@powerhousedao/connect 1.0.0-sky.184 → 1.0.0-sky.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/assets/{app-xkQmjDch.js → app-CEjUVP0-.js} +6 -6
  2. package/dist/assets/{app-xkQmjDch.js.map → app-CEjUVP0-.js.map} +1 -1
  3. package/dist/assets/{app-loader-BBe4M2Ml.js → app-loader-BNyCiyDz.js} +3 -3
  4. package/dist/assets/{app-loader-BBe4M2Ml.js.map → app-loader-BNyCiyDz.js.map} +1 -1
  5. package/dist/assets/{browser-CEARsm5L.js → browser-CPcl7U5g.js} +4 -4
  6. package/dist/assets/{browser-CEARsm5L.js.map → browser-CPcl7U5g.js.map} +1 -1
  7. package/dist/assets/{ccip-DA9iGsQE.js → ccip-C6tafvYY.js} +2 -2
  8. package/dist/assets/{ccip-DA9iGsQE.js.map → ccip-C6tafvYY.js.map} +1 -1
  9. package/dist/assets/content-C7DGe_qU.js +92 -0
  10. package/dist/assets/content-C7DGe_qU.js.map +1 -0
  11. package/dist/assets/{editor-Bi10PLX-.js → editor-60KSeLXl.js} +2 -2
  12. package/dist/assets/{editor-Bi10PLX-.js.map → editor-60KSeLXl.js.map} +1 -1
  13. package/dist/assets/{editor-Bs04MLzK.js → editor-B5mvOgOD.js} +2 -2
  14. package/dist/assets/{editor-Bs04MLzK.js.map → editor-B5mvOgOD.js.map} +1 -1
  15. package/dist/assets/{editor-CaH9gYrb.js → editor-C0aQEn9c.js} +2 -2
  16. package/dist/assets/{editor-CaH9gYrb.js.map → editor-C0aQEn9c.js.map} +1 -1
  17. package/dist/assets/{editor-BD8Wk4kt.js → editor-Dbz8kQvZ.js} +2 -2
  18. package/dist/assets/{editor-BD8Wk4kt.js.map → editor-Dbz8kQvZ.js.map} +1 -1
  19. package/dist/assets/{editors-BH6MLE1z.js → editors-CUAsvgKz.js} +5 -5
  20. package/dist/assets/{editors-BH6MLE1z.js.map → editors-CUAsvgKz.js.map} +1 -1
  21. package/dist/assets/{index-CMLoiw55.js → index-g4Q6-PRA.js} +2 -2
  22. package/dist/assets/{index-CMLoiw55.js.map → index-g4Q6-PRA.js.map} +1 -1
  23. package/dist/assets/{index-D_kQ8OEz.js → index-h9lOUGxV.js} +3 -3
  24. package/dist/assets/{index-D_kQ8OEz.js.map → index-h9lOUGxV.js.map} +1 -1
  25. package/dist/assets/{main.yZTQnvvE.js → main.AX2O67pt.js} +2 -2
  26. package/dist/assets/{main.yZTQnvvE.js.map → main.AX2O67pt.js.map} +1 -1
  27. package/dist/assets/{root-DIxTzlKD.js → root-C784bEPE.js} +2 -2
  28. package/dist/assets/{root-DIxTzlKD.js.map → root-C784bEPE.js.map} +1 -1
  29. package/dist/assets/{router-rzs8I7Wj.js → router-0g625aul.js} +4 -4
  30. package/dist/assets/{router-rzs8I7Wj.js.map → router-0g625aul.js.map} +1 -1
  31. package/dist/assets/{useUiNodes-DH62DyAC.js → useUiNodes-DYMt05zv.js} +2 -2
  32. package/dist/assets/{useUiNodes-DH62DyAC.js.map → useUiNodes-DYMt05zv.js.map} +1 -1
  33. package/dist/index.html +6 -6
  34. package/dist/service-worker.js +1 -1
  35. package/dist/swEnv.js +5 -5
  36. package/dist/vite-envs.sh +5 -5
  37. package/package.json +2 -2
  38. package/dist/assets/content-DAePlLHb.js +0 -92
  39. package/dist/assets/content-DAePlLHb.js.map +0 -1
  40. package/dist/icons.svg +0 -302
@@ -0,0 +1,92 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editors-CUAsvgKz.js","assets/main.AX2O67pt.js","assets/app-CEjUVP0-.js","assets/app-loader-BNyCiyDz.js","assets/app-loader-DoI5W0wZ.css"])))=>i.map(i=>d[i]);
2
+ import{jsx as w,jsxs as te,Fragment as Nt}from"react/jsx-runtime";import{DefaultEditorLoader as Jm,FILE as Ds,DocumentToolbar as _m,RevisionHistory as Zm,FileItem as Xm,useDrop as eg,FOLDER as tg,FolderItem as ng,Footer as rg,FooterLink as $s,Icon as Gn,ConnectSearchBar as og,useUiNodesContext as sg,DRIVE as ig,Breadcrumbs as ag}from"@powerhousedao/design-system";import*as b from"react";import re,{useState as ze,useRef as nr,useCallback as Ce,useContext as Ua,useLayoutEffect as kd,useEffect as Ue,createContext as za,forwardRef as je,useImperativeHandle as lg,createElement as $r,useMemo as ts,Fragment as cg,useSyncExternalStore as ug,Suspense as dg}from"react";import{x as Id,y as tn,U as fg,z as hg,V as pg,A as mg,B as Od,j as Nd,C as ja,F as gg,G as yg,H as bg,I as vg,J as wg,K as Ag,L as xg,M as Cg,N as Eg,P as Sg,Q as lc,S as Pg,k as Ts,t as Dd,T as Mg,W as Js,a as kg,u as Ig,X as Og,Y as _s,r as Ng,Z as cc}from"./app-CEjUVP0-.js";import{_ as uc}from"./main.AX2O67pt.js";import*as Td from"react-dom";import Dg,{flushSync as Tg}from"react-dom";import{o as Rg,u as dc}from"./useUiNodes-DYMt05zv.js";import"./app-loader-BNyCiyDz.js";const fc=(e,t)=>e.name.localeCompare(t.name);function Fg(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=Rd(t))&&(r&&(r+=" "),r+=n);return r}function Rd(e){if(typeof e=="string")return e;for(var t,n="",r=0;r<e.length;r++)e[r]&&(t=Rd(e[r]))&&(n&&(n+=" "),n+=t);return n}var Qa="-";function Bg(e){var t=Ug(e),n=e.conflictingClassGroups,r=e.conflictingClassGroupModifiers,o=r===void 0?{}:r;function s(a){var l=a.split(Qa);return l[0]===""&&l.length!==1&&l.shift(),Fd(l,t)||Lg(a)}function i(a,l){var u=n[a]||[];return l&&o[a]?[].concat(u,o[a]):u}return{getClassGroupId:s,getConflictingClassGroupIds:i}}function Fd(e,t){var i;if(e.length===0)return t.classGroupId;var n=e[0],r=t.nextPart.get(n),o=r?Fd(e.slice(1),r):void 0;if(o)return o;if(t.validators.length!==0){var s=e.join(Qa);return(i=t.validators.find(function(a){var l=a.validator;return l(s)}))==null?void 0:i.classGroupId}}var hc=/^\[(.+)\]$/;function Lg(e){if(hc.test(e)){var t=hc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function Ug(e){var t=e.theme,n=e.prefix,r={nextPart:new Map,validators:[]},o=jg(Object.entries(e.classGroups),n);return o.forEach(function(s){var i=s[0],a=s[1];Vi(a,r,i,t)}),r}function Vi(e,t,n,r){e.forEach(function(o){if(typeof o=="string"){var s=o===""?t:pc(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(zg(o)){Vi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(function(i){var a=i[0],l=i[1];Vi(l,pc(t,a),n,r)})})}function pc(e,t){var n=e;return t.split(Qa).forEach(function(r){n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function zg(e){return e.isThemeGetter}function jg(e,t){return t?e.map(function(n){var r=n[0],o=n[1],s=o.map(function(i){return typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(function(a){var l=a[0],u=a[1];return[t+l,u]})):i});return[r,s]}):e}function Qg(e){if(e<1)return{get:function(){},set:function(){}};var t=0,n=new Map,r=new Map;function o(s,i){n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get:function(i){var a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set:function(i,a){n.has(i)?n.set(i,a):o(i,a)}}}var Bd="!";function Wg(e){var t=e.separator||":",n=t.length===1,r=t[0],o=t.length;return function(i){for(var a=[],l=0,u=0,c,d=0;d<i.length;d++){var h=i[d];if(l===0){if(h===r&&(n||i.slice(d,d+o)===t)){a.push(i.slice(u,d)),u=d+o;continue}if(h==="/"){c=d;continue}}h==="["?l++:h==="]"&&l--}var f=a.length===0?i:i.substring(u),m=f.startsWith(Bd),p=m?f.substring(1):f,g=c&&c>u?c-u:void 0;return{modifiers:a,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:g}}}function Hg(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var o=r[0]==="[";o?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function Vg(e){return{cache:Qg(e.cacheSize),splitModifiers:Wg(e),...Bg(e)}}var Gg=/\s+/;function qg(e,t){var n=t.splitModifiers,r=t.getClassGroupId,o=t.getConflictingClassGroupIds,s=new Set;return e.trim().split(Gg).map(function(i){var a=n(i),l=a.modifiers,u=a.hasImportantModifier,c=a.baseClassName,d=a.maybePostfixModifierPosition,h=r(d?c.substring(0,d):c),f=!!d;if(!h){if(!d)return{isTailwindClass:!1,originalClassName:i};if(h=r(c),!h)return{isTailwindClass:!1,originalClassName:i};f=!1}var m=Hg(l).join(":"),p=u?m+Bd:m;return{isTailwindClass:!0,modifierId:p,classGroupId:h,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(function(i){if(!i.isTailwindClass)return!0;var a=i.modifierId,l=i.classGroupId,u=i.hasPostfixModifier,c=a+l;return s.has(c)?!1:(s.add(c),o(l,u).forEach(function(d){return s.add(a+d)}),!0)}).reverse().map(function(i){return i.originalClassName}).join(" ")}function Kg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o,s,i=a;function a(u){var c=t[0],d=t.slice(1),h=d.reduce(function(f,m){return m(f)},c());return r=Vg(h),o=r.cache.get,s=r.cache.set,i=l,l(u)}function l(u){var c=o(u);if(c)return c;var d=qg(u,r);return s(u,d),d}return function(){return i(Fg.apply(null,arguments))}}function pe(e){var t=function(r){return r[e]||[]};return t.isThemeGetter=!0,t}var Ld=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yg=/^\d+\/\d+$/,$g=new Set(["px","full","screen"]),Jg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_g=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Zg=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function Xe(e){return pn(e)||$g.has(e)||Yg.test(e)||Gi(e)}function Gi(e){return In(e,"length",oy)}function Xg(e){return In(e,"size",Ud)}function ey(e){return In(e,"position",Ud)}function ty(e){return In(e,"url",sy)}function Ro(e){return In(e,"number",pn)}function pn(e){return!Number.isNaN(Number(e))}function ny(e){return e.endsWith("%")&&pn(e.slice(0,-1))}function gr(e){return mc(e)||In(e,"number",mc)}function ie(e){return Ld.test(e)}function yr(){return!0}function Ft(e){return Jg.test(e)}function ry(e){return In(e,"",iy)}function In(e,t,n){var r=Ld.exec(e);return r?r[1]?r[1]===t:n(r[2]):!1}function oy(e){return _g.test(e)}function Ud(){return!1}function sy(e){return e.startsWith("url(")}function mc(e){return Number.isInteger(Number(e))}function iy(e){return Zg.test(e)}function ay(){var e=pe("colors"),t=pe("spacing"),n=pe("blur"),r=pe("brightness"),o=pe("borderColor"),s=pe("borderRadius"),i=pe("borderSpacing"),a=pe("borderWidth"),l=pe("contrast"),u=pe("grayscale"),c=pe("hueRotate"),d=pe("invert"),h=pe("gap"),f=pe("gradientColorStops"),m=pe("gradientColorStopPositions"),p=pe("inset"),g=pe("margin"),A=pe("opacity"),v=pe("padding"),S=pe("saturate"),M=pe("scale"),y=pe("sepia"),x=pe("skew"),E=pe("space"),D=pe("translate"),I=function(){return["auto","contain","none"]},R=function(){return["auto","hidden","clip","visible","scroll"]},V=function(){return["auto",ie,t]},O=function(){return[ie,t]},B=function(){return["",Xe]},z=function(){return["auto",pn,ie]},Y=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},W=function(){return["solid","dashed","dotted","double","none"]},$=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},K=function(){return["start","end","center","between","around","evenly","stretch"]},Z=function(){return["","0",ie]},ae=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},de=function(){return[pn,Ro]},T=function(){return[pn,ie]};return{cacheSize:500,theme:{colors:[yr],spacing:[Xe],blur:["none","",Ft,ie],brightness:de(),borderColor:[e],borderRadius:["none","","full",Ft,ie],borderSpacing:O(),borderWidth:B(),contrast:de(),grayscale:Z(),hueRotate:T(),invert:Z(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[ny,Gi],inset:V(),margin:V(),opacity:de(),padding:O(),saturate:de(),scale:de(),sepia:Z(),skew:T(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",ie]}],container:["container"],columns:[{columns:[Ft]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(Y(),[ie])}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gr]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ie]}],grow:[{grow:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",gr]}],"grid-cols":[{"grid-cols":[yr]}],"col-start-end":[{col:["auto",{span:["full",gr]},ie]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[yr]}],"row-start-end":[{row:["auto",{span:[gr]},ie]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ie]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal"].concat(K())}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(K(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(K(),["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",ie,t]}],"min-w":[{"min-w":["min","max","fit",ie,Xe]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Ft]},Ft,ie]}],h:[{h:[ie,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",ie,Xe]}],"max-h":[{"max-h":[ie,t,"min","max","fit"]}],"font-size":[{text:["base",Ft,Gi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ro]}],"font-family":[{font:[yr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ie]}],"line-clamp":[{"line-clamp":["none",pn,Ro]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ie,Xe]}],"list-image":[{"list-image":["none",ie]}],"list-style-type":[{list:["none","disc","decimal",ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(W(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",Xe]}],"underline-offset":[{"underline-offset":["auto",ie,Xe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(Y(),[ey])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ty]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[].concat(W(),["hidden"])}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"divide-style":[{divide:W()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:[""].concat(W())}],"outline-offset":[{"outline-offset":[ie,Xe]}],"outline-w":[{outline:[Xe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[Xe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ft,ry]}],"shadow-color":[{shadow:[yr]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":$()}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ft,ie]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[S]}],sepia:[{sepia:[y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ie]}],duration:[{duration:T()}],ease:[{ease:["linear","in","out","in-out",ie]}],delay:[{delay:T()}],animate:[{animate:["none","spin","ping","pulse","bounce",ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[gr,ie]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ie]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ie]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Xe,Ro]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}var qi=Kg(ay);const Hr=({className:e,...t})=>w("button",{className:qi("rounded-md bg-gray-500/20 px-4 py-1.5 text-gray-500 shadow-button hover:bg-slate-100 hover:shadow-none",e),...t});function Ki(){return Ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ki.apply(null,arguments)}var zd=["shift","alt","meta","mod","ctrl"],ly={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Wt(e){return(e&&ly[e]||e||"").trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function cy(e){return zd.includes(e)}function Zs(e,t){return t===void 0&&(t=","),e.split(t)}function Xs(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(i){return Wt(i)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},s=r.filter(function(i){return!zd.includes(i)});return Ki({},o,{keys:s,description:n,hotkey:e})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&jd([Wt(e.key),Wt(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&Qd([Wt(e.key),Wt(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Ht.clear()})})();var Ht=new Set;function Wa(e){return Array.isArray(e)}function uy(e,t){t===void 0&&(t=",");var n=Wa(e)?e:e.split(t);return n.every(function(r){return Ht.has(r.trim().toLowerCase())})}function jd(e){var t=Array.isArray(e)?e:[e];Ht.has("meta")&&Ht.forEach(function(n){return!cy(n)&&Ht.delete(n.toLowerCase())}),t.forEach(function(n){return Ht.add(n.toLowerCase())})}function Qd(e){var t=Array.isArray(e)?e:[e];e==="meta"?Ht.clear():t.forEach(function(n){return Ht.delete(n.toLowerCase())})}function dy(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function fy(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function hy(e){return Wd(e,["input","textarea","select"])}function Wd(e,t){t===void 0&&(t=!1);var n=e.target,r=e.composed,o=null;return py(n)&&r?o=e.composedPath()[0]&&e.composedPath()[0].tagName:o=n&&n.tagName,Wa(t)?!!(o&&t&&t.some(function(s){var i;return s.toLowerCase()===((i=o)==null?void 0:i.toLowerCase())})):!!(o&&t&&t)}function py(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function my(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var gy=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,i=n.mod,a=n.shift,l=n.ctrl,u=n.keys,c=t.key,d=t.code,h=t.ctrlKey,f=t.metaKey,m=t.shiftKey,p=t.altKey,g=Wt(d),A=c.toLowerCase();if(!(u!=null&&u.includes(g))&&!(u!=null&&u.includes(A))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(g))return!1;if(!r){if(o===!p&&A!=="alt"||a===!m&&A!=="shift")return!1;if(i){if(!f&&!h)return!1}else if(s===!f&&A!=="meta"&&A!=="os"||l===!h&&A!=="ctrl"&&A!=="control")return!1}return u&&u.length===1&&(u.includes(A)||u.includes(g))?!0:u?uy(u):!u},yy=za(void 0),by=function(){return Ua(yy)};function Hd(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&Hd(e[r],t[r])},!0):e===t}var vy=za({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),wy=function(){return Ua(vy)};function Ay(e){var t=nr(void 0);return Hd(t.current,e)||(t.current=e),t.current}var gc=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},xy=typeof window<"u"?kd:Ue;function yc(e,t,n,r){var o=ze(null),s=o[0],i=o[1],a=nr(!1),l=n instanceof Array?r instanceof Array?void 0:r:n,u=Wa(e)?e.join(l==null?void 0:l.splitKey):e,c=n instanceof Array?n:r instanceof Array?r:void 0,d=Ce(t,c??[]),h=nr(d);c?h.current=d:h.current=t;var f=Ay(l),m=wy(),p=m.enabledScopes,g=by();return xy(function(){if(!((f==null?void 0:f.enabled)===!1||!my(p,f==null?void 0:f.scopes))){var A=function(x,E){var D;if(E===void 0&&(E=!1),!(hy(x)&&!Wd(x,f==null?void 0:f.enableOnFormTags))){if(s!==null){var I=s.getRootNode();if((I instanceof Document||I instanceof ShadowRoot)&&I.activeElement!==s&&!s.contains(I.activeElement)){gc(x);return}}(D=x.target)!=null&&D.isContentEditable&&!(f!=null&&f.enableOnContentEditable)||Zs(u,f==null?void 0:f.splitKey).forEach(function(R){var V,O=Xs(R,f==null?void 0:f.combinationKey);if(gy(x,O,f==null?void 0:f.ignoreModifiers)||(V=O.keys)!=null&&V.includes("*")){if(f!=null&&f.ignoreEventWhen!=null&&f.ignoreEventWhen(x)||E&&a.current)return;if(dy(x,O,f==null?void 0:f.preventDefault),!fy(x,O,f==null?void 0:f.enabled)){gc(x);return}h.current(x,O),E||(a.current=!0)}})}},v=function(x){x.key!==void 0&&(jd(Wt(x.code)),((f==null?void 0:f.keydown)===void 0&&(f==null?void 0:f.keyup)!==!0||f!=null&&f.keydown)&&A(x))},S=function(x){x.key!==void 0&&(Qd(Wt(x.code)),a.current=!1,f!=null&&f.keyup&&A(x,!0))},M=s||(l==null?void 0:l.document)||document;return M.addEventListener("keyup",S),M.addEventListener("keydown",v),g&&Zs(u,f==null?void 0:f.splitKey).forEach(function(y){return g.addHotkey(Xs(y,f==null?void 0:f.combinationKey,f==null?void 0:f.description))}),function(){M.removeEventListener("keyup",S),M.removeEventListener("keydown",v),g&&Zs(u,f==null?void 0:f.splitKey).forEach(function(y){return g.removeHotkey(Xs(y,f==null?void 0:f.combinationKey,f==null?void 0:f.description))})}}},[s,u,f,p]),i}const Cy=e=>{var l;const{undo:t,redo:n,canRedo:r,canUndo:o}=e,{isMac:s}=((l=window.electronAPI)==null?void 0:l.platformInfo)||{};let i="ctrl+z",a="ctrl+y";s&&(i="mod+z",a="mod+shift+z"),yc(i,u=>{u.preventDefault(),o&&t()},{},[o,t]),yc(a,u=>{u.preventDefault(),r&&n()},{},[r,n])};var Vd=e=>{throw TypeError(e)},Ha=(e,t,n)=>t.has(e)||Vd("Cannot "+n),P=(e,t,n)=>(Ha(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>t.has(e)?Vd("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),G=(e,t,n,r)=>(Ha(e,t,"write to private field"),t.set(e,n),n),ce=(e,t,n)=>(Ha(e,t,"access private method"),n),Yi=(e,t,n,r)=>({set _(o){G(e,t,o)},get _(){return P(e,t,r)}});const Va="-",Ey=e=>{const t=Py(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const s=o.split(Va);return s[0]===""&&s.length!==1&&s.shift(),Gd(s,t)||Sy(o)},getConflictingClassGroupIds:(o,s)=>{const i=n[o]||[];return s&&r[o]?[...i,...r[o]]:i}}},Gd=(e,t)=>{var n;if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),s=o?Gd(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Va);return(n=t.validators.find(({validator:a})=>a(i)))==null?void 0:n.classGroupId},bc=/^\[(.+)\]$/,Sy=e=>{if(bc.test(e)){const t=bc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Py=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ky(Object.entries(e.classGroups),n).forEach(([o,s])=>{$i(s,r,o,t)}),r},$i=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:vc(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(My(o)){$i(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{$i(i,vc(t,s),n,r)})})},vc=(e,t)=>{let n=e;return t.split(Va).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},My=e=>e.isThemeGetter,ky=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,Iy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},qd="!",Oy=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let u=0,c=0,d;for(let g=0;g<a.length;g++){let A=a[g];if(u===0){if(A===o&&(r||a.slice(g,g+s)===t)){l.push(a.slice(c,g)),c=g+s;continue}if(A==="/"){d=g;continue}}A==="["?u++:A==="]"&&u--}const h=l.length===0?a:a.substring(c),f=h.startsWith(qd),m=f?h.substring(1):h,p=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:i}):i},Ny=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Dy=e=>({cache:Iy(e.cacheSize),parseClassName:Oy(e),...Ey(e)}),Ty=/\s+/,Ry=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Ty);let a="";for(let l=i.length-1;l>=0;l-=1){const u=i[l],{modifiers:c,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=n(u);let m=!!f,p=r(m?h.substring(0,f):h);if(!p){if(!m){a=u+(a.length>0?" "+a:a);continue}if(p=r(h),!p){a=u+(a.length>0?" "+a:a);continue}m=!1}const g=Ny(c).join(":"),A=d?g+qd:g,v=A+p;if(s.includes(v))continue;s.push(v);const S=o(p,m);for(let M=0;M<S.length;++M){const y=S[M];s.push(A+y)}a=u+(a.length>0?" "+a:a)}return a};function Fy(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Kd(t))&&(r&&(r+=" "),r+=n);return r}const Kd=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Kd(e[r]))&&(n&&(n+=" "),n+=t);return n};function By(e,...t){let n,r,o,s=i;function i(l){const u=t.reduce((c,d)=>d(c),e());return n=Dy(u),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=Ry(l,n);return o(l,c),c}return function(){return s(Fy.apply(null,arguments))}}const me=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Yd=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ly=/^\d+\/\d+$/,Uy=new Set(["px","full","screen"]),zy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jy=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wt=e=>Jn(e)||Uy.has(e)||Ly.test(e),Bt=e=>ur(e,"length",_y),Jn=e=>!!e&&!Number.isNaN(Number(e)),ei=e=>ur(e,"number",Jn),br=e=>!!e&&Number.isInteger(Number(e)),Vy=e=>e.endsWith("%")&&Jn(e.slice(0,-1)),ne=e=>Yd.test(e),Lt=e=>zy.test(e),Gy=new Set(["length","size","percentage"]),qy=e=>ur(e,Gy,$d),Ky=e=>ur(e,"position",$d),Yy=new Set(["image","url"]),$y=e=>ur(e,Yy,Xy),Jy=e=>ur(e,"",Zy),vr=()=>!0,ur=(e,t,n)=>{const r=Yd.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},_y=e=>jy.test(e)&&!Qy.test(e),$d=()=>!1,Zy=e=>Wy.test(e),Xy=e=>Hy.test(e),eb=()=>{const e=me("colors"),t=me("spacing"),n=me("blur"),r=me("brightness"),o=me("borderColor"),s=me("borderRadius"),i=me("borderSpacing"),a=me("borderWidth"),l=me("contrast"),u=me("grayscale"),c=me("hueRotate"),d=me("invert"),h=me("gap"),f=me("gradientColorStops"),m=me("gradientColorStopPositions"),p=me("inset"),g=me("margin"),A=me("opacity"),v=me("padding"),S=me("saturate"),M=me("scale"),y=me("sepia"),x=me("skew"),E=me("space"),D=me("translate"),I=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",ne,t],O=()=>[ne,t],B=()=>["",wt,Bt],z=()=>["auto",Jn,ne],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],Z=()=>["","0",ne],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],de=()=>[Jn,ne];return{cacheSize:500,separator:":",theme:{colors:[vr],spacing:[wt,Bt],blur:["none","",Lt,ne],brightness:de(),borderColor:[e],borderRadius:["none","","full",Lt,ne],borderSpacing:O(),borderWidth:B(),contrast:de(),grayscale:Z(),hueRotate:de(),invert:Z(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[Vy,Bt],inset:V(),margin:V(),opacity:de(),padding:O(),saturate:de(),scale:de(),sepia:Z(),skew:de(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[Lt]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),ne]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",br,ne]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",br,ne]}],"grid-cols":[{"grid-cols":[vr]}],"col-start-end":[{col:["auto",{span:["full",br,ne]},ne]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[vr]}],"row-start-end":[{row:["auto",{span:[br,ne]},ne]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[Lt]},Lt]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Lt,Bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ei]}],"font-family":[{font:[vr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",Jn,ei]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",wt,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",wt,Bt]}],"underline-offset":[{"underline-offset":["auto",wt,ne]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),Ky]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",qy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$y]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"divide-style":[{divide:W()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[wt,ne]}],"outline-w":[{outline:[wt,Bt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[wt,Bt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Lt,Jy]}],"shadow-color":[{shadow:[vr]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Lt,ne]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[S]}],sepia:[{sepia:[y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:de()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:de()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[br,ne]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[wt,Bt,ei]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Jd=By(eb);var Fo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ti,wc;function nb(){if(wc)return ti;wc=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,l=typeof Fo=="object"&&Fo&&Fo.Object===Object&&Fo,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),d=Object.prototype,h=d.toString,f=Math.max,m=Math.min,p=function(){return c.Date.now()};function g(y,x,E){var D,I,R,V,O,B,z=0,Y=!1,W=!1,$=!0;if(typeof y!="function")throw new TypeError(e);x=M(x)||0,A(E)&&(Y=!!E.leading,W="maxWait"in E,R=W?f(M(E.maxWait)||0,x):R,$="trailing"in E?!!E.trailing:$);function K(J){var fe=D,we=I;return D=I=void 0,z=J,V=y.apply(we,fe),V}function Z(J){return z=J,O=setTimeout(T,x),Y?K(J):V}function ae(J){var fe=J-B,we=J-z,Ze=x-fe;return W?m(Ze,R-we):Ze}function de(J){var fe=J-B,we=J-z;return B===void 0||fe>=x||fe<0||W&&we>=R}function T(){var J=p();if(de(J))return H(J);O=setTimeout(T,ae(J))}function H(J){return O=void 0,$&&D?K(J):(D=I=void 0,V)}function X(){O!==void 0&&clearTimeout(O),z=0,D=B=I=O=void 0}function q(){return O===void 0?V:H(p())}function se(){var J=p(),fe=de(J);if(D=arguments,I=this,B=J,fe){if(O===void 0)return Z(B);if(W)return O=setTimeout(T,x),K(B)}return O===void 0&&(O=setTimeout(T,x)),V}return se.cancel=X,se.flush=q,se}function A(y){var x=typeof y;return!!y&&(x=="object"||x=="function")}function v(y){return!!y&&typeof y=="object"}function S(y){return typeof y=="symbol"||v(y)&&h.call(y)==n}function M(y){if(typeof y=="number")return y;if(S(y))return t;if(A(y)){var x=typeof y.valueOf=="function"?y.valueOf():y;y=A(x)?x+"":x}if(typeof y!="string")return y===0?y:+y;y=y.replace(r,"");var E=s.test(y);return E||i.test(y)?a(y.slice(2),E?2:8):o.test(y)?t:+y}return ti=g,ti}nb();function rb(){const[e,t]=ze(null),n=Ce(async r=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(r),t(r),!0}catch(o){return console.warn("Copy failed",o),t(null),!1}},[]);return[e,n]}const ob=["top","right","bottom","left"],qt=Math.min,Ge=Math.max,cs=Math.round,Bo=Math.floor,ht=e=>({x:e,y:e}),sb={left:"right",right:"left",bottom:"top",top:"bottom"},ib={start:"end",end:"start"};function Ji(e,t,n){return Ge(e,qt(t,n))}function Dt(e,t){return typeof e=="function"?e(t):e}function Tt(e){return e.split("-")[0]}function dr(e){return e.split("-")[1]}function Ga(e){return e==="x"?"y":"x"}function qa(e){return e==="y"?"height":"width"}function Kt(e){return["top","bottom"].includes(Tt(e))?"y":"x"}function Ka(e){return Ga(Kt(e))}function ab(e,t,n){n===void 0&&(n=!1);const r=dr(e),o=Ka(e),s=qa(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=us(i)),[i,us(i)]}function lb(e){const t=us(e);return[_i(e),t,_i(t)]}function _i(e){return e.replace(/start|end/g,t=>ib[t])}function cb(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function ub(e,t,n,r){const o=dr(e);let s=cb(Tt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(_i)))),s}function us(e){return e.replace(/left|right|bottom|top/g,t=>sb[t])}function db(e){return{top:0,right:0,bottom:0,left:0,...e}}function _d(e){return typeof e!="number"?db(e):{top:e,right:e,bottom:e,left:e}}function ds(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ac(e,t,n){let{reference:r,floating:o}=e;const s=Kt(t),i=Ka(t),a=qa(i),l=Tt(t),u=s==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:c,y:r.y-o.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(dr(t)){case"start":f[i]-=h*(n&&u?-1:1);break;case"end":f[i]+=h*(n&&u?-1:1);break}return f}const fb=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Ac(u,r,l),h=r,f={},m=0;for(let p=0;p<a.length;p++){const{name:g,fn:A}=a[p],{x:v,y:S,data:M,reset:y}=await A({x:c,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:u,platform:i,elements:{reference:e,floating:t}});c=v??c,d=S??d,f={...f,[g]:{...f[g],...M}},y&&m<=50&&(m++,typeof y=="object"&&(y.placement&&(h=y.placement),y.rects&&(u=y.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),{x:c,y:d}=Ac(u,h,l)),p=-1)}return{x:c,y:d,placement:h,strategy:o,middlewareData:f}};async function Jr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=Dt(t,e),m=_d(f),p=a[h?d==="floating"?"reference":"floating":d],g=ds(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),A=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},M=ds(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:v,strategy:l}):A);return{top:(g.top-M.top+m.top)/S.y,bottom:(M.bottom-g.bottom+m.bottom)/S.y,left:(g.left-M.left+m.left)/S.x,right:(M.right-g.right+m.right)/S.x}}const hb=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=Dt(e,t)||{};if(u==null)return{};const d=_d(c),h={x:n,y:r},f=Ka(o),m=qa(f),p=await i.getDimensions(u),g=f==="y",A=g?"top":"left",v=g?"bottom":"right",S=g?"clientHeight":"clientWidth",M=s.reference[m]+s.reference[f]-h[f]-s.floating[m],y=h[f]-s.reference[f],x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let E=x?x[S]:0;(!E||!await(i.isElement==null?void 0:i.isElement(x)))&&(E=a.floating[S]||s.floating[m]);const D=M/2-y/2,I=E/2-p[m]/2-1,R=qt(d[A],I),V=qt(d[v],I),O=R,B=E-p[m]-V,z=E/2-p[m]/2+D,Y=Ji(O,z,B),W=!l.arrow&&dr(o)!=null&&z!==Y&&s.reference[m]/2-(z<O?R:V)-p[m]/2<0,$=W?z<O?z-O:z-B:0;return{[f]:h[f]+$,data:{[f]:Y,centerOffset:z-Y-$,...W&&{alignmentOffset:$}},reset:W}}}),pb=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=Dt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const A=Tt(o),v=Kt(a),S=Tt(a)===a,M=await(l.isRTL==null?void 0:l.isRTL(u.floating)),y=h||(S||!p?[us(a)]:lb(a)),x=m!=="none";!h&&x&&y.push(...ub(a,p,m,M));const E=[a,...y],D=await Jr(t,g),I=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&I.push(D[A]),d){const z=ab(o,i,M);I.push(D[z[0]],D[z[1]])}if(R=[...R,{placement:o,overflows:I}],!I.every(z=>z<=0)){var V,O;const z=(((V=s.flip)==null?void 0:V.index)||0)+1,Y=E[z];if(Y)return{data:{index:z,overflows:R},reset:{placement:Y}};let W=(O=R.filter($=>$.overflows[0]<=0).sort(($,K)=>$.overflows[1]-K.overflows[1])[0])==null?void 0:O.placement;if(!W)switch(f){case"bestFit":{var B;const $=(B=R.filter(K=>{if(x){const Z=Kt(K.placement);return Z===v||Z==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(Z=>Z>0).reduce((Z,ae)=>Z+ae,0)]).sort((K,Z)=>K[1]-Z[1])[0])==null?void 0:B[0];$&&(W=$);break}case"initialPlacement":W=a;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function xc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Cc(e){return ob.some(t=>e[t]>=0)}const mb=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Dt(e,t);switch(r){case"referenceHidden":{const s=await Jr(t,{...o,elementContext:"reference"}),i=xc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Cc(i)}}}case"escaped":{const s=await Jr(t,{...o,altBoundary:!0}),i=xc(s,n.floating);return{data:{escapedOffsets:i,escaped:Cc(i)}}}default:return{}}}}};async function gb(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Tt(n),a=dr(n),l=Kt(n)==="y",u=["left","top"].includes(i)?-1:1,c=s&&l?-1:1,d=Dt(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(f=a==="end"?m*-1:m),l?{x:f*c,y:h*u}:{x:h*u,y:f*c}}const yb=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await gb(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},bb=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:g=>{let{x:A,y:v}=g;return{x:A,y:v}}},...l}=Dt(e,t),u={x:n,y:r},c=await Jr(t,l),d=Kt(Tt(o)),h=Ga(d);let f=u[h],m=u[d];if(s){const g=h==="y"?"top":"left",A=h==="y"?"bottom":"right",v=f+c[g],S=f-c[A];f=Ji(v,f,S)}if(i){const g=d==="y"?"top":"left",A=d==="y"?"bottom":"right",v=m+c[g],S=m-c[A];m=Ji(v,m,S)}const p=a.fn({...t,[h]:f,[d]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:s,[d]:i}}}}}},vb=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Dt(e,t),c={x:n,y:r},d=Kt(o),h=Ga(d);let f=c[h],m=c[d];const p=Dt(a,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const S=h==="y"?"height":"width",M=s.reference[h]-s.floating[S]+g.mainAxis,y=s.reference[h]+s.reference[S]-g.mainAxis;f<M?f=M:f>y&&(f=y)}if(u){var A,v;const S=h==="y"?"width":"height",M=["top","left"].includes(Tt(o)),y=s.reference[d]-s.floating[S]+(M&&((A=i.offset)==null?void 0:A[d])||0)+(M?0:g.crossAxis),x=s.reference[d]+s.reference[S]+(M?0:((v=i.offset)==null?void 0:v[d])||0)-(M?g.crossAxis:0);m<y?m=y:m>x&&(m=x)}return{[h]:f,[d]:m}}}},wb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...u}=Dt(e,t),c=await Jr(t,u),d=Tt(o),h=dr(o),f=Kt(o)==="y",{width:m,height:p}=s.floating;let g,A;d==="top"||d==="bottom"?(g=d,A=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(A=d,g=h==="end"?"top":"bottom");const v=p-c.top-c.bottom,S=m-c.left-c.right,M=qt(p-c[g],v),y=qt(m-c[A],S),x=!t.middlewareData.shift;let E=M,D=y;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=v),x&&!h){const R=Ge(c.left,0),V=Ge(c.right,0),O=Ge(c.top,0),B=Ge(c.bottom,0);f?D=m-2*(R!==0||V!==0?R+V:Ge(c.left,c.right)):E=p-2*(O!==0||B!==0?O+B:Ge(c.top,c.bottom))}await l({...t,availableWidth:D,availableHeight:E});const I=await i.getDimensions(a.floating);return m!==I.width||p!==I.height?{reset:{rects:!0}}:{}}}};function Rs(){return typeof window<"u"}function fr(e){return Zd(e)?(e.nodeName||"").toLowerCase():"#document"}function qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bt(e){var t;return(t=(Zd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zd(e){return Rs()?e instanceof Node||e instanceof qe(e).Node:!1}function ot(e){return Rs()?e instanceof Element||e instanceof qe(e).Element:!1}function gt(e){return Rs()?e instanceof HTMLElement||e instanceof qe(e).HTMLElement:!1}function Ec(e){return!Rs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qe(e).ShadowRoot}function Eo(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=st(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ab(e){return["table","td","th"].includes(fr(e))}function Fs(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ya(e){const t=$a(),n=ot(e)?st(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function xb(e){let t=Yt(e);for(;gt(t)&&!rr(t);){if(Ya(t))return t;if(Fs(t))return null;t=Yt(t)}return null}function $a(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function rr(e){return["html","body","#document"].includes(fr(e))}function st(e){return qe(e).getComputedStyle(e)}function Bs(e){return ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yt(e){if(fr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ec(e)&&e.host||bt(e);return Ec(t)?t.host:t}function Xd(e){const t=Yt(e);return rr(t)?e.ownerDocument?e.ownerDocument.body:e.body:gt(t)&&Eo(t)?t:Xd(t)}function _r(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Xd(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=qe(o);if(s){const a=Zi(i);return t.concat(i,i.visualViewport||[],Eo(o)?o:[],a&&n?_r(a):[])}return t.concat(o,_r(o,[],n))}function Zi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ef(e){const t=st(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=gt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=cs(n)!==s||cs(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ja(e){return ot(e)?e:e.contextElement}function _n(e){const t=Ja(e);if(!gt(t))return ht(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=ef(t);let i=(s?cs(n.width):n.width)/r,a=(s?cs(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Cb=ht(0);function tf(e){const t=qe(e);return!$a()||!t.visualViewport?Cb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Eb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qe(e)?!1:t}function wn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ja(e);let i=ht(1);t&&(r?ot(r)&&(i=_n(r)):i=_n(e));const a=Eb(s,n,r)?tf(s):ht(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,c=o.width/i.x,d=o.height/i.y;if(s){const h=qe(s),f=r&&ot(r)?qe(r):r;let m=h,p=Zi(m);for(;p&&r&&f!==m;){const g=_n(p),A=p.getBoundingClientRect(),v=st(p),S=A.left+(p.clientLeft+parseFloat(v.paddingLeft))*g.x,M=A.top+(p.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,d*=g.y,l+=S,u+=M,m=qe(p),p=Zi(m)}}return ds({width:c,height:d,x:l,y:u})}function _a(e,t){const n=Bs(e).scrollLeft;return t?t.left+n:wn(bt(e)).left+n}function nf(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:_a(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Sb(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=bt(r),a=t?Fs(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ht(1);const c=ht(0),d=gt(r);if((d||!d&&!s)&&((fr(r)!=="body"||Eo(i))&&(l=Bs(r)),gt(r))){const f=wn(r);u=_n(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}const h=i&&!d&&!s?nf(i,l,!0):ht(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function Pb(e){return Array.from(e.getClientRects())}function Mb(e){const t=bt(e),n=Bs(e),r=e.ownerDocument.body,o=Ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+_a(e);const a=-n.scrollTop;return st(r).direction==="rtl"&&(i+=Ge(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function kb(e,t){const n=qe(e),r=bt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const u=$a();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function Ib(e,t){const n=wn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=gt(e)?_n(e):ht(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function Sc(e,t,n){let r;if(t==="viewport")r=kb(e,n);else if(t==="document")r=Mb(bt(e));else if(ot(t))r=Ib(t,n);else{const o=tf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ds(r)}function rf(e,t){const n=Yt(e);return n===t||!ot(n)||rr(n)?!1:st(n).position==="fixed"||rf(n,t)}function Ob(e,t){const n=t.get(e);if(n)return n;let r=_r(e,[],!1).filter(a=>ot(a)&&fr(a)!=="body"),o=null;const s=st(e).position==="fixed";let i=s?Yt(e):e;for(;ot(i)&&!rr(i);){const a=st(i),l=Ya(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&o&&["absolute","fixed"].includes(o.position)||Eo(i)&&!l&&rf(e,i))?r=r.filter(u=>u!==i):o=a,i=Yt(i)}return t.set(e,r),r}function Nb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Fs(t)?[]:Ob(t,this._c):[].concat(n),r],i=s[0],a=s.reduce((l,u)=>{const c=Sc(t,u,o);return l.top=Ge(c.top,l.top),l.right=qt(c.right,l.right),l.bottom=qt(c.bottom,l.bottom),l.left=Ge(c.left,l.left),l},Sc(t,i,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Db(e){const{width:t,height:n}=ef(e);return{width:t,height:n}}function Tb(e,t,n){const r=gt(t),o=bt(t),s=n==="fixed",i=wn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ht(0);if(r||!r&&!s)if((fr(t)!=="body"||Eo(o))&&(a=Bs(t)),r){const h=wn(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&(l.x=_a(o));const u=o&&!r&&!s?nf(o,a):ht(0),c=i.left+a.scrollLeft-l.x-u.x,d=i.top+a.scrollTop-l.y-u.y;return{x:c,y:d,width:i.width,height:i.height}}function ni(e){return st(e).position==="static"}function Pc(e,t){if(!gt(e)||st(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bt(e)===n&&(n=n.ownerDocument.body),n}function of(e,t){const n=qe(e);if(Fs(e))return n;if(!gt(e)){let o=Yt(e);for(;o&&!rr(o);){if(ot(o)&&!ni(o))return o;o=Yt(o)}return n}let r=Pc(e,t);for(;r&&Ab(r)&&ni(r);)r=Pc(r,t);return r&&rr(r)&&ni(r)&&!Ya(r)?n:r||xb(e)||n}const Rb=async function(e){const t=this.getOffsetParent||of,n=this.getDimensions,r=await n(e.floating);return{reference:Tb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fb(e){return st(e).direction==="rtl"}const Bb={convertOffsetParentRelativeRectToViewportRelativeRect:Sb,getDocumentElement:bt,getClippingRect:Nb,getOffsetParent:of,getElementRects:Rb,getClientRects:Pb,getDimensions:Db,getScale:_n,isElement:ot,isRTL:Fb};function Lb(e,t){let n=null,r;const o=bt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=Bo(c),m=Bo(o.clientWidth-(u+d)),p=Bo(o.clientHeight-(c+h)),g=Bo(u),A={rootMargin:-f+"px "+-m+"px "+-p+"px "+-g+"px",threshold:Ge(0,qt(1,l))||1};let v=!0;function S(M){const y=M[0].intersectionRatio;if(y!==l){if(!v)return i();y?i(!1,y):r=setTimeout(()=>{i(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(S,{...A,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,A)}n.observe(e)}return i(!0),s}function Ub(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ja(e),c=o||s?[...u?_r(u):[],..._r(t)]:[];c.forEach(A=>{o&&A.addEventListener("scroll",n,{passive:!0}),s&&A.addEventListener("resize",n)});const d=u&&a?Lb(u,n):null;let h=-1,f=null;i&&(f=new ResizeObserver(A=>{let[v]=A;v&&v.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=f)==null||S.observe(t)})),n()}),u&&!l&&f.observe(u),f.observe(t));let m,p=l?wn(e):null;l&&g();function g(){const A=wn(e);p&&(A.x!==p.x||A.y!==p.y||A.width!==p.width||A.height!==p.height)&&n(),p=A,m=requestAnimationFrame(g)}return n(),()=>{var A;c.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(A=f)==null||A.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const zb=yb,jb=bb,Qb=pb,Wb=wb,Hb=mb,Mc=hb,Vb=vb,Gb=(e,t,n)=>{const r=new Map,o={platform:Bb,...n},s={...o.platform,_c:r};return fb(e,t,{...o,platform:s})};function Ke(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function kc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sf(...e){return t=>{let n=!1;const r=e.map(o=>{const s=kc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():kc(e[o],null)}}}}function it(...e){return b.useCallback(sf(...e),e)}function qb(e,t){const n=b.createContext(t),r=s=>{const{children:i,...a}=s,l=b.useMemo(()=>a,Object.values(a));return w(n.Provider,{value:l,children:i})};r.displayName=e+"Provider";function o(s){const i=b.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Za(e,t=[]){let n=[];function r(s,i){const a=b.createContext(i),l=n.length;n=[...n,i];const u=d=>{var h;const{scope:f,children:m,...p}=d,g=((h=f==null?void 0:f[e])==null?void 0:h[l])||a,A=b.useMemo(()=>p,Object.values(p));return w(g.Provider,{value:A,children:m})};u.displayName=s+"Provider";function c(d,h){var f;const m=((f=h==null?void 0:h[e])==null?void 0:f[l])||a,p=b.useContext(m);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,c]}const o=()=>{const s=n.map(i=>b.createContext(i));return function(i){const a=(i==null?void 0:i[e])||s;return b.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return o.scopeName=e,[r,Kb(o,...t)]}function Kb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(o){const s=r.reduce((i,{useScope:a,scopeName:l})=>{const u=a(o)[`__scope${l}`];return{...i,...u}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function $t(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function af({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Yb({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=$t(n),l=b.useCallback(u=>{if(s){const c=typeof u=="function"?u(e):u;c!==e&&a(c)}else o(u)},[s,e,o,a]);return[i,l]}function Yb({defaultProp:e,onChange:t}){const n=b.useState(e),[r]=n,o=b.useRef(r),s=$t(t);return b.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var So=b.forwardRef((e,t)=>{const{children:n,...r}=e,o=b.Children.toArray(n),s=o.find(Jb);if(s){const i=s.props.children,a=o.map(l=>l===s?b.Children.count(i)>1?b.Children.only(null):b.isValidElement(i)?i.props.children:null:l);return w(Xi,{...r,ref:t,children:b.isValidElement(i)?b.cloneElement(i,void 0,a):null})}return w(Xi,{...r,ref:t,children:n})});So.displayName="Slot";var Xi=b.forwardRef((e,t)=>{const{children:n,...r}=e;if(b.isValidElement(n)){const o=Zb(n);return b.cloneElement(n,{..._b(r,n.props),ref:t?sf(t,o):o})}return b.Children.count(n)>1?b.Children.only(null):null});Xi.displayName="SlotClone";var $b=({children:e})=>w(Nt,{children:e});function Jb(e){return b.isValidElement(e)&&e.type===$b}function _b(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{s(...i),o(...i)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Zb(e){var t,n;let r=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?e.ref:(r=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Xb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=Xb.reduce((e,t)=>{const n=b.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?So:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ev(e,t){e&&Td.flushSync(()=>e.dispatchEvent(t))}function tv(e,t=globalThis==null?void 0:globalThis.document){const n=$t(e);b.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var nv="DismissableLayer",ea="dismissableLayer.update",rv="dismissableLayer.pointerDownOutside",ov="dismissableLayer.focusOutside",Ic,lf=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xa=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,u=b.useContext(lf),[c,d]=b.useState(null),h=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=b.useState({}),m=it(t,E=>d(E)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),A=p.indexOf(g),v=c?p.indexOf(c):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,M=v>=A,y=av(E=>{const D=E.target,I=[...u.branches].some(R=>R.contains(D));!M||I||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},h),x=lv(E=>{const D=E.target;[...u.branches].some(I=>I.contains(D))||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},h);return tv(E=>{v===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},h),b.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ic=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Oc(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ic)}},[c,h,n,u]),b.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Oc())},[c,u]),b.useEffect(()=>{const E=()=>f({});return document.addEventListener(ea,E),()=>document.removeEventListener(ea,E)},[]),w(ve.div,{...l,ref:m,style:{pointerEvents:S?M?"auto":"none":void 0,...e.style},onFocusCapture:Ke(e.onFocusCapture,x.onFocusCapture),onBlurCapture:Ke(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:Ke(e.onPointerDownCapture,y.onPointerDownCapture)})});Xa.displayName=nv;var sv="DismissableLayerBranch",iv=b.forwardRef((e,t)=>{const n=b.useContext(lf),r=b.useRef(null),o=it(t,r);return b.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),w(ve.div,{...e,ref:o})});iv.displayName=sv;function av(e,t=globalThis==null?void 0:globalThis.document){const n=$t(e),r=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){cf(rv,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lv(e,t=globalThis==null?void 0:globalThis.document){const n=$t(e),r=b.useRef(!1);return b.useEffect(()=>{const o=s=>{s.target&&!r.current&&cf(ov,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Oc(){const e=new CustomEvent(ea);document.dispatchEvent(e)}function cf(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ev(o,s):o.dispatchEvent(s)}var ri=0;function uf(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Nc()),document.body.insertAdjacentElement("beforeend",e[1]??Nc()),ri++,()=>{ri===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ri--}},[])}function Nc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var oi="focusScope.autoFocusOnMount",si="focusScope.autoFocusOnUnmount",Dc={bubbles:!1,cancelable:!0},cv="FocusScope",el=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=b.useState(null),u=$t(o),c=$t(s),d=b.useRef(null),h=it(t,p=>l(p)),f=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let p=function(S){if(f.paused||!a)return;const M=S.target;a.contains(M)?d.current=M:jt(d.current,{select:!0})},g=function(S){if(f.paused||!a)return;const M=S.relatedTarget;M!==null&&(a.contains(M)||jt(d.current,{select:!0}))},A=function(S){if(document.activeElement===document.body)for(const M of S)M.removedNodes.length>0&&jt(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const v=new MutationObserver(A);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,f.paused]),b.useEffect(()=>{if(a){Rc.add(f);const p=document.activeElement;if(!a.contains(p)){const g=new CustomEvent(oi,Dc);a.addEventListener(oi,u),a.dispatchEvent(g),g.defaultPrevented||(uv(mv(df(a)),{select:!0}),document.activeElement===p&&jt(a))}return()=>{a.removeEventListener(oi,u),setTimeout(()=>{const g=new CustomEvent(si,Dc);a.addEventListener(si,c),a.dispatchEvent(g),g.defaultPrevented||jt(p??document.body,{select:!0}),a.removeEventListener(si,c),Rc.remove(f)},0)}}},[a,u,c,f]);const m=b.useCallback(p=>{if(!n&&!r||f.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,A=document.activeElement;if(g&&A){const v=p.currentTarget,[S,M]=dv(v);S&&M?!p.shiftKey&&A===M?(p.preventDefault(),n&&jt(S,{select:!0})):p.shiftKey&&A===S&&(p.preventDefault(),n&&jt(M,{select:!0})):A===v&&p.preventDefault()}},[n,r,f.paused]);return w(ve.div,{tabIndex:-1,...i,ref:h,onKeyDown:m})});el.displayName=cv;function uv(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jt(r,{select:t}),document.activeElement!==n)return}function dv(e){const t=df(e),n=Tc(t,e),r=Tc(t.reverse(),e);return[n,r]}function df(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tc(e,t){for(const n of e)if(!fv(n,{upTo:t}))return n}function fv(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function hv(e){return e instanceof HTMLInputElement&&"select"in e}function jt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hv(e)&&t&&e.select()}}var Rc=pv();function pv(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Fc(e,t),e.unshift(t)},remove(t){var n;e=Fc(e,t),(n=e[0])==null||n.resume()}}}function Fc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function mv(e){return e.filter(t=>t.tagName!=="A")}var An=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},gv=b.useId||(()=>{}),yv=0;function pt(e){const[t,n]=b.useState(gv());return An(()=>{n(r=>r??String(yv++))},[e]),t?`radix-${t}`:""}var ns=typeof document<"u"?kd:Ue;function fs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!fs(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!fs(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ff(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bc(e,t){const n=ff(e);return Math.round(t*n)/n}function ii(e){const t=b.useRef(e);return ns(()=>{t.current=e}),t}function bv(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=b.useState(r);fs(h,r)||f(r);const[m,p]=b.useState(null),[g,A]=b.useState(null),v=b.useCallback(K=>{K!==x.current&&(x.current=K,p(K))},[]),S=b.useCallback(K=>{K!==E.current&&(E.current=K,A(K))},[]),M=s||m,y=i||g,x=b.useRef(null),E=b.useRef(null),D=b.useRef(c),I=l!=null,R=ii(l),V=ii(o),O=ii(u),B=b.useCallback(()=>{if(!x.current||!E.current)return;const K={placement:t,strategy:n,middleware:h};V.current&&(K.platform=V.current),Gb(x.current,E.current,K).then(Z=>{const ae={...Z,isPositioned:O.current!==!1};z.current&&!fs(D.current,ae)&&(D.current=ae,Td.flushSync(()=>{d(ae)}))})},[h,t,n,V,O]);ns(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(K=>({...K,isPositioned:!1})))},[u]);const z=b.useRef(!1);ns(()=>(z.current=!0,()=>{z.current=!1}),[]),ns(()=>{if(M&&(x.current=M),y&&(E.current=y),M&&y){if(R.current)return R.current(M,y,B);B()}},[M,y,B,R,I]);const Y=b.useMemo(()=>({reference:x,floating:E,setReference:v,setFloating:S}),[v,S]),W=b.useMemo(()=>({reference:M,floating:y}),[M,y]),$=b.useMemo(()=>{const K={position:n,left:0,top:0};if(!W.floating)return K;const Z=Bc(W.floating,c.x),ae=Bc(W.floating,c.y);return a?{...K,transform:"translate("+Z+"px, "+ae+"px)",...ff(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:ae}},[n,a,W.floating,c.x,c.y]);return b.useMemo(()=>({...c,update:B,refs:Y,elements:W,floatingStyles:$}),[c,B,Y,W,$])}const vv=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Mc({element:r.current,padding:o}).fn(n):{}:r?Mc({element:r,padding:o}).fn(n):{}}}},wv=(e,t)=>({...zb(e),options:[e,t]}),Av=(e,t)=>({...jb(e),options:[e,t]}),xv=(e,t)=>({...Vb(e),options:[e,t]}),Cv=(e,t)=>({...Qb(e),options:[e,t]}),Ev=(e,t)=>({...Wb(e),options:[e,t]}),Sv=(e,t)=>({...Hb(e),options:[e,t]}),Pv=(e,t)=>({...vv(e),options:[e,t]});var Mv="Arrow",hf=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return w(ve.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w("polygon",{points:"0,0 30,0 15,10"})})});hf.displayName=Mv;var kv=hf;function Iv(e){const[t,n]=b.useState(void 0);return An(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var tl="Popper",[pf,mf]=Za(tl),[Ov,gf]=pf(tl),yf=e=>{const{__scopePopper:t,children:n}=e,[r,o]=b.useState(null);return w(Ov,{scope:t,anchor:r,onAnchorChange:o,children:n})};yf.displayName=tl;var bf="PopperAnchor",vf=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=gf(bf,n),i=b.useRef(null),a=it(t,i);return b.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:w(ve.div,{...o,ref:a})});vf.displayName=bf;var nl="PopperContent",[Nv,Dv]=pf(nl),wf=b.forwardRef((e,t)=>{var n,r,o,s,i,a;const{__scopePopper:l,side:u="bottom",sideOffset:c=0,align:d="center",alignOffset:h=0,arrowPadding:f=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:g=0,sticky:A="partial",hideWhenDetached:v=!1,updatePositionStrategy:S="optimized",onPlaced:M,...y}=e,x=gf(nl,l),[E,D]=b.useState(null),I=it(t,Rt=>D(Rt)),[R,V]=b.useState(null),O=Iv(R),B=(O==null?void 0:O.width)??0,z=(O==null?void 0:O.height)??0,Y=u+(d!=="center"?"-"+d:""),W=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},$=Array.isArray(p)?p:[p],K=$.length>0,Z={padding:W,boundary:$.filter(Rv),altBoundary:K},{refs:ae,floatingStyles:de,placement:T,isPositioned:H,middlewareData:X}=bv({strategy:"fixed",placement:Y,whileElementsMounted:(...Rt)=>Ub(...Rt,{animationFrame:S==="always"}),elements:{reference:x.anchor},middleware:[wv({mainAxis:c+z,alignmentAxis:h}),m&&Av({mainAxis:!0,crossAxis:!1,limiter:A==="partial"?xv():void 0,...Z}),m&&Cv({...Z}),Ev({...Z,apply:({elements:Rt,rects:To,availableWidth:C,availableHeight:k})=>{const{width:N,height:j}=To.reference,L=Rt.floating.style;L.setProperty("--radix-popper-available-width",`${C}px`),L.setProperty("--radix-popper-available-height",`${k}px`),L.setProperty("--radix-popper-anchor-width",`${N}px`),L.setProperty("--radix-popper-anchor-height",`${j}px`)}}),R&&Pv({element:R,padding:f}),Fv({arrowWidth:B,arrowHeight:z}),v&&Sv({strategy:"referenceHidden",...Z})]}),[q,se]=Cf(T),J=$t(M);An(()=>{H&&(J==null||J())},[H,J]);const fe=(n=X.arrow)==null?void 0:n.x,we=(r=X.arrow)==null?void 0:r.y,Ze=((o=X.arrow)==null?void 0:o.centerOffset)!==0,[Do,qs]=b.useState();return An(()=>{E&&qs(window.getComputedStyle(E).zIndex)},[E]),w("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...de,transform:H?de.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Do,"--radix-popper-transform-origin":[(s=X.transformOrigin)==null?void 0:s.x,(i=X.transformOrigin)==null?void 0:i.y].join(" "),...((a=X.hide)==null?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w(Nv,{scope:l,placedSide:q,onArrowChange:V,arrowX:fe,arrowY:we,shouldHideArrow:Ze,children:w(ve.div,{"data-side":q,"data-align":se,...y,ref:I,style:{...y.style,animation:H?void 0:"none"}})})})});wf.displayName=nl;var Af="PopperArrow",Tv={top:"bottom",right:"left",bottom:"top",left:"right"},xf=b.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=Dv(Af,n),s=Tv[o.placedSide];return w("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:w(kv,{...r,ref:t,style:{...r.style,display:"block"}})})});xf.displayName=Af;function Rv(e){return e!==null}var Fv=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:s,rects:i,middlewareData:a}=t,l=((n=a.arrow)==null?void 0:n.centerOffset)!==0,u=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[d,h]=Cf(s),f={start:"0%",center:"50%",end:"100%"}[h],m=(((r=a.arrow)==null?void 0:r.x)??0)+u/2,p=(((o=a.arrow)==null?void 0:o.y)??0)+c/2;let g="",A="";return d==="bottom"?(g=l?f:`${m}px`,A=`${-c}px`):d==="top"?(g=l?f:`${m}px`,A=`${i.floating.height+c}px`):d==="right"?(g=`${-c}px`,A=l?f:`${p}px`):d==="left"&&(g=`${i.floating.width+c}px`,A=l?f:`${p}px`),{data:{x:g,y:A}}}});function Cf(e){const[t,n="center"]=e.split("-");return[t,n]}var Bv=yf,Ef=vf,Lv=wf,Uv=xf,zv="Portal",rl=b.forwardRef((e,t)=>{var n;const{container:r,...o}=e,[s,i]=b.useState(!1);An(()=>i(!0),[]);const a=r||s&&((n=globalThis==null?void 0:globalThis.document)==null?void 0:n.body);return a?Dg.createPortal(w(ve.div,{...o,ref:t}),a):null});rl.displayName=zv;function jv(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var hr=e=>{const{present:t,children:n}=e,r=Qv(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),s=it(r.ref,Wv(o));return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:s}):null};hr.displayName="Presence";function Qv(e){const[t,n]=b.useState(),r=b.useRef({}),o=b.useRef(e),s=b.useRef("none"),i=e?"mounted":"unmounted",[a,l]=jv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Lo(r.current);s.current=a==="mounted"?u:"none"},[a]),An(()=>{const u=r.current,c=o.current;if(c!==e){const d=s.current,h=Lo(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&d!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),An(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=f=>{const m=Lo(r.current).includes(f.animationName);if(f.target===t&&m&&(l("ANIMATION_END"),!o.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},h=f=>{f.target===t&&(s.current=Lo(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Lo(e){return(e==null?void 0:e.animationName)||"none"}function Wv(e){var t,n;let r=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?e.ref:(r=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Hv=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Nn=new WeakMap,Uo=new WeakMap,zo={},ai=0,Sf=function(e){return e&&(e.host||Sf(e.parentNode))},Vv=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Sf(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Gv=function(e,t,n,r){var o=Vv(t,Array.isArray(e)?e:[e]);zo[n]||(zo[n]=new WeakMap);var s=zo[n],i=[],a=new Set,l=new Set(o),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};o.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))c(h);else try{var f=h.getAttribute(r),m=f!==null&&f!=="false",p=(Nn.get(h)||0)+1,g=(s.get(h)||0)+1;Nn.set(h,p),s.set(h,g),i.push(h),p===1&&m&&Uo.set(h,!0),g===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(A){console.error("aria-hidden: cannot operate on ",h,A)}})};return c(t),a.clear(),ai++,function(){i.forEach(function(d){var h=Nn.get(d)-1,f=s.get(d)-1;Nn.set(d,h),s.set(d,f),h||(Uo.has(d)||d.removeAttribute(r),Uo.delete(d)),f||d.removeAttribute(n)}),ai--,ai||(Nn=new WeakMap,Nn=new WeakMap,Uo=new WeakMap,zo={})}},Pf=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Hv(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Gv(r,o,n,"aria-hidden")):function(){return null}},ut=function(){return ut=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},ut.apply(this,arguments)};function Mf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function qv(e,t,n){for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var rs="right-scroll-bar-position",os="width-before-scroll-bar",Kv="with-scroll-bars-hidden",Yv="--removed-body-scroll-bar-size";function li(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $v(e,t){var n=ze(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Jv=typeof window<"u"?b.useLayoutEffect:b.useEffect,Lc=new WeakMap;function _v(e,t){var n=$v(null,function(r){return e.forEach(function(o){return li(o,r)})});return Jv(function(){var r=Lc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||li(a,null)}),s.forEach(function(a){o.has(a)||li(a,i)})}Lc.set(n,e)},[e]),n}function Zv(e){return e}function Xv(e,t){t===void 0&&(t=Zv);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var c=i;i=[],c.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(c){i.push(c),u()},filter:function(c){return i=i.filter(c),n}}}};return o}function e0(e){e===void 0&&(e={});var t=Xv(null);return t.options=ut({async:!0,ssr:!1},e),t}var kf=function(e){var t=e.sideCar,n=Mf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,ut({},n))};kf.isSideCarExport=!0;function t0(e,t){return e.useMedium(t),kf}var If=e0(),ci=function(){},Ls=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:ci,onWheelCapture:ci,onTouchMoveCapture:ci}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,m=e.inert,p=e.allowPinchZoom,g=e.as,A=g===void 0?"div":g,v=e.gapMode,S=Mf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=h,y=_v([n,t]),x=ut(ut({},S),o);return b.createElement(b.Fragment,null,c&&b.createElement(M,{sideCar:If,removeScrollBar:u,shards:d,noIsolation:f,inert:m,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:v}),i?b.cloneElement(b.Children.only(a),ut(ut({},x),{ref:y})):b.createElement(A,ut({},x,{className:l,ref:y}),a))});Ls.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ls.classNames={fullWidth:os,zeroRight:rs};var n0=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function r0(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=n0();return t&&e.setAttribute("nonce",t),e}function o0(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function s0(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var i0=function(){var e=0,t=null;return{add:function(n){e==0&&(t=r0())&&(o0(t,n),s0(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},a0=function(){var e=i0();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Of=function(){var e=a0(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},l0={left:0,top:0,right:0,gap:0},ui=function(e){return parseInt(e||"",10)||0},c0=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ui(n),ui(r),ui(o)]},u0=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return l0;var t=c0(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},d0=Of(),Zn="data-scroll-locked",f0=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
3
+ .`.concat(Kv,` {
4
+ overflow: hidden `).concat(r,`;
5
+ padding-right: `).concat(a,"px ").concat(r,`;
6
+ }
7
+ body[`).concat(Zn,`] {
8
+ overflow: hidden `).concat(r,`;
9
+ overscroll-behavior: contain;
10
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
11
+ padding-left: `.concat(o,`px;
12
+ padding-top: `).concat(s,`px;
13
+ padding-right: `).concat(i,`px;
14
+ margin-left:0;
15
+ margin-top:0;
16
+ margin-right: `).concat(a,"px ").concat(r,`;
17
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
18
+ }
19
+
20
+ .`).concat(rs,` {
21
+ right: `).concat(a,"px ").concat(r,`;
22
+ }
23
+
24
+ .`).concat(os,` {
25
+ margin-right: `).concat(a,"px ").concat(r,`;
26
+ }
27
+
28
+ .`).concat(rs," .").concat(rs,` {
29
+ right: 0 `).concat(r,`;
30
+ }
31
+
32
+ .`).concat(os," .").concat(os,` {
33
+ margin-right: 0 `).concat(r,`;
34
+ }
35
+
36
+ body[`).concat(Zn,`] {
37
+ `).concat(Yv,": ").concat(a,`px;
38
+ }
39
+ `)},Uc=function(){var e=parseInt(document.body.getAttribute(Zn)||"0",10);return isFinite(e)?e:0},h0=function(){b.useEffect(function(){return document.body.setAttribute(Zn,(Uc()+1).toString()),function(){var e=Uc()-1;e<=0?document.body.removeAttribute(Zn):document.body.setAttribute(Zn,e.toString())}},[])},p0=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;h0();var s=b.useMemo(function(){return u0(o)},[o]);return b.createElement(d0,{styles:f0(s,!t,o,n?"":"!important")})},ta=!1;if(typeof window<"u")try{var jo=Object.defineProperty({},"passive",{get:function(){return ta=!0,!0}});window.addEventListener("test",jo,jo),window.removeEventListener("test",jo,jo)}catch{ta=!1}var Dn=ta?{passive:!1}:!1,m0=function(e){return e.tagName==="TEXTAREA"},Nf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!m0(e)&&n[t]==="visible")},g0=function(e){return Nf(e,"overflowY")},y0=function(e){return Nf(e,"overflowX")},zc=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Df(e,r);if(o){var s=Tf(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},b0=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},v0=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Df=function(e,t){return e==="v"?g0(t):y0(t)},Tf=function(e,t){return e==="v"?b0(t):v0(t)},w0=function(e,t){return e==="h"&&t==="rtl"?-1:1},A0=function(e,t,n,r,o){var s=w0(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),u=!1,c=i>0,d=0,h=0;do{var f=Tf(e,a),m=f[0],p=f[1],g=f[2],A=p-g-s*m;(m||A)&&Df(e,a)&&(d+=A,h+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&(Math.abs(d)<1||!o)||!c&&(Math.abs(h)<1||!o))&&(u=!0),u},Qo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jc=function(e){return[e.deltaX,e.deltaY]},Qc=function(e){return e&&"current"in e?e.current:e},x0=function(e,t){return e[0]===t[0]&&e[1]===t[1]},C0=function(e){return`
40
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
41
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
42
+ `)},E0=0,Tn=[];function S0(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),o=b.useState(E0++)[0],s=b.useState(Of)[0],i=b.useRef(e);b.useEffect(function(){i.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=qv([e.lockRef.current],(e.shards||[]).map(Qc)).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=b.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var A=Qo(p),v=n.current,S="deltaX"in p?p.deltaX:v[0]-A[0],M="deltaY"in p?p.deltaY:v[1]-A[1],y,x=p.target,E=Math.abs(S)>Math.abs(M)?"h":"v";if("touches"in p&&E==="h"&&x.type==="range")return!1;var D=zc(E,x);if(!D)return!0;if(D?y=E:(y=E==="v"?"h":"v",D=zc(E,x)),!D)return!1;if(!r.current&&"changedTouches"in p&&(S||M)&&(r.current=y),!y)return!0;var I=r.current||y;return A0(I,g,p,I==="h"?S:M,!0)},[]),l=b.useCallback(function(p){var g=p;if(!(!Tn.length||Tn[Tn.length-1]!==s)){var A="deltaY"in g?jc(g):Qo(g),v=t.current.filter(function(y){return y.name===g.type&&(y.target===g.target||g.target===y.shadowParent)&&x0(y.delta,A)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var S=(i.current.shards||[]).map(Qc).filter(Boolean).filter(function(y){return y.contains(g.target)}),M=S.length>0?a(g,S[0]):!i.current.noIsolation;M&&g.cancelable&&g.preventDefault()}}},[]),u=b.useCallback(function(p,g,A,v){var S={name:p,delta:g,target:A,should:v,shadowParent:P0(A)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(M){return M!==S})},1)},[]),c=b.useCallback(function(p){n.current=Qo(p),r.current=void 0},[]),d=b.useCallback(function(p){u(p.type,jc(p),p.target,a(p,e.lockRef.current))},[]),h=b.useCallback(function(p){u(p.type,Qo(p),p.target,a(p,e.lockRef.current))},[]);b.useEffect(function(){return Tn.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Dn),document.addEventListener("touchmove",l,Dn),document.addEventListener("touchstart",c,Dn),function(){Tn=Tn.filter(function(p){return p!==s}),document.removeEventListener("wheel",l,Dn),document.removeEventListener("touchmove",l,Dn),document.removeEventListener("touchstart",c,Dn)}},[]);var f=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(s,{styles:C0(o)}):null,f?b.createElement(p0,{gapMode:e.gapMode}):null)}function P0(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const M0=t0(If,S0);var ol=b.forwardRef(function(e,t){return b.createElement(Ls,ut({},e,{ref:t,sideCar:M0}))});ol.classNames=Ls.classNames;const Rf="2.21.55";let Wo={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Rf}`},Q=class na extends Error{constructor(t,n={}){var r;const o=(()=>{var l;return n.cause instanceof na?n.cause.details:(l=n.cause)!=null&&l.message?n.cause.message:n.details})(),s=n.cause instanceof na&&n.cause.docsPath||n.docsPath,i=(r=Wo.getDocsUrl)==null?void 0:r.call(Wo,{...n,docsPath:s}),a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...o?[`Details: ${o}`]:[],...Wo.version?[`Version: ${Wo.version}`]:[]].join(`
43
+ `);super(a,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=o,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Rf}walk(t){return Ff(this,t)}};function Ff(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Ff(e.cause,t):t?null:e}class Bf extends Q{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class k0 extends Q{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class I0 extends Q{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}class Lf extends Q{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class Uf extends Q{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}class Wc extends Q{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function pr(e,{dir:t,size:n=32}={}){return typeof e=="string"?Vt(e,{dir:t,size:n}):O0(e,{dir:t,size:n})}function Vt(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new Uf({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function O0(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Uf({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let o=0;o<n;o++){const s=t==="right";r[s?o:n-o-1]=e[s?o:e.length-o-1]}return r}function On(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Ie(e){return On(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function sl(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}const N0=new TextEncoder;function il(e,t={}){return typeof e=="number"||typeof e=="bigint"?T0(e,t):typeof e=="boolean"?D0(e,t):On(e)?al(e,t):yn(e,t)}function D0(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(vt(n,{size:t.size}),pr(n,{size:t.size})):n}const At={zero:48,nine:57,A:65,F:70,a:97,f:102};function Hc(e){if(e>=At.zero&&e<=At.nine)return e-At.zero;if(e>=At.A&&e<=At.F)return e-(At.A-10);if(e>=At.a&&e<=At.f)return e-(At.a-10)}function al(e,t={}){let n=e;t.size&&(vt(n,{size:t.size}),n=pr(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const o=r.length/2,s=new Uint8Array(o);for(let i=0,a=0;i<o;i++){const l=Hc(r.charCodeAt(a++)),u=Hc(r.charCodeAt(a++));if(l===void 0||u===void 0)throw new Q(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);s[i]=l*16+u}return s}function T0(e,t){const n=ge(e,t);return al(n)}function yn(e,t={}){const n=N0.encode(e);return typeof t.size=="number"?(vt(n,{size:t.size}),pr(n,{dir:"right",size:t.size})):n}function vt(e,{size:t}){if(Ie(e)>t)throw new I0({givenSize:Ie(e),maxSize:t})}function zf(e,t={}){const{signed:n}=t;t.size&&vt(e,{size:t.size});const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function R0(e,t={}){return Number(zf(e,t))}const F0=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ll(e,t={}){return typeof e=="number"||typeof e=="bigint"?ge(e,t):typeof e=="string"?cl(e,t):typeof e=="boolean"?jf(e,t):Je(e,t)}function jf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(vt(n,{size:t.size}),pr(n,{size:t.size})):n}function Je(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=F0[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(vt(r,{size:t.size}),pr(r,{dir:"right",size:t.size})):r}function ge(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const l=typeof e=="bigint"?"n":"";throw new Bf({max:s?`${s}${l}`:void 0,min:`${i}${l}`,signed:n,size:r,value:`${e}${l}`})}const a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?pr(a,{size:r}):a}const B0=new TextEncoder;function cl(e,t={}){const n=B0.encode(e);return Je(n,t)}function or(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Y0(e.type);return`${e.name}(${ul(e.inputs,{includeName:t})})`}function ul(e,{includeName:t=!1}={}){return e?e.map(n=>L0(n,{includeName:t})).join(t?", ":","):""}function L0(e,{includeName:t}){return e.type.startsWith("tuple")?`(${ul(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class U0 extends Q{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
44
+ `),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class Vc extends Q{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
45
+ `),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class z0 extends Q{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
46
+ `),{metaMessages:[`Params: (${ul(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class dl extends Q{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class j0 extends Q{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
47
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}}class Q0 extends Q{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${Ie(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class W0 extends Q{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
48
+ `),{name:"AbiEncodingLengthMismatchError"})}}class Qf extends Q{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
49
+ `),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class hs extends Q{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
50
+ `),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class H0 extends Q{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
51
+ `),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class V0 extends Q{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${or(t.abiItem)}\`, and`,`\`${n.type}\` in \`${or(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class G0 extends Q{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
52
+ `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class q0 extends Q{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
53
+ `),{docsPath:n,name:"InvalidAbiDecodingType"})}}class K0 extends Q{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
54
+ `),{name:"InvalidArrayError"})}}class Y0 extends Q{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
55
+ `),{name:"InvalidDefinitionTypeError"})}}function Jt(e){return typeof e[0]=="string"?fl(e):$0(e)}function $0(e){let t=0;for(const o of e)t+=o.length;const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function fl(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}class xn extends Q{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class hl extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}function Gc(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function J0(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function pl(e,...t){if(!J0(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function qc(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function _0(e,t){pl(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const Ho=BigInt(2**32-1),Kc=BigInt(32);function Z0(e,t=!1){return t?{h:Number(e&Ho),l:Number(e>>Kc&Ho)}:{h:Number(e>>Kc&Ho)|0,l:Number(e&Ho)|0}}function X0(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:s,l:i}=Z0(e[o],t);[n[o],r[o]]=[s,i]}return[n,r]}const ew=(e,t,n)=>e<<n|t>>>32-n,tw=(e,t,n)=>t<<n|e>>>32-n,nw=(e,t,n)=>t<<n-32|e>>>64-n,rw=(e,t,n)=>e<<n-32|t>>>64-n;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ow=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Yc=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,sw=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function $c(e){for(let t=0;t<e.length;t++)e[t]=sw(e[t])}function iw(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Wf(e){return typeof e=="string"&&(e=iw(e)),pl(e),e}class aw{clone(){return this._cloneInto()}}function lw(e){const t=r=>e().update(Wf(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const Hf=[],Vf=[],Gf=[],cw=BigInt(0),wr=BigInt(1),uw=BigInt(2),dw=BigInt(7),fw=BigInt(256),hw=BigInt(113);for(let e=0,t=wr,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Hf.push(2*(5*r+n)),Vf.push((e+1)*(e+2)/2%64);let o=cw;for(let s=0;s<7;s++)t=(t<<wr^(t>>dw)*hw)%fw,t&uw&&(o^=wr<<(wr<<BigInt(s))-wr);Gf.push(o)}const[pw,mw]=X0(Gf,!0),Jc=(e,t,n)=>n>32?nw(e,t,n):ew(e,t,n),_c=(e,t,n)=>n>32?rw(e,t,n):tw(e,t,n);function gw(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const a=(i+8)%10,l=(i+2)%10,u=n[l],c=n[l+1],d=Jc(u,c,1)^n[a],h=_c(u,c,1)^n[a+1];for(let f=0;f<50;f+=10)e[i+f]^=d,e[i+f+1]^=h}let o=e[2],s=e[3];for(let i=0;i<24;i++){const a=Vf[i],l=Jc(o,s,a),u=_c(o,s,a),c=Hf[i];o=e[c],s=e[c+1],e[c]=l,e[c+1]=u}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)n[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=pw[r],e[1]^=mw[r]}n.fill(0)}class ml extends aw{constructor(t,n,r,o=!1,s=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Gc(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=ow(this.state)}keccak(){Yc||$c(this.state32),gw(this.state32,this.rounds),Yc||$c(this.state32),this.posOut=0,this.pos=0}update(t){qc(this);const{blockLen:n,state:r}=this;t=Wf(t);const o=t.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);for(let a=0;a<i;a++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){qc(this,!1),pl(t),this.finish();const n=this.state,{blockLen:r}=this;for(let o=0,s=t.length;o<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-o);t.set(n.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Gc(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(_0(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new ml(n,r,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}}const yw=(e,t,n)=>lw(()=>new ml(t,e,n)),bw=yw(1,136,256/8);function sr(e,t){const n=t||"hex",r=bw(On(e,{strict:!1})?il(e):e);return n==="bytes"?r:ll(r)}const di=new hl(8192);function gl(e,t){if(di.has(`${e}.${t}`))return di.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=sr(yn(n),"bytes"),o=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(r[i>>1]&15)>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());const s=`0x${o.join("")}`;return di.set(`${e}.${t}`,s),s}function Vo(e,t){if(!yt(e,{strict:!1}))throw new xn({address:e});return gl(e,t)}const vw=/^0x[a-fA-F0-9]{40}$/,fi=new hl(8192);function yt(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(fi.has(r))return fi.get(r);const o=vw.test(e)?e.toLowerCase()===e?!0:n?gl(e)===e:!0:!1;return fi.set(r,o),o}function ps(e,t,n,{strict:r}={}){return On(e,{strict:!1})?ww(e,t,n,{strict:r}):Yf(e,t,n,{strict:r})}function qf(e,t){if(typeof t=="number"&&t>0&&t>Ie(e)-1)throw new Lf({offset:t,position:"start",size:Ie(e)})}function Kf(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Ie(e)!==n-t)throw new Lf({offset:n,position:"end",size:Ie(e)})}function Yf(e,t,n,{strict:r}={}){qf(e,t);const o=e.slice(t,n);return r&&Kf(o,t,n),o}function ww(e,t,n,{strict:r}={}){qf(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Kf(o,t,n),o}const Aw=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function yl(e,t){if(e.length!==t.length)throw new W0({expectedLength:e.length,givenLength:t.length});const n=xw({params:e,values:t}),r=vl(n);return r.length===0?"0x":r}function xw({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(bl({param:e[r],value:t[r]}));return n}function bl({param:e,value:t}){const n=wl(e.type);if(n){const[r,o]=n;return Ew(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return Iw(t,{param:e});if(e.type==="address")return Cw(t);if(e.type==="bool")return Pw(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=Aw.exec(e.type)??[];return Mw(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return Sw(t,{param:e});if(e.type==="string")return kw(t);throw new G0(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function vl(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:a}=e[s];i?t+=32:t+=Ie(a)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:a}=e[s];i?(n.push(ge(t+o,{size:32})),r.push(a),o+=Ie(a)):n.push(a)}return Jt([...n,...r])}function Cw(e){if(!yt(e))throw new xn({address:e});return{dynamic:!1,encoded:Vt(e.toLowerCase())}}function Ew(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new K0(e);if(!r&&e.length!==t)throw new j0({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const a=bl({param:n,value:e[i]});a.dynamic&&(o=!0),s.push(a)}if(r||o){const i=vl(s);if(r){const a=ge(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Jt([a,i]):a}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:Jt(s.map(({encoded:i})=>i))}}function Sw(e,{param:t}){const[,n]=t.type.split("bytes"),r=Ie(e);if(!n){let o=e;return r%32!==0&&(o=Vt(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Jt([Vt(ge(r,{size:32})),o])}}if(r!==Number.parseInt(n))throw new Q0({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:Vt(e,{dir:"right"})}}function Pw(e){if(typeof e!="boolean")throw new Q(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Vt(jf(e))}}function Mw(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new Bf({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:ge(e,{size:32,signed:t})}}function kw(e){const t=cl(e),n=Math.ceil(Ie(t)/32),r=[];for(let o=0;o<n;o++)r.push(Vt(ps(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Jt([Vt(ge(Ie(t),{size:32})),...r])}}function Iw(e,{param:t}){let n=!1;const r=[];for(let o=0;o<t.components.length;o++){const s=t.components[o],i=Array.isArray(e)?o:s.name,a=bl({param:s,value:e[i]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?vl(r):Jt(r.map(({encoded:o})=>o))}}function wl(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const hi="/docs/contract/encodeDeployData";function $f(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const o=t.find(i=>"type"in i&&i.type==="constructor");if(!o)throw new U0({docsPath:hi});if(!("inputs"in o))throw new Vc({docsPath:hi});if(!o.inputs||o.inputs.length===0)throw new Vc({docsPath:hi});const s=yl(o.inputs,n);return fl([r,s])}function Us(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class Zc extends Q{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class Ow extends Q{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class Nw extends Q{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const Dw={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Nw({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Ow({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Zc({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Zc({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Tw(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Dw);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class ra extends Q{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class Jf extends Q{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const Rw={gwei:9,wei:18},Fw={ether:-9,wei:9};function _f(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${s?`.${s}`:""}`}function bn(e,t="wei"){return _f(e,Fw[t])}class $n extends Q{constructor({cause:t,message:n}={}){var r;const o=(r=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:r.replace("execution reverted","");super(`Execution reverted ${o?`with reason: ${o}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty($n,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty($n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class ms extends Q{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${bn(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(ms,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class oa extends Q{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${bn(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(oa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class sa extends Q{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(sa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class ia extends Q{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
56
+ `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(ia,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class aa extends Q{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(aa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class la extends Q{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
57
+ `),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(la,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class ca extends Q{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(ca,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class ua extends Q{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(ua,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class da extends Q{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(da,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class gs extends Q{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${bn(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${bn(r)} gwei`:""}).`].join(`
58
+ `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(gs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Zf extends Q{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function Bw(e,t="wei"){return _f(e,Rw[t])}function Xf(e){const t=Object.entries(e).map(([r,o])=>o===void 0||o===!1?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>` ${`${r}:`.padEnd(n+1)} ${o}`).join(`
59
+ `)}class Lw extends Q{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
60
+ `),{name:"FeeConflictError"})}}const mt=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n),Uw=e=>e,Po=e=>e;class vn extends Q{constructor({body:t,cause:n,details:r,headers:o,status:s,url:i}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${Po(i)}`,t&&`Request body: ${mt(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=o,this.status=s,this.url=i}}class eh extends Q{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${Po(r)}`,`Request body: ${mt(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code}}class Xc extends Q{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Po(n)}`,`Request body: ${mt(t)}`],name:"TimeoutError"})}}const zw=-1;class Qe extends Q{constructor(t,{code:n,docsPath:r,metaMessages:o,name:s,shortMessage:i}){super(i,{cause:t,docsPath:r,metaMessages:o||(t==null?void 0:t.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||t.name,this.code=t instanceof eh?t.code:n??zw}}class mr extends Qe{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class Zr extends Qe{constructor(t){super(t,{code:Zr.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Zr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Xr extends Qe{constructor(t){super(t,{code:Xr.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Xr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class eo extends Qe{constructor(t,{method:n}={}){super(t,{code:eo.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class to extends Qe{constructor(t){super(t,{code:to.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
61
+ `)})}}Object.defineProperty(to,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Cn extends Qe{constructor(t){super(t,{code:Cn.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Cn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class no extends Qe{constructor(t){super(t,{code:no.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
62
+ `)})}}Object.defineProperty(no,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ro extends Qe{constructor(t){super(t,{code:ro.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ro,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Gt extends Qe{constructor(t){super(t,{code:Gt.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Gt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class oo extends Qe{constructor(t){super(t,{code:oo.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class so extends Qe{constructor(t,{method:n}={}){super(t,{code:so.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not implemented.`})}}Object.defineProperty(so,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class ir extends Qe{constructor(t){super(t,{code:ir.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(ir,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class io extends Qe{constructor(t){super(t,{code:io.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(io,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Ne extends mr{constructor(t){super(t,{code:Ne.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Ne,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class ao extends mr{constructor(t){super(t,{code:ao.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(ao,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class lo extends mr{constructor(t,{method:n}={}){super(t,{code:lo.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(lo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class co extends mr{constructor(t){super(t,{code:co.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(co,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class uo extends mr{constructor(t){super(t,{code:uo.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(uo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class En extends mr{constructor(t){super(t,{code:En.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(En,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class jw extends Qe{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function Qw(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof Q?e.walk(o=>(o==null?void 0:o.code)===$n.code):e;return r instanceof Q?new $n({cause:e,message:r.details}):$n.nodeMessage.test(n)?new $n({cause:e,message:e.details}):ms.nodeMessage.test(n)?new ms({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):oa.nodeMessage.test(n)?new oa({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):sa.nodeMessage.test(n)?new sa({cause:e,nonce:t==null?void 0:t.nonce}):ia.nodeMessage.test(n)?new ia({cause:e,nonce:t==null?void 0:t.nonce}):aa.nodeMessage.test(n)?new aa({cause:e,nonce:t==null?void 0:t.nonce}):la.nodeMessage.test(n)?new la({cause:e}):ca.nodeMessage.test(n)?new ca({cause:e,gas:t==null?void 0:t.gas}):ua.nodeMessage.test(n)?new ua({cause:e,gas:t==null?void 0:t.gas}):da.nodeMessage.test(n)?new da({cause:e}):gs.nodeMessage.test(n)?new gs({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new Zf({cause:e})}function Ww(e,{format:t}){if(!t)return{};const n={};function r(s){const i=Object.keys(s);for(const a of i)a in e&&(n[a]=e[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&r(s[a])}const o=t(e||{});return r(o),n}const Hw={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Vw(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=Gw(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>Je(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=ge(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=ge(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=ge(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=ge(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=ge(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=ge(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Hw[e.type]),typeof e.value<"u"&&(t.value=ge(e.value)),t}function Gw(e){return e.map(t=>({address:t.contractAddress,r:t.r,s:t.s,chainId:ge(t.chainId),nonce:ge(t.nonce),...typeof t.yParity<"u"?{yParity:ge(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:ge(t.v)}:{}}))}function zs(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const o=e[n];return typeof o=="function"?o:s=>t(e,s)}const qw=2n**256n-1n;function Kw(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:o,to:s}=e,i=t?Us(t):void 0;if(i&&!yt(i.address))throw new xn({address:i.address});if(s&&!yt(s))throw new xn({address:s});if(typeof n<"u"&&(typeof r<"u"||typeof o<"u"))throw new Lw;if(r&&r>qw)throw new ms({maxFeePerGas:r});if(o&&r&&o>r)throw new gs({maxFeePerGas:r,maxPriorityFeePerGas:o})}class Yw extends Q{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class $w extends Q{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function eu(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
63
+ `,"")}function Jw(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
64
+ `;return r.nonce&&(o+=` nonce: ${r.nonce}
65
+ `),r.balance&&(o+=` balance: ${r.balance}
66
+ `),r.code&&(o+=` code: ${r.code}
67
+ `),r.state&&(o+=` state:
68
+ `,o+=eu(r.state)),r.stateDiff&&(o+=` stateDiff:
69
+ `,o+=eu(r.stateDiff)),o},` State Override:
70
+ `).slice(0,-1)}function tu(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Wc({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Wc({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function _w(e){const{balance:t,nonce:n,state:r,stateDiff:o,code:s}=e,i={};if(s!==void 0&&(i.code=s),t!==void 0&&(i.balance=ge(t)),n!==void 0&&(i.nonce=ge(n)),r!==void 0&&(i.state=tu(r)),o!==void 0){if(i.state)throw new $w;i.stateDiff=tu(o)}return i}function Zw(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!yt(n,{strict:!1}))throw new xn({address:n});if(t[n])throw new Yw({address:n});t[n]=_w(r)}return t}const nu=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],th=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Xw=[...th,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],eA=[...th,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],ru=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}];function tA(e,t={}){typeof t.size<"u"&&vt(e,{size:t.size});const n=Je(e,t);return zf(n,t)}function nA(e,t={}){let n=e;if(typeof t.size<"u"&&(vt(n,{size:t.size}),n=sl(n)),n.length>1||n[0]>1)throw new k0(n);return!!n[0]}function Ot(e,t={}){typeof t.size<"u"&&vt(e,{size:t.size});const n=Je(e,t);return R0(n,t)}function rA(e,t={}){let n=e;return typeof t.size<"u"&&(vt(n,{size:t.size}),n=sl(n,{dir:"right"})),new TextDecoder().decode(n)}function nh(e,t){const n=typeof t=="string"?al(t):t,r=Tw(n);if(Ie(n)===0&&e.length>0)throw new dl;if(Ie(t)&&Ie(t)<32)throw new z0({data:typeof t=="string"?t:Je(t),params:e,size:Ie(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const a=e[i];r.setPosition(o);const[l,u]=Xn(r,a,{staticPosition:0});o+=u,s.push(l)}return s}function Xn(e,t,{staticPosition:n}){const r=wl(t.type);if(r){const[o,s]=r;return sA(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return cA(e,t,{staticPosition:n});if(t.type==="address")return oA(e);if(t.type==="bool")return iA(e);if(t.type.startsWith("bytes"))return aA(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return lA(e,t);if(t.type==="string")return uA(e,{staticPosition:n});throw new q0(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ou=32,fa=32;function oA(e){const t=e.readBytes(32);return[gl(Je(Yf(t,-20))),32]}function sA(e,t,{length:n,staticPosition:r}){if(!n){const i=Ot(e.readBytes(fa)),a=r+i,l=a+ou;e.setPosition(a);const u=Ot(e.readBytes(ou)),c=fo(t);let d=0;const h=[];for(let f=0;f<u;++f){e.setPosition(l+(c?f*32:d));const[m,p]=Xn(e,t,{staticPosition:l});d+=p,h.push(m)}return e.setPosition(r+32),[h,32]}if(fo(t)){const i=Ot(e.readBytes(fa)),a=r+i,l=[];for(let u=0;u<n;++u){e.setPosition(a+u*32);const[c]=Xn(e,t,{staticPosition:a});l.push(c)}return e.setPosition(r+32),[l,32]}let o=0;const s=[];for(let i=0;i<n;++i){const[a,l]=Xn(e,t,{staticPosition:r+o});o+=l,s.push(a)}return[s,o]}function iA(e){return[nA(e.readBytes(32),{size:32}),32]}function aA(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const s=Ot(e.readBytes(32));e.setPosition(n+s);const i=Ot(e.readBytes(32));if(i===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(i);return e.setPosition(n+32),[Je(a),32]}return[Je(e.readBytes(Number.parseInt(o),32)),32]}function lA(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),o=e.readBytes(32);return[r>48?tA(o,{signed:n}):Ot(o,{signed:n}),32]}function cA(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(fo(t)){const i=Ot(e.readBytes(fa)),a=n+i;for(let l=0;l<t.components.length;++l){const u=t.components[l];e.setPosition(a+s);const[c,d]=Xn(e,u,{staticPosition:a});s+=d,o[r?l:u==null?void 0:u.name]=c}return e.setPosition(n+32),[o,32]}for(let i=0;i<t.components.length;++i){const a=t.components[i],[l,u]=Xn(e,a,{staticPosition:n});o[r?i:a==null?void 0:a.name]=l,s+=u}return[o,s]}function uA(e,{staticPosition:t}){const n=Ot(e.readBytes(32)),r=t+n;e.setPosition(r);const o=Ot(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=rA(sl(s));return e.setPosition(t+32),[i,32]}function fo(e){var t;const{type:n}=e;if(n==="string"||n==="bytes"||n.endsWith("[]"))return!0;if(n==="tuple")return(t=e.components)==null?void 0:t.some(fo);const r=wl(e.type);return!!(r&&fo({...e,type:r[1]}))}const dA=e=>sr(il(e));function fA(e){return dA(e)}const hA="1.0.7";let _e=class ha extends Error{constructor(t,n={}){var r;const o=n.cause instanceof ha?n.cause.details:(r=n.cause)!=null&&r.message?n.cause.message:n.details,s=n.cause instanceof ha&&n.cause.docsPath||n.docsPath,i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...o?[`Details: ${o}`]:[],`Version: abitype@${hA}`].join(`
71
+ `);super(i),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=o,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function Zt(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const rh=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,oh=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,sh=/^\(.+?\).*?$/,su=/^tuple(?<array>(\[(\d*)\])*)$/;function pa(e){let t=e.type;if(su.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let o=0;o<n;o++){const s=e.components[o];t+=pa(s),o<n-1&&(t+=", ")}const r=Zt(su,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,pa({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Ar(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=pa(o),r!==n-1&&(t+=", ")}return t}function pA(e){var t;return e.type==="function"?`function ${e.name}(${Ar(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${Ar(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Ar(e.inputs)})`:e.type==="error"?`error ${e.name}(${Ar(e.inputs)})`:e.type==="constructor"?`constructor(${Ar(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const ih=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function mA(e){return ih.test(e)}function gA(e){return Zt(ih,e)}const ah=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function yA(e){return ah.test(e)}function bA(e){return Zt(ah,e)}const lh=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function vA(e){return lh.test(e)}function wA(e){return Zt(lh,e)}const ch=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function uh(e){return ch.test(e)}function AA(e){return Zt(ch,e)}const dh=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function xA(e){return dh.test(e)}function CA(e){return Zt(dh,e)}const EA=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function SA(e){return EA.test(e)}const PA=/^receive\(\) external payable$/;function MA(e){return PA.test(e)}const kA=new Set(["indexed"]),ma=new Set(["calldata","memory","storage"]);class IA extends _e{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class OA extends _e{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class NA extends _e{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class DA extends _e{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class TA extends _e{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class RA extends _e{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class FA extends _e{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Vr extends _e{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class BA extends _e{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class LA extends _e{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class UA extends _e{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class zA extends _e{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function jA(e,t,n){let r="";if(n)for(const o of Object.entries(n)){if(!o)continue;let s="";for(const i of o[1])s+=`[${i.type}${i.name?`:${i.name}`:""}]`;r+=`(${o[0]}{${s}})`}return t?`${t}:${e}${r}`:e}const pi=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function QA(e,t={}){if(vA(e)){const n=wA(e);if(!n)throw new Vr({signature:e,type:"function"});const r=nt(n.parameters),o=[],s=r.length;for(let a=0;a<s;a++)o.push(fn(r[a],{modifiers:ma,structs:t,type:"function"}));const i=[];if(n.returns){const a=nt(n.returns),l=a.length;for(let u=0;u<l;u++)i.push(fn(a[u],{modifiers:ma,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}if(yA(e)){const n=bA(e);if(!n)throw new Vr({signature:e,type:"event"});const r=nt(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(fn(r[i],{modifiers:kA,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}if(mA(e)){const n=gA(e);if(!n)throw new Vr({signature:e,type:"error"});const r=nt(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(fn(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}if(xA(e)){const n=CA(e);if(!n)throw new Vr({signature:e,type:"constructor"});const r=nt(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(fn(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}if(SA(e))return{type:"fallback"};if(MA(e))return{type:"receive",stateMutability:"payable"};throw new BA({signature:e})}const WA=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,HA=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,VA=/^u?int$/;function fn(e,t){var n,r;const o=jA(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(pi.has(o))return pi.get(o);const s=sh.test(e),i=Zt(s?HA:WA,e);if(!i)throw new NA({param:e});if(i.name&&qA(i.name))throw new DA({param:e,name:i.name});const a=i.name?{name:i.name}:{},l=i.modifier==="indexed"?{indexed:!0}:{},u=(t==null?void 0:t.structs)??{};let c,d={};if(s){c="tuple";const f=nt(i.type),m=[],p=f.length;for(let g=0;g<p;g++)m.push(fn(f[g],{structs:u}));d={components:m}}else if(i.type in u)c="tuple",d={components:u[i.type]};else if(VA.test(i.type))c=`${i.type}256`;else if(c=i.type,(t==null?void 0:t.type)!=="struct"&&!fh(c))throw new OA({type:c});if(i.modifier){if(!((r=(n=t==null?void 0:t.modifiers)==null?void 0:n.has)!=null&&r.call(n,i.modifier)))throw new TA({param:e,type:t==null?void 0:t.type,modifier:i.modifier});if(ma.has(i.modifier)&&!KA(c,!!i.array))throw new RA({param:e,type:t==null?void 0:t.type,modifier:i.modifier})}const h={type:`${c}${i.array??""}`,...a,...l,...d};return pi.set(o,h),h}function nt(e,t=[],n="",r=0){const o=e.trim().length;for(let s=0;s<o;s++){const i=e[s],a=e.slice(s+1);switch(i){case",":return r===0?nt(a,[...t,n.trim()]):nt(a,t,`${n}${i}`,r);case"(":return nt(a,t,`${n}${i}`,r+1);case")":return nt(a,t,`${n}${i}`,r-1);default:return nt(a,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new zA({current:n,depth:r});return t.push(n.trim()),t}function fh(e){return e==="address"||e==="bool"||e==="function"||e==="string"||rh.test(e)||oh.test(e)}const GA=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function qA(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||rh.test(e)||oh.test(e)||GA.test(e)}function KA(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function YA(e){const t={},n=e.length;for(let i=0;i<n;i++){const a=e[i];if(!uh(a))continue;const l=AA(a);if(!l)throw new Vr({signature:a,type:"struct"});const u=l.properties.split(";"),c=[],d=u.length;for(let h=0;h<d;h++){const f=u[h].trim();if(!f)continue;const m=fn(f,{type:"struct"});c.push(m)}if(!c.length)throw new LA({signature:a});t[l.name]=c}const r={},o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];r[a]=hh(l,t)}return r}const $A=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function hh(e,t,n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(sh.test(i.type))r.push(i);else{const a=Zt($A,i.type);if(!(a!=null&&a.type))throw new FA({abiParameter:i});const{array:l,type:u}=a;if(u in t){if(n.has(u))throw new UA({type:u});r.push({...i,type:`tuple${l??""}`,components:hh(t[u]??[],t,new Set([...n,u]))})}else if(fh(u))r.push(i);else throw new IA({type:u})}}return r}function ph(e){const t=YA(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];uh(s)||n.push(QA(s,t))}return n}function JA(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const a=e[i];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){s=!0;break}continue}if(a===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=a,n+=a}}if(!s)throw new Q("Unable to normalize signature.");return o}const _A=e=>{const t=typeof e=="string"?e:pA(e);return JA(t)};function mh(e){return fA(_A(e))}const ZA=mh,Al=e=>ps(mh(e),0,4);function xl(e){const{abi:t,args:n=[],name:r}=e,o=On(r,{strict:!1}),s=t.filter(a=>o?a.type==="function"?Al(a)===r:a.type==="event"?ZA(a)===r:!1:"name"in a&&a.name===r);if(s.length===0)return;if(s.length===1)return s[0];let i;for(const a of s)if("inputs"in a){if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)&&n.every((l,u)=>{const c="inputs"in a&&a.inputs[u];return c?ga(l,c):!1})){if(i&&"inputs"in i&&i.inputs){const l=gh(a.inputs,i.inputs,n);if(l)throw new V0({abiItem:a,type:l[0]},{abiItem:i,type:l[1]})}i=a}}return i||s[0]}function ga(e,t){const n=typeof e,r=t.type;switch(r){case"address":return yt(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>ga(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>ga(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function gh(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return gh(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")||(i.includes("address")&&i.includes("string")?yt(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")&&yt(n[r],{strict:!1})))return i}}const mi="/docs/contract/decodeFunctionResult";function Cl(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const a=xl({abi:t,args:n,name:r});if(!a)throw new hs(r,{docsPath:mi});s=a}if(s.type!=="function")throw new hs(void 0,{docsPath:mi});if(!s.outputs)throw new H0(s.name,{docsPath:mi});const i=nh(s.outputs,o);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}const iu="/docs/contract/encodeFunctionData";function XA(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=xl({abi:t,args:n,name:r});if(!s)throw new hs(r,{docsPath:iu});o=s}if(o.type!=="function")throw new hs(void 0,{docsPath:iu});return{abi:[o],functionName:Al(or(o))}}function El(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var a;return e.abi.length===1&&(a=e.functionName)!=null&&a.startsWith("0x")?e:XA(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?yl(o.inputs,t??[]):void 0;return fl([s,i??"0x"])}function Sl({blockNumber:e,chain:t,contract:n}){var r;const o=(r=t==null?void 0:t.contracts)==null?void 0:r[n];if(!o)throw new ra({chain:t,contract:{name:n}});if(e&&o.blockCreated&&o.blockCreated>e)throw new ra({blockNumber:e,chain:t,contract:{name:n,blockCreated:o.blockCreated}});return o.address}const yh={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},ex={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},tx={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function bh(e){const{abi:t,data:n}=e,r=ps(n,0,4);if(r==="0x")throw new dl;const o=[...t||[],ex,tx].find(s=>s.type==="error"&&r===Al(or(s)));if(!o)throw new Qf(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?nh(o.inputs,ps(n,4)):void 0,errorName:o.name}}function vh({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((o,s)=>`${r&&o.name?`${o.name}: `:""}${typeof t[s]=="object"?mt(t[s]):t[s]}`).join(", ")})`}class nx extends Q{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:c,to:d,value:h,stateOverride:f}){var m;const p=n?Us(n):void 0;let g=Xf({from:p==null?void 0:p.address,to:d,value:typeof h<"u"&&`${Bw(h)} ${((m=o==null?void 0:o.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof a<"u"&&`${bn(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${bn(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${bn(u)} gwei`,nonce:c});f&&(g+=`
72
+ ${Jw(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",g].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class rx extends Q{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:s,functionName:i,sender:a}){const l=xl({abi:n,args:r,name:i}),u=l?vh({abiItem:l,args:r,includeFunctionName:!1,includeName:!1}):void 0,c=l?or(l,{includeName:!0}):void 0,d=Xf({address:o&&Uw(o),function:c,args:u&&u!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${u}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=o,this.functionName=i,this.sender=a}}class ya extends Q{constructor({abi:t,data:n,functionName:r,message:o}){let s,i,a,l;if(n&&n!=="0x")try{i=bh({abi:t,data:n});const{abiItem:c,errorName:d,args:h}=i;if(d==="Error")l=h[0];else if(d==="Panic"){const[f]=h;l=yh[f]}else{const f=c?or(c,{includeName:!0}):void 0,m=c&&h?vh({abiItem:c,args:h,includeFunctionName:!1,includeName:!1}):void 0;a=[f?`Error: ${f}`:"",m&&m!=="()"?` ${[...Array((d==null?void 0:d.length)??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(c){s=c}else o&&(l=o);let u;s instanceof Qf&&(u=s.signature,a=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(l&&l!=="execution reverted"||u?[`The contract function "${r}" reverted with the following ${u?"signature":"reason"}:`,l||u].join(`
73
+ `):`The contract function "${r}" reverted.`,{cause:s,metaMessages:a,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.reason=l,this.signature=u}}class ox extends Q{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class sx extends Q{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class wh extends Q{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}function Ah(e,t){var n,r,o,s,i,a;if(!(e instanceof Q))return!1;const l=e.walk(u=>u instanceof ya);return l instanceof ya?!!(((n=l.data)==null?void 0:n.errorName)==="ResolverNotFound"||((r=l.data)==null?void 0:r.errorName)==="ResolverWildcardNotSupported"||((o=l.data)==null?void 0:o.errorName)==="ResolverNotContract"||((s=l.data)==null?void 0:s.errorName)==="ResolverError"||((i=l.data)==null?void 0:i.errorName)==="HttpError"||(a=l.reason)!=null&&a.includes("Wildcard on non-extended resolvers is not supported")||t==="reverse"&&l.reason===yh[50]):!1}function xh(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return On(t)?t:null}function ix(e){let t=new Uint8Array(32).fill(0);if(!e)return Je(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const o=xh(n[r]),s=o?il(o):sr(yn(n[r]),"bytes");t=sr(Jt([t,s]),"bytes")}return Je(t)}function ax(e){return`[${e.slice(2)}]`}function lx(e){const t=new Uint8Array(32).fill(0);return e?xh(e)||sr(yn(e)):Je(t)}function Ch(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(yn(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=yn(o[s]);i.byteLength>255&&(i=yn(ax(lx(o[s])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}const cx=3;function ux(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const{code:a,data:l,message:u,shortMessage:c}=e instanceof wh?e:e instanceof Q?e.walk(h=>"data"in h)||e.walk():{},d=e instanceof dl?new ox({functionName:s}):[cx,Cn.code].includes(a)&&(l||u||c)?new ya({abi:t,data:typeof l=="object"?l.data:l,functionName:s,message:c??u}):e;return new rx(d,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}const dx="0x82ad56cb",fx="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",hx="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";function px(e,{docsPath:t,...n}){const r=(()=>{const o=Qw(e,n);return o instanceof Zf?e:o})();return new nx(r,{docsPath:t,...n})}function mx(){let e=()=>{},t=()=>{};return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}const gi=new Map;function Eh({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const s=async()=>{const c=l();i();const d=c.map(({args:h})=>h);d.length!==0&&e(d).then(h=>{o&&Array.isArray(h)&&h.sort(o);for(let f=0;f<c.length;f++){const{resolve:m}=c[f];m==null||m([h[f],h])}}).catch(h=>{for(let f=0;f<c.length;f++){const{reject:m}=c[f];m==null||m(h)}})},i=()=>gi.delete(t),a=()=>l().map(({args:c})=>c),l=()=>gi.get(t)||[],u=c=>gi.set(t,[...l(),c]);return{flush:i,async schedule(c){const{promise:d,resolve:h,reject:f}=mx();return n!=null&&n([...a(),c])&&s(),l().length>0?(u({args:c,resolve:h,reject:f}),d):(u({args:c,resolve:h,reject:f}),setTimeout(s,r),d)}}}async function Sh(e,t){var n,r,o,s;const{account:i=e.account,batch:a=!!((n=e.batch)!=null&&n.multicall),blockNumber:l,blockTag:u="latest",accessList:c,blobs:d,code:h,data:f,factory:m,factoryData:p,gas:g,gasPrice:A,maxFeePerBlobGas:v,maxFeePerGas:S,maxPriorityFeePerGas:M,nonce:y,to:x,value:E,stateOverride:D,...I}=t,R=i?Us(i):void 0;if(h&&(m||p))throw new Q("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(h&&x)throw new Q("Cannot provide both `code` & `to` as parameters.");const V=h&&f,O=m&&p&&x&&f,B=V||O,z=V?bx({code:h,data:f}):O?vx({data:f,factory:m,factoryData:p,to:x}):f;try{Kw(t);const Y=(l?ge(l):void 0)||u,W=Zw(D),$=(s=(o=(r=e.chain)==null?void 0:r.formatters)==null?void 0:o.transactionRequest)==null?void 0:s.format,K=($||Vw)({...Ww(I,{format:$}),from:R==null?void 0:R.address,accessList:c,blobs:d,data:z,gas:g,gasPrice:A,maxFeePerBlobGas:v,maxFeePerGas:S,maxPriorityFeePerGas:M,nonce:y,to:B?void 0:x,value:E});if(a&&gx({request:K})&&!W)try{return await yx(e,{...K,blockNumber:l,blockTag:u})}catch(ae){if(!(ae instanceof Jf)&&!(ae instanceof ra))throw ae}const Z=await e.request({method:"eth_call",params:W?[K,Y,W]:[K,Y]});return Z==="0x"?{data:void 0}:{data:Z}}catch(Y){const W=wx(Y),{offchainLookup:$,offchainLookupSignature:K}=await Promise.resolve().then(()=>qx);if(e.ccipRead!==!1&&(W==null?void 0:W.slice(0,10))===K&&x)return{data:await $(e,{data:W,to:x})};throw B&&(W==null?void 0:W.slice(0,10))==="0x101bb98d"?new sx({factory:m}):px(Y,{...t,account:R,chain:e.chain})}}function gx({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(dx)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function yx(e,t){var n;const{batchSize:r=1024,wait:o=0}=typeof((n=e.batch)==null?void 0:n.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:i="latest",data:a,multicallAddress:l,to:u}=t;let c=l;if(!c){if(!e.chain)throw new Jf;c=Sl({blockNumber:s,chain:e.chain,contract:"multicall3"})}const d=(s?ge(s):void 0)||i,{schedule:h}=Eh({id:`${e.uid}.${d}`,wait:o,shouldSplitBatch(p){return p.reduce((g,{data:A})=>g+(A.length-2),0)>r*2},fn:async p=>{const g=p.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),A=El({abi:nu,args:[g],functionName:"aggregate3"}),v=await e.request({method:"eth_call",params:[{data:A,to:c},d]});return Cl({abi:nu,args:[g],functionName:"aggregate3",data:v||"0x"})}}),[{returnData:f,success:m}]=await h({data:a,to:u});if(!m)throw new wh({data:f});return f==="0x"?{data:void 0}:{data:f}}function bx(e){const{code:t,data:n}=e;return $f({abi:ph(["constructor(bytes, bytes)"]),bytecode:fx,args:[t,n]})}function vx(e){const{data:t,factory:n,factoryData:r,to:o}=e;return $f({abi:ph(["constructor(address, bytes, address, bytes)"]),bytecode:hx,args:[o,t,n,r]})}function wx(e){var t;if(!(e instanceof Q))return;const n=e.walk();return typeof(n==null?void 0:n.data)=="object"?(t=n.data)==null?void 0:t.data:n.data}async function ys(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,a=El({abi:n,args:o,functionName:s});try{const{data:l}=await zs(e,Sh,"call")({...i,data:a,to:r});return Cl({abi:n,args:o,functionName:s,data:l||"0x"})}catch(l){throw ux(l,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}class Ax extends Q{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class xr extends Q{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Pl extends Q{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class xx extends Q{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Cx=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Ex=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,Sx=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Px=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Mx(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function au(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Ph({uri:e,gatewayUrls:t}){const n=Sx.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=au(t==null?void 0:t.ipfs,"https://ipfs.io"),o=au(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(Cx),{protocol:i,subpath:a,target:l,subtarget:u=""}=(s==null?void 0:s.groups)||{},c=i==="ipns:/"||a==="ipns/",d=i==="ipfs:/"||a==="ipfs/"||Ex.test(e);if(e.startsWith("http")&&!c&&!d){let f=e;return t!=null&&t.arweave&&(f=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:f,isOnChain:!1,isEncoded:!1}}if((c||d)&&l)return{uri:`${r}/${c?"ipns":"ipfs"}/${l}${u}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&l)return{uri:`${o}/${l}${u||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(Px,"");if(h.startsWith("<svg")&&(h=`data:image/svg+xml;base64,${btoa(h)}`),h.startsWith("data:")||h.startsWith("{"))return{uri:h,isOnChain:!0,isEncoded:!1};throw new Pl({uri:e})}function Mh(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Ax({data:e});return e.image||e.image_url||e.image_data}async function kx({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(r=>r.json());return await Ml({gatewayUrls:e,uri:Mh(n)})}catch{throw new Pl({uri:t})}}async function Ml({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=Ph({uri:t,gatewayUrls:e});if(r||await Mx(n))return n;throw new Pl({uri:t})}function Ix(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,o]=t.split("/"),[s,i]=n.split(":"),[a,l]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new xr({reason:"Only EIP-155 supported"});if(!i)throw new xr({reason:"Chain ID not found"});if(!l)throw new xr({reason:"Contract address not found"});if(!o)throw new xr({reason:"Token ID not found"});if(!a)throw new xr({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i),namespace:a.toLowerCase(),contractAddress:l,tokenID:o}}async function Ox(e,{nft:t}){if(t.namespace==="erc721")return ys(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return ys(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new xx({namespace:t.namespace})}async function Nx(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Dx(e,{gatewayUrls:t,record:n}):Ml({uri:n,gatewayUrls:t})}async function Dx(e,{gatewayUrls:t,record:n}){const r=Ix(n),o=await Ox(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:a}=Ph({uri:o,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const u=a?atob(s.replace("data:application/json;base64,","")):s,c=JSON.parse(u);return Ml({uri:Mh(c),gatewayUrls:t})}let l=r.tokenID;return r.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),kx({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,l)})}async function Tx(e,{blockNumber:t,blockTag:n,name:r,key:o,gatewayUrls:s,strict:i,universalResolverAddress:a}){let l=a;if(!l){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Sl({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const u={address:l,abi:Xw,functionName:"resolve",args:[ll(Ch(r)),El({abi:ru,functionName:"text",args:[ix(r),o]})],blockNumber:t,blockTag:n},c=zs(e,ys,"readContract"),d=s?await c({...u,args:[...u.args,s]}):await c(u);if(d[0]==="0x")return null;const h=Cl({abi:ru,functionName:"text",data:d[0]});return h===""?null:h}catch(u){if(i)throw u;if(Ah(u,"resolve"))return null;throw u}}async function Rx(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:a}){const l=await zs(e,Tx,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:a,gatewayUrls:s,strict:i});if(!l)return null;try{return await Nx(e,{record:l,gatewayUrls:r})}catch{return null}}async function Fx(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:o,strict:s,universalResolverAddress:i}){let a=i;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Sl({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const l=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const u={address:a,abi:eA,functionName:"reverse",args:[ll(Ch(l))],blockNumber:n,blockTag:r},c=zs(e,ys,"readContract"),[d,h]=o?await c({...u,args:[...u.args,o]}):await c(u);return t.toLowerCase()!==h.toLowerCase()?null:d}catch(u){if(s)throw u;if(Ah(u,"reverse"))return null;throw u}}function Bx(e,t){if(!yt(e,{strict:!1}))throw new xn({address:e});if(!yt(t,{strict:!1}))throw new xn({address:t});return e.toLowerCase()===t.toLowerCase()}async function Lx(e){return new Promise(t=>setTimeout(t,e))}const Go=new hl(8192);function Ux(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Go.get(n))return Go.get(n);const r=e().finally(()=>Go.delete(n));return Go.set(n,r),r}function kh(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((o,s)=>{const i=async({count:a=0}={})=>{const l=async({error:u})=>{const c=typeof t=="function"?t({count:a,error:u}):t;c&&await Lx(c),i({count:a+1})};try{const u=await e();o(u)}catch(u){if(a<n&&await r({count:a,error:u}))return l({error:u});s(u)}};i()})}function zx(e,t={}){return async(n,r={})=>{const{dedupe:o=!1,retryDelay:s=150,retryCount:i=3,uid:a}={...t,...r},l=o?sr(cl(`${a}.${mt(n)}`)):void 0;return Ux(()=>kh(async()=>{try{return await e(n)}catch(u){const c=u;switch(c.code){case Zr.code:throw new Zr(c);case Xr.code:throw new Xr(c);case eo.code:throw new eo(c,{method:n.method});case to.code:throw new to(c);case Cn.code:throw new Cn(c);case no.code:throw new no(c);case ro.code:throw new ro(c);case Gt.code:throw new Gt(c);case oo.code:throw new oo(c);case so.code:throw new so(c,{method:n.method});case ir.code:throw new ir(c);case io.code:throw new io(c);case Ne.code:throw new Ne(c);case ao.code:throw new ao(c);case lo.code:throw new lo(c);case co.code:throw new co(c);case uo.code:throw new uo(c);case En.code:throw new En(c);case 5e3:throw new Ne(c);default:throw u instanceof Q?u:new jw(c)}}},{delay:({count:u,error:c})=>{var d;if(c&&c instanceof vn){const h=(d=c==null?void 0:c.headers)==null?void 0:d.get("Retry-After");if(h!=null&&h.match(/\d/))return Number.parseInt(h)*1e3}return~~(1<<u)*s},retryCount:i,shouldRetry:({error:u})=>jx(u)}),{enabled:o,id:l})}}function jx(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===ir.code||e.code===Cn.code:e instanceof vn&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}class Qx extends Q{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:s,urls:i}){var a;super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],(a=n.metaMessages)!=null&&a.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(l=>` ${Po(l)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class Wx extends Q{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${Po(n)}`,`Response: ${mt(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Hx extends Q{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const Vx="0x556f1830",Ih={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function Gx(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=bh({data:r,abi:[Ih]}),[i,a,l,u,c]=s,{ccipRead:d}=e,h=d&&typeof(d==null?void 0:d.request)=="function"?d.request:Oh;try{if(!Bx(o,i))throw new Hx({sender:i,to:o});const f=await h({data:l,sender:i,urls:a}),{data:m}=await Sh(e,{blockNumber:t,blockTag:n,data:Jt([u,yl([{type:"bytes"},{type:"bytes"}],[f,c])]),to:o});return m}catch(f){throw new Qx({callbackSelector:u,cause:f,data:r,extraData:c,sender:i,urls:a})}}async function Oh({data:e,sender:t,urls:n}){var r;let o=new Error("An unknown error occurred.");for(let s=0;s<n.length;s++){const i=n[s],a=i.includes("{data}")?"GET":"POST",l=a==="POST"?{data:e,sender:t}:void 0,u=a==="POST"?{"Content-Type":"application/json"}:{};try{const c=await fetch(i.replace("{sender}",t).replace("{data}",e),{body:JSON.stringify(l),headers:u,method:a});let d;if((r=c.headers.get("Content-Type"))!=null&&r.startsWith("application/json")?d=(await c.json()).data:d=await c.text(),!c.ok){o=new vn({body:l,details:d!=null&&d.error?mt(d.error):c.statusText,headers:c.headers,status:c.status,url:i});continue}if(!On(d)){o=new Wx({result:d,url:i});continue}return d}catch(c){o=new vn({body:l,details:c.message,url:i})}}throw o}const qx=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Oh,offchainLookup:Gx,offchainLookupAbiItem:Ih,offchainLookupSignature:Vx},Symbol.toStringTag,{value:"Module"}));function Kx(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function Nh(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((o,s)=>{(async()=>{let i;try{const a=new AbortController;n>0&&(i=setTimeout(()=>{r?a.abort():s(t)},n)),o(await e({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(t),s(a)}finally{clearTimeout(i)}})()})}function Yx(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const lu=Yx();function $x(e,t={}){return{async request(n){var r;const{body:o,onRequest:s=t.onRequest,onResponse:i=t.onResponse,timeout:a=t.timeout??1e4}=n,l={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:u,method:c,signal:d}=l;try{const h=await Nh(async({signal:m})=>{const p={...l,body:Array.isArray(o)?mt(o.map(v=>({jsonrpc:"2.0",id:v.id??lu.take(),...v}))):mt({jsonrpc:"2.0",id:o.id??lu.take(),...o}),headers:{"Content-Type":"application/json",...u},method:c||"POST",signal:d||(a>0?m:null)},g=new Request(e,p),A=await(s==null?void 0:s(g,p))??{...p,url:e};return await fetch(A.url??e,A)},{errorInstance:new Xc({body:o,url:e}),timeout:a,signal:!0});i&&await i(h);let f;if((r=h.headers.get("Content-Type"))!=null&&r.startsWith("application/json"))f=await h.json();else{f=await h.text();try{f=JSON.parse(f||"{}")}catch(m){if(h.ok)throw m;f={error:f}}}if(!h.ok)throw new vn({body:o,details:mt(f.error)||h.statusText,headers:h.headers,status:h.status,url:e});return f}catch(h){throw h instanceof vn||h instanceof Xc?h:new vn({body:o,cause:h,url:e})}}}}function Dh(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const o=e[n];return typeof o=="function"?o:s=>t(e,s)}const ss="2.16.0",Jx=()=>`@wagmi/core@${ss}`;var Th=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},bs,Rh;let kl=class ba extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Jx()}constructor(t,n={}){var r;super(),bs.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const o=n.cause instanceof ba?n.cause.details:(r=n.cause)!=null&&r.message?n.cause.message:n.details,s=n.cause instanceof ba&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...o?[`Details: ${o}`]:[],`Version: ${this.version}`].join(`
74
+ `),n.cause&&(this.cause=n.cause),this.details=o,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return Th(this,bs,"m",Rh).call(this,this,t)}};bs=new WeakSet,Rh=function e(t,n){return n!=null&&n(t)?t:t.cause?Th(this,bs,"m",e).call(this,t.cause,n):t};class va extends kl{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}const wa=256;let qo=wa,Ko;function Fh(e=11){if(!Ko||qo+e>wa*2){Ko="",qo=0;for(let t=0;t<wa;t++)Ko+=(256+Math.random()*256|0).toString(16).substring(1)}return Ko.substring(qo,qo+++e)}function _x(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,ccipRead:r,key:o="base",name:s="Base Client",pollingInterval:i=4e3,type:a="base"}=e,l=e.chain,u=e.account?Us(e.account):void 0,{config:c,request:d,value:h}=e.transport({chain:l,pollingInterval:i}),f={...c,...h},m={account:u,batch:t,cacheTime:n,ccipRead:r,chain:l,key:o,name:s,pollingInterval:i,request:d,transport:f,type:a,uid:Fh()};function p(g){return A=>{const v=A(g);for(const M in m)delete v[M];const S={...g,...v};return Object.assign(S,{extend:p(S)})}}return Object.assign(m,{extend:p(m)})}function Zx({key:e,name:t,request:n,retryCount:r=3,retryDelay:o=150,timeout:s,type:i},a){const l=Fh();return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:o,timeout:s,type:i},request:zx(n,{retryCount:r,retryDelay:o,uid:l}),value:a}}class Xx extends Q{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function e1(e,t={}){const{batch:n,fetchOptions:r,key:o="http",name:s="HTTP JSON-RPC",onFetchRequest:i,onFetchResponse:a,retryDelay:l}=t;return({chain:u,retryCount:c,timeout:d})=>{const{batchSize:h=1e3,wait:f=0}=typeof n=="object"?n:{},m=t.retryCount??c,p=d??t.timeout??1e4,g=u==null?void 0:u.rpcUrls.default.http[0];if(!g)throw new Xx;const A=$x(g,{fetchOptions:r,onRequest:i,onResponse:a,timeout:p});return Zx({key:o,name:s,async request({method:v,params:S}){const M={method:v,params:S},{schedule:y}=Eh({id:g,wait:f,shouldSplitBatch(I){return I.length>h},fn:I=>A.request({body:I}),sort:(I,R)=>I.id-R.id}),x=async I=>n?y(I):[await A.request({body:I})],[{error:E,result:D}]=await x(M);if(E)throw new eh({body:M,error:E,url:g});return D},retryCount:m,retryDelay:l,timeout:p,type:"http"},{fetchOptions:r,url:g})}}function cu(e){return e.state.chainId}function t1(e,t){const{chainId:n,...r}=t,o=e.getClient({chainId:n});return Dh(o,Rx,"getEnsAvatar")(r)}function n1(e,t){const{chainId:n,...r}=t,o=e.getClient({chainId:n});return Dh(o,Fx,"getEnsName")(r)}let yi=!1;async function r1(e,t={}){var n,r;if(yi)return[];yi=!0,e.setState(d=>({...d,status:d.current?"reconnecting":"connecting"}));const o=[];if((n=t.connectors)!=null&&n.length)for(const d of t.connectors){let h;typeof d=="function"?h=e._internal.connectors.setup(d):h=d,o.push(h)}else o.push(...e.connectors);let s;try{s=await((r=e.storage)==null?void 0:r.getItem("recentConnectorId"))}catch{}const i={};for(const[,d]of e.state.connections)i[d.connector.id]=1;s&&(i[s]=0);const a=Object.keys(i).length>0?[...o].sort((d,h)=>(i[d.id]??10)-(i[h.id]??10)):o;let l=!1;const u=[],c=[];for(const d of a){const h=await d.getProvider().catch(()=>{});if(!h||c.some(m=>m===h)||!await d.isAuthorized())continue;const f=await d.connect({isReconnecting:!0}).catch(()=>null);f&&(d.emitter.off("connect",e._internal.events.connect),d.emitter.on("change",e._internal.events.change),d.emitter.on("disconnect",e._internal.events.disconnect),e.setState(m=>{const p=new Map(l?m.connections:new Map).set(d.uid,{accounts:f.accounts,chainId:f.chainId,connector:d});return{...m,current:l?m.current:d.uid,connections:p}}),u.push({accounts:f.accounts,chainId:f.chainId,connector:d}),c.push(h),l=!0)}return(e.state.status==="reconnecting"||e.state.status==="connecting")&&(l?e.setState(d=>({...d,status:"connected"})):e.setState(d=>({...d,connections:new Map,current:null,status:"disconnected"}))),yi=!1,u}class Rn extends kl{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}function o1(e,t){const{onChange:n}=t;return e.subscribe(r=>r.chainId,n)}Il.type="injected";function Il(e={}){const{shimDisconnect:t=!0,unstable_shimAsyncInject:n}=e;function r(){const l=e.target;if(typeof l=="function"){const u=l();if(u)return u}return typeof l=="object"?l:typeof l=="string"?{...s1[l]??{id:l,name:`${l[0].toUpperCase()}${l.slice(1)}`,provider:`is${l[0].toUpperCase()}${l.slice(1)}`}}:{id:"injected",name:"Injected",provider(u){return u==null?void 0:u.ethereum}}}let o,s,i,a;return l=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:Il.type,async setup(){const u=await this.getProvider();u!=null&&u.on&&e.target&&(i||(i=this.onConnect.bind(this),u.on("connect",i)),o||(o=this.onAccountsChanged.bind(this),u.on("accountsChanged",o)))},async connect({chainId:u,isReconnecting:c}={}){var d,h,f,m,p,g;const A=await this.getProvider();if(!A)throw new Rn;let v=[];if(c)v=await this.getAccounts().catch(()=>[]);else if(t)try{v=(m=(f=(h=(d=(await A.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:d.caveats)==null?void 0:h[0])==null?void 0:f.value)==null?void 0:m.map(S=>Vo(S)),v.length>0&&(v=await this.getAccounts())}catch(S){const M=S;if(M.code===Ne.code)throw new Ne(M);if(M.code===Gt.code)throw M}try{!(v!=null&&v.length)&&!c&&(v=(await A.request({method:"eth_requestAccounts"})).map(M=>Vo(M))),i&&(A.removeListener("connect",i),i=void 0),o||(o=this.onAccountsChanged.bind(this),A.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),A.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),A.on("disconnect",a));let S=await this.getChainId();if(u&&S!==u){const M=await this.switchChain({chainId:u}).catch(y=>{if(y.code===Ne.code)throw y;return{id:S}});S=(M==null?void 0:M.id)??S}return t&&await((p=l.storage)==null?void 0:p.removeItem(`${this.id}.disconnected`)),e.target||await((g=l.storage)==null?void 0:g.setItem("injected.connected",!0)),{accounts:v,chainId:S}}catch(S){const M=S;throw M.code===Ne.code?new Ne(M):M.code===Gt.code?new Gt(M):M}},async disconnect(){var u,c;const d=await this.getProvider();if(!d)throw new Rn;s&&(d.removeListener("chainChanged",s),s=void 0),a&&(d.removeListener("disconnect",a),a=void 0),i||(i=this.onConnect.bind(this),d.on("connect",i));try{await Nh(()=>d.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}t&&await((u=l.storage)==null?void 0:u.setItem(`${this.id}.disconnected`,!0)),e.target||await((c=l.storage)==null?void 0:c.removeItem("injected.connected"))},async getAccounts(){const u=await this.getProvider();if(!u)throw new Rn;return(await u.request({method:"eth_accounts"})).map(c=>Vo(c))},async getChainId(){const u=await this.getProvider();if(!u)throw new Rn;const c=await u.request({method:"eth_chainId"});return Number(c)},async getProvider(){if(typeof window>"u")return;let u;const c=r();return typeof c.provider=="function"?u=c.provider(window):typeof c.provider=="string"?u=is(window,c.provider):u=c.provider,u&&!u.removeListener&&("off"in u&&typeof u.off=="function"?u.removeListener=u.off:u.removeListener=()=>{}),u},async isAuthorized(){var u,c;try{if(t&&await((u=l.storage)==null?void 0:u.getItem(`${this.id}.disconnected`))||!e.target&&!await((c=l.storage)==null?void 0:c.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const d=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",d),!!await this.getProvider()),h=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(f=>window.addEventListener("ethereum#initialized",()=>f(d()),{once:!0}))]:[],new Promise(f=>setTimeout(()=>f(d()),h))]))return!0}throw new Rn}return!!(await kh(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:c}){var d,h,f,m;const p=await this.getProvider();if(!p)throw new Rn;const g=l.chains.find(v=>v.id===c);if(!g)throw new En(new va);const A=new Promise(v=>{const S=M=>{"chainId"in M&&M.chainId===c&&(l.emitter.off("change",S),v())};l.emitter.on("change",S)});try{return await Promise.all([p.request({method:"wallet_switchEthereumChain",params:[{chainId:ge(c)}]}).then(async()=>{await this.getChainId()===c&&l.emitter.emit("change",{chainId:c})}),A]),g}catch(v){const S=v;if(S.code===4902||((h=(d=S==null?void 0:S.data)==null?void 0:d.originalError)==null?void 0:h.code)===4902)try{const{default:M,...y}=g.blockExplorers??{};let x;u!=null&&u.blockExplorerUrls?x=u.blockExplorerUrls:M&&(x=[M.url,...Object.values(y).map(I=>I.url)]);let E;(f=u==null?void 0:u.rpcUrls)!=null&&f.length?E=u.rpcUrls:E=[((m=g.rpcUrls.default)==null?void 0:m.http[0])??""];const D={blockExplorerUrls:x,chainId:ge(c),chainName:(u==null?void 0:u.chainName)??g.name,iconUrls:u==null?void 0:u.iconUrls,nativeCurrency:(u==null?void 0:u.nativeCurrency)??g.nativeCurrency,rpcUrls:E};return await Promise.all([p.request({method:"wallet_addEthereumChain",params:[D]}).then(async()=>{if(await this.getChainId()===c)l.emitter.emit("change",{chainId:c});else throw new Ne(new Error("User rejected switch after adding network."))}),A]),g}catch(M){throw new Ne(M)}throw S.code===Ne.code?new Ne(S):new En(S)}},async onAccountsChanged(u){var c;if(u.length===0)this.onDisconnect();else if(l.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),t&&await((c=l.storage)==null?void 0:c.removeItem(`${this.id}.disconnected`))}else l.emitter.emit("change",{accounts:u.map(d=>Vo(d))})},onChainChanged(u){const c=Number(u);l.emitter.emit("change",{chainId:c})},async onConnect(u){const c=await this.getAccounts();if(c.length===0)return;const d=Number(u.chainId);l.emitter.emit("connect",{accounts:c,chainId:d});const h=await this.getProvider();h&&(i&&(h.removeListener("connect",i),i=void 0),o||(o=this.onAccountsChanged.bind(this),h.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),h.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),h.on("disconnect",a)))},async onDisconnect(u){const c=await this.getProvider();u&&u.code===1013&&c&&(await this.getAccounts()).length||(l.emitter.emit("disconnect"),c&&(s&&(c.removeListener("chainChanged",s),s=void 0),a&&(c.removeListener("disconnect",a),a=void 0),i||(i=this.onConnect.bind(this),c.on("connect",i))))}})}const s1={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(e){return e!=null&&e.coinbaseWalletExtension?e.coinbaseWalletExtension:is(e,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(e){return is(e,t=>{if(!t.isMetaMask||t.isBraveWallet&&!t._events&&!t._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(t[r])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(e){var t,n;return(t=e==null?void 0:e.phantom)!=null&&t.ethereum?(n=e.phantom)==null?void 0:n.ethereum:is(e,"isPhantom")}}};function is(e,t){function n(o){return typeof t=="function"?t(o):typeof t=="string"?o[t]:!0}const r=e.ethereum;if(r!=null&&r.providers)return r.providers.find(o=>n(o));if(r&&n(r))return r}function i1(e){if(typeof window>"u")return;const t=n=>e(n.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}function a1(){const e=new Set;let t=[];const n=()=>i1(o=>{t.some(({info:s})=>s.uuid===o.info.uuid)||(t=[...t,o],e.forEach(s=>s(t,{added:[o]})))});let r=n();return{_listeners(){return e},clear(){e.forEach(o=>o([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),r==null||r()},findProvider({rdns:o}){return t.find(s=>s.info.rdns===o)},getProviders(){return t},reset(){this.clear(),r==null||r(),r=n()},subscribe(o,{emitImmediately:s}={}){return e.add(o),s&&o(t,{added:t}),()=>e.delete(o)}}}const l1=e=>(t,n,r)=>{const o=r.subscribe;return r.subscribe=(s,i,a)=>{let l=s;if(i){const u=(a==null?void 0:a.equalityFn)||Object.is;let c=s(r.getState());l=d=>{const h=s(d);if(!u(c,h)){const f=c;i(c=h,f)}},a!=null&&a.fireImmediately&&i(c,c)}return o(l)},e(t,n,r)},c1=l1;function u1(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var o;const s=a=>a===null?null:JSON.parse(a,void 0),i=(o=n.getItem(r))!=null?o:null;return i instanceof Promise?i.then(s):s(i)},setItem:(r,o)=>n.setItem(r,JSON.stringify(o,void 0)),removeItem:r=>n.removeItem(r)}}const Aa=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Aa(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Aa(r)(n)}}}},d1=(e,t)=>(n,r,o)=>{let s={storage:u1(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...t},i=!1;const a=new Set,l=new Set;let u=s.storage;if(!u)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...p)},r,o);const c=()=>{const p=s.partialize({...r()});return u.setItem(s.name,{state:p,version:s.version})},d=o.setState;o.setState=(p,g)=>{d(p,g),c()};const h=e((...p)=>{n(...p),c()},r,o);o.getInitialState=()=>h;let f;const m=()=>{var p,g;if(!u)return;i=!1,a.forEach(v=>{var S;return v((S=r())!=null?S:h)});const A=((g=s.onRehydrateStorage)==null?void 0:g.call(s,(p=r())!=null?p:h))||void 0;return Aa(u.getItem.bind(u))(s.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==s.version){if(s.migrate)return[!0,s.migrate(v.state,v.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var S;const[M,y]=v;if(f=s.merge(y,(S=r())!=null?S:h),n(f,!0),M)return c()}).then(()=>{A==null||A(f,void 0),f=r(),i=!0,l.forEach(v=>v(f))}).catch(v=>{A==null||A(void 0,v)})};return o.persist={setOptions:p=>{s={...s,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(l.add(p),()=>{l.delete(p)})},s.skipHydration||m(),f||h},f1=d1,uu=e=>{let t;const n=new Set,r=(a,l)=>{const u=typeof a=="function"?a(t):a;if(!Object.is(u,t)){const c=t;t=l??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(d=>d(t,c))}},o=()=>t,s={setState:r,getState:o,getInitialState:()=>i,subscribe:a=>(n.add(a),()=>n.delete(a))},i=t=e(r,o,s);return s},bi=e=>e?uu(e):uu;var du={exports:{}},fu;function h1(){return fu||(fu=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function s(l,u,c,d,h){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new o(c,d||l,h),m=n?n+u:u;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],f]:l._events[m].push(f):(l._events[m]=f,l._eventsCount++),l}function i(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,c;if(this._eventsCount===0)return l;for(c in u=this._events)t.call(u,c)&&l.push(n?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=n?n+l:l,c=this._events[u];if(!c)return[];if(c.fn)return[c.fn];for(var d=0,h=c.length,f=new Array(h);d<h;d++)f[d]=c[d].fn;return f},a.prototype.listenerCount=function(l){var u=n?n+l:l,c=this._events[u];return c?c.fn?1:c.length:0},a.prototype.emit=function(l,u,c,d,h,f){var m=n?n+l:l;if(!this._events[m])return!1;var p=this._events[m],g=arguments.length,A,v;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),g){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,u),!0;case 3:return p.fn.call(p.context,u,c),!0;case 4:return p.fn.call(p.context,u,c,d),!0;case 5:return p.fn.call(p.context,u,c,d,h),!0;case 6:return p.fn.call(p.context,u,c,d,h,f),!0}for(v=1,A=new Array(g-1);v<g;v++)A[v-1]=arguments[v];p.fn.apply(p.context,A)}else{var S=p.length,M;for(v=0;v<S;v++)switch(p[v].once&&this.removeListener(l,p[v].fn,void 0,!0),g){case 1:p[v].fn.call(p[v].context);break;case 2:p[v].fn.call(p[v].context,u);break;case 3:p[v].fn.call(p[v].context,u,c);break;case 4:p[v].fn.call(p[v].context,u,c,d);break;default:if(!A)for(M=1,A=new Array(g-1);M<g;M++)A[M-1]=arguments[M];p[v].fn.apply(p[v].context,A)}}return!0},a.prototype.on=function(l,u,c){return s(this,l,u,c,!1)},a.prototype.once=function(l,u,c){return s(this,l,u,c,!0)},a.prototype.removeListener=function(l,u,c,d){var h=n?n+l:l;if(!this._events[h])return this;if(!u)return i(this,h),this;var f=this._events[h];if(f.fn)f.fn===u&&(!d||f.once)&&(!c||f.context===c)&&i(this,h);else{for(var m=0,p=[],g=f.length;m<g;m++)(f[m].fn!==u||d&&!f[m].once||c&&f[m].context!==c)&&p.push(f[m]);p.length?this._events[h]=p.length===1?p[0]:p:i(this,h)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=n?n+l:l,this._events[u]&&i(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}(du)),du.exports}var p1=h1();const m1=tb(p1);class g1{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new m1})}on(t,n){this._emitter.on(t,n)}once(t,n){this._emitter.once(t,n)}off(t,n){this._emitter.off(t,n)}emit(t,...n){const r=n[0];this._emitter.emit(t,{uid:this.uid,...r})}listenerCount(t){return this._emitter.listenerCount(t)}}function y1(e){return new g1(e)}function b1(e,t){return JSON.parse(e,(n,r)=>{let o=r;return(o==null?void 0:o.__type)==="bigint"&&(o=BigInt(o.value)),(o==null?void 0:o.__type)==="Map"&&(o=new Map(o.value)),(t==null?void 0:t(n,o))??o})}function hu(e,t){return e.slice(0,t).join(".")||"."}function pu(e,t){const{length:n}=e;for(let r=0;r<n;++r)if(e[r]===t)return r+1;return 0}function v1(e,t){const n=typeof e=="function",r=typeof t=="function",o=[],s=[];return function(i,a){if(typeof a=="object")if(o.length){const l=pu(o,this);l===0?o[o.length]=this:(o.splice(l),s.splice(l)),s[s.length]=i;const u=pu(o,a);if(u!==0)return r?t.call(this,i,a,hu(s,u)):`[ref=${hu(s,u)}]`}else o[0]=a,s[0]=i;return n?e.call(this,i,a):a}}function w1(e,t,n,r){return JSON.stringify(e,v1((o,s)=>{let i=s;return typeof i=="bigint"&&(i={__type:"bigint",value:s.toString()}),i instanceof Map&&(i={__type:"Map",value:Array.from(s.entries())}),(t==null?void 0:t(o,i))??i},r),n??void 0)}function A1(e){const{deserialize:t=b1,key:n="wagmi",serialize:r=w1,storage:o=Bh}=e;function s(i){return i instanceof Promise?i.then(a=>a).catch(()=>null):i}return{...o,key:n,async getItem(i,a){const l=o.getItem(`${n}.${i}`),u=await s(l);return u?t(u)??null:a??null},async setItem(i,a){const l=`${n}.${i}`;a===null?await s(o.removeItem(l)):await s(o.setItem(l,r(a)))},async removeItem(i){await s(o.removeItem(`${n}.${i}`))}}}const Bh={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},xa=256;let Yo=xa,$o;function x1(e=11){if(!$o||Yo+e>xa*2){$o="",Yo=0;for(let t=0;t<xa;t++)$o+=(256+Math.random()*256|0).toString(16).substring(1)}return $o.substring(Yo,Yo+++e)}function C1(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=A1({storage:typeof window<"u"&&window.localStorage?window.localStorage:Bh}),syncConnectedChain:r=!0,ssr:o=!1,...s}=e,i=typeof window<"u"&&t?a1():void 0,a=bi(()=>s.chains),l=bi(()=>{const y=[],x=new Set;for(const E of s.connectors??[]){const D=u(E);if(y.push(D),!o&&D.rdns){const I=typeof D.rdns=="string"?[D.rdns]:D.rdns;for(const R of I)x.add(R)}}if(!o&&i){const E=i.getProviders();for(const D of E)x.has(D.info.rdns)||y.push(u(c(D)))}return y});function u(y){var x;const E=y1(x1()),D={...y({emitter:E,chains:a.getState(),storage:n,transports:s.transports}),emitter:E,uid:E.uid};return E.on("connect",S),(x=D.setup)==null||x.call(D),D}function c(y){const{info:x}=y,E=y.provider;return Il({target:{...x,id:x.rdns,provider:E}})}const d=new Map;function h(y={}){const x=y.chainId??g.getState().chainId,E=a.getState().find(I=>I.id===x);if(y.chainId&&!E)throw new va;{const I=d.get(g.getState().chainId);if(I&&!E)return I;if(!E)throw new va}{const I=d.get(x);if(I)return I}let D;if(s.client)D=s.client({chain:E});else{const I=E.id,R=a.getState().map(B=>B.id),V={},O=Object.entries(s);for(const[B,z]of O)if(!(B==="chains"||B==="client"||B==="connectors"||B==="transports"))if(typeof z=="object")if(I in z)V[B]=z[I];else{if(R.some(Y=>Y in z))continue;V[B]=z}else V[B]=z;D=_x({...V,chain:E,batch:V.batch??{multicall:!0},transport:B=>s.transports[I]({...B,connectors:l})})}return d.set(x,D),D}function f(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let m;const p="0.0.0-canary-";ss.startsWith(p)?m=Number.parseInt(ss.replace(p,"")):m=Number.parseInt(ss.split(".")[0]??"0");const g=bi(c1(n?f1(f,{migrate(y,x){if(x===m)return y;const E=f(),D=A(y,E.chainId);return{...E,chainId:D}},name:"store",partialize(y){return{connections:{__type:"Map",value:Array.from(y.connections.entries()).map(([x,E])=>{const{id:D,name:I,type:R,uid:V}=E.connector;return[x,{...E,connector:{id:D,name:I,type:R,uid:V}}]})},chainId:y.chainId,current:y.current}},merge(y,x){typeof y=="object"&&y&&"status"in y&&delete y.status;const E=A(y,x.chainId);return{...x,...y,chainId:E}},skipHydration:o,storage:n,version:m}):f));g.setState(f());function A(y,x){return y&&typeof y=="object"&&"chainId"in y&&typeof y.chainId=="number"&&a.getState().some(E=>E.id===y.chainId)?y.chainId:x}r&&g.subscribe(({connections:y,current:x})=>{var E;return x?(E=y.get(x))==null?void 0:E.chainId:void 0},y=>{if(a.getState().some(x=>x.id===y))return g.setState(x=>({...x,chainId:y??x.chainId}))}),i==null||i.subscribe(y=>{const x=new Set,E=new Set;for(const I of l.getState())if(x.add(I.id),I.rdns){const R=typeof I.rdns=="string"?[I.rdns]:I.rdns;for(const V of R)E.add(V)}const D=[];for(const I of y){if(E.has(I.info.rdns))continue;const R=u(c(I));x.has(R.id)||D.push(R)}n&&!g.persist.hasHydrated()||l.setState(I=>[...I,...D],!0)});function v(y){g.setState(x=>{const E=x.connections.get(y.uid);return E?{...x,connections:new Map(x.connections).set(y.uid,{accounts:y.accounts??E.accounts,chainId:y.chainId??E.chainId,connector:E.connector})}:x})}function S(y){g.getState().status==="connecting"||g.getState().status==="reconnecting"||g.setState(x=>{const E=l.getState().find(D=>D.uid===y.uid);return E?(E.emitter.listenerCount("connect")&&E.emitter.off("connect",v),E.emitter.listenerCount("change")||E.emitter.on("change",v),E.emitter.listenerCount("disconnect")||E.emitter.on("disconnect",M),{...x,connections:new Map(x.connections).set(y.uid,{accounts:y.accounts,chainId:y.chainId,connector:E}),current:y.uid,status:"connected"}):x})}function M(y){g.setState(x=>{const E=x.connections.get(y.uid);if(E){const I=E.connector;I.emitter.listenerCount("change")&&E.connector.emitter.off("change",v),I.emitter.listenerCount("disconnect")&&E.connector.emitter.off("disconnect",M),I.emitter.listenerCount("connect")||E.connector.emitter.on("connect",S)}if(x.connections.delete(y.uid),x.connections.size===0)return{...x,connections:new Map,current:null,status:"disconnected"};const D=x.connections.values().next().value;return{...x,connections:new Map(x.connections),current:D.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return l.getState()},storage:n,getClient:h,get state(){return g.getState()},setState(y){let x;typeof y=="function"?x=y(g.getState()):x=y;const E=f();typeof x!="object"&&(x=E),Object.keys(E).some(D=>!(D in x))&&(x=E),g.setState(x,!0)},subscribe(y,x,E){return g.subscribe(y,x,E?{...E,fireImmediately:E.emitImmediately}:void 0)},_internal:{mipd:i,store:g,ssr:!!o,syncConnectedChain:r,transports:s.transports,chains:{setState(y){const x=typeof y=="function"?y(a.getState()):y;if(x.length!==0)return a.setState(x,!0)},subscribe(y){return a.subscribe(y)}},connectors:{providerDetailToConnector:c,setup:u,setState(y){return l.setState(typeof y=="function"?y(l.getState()):y,!0)},subscribe(y){return l.subscribe(y)}},events:{change:v,connect:S,disconnect:M}}}}function E1(e,t){const{initialState:n,reconnectOnMount:r}=t;return n&&!e._internal.store.persist.hasHydrated()&&e.setState({...n,chainId:e.chains.some(o=>o.id===n.chainId)?n.chainId:e.chains[0].id,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){e._internal.ssr&&(await e._internal.store.persist.rehydrate(),e._internal.mipd&&e._internal.connectors.setState(o=>{var s;const i=new Set;for(const u of o??[])if(u.rdns){const c=Array.isArray(u.rdns)?u.rdns:[u.rdns];for(const d of c)i.add(d)}const a=[],l=((s=e._internal.mipd)==null?void 0:s.getProviders())??[];for(const u of l){if(i.has(u.info.rdns))continue;const c=e._internal.connectors.providerDetailToConnector(u),d=e._internal.connectors.setup(c);a.push(d)}return[...o,...a]})),r?r1(e):e.storage&&e.setState(o=>({...o,connections:new Map}))}}}function S1(e){const{children:t,config:n,initialState:r,reconnectOnMount:o=!0}=e,{onMount:s}=E1(n,{initialState:r,reconnectOnMount:o});n._internal.ssr||s();const i=nr(!0);return Ue(()=>{if(i.current&&n._internal.ssr)return s(),()=>{i.current=!1}},[]),t}const Lh=za(void 0);function P1(e){const{children:t,config:n}=e,r={value:n};return $r(S1,e,$r(Lh.Provider,r,t))}const M1="2.14.1",k1=()=>`wagmi@${M1}`;class I1 extends kl{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return k1()}}class O1 extends I1{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function Ol(e={}){const t=e.config??Ua(Lh);if(!t)throw new O1;return t}var Mo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Sn=typeof window>"u"||"Deno"in globalThis;function $e(){}function N1(e,t){return typeof e=="function"?e(t):e}function Ca(e){return typeof e=="number"&&e>=0&&e!==1/0}function Uh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function er(e,t){return typeof e=="function"?e(t):e}function tt(e,t){return typeof e=="function"?e(t):e}function mu(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Nl(i,t.options))return!1}else if(!po(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function gu(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(ho(t.options.mutationKey)!==ho(s))return!1}else if(!po(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Nl(e,t){return((t==null?void 0:t.queryKeyHashFn)||ho)(e)}function ho(e){return JSON.stringify(e,(t,n)=>Sa(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function po(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!po(e[n],t[n])):!1}function zh(e,t){if(e===t)return e;const n=yu(e)&&yu(t);if(n||Sa(e)&&Sa(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let l=0;for(let u=0;u<i;u++){const c=n?u:s[u];(!n&&r.includes(c)||n)&&e[c]===void 0&&t[c]===void 0?(a[c]=void 0,l++):(a[c]=zh(e[c],t[c]),a[c]===e[c]&&e[c]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function Ea(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function yu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sa(e){if(!bu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!bu(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function bu(e){return Object.prototype.toString.call(e)==="[object Object]"}function D1(e){return new Promise(t=>{setTimeout(t,e)})}function Pa(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?zh(e,t):t}function T1(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function R1(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Dl=Symbol();function jh(e,t){return!e.queryFn&&t!=null&&t.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Dl?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Fn,nn,Cr,vu,F1=(vu=class extends Mo{constructor(){super(),ee(this,Fn),ee(this,nn),ee(this,Cr),G(this,Cr,e=>{if(!Sn&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){P(this,nn)||this.setEventListener(P(this,Cr))}onUnsubscribe(){var e;this.hasListeners()||((e=P(this,nn))==null||e.call(this),G(this,nn,void 0))}setEventListener(e){var t;G(this,Cr,e),(t=P(this,nn))==null||t.call(this),G(this,nn,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){P(this,Fn)!==e&&(G(this,Fn,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof P(this,Fn)=="boolean"?P(this,Fn):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Fn=new WeakMap,nn=new WeakMap,Cr=new WeakMap,vu),Tl=new F1,Er,rn,Sr,wu,B1=(wu=class extends Mo{constructor(){super(),ee(this,Er,!0),ee(this,rn),ee(this,Sr),G(this,Sr,e=>{if(!Sn&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}})}onSubscribe(){P(this,rn)||this.setEventListener(P(this,Sr))}onUnsubscribe(){var e;this.hasListeners()||((e=P(this,rn))==null||e.call(this),G(this,rn,void 0))}setEventListener(e){var t;G(this,Sr,e),(t=P(this,rn))==null||t.call(this),G(this,rn,e(this.setOnline.bind(this)))}setOnline(e){P(this,Er)!==e&&(G(this,Er,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return P(this,Er)}},Er=new WeakMap,rn=new WeakMap,Sr=new WeakMap,wu),vs=new B1;function Ma(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function L1(e){return Math.min(1e3*2**e,3e4)}function Qh(e){return(e??"online")==="online"?vs.isOnline():!0}var Wh=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function vi(e){return e instanceof Wh}function Hh(e){let t=!1,n=0,r=!1,o;const s=Ma(),i=p=>{var g;r||(h(new Wh(p)),(g=e.abort)==null||g.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Tl.isFocused()&&(e.networkMode==="always"||vs.isOnline())&&e.canRun(),c=()=>Qh(e.networkMode)&&e.canRun(),d=p=>{var g;r||(r=!0,(g=e.onSuccess)==null||g.call(e,p),o==null||o(),s.resolve(p))},h=p=>{var g;r||(r=!0,(g=e.onError)==null||g.call(e,p),o==null||o(),s.reject(p))},f=()=>new Promise(p=>{var g;o=A=>{(r||u())&&p(A)},(g=e.onPause)==null||g.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),m=()=>{if(r)return;let p;const g=n===0?e.initialPromise:void 0;try{p=g??e.fn()}catch(A){p=Promise.reject(A)}Promise.resolve(p).then(d).catch(A=>{var v;if(r)return;const S=e.retry??(Sn?0:3),M=e.retryDelay??L1,y=typeof M=="function"?M(n,A):M,x=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,A);if(t||!x){h(A);return}n++,(v=e.onFail)==null||v.call(e,n,A),D1(y).then(()=>u()?void 0:f()).then(()=>{t?h(A):m()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?m():f().then(m),s)}}function U1(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var ke=U1(),Bn,Au,Vh=(Au=class{constructor(){ee(this,Bn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ca(this.gcTime)&&G(this,Bn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Sn?1/0:5*60*1e3))}clearGcTimeout(){P(this,Bn)&&(clearTimeout(P(this,Bn)),G(this,Bn,void 0))}},Bn=new WeakMap,Au),Pr,Mr,et,Oe,Jo,Ln,ct,xt,xu,z1=(xu=class extends Vh{constructor(e){super(),ee(this,ct),ee(this,Pr),ee(this,Mr),ee(this,et),ee(this,Oe),ee(this,Jo),ee(this,Ln),G(this,Ln,!1),G(this,Jo,e.defaultOptions),this.setOptions(e.options),this.observers=[],G(this,et,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,G(this,Pr,j1(this.options)),this.state=e.state??P(this,Pr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=P(this,Oe))==null?void 0:e.promise}setOptions(e){this.options={...P(this,Jo),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,et).remove(this)}setData(e,t){const n=Pa(this.state.data,e,this.options);return ce(this,ct,xt).call(this,{data:n,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),n}setState(e,t){ce(this,ct,xt).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var t,n;const r=(t=P(this,Oe))==null?void 0:t.promise;return(n=P(this,Oe))==null||n.cancel(e),r?r.then($e).catch($e):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,Pr))}isActive(){return this.observers.some(e=>tt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dl||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Uh(this.state.dataUpdatedAt,e)}onFocus(){var e;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(e=P(this,Oe))==null||e.continue()}onOnline(){var e;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(e=P(this,Oe))==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),P(this,et).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(P(this,Oe)&&(P(this,Ln)?P(this,Oe).cancel({revert:!0}):P(this,Oe).cancelRetry()),this.scheduleGc()),P(this,et).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,ct,xt).call(this,{type:"invalidate"})}fetch(e,t){var n,r,o;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t!=null&&t.cancelRefetch)this.cancel({silent:!0});else if(P(this,Oe))return P(this,Oe).continueRetry(),P(this,Oe).promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const s=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(G(this,Ln,!0),s.signal)})},a=()=>{const c=jh(this.options,t),d={queryKey:this.queryKey,meta:this.meta};return i(d),G(this,Ln,!1),this.options.persister?this.options.persister(c,d,this):c(d)},l={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};i(l),(n=this.options.behavior)==null||n.onFetch(l,this),G(this,Mr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((r=l.fetchOptions)==null?void 0:r.meta))&&ce(this,ct,xt).call(this,{type:"fetch",meta:(o=l.fetchOptions)==null?void 0:o.meta});const u=c=>{var d,h,f,m;vi(c)&&c.silent||ce(this,ct,xt).call(this,{type:"error",error:c}),vi(c)||((h=(d=P(this,et).config).onError)==null||h.call(d,c,this),(m=(f=P(this,et).config).onSettled)==null||m.call(f,this.state.data,c,this)),this.scheduleGc()};return G(this,Oe,Hh({initialPromise:t==null?void 0:t.initialPromise,fn:l.fetchFn,abort:s.abort.bind(s),onSuccess:c=>{var d,h,f,m;if(c===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(p){u(p);return}(h=(d=P(this,et).config).onSuccess)==null||h.call(d,c,this),(m=(f=P(this,et).config).onSettled)==null||m.call(f,c,this.state.error,this),this.scheduleGc()},onError:u,onFail:(c,d)=>{ce(this,ct,xt).call(this,{type:"failed",failureCount:c,error:d})},onPause:()=>{ce(this,ct,xt).call(this,{type:"pause"})},onContinue:()=>{ce(this,ct,xt).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),P(this,Oe).start()}},Pr=new WeakMap,Mr=new WeakMap,et=new WeakMap,Oe=new WeakMap,Jo=new WeakMap,Ln=new WeakMap,ct=new WeakSet,xt=function(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Gh(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return vi(r)&&r.revert&&P(this,Mr)?{...P(this,Mr),fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),ke.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),P(this,et).notify({query:this,type:"updated",action:e})})},xu);function Gh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Qh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function j1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ct,Cu,Q1=(Cu=class extends Mo{constructor(e={}){super(),ee(this,Ct),this.config=e,G(this,Ct,new Map)}build(e,t,n){const r=t.queryKey,o=t.queryHash??Nl(r,t);let s=this.get(o);return s||(s=new z1({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){P(this,Ct).has(e.queryHash)||(P(this,Ct).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=P(this,Ct).get(e.queryHash);t&&(e.destroy(),t===e&&P(this,Ct).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ke.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return P(this,Ct).get(e)}getAll(){return[...P(this,Ct).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>mu(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>mu(e,n)):t}notify(e){ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ke.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ke.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ct=new WeakMap,Cu),Et,Re,Un,St,Ut,Eu,W1=(Eu=class extends Vh{constructor(e){super(),ee(this,St),ee(this,Et),ee(this,Re),ee(this,Un),this.mutationId=e.mutationId,G(this,Re,e.mutationCache),G(this,Et,[]),this.state=e.state||H1(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){P(this,Et).includes(e)||(P(this,Et).push(e),this.clearGcTimeout(),P(this,Re).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){G(this,Et,P(this,Et).filter(t=>t!==e)),this.scheduleGc(),P(this,Re).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){P(this,Et).length||(this.state.status==="pending"?this.scheduleGc():P(this,Re).remove(this))}continue(){var e;return((e=P(this,Un))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var t,n,r,o,s,i,a,l,u,c,d,h,f,m,p,g,A,v,S,M;G(this,Un,Hh({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,D)=>{ce(this,St,Ut).call(this,{type:"failed",failureCount:E,error:D})},onPause:()=>{ce(this,St,Ut).call(this,{type:"pause"})},onContinue:()=>{ce(this,St,Ut).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,Re).canRun(this)}));const y=this.state.status==="pending",x=!P(this,Un).canStart();try{if(!y){ce(this,St,Ut).call(this,{type:"pending",variables:e,isPaused:x}),await((n=(t=P(this,Re).config).onMutate)==null?void 0:n.call(t,e,this));const D=await((o=(r=this.options).onMutate)==null?void 0:o.call(r,e));D!==this.state.context&&ce(this,St,Ut).call(this,{type:"pending",context:D,variables:e,isPaused:x})}const E=await P(this,Un).start();return await((i=(s=P(this,Re).config).onSuccess)==null?void 0:i.call(s,E,e,this.state.context,this)),await((l=(a=this.options).onSuccess)==null?void 0:l.call(a,E,e,this.state.context)),await((c=(u=P(this,Re).config).onSettled)==null?void 0:c.call(u,E,null,this.state.variables,this.state.context,this)),await((h=(d=this.options).onSettled)==null?void 0:h.call(d,E,null,e,this.state.context)),ce(this,St,Ut).call(this,{type:"success",data:E}),E}catch(E){try{throw await((m=(f=P(this,Re).config).onError)==null?void 0:m.call(f,E,e,this.state.context,this)),await((g=(p=this.options).onError)==null?void 0:g.call(p,E,e,this.state.context)),await((v=(A=P(this,Re).config).onSettled)==null?void 0:v.call(A,void 0,E,this.state.variables,this.state.context,this)),await((M=(S=this.options).onSettled)==null?void 0:M.call(S,void 0,E,e,this.state.context)),E}finally{ce(this,St,Ut).call(this,{type:"error",error:E})}}finally{P(this,Re).runNext(this)}}},Et=new WeakMap,Re=new WeakMap,Un=new WeakMap,St=new WeakSet,Ut=function(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ke.batch(()=>{P(this,Et).forEach(n=>{n.onMutationUpdate(e)}),P(this,Re).notify({mutation:this,type:"updated",action:e})})},Eu);function H1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ye,_o,Su,V1=(Su=class extends Mo{constructor(e={}){super(),ee(this,Ye),ee(this,_o),this.config=e,G(this,Ye,new Map),G(this,_o,Date.now())}build(e,t,n){const r=new W1({mutationCache:this,mutationId:++Yi(this,_o)._,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=Zo(e),n=P(this,Ye).get(t)??[];n.push(e),P(this,Ye).set(t,n),this.notify({type:"added",mutation:e})}remove(e){var t;const n=Zo(e);if(P(this,Ye).has(n)){const r=(t=P(this,Ye).get(n))==null?void 0:t.filter(o=>o!==e);r&&(r.length===0?P(this,Ye).delete(n):P(this,Ye).set(n,r))}this.notify({type:"removed",mutation:e})}canRun(e){var t;const n=(t=P(this,Ye).get(Zo(e)))==null?void 0:t.find(r=>r.state.status==="pending");return!n||n===e}runNext(e){var t;const n=(t=P(this,Ye).get(Zo(e)))==null?void 0:t.find(r=>r!==e&&r.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){ke.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...P(this,Ye).values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(n=>gu(t,n))}findAll(e={}){return this.getAll().filter(t=>gu(e,t))}notify(e){ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ke.batch(()=>Promise.all(e.map(t=>t.continue().catch($e))))}},Ye=new WeakMap,_o=new WeakMap,Su);function Zo(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Pu(e){return{onFetch:(t,n)=>{var r,o,s,i,a;const l=t.options,u=(s=(o=(r=t.fetchOptions)==null?void 0:r.meta)==null?void 0:o.fetchMore)==null?void 0:s.direction,c=((i=t.state.data)==null?void 0:i.pages)||[],d=((a=t.state.data)==null?void 0:a.pageParams)||[];let h={pages:[],pageParams:[]},f=0;const m=async()=>{let p=!1;const g=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},A=jh(t.options,t.fetchOptions),v=async(S,M,y)=>{if(p)return Promise.reject();if(M==null&&S.pages.length)return Promise.resolve(S);const x={queryKey:t.queryKey,pageParam:M,direction:y?"backward":"forward",meta:t.options.meta};g(x);const E=await A(x),{maxPages:D}=t.options,I=y?R1:T1;return{pages:I(S.pages,E,D),pageParams:I(S.pageParams,M,D)}};if(u&&c.length){const S=u==="backward",M=S?G1:Mu,y={pages:c,pageParams:d},x=M(l,y);h=await v(y,x,S)}else{const S=e??c.length;do{const M=f===0?d[0]??l.initialPageParam:Mu(l,h);if(f>0&&M==null)break;h=await v(h,M),f++}while(f<S)}return h};t.options.persister?t.fetchFn=()=>{var p,g;return(g=(p=t.options).persister)==null?void 0:g.call(p,m,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=m}}}function Mu(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function G1(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ae,on,sn,kr,Ir,an,Or,Nr,ku,q1=(ku=class{constructor(e={}){ee(this,Ae),ee(this,on),ee(this,sn),ee(this,kr),ee(this,Ir),ee(this,an),ee(this,Or),ee(this,Nr),G(this,Ae,e.queryCache||new Q1),G(this,on,e.mutationCache||new V1),G(this,sn,e.defaultOptions||{}),G(this,kr,new Map),G(this,Ir,new Map),G(this,an,0)}mount(){Yi(this,an)._++,P(this,an)===1&&(G(this,Or,Tl.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,Ae).onFocus())})),G(this,Nr,vs.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,Ae).onOnline())})))}unmount(){var e,t;Yi(this,an)._--,P(this,an)===0&&((e=P(this,Or))==null||e.call(this),G(this,Or,void 0),(t=P(this,Nr))==null||t.call(this),G(this,Nr,void 0))}isFetching(e){return P(this,Ae).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,on).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=P(this,Ae).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,Ae).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(er(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,Ae).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=P(this,Ae).get(r.queryHash),s=o==null?void 0:o.state.data,i=N1(t,s);if(i!==void 0)return P(this,Ae).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return ke.batch(()=>P(this,Ae).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=P(this,Ae).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const t=P(this,Ae);ke.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,Ae),r={type:"active",...e};return ke.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ke.batch(()=>P(this,Ae).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then($e).catch($e)}invalidateQueries(e,t={}){return ke.batch(()=>{if(P(this,Ae).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ke.batch(()=>P(this,Ae).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch($e)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then($e)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,Ae).build(this,t);return n.isStaleByTime(er(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($e).catch($e)}fetchInfiniteQuery(e){return e.behavior=Pu(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($e).catch($e)}ensureInfiniteQueryData(e){return e.behavior=Pu(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return vs.isOnline()?P(this,on).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,Ae)}getMutationCache(){return P(this,on)}getDefaultOptions(){return P(this,sn)}setDefaultOptions(e){G(this,sn,e)}setQueryDefaults(e,t){P(this,kr).set(ho(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,kr).values()],n={};return t.forEach(r=>{po(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,Ir).set(ho(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Ir).values()];let n={};return t.forEach(r=>{po(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,sn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nl(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Dl&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,sn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,Ae).clear(),P(this,on).clear()}},Ae=new WeakMap,on=new WeakMap,sn=new WeakMap,kr=new WeakMap,Ir=new WeakMap,an=new WeakMap,Or=new WeakMap,Nr=new WeakMap,ku),He,le,Xo,Fe,zn,Dr,ln,Pt,es,Tr,Rr,jn,Qn,cn,Fr,xe,Br,wi,Ai,xi,Ci,Ei,Si,Pi,Iu,Ou,K1=(Ou=class extends Mo{constructor(e,t){super(),ee(this,xe),ee(this,He),ee(this,le),ee(this,Xo),ee(this,Fe),ee(this,zn),ee(this,Dr),ee(this,ln),ee(this,Pt),ee(this,es),ee(this,Tr),ee(this,Rr),ee(this,jn),ee(this,Qn),ee(this,cn),ee(this,Fr,new Set),this.options=t,G(this,He,e),G(this,Pt,null),G(this,ln,Ma()),this.options.experimental_prefetchInRender||P(this,ln).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,le).addObserver(this),Nu(P(this,le),this.options)?ce(this,xe,Br).call(this):this.updateResult(),ce(this,xe,Ci).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ka(P(this,le),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ka(P(this,le),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,xe,Ei).call(this),ce(this,xe,Si).call(this),P(this,le).removeObserver(this)}setOptions(e,t){const n=this.options,r=P(this,le);if(this.options=P(this,He).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof tt(this.options.enabled,P(this,le))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,xe,Pi).call(this),P(this,le).setOptions(this.options),n._defaulted&&!Ea(this.options,n)&&P(this,He).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,le),observer:this});const o=this.hasListeners();o&&Du(P(this,le),r,this.options,n)&&ce(this,xe,Br).call(this),this.updateResult(t),o&&(P(this,le)!==r||tt(this.options.enabled,P(this,le))!==tt(n.enabled,P(this,le))||er(this.options.staleTime,P(this,le))!==er(n.staleTime,P(this,le)))&&ce(this,xe,wi).call(this);const s=ce(this,xe,Ai).call(this);o&&(P(this,le)!==r||tt(this.options.enabled,P(this,le))!==tt(n.enabled,P(this,le))||s!==P(this,cn))&&ce(this,xe,xi).call(this,s)}getOptimisticResult(e){const t=P(this,He).getQueryCache().build(P(this,He),e),n=this.createResult(t,e);return $1(this,n)&&(G(this,Fe,n),G(this,Dr,this.options),G(this,zn,P(this,le).state)),n}getCurrentResult(){return P(this,Fe)}trackResult(e,t){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t==null||t(r),e[r])})}),n}trackProp(e){P(this,Fr).add(e)}getCurrentQuery(){return P(this,le)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=P(this,He).defaultQueryOptions(e),n=P(this,He).getQueryCache().build(P(this,He),t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return ce(this,xe,Br).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Fe)))}createResult(e,t){var n;const r=P(this,le),o=this.options,s=P(this,Fe),i=P(this,zn),a=P(this,Dr),l=e!==r?e.state:P(this,Xo),{state:u}=e;let c={...u},d=!1,h;if(t._optimisticResults){const x=this.hasListeners(),E=!x&&Nu(e,t),D=x&&Du(e,r,t,o);(E||D)&&(c={...c,...Gh(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:f,errorUpdatedAt:m,status:p}=c;if(t.select&&c.data!==void 0)if(s&&c.data===(i==null?void 0:i.data)&&t.select===P(this,es))h=P(this,Tr);else try{G(this,es,t.select),h=t.select(c.data),h=Pa(s==null?void 0:s.data,h,t),G(this,Tr,h),G(this,Pt,null)}catch(x){G(this,Pt,x)}else h=c.data;if(t.placeholderData!==void 0&&h===void 0&&p==="pending"){let x;if(s!=null&&s.isPlaceholderData&&t.placeholderData===(a==null?void 0:a.placeholderData))x=s.data;else if(x=typeof t.placeholderData=="function"?t.placeholderData((n=P(this,Rr))==null?void 0:n.state.data,P(this,Rr)):t.placeholderData,t.select&&x!==void 0)try{x=t.select(x),G(this,Pt,null)}catch(E){G(this,Pt,E)}x!==void 0&&(p="success",h=Pa(s==null?void 0:s.data,x,t),d=!0)}P(this,Pt)&&(f=P(this,Pt),h=P(this,Tr),m=Date.now(),p="error");const g=c.fetchStatus==="fetching",A=p==="pending",v=p==="error",S=A&&g,M=h!==void 0,y={status:p,fetchStatus:c.fetchStatus,isPending:A,isSuccess:p==="success",isError:v,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:c.dataUpdatedAt,error:f,errorUpdatedAt:m,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:g,isRefetching:g&&!A,isLoadingError:v&&!M,isPaused:c.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:v&&M,isStale:Rl(e,t),refetch:this.refetch,promise:P(this,ln)};if(this.options.experimental_prefetchInRender){const x=I=>{y.status==="error"?I.reject(y.error):y.data!==void 0&&I.resolve(y.data)},E=()=>{const I=G(this,ln,y.promise=Ma());x(I)},D=P(this,ln);switch(D.status){case"pending":e.queryHash===r.queryHash&&x(D);break;case"fulfilled":(y.status==="error"||y.data!==D.value)&&E();break;case"rejected":(y.status!=="error"||y.error!==D.reason)&&E();break}}return y}updateResult(e){const t=P(this,Fe),n=this.createResult(P(this,le),this.options);if(G(this,zn,P(this,le).state),G(this,Dr,this.options),P(this,zn).data!==void 0&&G(this,Rr,P(this,le)),Ea(n,t))return;G(this,Fe,n);const r={},o=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!P(this,Fr).size)return!0;const a=new Set(i??P(this,Fr));return this.options.throwOnError&&a.add("error"),Object.keys(P(this,Fe)).some(l=>{const u=l;return P(this,Fe)[u]!==t[u]&&a.has(u)})};(e==null?void 0:e.listeners)!==!1&&o()&&(r.listeners=!0),ce(this,xe,Iu).call(this,{...r,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,xe,Ci).call(this)}},He=new WeakMap,le=new WeakMap,Xo=new WeakMap,Fe=new WeakMap,zn=new WeakMap,Dr=new WeakMap,ln=new WeakMap,Pt=new WeakMap,es=new WeakMap,Tr=new WeakMap,Rr=new WeakMap,jn=new WeakMap,Qn=new WeakMap,cn=new WeakMap,Fr=new WeakMap,xe=new WeakSet,Br=function(e){ce(this,xe,Pi).call(this);let t=P(this,le).fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch($e)),t},wi=function(){ce(this,xe,Ei).call(this);const e=er(this.options.staleTime,P(this,le));if(Sn||P(this,Fe).isStale||!Ca(e))return;const t=Uh(P(this,Fe).dataUpdatedAt,e)+1;G(this,jn,setTimeout(()=>{P(this,Fe).isStale||this.updateResult()},t))},Ai=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,le)):this.options.refetchInterval)??!1},xi=function(e){ce(this,xe,Si).call(this),G(this,cn,e),!(Sn||tt(this.options.enabled,P(this,le))===!1||!Ca(P(this,cn))||P(this,cn)===0)&&G(this,Qn,setInterval(()=>{(this.options.refetchIntervalInBackground||Tl.isFocused())&&ce(this,xe,Br).call(this)},P(this,cn)))},Ci=function(){ce(this,xe,wi).call(this),ce(this,xe,xi).call(this,ce(this,xe,Ai).call(this))},Ei=function(){P(this,jn)&&(clearTimeout(P(this,jn)),G(this,jn,void 0))},Si=function(){P(this,Qn)&&(clearInterval(P(this,Qn)),G(this,Qn,void 0))},Pi=function(){const e=P(this,He).getQueryCache().build(P(this,He),this.options);if(e===P(this,le))return;const t=P(this,le);G(this,le,e),G(this,Xo,e.state),this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))},Iu=function(e){ke.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(P(this,Fe))}),P(this,He).getQueryCache().notify({query:P(this,le),type:"observerResultsUpdated"})})},Ou);function Y1(e,t){return tt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Nu(e,t){return Y1(e,t)||e.state.data!==void 0&&ka(e,t,t.refetchOnMount)}function ka(e,t,n){if(tt(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Rl(e,t)}return!1}function Du(e,t,n,r){return(e!==t||tt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Rl(e,n)}function Rl(e,t){return tt(t.enabled,e)!==!1&&e.isStaleByTime(er(t.staleTime,e))}function $1(e,t){return!Ea(e.getCurrentResult(),t)}function J1(e){return JSON.stringify(e,(t,n)=>_1(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):typeof n=="bigint"?n.toString():n)}function _1(e){if(!Tu(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Tu(n)||!n.hasOwnProperty("isPrototypeOf"))}function Tu(e){return Object.prototype.toString.call(e)==="[object Object]"}function qh(e){const{_defaulted:t,behavior:n,gcTime:r,initialData:o,initialDataUpdatedAt:s,maxPages:i,meta:a,networkMode:l,queryFn:u,queryHash:c,queryKey:d,queryKeyHashFn:h,retry:f,retryDelay:m,structuralSharing:p,getPreviousPageParam:g,getNextPageParam:A,initialPageParam:v,_optimisticResults:S,enabled:M,notifyOnChangeProps:y,placeholderData:x,refetchInterval:E,refetchIntervalInBackground:D,refetchOnMount:I,refetchOnReconnect:R,refetchOnWindowFocus:V,retryOnMount:O,select:B,staleTime:z,suspense:Y,throwOnError:W,config:$,connector:K,query:Z,...ae}=e;return ae}function Z1(e,t={}){return{async queryFn({queryKey:n}){const{name:r,scopeKey:o,...s}=n[1];if(!r)throw new Error("name is required");return t1(e,{...s,name:r})},queryKey:X1(t)}}function X1(e={}){return["ensAvatar",qh(e)]}function eC(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:o,...s}=n[1];if(!r)throw new Error("address is required");return n1(e,{...s,address:r})},queryKey:tC(t)}}function tC(e={}){return["ensName",qh(e)]}var Kh=b.createContext(void 0),nC=e=>{const t=b.useContext(Kh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},rC=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w(Kh.Provider,{value:e,children:t})),Yh=b.createContext(!1),oC=()=>b.useContext(Yh);Yh.Provider;function sC(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var iC=b.createContext(sC()),aC=()=>b.useContext(iC);function lC(e,t){return typeof e=="function"?e(...t):!!e}function Ru(){}var cC=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},uC=e=>{b.useEffect(()=>{e.clearReset()},[e])},dC=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&lC(n,[e.error,r]),fC=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},hC=(e,t)=>e.isLoading&&e.isFetching&&!t,pC=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Fu=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function mC(e,t,n){var r,o,s,i,a;const l=nC(),u=oC(),c=aC(),d=l.defaultQueryOptions(e);(o=(r=l.getDefaultOptions().queries)==null?void 0:r._experimental_beforeQuery)==null||o.call(r,d),d._optimisticResults=u?"isRestoring":"optimistic",fC(d),cC(d,c),uC(c);const h=!l.getQueryCache().get(d.queryHash),[f]=b.useState(()=>new t(l,d)),m=f.getOptimisticResult(d);if(b.useSyncExternalStore(b.useCallback(p=>{const g=u?Ru:f.subscribe(ke.batchCalls(p));return f.updateResult(),g},[f,u]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(d,{listeners:!1})},[d,f]),pC(d,m))throw Fu(d,f,c);if(dC({result:m,errorResetBoundary:c,throwOnError:d.throwOnError,query:l.getQueryCache().get(d.queryHash)}))throw m.error;if((i=(s=l.getDefaultOptions().queries)==null?void 0:s._experimental_afterQuery)==null||i.call(s,d,m),d.experimental_prefetchInRender&&!Sn&&hC(m,u)){const p=h?Fu(d,f,c):(a=l.getQueryCache().get(d.queryHash))==null?void 0:a.promise;p==null||p.catch(Ru).finally(()=>{f.updateResult()})}return d.notifyOnChangeProps?m:f.trackResult(m)}function gC(e,t){return mC(e,K1)}function $h(e){const t=gC({...e,queryKeyHashFn:J1});return t.queryKey=e.queryKey,t}function Jh(e={}){const t=Ol(e);return ug(n=>o1(t,{onChange:n}),()=>cu(t),()=>cu(t))}function yC(e={}){const{name:t,query:n={}}=e,r=Ol(e),o=Jh({config:r}),s=Z1(r,{...e,chainId:e.chainId??o}),i=!!(t&&(n.enabled??!0));return $h({...n,...s,enabled:i})}function _h(e={}){const{address:t,query:n={}}=e,r=Ol(e),o=Jh({config:r}),s=eC(r,{...e,chainId:e.chainId??o}),i=!!(t&&(n.enabled??!0));return $h({...n,...s,enabled:i})}var ko=e=>e.type==="checkbox",mn=e=>e instanceof Date,De=e=>e==null;const Zh=e=>typeof e=="object";var Ee=e=>!De(e)&&!Array.isArray(e)&&Zh(e)&&!mn(e),Xh=e=>Ee(e)&&e.target?ko(e.target)?e.target.checked:e.target.value:e,bC=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ep=(e,t)=>e.has(bC(t)),vC=e=>{const t=e.constructor&&e.constructor.prototype;return Ee(t)&&t.hasOwnProperty("isPrototypeOf")},Fl=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Be(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Fl&&(e instanceof Blob||r))&&(n||Ee(e)))if(t=n?[]:{},!n&&!vC(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Be(e[o]));else return e;return t}var js=e=>Array.isArray(e)?e.filter(Boolean):[],ye=e=>e===void 0,U=(e,t,n)=>{if(!t||!Ee(e))return n;const r=js(t.split(/[,[\].]+?/)).reduce((o,s)=>De(o)?o:o[s],e);return ye(r)||r===e?ye(e[t])?n:e[t]:r},Ve=e=>typeof e=="boolean",Bl=e=>/^\w*$/.test(e),tp=e=>js(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ue=(e,t,n)=>{let r=-1;const o=Bl(t)?[t]:tp(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let l=n;if(r!==i){const u=e[a];l=Ee(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=l,e=e[a]}return e};const ws={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},rt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Mt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},np=re.createContext(null),Qs=()=>re.useContext(np),wC=e=>{const{children:t,...n}=e;return re.createElement(np.Provider,{value:n},t)};var rp=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==rt.all&&(t._proxyFormState[i]=!r||rt.all),n&&(n[i]=!0),e[i]}});return o},Le=e=>Ee(e)&&!Object.keys(e).length,op=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Le(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!r||rt.all))},qr=e=>Array.isArray(e)?e:[e],sp=(e,t,n)=>!e||!t||e===t||qr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Ll(e){const t=re.useRef(e);t.current=e,re.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function AC(e){const t=Qs(),{control:n=t.control,disabled:r,name:o,exact:s}=e||{},[i,a]=re.useState(n._formState),l=re.useRef(!0),u=re.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=re.useRef(o);return c.current=o,Ll({disabled:r,next:d=>l.current&&sp(c.current,d.name,s)&&op(d,u.current,n._updateFormState)&&a({...n._formState,...d}),subject:n._subjects.state}),re.useEffect(()=>(l.current=!0,u.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),re.useMemo(()=>rp(i,n,u.current,!1),[i,n])}var ft=e=>typeof e=="string",ip=(e,t,n,r,o)=>ft(e)?(r&&t.watch.add(e),U(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),U(n,s))):(r&&(t.watchAll=!0),n);function xC(e){const t=Qs(),{control:n=t.control,name:r,defaultValue:o,disabled:s,exact:i}=e||{},a=re.useRef(r);a.current=r,Ll({disabled:s,subject:n._subjects.values,next:c=>{sp(a.current,c.name,i)&&u(Be(ip(a.current,n._names,c.values||n._formValues,!1,o)))}});const[l,u]=re.useState(n._getWatch(r,o));return re.useEffect(()=>n._removeUnmounted()),l}function CC(e){const t=Qs(),{name:n,disabled:r,control:o=t.control,shouldUnregister:s}=e,i=ep(o._names.array,n),a=xC({control:o,name:n,defaultValue:U(o._formValues,n,U(o._defaultValues,n,e.defaultValue)),exact:!0}),l=AC({control:o,name:n,exact:!0}),u=re.useRef(o.register(n,{...e.rules,value:a,...Ve(e.disabled)?{disabled:e.disabled}:{}})),c=re.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!U(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!U(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!U(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!U(l.validatingFields,n)},error:{enumerable:!0,get:()=>U(l.errors,n)}}),[l,n]),d=re.useMemo(()=>({name:n,value:a,...Ve(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:h=>u.current.onChange({target:{value:Xh(h),name:n},type:ws.CHANGE}),onBlur:()=>u.current.onBlur({target:{value:U(o._formValues,n),name:n},type:ws.BLUR}),ref:h=>{const f=U(o._fields,n);f&&h&&(f._f.ref={focus:()=>h.focus(),select:()=>h.select(),setCustomValidity:m=>h.setCustomValidity(m),reportValidity:()=>h.reportValidity()})}}),[n,o._formValues,r,l.disabled,a,o._fields]);return re.useEffect(()=>{const h=o._options.shouldUnregister||s,f=(m,p)=>{const g=U(o._fields,m);g&&g._f&&(g._f.mount=p)};if(f(n,!0),h){const m=Be(U(o._options.defaultValues,n));ue(o._defaultValues,n,m),ye(U(o._formValues,n))&&ue(o._formValues,n,m)}return()=>{(i?h&&!o._state.action:h)?o.unregister(n):f(n,!1)}},[n,o,i,s]),re.useEffect(()=>{Ve(r)&&U(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n,value:U(o._fields,n)._f.value})},[r,n,o]),re.useMemo(()=>({field:d,formState:l,fieldState:c}),[d,l,c])}const EC=e=>e.render(CC(e));var ap=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Bu=e=>({isOnSubmit:!e||e===rt.onSubmit,isOnBlur:e===rt.onBlur,isOnChange:e===rt.onChange,isOnAll:e===rt.all,isOnTouch:e===rt.onTouched}),Lu=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Kr=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=U(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r||i.ref&&t(i.ref,i.name)&&!r)return!0;if(Kr(a,t))break}else if(Ee(a)&&Kr(a,t))break}}};var SC=(e,t,n)=>{const r=qr(U(e,n));return ue(r,"root",t[n]),ue(e,n,r),e},Ul=e=>e.type==="file",dt=e=>typeof e=="function",As=e=>{if(!Fl)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},as=e=>ft(e),zl=e=>e.type==="radio",xs=e=>e instanceof RegExp;const Uu={value:!1,isValid:!1},zu={value:!0,isValid:!0};var lp=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ye(e[0].attributes.value)?ye(e[0].value)||e[0].value===""?zu:{value:e[0].value,isValid:!0}:zu:Uu}return Uu};const ju={isValid:!1,value:null};var cp=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ju):ju;function Qu(e,t,n="validate"){if(as(e)||Array.isArray(e)&&e.every(as)||Ve(e)&&!e)return{type:n,message:as(e)?e:"",ref:t}}var Wn=e=>Ee(e)&&!xs(e)?e:{value:e,message:""},Wu=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:l,minLength:u,min:c,max:d,pattern:h,validate:f,name:m,valueAsNumber:p,mount:g,disabled:A}=e._f,v=U(t,m);if(!g||A)return{};const S=i?i[0]:s,M=O=>{r&&S.reportValidity&&(S.setCustomValidity(Ve(O)?"":O||""),S.reportValidity())},y={},x=zl(s),E=ko(s),D=x||E,I=(p||Ul(s))&&ye(s.value)&&ye(v)||As(s)&&s.value===""||v===""||Array.isArray(v)&&!v.length,R=ap.bind(null,m,n,y),V=(O,B,z,Y=Mt.maxLength,W=Mt.minLength)=>{const $=O?B:z;y[m]={type:O?Y:W,message:$,ref:s,...R(O?Y:W,$)}};if(o?!Array.isArray(v)||!v.length:a&&(!D&&(I||De(v))||Ve(v)&&!v||E&&!lp(i).isValid||x&&!cp(i).isValid)){const{value:O,message:B}=as(a)?{value:!!a,message:a}:Wn(a);if(O&&(y[m]={type:Mt.required,message:B,ref:S,...R(Mt.required,B)},!n))return M(B),y}if(!I&&(!De(c)||!De(d))){let O,B;const z=Wn(d),Y=Wn(c);if(!De(v)&&!isNaN(v)){const W=s.valueAsNumber||v&&+v;De(z.value)||(O=W>z.value),De(Y.value)||(B=W<Y.value)}else{const W=s.valueAsDate||new Date(v),$=ae=>new Date(new Date().toDateString()+" "+ae),K=s.type=="time",Z=s.type=="week";ft(z.value)&&v&&(O=K?$(v)>$(z.value):Z?v>z.value:W>new Date(z.value)),ft(Y.value)&&v&&(B=K?$(v)<$(Y.value):Z?v<Y.value:W<new Date(Y.value))}if((O||B)&&(V(!!O,z.message,Y.message,Mt.max,Mt.min),!n))return M(y[m].message),y}if((l||u)&&!I&&(ft(v)||o&&Array.isArray(v))){const O=Wn(l),B=Wn(u),z=!De(O.value)&&v.length>+O.value,Y=!De(B.value)&&v.length<+B.value;if((z||Y)&&(V(z,O.message,B.message),!n))return M(y[m].message),y}if(h&&!I&&ft(v)){const{value:O,message:B}=Wn(h);if(xs(O)&&!v.match(O)&&(y[m]={type:Mt.pattern,message:B,ref:s,...R(Mt.pattern,B)},!n))return M(B),y}if(f){if(dt(f)){const O=await f(v,t),B=Qu(O,S);if(B&&(y[m]={...B,...R(Mt.validate,B.message)},!n))return M(B.message),y}else if(Ee(f)){let O={};for(const B in f){if(!Le(O)&&!n)break;const z=Qu(await f[B](v,t),S,B);z&&(O={...z,...R(B,z.message)},M(z.message),n&&(y[m]=O))}if(!Le(O)&&(y[m]={ref:S,...O},!n))return y}}return M(!0),y};function PC(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ye(e)?r++:e[t[r++]];return e}function MC(e){for(const t in e)if(e.hasOwnProperty(t)&&!ye(e[t]))return!1;return!0}function Se(e,t){const n=Array.isArray(t)?t:Bl(t)?[t]:tp(t),r=n.length===1?e:PC(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Ee(r)&&Le(r)||Array.isArray(r)&&MC(r))&&Se(e,n.slice(0,-1)),e}var Mi=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(n=>n!==t)}}),unsubscribe:()=>{e=[]}}},Ia=e=>De(e)||!Zh(e);function Qt(e,t){if(Ia(e)||Ia(t))return e===t;if(mn(e)&&mn(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(mn(s)&&mn(i)||Ee(s)&&Ee(i)||Array.isArray(s)&&Array.isArray(i)?!Qt(s,i):s!==i)return!1}}return!0}var up=e=>e.type==="select-multiple",kC=e=>zl(e)||ko(e),ki=e=>As(e)&&e.isConnected,dp=e=>{for(const t in e)if(dt(e[t]))return!0;return!1};function Cs(e,t={}){const n=Array.isArray(e);if(Ee(e)||n)for(const r in e)Array.isArray(e[r])||Ee(e[r])&&!dp(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Cs(e[r],t[r])):De(e[r])||(t[r]=!0);return t}function fp(e,t,n){const r=Array.isArray(e);if(Ee(e)||r)for(const o in e)Array.isArray(e[o])||Ee(e[o])&&!dp(e[o])?ye(t)||Ia(n[o])?n[o]=Array.isArray(e[o])?Cs(e[o],[]):{...Cs(e[o])}:fp(e[o],De(t)?{}:t[o],n[o]):n[o]=!Qt(e[o],t[o]);return n}var Lr=(e,t)=>fp(e,t,Cs(t)),hp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ye(e)?e:t?e===""?NaN:e&&+e:n&&ft(e)?new Date(e):r?r(e):e;function Ii(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Ul(t)?t.files:zl(t)?cp(e.refs).value:up(t)?[...t.selectedOptions].map(({value:n})=>n):ko(t)?lp(e.refs).value:hp(ye(t.value)?e.ref.value:t.value,e)}var IC=(e,t,n,r)=>{const o={};for(const s of e){const i=U(t,s);i&&ue(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Ur=e=>ye(e)?e:xs(e)?e.source:Ee(e)?xs(e.value)?e.value.source:e.value:e;const Hu="AsyncFunction";var OC=e=>!!e&&!!e.validate&&!!(dt(e.validate)&&e.validate.constructor.name===Hu||Ee(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Hu)),NC=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Vu(e,t,n){const r=U(e,n);if(r||Bl(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=U(t,s),a=U(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};o.pop()}return{name:n}}var DC=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,TC=(e,t)=>!js(U(e,t)).length&&Se(e,t);const RC={mode:rt.onSubmit,reValidateMode:rt.onChange,shouldFocusError:!0};function FC(e={}){let t={...RC,...e},n={submitCount:0,isDirty:!1,isLoading:dt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Ee(t.defaultValues)||Ee(t.values)?Be(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Be(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:Mi(),array:Mi(),state:Mi()},h=Bu(t.mode),f=Bu(t.reValidateMode),m=t.criteriaMode===rt.all,p=C=>k=>{clearTimeout(u),u=setTimeout(C,k)},g=async C=>{if(!t.disabled&&(c.isValid||C)){const k=t.resolver?Le((await D()).errors):await R(r,!0);k!==n.isValid&&d.state.next({isValid:k})}},A=(C,k)=>{!t.disabled&&(c.isValidating||c.validatingFields)&&((C||Array.from(a.mount)).forEach(N=>{N&&(k?ue(n.validatingFields,N,k):Se(n.validatingFields,N))}),d.state.next({validatingFields:n.validatingFields,isValidating:!Le(n.validatingFields)}))},v=(C,k=[],N,j,L=!0,F=!0)=>{if(j&&N&&!t.disabled){if(i.action=!0,F&&Array.isArray(U(r,C))){const _=N(U(r,C),j.argA,j.argB);L&&ue(r,C,_)}if(F&&Array.isArray(U(n.errors,C))){const _=N(U(n.errors,C),j.argA,j.argB);L&&ue(n.errors,C,_),TC(n.errors,C)}if(c.touchedFields&&F&&Array.isArray(U(n.touchedFields,C))){const _=N(U(n.touchedFields,C),j.argA,j.argB);L&&ue(n.touchedFields,C,_)}c.dirtyFields&&(n.dirtyFields=Lr(o,s)),d.state.next({name:C,isDirty:O(C,k),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ue(s,C,k)},S=(C,k)=>{ue(n.errors,C,k),d.state.next({errors:n.errors})},M=C=>{n.errors=C,d.state.next({errors:n.errors,isValid:!1})},y=(C,k,N,j)=>{const L=U(r,C);if(L){const F=U(s,C,ye(N)?U(o,C):N);ye(F)||j&&j.defaultChecked||k?ue(s,C,k?F:Ii(L._f)):Y(C,F),i.mount&&g()}},x=(C,k,N,j,L)=>{let F=!1,_=!1;const oe={name:C};if(!t.disabled){const Pe=!!(U(r,C)&&U(r,C)._f&&U(r,C)._f.disabled);if(!N||j){c.isDirty&&(_=n.isDirty,n.isDirty=oe.isDirty=O(),F=_!==oe.isDirty);const Me=Pe||Qt(U(o,C),k);_=!!(!Pe&&U(n.dirtyFields,C)),Me||Pe?Se(n.dirtyFields,C):ue(n.dirtyFields,C,!0),oe.dirtyFields=n.dirtyFields,F=F||c.dirtyFields&&_!==!Me}if(N){const Me=U(n.touchedFields,C);Me||(ue(n.touchedFields,C,N),oe.touchedFields=n.touchedFields,F=F||c.touchedFields&&Me!==N)}F&&L&&d.state.next(oe)}return F?oe:{}},E=(C,k,N,j)=>{const L=U(n.errors,C),F=c.isValid&&Ve(k)&&n.isValid!==k;if(t.delayError&&N?(l=p(()=>S(C,N)),l(t.delayError)):(clearTimeout(u),l=null,N?ue(n.errors,C,N):Se(n.errors,C)),(N?!Qt(L,N):L)||!Le(j)||F){const _={...j,...F&&Ve(k)?{isValid:k}:{},errors:n.errors,name:C};n={...n,..._},d.state.next(_)}},D=async C=>{A(C,!0);const k=await t.resolver(s,t.context,IC(C||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return A(C),k},I=async C=>{const{errors:k}=await D(C);if(C)for(const N of C){const j=U(k,N);j?ue(n.errors,N,j):Se(n.errors,N)}else n.errors=k;return k},R=async(C,k,N={valid:!0})=>{for(const j in C){const L=C[j];if(L){const{_f:F,..._}=L;if(F){const oe=a.array.has(F.name),Pe=L._f&&OC(L._f);Pe&&c.validatingFields&&A([j],!0);const Me=await Wu(L,s,m,t.shouldUseNativeValidation&&!k,oe);if(Pe&&c.validatingFields&&A([j]),Me[F.name]&&(N.valid=!1,k))break;!k&&(U(Me,F.name)?oe?SC(n.errors,Me,F.name):ue(n.errors,F.name,Me[F.name]):Se(n.errors,F.name))}!Le(_)&&await R(_,k,N)}}return N.valid},V=()=>{for(const C of a.unMount){const k=U(r,C);k&&(k._f.refs?k._f.refs.every(N=>!ki(N)):!ki(k._f.ref))&&se(C)}a.unMount=new Set},O=(C,k)=>!t.disabled&&(C&&k&&ue(s,C,k),!Qt(de(),o)),B=(C,k,N)=>ip(C,a,{...i.mount?s:ye(k)?o:ft(C)?{[C]:k}:k},N,k),z=C=>js(U(i.mount?s:o,C,t.shouldUnregister?U(o,C,[]):[])),Y=(C,k,N={})=>{const j=U(r,C);let L=k;if(j){const F=j._f;F&&(!F.disabled&&ue(s,C,hp(k,F)),L=As(F.ref)&&De(k)?"":k,up(F.ref)?[...F.ref.options].forEach(_=>_.selected=L.includes(_.value)):F.refs?ko(F.ref)?F.refs.length>1?F.refs.forEach(_=>(!_.defaultChecked||!_.disabled)&&(_.checked=Array.isArray(L)?!!L.find(oe=>oe===_.value):L===_.value)):F.refs[0]&&(F.refs[0].checked=!!L):F.refs.forEach(_=>_.checked=_.value===L):Ul(F.ref)?F.ref.value="":(F.ref.value=L,F.ref.type||d.values.next({name:C,values:{...s}})))}(N.shouldDirty||N.shouldTouch)&&x(C,L,N.shouldTouch,N.shouldDirty,!0),N.shouldValidate&&ae(C)},W=(C,k,N)=>{for(const j in k){const L=k[j],F=`${C}.${j}`,_=U(r,F);(a.array.has(C)||Ee(L)||_&&!_._f)&&!mn(L)?W(F,L,N):Y(F,L,N)}},$=(C,k,N={})=>{const j=U(r,C),L=a.array.has(C),F=Be(k);ue(s,C,F),L?(d.array.next({name:C,values:{...s}}),(c.isDirty||c.dirtyFields)&&N.shouldDirty&&d.state.next({name:C,dirtyFields:Lr(o,s),isDirty:O(C,F)})):j&&!j._f&&!De(F)?W(C,F,N):Y(C,F,N),Lu(C,a)&&d.state.next({...n}),d.values.next({name:i.mount?C:void 0,values:{...s}})},K=async C=>{i.mount=!0;const k=C.target;let N=k.name,j=!0;const L=U(r,N),F=()=>k.type?Ii(L._f):Xh(C),_=oe=>{j=Number.isNaN(oe)||mn(oe)&&isNaN(oe.getTime())||Qt(oe,U(s,N,oe))};if(L){let oe,Pe;const Me=F(),en=C.type===ws.BLUR||C.type===ws.FOCUS_OUT,Km=!NC(L._f)&&!t.resolver&&!U(n.errors,N)&&!L._f.deps||DC(en,U(n.touchedFields,N),n.isSubmitted,f,h),Ks=Lu(N,a,en);ue(s,N,Me),en?(L._f.onBlur&&L._f.onBlur(C),l&&l(0)):L._f.onChange&&L._f.onChange(C);const Ys=x(N,Me,en,!1),Ym=!Le(Ys)||Ks;if(!en&&d.values.next({name:N,type:C.type,values:{...s}}),Km)return c.isValid&&(t.mode==="onBlur"?en&&g():g()),Ym&&d.state.next({name:N,...Ks?{}:Ys});if(!en&&Ks&&d.state.next({...n}),t.resolver){const{errors:ic}=await D([N]);if(_(Me),j){const $m=Vu(n.errors,r,N),ac=Vu(ic,r,$m.name||N);oe=ac.error,N=ac.name,Pe=Le(ic)}}else A([N],!0),oe=(await Wu(L,s,m,t.shouldUseNativeValidation))[N],A([N]),_(Me),j&&(oe?Pe=!1:c.isValid&&(Pe=await R(r,!0)));j&&(L._f.deps&&ae(L._f.deps),E(N,Pe,oe,Ys))}},Z=(C,k)=>{if(U(n.errors,k)&&C.focus)return C.focus(),1},ae=async(C,k={})=>{let N,j;const L=qr(C);if(t.resolver){const F=await I(ye(C)?C:L);N=Le(F),j=C?!L.some(_=>U(F,_)):N}else C?(j=(await Promise.all(L.map(async F=>{const _=U(r,F);return await R(_&&_._f?{[F]:_}:_)}))).every(Boolean),!(!j&&!n.isValid)&&g()):j=N=await R(r);return d.state.next({...!ft(C)||c.isValid&&N!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:N}:{},errors:n.errors}),k.shouldFocus&&!j&&Kr(r,Z,C?L:a.mount),j},de=C=>{const k={...i.mount?s:o};return ye(C)?k:ft(C)?U(k,C):C.map(N=>U(k,N))},T=(C,k)=>({invalid:!!U((k||n).errors,C),isDirty:!!U((k||n).dirtyFields,C),error:U((k||n).errors,C),isValidating:!!U(n.validatingFields,C),isTouched:!!U((k||n).touchedFields,C)}),H=C=>{C&&qr(C).forEach(k=>Se(n.errors,k)),d.state.next({errors:C?n.errors:{}})},X=(C,k,N)=>{const j=(U(r,C,{_f:{}})._f||{}).ref,L=U(n.errors,C)||{},{ref:F,message:_,type:oe,...Pe}=L;ue(n.errors,C,{...Pe,...k,ref:j}),d.state.next({name:C,errors:n.errors,isValid:!1}),N&&N.shouldFocus&&j&&j.focus&&j.focus()},q=(C,k)=>dt(C)?d.values.subscribe({next:N=>C(B(void 0,k),N)}):B(C,k,!0),se=(C,k={})=>{for(const N of C?qr(C):a.mount)a.mount.delete(N),a.array.delete(N),k.keepValue||(Se(r,N),Se(s,N)),!k.keepError&&Se(n.errors,N),!k.keepDirty&&Se(n.dirtyFields,N),!k.keepTouched&&Se(n.touchedFields,N),!k.keepIsValidating&&Se(n.validatingFields,N),!t.shouldUnregister&&!k.keepDefaultValue&&Se(o,N);d.values.next({values:{...s}}),d.state.next({...n,...k.keepDirty?{isDirty:O()}:{}}),!k.keepIsValid&&g()},J=({disabled:C,name:k,field:N,fields:j,value:L})=>{if(Ve(C)&&i.mount||C){const F=C?void 0:ye(L)?Ii(N?N._f:U(j,k)._f):L;(C||!C&&!ye(F))&&ue(s,k,F),x(k,F,!1,!1,!0)}},fe=(C,k={})=>{let N=U(r,C);const j=Ve(k.disabled)||Ve(t.disabled);return ue(r,C,{...N||{},_f:{...N&&N._f?N._f:{ref:{name:C}},name:C,mount:!0,...k}}),a.mount.add(C),N?J({field:N,disabled:Ve(k.disabled)?k.disabled:t.disabled,name:C,value:k.value}):y(C,!0,k.value),{...j?{disabled:k.disabled||t.disabled}:{},...t.progressive?{required:!!k.required,min:Ur(k.min),max:Ur(k.max),minLength:Ur(k.minLength),maxLength:Ur(k.maxLength),pattern:Ur(k.pattern)}:{},name:C,onChange:K,onBlur:K,ref:L=>{if(L){fe(C,k),N=U(r,C);const F=ye(L.value)&&L.querySelectorAll&&L.querySelectorAll("input,select,textarea")[0]||L,_=kC(F),oe=N._f.refs||[];if(_?oe.find(Pe=>Pe===F):F===N._f.ref)return;ue(r,C,{_f:{...N._f,..._?{refs:[...oe.filter(ki),F,...Array.isArray(U(o,C))?[{}]:[]],ref:{type:F.type,name:C}}:{ref:F}}}),y(C,!1,void 0,F)}else N=U(r,C,{}),N._f&&(N._f.mount=!1),(t.shouldUnregister||k.shouldUnregister)&&!(ep(a.array,C)&&i.action)&&a.unMount.add(C)}}},we=()=>t.shouldFocusError&&Kr(r,Z,a.mount),Ze=C=>{Ve(C)&&(d.state.next({disabled:C}),Kr(r,(k,N)=>{const j=U(r,N);j&&(k.disabled=j._f.disabled||C,Array.isArray(j._f.refs)&&j._f.refs.forEach(L=>{L.disabled=j._f.disabled||C}))},0,!1))},Do=(C,k)=>async N=>{let j;if(N&&(N.preventDefault&&N.preventDefault(),N.persist&&N.persist()),t.disabled){k&&await k({...n.errors},N);return}let L=Be(s);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:F,values:_}=await D();n.errors=F,L=_}else await R(r);if(Se(n.errors,"root"),Le(n.errors)){d.state.next({errors:{}});try{await C(L,N)}catch(F){j=F}}else k&&await k({...n.errors},N),we(),setTimeout(we);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Le(n.errors)&&!j,submitCount:n.submitCount+1,errors:n.errors}),j)throw j},qs=(C,k={})=>{U(r,C)&&(ye(k.defaultValue)?$(C,Be(U(o,C))):($(C,k.defaultValue),ue(o,C,Be(k.defaultValue))),k.keepTouched||Se(n.touchedFields,C),k.keepDirty||(Se(n.dirtyFields,C),n.isDirty=k.defaultValue?O(C,Be(U(o,C))):O()),k.keepError||(Se(n.errors,C),c.isValid&&g()),d.state.next({...n}))},Rt=(C,k={})=>{const N=C?Be(C):o,j=Be(N),L=Le(C),F=L?o:j;if(k.keepDefaultValues||(o=N),!k.keepValues){if(k.keepDirtyValues){const _=new Set([...a.mount,...Object.keys(Lr(o,s))]);for(const oe of Array.from(_))U(n.dirtyFields,oe)?ue(F,oe,U(s,oe)):$(oe,U(F,oe))}else{if(Fl&&ye(C))for(const _ of a.mount){const oe=U(r,_);if(oe&&oe._f){const Pe=Array.isArray(oe._f.refs)?oe._f.refs[0]:oe._f.ref;if(As(Pe)){const Me=Pe.closest("form");if(Me){Me.reset();break}}}}r={}}s=t.shouldUnregister?k.keepDefaultValues?Be(o):{}:Be(F),d.array.next({values:{...F}}),d.values.next({values:{...F}})}a={mount:k.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!c.isValid||!!k.keepIsValid||!!k.keepDirtyValues,i.watch=!!t.shouldUnregister,d.state.next({submitCount:k.keepSubmitCount?n.submitCount:0,isDirty:L?!1:k.keepDirty?n.isDirty:!!(k.keepDefaultValues&&!Qt(C,o)),isSubmitted:k.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:L?{}:k.keepDirtyValues?k.keepDefaultValues&&s?Lr(o,s):n.dirtyFields:k.keepDefaultValues&&C?Lr(o,C):k.keepDirty?n.dirtyFields:{},touchedFields:k.keepTouched?n.touchedFields:{},errors:k.keepErrors?n.errors:{},isSubmitSuccessful:k.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},To=(C,k)=>Rt(dt(C)?C(s):C,k);return{control:{register:fe,unregister:se,getFieldState:T,handleSubmit:Do,setError:X,_executeSchema:D,_getWatch:B,_getDirty:O,_updateValid:g,_removeUnmounted:V,_updateFieldArray:v,_updateDisabledField:J,_getFieldArray:z,_reset:Rt,_resetDefaultValues:()=>dt(t.defaultValues)&&t.defaultValues().then(C=>{To(C,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:Ze,_subjects:d,_proxyFormState:c,_setErrors:M,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(C){i=C},get _defaultValues(){return o},get _names(){return a},set _names(C){a=C},get _formState(){return n},set _formState(C){n=C},get _options(){return t},set _options(C){t={...t,...C}}},trigger:ae,register:fe,handleSubmit:Do,watch:q,setValue:$,getValues:de,reset:To,resetField:qs,clearErrors:H,unregister:se,setError:X,setFocus:(C,k={})=>{const N=U(r,C),j=N&&N._f;if(j){const L=j.refs?j.refs[0]:j.ref;L.focus&&(L.focus(),k.shouldSelect&&dt(L.select)&&L.select())}},getFieldState:T}}function pp(e={}){const t=re.useRef(void 0),n=re.useRef(void 0),[r,o]=re.useState({isDirty:!1,isValidating:!1,isLoading:dt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:dt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...FC(e),formState:r});const s=t.current.control;return s._options=e,Ll({subject:s._subjects.state,next:i=>{op(i,s._proxyFormState,s._updateFormState,!0)&&o({...s._formState})}}),re.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),re.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),re.useEffect(()=>{e.values&&!Qt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),re.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),re.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),re.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),t.current.formState=rp(r,s),t.current}var jl="Dialog",[mp,Ik]=Za(jl),[BC,at]=mp(jl),gp=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=b.useRef(null),l=b.useRef(null),[u=!1,c]=af({prop:r,defaultProp:o,onChange:s});return w(BC,{scope:t,triggerRef:a,contentRef:l,contentId:pt(),titleId:pt(),descriptionId:pt(),open:u,onOpenChange:c,onOpenToggle:b.useCallback(()=>c(d=>!d),[c]),modal:i,children:n})};gp.displayName=jl;var yp="DialogTrigger",LC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=at(yp,n),s=it(t,o.triggerRef);return w(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Hl(o.open),...r,ref:s,onClick:Ke(e.onClick,o.onOpenToggle)})});LC.displayName=yp;var Ql="DialogPortal",[UC,bp]=mp(Ql,{forceMount:void 0}),vp=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=at(Ql,t);return w(UC,{scope:t,forceMount:n,children:b.Children.map(r,i=>w(hr,{present:n||s.open,children:w(rl,{asChild:!0,container:o,children:i})}))})};vp.displayName=Ql;var Es="DialogOverlay",wp=b.forwardRef((e,t)=>{const n=bp(Es,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=at(Es,e.__scopeDialog);return s.modal?w(hr,{present:r||s.open,children:w(zC,{...o,ref:t})}):null});wp.displayName=Es;var zC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=at(Es,n);return w(ol,{as:So,allowPinchZoom:!0,shards:[o.contentRef],children:w(ve.div,{"data-state":Hl(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",Ap=b.forwardRef((e,t)=>{const n=bp(Pn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=at(Pn,e.__scopeDialog);return w(hr,{present:r||s.open,children:s.modal?w(jC,{...o,ref:t}):w(QC,{...o,ref:t})})});Ap.displayName=Pn;var jC=b.forwardRef((e,t)=>{const n=at(Pn,e.__scopeDialog),r=b.useRef(null),o=it(t,n.contentRef,r);return b.useEffect(()=>{const s=r.current;if(s)return Pf(s)},[]),w(xp,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ke(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Ke(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:Ke(e.onFocusOutside,s=>s.preventDefault())})}),QC=b.forwardRef((e,t)=>{const n=at(Pn,e.__scopeDialog),r=b.useRef(!1),o=b.useRef(!1);return w(xp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var i,a;(i=e.onInteractOutside)==null||i.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=s.target;(a=n.triggerRef.current)!=null&&a.contains(l)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),xp=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=at(Pn,n),l=b.useRef(null),u=it(t,l);return uf(),te(Nt,{children:[w(el,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:w(Xa,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Hl(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),te(Nt,{children:[w(WC,{titleId:a.titleId}),w(VC,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Wl="DialogTitle",Cp=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=at(Wl,n);return w(ve.h2,{id:o.titleId,...r,ref:t})});Cp.displayName=Wl;var Ep="DialogDescription",Sp=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=at(Ep,n);return w(ve.p,{id:o.descriptionId,...r,ref:t})});Sp.displayName=Ep;var Pp="DialogClose",Mp=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=at(Pp,n);return w(ve.button,{type:"button",...r,ref:t,onClick:Ke(e.onClick,()=>o.onOpenChange(!1))})});Mp.displayName=Pp;function Hl(e){return e?"open":"closed"}var kp="DialogTitleWarning",[Ok,Ip]=qb(kp,{contentName:Pn,titleName:Wl,docsSlug:"dialog"}),WC=({titleId:e})=>{const t=Ip(kp),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
75
+
76
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
77
+
78
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},HC="DialogDescriptionWarning",VC=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ip(HC).contentName}}.`;return b.useEffect(()=>{var r;const o=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},GC=gp,Op=vp,Vl=wp,Gl=Ap,Np=Cp,Dp=Sp,qC=Mp;const Tp=6048e5,KC=864e5,Gu=Symbol.for("constructDateFrom");function _t(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Gu in e?e[Gu](t):e instanceof Date?new e.constructor(t):new Date(t)}function lt(e,t){return _t(t||e,e)}let YC={};function Io(){return YC}function mo(e,t){var n,r,o,s;const i=Io(),a=(t==null?void 0:t.weekStartsOn)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??i.weekStartsOn??((s=(o=i.locale)==null?void 0:o.options)==null?void 0:s.weekStartsOn)??0,l=lt(e,t==null?void 0:t.in),u=l.getDay(),c=(u<a?7:0)+u-a;return l.setDate(l.getDate()-c),l.setHours(0,0,0,0),l}function Ss(e,t){return mo(e,{...t,weekStartsOn:1})}function Rp(e,t){const n=lt(e,void 0),r=n.getFullYear(),o=_t(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Ss(o),i=_t(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Ss(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function qu(e){const t=lt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function $C(e,...t){const n=_t.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Ku(e,t){const n=lt(e,void 0);return n.setHours(0,0,0,0),n}function JC(e,t,n){const[r,o]=$C(void 0,e,t),s=Ku(r),i=Ku(o),a=+s-qu(s),l=+i-qu(i);return Math.round((a-l)/KC)}function _C(e,t){const n=Rp(e),r=_t(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ss(r)}function ZC(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function XC(e){return!(!ZC(e)&&typeof e!="number"||isNaN(+lt(e)))}function eE(e,t){const n=lt(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const tE={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nE=(e,t,n)=>{let r;const o=tE[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Oi(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const rE={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},oE={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},sE={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iE={date:Oi({formats:rE,defaultWidth:"full"}),time:Oi({formats:oE,defaultWidth:"full"}),dateTime:Oi({formats:sE,defaultWidth:"full"})},aE={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lE=(e,t,n,r)=>aE[e];function zr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const cE={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uE={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dE={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fE={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hE={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pE={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},mE=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},gE={ordinalNumber:mE,era:zr({values:cE,defaultWidth:"wide"}),quarter:zr({values:uE,defaultWidth:"wide",argumentCallback:e=>e-1}),month:zr({values:dE,defaultWidth:"wide"}),day:zr({values:fE,defaultWidth:"wide"}),dayPeriod:zr({values:hE,defaultWidth:"wide",formattingValues:pE,defaultFormattingWidth:"wide"})};function jr(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?bE(a,d=>d.test(i)):yE(a,d=>d.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(i.length);return{value:u,rest:c}}}function yE(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function bE(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function vE(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const wE=/^(\d+)(th|st|nd|rd)?/i,AE=/\d+/i,xE={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},CE={any:[/^b/i,/^(a|c)/i]},EE={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},SE={any:[/1/i,/2/i,/3/i,/4/i]},PE={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ME={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},kE={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},IE={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},OE={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},NE={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},DE={ordinalNumber:vE({matchPattern:wE,parsePattern:AE,valueCallback:e=>parseInt(e,10)}),era:jr({matchPatterns:xE,defaultMatchWidth:"wide",parsePatterns:CE,defaultParseWidth:"any"}),quarter:jr({matchPatterns:EE,defaultMatchWidth:"wide",parsePatterns:SE,defaultParseWidth:"any",valueCallback:e=>e+1}),month:jr({matchPatterns:PE,defaultMatchWidth:"wide",parsePatterns:ME,defaultParseWidth:"any"}),day:jr({matchPatterns:kE,defaultMatchWidth:"wide",parsePatterns:IE,defaultParseWidth:"any"}),dayPeriod:jr({matchPatterns:OE,defaultMatchWidth:"any",parsePatterns:NE,defaultParseWidth:"any"})},TE={code:"en-US",formatDistance:nE,formatLong:iE,formatRelative:lE,localize:gE,match:DE,options:{weekStartsOn:0,firstWeekContainsDate:1}};function RE(e,t){const n=lt(e,void 0);return JC(n,eE(n))+1}function FE(e,t){const n=lt(e,void 0),r=+Ss(n)-+_C(n);return Math.round(r/Tp)+1}function Fp(e,t){var n,r,o,s;const i=lt(e,t==null?void 0:t.in),a=i.getFullYear(),l=Io(),u=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??l.firstWeekContainsDate??((s=(o=l.locale)==null?void 0:o.options)==null?void 0:s.firstWeekContainsDate)??1,c=_t((t==null?void 0:t.in)||e,0);c.setFullYear(a+1,0,u),c.setHours(0,0,0,0);const d=mo(c,t),h=_t((t==null?void 0:t.in)||e,0);h.setFullYear(a,0,u),h.setHours(0,0,0,0);const f=mo(h,t);return+i>=+d?a+1:+i>=+f?a:a-1}function BE(e,t){var n,r,o,s;const i=Io(),a=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??i.firstWeekContainsDate??((s=(o=i.locale)==null?void 0:o.options)==null?void 0:s.firstWeekContainsDate)??1,l=Fp(e,t),u=_t((t==null?void 0:t.in)||e,0);return u.setFullYear(l,0,a),u.setHours(0,0,0,0),mo(u,t)}function LE(e,t){const n=lt(e,t==null?void 0:t.in),r=+mo(n,t)-+BE(n,t);return Math.round(r/Tp)+1}function he(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const zt={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return he(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):he(n+1,2)},d(e,t){return he(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return he(e.getHours()%12||12,t.length)},H(e,t){return he(e.getHours(),t.length)},m(e,t){return he(e.getMinutes(),t.length)},s(e,t){return he(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return he(o,t.length)}},Hn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Yu={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return zt.y(e,t)},Y:function(e,t,n,r){const o=Fp(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return he(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):he(s,t.length)},R:function(e,t){const n=Rp(e);return he(n,t.length)},u:function(e,t){const n=e.getFullYear();return he(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return he(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return he(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return zt.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return he(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=LE(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):he(o,t.length)},I:function(e,t,n){const r=FE(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):he(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):zt.d(e,t)},D:function(e,t,n){const r=RE(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):he(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return he(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return he(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return he(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Hn.noon:r===0?o=Hn.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Hn.evening:r>=12?o=Hn.afternoon:r>=4?o=Hn.morning:o=Hn.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return zt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):zt.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):he(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):he(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):zt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):zt.s(e,t)},S:function(e,t){return zt.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Ju(r);case"XXXX":case"XX":return un(r);case"XXXXX":case"XXX":default:return un(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Ju(r);case"xxxx":case"xx":return un(r);case"xxxxx":case"xxx":default:return un(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+$u(r,":");case"OOOO":default:return"GMT"+un(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+$u(r,":");case"zzzz":default:return"GMT"+un(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return he(r,t.length)},T:function(e,t,n){return he(+e,t.length)}};function $u(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+he(s,2)}function Ju(e,t){return e%60===0?(e>0?"-":"+")+he(Math.abs(e)/60,2):un(e,t)}function un(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=he(Math.trunc(r/60),2),s=he(r%60,2);return n+o+t+s}const _u=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Bp=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},UE=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return _u(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",_u(r,t)).replace("{{time}}",Bp(o,t))},zE={p:Bp,P:UE},jE=/^D+$/,QE=/^Y+$/,WE=["D","DD","YY","YYYY"];function HE(e){return jE.test(e)}function VE(e){return QE.test(e)}function GE(e,t,n){const r=qE(e,t,n);if(console.warn(r),WE.includes(e))throw new RangeError(r)}function qE(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const KE=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,YE=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$E=/^'([^]*?)'?$/,JE=/''/g,_E=/[a-zA-Z]/;function ZE(e,t,n){var r,o,s,i,a,l,u,c;const d=Io(),h=(n==null?void 0:n.locale)??d.locale??TE,f=(n==null?void 0:n.firstWeekContainsDate)??((o=(r=n==null?void 0:n.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??d.firstWeekContainsDate??((i=(s=d.locale)==null?void 0:s.options)==null?void 0:i.firstWeekContainsDate)??1,m=(n==null?void 0:n.weekStartsOn)??((l=(a=n==null?void 0:n.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((c=(u=d.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,p=lt(e,n==null?void 0:n.in);if(!XC(p))throw new RangeError("Invalid time value");let g=t.match(YE).map(v=>{const S=v[0];if(S==="p"||S==="P"){const M=zE[S];return M(v,h.formatLong)}return v}).join("").match(KE).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const S=v[0];if(S==="'")return{isToken:!1,value:XE(v)};if(Yu[S])return{isToken:!0,value:v};if(S.match(_E))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:v}});h.localize.preprocessor&&(g=h.localize.preprocessor(p,g));const A={firstWeekContainsDate:f,weekStartsOn:m,locale:h};return g.map(v=>{if(!v.isToken)return v.value;const S=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&VE(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&HE(S))&&GE(S,t,String(e));const M=Yu[S[0]];return M(p,S,h.localize,A)}).join("")}function XE(e){const t=e.match($E);return t?t[1].replace(JE,"'"):e}function eS(){return Object.assign({},Io())}function tS(e){return`${e.slice(0,7)}...${e.slice(-5)}`}function Lp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Lp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Up(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Lp(e))&&(r&&(r+=" "),r+=t);return r}const Zu=Kx({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),nS=C1({chains:[Zu],transports:{[Zu.id]:e1()}}),rS=new q1;function oS(e){const{children:t,wagmiProviderProps:n,queryClientProviderProps:r}=e,{config:o=nS,...s}=n??{},{client:i=rS,...a}=r??{};return w(P1,{config:o,...s,children:w(rC,{client:i,...a,children:t})})}function Xu(e,t,n){const r=eS(),o=aS(e,n.timeZone,n.locale??r.locale);return"formatToParts"in o?sS(o,t):iS(o,t)}function sS(e,t){const n=e.formatToParts(t);for(let r=n.length-1;r>=0;--r)if(n[r].type==="timeZoneName")return n[r].value}function iS(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}function aS(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function lS(e,t){const n=hS(t);return"formatToParts"in n?uS(n,e):dS(n,e)}const cS={year:0,month:1,day:2,hour:3,minute:4,second:5};function uS(e,t){try{const n=e.formatToParts(t),r=[];for(let o=0;o<n.length;o++){const s=cS[n[o].type];s!==void 0&&(r[s]=parseInt(n[o].value,10))}return r}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function dS(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}const Ni={},ed=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),fS=ed==="06/25/2014, 00:00:00"||ed==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function hS(e){return Ni[e]||(Ni[e]=fS?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ni[e]}function zp(e,t,n,r,o,s,i){const a=new Date(0);return a.setUTCFullYear(e,t,n),a.setUTCHours(r,o,s,i),a}const td=36e5,pS=6e4,Di={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ql(e,t,n){if(!e)return 0;let r=Di.timezoneZ.exec(e);if(r)return 0;let o,s;if(r=Di.timezoneHH.exec(e),r)return o=parseInt(r[1],10),nd(o)?-(o*td):NaN;if(r=Di.timezoneHHMM.exec(e),r){o=parseInt(r[2],10);const i=parseInt(r[3],10);return nd(o,i)?(s=Math.abs(o)*td+i*pS,r[1]==="+"?-s:s):NaN}if(yS(e)){t=new Date(t||Date.now());const i=n?t:mS(t),a=Oa(i,e);return-(n?a:gS(t,a,e))}return NaN}function mS(e){return zp(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Oa(e,t){const n=lS(e,t),r=zp(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let o=e.getTime();const s=o%1e3;return o-=s>=0?s:1e3+s,r-o}function gS(e,t,n){let r=e.getTime()-t;const o=Oa(new Date(r),n);if(t===o)return t;r-=o-t;const s=Oa(new Date(r),n);return o===s?o:Math.max(o,s)}function nd(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const rd={};function yS(e){if(rd[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),rd[e]=!0,!0}catch{return!1}}const bS=60*1e3,vS={X:function(e,t,n){const r=Ti(n.timeZone,e);if(r===0)return"Z";switch(t){case"X":return od(r);case"XXXX":case"XX":return qn(r);case"XXXXX":case"XXX":default:return qn(r,":")}},x:function(e,t,n){const r=Ti(n.timeZone,e);switch(t){case"x":return od(r);case"xxxx":case"xx":return qn(r);case"xxxxx":case"xxx":default:return qn(r,":")}},O:function(e,t,n){const r=Ti(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+wS(r,":");case"OOOO":default:return"GMT"+qn(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Xu("short",e,n);case"zzzz":default:return Xu("long",e,n)}}};function Ti(e,t){const n=e?ql(e,t,!0)/bS:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Ps(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r}function qn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ps(Math.floor(r/60),2),s=Ps(Math.floor(r%60),2);return n+o+t+s}function od(e,t){return e%60===0?(e>0?"-":"+")+Ps(Math.abs(e)/60,2):qn(e,t)}function wS(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+Ps(s,2)}function sd(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const AS=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ri=36e5,id=6e4,xS=2,Te={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:AS};function jp(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?xS:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const r=CS(e),{year:o,restDateString:s}=ES(r.date,n),i=SS(s,o);if(i===null||isNaN(i.getTime()))return new Date(NaN);if(i){const a=i.getTime();let l=0,u;if(r.time&&(l=PS(r.time),l===null||isNaN(l)))return new Date(NaN);if(r.timeZone||t.timeZone){if(u=ql(r.timeZone||t.timeZone,new Date(a+l)),isNaN(u))return new Date(NaN)}else u=sd(new Date(a+l)),u=sd(new Date(a+l+u));return new Date(a+l+u)}else return new Date(NaN)}function CS(e){const t={};let n=Te.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=Te.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const o=Te.timeZone.exec(r);o?(t.time=r.replace(o[1],""),t.timeZone=o[1].trim()):t.time=r}return t}function ES(e,t){if(e){const n=Te.YYY[t],r=Te.YYYYY[t];let o=Te.YYYY.exec(e)||r.exec(e);if(o){const s=o[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(o=Te.YY.exec(e)||n.exec(e),o){const s=o[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function SS(e,t){if(t===null)return null;let n,r,o;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=Te.MM.exec(e);if(s)return n=new Date(0),r=parseInt(s[1],10)-1,ld(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(s=Te.DDD.exec(e),s){n=new Date(0);const i=parseInt(s[1],10);return IS(t,i)?(n.setUTCFullYear(t,0,i),n):new Date(NaN)}if(s=Te.MMDD.exec(e),s){n=new Date(0),r=parseInt(s[1],10)-1;const i=parseInt(s[2],10);return ld(t,r,i)?(n.setUTCFullYear(t,r,i),n):new Date(NaN)}if(s=Te.Www.exec(e),s)return o=parseInt(s[1],10)-1,cd(o)?ad(t,o):new Date(NaN);if(s=Te.WwwD.exec(e),s){o=parseInt(s[1],10)-1;const i=parseInt(s[2],10)-1;return cd(o,i)?ad(t,o,i):new Date(NaN)}return null}function PS(e){let t,n,r=Te.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),Fi(t)?t%24*Ri:NaN;if(r=Te.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),Fi(t,n)?t%24*Ri+n*id:NaN;if(r=Te.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const o=parseFloat(r[3].replace(",","."));return Fi(t,n,o)?t%24*Ri+n*id+o*1e3:NaN}return null}function ad(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const o=r.getUTCDay()||7,s=t*7+n+1-o;return r.setUTCDate(r.getUTCDate()+s),r}const MS=[31,28,31,30,31,30,31,31,30,31,30,31],kS=[31,29,31,30,31,30,31,31,30,31,30,31];function Qp(e){return e%400===0||e%4===0&&e%100!==0}function ld(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=Qp(e);if(r&&n>kS[t]||!r&&n>MS[t])return!1}return!0}function IS(e,t){if(t<1)return!1;const n=Qp(e);return!(n&&t>366||!n&&t>365)}function cd(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Fi(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const OS=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function NS(e,t,n={}){t=String(t);const r=t.match(OS);if(r){const o=jp(n.originalDate||e,n);t=r.reduce(function(s,i){if(i[0]==="'")return s;const a=s.indexOf(i),l=s[a-1]==="'",u=s.replace(i,"'"+vS[i[0]](o,i,n)+"'");return l?u.substring(0,a-1)+u.substring(a+1):u},t)}return ZE(e,t,n)}function DS(e,t,n){e=jp(e,n);const r=ql(t,e,!0),o=new Date(e.getTime()-r),s=new Date(0);return s.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),s.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),s}function TS(e,t,n,r){return r={...r,timeZone:t,originalDate:e},NS(DS(e,t,{timeZone:r.timeZone}),n,r)}const kt={CREATE_ISSUE:"CREATE_ISSUE",ADD_NOTION_ID_TO_ISSUE:"ADD_NOTION_ID_TO_ISSUE",REMOVE_NOTION_ID_FROM_ISSUE:"REMOVE_NOTION_ID_FROM_ISSUE"};function Wp(e){const t=new CustomEvent(kt.CREATE_ISSUE,{detail:{notionIds:e}});window.dispatchEvent(t)}function RS(e,t){const n=new CustomEvent(kt.ADD_NOTION_ID_TO_ISSUE,{detail:{notionId:e,phid:t}});window.dispatchEvent(n)}function FS(e,t){const n=new CustomEvent(kt.REMOVE_NOTION_ID_FROM_ISSUE,{detail:{notionId:e,phid:t}});window.dispatchEvent(n)}function Hp(e,t){const n=[];for(const r of e){const o=t.includes(r.slugSuffix),s=Hp(r.subDocuments,t);o?n.push({...r,subDocuments:s}):s.length>0&&n.push(...s)}return n}function BS(e){const{formalId:t,title:n,typeSuffix:r}=e.title,{prefix:o,numberPath:s}=t,i=s.join("."),a=r?` - ${r}`:"";return`${o}.${i} - ${n}${a}`}function be(...e){return Jd(Up(e))}function LS(){const e=Ce(()=>{console.log("login")},[]);return w("div",{children:w("button",{onClick:()=>e(),children:"Login"})})}var ud=1,US=.9,zS=.8,jS=.17,Bi=.1,Li=.999,QS=.9999,WS=.99,HS=/[\\\/_+.#"@\[\(\{&]/,VS=/[\\\/_+.#"@\[\(\{&]/g,GS=/[\s-]/,Vp=/[\s-]/g;function Na(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?ud:WS;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var l=r.charAt(s),u=n.indexOf(l,o),c=0,d,h,f,m;u>=0;)d=Na(e,t,n,r,u+1,s+1,i),d>c&&(u===o?d*=ud:HS.test(e.charAt(u-1))?(d*=zS,f=e.slice(o,u-1).match(VS),f&&o>0&&(d*=Math.pow(Li,f.length))):GS.test(e.charAt(u-1))?(d*=US,m=e.slice(o,u-1).match(Vp),m&&o>0&&(d*=Math.pow(Li,m.length))):(d*=jS,o>0&&(d*=Math.pow(Li,u-o))),e.charAt(u)!==t.charAt(s)&&(d*=QS)),(d<Bi&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=Na(e,t,n,r,u+1,s+2,i),h*Bi>d&&(d=h*Bi)),d>c&&(c=d),u=n.indexOf(l,u+1);return i[a]=c,c}function dd(e){return e.toLowerCase().replace(Vp," ")}function qS(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Na(e,t,dd(e),dd(t),0,0,{})}var fd={exports:{}},Ui={};/**
79
+ * @license React
80
+ * use-sync-external-store-shim.production.js
81
+ *
82
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
83
+ *
84
+ * This source code is licensed under the MIT license found in the
85
+ * LICENSE file in the root directory of this source tree.
86
+ */var hd;function KS(){if(hd)return Ui;hd=1;var e=re;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(d,h){var f=h(),m=r({inst:{value:f,getSnapshot:h}}),p=m[0].inst,g=m[1];return s(function(){p.value=f,p.getSnapshot=h,l(p)&&g({inst:p})},[d,f,h]),o(function(){return l(p)&&g({inst:p}),d(function(){l(p)&&g({inst:p})})},[d]),i(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function u(d,h){return h()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Ui.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,Ui}var pd;function YS(){return pd||(pd=1,fd.exports=KS()),fd.exports}var $S=YS(),Qr='[cmdk-group=""]',zi='[cmdk-group-items=""]',JS='[cmdk-group-heading=""]',Kl='[cmdk-item=""]',md=`${Kl}:not([aria-disabled="true"])`,Da="cmdk-item-select",hn="data-value",_S=(e,t,n)=>qS(e,t,n),Gp=b.createContext(void 0),Oo=()=>b.useContext(Gp),qp=b.createContext(void 0),Yl=()=>b.useContext(qp),Kp=b.createContext(void 0),Yp=b.forwardRef((e,t)=>{let n=Kn(()=>{var T,H;return{search:"",value:(H=(T=e.value)!=null?T:e.defaultValue)!=null?H:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Kn(()=>new Set),o=Kn(()=>new Map),s=Kn(()=>new Map),i=Kn(()=>new Set),a=$p(e),{label:l,children:u,value:c,onValueChange:d,filter:h,shouldFilter:f,loop:m,disablePointerSelection:p=!1,vimBindings:g=!0,...A}=e,v=pt(),S=pt(),M=pt(),y=b.useRef(null),x=lP();Mn(()=>{if(c!==void 0){let T=c.trim();n.current.value=T,E.emit()}},[c]),Mn(()=>{x(6,B)},[]);let E=b.useMemo(()=>({subscribe:T=>(i.current.add(T),()=>i.current.delete(T)),snapshot:()=>n.current,setState:(T,H,X)=>{var q,se,J;if(!Object.is(n.current[T],H)){if(n.current[T]=H,T==="search")O(),R(),x(1,V);else if(T==="value"&&(X||x(5,B),((q=a.current)==null?void 0:q.value)!==void 0)){let fe=H??"";(J=(se=a.current).onValueChange)==null||J.call(se,fe);return}E.emit()}},emit:()=>{i.current.forEach(T=>T())}}),[]),D=b.useMemo(()=>({value:(T,H,X)=>{var q;H!==((q=s.current.get(T))==null?void 0:q.value)&&(s.current.set(T,{value:H,keywords:X}),n.current.filtered.items.set(T,I(H,X)),x(2,()=>{R(),E.emit()}))},item:(T,H)=>(r.current.add(T),H&&(o.current.has(H)?o.current.get(H).add(T):o.current.set(H,new Set([T]))),x(3,()=>{O(),R(),n.current.value||V(),E.emit()}),()=>{s.current.delete(T),r.current.delete(T),n.current.filtered.items.delete(T);let X=z();x(4,()=>{O(),(X==null?void 0:X.getAttribute("id"))===T&&V(),E.emit()})}),group:T=>(o.current.has(T)||o.current.set(T,new Set),()=>{s.current.delete(T),o.current.delete(T)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:v,inputId:M,labelId:S,listInnerRef:y}),[]);function I(T,H){var X,q;let se=(q=(X=a.current)==null?void 0:X.filter)!=null?q:_S;return T?se(T,n.current.search,H):0}function R(){if(!n.current.search||a.current.shouldFilter===!1)return;let T=n.current.filtered.items,H=[];n.current.filtered.groups.forEach(q=>{let se=o.current.get(q),J=0;se.forEach(fe=>{let we=T.get(fe);J=Math.max(we,J)}),H.push([q,J])});let X=y.current;Y().sort((q,se)=>{var J,fe;let we=q.getAttribute("id"),Ze=se.getAttribute("id");return((J=T.get(Ze))!=null?J:0)-((fe=T.get(we))!=null?fe:0)}).forEach(q=>{let se=q.closest(zi);se?se.appendChild(q.parentElement===se?q:q.closest(`${zi} > *`)):X.appendChild(q.parentElement===X?q:q.closest(`${zi} > *`))}),H.sort((q,se)=>se[1]-q[1]).forEach(q=>{var se;let J=(se=y.current)==null?void 0:se.querySelector(`${Qr}[${hn}="${encodeURIComponent(q[0])}"]`);J==null||J.parentElement.appendChild(J)})}function V(){let T=Y().find(X=>X.getAttribute("aria-disabled")!=="true"),H=T==null?void 0:T.getAttribute(hn);E.setState("value",H||void 0)}function O(){var T,H,X,q;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let J of r.current){let fe=(H=(T=s.current.get(J))==null?void 0:T.value)!=null?H:"",we=(q=(X=s.current.get(J))==null?void 0:X.keywords)!=null?q:[],Ze=I(fe,we);n.current.filtered.items.set(J,Ze),Ze>0&&se++}for(let[J,fe]of o.current)for(let we of fe)if(n.current.filtered.items.get(we)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=se}function B(){var T,H,X;let q=z();q&&(((T=q.parentElement)==null?void 0:T.firstChild)===q&&((X=(H=q.closest(Qr))==null?void 0:H.querySelector(JS))==null||X.scrollIntoView({block:"nearest"})),q.scrollIntoView({block:"nearest"}))}function z(){var T;return(T=y.current)==null?void 0:T.querySelector(`${Kl}[aria-selected="true"]`)}function Y(){var T;return Array.from(((T=y.current)==null?void 0:T.querySelectorAll(md))||[])}function W(T){let H=Y()[T];H&&E.setState("value",H.getAttribute(hn))}function $(T){var H;let X=z(),q=Y(),se=q.findIndex(fe=>fe===X),J=q[se+T];(H=a.current)!=null&&H.loop&&(J=se+T<0?q[q.length-1]:se+T===q.length?q[0]:q[se+T]),J&&E.setState("value",J.getAttribute(hn))}function K(T){let H=z(),X=H==null?void 0:H.closest(Qr),q;for(;X&&!q;)X=T>0?iP(X,Qr):aP(X,Qr),q=X==null?void 0:X.querySelector(md);q?E.setState("value",q.getAttribute(hn)):$(T)}let Z=()=>W(Y().length-1),ae=T=>{T.preventDefault(),T.metaKey?Z():T.altKey?K(1):$(1)},de=T=>{T.preventDefault(),T.metaKey?W(0):T.altKey?K(-1):$(-1)};return b.createElement(ve.div,{ref:t,tabIndex:-1,...A,"cmdk-root":"",onKeyDown:T=>{var H;if((H=A.onKeyDown)==null||H.call(A,T),!T.defaultPrevented)switch(T.key){case"n":case"j":{g&&T.ctrlKey&&ae(T);break}case"ArrowDown":{ae(T);break}case"p":case"k":{g&&T.ctrlKey&&de(T);break}case"ArrowUp":{de(T);break}case"Home":{T.preventDefault(),W(0);break}case"End":{T.preventDefault(),Z();break}case"Enter":if(!T.nativeEvent.isComposing&&T.keyCode!==229){T.preventDefault();let X=z();if(X){let q=new Event(Da);X.dispatchEvent(q)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:uP},l),Ws(e,T=>b.createElement(qp.Provider,{value:E},b.createElement(Gp.Provider,{value:D},T))))}),ZS=b.forwardRef((e,t)=>{var n,r;let o=pt(),s=b.useRef(null),i=b.useContext(Kp),a=Oo(),l=$p(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;Mn(()=>{if(!u)return a.item(o,i==null?void 0:i.id)},[u]);let c=Jp(o,s,[e.value,e.children,s],e.keywords),d=Yl(),h=kn(x=>x.value&&x.value===c.current),f=kn(x=>u||a.filter()===!1?!0:x.search?x.filtered.items.get(o)>0:!0);b.useEffect(()=>{let x=s.current;if(!(!x||e.disabled))return x.addEventListener(Da,m),()=>x.removeEventListener(Da,m)},[f,e.onSelect,e.disabled]);function m(){var x,E;p(),(E=(x=l.current).onSelect)==null||E.call(x,c.current)}function p(){d.setState("value",c.current,!0)}if(!f)return null;let{disabled:g,value:A,onSelect:v,forceMount:S,keywords:M,...y}=e;return b.createElement(ve.div,{ref:go([s,t]),...y,id:o,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!h,"data-disabled":!!g,"data-selected":!!h,onPointerMove:g||a.getDisablePointerSelection()?void 0:p,onClick:g?void 0:m},e.children)}),XS=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=pt(),a=b.useRef(null),l=b.useRef(null),u=pt(),c=Oo(),d=kn(f=>o||c.filter()===!1?!0:f.search?f.filtered.groups.has(i):!0);Mn(()=>c.group(i),[]),Jp(i,a,[e.value,e.heading,l]);let h=b.useMemo(()=>({id:i,forceMount:o}),[o]);return b.createElement(ve.div,{ref:go([a,t]),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&b.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Ws(e,f=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},b.createElement(Kp.Provider,{value:h},f))))}),eP=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=b.useRef(null),s=kn(i=>!i.search);return!n&&!s?null:b.createElement(ve.div,{ref:go([o,t]),...r,"cmdk-separator":"",role:"separator"})}),tP=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=Yl(),i=kn(c=>c.search),a=kn(c=>c.value),l=Oo(),u=b.useMemo(()=>{var c;let d=(c=l.listInnerRef.current)==null?void 0:c.querySelector(`${Kl}[${hn}="${encodeURIComponent(a)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return b.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),b.createElement(ve.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":u,id:l.inputId,type:"text",value:o?e.value:i,onChange:c=>{o||s.setState("search",c.target.value),n==null||n(c.target.value)}})}),nP=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=b.useRef(null),i=b.useRef(null),a=Oo();return b.useEffect(()=>{if(i.current&&s.current){let l=i.current,u=s.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let h=l.offsetHeight;u.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return d.observe(l),()=>{cancelAnimationFrame(c),d.unobserve(l)}}},[]),b.createElement(ve.div,{ref:go([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},Ws(e,l=>b.createElement("div",{ref:go([i,a.listInnerRef]),"cmdk-list-sizer":""},l)))}),rP=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=e;return b.createElement(GC,{open:n,onOpenChange:r},b.createElement(Op,{container:i},b.createElement(Vl,{"cmdk-overlay":"",className:o}),b.createElement(Gl,{"aria-label":e.label,"cmdk-dialog":"",className:s},b.createElement(Yp,{ref:t,...a}))))}),oP=b.forwardRef((e,t)=>kn(n=>n.filtered.count===0)?b.createElement(ve.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),sP=b.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return b.createElement(ve.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ws(e,i=>b.createElement("div",{"aria-hidden":!0},i)))}),We=Object.assign(Yp,{List:nP,Item:ZS,Input:tP,Group:XS,Separator:eP,Dialog:rP,Empty:oP,Loading:sP});function iP(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function aP(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $p(e){let t=b.useRef(e);return Mn(()=>{t.current=e}),t}var Mn=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Kn(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function go(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function kn(e){let t=Yl(),n=()=>e(t.snapshot());return $S.useSyncExternalStore(t.subscribe,n,n)}function Jp(e,t,n,r=[]){let o=b.useRef(),s=Oo();return Mn(()=>{var i;let a=(()=>{var u;for(let c of n){if(typeof c=="string")return c.trim();if(typeof c=="object"&&"current"in c)return c.current?(u=c.current.textContent)==null?void 0:u.trim():o.current}})(),l=r.map(u=>u.trim());s.value(e,a,l),(i=t.current)==null||i.setAttribute(hn,a),o.current=a}),o}var lP=()=>{let[e,t]=b.useState(),n=Kn(()=>new Map);return Mn(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function cP(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ws({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(cP(t),{ref:t.ref},n(t.props.children)):n(t)}var uP={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const dP=Op,_p=je(({className:e,...t},n)=>w(Vl,{className:be("fixed inset-0 z-50 bg-black/80",e),ref:n,...t}));_p.displayName=Vl.displayName;const fP=je(({className:e,children:t,...n},r)=>te(dP,{children:[w(_p,{}),te(Gl,{className:be("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-white p-6 shadow-lg duration-200 sm:rounded-lg",e),ref:r,...n,children:[t,te(qC,{className:`
87
+ absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-slate-50 data-[state=open]:text-gray-500`,children:["X",w("span",{className:"sr-only",children:"Close"})]})]})]}));fP.displayName=Gl.displayName;const hP=je(({className:e,...t},n)=>w(Np,{className:be("text-lg font-semibold leading-none tracking-tight",e),ref:n,...t}));hP.displayName=Np.displayName;const pP=je(({className:e,...t},n)=>w(Dp,{className:be("text-muted-foreground text-sm",e),ref:n,...t}));pP.displayName=Dp.displayName;const yo=je(({className:e,...t},n)=>w(We,{className:be("flex size-full flex-col overflow-hidden rounded-md bg-white text-gray-900",e),ref:n,...t}));yo.displayName=We.displayName;const Zp=je(({className:e,...t},n)=>w("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:w(We.Input,{className:be("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-gray-400 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t})}));Zp.displayName=We.Input.displayName;const bo=je(({className:e,...t},n)=>w(We.List,{className:be("max-h-[300px] overflow-y-auto overflow-x-hidden",e),ref:n,...t}));bo.displayName=We.List.displayName;const Xp=je((e,t)=>w(We.Empty,{className:"py-6 text-center text-sm",ref:t,...e}));Xp.displayName=We.Empty.displayName;const vo=je(({className:e,...t},n)=>w(We.Group,{className:be("p-1 text-gray-900 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-gray-400",e),ref:n,...t}));vo.displayName=We.Group.displayName;const mP=je(({className:e,...t},n)=>w(We.Separator,{className:be("-mx-1 h-px bg-gray-200",e),ref:n,...t}));mP.displayName=We.Separator.displayName;const It=je(({className:e,...t},n)=>w(We.Item,{className:be("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-slate-100 data-[selected=true]:text-gray-900 data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),ref:n,...t}));It.displayName=We.Item.displayName;var $l="Popover",[em,Nk]=Za($l,[mf]),No=mf(),[gP,Xt]=em($l),tm=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=No(t),l=b.useRef(null),[u,c]=b.useState(!1),[d=!1,h]=af({prop:r,defaultProp:o,onChange:s});return w(Bv,{...a,children:w(gP,{scope:t,contentId:pt(),triggerRef:l,open:d,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(f=>!f),[h]),hasCustomAnchor:u,onCustomAnchorAdd:b.useCallback(()=>c(!0),[]),onCustomAnchorRemove:b.useCallback(()=>c(!1),[]),modal:i,children:n})})};tm.displayName=$l;var nm="PopoverAnchor",yP=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xt(nm,n),s=No(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return b.useEffect(()=>(i(),()=>a()),[i,a]),w(Ef,{...s,...r,ref:t})});yP.displayName=nm;var rm="PopoverTrigger",om=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xt(rm,n),s=No(n),i=it(t,o.triggerRef),a=w(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":cm(o.open),...r,ref:i,onClick:Ke(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:w(Ef,{asChild:!0,...s,children:a})});om.displayName=rm;var Jl="PopoverPortal",[bP,vP]=em(Jl,{forceMount:void 0}),sm=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Xt(Jl,t);return w(bP,{scope:t,forceMount:n,children:w(hr,{present:n||s.open,children:w(rl,{asChild:!0,container:o,children:r})})})};sm.displayName=Jl;var ar="PopoverContent",im=b.forwardRef((e,t)=>{const n=vP(ar,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Xt(ar,e.__scopePopover);return w(hr,{present:r||s.open,children:s.modal?w(wP,{...o,ref:t}):w(AP,{...o,ref:t})})});im.displayName=ar;var wP=b.forwardRef((e,t)=>{const n=Xt(ar,e.__scopePopover),r=b.useRef(null),o=it(t,r),s=b.useRef(!1);return b.useEffect(()=>{const i=r.current;if(i)return Pf(i)},[]),w(ol,{as:So,allowPinchZoom:!0,children:w(am,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ke(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ke(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Ke(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),AP=b.forwardRef((e,t)=>{const n=Xt(ar,e.__scopePopover),r=b.useRef(!1),o=b.useRef(!1);return w(am,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var i,a;(i=e.onInteractOutside)==null||i.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=s.target;(a=n.triggerRef.current)!=null&&a.contains(l)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),am=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:c,...d}=e,h=Xt(ar,n),f=No(n);return uf(),w(el,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:w(Xa,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:c,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:w(Lv,{"data-state":cm(h.open),role:"dialog",id:h.contentId,...f,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),lm="PopoverClose",xP=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xt(lm,n);return w(ve.button,{type:"button",...r,ref:t,onClick:Ke(e.onClick,()=>o.onOpenChange(!1))})});xP.displayName=lm;var CP="PopoverArrow",EP=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=No(n);return w(Uv,{...o,...r,ref:t})});EP.displayName=CP;function cm(e){return e?"open":"closed"}var SP=tm,PP=om,MP=sm,um=im;const _l=SP,Zl=PP,Hs=je(({className:e,align:t="center",sideOffset:n=4,...r},o)=>w(MP,{children:w(um,{align:t,className:be("rounded-md border bg-white p-4 text-gray-900 outline-none",e),ref:o,sideOffset:n,...r})}));Hs.displayName=um.displayName;function kP(e){const{viewNode:t,issues:n,issue:r}=e,[o,s]=ze(!1),[i,a]=ze(!1),l=n.filter(p=>p.phid!==(r==null?void 0:r.phid)),u=l.length>0,c=(r?r.comments.filter(p=>p.notionId===t.slugSuffix):n.flatMap(p=>p.comments).filter(p=>p.notionId===t.slugSuffix)).length??0,d=c>0,h=w("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:w("path",{d:"M4.01042 2.66406C2.53775 2.66406 1.34375 3.85806 1.34375 5.33073V13.3307C1.34375 13.9247 2.06975 14.2301 2.48975 13.8101L4.96908 11.9974H12.0104C13.4831 11.9974 14.6771 10.8034 14.6771 9.33073V5.33073C14.6771 3.85806 13.4831 2.66406 12.0104 2.66406H4.01042ZM4.67708 5.33073H11.3437C11.7117 5.33073 12.0104 5.6294 12.0104 5.9974C12.0104 6.3654 11.7117 6.66406 11.3437 6.66406H4.67708C4.30908 6.66406 4.01042 6.3654 4.01042 5.9974C4.01042 5.6294 4.30908 5.33073 4.67708 5.33073ZM4.67708 7.9974H9.34375C9.71175 7.9974 10.0104 8.29606 10.0104 8.66406C10.0104 9.03206 9.71175 9.33073 9.34375 9.33073H4.67708C4.30908 9.33073 4.01042 9.03206 4.01042 8.66406C4.01042 8.29606 4.30908 7.9974 4.67708 7.9974Z",fill:"currentColor"})}),f=w(yo,{children:w(bo,{children:te(vo,{children:[w(It,{onSelect:()=>{a(!1),s(!1),Wp([t.slugSuffix])},value:"create-new-issue",children:"Create new issue"}),u?w(It,{onSelect:()=>{a(!0)},value:"add-to-existing-issue",children:"Add to existing issue"},"add-to-existing-issue"):null,!!r&&w(It,{onSelect:()=>{FS(t.slugSuffix,r.phid),a(!1),s(!1)},value:"remove-from-issue",children:"Remove from issue"},"remove-from-issue")]})})}),m=te(yo,{children:[w(Zp,{placeholder:"Search issue..."}),te(bo,{children:[w(Xp,{children:"No issue found."}),w(vo,{children:l.map((p,g)=>te(It,{onSelect:A=>{RS(t.slugSuffix,A),s(!1)},value:p.phid,children:["Issue #",g+1]},p.phid))})]})]});return te(_l,{onOpenChange:p=>{s(p),p||a(!1)},open:o,children:[w(Zl,{asChild:!0,children:w("button",{"aria-expanded":o,className:be("text-gray-400 hover:text-gray-900 transition",!d&&"opacity-0 group-hover:opacity-100"),onClick:p=>p.stopPropagation(),role:"combobox",children:te("span",{className:"flex items-center gap-1",children:[w("span",{className:"w-4",children:h}),d?w("span",{children:c}):null]})})}),w(Hs,{className:"p-0",onClick:p=>{p.stopPropagation()},children:i?m:f})]})}function dm(e){const{open:t,className:n,...r}=e;return w("svg",{...r,className:Jd("mt-0.5 flex-none transition text-gray-700",t&&"rotate-180",n),height:5,viewBox:"0 0 8 5",width:8,xmlns:"http://www.w3.org/2000/svg",children:w("path",{clipRule:"evenodd",d:"M0.4609 0.593871C0.64835 0.406421 0.95227 0.406421 1.13972 0.593871L4.00031 3.45446L6.8609 0.593871C7.0484 0.406421 7.3523 0.406421 7.5397 0.593871C7.7272 0.781321 7.7272 1.08524 7.5397 1.27269L4.33972 4.4727C4.24971 4.5627 4.12762 4.6133 4.00031 4.6133C3.87301 4.6133 3.75092 4.5627 3.6609 4.4727L0.4609 1.27269C0.27345 1.08524 0.27345 0.781321 0.4609 0.593871Z",fill:"currentColor",fillRule:"evenodd"})})}function fm(e){const{viewNode:t,onSelectNotionId:n,tempIsDisplay:r=!1,level:o=0,selectedNotionId:s}=e,i=t.slugSuffix,[a,l]=ze(!r),u=t.subDocuments.length>0,c=t.type==="category"?t.title.title:BS(t),d=Ce(()=>{l(f=>!f),!r&&n(i)},[r,i,n]),h=w("svg",{className:"flex-none",height:"16",viewBox:"0 0 16 16",width:"16",xmlns:"http://www.w3.org/2000/svg",children:w("path",{clipRule:"evenodd",d:"M3.73281 2.13307C3.43826 2.13307 3.19948 2.37186 3.19948 2.66641V13.3331C3.19948 13.6276 3.43826 13.8664 3.73281 13.8664H12.2661C12.5607 13.8664 12.7995 13.6276 12.7995 13.3331V6.39974H9.06615C8.77159 6.39974 8.53281 6.16096 8.53281 5.86641V2.13307H3.73281ZM9.59948 2.88732L12.0452 5.33307H9.59948V2.88732ZM2.13281 2.66641C2.13281 1.78275 2.84916 1.06641 3.73281 1.06641H9.06615C9.20759 1.06641 9.34325 1.1226 9.44327 1.22262L13.7099 5.48928C13.81 5.5893 13.8661 5.72496 13.8661 5.86641V13.3331C13.8661 14.2167 13.1498 14.9331 12.2661 14.9331H3.73281C2.84916 14.9331 2.13281 14.2167 2.13281 13.3331V2.66641Z",fill:"currentColor",fillRule:"evenodd"})});return te("div",{className:"mb-3",style:{marginLeft:`${(o??0)*8}px`},children:[te("li",{className:"flex gap-2 items-start group cursor-pointer",onClick:d,children:[te("div",{className:"flex items-center gap-2 h-6",children:[w(dm,{className:u?"visible":"invisible",open:a}),h]}),w("span",{className:be("font-normal text-sm text-gray-700",s===i?"font-medium":""),children:c}),w("div",{className:"flex items-center h-6",children:w(kP,{...e})})]}),a?te(Nt,{children:[r?w("p",{children:t.content.map(f=>f.text.map(m=>m.text).join("")).join("")}):null,t.subDocuments.map(f=>$r(fm,{...e,key:f.slugSuffix,level:o+1,viewNode:f}))]}):null]})}function IP(e){const{scopes:t}=e;return w("ul",{children:t.map(n=>w(fm,{...e,viewNode:n},n.slugSuffix))})}const hm=je(function(e,t){const{className:n,open:r,onClick:o,...s}=e,i=w("svg",{fill:"none",height:"15",viewBox:"0 0 15 15",width:"15",xmlns:"http://www.w3.org/2000/svg",children:w("path",{clipRule:"evenodd",d:"M8.625 2.5C8.625 3.12132 8.12132 3.625 7.5 3.625C6.87868 3.625 6.375 3.12132 6.375 2.5C6.375 1.87868 6.87868 1.375 7.5 1.375C8.12132 1.375 8.625 1.87868 8.625 2.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM7.5 13.625C8.12132 13.625 8.625 13.1213 8.625 12.5C8.625 11.8787 8.12132 11.375 7.5 11.375C6.87868 11.375 6.375 11.8787 6.375 12.5C6.375 13.1213 6.87868 13.625 7.5 13.625Z",fill:"currentColor",fillRule:"evenodd"})});return w("div",{...s,"aria-expanded":r,className:be("text-gray-600 hover:text-gray-900 transition opacity-0 group-hover:opacity-100 p-1 cursor-pointer",n),onClick:a=>{a.stopPropagation(),o==null||o(a)},ref:t,role:"combobox",children:i})});function OP(e){const[t,n]=ze(!1),{issue:r,handleDeleteIssue:o}=e,[,s]=rb(),i=a=>()=>{s(a).catch(l=>{console.error("Failed to copy!",l)})};return te(_l,{onOpenChange:n,open:t,children:[w(Zl,{asChild:!0,children:w(hm,{open:t})}),w(Hs,{className:"p-0",onClick:a=>{a.stopPropagation()},children:w(yo,{children:w(bo,{children:te(vo,{children:[w(It,{onSelect:()=>{const a=new URL("https://mips-portal-staging-beta.vercel.app");a.searchParams.set("selectedIssuePhid",r.phid),i(a.toString())(),n(!1)},children:"Copy link"}),w(It,{onSelect:()=>{o({phid:r.phid}),n(!1)},children:"Delete issue"})]})})})})]})}function NP(e){const{issue:t,state:n,issueNumber:r,scopes:o,handleDeleteIssue:s,selectedIssuePhid:i,setSelectedIssuePhid:a,selectedNotionId:l,setSelectedNotionId:u}=e,c=i===t.phid,d=ts(()=>Hp(o,t.notionIds),[o,t.notionIds]),h=Ce(f=>{u(f)},[]);return te("li",{children:[te("button",{className:"flex items-center justify-between cursor-pointer text-gray-800 text-sm mb-3 group w-full",onClick:()=>{a(i===t.phid?void 0:t.phid),u(void 0)},children:[te("div",{className:"flex items-center gap-3",children:[w(dm,{className:"ml-1",open:c}),te("span",{className:"font-medium",children:["Issue #",r]})]}),w(OP,{handleDeleteIssue:s,issue:t})]}),c?w("div",{className:"pl-2",children:w(IP,{issue:t,issues:n.issues,onSelectNotionId:h,scopes:d,selectedNotionId:l})}):null]})}function DP(e){const{issues:t,scopes:n,selectedIssuePhid:r,handleDeleteIssue:o,setSelectedIssuePhid:s,selectedNotionId:i,setSelectedNotionId:a,state:l}=e;return w("ul",{children:t.map((u,c)=>w(NP,{handleDeleteIssue:o,issue:u,issueNumber:c+1,scopes:n,selectedIssuePhid:r,selectedNotionId:i,setSelectedIssuePhid:s,setSelectedNotionId:a,state:l},u.phid))})}const gd=(e,t,n)=>{if(e&&"reportValidity"in e){const r=U(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},pm=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?gd(r.ref,n,e):r.refs&&r.refs.forEach(o=>gd(o,n,e))}},TP=(e,t)=>{t.shouldUseNativeValidation&&pm(e,t);const n={};for(const r in e){const o=U(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(RP(t.names||Object.keys(e),r)){const i=Object.assign({},U(n,r));ue(i,"root",s),ue(n,r,i)}else ue(n,r,s)}return n},RP=(e,t)=>e.some(n=>n.startsWith(t+"."));var FP=function(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[i]={message:a.message,type:a.code}}else n[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(c){return c.errors.forEach(function(d){return e.push(d)})}),t){var l=n[i].types,u=l&&l[r.code];n[i]=ap(i,t,n,o,u?[].concat(u,r.message):r.message)}e.shift()}return n},mm=function(e,t,n){return n===void 0&&(n={}),function(r,o,s){try{return Promise.resolve(function(i,a){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return s.shouldUseNativeValidation&&pm({},s),{errors:{},values:n.raw?r:u}})}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:TP(FP(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}}};const Xl=je(({className:e,...t},n)=>{const r=nr(null),o=Ce(i=>{i.style.height="auto";const a=Math.max(i.scrollHeight,i.offsetHeight);i.style.height=`${a}px`},[]),s=Ce(i=>{o(i.currentTarget)},[o]);return b.useEffect(()=>{r.current&&o(r.current)},[o]),lg(n,()=>({focus:()=>{var i;return(i=r.current)==null?void 0:i.focus()},element:r.current})),w("textarea",{...t,className:be("min-h-10 w-full resize-none bg-transparent text-inherit placeholder:text-gray-600 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),onInput:s,ref:r})});Xl.displayName="Textarea";const gm=re.createContext({}),ym=re.createContext({});var BP="Label",bm=b.forwardRef((e,t)=>w(ve.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));bm.displayName=BP;var vm=bm;const LP=Up,UP=(e,t)=>n=>LP(e,n==null?void 0:n.class,n==null?void 0:n.className),zP=UP("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),wm=b.forwardRef(({className:e,...t},n)=>w(vm,{className:be(zP(),e),ref:n,...t}));wm.displayName=vm.displayName;const Vs=()=>{const e=re.useContext(gm),t=re.useContext(ym),{getFieldState:n,formState:r}=Qs(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},Am=wC,xm=({...e})=>w(gm.Provider,{value:{name:e.name},children:w(EC,{...e})}),ec=re.forwardRef(({className:e,...t},n)=>{const r=re.useId();return w(ym.Provider,{value:{id:r},children:w("div",{className:be("",e),ref:n,...t})})});ec.displayName="FormItem";const jP=re.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=Vs();return w(wm,{className:be(r&&"text-destructive",e),htmlFor:o,ref:n,...t})});jP.displayName="FormLabel";const tc=re.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:s}=Vs();return w(So,{"aria-describedby":n?`${o} ${s}`:o,"aria-invalid":!!n,id:r,ref:t,...e})});tc.displayName="FormControl";const QP=re.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Vs();return w("p",{className:be("text-[0.8rem] text-gray-600",e),id:r,ref:n,...t})});QP.displayName="FormDescription";const nc=re.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:s}=Vs(),i=o?String(o.message):t;return i?w("p",{className:be("text-[0.8rem] font-medium text-red-800",e),id:s,ref:r,...n,children:i}):null});nc.displayName="FormMessage";function WP(e){const{issue:t,notionId:n,state:r,handleCreateComment:o}=e,s=hg(r),i={content:"",notionId:n,issuePhid:t.phid,phid:Id.hashKey()},a=pp({resolver:mm(s),defaultValues:i}),l=Ce(c=>{o({...c,createdAt:new Date().toISOString()})},[o]),u=Ce(c=>{c.key==="Escape"&&(c.preventDefault(),c.currentTarget.blur()),c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),a.handleSubmit(l)())},[a,l]);return Ue(()=>{a.formState.isSubmitSuccessful&&a.reset(i)},[a.formState.isSubmitSuccessful,a.reset,i]),w(Am,{...a,children:te("form",{className:"bg-white p-3 rounded-md",onSubmit:a.handleSubmit(l),children:[w(xm,{control:a.control,name:"content",render:({field:c})=>te(ec,{children:[w(tc,{children:w(Xl,{...c,className:"placeholder:text-gray-600 placeholder:text-sm text-sm",onKeyDown:u,placeholder:"Add comment",rows:1})}),w(nc,{})]})}),w("button",{className:"bg-gray-100 rounded-md h-10 py-2 px-4 flex justify-center items-center w-full",type:"submit",children:"Comment"})]})})}function HP(e){const{issue:t,comment:n,state:r,isEditing:o,onSubmitEditComment:s,handleDeleteComment:i,onCancel:a}=e,l=pg(r),u={content:n.content,notionId:n.notionId,issuePhid:t.phid,phid:n.phid},c=pp({resolver:mm(l),defaultValues:u}),d=Ce(m=>{s({...m,editedAt:new Date().toISOString()})},[s]),h=Ce(m=>{m.key==="Escape"&&(m.preventDefault(),c.reset(u),m.currentTarget.blur(),a()),m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),c.handleSubmit(d)())},[c,d,a,u]),f=Ce(()=>{c.reset(u),a()},[c,u,a]);return w(Am,{...c,children:w("form",{onSubmit:c.handleSubmit(d),children:w(xm,{control:c.control,name:"content",render:({field:m})=>te(ec,{children:[w(tc,{children:w(Xl,{...m,autoFocus:!0,className:"text-right",disabled:!o,onBlur:f,onKeyDown:h,rows:1})}),w(nc,{})]})})})})}function VP(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function GP(e,t=!0,n=!1){const r=t?"HH:mm dd/MM/yy":"dd/MM/yy",o=n?"UTC":VP();return TS(e,o,r)}var q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v9rV0sAS0MWEwCmfauO7oQZMiakHU35LBxiyJoOMddhUWgcZuC8r4Ksvn75TTcQXLJ7kWtYhGuGqPd9dZuFjBWQHNwosXY5snbHFQq72CvHXhIg+shQxycuLOuWYErwCLZeF24b7F78pO7xw4X6lIAR02hUOf5087Rl0nOaeb6CK4i/KA/EZv76ftOWZtjwxslNr0E/u8rWUmnf3amfg6UZmBAluuoj3Dd7UV+9IAJ6iYcDfSJlgmIImohjfIUMJ27z+opj50Ak9af2LCNrWrBJvMovA1OeNO+MF/MwZvnaCxTgG7Cw4QfSPF6AYCGFt21M8PySZFeV3t2Rqqs5JMzMYzGRgq4o+UaKRgBf9GHi/9X9HXA3wxkCsd/UhnHSh2zUVDiraio/6nP4y3XJqs8ABfALAtCYU7DHPMPRjgcM6Ad/HiSXDAbOdSMkvGZPAkHs8wuQTy6X2Ov/JFvcPuKfV3/r9Q28";const yd=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),bd=4;function KP(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),o=1,s=[0,1];for(let y=1;y<r;y++)s.push(o+=n());let i=n(),a=t;t+=i;let l=0,u=0;function c(){return l==0&&(u=u<<8|e[t++],l=8),u>>--l&1}const d=31,h=2**d,f=h>>>1,m=f>>1,p=h-1;let g=0;for(let y=0;y<d;y++)g=g<<1|c();let A=[],v=0,S=h;for(;;){let y=Math.floor(((g-v+1)*o-1)/S),x=0,E=r;for(;E-x>1;){let R=x+E>>>1;y<s[R]?E=R:x=R}if(x==0)break;A.push(x);let D=v+Math.floor(S*s[x]/o),I=v+Math.floor(S*s[x+1]/o)-1;for(;!((D^I)&f);)g=g<<1&p|c(),D=D<<1&p,I=I<<1&p|1;for(;D&~I&m;)g=g&f|g<<1&p>>>1|c(),D=D<<1^f,I=(I^f)<<1|f|1;v=D,S=1+I-D}let M=r-4;return A.map(y=>{switch(y-M){case 3:return M+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return M+256+(e[a++]<<8|e[a++]);case 1:return M+e[a++];default:return y-1}})}function YP(e){let t=0;return()=>e[t++]}function Cm(e){return YP(KP($P(e)))}function $P(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((o,s)=>t[o.charCodeAt(0)]=s);let n=e.length,r=new Uint8Array(6*n>>3);for(let o=0,s=0,i=0,a=0;o<n;o++)a=a<<6|t[e.charCodeAt(o)],i+=6,i>=8&&(r[s++]=a>>(i-=8));return r}function JP(e){return e&1?~e>>1:e>>1}function _P(e,t){let n=Array(e);for(let r=0,o=0;r<e;r++)n[r]=o+=JP(t());return n}function wo(e,t=0){let n=[];for(;;){let r=e(),o=e();if(!o)break;t+=r;for(let s=0;s<o;s++)n.push(t+s);t+=o+1}return n}function Em(e){return Ao(()=>{let t=wo(e);if(t.length)return t})}function Sm(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(ZP(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(XP(n,e))}return t.flat()}function Ao(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function Pm(e,t,n){let r=Array(e).fill().map(()=>[]);for(let o=0;o<t;o++)_P(e,n).forEach((s,i)=>r[i].push(s));return r}function ZP(e,t){let n=1+t(),r=t(),o=Ao(t);return Pm(o.length,1+e,t).flatMap((s,i)=>{let[a,...l]=s;return Array(o[i]).fill().map((u,c)=>{let d=c*r;return[a+c*n,l.map(h=>h+d)]})})}function XP(e,t){let n=1+t();return Pm(n,1+e,t).map(r=>[r[0],r.slice(1)])}function eM(e){let t=[],n=wo(e);return o(r([]),[]),t;function r(s){let i=e(),a=Ao(()=>{let l=wo(e).map(u=>n[u]);if(l.length)return r(l)});return{S:i,B:a,Q:s}}function o({S:s,B:i},a,l){if(!(s&4&&l===a[a.length-1])){s&2&&(l=a[a.length-1]),s&1&&t.push(a);for(let u of i)for(let c of u.Q)o(u,[...a,c],l)}}}function tM(e){return e.toString(16).toUpperCase().padStart(2,"0")}function Mm(e){return`{${tM(e)}}`}function nM(e){let t=[];for(let n=0,r=e.length;n<r;){let o=e.codePointAt(n);n+=o<65536?1:2,t.push(o)}return t}function lr(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let n=[];for(let r=0;r<t;)n.push(String.fromCodePoint(...e.slice(r,r+=4096)));return n.join("")}function rM(e,t){let n=e.length,r=n-t.length;for(let o=0;r==0&&o<n;o++)r=e[o]-t[o];return r}var oM="AEUDVgHLCGMATwDUADIAdAAhADQAFAAtABQAIQAPACcADQASAAoAGAAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAeYDMwCxCl8B8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobWgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vAITAdQZWxDzALN9AhsZVwIcGSkCBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV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vdIAzvgfH8knukYDck07tc++DP4TdWeI7HXuq5Yl6VVFrUQtf64/dkXewlKZSHQo6YvCSpREB0GDrz+Ys2GfO8nw2SwrYwaf88AifzlPvP17bf1mI3AuccJvAjZIpBmqvharKFAebEjVKfGAwpQjWoXlm9LROsq9bCk1UeQ3CJxJqprzssS/Q04JeS1ReCCubL3J7sx86spkP4eNpp95UF+8K748icIs8vdILFklk9skQqi1So6cx3X906pvy1vz+KipTJ8fiVJxsV5MmT0XwA";const xo=44032,Ms=4352,ks=4449,Is=4519,km=19,Im=21,cr=28,Os=Im*cr,sM=km*Os,iM=xo+sM,aM=Ms+km,lM=ks+Im,cM=Is+cr;function Gr(e){return e>>24&255}function Om(e){return e&16777215}let Ta,vd,Ra,ls;function uM(){let e=Cm(oM);Ta=new Map(Em(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),vd=new Set(wo(e)),Ra=new Map,ls=new Map;for(let[t,n]of Sm(e)){if(!vd.has(t)&&n.length==2){let[r,o]=n,s=ls.get(r);s||(s=new Map,ls.set(r,s)),s.set(o,t)}Ra.set(t,n.reverse())}}function Nm(e){return e>=xo&&e<iM}function dM(e,t){if(e>=Ms&&e<aM&&t>=ks&&t<lM)return xo+(e-Ms)*Os+(t-ks)*cr;if(Nm(e)&&t>Is&&t<cM&&(e-xo)%cr==0)return e+(t-Is);{let n=ls.get(e);return n&&(n=n.get(t),n)?n:-1}}function Dm(e){Ta||uM();let t=[],n=[],r=!1;function o(s){let i=Ta.get(s);i&&(r=!0,s|=i),t.push(s)}for(let s of e)for(;;){if(s<128)t.push(s);else if(Nm(s)){let i=s-xo,a=i/Os|0,l=i%Os/cr|0,u=i%cr;o(Ms+a),o(ks+l),u>0&&o(Is+u)}else{let i=Ra.get(s);i?n.push(...i):o(s)}if(!n.length)break;s=n.pop()}if(r&&t.length>1){let s=Gr(t[0]);for(let i=1;i<t.length;i++){let a=Gr(t[i]);if(a==0||s<=a){s=a;continue}let l=i-1;for(;;){let u=t[l+1];if(t[l+1]=t[l],t[l]=u,!l||(s=Gr(t[--l]),s<=a))break}s=Gr(t[i])}}return t}function fM(e){let t=[],n=[],r=-1,o=0;for(let s of e){let i=Gr(s),a=Om(s);if(r==-1)i==0?r=a:t.push(a);else if(o>0&&o>=i)i==0?(t.push(r,...n),n.length=0,r=a):n.push(a),o=i;else{let l=dM(r,a);l>=0?r=l:o==0&&i==0?(t.push(r),r=a):(n.push(a),o=i)}}return r>=0&&t.push(r,...n),t}function Tm(e){return Dm(e).map(Om)}function hM(e){return fM(Dm(e))}const wd=45,Rm=".",Fm=65039,Bm=1,Ns=e=>Array.from(e);function Co(e,t){return e.P.has(t)||e.Q.has(t)}class pM extends Array{get is_emoji(){return!0}}let Fa,Lm,gn,Ba,Um,tr,ji,Yn,dn,Ad,La;function rc(){if(Fa)return;let e=Cm(qP);const t=()=>wo(e),n=()=>new Set(t()),r=(c,d)=>d.forEach(h=>c.add(h));Fa=new Map(Sm(e)),Lm=n(),gn=t(),Ba=new Set(t().map(c=>gn[c])),gn=new Set(gn),Um=n(),n();let o=Em(e),s=e();const i=()=>{let c=new Set;return t().forEach(d=>r(c,o[d])),r(c,t()),c};tr=Ao(c=>{let d=Ao(e).map(h=>h+96);if(d.length){let h=c>=s;d[0]-=32,d=lr(d),h&&(d=`Restricted[${d}]`);let f=i(),m=i(),p=!e();return{N:d,P:f,Q:m,M:p,R:h}}}),ji=n(),Yn=new Map;let a=t().concat(Ns(ji)).sort((c,d)=>c-d);a.forEach((c,d)=>{let h=e(),f=a[d]=h?a[d-h]:{V:[],M:new Map};f.V.push(c),ji.has(c)||Yn.set(c,f)});for(let{V:c,M:d}of new Set(Yn.values())){let h=[];for(let m of c){let p=tr.filter(A=>Co(A,m)),g=h.find(({G:A})=>p.some(v=>A.has(v)));g||(g={G:new Set,V:[]},h.push(g)),g.V.push(m),r(g.G,p)}let f=h.flatMap(m=>Ns(m.G));for(let{G:m,V:p}of h){let g=new Set(f.filter(A=>!m.has(A)));for(let A of p)d.set(A,g)}}dn=new Set;let l=new Set;const u=c=>dn.has(c)?l.add(c):dn.add(c);for(let c of tr){for(let d of c.P)u(d);for(let d of c.Q)u(d)}for(let c of dn)!Yn.has(c)&&!l.has(c)&&Yn.set(c,Bm);r(dn,Tm(dn)),Ad=eM(e).map(c=>pM.from(c)).sort(rM),La=new Map;for(let c of Ad){let d=[La];for(let h of c){let f=d.map(m=>{let p=m.get(h);return p||(p=new Map,m.set(h,p)),p});h===Fm?d.push(...f):d=f}for(let h of d)h.V=c}}function oc(e){return(zm(e)?"":`${sc(Gs([e]))} `)+Mm(e)}function sc(e){return`"${e}"‎`}function mM(e){if(e.length>=4&&e[2]==wd&&e[3]==wd)throw new Error(`invalid label extension: "${lr(e.slice(0,4))}"`)}function gM(e){for(let t=e.lastIndexOf(95);t>0;)if(e[--t]!==95)throw new Error("underscore allowed only at start")}function yM(e){let t=e[0],n=yd.get(t);if(n)throw Yr(`leading ${n}`);let r=e.length,o=-1;for(let s=1;s<r;s++){t=e[s];let i=yd.get(t);if(i){if(o==s)throw Yr(`${n} + ${i}`);o=s+1,n=i}}if(o==r)throw Yr(`trailing ${n}`)}function Gs(e,t=1/0,n=Mm){let r=[];bM(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let o=0,s=e.length;for(let i=0;i<s;i++){let a=e[i];zm(a)&&(r.push(lr(e.slice(o,i))),r.push(n(a)),o=i+1)}return r.push(lr(e.slice(o,s))),r.join("")}function bM(e,t){return rc(),gn.has(e)}function zm(e){return rc(),Um.has(e)}function vM(e){return CM(wM(e,hM,PM))}function wM(e,t,n){if(!e)return[];rc();let r=0;return e.split(Rm).map(o=>{let s=nM(o),i={input:s,offset:r};r+=s.length+1;try{let a=i.tokens=SM(s,t,n),l=a.length,u;if(!l)throw new Error("empty label");let c=i.output=a.flat();if(gM(c),!(i.emoji=l>1||a[0].is_emoji)&&c.every(d=>d<128))mM(c),u="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)u="Emoji";else{if(gn.has(c[0]))throw Yr("leading combining mark");for(let m=1;m<l;m++){let p=a[m];if(!p.is_emoji&&gn.has(p[0]))throw Yr(`emoji + combining mark: "${lr(a[m-1])} + ${Gs([p[0]])}"`)}yM(c);let h=Ns(new Set(d)),[f]=xM(h);EM(f,d),AM(f,h),u=f.N}}i.type=u}catch(a){i.error=a}return i})}function AM(e,t){let n,r=[];for(let o of t){let s=Yn.get(o);if(s===Bm)return;if(s){let i=s.M.get(o);if(n=n?n.filter(a=>i.has(a)):Ns(i),!n.length)return}else r.push(o)}if(n){for(let o of n)if(r.every(s=>Co(o,s)))throw new Error(`whole-script confusable: ${e.N}/${o.N}`)}}function xM(e){let t=tr;for(let n of e){let r=t.filter(o=>Co(o,n));if(!r.length)throw tr.some(o=>Co(o,n))?Qm(t[0],n):jm(n);if(t=r,r.length==1)break}return t}function CM(e){return e.map(({input:t,error:n,output:r})=>{if(n){let o=n.message;throw new Error(e.length==1?o:`Invalid label ${sc(Gs(t,63))}: ${o}`)}return lr(r)}).join(Rm)}function jm(e){return new Error(`disallowed character: ${oc(e)}`)}function Qm(e,t){let n=oc(t),r=tr.find(o=>o.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function Yr(e){return new Error(`illegal placement: ${e}`)}function EM(e,t){for(let n of t)if(!Co(e,n))throw Qm(e,n);if(e.M){let n=Tm(t);for(let r=1,o=n.length;r<o;r++)if(Ba.has(n[r])){let s=r+1;for(let i;s<o&&Ba.has(i=n[s]);s++)for(let a=r;a<s;a++)if(n[a]==i)throw new Error(`duplicate non-spacing marks: ${oc(i)}`);if(s-r>bd)throw new Error(`excessive non-spacing marks: ${sc(Gs(n.slice(r-1,s)))} (${s-r}/${bd})`);r=s}}}function SM(e,t,n){let r=[],o=[];for(e=e.slice().reverse();e.length;){let s=MM(e);if(s)o.length&&(r.push(t(o)),o=[]),r.push(n(s));else{let i=e.pop();if(dn.has(i))o.push(i);else{let a=Fa.get(i);if(a)o.push(...a);else if(!Lm.has(i))throw jm(i)}}}return o.length&&r.push(t(o)),r}function PM(e){return e.filter(t=>t!=Fm)}function MM(e,t){let n=La,r,o=e.length;for(;o&&(n=n.get(e[--o]),!!n);){let{V:s}=n;s&&(r=s,e.length=o)}return r}function Wm(e){return vM(e)}Wm.parseError=e=>e;function kM(e){return Wm(e)}const IM=e=>{const{address:t}=e,n=_h({address:t}),r=n.data?kM(n.data):void 0,{data:o}=yC({name:r});return o?w("img",{alt:r,className:"size-4 rounded-full",src:o}):null};function OM(e){const[t,n]=ze(!1),{comment:r,issue:o,onEditComment:s,handleDeleteComment:i}=e;return te(_l,{onOpenChange:n,open:t,children:[w(Zl,{asChild:!0,children:w(hm,{open:t})}),w(Hs,{className:"p-0",onClick:a=>{a.stopPropagation()},children:w(yo,{children:w(bo,{children:te(vo,{children:[w(It,{onSelect:()=>{s(),n(!1)},children:"Edit comment"}),w(It,{onSelect:()=>{i({issuePhid:o.phid,phid:r.phid}),n(!1)},children:"Delete comment"})]})})})})]})}function NM(e){const{issue:t,comment:n,user:r,state:o,handleEditComment:s,handleDeleteComment:i}=e,[a,l]=ze(!1),u=_h({address:n.creatorAddress}).data??void 0,c=tS(n.creatorAddress),d=r.address===n.creatorAddress,h=u??(d?"You":c),f=Ce(v=>{s(v),l(!1)},[s]),m=Ce(()=>{l(!1)},[]),p=d?"bg-gray-300 text-gray-900 ml-4 text-right":"bg-gray-900 text-gray-50 mr-4",g=d?"text-right text-gray-600":"text-right text-gray-400",A=n.content.split(`
88
+ `).map((v,S)=>te(cg,{children:[v,w("br",{})]},S));return te("div",{className:be(p,"p-2 rounded-lg group"),children:[te("div",{className:be("flex text-left items-center justify-between",d?"text-gray-600":"text-gray-400"),children:[te("div",{className:"flex items-center gap-1",children:[w(IM,{address:n.creatorAddress}),d?"You":h]}),d?w(OM,{comment:n,handleDeleteComment:i,issue:t,onEditComment:()=>l(!0)}):null]}),a?w("div",{className:"px-2",children:w(HP,{comment:n,handleDeleteComment:i,isEditing:a,issue:t,onCancel:m,onSubmitEditComment:f,state:o})}):w("div",{className:"px-2",children:w("p",{className:"text-inherit pb-1.5",children:A})}),w("span",{className:be(g,"block text-right mr-1 mt-1"),children:GP(n.lastEditedAt)})]})}function DM(e){var t;const{notionId:n,issue:r,handleDeleteComment:o,handleEditComment:s,state:i,user:a}=e,l=(t=i.issues.find(u=>u.phid===r.phid))==null?void 0:t.comments;return l?w("ul",{children:l.filter(u=>u.notionId===n).map(u=>w("li",{className:"my-2",children:w(NM,{comment:u,handleDeleteComment:o,handleEditComment:s,issue:r,state:i,user:a})},u.phid))}):null}function TM(e){const{document:t,context:n,scopes:r,dispatch:o,selectedIssuePhid:s,setSelectedIssuePhid:i}=e,{user:a}=n,l=t.state.global,u=t.state.global.issues,c=u.find(y=>y.phid===s),[d,h]=ze(),f=Ce(y=>{const{notionIds:x}=y.detail,E=Id.hashKey(),D={phid:E,notionIds:x,createdAt:new Date().toISOString()};o(tn.createIssue(D)),i(E),h(x[0])},[o,i,h]),m=Ce(y=>{o(tn.deleteIssue(y)),y.phid===s&&(i(void 0),h(void 0))},[o,i,s,h]),p=Ce(y=>{const{notionId:x,phid:E}=y.detail,D={phid:E,notionId:x};o(tn.addNotionId(D)),h(x),i(E)},[o,h,i]),g=Ce(y=>{const{notionId:x,phid:E}=y.detail,D={phid:E,notionId:x};o(tn.removeNotionId(D)),d===x&&h(void 0)},[o,h,d]),A=Ce(y=>{o(tn.createComment(y))},[o]),v=Ce(y=>{o(tn.deleteComment(y))},[o]),S=Ce(y=>{o(tn.editComment({...y,editedAt:new Date().toISOString()}))},[o]);Ue(()=>(window.addEventListener(kt.CREATE_ISSUE,f),window.addEventListener(kt.ADD_NOTION_ID_TO_ISSUE,p),window.addEventListener(kt.REMOVE_NOTION_ID_FROM_ISSUE,g),()=>{window.removeEventListener(kt.CREATE_ISSUE,f),window.removeEventListener(kt.ADD_NOTION_ID_TO_ISSUE,p),window.removeEventListener(kt.REMOVE_NOTION_ID_FROM_ISSUE,g)}),[f,p,g]);const M=!!a&&fg.includes(a.address);return w(oS,{children:M?te("section",{className:"h-full p-2",children:[te("h2",{className:"flex items-center relative mb-3",children:[w("span",{className:"w-full text-center text-gray-900 text-lg font-semibold",children:"Coordination Group"}),w("div",{className:"absolute right-0",children:w("svg",{className:"justify-self-end",height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",children:w("path",{d:"M7.98956 5.27202C7.73443 5.27202 6.2301 5.25335 5.98956 5.27202C2.02729 5.57668 1.32289 8.60535 1.32289 11.9387V12.6053C2.56743 11.3287 3.32289 10.6053 5.98956 10.6053C6.48663 10.6053 7.38596 10.6053 7.98956 10.6053L8.00976 12.3213C8.00976 13.268 8.59423 13.556 9.31516 12.9647L14.1023 9.03601C14.8409 8.43001 14.8409 7.44735 14.1023 6.84135L9.31516 2.91268C8.59423 2.32135 8.00976 2.60935 8.00976 3.55601L7.98956 5.27202Z",fill:"currentColor",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.002"})})})]}),w(DP,{handleDeleteIssue:m,issues:u,scopes:r,selectedIssuePhid:s,selectedNotionId:d,setSelectedIssuePhid:i,setSelectedNotionId:h,state:l}),!!c&&!!d&&te(Nt,{children:[w("div",{className:"h-px bg-gray-300 mt-3.5 mb-5"}),te("div",{className:"bg-gray-100 p-2 rounded-xl",children:[w(DM,{handleDeleteComment:v,handleEditComment:S,issue:c,notionId:d,state:l,user:a}),w(WP,{handleCreateComment:A,issue:c,notionId:d,state:l},"new-comment")]})]}),w("div",{className:"px-5",children:w("button",{className:"mt-2 bg-gray-900 text-gray-50 w-full flex justify-center items-center py-2 px-4 rounded-md",onClick:()=>Wp([]),children:"Create new issue"})})]}):w(LS,{})})}const Hm={Component:TM,documentTypes:["makerdao/feedback-issues"],config:{id:"makerdao/feedback-issues",disableExternalControls:!0,documentToolbarEnabled:!0,showSwitchboardLink:!0}},RM=window.__VITE_ENVS.PH_CONNECT_ATLAS_BASE_URL||"https://mips-portal-staging-beta.vercel.app";async function FM(){const e=new URL("/api/view-node-tree",RM);try{return await(await fetch(e)).json()}catch(t){return Nd.error(t),{}}}const BM=mg(FM),LM=Od(async e=>{const t=await e(BM);return Object.values(t).filter(r=>(r==null?void 0:r.type)==="scope")}),UM=()=>ja(LM);function zM(e){const t=UM(),[n,r]=ze();return w(Hm.Component,{...e,selectedIssuePhid:n,setSelectedIssuePhid:r,scopes:t})}const jM={...Hm,Component:zM},QM=window.__VITE_ENVS.LOCAL_DOCUMENT_EDITORS;async function WM(){const e=await uc(()=>import("./editors-CUAsvgKz.js").then(n=>n.e),__vite__mapDeps([0,1,2,3,4])),t=Object.values(e);if(t.push(jM),!QM)return t;try{const n=await uc(()=>import("LOCAL_DOCUMENT_EDITORS"),[]);return console.log("Loaded local document editors:",n),Object.values(n).concat(t)}catch(n){return console.error("Error loading local document models",n),t}}const Vm=WM(),HM=Od(Vm),VM=gg(HM),GM=()=>ja(VM),qM=()=>Vm,Gm=(e,t,n)=>{const r=t.find(s=>{var i;return((i=s.config)==null?void 0:i.id)===n&&s.documentTypes.includes(e)});return r||t.find(s=>s.documentTypes.includes(e))||t.find(s=>s.documentTypes.includes("*"))||null},KM=()=>{const e=GM(),[t]=yg();return n=>e?Gm(n,e,t.value):void 0},YM=()=>{const e=qM();return async t=>{const n=await e,r=Gm(t,n);r&&"preload"in r.Component&&await r.Component.preload()}};function xd(e){const[t,n]=ze(!1);if(Ue(()=>{setTimeout(()=>{n(!0)},e.loadingTimeout??200)},[e]),!t)return null;const{customEditorLoader:r,...o}=e;return r?w(Nt,{children:r}):w(Jm,{...o})}function Qi({message:e}){return w("div",{className:"flex size-full items-center justify-center",children:w("h3",{className:"text-lg font-semibold",children:e})})}function $M(e){const{selectedNode:t,fileNodeDocument:n,selectedParentNode:r,document:o,setSelectedNode:s,onChange:i,onExport:a,onAddOperation:l,onOpenSwitchboardLink:u}=e,[c,d]=ze(!1),h=ja(Eg),f=bg()||void 0,m=vg(),{sign:p}=wg(),g=Ag(),A=KM(),v=n==null?void 0:n.documentType,S=ts(()=>v?g(v):void 0,[v,g]),M=ts(()=>v?A(v):void 0,[v,A]),[y,x,E]=xg(S==null?void 0:S.reducer,o),D=ts(()=>({theme:h,user:f}),[h,f]),I=Cg(),R=(n==null?void 0:n.status)==="LOADING"||!y,V=M===void 0||!!y&&M&&!M.documentTypes.includes(y.documentType)&&!M.documentTypes.includes("*"),O=!!y&&(y.revision.global>0||y.revision.local>0),B=!!(y!=null&&y.clipboard.length);Cy({undo:Y,redo:W,canUndo:O,canRedo:B});function z(T,H){const X=(q,se)=>{if(!t)return;const{prevState:J}=se;Pg(q,p,t.id,J,S==null?void 0:S.reducer,f).then(fe=>{var we;return(we=window.documentEditorDebugTools)==null||we.pushOperation(q),l(fe)}).catch(Nd.error)};x(Sg(T,m,f),X,H)}Ue(()=>()=>{var T;(T=window.documentEditorDebugTools)==null||T.clear()},[]),Ue(()=>{var T;y&&((T=window.documentEditorDebugTools)==null||T.setDocument(y),i==null||i(y))},[y]);function Y(){z(lc.undo())}function W(){z(lc.redo())}function $(){s(r)}if((n==null?void 0:n.status)==="ERROR")return w(Qi,{message:"Error loading document"});if(R||V)return w(xd,{message:R?"Loading document":"Loading editor"});if((t==null?void 0:t.kind)!==Ds)return null;if(!S)return w(Qi,{message:`Document of type '${v}' is not supported`});if(M===null)return w(Qi,{message:`No editor available for document of type '${v}'`});const K=M.Component,{disableExternalControls:Z,documentToolbarEnabled:ae,showSwitchboardLink:de}=M.config||{};return te("div",{className:"relative h-full",id:"document-editor-context",children:[ae&&Z&&!c&&w(_m,{onClose:$,onExport:a,onShowRevisionHistory:()=>d(!0),title:y.name,...de&&{onSwitchboardLinkClick:u}}),!Z&&te("div",{className:"mb-4 flex justify-end gap-10",children:[w(Hr,{onClick:a,children:"Export"}),te("div",{className:"flex gap-4",children:[w(Hr,{onClick:Y,disabled:!O,children:"Undo"}),w(Hr,{onClick:W,disabled:!B,children:"Redo"})]}),w("div",{className:"flex gap-4",children:w(Hr,{onClick:$,children:"Close"})})]}),w(Nt,{children:c?w(Zm,{documentTitle:y.name,documentId:t.id,globalOperations:y.operations.global,localOperations:y.operations.local,onClose:()=>d(!1)}):w(dg,{fallback:w(xd,{}),children:w(K,{error:E,context:D,document:y,documentNodeName:t.name,dispatch:z,onClose:$,onExport:a,canUndo:O,canRedo:B,undo:Y,redo:W,onSwitchboardLinkClick:u,onShowRevisionHistory:()=>d(!0),isAllowedToCreateDocuments:(I==null?void 0:I.isAllowedToCreateDocuments)??!1,isAllowedToEditDocuments:(I==null?void 0:I.isAllowedToEditDocuments)??!1})})})]})}const Cd=({title:e,children:t,...n})=>te("div",{...n,children:[e&&w("div",{className:"mb-4 text-base font-semibold text-gray-600",children:e}),w("div",{className:"flex flex-wrap gap-2",children:t})]});function Vn(e,t,n){let r=n.initialDeps??[],o;return()=>{var s,i,a,l;let u;n.key&&((s=n.debug)!=null&&s.call(n))&&(u=Date.now());const c=e();if(!(c.length!==r.length||c.some((f,m)=>r[m]!==f)))return o;r=c;let h;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(h=Date.now()),o=t(...c),n.key&&((a=n.debug)!=null&&a.call(n))){const f=Math.round((Date.now()-u)*100)/100,m=Math.round((Date.now()-h)*100)/100,p=m/16,g=(A,v)=>{for(A=String(A);A.length<v;)A=" "+A;return A};console.info(`%c⏱ ${g(m,5)} /${g(f,5)} ms`,`
89
+ font-size: .6rem;
90
+ font-weight: bold;
91
+ color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,o),o}}function Wi(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const JM=(e,t)=>Math.abs(e-t)<1,_M=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},ZM=e=>e,XM=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},ek=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=i=>{const{width:a,height:l}=i;t({width:Math.round(a),height:Math.round(l)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(i=>{const a=i[0];if(a!=null&&a.borderBoxSize){const l=a.borderBoxSize[0];if(l){o({width:l.inlineSize,height:l.blockSize});return}}o(n.getBoundingClientRect())});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},Ed={passive:!0},tk=typeof window>"u"?!0:"onscrollend"in window,nk=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const s=e.options.useScrollendEvent&&tk?()=>{}:_M(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),i=u=>()=>{const{horizontal:c,isRtl:d}=e.options;o=c?n.scrollLeft*(d&&-1||1):n.scrollTop,s(),t(o,u)},a=i(!0),l=i(!1);return l(),n.addEventListener("scroll",a,Ed),n.addEventListener("scrollend",l,Ed),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",l)}},rk=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},ok=(e,{adjustments:t=0,behavior:n},r)=>{var o,s;const i=e+t;(s=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||s.call(o,{[r.options.horizontal?"left":"top"]:i,behavior:n})};class sk{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(s=>{this._measureElement(s.target,s)})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var s;return(s=r())==null?void 0:s.observe(o,{box:"border-box"})},unobserve:o=>{var s;return(s=r())==null?void 0:s.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ZM,rangeExtractor:XM,onChange:()=>{},measureElement:rk,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Vn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,s=new Map;for(let i=r-1;i>=0;i--){const a=n[i];if(o.has(a.lane))continue;const l=s.get(a.lane);if(l==null||a.end>l.end?s.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=Vn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,s,i)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:s,enabled:i}),{key:!1}),this.getMeasurements=Vn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:s,enabled:i},a)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let c=l;c<n;c++){const d=s(c),h=this.options.lanes===1?u[c-1]:this.getFurthestMeasurement(u,c),f=h?h.end+this.options.gap:r+o,m=a.get(d),p=typeof m=="number"?m:this.options.estimateSize(c),g=f+p,A=h?h.lane:c%this.options.lanes;u[c]={index:c,start:f,size:p,end:g,key:d,lane:A}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Vn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,o)=>this.range=n.length>0&&r>0?ik({measurements:n,outerSize:r,scrollOffset:o}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=Vn(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,o,s)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,overscan:o,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),s=this.measurementsCache[o];if(!s)return;const i=s.key,a=this.elementsCache.get(i);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(i,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const s=this.itemSizeCache.get(o.key)??o.size,i=r-s;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,i,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=Vn(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let s=0,i=n.length;s<i;s++){const a=n[s],l=r[a];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Wi(r[qm(0,r.length-1,o=>Wi(r[o]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const o=this.getSize(),s=this.getScrollOffset();r==="auto"&&(n<=s?r="start":n>=s+o?r="end":r="start"),r==="start"?n=n:r==="end"?n=n-o:r==="center"&&(n=n-o/2);const i=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-o;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const s=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(o.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(o.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const s=this.getOffsetForIndex(n,r);if(!s)return;const[i,a]=s;this._scrollToOffset(i,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[u]=Wi(this.getOffsetForIndex(n,a));JM(u,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:o})}else this.scrollToIndex(n,{align:a,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(s=>s.end)),Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const qm=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,s=n(o);if(s<r)e=o+1;else if(s>r)t=o-1;else return o}return e>0?e-1:0};function ik({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,s=qm(0,r,a=>e[a].start,n);let i=s;for(;i<r&&e[i].end<n+t;)i++;return{startIndex:s,endIndex:i}}const ak=typeof document<"u"?b.useLayoutEffect:b.useEffect;function lk(e){const t=b.useReducer(()=>({}),{})[1],n={...e,onChange:(o,s)=>{var i;s?Tg(t):t(),(i=e.onChange)==null||i.call(e,o,s)}},[r]=b.useState(()=>new sk(n));return r.setOptions(n),b.useEffect(()=>r._didMount(),[]),ak(()=>r._willUpdate()),r}function Sd(e){return lk({observeElementRect:ek,observeElementOffset:nk,scrollToFn:ok,...e})}const ck=()=>{const[e,t]=ze({innerWidth:window.innerWidth,innerHeight:window.innerHeight});return Ue(()=>{const n=()=>{t({innerWidth:window.innerWidth,innerHeight:window.innerHeight})};return window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[]),e},Wr=8,Hi=256,Pd=48,uk=420;function dk(e){const t=nr(null),{t:n}=Ts(),r=ck(),{fileNodes:o}=e,s=r.innerWidth-uk,i=Math.floor(s/(Hi+Wr))||1,a=Math.ceil(o.length/i),l=Sd({count:a,getScrollElement:()=>t.current,estimateSize:f=>f>0?Pd+Wr:Pd,overscan:5}),u=Sd({horizontal:!0,count:i,getScrollElement:()=>t.current,estimateSize:f=>f>0?Hi+Wr:Hi,overscan:5}),c=(f,m)=>f*i+m,d=(f,m)=>{const p=c(f,m);return o[p]||null};if(o.length===0)return w("div",{className:"mb-8 text-sm text-gray-400",children:n("folderView.sections.documents.empty")});const h=(f,m)=>{const p=d(f,m);return p?w("div",{style:{marginLeft:m===0?0:Wr},children:$r(Xm,{...e,key:p.id,uiNode:p})}):null};return w("div",{ref:t,style:{height:"400px",width:"100%",overflow:"auto"},children:w("div",{style:{height:`${l.getTotalSize()}px`,width:`${u.getTotalSize()}px`,position:"relative"},children:l.getVirtualItems().map(f=>w(re.Fragment,{children:u.getVirtualItems().map(m=>w("div",{style:{position:"absolute",top:0,left:0,marginTop:f.index===0?0:Wr,width:`${m.size}px`,height:`${f.size}px`,transform:`translateX(${m.start}px) translateY(${f.start}px)`},children:h(f.index,m.index)},m.key))},f.key))})})}function fk(e){const{t}=Ts(),{selectedParentNode:n}=e,{isDropTarget:r,dropProps:o}=eg({...e,uiNode:n}),s=(n==null?void 0:n.children.filter(a=>a.kind===tg).sort(fc))??[],i=(n==null?void 0:n.children.filter(a=>a.kind===Ds).sort(fc))??[];return te("div",{...o,className:qi("rounded-md border-2 border-transparent p-2",r&&"border-dashed border-blue-100"),children:[w(Cd,{title:t("folderView.sections.folders.title"),className:"mb-4",children:s.length>0?s.map(a=>$r(ng,{...e,key:a.id,uiNode:a})):w("div",{className:"mb-8 text-sm text-gray-400",children:t("folderView.sections.folders.empty")})}),w(Cd,{title:t("folderView.sections.documents.title"),children:w("div",{className:qi("w-full",i.length>0?"min-h-[400px]":"min-h-14"),children:w(dk,{...e,fileNodes:i})})})]})}const hk=()=>{const{showModal:e}=Dd(),[,t]=Mg();return te(rg,{children:[w($s,{onClick:()=>{t(!0)},children:w(Js,{i18nKey:"footer.cookiePolicy"})}),w($s,{onClick:()=>e("disclaimerModal",{}),children:w(Js,{i18nKey:"footer.disclaimer"})}),w($s,{id:"ph-logo-link",onClick:()=>Rg("https://www.powerhouse.inc/"),children:w(Js,{i18nKey:"footer.builtWith",components:{icon:w(Gn,{name:"PowerhouseLogoSmall",size:16,className:"mx-1"})}})})]})},pk=[{id:"project",label:".project",icon:w(Gn,{name:"Project",color:"#FF6A55",size:16})},{id:"budget",label:".budget",icon:w(Gn,{name:"BarChart",color:"#8E55EA",size:16})},{id:"profile",label:".profile",icon:w(Gn,{name:"Person",color:"#3E90F0",size:16})},{id:"legal",label:".legal",icon:w(Gn,{name:"Briefcase",color:"#4BAB71",size:16})},{id:"atlas",label:".Atlas",icon:w(Gn,{name:"Globe",color:"#FF8A00",size:16})}],mk=()=>{const{t:e}=Ts();return w(og,{className:"max-w-searchbar-width m-4 shrink-0 bg-gray-100",placeholder:e("searchbar.placeholder"),filterLabel:e("searchbar.filterLabel"),filterItems:pk})};function gk(e){const t=e[0];if(!t)return;if(t.kind!==ig)throw new Error("Node path is invalid, first node is not a drive node.");const n=yk(t),r=e.slice(1).map(s=>encodeURIComponent(s.slug||s.name));return[n,...r].join("/")}function yk(e){const t=e.slug||e.name||e.id;return`/d/${encodeURIComponent(t)}`}function Md(e,t,n){if(!t)return e[0];const r=decodeURIComponent(t),o=e.find(a=>(a==null?void 0:a.id)===r||(a==null?void 0:a.slug)===r||(a==null?void 0:a.name)===r);if(!o)return e[0];if(!n)return o;const s=n.split("/").filter(Boolean).map(decodeURIComponent);let i=o;for(const a of s){if(i.kind===Ds)break;const l=i.children.find(u=>u.slug===a||u.name===a);if(!l){console.error("Node not found:",a);break}i=l}return i}const bk=()=>{const e=kg(),t=Ig(),{search:n,pathname:r}=t,o=Og(),{driveNodes:s,selectedNode:i,selectedNodePath:a,setSelectedNode:l}=sg(),u=o.driveId,c=o["*"],d=Md(s,u,c),h=gk(a);Ue(()=>{!h||h===r||e({pathname:h,search:n})},[n,e,h]),Ue(()=>{i||!d||l(d)},[i,d,l]),Ue(()=>{const f=Md(s,u,c);f&&l(f)},[s,u,c,l])},vk=e=>{const t=[];if(e.documentType!=="powerhouse/document-model")return t;const r=e.state.global.specifications[0],o=Object.keys(r.state).reduce((a,l)=>{const u=l;return[...a,..._s.validateInitialState(r.state[u].initialValue,u!=="global").map(c=>({...c,message:`${c.message}. Scope: ${u}`,details:{...c.details,scope:u}}))]},[]),s=Object.keys(r.state).reduce((a,l)=>{var d;const u=l,c=u==="global";return[...a,..._s.validateStateSchemaName(r.state[u].schema,e.name||((d=e.state.global)==null?void 0:d.name)||"",c?"":u,!c).map(h=>({...h,message:`${h.message}. Scope: ${u}`,details:{...h.details,scope:u}}))]},[]),i=_s.validateModules(r.modules);return[...o,...s,...i]},wk=e=>e==="RealWorldAssets"?"RWA Portfolio":e;function Dk(){const[e]=Ng(),{t}=Ts(),n=dc(),{selectedNode:r,selectedDriveNode:o,selectedParentNode:s,isRemoteDrive:i,isAllowedToCreateDocuments:a,fileNodeDocument:l,selectedDocument:u,documentModels:c,setSelectedNode:d,openSwitchboardLink:h,setSelectedDocument:f,addOperationToSelectedDocument:m,addFile:p,renameNode:g,getDocumentModel:A}=dc(),{showModal:v}=Dd(),S=YM();bk(),Ue(()=>{if(!c)return;const I=window.requestIdleCallback??setTimeout,R=window.cancelIdleCallback??clearTimeout,V=I(async()=>{for(const O of c)await S(O.documentModel.id)});return()=>R(V)},[c,S]),Ue(()=>{var I;return(I=window.electronAPI)==null?void 0:I.handleFileOpen(async R=>{!o||(r==null?void 0:r.kind)!==Ds||await p(R.content,o.id,R.name,r.parentFolder)})},[o,r,p]);async function M(I){if(!u)throw new Error("No document selected");if(!m)throw new Error("No add operation function defined");await m(I)}function y(I){o&&v("createDocument",{documentModel:I,selectedParentNode:s,setSelectedNode:d})}function x(I){const R=vk(I);if(R.length)v("confirmationModal",{title:t("modals.exportDocumentWithErrors.title"),body:te("div",{children:[w("p",{children:t("modals.exportDocumentWithErrors.body")}),w("ul",{className:"mt-4 flex list-disc flex-col items-start px-4 text-xs",children:R.map((V,O)=>w("li",{children:V.message},O))})]}),cancelLabel:t("common.cancel"),continueLabel:t("common.export"),onCancel(V){V()},onContinue(V){return V(),cc(I,A)}});else return cc(I,A)}return te("div",{className:"flex h-full flex-col overflow-auto bg-gray-100 p-6 pb-3",id:"content-view",children:[l?w("div",{className:"flex-1 rounded-2xl bg-gray-50 p-4",children:w($M,{...n,document:u,onChange:I=>{if(f(I),r&&I.name!==""&&r.name!==I.name)return g(r.driveId,r.id,I.name)},onExport:()=>u&&x(u),onAddOperation:M,...i&&{onOpenSwitchboardLink:async()=>{await h(r)}}})}):w(Nt,{children:te("div",{className:"grow overflow-auto rounded-2xl bg-gray-50 p-2",children:[w(ag,{...n}),e.content.showSearchBar&&w(mk,{}),te("div",{className:"px-4",children:[w("div",{className:"mb-5",children:w(fk,{...n})}),a&&te(Nt,{children:[w("h3",{className:"mb-3 mt-4 text-xl font-bold text-gray-600",children:"New document"}),w("div",{className:"flex w-full flex-wrap gap-4",children:c==null?void 0:c.map(I=>w(Hr,{"aria-details":I.documentModel.description,className:"bg-gray-200 text-slate-800",onClick:()=>y(I),children:w("span",{className:"text-sm",children:wk(I.documentModel.name)})},I.documentModel.id))})]})]})]})}),w("div",{className:"flex w-full flex-row justify-end pr-3 pt-3",children:w(hk,{})})]})}export{Dk as default};
92
+ //# sourceMappingURL=content-C7DGe_qU.js.map