@powerhousedao/connect 1.0.0-sky.187 → 1.0.0-sky.188
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.
- package/dist/assets/{app-D49Tx2Bq.js → app-CCIiKpPD.js} +16 -16
- package/dist/assets/app-CCIiKpPD.js.map +1 -0
- package/dist/assets/{app-loader-DxOroInF.js → app-loader-BfaRR27W.js} +3 -3
- package/dist/assets/{app-loader-DxOroInF.js.map → app-loader-BfaRR27W.js.map} +1 -1
- package/dist/assets/{browser-nO0Wirvo.js → browser-howbEbax.js} +4 -4
- package/dist/assets/{browser-nO0Wirvo.js.map → browser-howbEbax.js.map} +1 -1
- package/dist/assets/{ccip-Cbtp8sOL.js → ccip-uEKD33vK.js} +2 -2
- package/dist/assets/{ccip-Cbtp8sOL.js.map → ccip-uEKD33vK.js.map} +1 -1
- package/dist/assets/content-BjANsuRK.js +92 -0
- package/dist/assets/content-BjANsuRK.js.map +1 -0
- package/dist/assets/{editor-BPCS6Xtf.js → editor-7J_sXwzQ.js} +2 -2
- package/dist/assets/{editor-BPCS6Xtf.js.map → editor-7J_sXwzQ.js.map} +1 -1
- package/dist/assets/{editor-CAG-sw6z.js → editor-BvunQMK4.js} +2 -2
- package/dist/assets/{editor-CAG-sw6z.js.map → editor-BvunQMK4.js.map} +1 -1
- package/dist/assets/{editor-DyQFQRZr.js → editor-DU-lQtwD.js} +2 -2
- package/dist/assets/{editor-DyQFQRZr.js.map → editor-DU-lQtwD.js.map} +1 -1
- package/dist/assets/{editor-BZe-FWPe.js → editor-DsJju1GR.js} +2 -2
- package/dist/assets/{editor-BZe-FWPe.js.map → editor-DsJju1GR.js.map} +1 -1
- package/dist/assets/{editors-Cp2pNRWI.js → editors-C0ROY17i.js} +5 -5
- package/dist/assets/{editors-Cp2pNRWI.js.map → editors-C0ROY17i.js.map} +1 -1
- package/dist/assets/{index-KDfZFawS.js → index-Cgfr30M3.js} +2 -2
- package/dist/assets/{index-KDfZFawS.js.map → index-Cgfr30M3.js.map} +1 -1
- package/dist/assets/{index-CH59hMeC.js → index-h0as4MhA.js} +3 -3
- package/dist/assets/{index-CH59hMeC.js.map → index-h0as4MhA.js.map} +1 -1
- package/dist/assets/{main.B_r_OGSY.js → main.CnQ6SfYh.js} +2 -2
- package/dist/assets/{main.B_r_OGSY.js.map → main.CnQ6SfYh.js.map} +1 -1
- package/dist/assets/{root-Boy6zt_e.js → root-DY0hjxda.js} +2 -2
- package/dist/assets/{root-Boy6zt_e.js.map → root-DY0hjxda.js.map} +1 -1
- package/dist/assets/{router-D7_xmk-f.js → router-CUrO08Jn.js} +4 -4
- package/dist/assets/{router-D7_xmk-f.js.map → router-CUrO08Jn.js.map} +1 -1
- package/dist/assets/useUiNodes-Q80utwRx.js +107 -0
- package/dist/assets/{useUiNodes-BBBwb6rq.js.map → useUiNodes-Q80utwRx.js.map} +1 -1
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/dist/swEnv.js +2 -2
- package/dist/vite-envs.sh +5 -5
- package/package.json +2 -2
- package/dist/assets/app-D49Tx2Bq.js.map +0 -1
- package/dist/assets/content-3KD38dCg.js +0 -92
- package/dist/assets/content-3KD38dCg.js.map +0 -1
- package/dist/assets/useUiNodes-BBBwb6rq.js +0 -107
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editors-Cp2pNRWI.js","assets/main.B_r_OGSY.js","assets/app-D49Tx2Bq.js","assets/app-loader-DxOroInF.js","assets/app-loader-DoI5W0wZ.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{jsx as v,jsxs as ee,Fragment as st}from"react/jsx-runtime";import{DefaultEditorLoader as Zm,FILE as Ds,DocumentToolbar as Xm,RevisionHistory as eg,FileItem as tg,useDrop as ng,FOLDER as rg,FolderItem as og,Footer as sg,FooterLink as $s,Icon as Gn,ConnectSearchBar as ig,useUiNodesContext as ag,DRIVE as ug,Breadcrumbs as lg}from"@powerhousedao/design-system";import*as b from"react";import re,{useState as Fe,useRef as nr,useCallback as ge,useContext as za,useLayoutEffect as Od,useEffect as Ue,createContext as Ua,forwardRef as je,useImperativeHandle as cg,useMemo as qr,createElement as Jr,Fragment as dg,useSyncExternalStore as fg,Suspense as hg}from"react";import{x as Nd,y as tn,U as pg,z as mg,V as gg,A as yg,B as Dd,j as Rd,C as ja,F as bg,G as wg,H as vg,I as Ag,J as xg,K as Cg,L as Eg,M as Sg,N as Pg,P as kg,Q as ll,S as Ig,k as Rs,t as Fd,T as Mg,W as Js,a as Og,u as Ng,X as Dg,Y as _s,r as Rg,Z as cl}from"./app-D49Tx2Bq.js";import{_ as dl}from"./main.B_r_OGSY.js";import*as Td from"react-dom";import Fg,{flushSync as Tg}from"react-dom";import{o as Bg,u as fl}from"./useUiNodes-BBBwb6rq.js";import"./app-loader-DxOroInF.js";const hl=(e,t)=>e.name.localeCompare(t.name);function Lg(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=Bd(t))&&(r&&(r+=" "),r+=n);return r}function Bd(e){if(typeof e=="string")return e;for(var t,n="",r=0;r<e.length;r++)e[r]&&(t=Bd(e[r]))&&(n&&(n+=" "),n+=t);return n}var Qa="-";function zg(e){var t=jg(e),n=e.conflictingClassGroups,r=e.conflictingClassGroupModifiers,o=r===void 0?{}:r;function s(a){var u=a.split(Qa);return u[0]===""&&u.length!==1&&u.shift(),Ld(u,t)||Ug(a)}function i(a,u){var c=n[a]||[];return u&&o[a]?[].concat(c,o[a]):c}return{getClassGroupId:s,getConflictingClassGroupIds:i}}function Ld(e,t){var i;if(e.length===0)return t.classGroupId;var n=e[0],r=t.nextPart.get(n),o=r?Ld(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 u=a.validator;return u(s)}))==null?void 0:i.classGroupId}}var pl=/^\[(.+)\]$/;function Ug(e){if(pl.test(e)){var t=pl.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function jg(e){var t=e.theme,n=e.prefix,r={nextPart:new Map,validators:[]},o=Wg(Object.entries(e.classGroups),n);return o.forEach(function(s){var i=s[0],a=s[1];Hi(a,r,i,t)}),r}function Hi(e,t,n,r){e.forEach(function(o){if(typeof o=="string"){var s=o===""?t:ml(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Qg(o)){Hi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(function(i){var a=i[0],u=i[1];Hi(u,ml(t,a),n,r)})})}function ml(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 Qg(e){return e.isThemeGetter}function Wg(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 u=a[0],c=a[1];return[t+u,c]})):i});return[r,s]}):e}function Vg(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 zd="!";function Hg(e){var t=e.separator||":",n=t.length===1,r=t[0],o=t.length;return function(i){for(var a=[],u=0,c=0,l,d=0;d<i.length;d++){var h=i[d];if(u===0){if(h===r&&(n||i.slice(d,d+o)===t)){a.push(i.slice(c,d)),c=d+o;continue}if(h==="/"){l=d;continue}}h==="["?u++:h==="]"&&u--}var f=a.length===0?i:i.substring(c),g=f.startsWith(zd),p=g?f.substring(1):f,m=l&&l>c?l-c:void 0;return{modifiers:a,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:m}}}function Gg(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 qg(e){return{cache:Vg(e.cacheSize),splitModifiers:Hg(e),...zg(e)}}var Kg=/\s+/;function Yg(e,t){var n=t.splitModifiers,r=t.getClassGroupId,o=t.getConflictingClassGroupIds,s=new Set;return e.trim().split(Kg).map(function(i){var a=n(i),u=a.modifiers,c=a.hasImportantModifier,l=a.baseClassName,d=a.maybePostfixModifierPosition,h=r(d?l.substring(0,d):l),f=!!d;if(!h){if(!d)return{isTailwindClass:!1,originalClassName:i};if(h=r(l),!h)return{isTailwindClass:!1,originalClassName:i};f=!1}var g=Gg(u).join(":"),p=c?g+zd:g;return{isTailwindClass:!0,modifierId:p,classGroupId:h,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(function(i){if(!i.isTailwindClass)return!0;var a=i.modifierId,u=i.classGroupId,c=i.hasPostfixModifier,l=a+u;return s.has(l)?!1:(s.add(l),o(u,c).forEach(function(d){return s.add(a+d)}),!0)}).reverse().map(function(i){return i.originalClassName}).join(" ")}function $g(){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(c){var l=t[0],d=t.slice(1),h=d.reduce(function(f,g){return g(f)},l());return r=qg(h),o=r.cache.get,s=r.cache.set,i=u,u(c)}function u(c){var l=o(c);if(l)return l;var d=Yg(c,r);return s(c,d),d}return function(){return i(Lg.apply(null,arguments))}}function pe(e){var t=function(r){return r[e]||[]};return t.isThemeGetter=!0,t}var Ud=/^\[(?:([a-z-]+):)?(.+)\]$/i,Jg=/^\d+\/\d+$/,_g=new Set(["px","full","screen"]),Zg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xg=/\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$/,ey=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function Xe(e){return pn(e)||_g.has(e)||Jg.test(e)||Gi(e)}function Gi(e){return Mn(e,"length",iy)}function ty(e){return Mn(e,"size",jd)}function ny(e){return Mn(e,"position",jd)}function ry(e){return Mn(e,"url",ay)}function To(e){return Mn(e,"number",pn)}function pn(e){return!Number.isNaN(Number(e))}function oy(e){return e.endsWith("%")&&pn(e.slice(0,-1))}function gr(e){return gl(e)||Mn(e,"number",gl)}function ie(e){return Ud.test(e)}function yr(){return!0}function Tt(e){return Zg.test(e)}function sy(e){return Mn(e,"",uy)}function Mn(e,t,n){var r=Ud.exec(e);return r?r[1]?r[1]===t:n(r[2]):!1}function iy(e){return Xg.test(e)}function jd(){return!1}function ay(e){return e.startsWith("url(")}function gl(e){return Number.isInteger(Number(e))}function uy(e){return ey.test(e)}function ly(){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"),u=pe("contrast"),c=pe("grayscale"),l=pe("hueRotate"),d=pe("invert"),h=pe("gap"),f=pe("gradientColorStops"),g=pe("gradientColorStopPositions"),p=pe("inset"),m=pe("margin"),A=pe("opacity"),w=pe("padding"),S=pe("saturate"),k=pe("scale"),y=pe("sepia"),x=pe("skew"),E=pe("space"),D=pe("translate"),O=function(){return["auto","contain","none"]},T=function(){return["auto","hidden","clip","visible","scroll"]},W=function(){return["auto",ie,t]},I=function(){return[ie,t]},F=function(){return["",Xe]},B=function(){return["auto",pn,ie]},q=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},V=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"]},Y=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,To]},R=function(){return[pn,ie]};return{cacheSize:500,theme:{colors:[yr],spacing:[Xe],blur:["none","",Tt,ie],brightness:de(),borderColor:[e],borderRadius:["none","","full",Tt,ie],borderSpacing:I(),borderWidth:F(),contrast:de(),grayscale:Z(),hueRotate:R(),invert:Z(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[oy,Gi],inset:W(),margin:W(),opacity:de(),padding:I(),saturate:de(),scale:de(),sepia:Z(),skew:R(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",ie]}],container:["container"],columns:[{columns:[Tt]}],"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(q(),[ie])}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],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:W()}],"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":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[yr]}],"row-start-end":[{row:["auto",{span:[gr]},ie]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"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(Y())}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(Y(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(Y(),["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"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:[Tt]},Tt,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",Tt,Gi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",To]}],"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,To]}],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(V(),["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:I()}],"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(q(),[ny])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ty]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ry]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"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(V(),["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:V()}],"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(V())}],"outline-offset":[{"outline-offset":[ie,Xe]}],"outline-w":[{outline:[Xe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"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",Tt,sy]}],"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:[u]}],"drop-shadow":[{"drop-shadow":["","none",Tt,ie]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[l]}],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":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"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:R()}],ease:[{ease:["linear","in","out","in-out",ie]}],delay:[{delay:R()}],animate:[{animate:["none","spin","ping","pulse","bounce",ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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,To]}],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=$g(ly);const Vr=({className:e,...t})=>v("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 Qd=["shift","alt","meta","mod","ctrl"],cy={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&&cy[e]||e||"").trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function dy(e){return Qd.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!Qd.includes(i)});return Ki({},o,{keys:s,description:n,hotkey:e})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&Wd([Wt(e.key),Wt(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&Vd([Wt(e.key),Wt(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Vt.clear()})})();var Vt=new Set;function Wa(e){return Array.isArray(e)}function fy(e,t){t===void 0&&(t=",");var n=Wa(e)?e:e.split(t);return n.every(function(r){return Vt.has(r.trim().toLowerCase())})}function Wd(e){var t=Array.isArray(e)?e:[e];Vt.has("meta")&&Vt.forEach(function(n){return!dy(n)&&Vt.delete(n.toLowerCase())}),t.forEach(function(n){return Vt.add(n.toLowerCase())})}function Vd(e){var t=Array.isArray(e)?e:[e];e==="meta"?Vt.clear():t.forEach(function(n){return Vt.delete(n.toLowerCase())})}function hy(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function py(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function my(e){return Hd(e,["input","textarea","select"])}function Hd(e,t){t===void 0&&(t=!1);var n=e.target,r=e.composed,o=null;return gy(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 gy(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function yy(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 by=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,i=n.mod,a=n.shift,u=n.ctrl,c=n.keys,l=t.key,d=t.code,h=t.ctrlKey,f=t.metaKey,g=t.shiftKey,p=t.altKey,m=Wt(d),A=l.toLowerCase();if(!(c!=null&&c.includes(m))&&!(c!=null&&c.includes(A))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(m))return!1;if(!r){if(o===!p&&A!=="alt"||a===!g&&A!=="shift")return!1;if(i){if(!f&&!h)return!1}else if(s===!f&&A!=="meta"&&A!=="os"||u===!h&&A!=="ctrl"&&A!=="control")return!1}return c&&c.length===1&&(c.includes(A)||c.includes(m))?!0:c?fy(c):!c},wy=Ua(void 0),vy=function(){return za(wy)};function Gd(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&&Gd(e[r],t[r])},!0):e===t}var Ay=Ua({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),xy=function(){return za(Ay)};function Cy(e){var t=nr(void 0);return Gd(t.current,e)||(t.current=e),t.current}var yl=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},Ey=typeof window<"u"?Od:Ue;function bl(e,t,n,r){var o=Fe(null),s=o[0],i=o[1],a=nr(!1),u=n instanceof Array?r instanceof Array?void 0:r:n,c=Wa(e)?e.join(u==null?void 0:u.splitKey):e,l=n instanceof Array?n:r instanceof Array?r:void 0,d=ge(t,l??[]),h=nr(d);l?h.current=d:h.current=t;var f=Cy(u),g=xy(),p=g.enabledScopes,m=vy();return Ey(function(){if(!((f==null?void 0:f.enabled)===!1||!yy(p,f==null?void 0:f.scopes))){var A=function(x,E){var D;if(E===void 0&&(E=!1),!(my(x)&&!Hd(x,f==null?void 0:f.enableOnFormTags))){if(s!==null){var O=s.getRootNode();if((O instanceof Document||O instanceof ShadowRoot)&&O.activeElement!==s&&!s.contains(O.activeElement)){yl(x);return}}(D=x.target)!=null&&D.isContentEditable&&!(f!=null&&f.enableOnContentEditable)||Zs(c,f==null?void 0:f.splitKey).forEach(function(T){var W,I=Xs(T,f==null?void 0:f.combinationKey);if(by(x,I,f==null?void 0:f.ignoreModifiers)||(W=I.keys)!=null&&W.includes("*")){if(f!=null&&f.ignoreEventWhen!=null&&f.ignoreEventWhen(x)||E&&a.current)return;if(hy(x,I,f==null?void 0:f.preventDefault),!py(x,I,f==null?void 0:f.enabled)){yl(x);return}h.current(x,I),E||(a.current=!0)}})}},w=function(x){x.key!==void 0&&(Wd(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&&(Vd(Wt(x.code)),a.current=!1,f!=null&&f.keyup&&A(x,!0))},k=s||(u==null?void 0:u.document)||document;return k.addEventListener("keyup",S),k.addEventListener("keydown",w),m&&Zs(c,f==null?void 0:f.splitKey).forEach(function(y){return m.addHotkey(Xs(y,f==null?void 0:f.combinationKey,f==null?void 0:f.description))}),function(){k.removeEventListener("keyup",S),k.removeEventListener("keydown",w),m&&Zs(c,f==null?void 0:f.splitKey).forEach(function(y){return m.removeHotkey(Xs(y,f==null?void 0:f.combinationKey,f==null?void 0:f.description))})}}},[s,c,f,p]),i}const Sy=e=>{var u;const{undo:t,redo:n,canRedo:r,canUndo:o}=e,{isMac:s}=((u=window.electronAPI)==null?void 0:u.platformInfo)||{};let i="ctrl+z",a="ctrl+y";s&&(i="mod+z",a="mod+shift+z"),bl(i,c=>{c.preventDefault(),o&&t()},{},[o,t]),bl(a,c=>{c.preventDefault(),r&&n()},{},[r,n])};var qd=e=>{throw TypeError(e)},Va=(e,t,n)=>t.has(e)||qd("Cannot "+n),P=(e,t,n)=>(Va(e,t,"read from private field"),n?n.call(e):t.get(e)),te=(e,t,n)=>t.has(e)?qd("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),G=(e,t,n,r)=>(Va(e,t,"write to private field"),t.set(e,n),n),le=(e,t,n)=>(Va(e,t,"access private method"),n),Yi=(e,t,n,r)=>({set _(o){G(e,t,o)},get _(){return P(e,t,r)}});const Ha="-",Py=e=>{const t=Iy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const s=o.split(Ha);return s[0]===""&&s.length!==1&&s.shift(),Kd(s,t)||ky(o)},getConflictingClassGroupIds:(o,s)=>{const i=n[o]||[];return s&&r[o]?[...i,...r[o]]:i}}},Kd=(e,t)=>{var n;if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),s=o?Kd(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Ha);return(n=t.validators.find(({validator:a})=>a(i)))==null?void 0:n.classGroupId},wl=/^\[(.+)\]$/,ky=e=>{if(wl.test(e)){const t=wl.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Iy=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Oy(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:vl(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,vl(t,s),n,r)})})},vl=(e,t)=>{let n=e;return t.split(Ha).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},My=e=>e.isThemeGetter,Oy=(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,Ny=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)}}},Yd="!",Dy=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const u=[];let c=0,l=0,d;for(let m=0;m<a.length;m++){let A=a[m];if(c===0){if(A===o&&(r||a.slice(m,m+s)===t)){u.push(a.slice(l,m)),l=m+s;continue}if(A==="/"){d=m;continue}}A==="["?c++:A==="]"&&c--}const h=u.length===0?a:a.substring(l),f=h.startsWith(Yd),g=f?h.substring(1):h,p=d&&d>l?d-l:void 0;return{modifiers:u,hasImportantModifier:f,baseClassName:g,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:i}):i},Ry=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},Fy=e=>({cache:Ny(e.cacheSize),parseClassName:Dy(e),...Py(e)}),Ty=/\s+/,By=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Ty);let a="";for(let u=i.length-1;u>=0;u-=1){const c=i[u],{modifiers:l,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=n(c);let g=!!f,p=r(g?h.substring(0,f):h);if(!p){if(!g){a=c+(a.length>0?" "+a:a);continue}if(p=r(h),!p){a=c+(a.length>0?" "+a:a);continue}g=!1}const m=Ry(l).join(":"),A=d?m+Yd:m,w=A+p;if(s.includes(w))continue;s.push(w);const S=o(p,g);for(let k=0;k<S.length;++k){const y=S[k];s.push(A+y)}a=c+(a.length>0?" "+a:a)}return a};function Ly(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=$d(t))&&(r&&(r+=" "),r+=n);return r}const $d=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=$d(e[r]))&&(n&&(n+=" "),n+=t);return n};function zy(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((l,d)=>d(l),e());return n=Fy(c),r=n.cache.get,o=n.cache.set,s=a,a(u)}function a(u){const c=r(u);if(c)return c;const l=By(u,n);return o(u,l),l}return function(){return s(Ly.apply(null,arguments))}}const me=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Jd=/^\[(?:([a-z-]+):)?(.+)\]$/i,Uy=/^\d+\/\d+$/,jy=new Set(["px","full","screen"]),Qy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wy=/\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$/,Vy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Hy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>Jn(e)||jy.has(e)||Uy.test(e),Bt=e=>cr(e,"length",Xy),Jn=e=>!!e&&!Number.isNaN(Number(e)),ei=e=>cr(e,"number",Jn),br=e=>!!e&&Number.isInteger(Number(e)),qy=e=>e.endsWith("%")&&Jn(e.slice(0,-1)),ne=e=>Jd.test(e),Lt=e=>Qy.test(e),Ky=new Set(["length","size","percentage"]),Yy=e=>cr(e,Ky,_d),$y=e=>cr(e,"position",_d),Jy=new Set(["image","url"]),_y=e=>cr(e,Jy,tb),Zy=e=>cr(e,"",eb),wr=()=>!0,cr=(e,t,n)=>{const r=Jd.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Xy=e=>Wy.test(e)&&!Vy.test(e),_d=()=>!1,eb=e=>Hy.test(e),tb=e=>Gy.test(e),nb=()=>{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"),u=me("contrast"),c=me("grayscale"),l=me("hueRotate"),d=me("invert"),h=me("gap"),f=me("gradientColorStops"),g=me("gradientColorStopPositions"),p=me("inset"),m=me("margin"),A=me("opacity"),w=me("padding"),S=me("saturate"),k=me("scale"),y=me("sepia"),x=me("skew"),E=me("space"),D=me("translate"),O=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto",ne,t],I=()=>[ne,t],F=()=>["",xt,Bt],B=()=>["auto",Jn,ne],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["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"],Y=()=>["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:[wr],spacing:[xt,Bt],blur:["none","",Lt,ne],brightness:de(),borderColor:[e],borderRadius:["none","","full",Lt,ne],borderSpacing:I(),borderWidth:F(),contrast:de(),grayscale:Z(),hueRotate:de(),invert:Z(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[qy,Bt],inset:W(),margin:W(),opacity:de(),padding:I(),saturate:de(),scale:de(),sepia:Z(),skew:de(),space:I(),translate:I()},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:[...q(),ne]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],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:W()}],"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":[wr]}],"col-start-end":[{col:["auto",{span:["full",br,ne]},ne]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[wr]}],"row-start-end":[{row:["auto",{span:[br,ne]},ne]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"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",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"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:[wr]}],"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",xt,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:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xt,Bt]}],"underline-offset":[{"underline-offset":["auto",xt,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:I()}],"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:[...q(),$y]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Yy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_y]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"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:[...V(),"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:V()}],"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:["",...V()]}],"outline-offset":[{"outline-offset":[xt,ne]}],"outline-w":[{outline:[xt,Bt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[xt,Bt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Lt,Zy]}],"shadow-color":[{shadow:[wr]}],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:[u]}],"drop-shadow":[{"drop-shadow":["","none",Lt,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[l]}],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":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"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:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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:[xt,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"]}}},Zd=zy(nb);var Bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ti,Al;function ob(){if(Al)return ti;Al=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,u=typeof Bo=="object"&&Bo&&Bo.Object===Object&&Bo,c=typeof self=="object"&&self&&self.Object===Object&&self,l=u||c||Function("return this")(),d=Object.prototype,h=d.toString,f=Math.max,g=Math.min,p=function(){return l.Date.now()};function m(y,x,E){var D,O,T,W,I,F,B=0,q=!1,V=!1,$=!0;if(typeof y!="function")throw new TypeError(e);x=k(x)||0,A(E)&&(q=!!E.leading,V="maxWait"in E,T=V?f(k(E.maxWait)||0,x):T,$="trailing"in E?!!E.trailing:$);function Y(J){var fe=D,Ae=O;return D=O=void 0,B=J,W=y.apply(Ae,fe),W}function Z(J){return B=J,I=setTimeout(R,x),q?Y(J):W}function ae(J){var fe=J-F,Ae=J-B,Ze=x-fe;return V?g(Ze,T-Ae):Ze}function de(J){var fe=J-F,Ae=J-B;return F===void 0||fe>=x||fe<0||V&&Ae>=T}function R(){var J=p();if(de(J))return H(J);I=setTimeout(R,ae(J))}function H(J){return I=void 0,$&&D?Y(J):(D=O=void 0,W)}function X(){I!==void 0&&clearTimeout(I),B=0,D=F=O=I=void 0}function K(){return I===void 0?W:H(p())}function se(){var J=p(),fe=de(J);if(D=arguments,O=this,F=J,fe){if(I===void 0)return Z(F);if(V)return I=setTimeout(R,x),Y(F)}return I===void 0&&(I=setTimeout(R,x)),W}return se.cancel=X,se.flush=K,se}function A(y){var x=typeof y;return!!y&&(x=="object"||x=="function")}function w(y){return!!y&&typeof y=="object"}function S(y){return typeof y=="symbol"||w(y)&&h.call(y)==n}function k(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=m,ti}ob();function sb(){const[e,t]=Fe(null),n=ge(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 ib=["top","right","bottom","left"],qt=Math.min,Ge=Math.max,ls=Math.round,Lo=Math.floor,mt=e=>({x:e,y:e}),ab={left:"right",right:"left",bottom:"top",top:"bottom"},ub={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 Rt(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(Rt(e))?"y":"x"}function Ka(e){return Ga(Kt(e))}function lb(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=cs(i)),[i,cs(i)]}function cb(e){const t=cs(e);return[_i(e),t,_i(t)]}function _i(e){return e.replace(/start|end/g,t=>ub[t])}function db(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 fb(e,t,n,r){const o=dr(e);let s=db(Rt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(_i)))),s}function cs(e){return e.replace(/left|right|bottom|top/g,t=>ab[t])}function hb(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xd(e){return typeof e!="number"?hb(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 xl(e,t,n){let{reference:r,floating:o}=e;const s=Kt(t),i=Ka(t),a=qa(i),u=Rt(t),c=s==="y",l=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(u){case"top":f={x:l,y:r.y-o.height};break;case"bottom":f={x:l,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&&c?-1:1);break;case"end":f[i]+=h*(n&&c?-1:1);break}return f}const pb=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:l,y:d}=xl(c,r,u),h=r,f={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:A}=a[p],{x:w,y:S,data:k,reset:y}=await A({x:l,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:i,elements:{reference:e,floating:t}});l=w??l,d=S??d,f={...f,[m]:{...f[m],...k}},y&&g<=50&&(g++,typeof y=="object"&&(y.placement&&(h=y.placement),y.rects&&(c=y.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),{x:l,y:d}=xl(c,h,u)),p=-1)}return{x:l,y:d,placement:h,strategy:o,middlewareData:f}};async function _r(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=Dt(t,e),g=Xd(f),p=a[h?d==="floating"?"reference":"floating":d],m=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:c,rootBoundary:l,strategy:u})),A=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},k=ds(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:w,strategy:u}):A);return{top:(m.top-k.top+g.top)/S.y,bottom:(k.bottom-m.bottom+g.bottom)/S.y,left:(m.left-k.left+g.left)/S.x,right:(k.right-m.right+g.right)/S.x}}const mb=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:c,padding:l=0}=Dt(e,t)||{};if(c==null)return{};const d=Xd(l),h={x:n,y:r},f=Ka(o),g=qa(f),p=await i.getDimensions(c),m=f==="y",A=m?"top":"left",w=m?"bottom":"right",S=m?"clientHeight":"clientWidth",k=s.reference[g]+s.reference[f]-h[f]-s.floating[g],y=h[f]-s.reference[f],x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=x?x[S]:0;(!E||!await(i.isElement==null?void 0:i.isElement(x)))&&(E=a.floating[S]||s.floating[g]);const D=k/2-y/2,O=E/2-p[g]/2-1,T=qt(d[A],O),W=qt(d[w],O),I=T,F=E-p[g]-W,B=E/2-p[g]/2+D,q=Ji(I,B,F),V=!u.arrow&&dr(o)!=null&&B!==q&&s.reference[g]/2-(B<I?T:W)-p[g]/2<0,$=V?B<I?B-I:B-F:0;return{[f]:h[f]+$,data:{[f]:q,centerOffset:B-q-$,...V&&{alignmentOffset:$}},reset:V}}}),gb=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:u,elements:c}=t,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Dt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const A=Rt(o),w=Kt(a),S=Rt(a)===a,k=await(u.isRTL==null?void 0:u.isRTL(c.floating)),y=h||(S||!p?[cs(a)]:cb(a)),x=g!=="none";!h&&x&&y.push(...fb(a,p,g,k));const E=[a,...y],D=await _r(t,m),O=[];let T=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&O.push(D[A]),d){const B=lb(o,i,k);O.push(D[B[0]],D[B[1]])}if(T=[...T,{placement:o,overflows:O}],!O.every(B=>B<=0)){var W,I;const B=(((W=s.flip)==null?void 0:W.index)||0)+1,q=E[B];if(q)return{data:{index:B,overflows:T},reset:{placement:q}};let V=(I=T.filter($=>$.overflows[0]<=0).sort(($,Y)=>$.overflows[1]-Y.overflows[1])[0])==null?void 0:I.placement;if(!V)switch(f){case"bestFit":{var F;const $=(F=T.filter(Y=>{if(x){const Z=Kt(Y.placement);return Z===w||Z==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(Z=>Z>0).reduce((Z,ae)=>Z+ae,0)]).sort((Y,Z)=>Y[1]-Z[1])[0])==null?void 0:F[0];$&&(V=$);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function Cl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function El(e){return ib.some(t=>e[t]>=0)}const yb=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 _r(t,{...o,elementContext:"reference"}),i=Cl(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:El(i)}}}case"escaped":{const s=await _r(t,{...o,altBoundary:!0}),i=Cl(s,n.floating);return{data:{escapedOffsets:i,escaped:El(i)}}}default:return{}}}}};async function bb(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Rt(n),a=dr(n),u=Kt(n)==="y",c=["left","top"].includes(i)?-1:1,l=s&&u?-1:1,d=Dt(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(f=a==="end"?g*-1:g),u?{x:f*l,y:h*c}:{x:h*c,y:f*l}}const wb=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,u=await bb(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},vb=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:m=>{let{x:A,y:w}=m;return{x:A,y:w}}},...u}=Dt(e,t),c={x:n,y:r},l=await _r(t,u),d=Kt(Rt(o)),h=Ga(d);let f=c[h],g=c[d];if(s){const m=h==="y"?"top":"left",A=h==="y"?"bottom":"right",w=f+l[m],S=f-l[A];f=Ji(w,f,S)}if(i){const m=d==="y"?"top":"left",A=d==="y"?"bottom":"right",w=g+l[m],S=g-l[A];g=Ji(w,g,S)}const p=a.fn({...t,[h]:f,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:s,[d]:i}}}}}},Ab=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:u=!0,crossAxis:c=!0}=Dt(e,t),l={x:n,y:r},d=Kt(o),h=Ga(d);let f=l[h],g=l[d];const p=Dt(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(u){const S=h==="y"?"height":"width",k=s.reference[h]-s.floating[S]+m.mainAxis,y=s.reference[h]+s.reference[S]-m.mainAxis;f<k?f=k:f>y&&(f=y)}if(c){var A,w;const S=h==="y"?"width":"height",k=["top","left"].includes(Rt(o)),y=s.reference[d]-s.floating[S]+(k&&((A=i.offset)==null?void 0:A[d])||0)+(k?0:m.crossAxis),x=s.reference[d]+s.reference[S]+(k?0:((w=i.offset)==null?void 0:w[d])||0)-(k?m.crossAxis:0);g<y?g=y:g>x&&(g=x)}return{[h]:f,[d]:g}}}},xb=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:u=()=>{},...c}=Dt(e,t),l=await _r(t,c),d=Rt(o),h=dr(o),f=Kt(o)==="y",{width:g,height:p}=s.floating;let m,A;d==="top"||d==="bottom"?(m=d,A=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(A=d,m=h==="end"?"top":"bottom");const w=p-l.top-l.bottom,S=g-l.left-l.right,k=qt(p-l[m],w),y=qt(g-l[A],S),x=!t.middlewareData.shift;let E=k,D=y;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=w),x&&!h){const T=Ge(l.left,0),W=Ge(l.right,0),I=Ge(l.top,0),F=Ge(l.bottom,0);f?D=g-2*(T!==0||W!==0?T+W:Ge(l.left,l.right)):E=p-2*(I!==0||F!==0?I+F:Ge(l.top,l.bottom))}await u({...t,availableWidth:D,availableHeight:E});const O=await i.getDimensions(a.floating);return g!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function Fs(){return typeof window<"u"}function fr(e){return ef(e)?(e.nodeName||"").toLowerCase():"#document"}function qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vt(e){var t;return(t=(ef(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ef(e){return Fs()?e instanceof Node||e instanceof qe(e).Node:!1}function it(e){return Fs()?e instanceof Element||e instanceof qe(e).Element:!1}function bt(e){return Fs()?e instanceof HTMLElement||e instanceof qe(e).HTMLElement:!1}function Sl(e){return!Fs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qe(e).ShadowRoot}function So(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=at(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Cb(e){return["table","td","th"].includes(fr(e))}function Ts(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ya(e){const t=$a(),n=it(e)?at(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 Eb(e){let t=Yt(e);for(;bt(t)&&!rr(t);){if(Ya(t))return t;if(Ts(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 at(e){return qe(e).getComputedStyle(e)}function Bs(e){return it(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||Sl(e)&&e.host||vt(e);return Sl(t)?t.host:t}function tf(e){const t=Yt(e);return rr(t)?e.ownerDocument?e.ownerDocument.body:e.body:bt(t)&&So(t)?t:tf(t)}function Zr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=tf(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||[],So(o)?o:[],a&&n?Zr(a):[])}return t.concat(o,Zr(o,[],n))}function Zi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nf(e){const t=at(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=bt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=ls(n)!==s||ls(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ja(e){return it(e)?e:e.contextElement}function _n(e){const t=Ja(e);if(!bt(t))return mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=nf(t);let i=(s?ls(n.width):n.width)/r,a=(s?ls(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Sb=mt(0);function rf(e){const t=qe(e);return!$a()||!t.visualViewport?Sb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qe(e)?!1:t}function vn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ja(e);let i=mt(1);t&&(r?it(r)&&(i=_n(r)):i=_n(e));const a=Pb(s,n,r)?rf(s):mt(0);let u=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,l=o.width/i.x,d=o.height/i.y;if(s){const h=qe(s),f=r&&it(r)?qe(r):r;let g=h,p=Zi(g);for(;p&&r&&f!==g;){const m=_n(p),A=p.getBoundingClientRect(),w=at(p),S=A.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,k=A.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;u*=m.x,c*=m.y,l*=m.x,d*=m.y,u+=S,c+=k,g=qe(p),p=Zi(g)}}return ds({width:l,height:d,x:u,y:c})}function _a(e,t){const n=Bs(e).scrollLeft;return t?t.left+n:vn(vt(e)).left+n}function of(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 kb(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=vt(r),a=t?Ts(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=mt(1);const l=mt(0),d=bt(r);if((d||!d&&!s)&&((fr(r)!=="body"||So(i))&&(u=Bs(r)),bt(r))){const f=vn(r);c=_n(r),l.x=f.x+r.clientLeft,l.y=f.y+r.clientTop}const h=i&&!d&&!s?of(i,u,!0):mt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+l.x+h.x,y:n.y*c.y-u.scrollTop*c.y+l.y+h.y}}function Ib(e){return Array.from(e.getClientRects())}function Mb(e){const t=vt(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 at(r).direction==="rtl"&&(i+=Ge(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Ob(e,t){const n=qe(e),r=vt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const c=$a();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function Nb(e,t){const n=vn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=bt(e)?_n(e):mt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,c=r*s.y;return{width:i,height:a,x:u,y:c}}function Pl(e,t,n){let r;if(t==="viewport")r=Ob(e,n);else if(t==="document")r=Mb(vt(e));else if(it(t))r=Nb(t,n);else{const o=rf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ds(r)}function sf(e,t){const n=Yt(e);return n===t||!it(n)||rr(n)?!1:at(n).position==="fixed"||sf(n,t)}function Db(e,t){const n=t.get(e);if(n)return n;let r=Zr(e,[],!1).filter(a=>it(a)&&fr(a)!=="body"),o=null;const s=at(e).position==="fixed";let i=s?Yt(e):e;for(;it(i)&&!rr(i);){const a=at(i),u=Ya(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&o&&["absolute","fixed"].includes(o.position)||So(i)&&!u&&sf(e,i))?r=r.filter(c=>c!==i):o=a,i=Yt(i)}return t.set(e,r),r}function Rb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Ts(t)?[]:Db(t,this._c):[].concat(n),r],i=s[0],a=s.reduce((u,c)=>{const l=Pl(t,c,o);return u.top=Ge(l.top,u.top),u.right=qt(l.right,u.right),u.bottom=qt(l.bottom,u.bottom),u.left=Ge(l.left,u.left),u},Pl(t,i,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Fb(e){const{width:t,height:n}=nf(e);return{width:t,height:n}}function Tb(e,t,n){const r=bt(t),o=vt(t),s=n==="fixed",i=vn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=mt(0);if(r||!r&&!s)if((fr(t)!=="body"||So(o))&&(a=Bs(t)),r){const h=vn(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&(u.x=_a(o));const c=o&&!r&&!s?of(o,a):mt(0),l=i.left+a.scrollLeft-u.x-c.x,d=i.top+a.scrollTop-u.y-c.y;return{x:l,y:d,width:i.width,height:i.height}}function ni(e){return at(e).position==="static"}function kl(e,t){if(!bt(e)||at(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return vt(e)===n&&(n=n.ownerDocument.body),n}function af(e,t){const n=qe(e);if(Ts(e))return n;if(!bt(e)){let o=Yt(e);for(;o&&!rr(o);){if(it(o)&&!ni(o))return o;o=Yt(o)}return n}let r=kl(e,t);for(;r&&Cb(r)&&ni(r);)r=kl(r,t);return r&&rr(r)&&ni(r)&&!Ya(r)?n:r||Eb(e)||n}const Bb=async function(e){const t=this.getOffsetParent||af,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 Lb(e){return at(e).direction==="rtl"}const zb={convertOffsetParentRelativeRectToViewportRelativeRect:kb,getDocumentElement:vt,getClippingRect:Rb,getOffsetParent:af,getElementRects:Bb,getClientRects:Ib,getDimensions:Fb,getScale:_n,isElement:it,isRTL:Lb};function Ub(e,t){let n=null,r;const o=vt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const{left:c,top:l,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=Lo(l),g=Lo(o.clientWidth-(c+d)),p=Lo(o.clientHeight-(l+h)),m=Lo(c),A={rootMargin:-f+"px "+-g+"px "+-p+"px "+-m+"px",threshold:Ge(0,qt(1,u))||1};let w=!0;function S(k){const y=k[0].intersectionRatio;if(y!==u){if(!w)return i();y?i(!1,y):r=setTimeout(()=>{i(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(S,{...A,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,A)}n.observe(e)}return i(!0),s}function jb(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:u=!1}=r,c=Ja(e),l=o||s?[...c?Zr(c):[],...Zr(t)]:[];l.forEach(A=>{o&&A.addEventListener("scroll",n,{passive:!0}),s&&A.addEventListener("resize",n)});const d=c&&a?Ub(c,n):null;let h=-1,f=null;i&&(f=new ResizeObserver(A=>{let[w]=A;w&&w.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=f)==null||S.observe(t)})),n()}),c&&!u&&f.observe(c),f.observe(t));let g,p=u?vn(e):null;u&&m();function m(){const A=vn(e);p&&(A.x!==p.x||A.y!==p.y||A.width!==p.width||A.height!==p.height)&&n(),p=A,g=requestAnimationFrame(m)}return n(),()=>{var A;l.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d==null||d(),(A=f)==null||A.disconnect(),f=null,u&&cancelAnimationFrame(g)}}const Qb=wb,Wb=vb,Vb=gb,Hb=xb,Gb=yb,Il=mb,qb=Ab,Kb=(e,t,n)=>{const r=new Map,o={platform:zb,...n},s={...o.platform,_c:r};return pb(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 Ml(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function uf(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ml(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():Ml(e[o],null)}}}}function ut(...e){return b.useCallback(uf(...e),e)}function Yb(e,t){const n=b.createContext(t),r=s=>{const{children:i,...a}=s,u=b.useMemo(()=>a,Object.values(a));return v(n.Provider,{value:u,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),u=n.length;n=[...n,i];const c=d=>{var h;const{scope:f,children:g,...p}=d,m=((h=f==null?void 0:f[e])==null?void 0:h[u])||a,A=b.useMemo(()=>p,Object.values(p));return v(m.Provider,{value:A,children:g})};c.displayName=s+"Provider";function l(d,h){var f;const g=((f=h==null?void 0:h[e])==null?void 0:f[u])||a,p=b.useContext(g);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,l]}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,$b(o,...t)]}function $b(...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:u})=>{const c=a(o)[`__scope${u}`];return{...i,...c}},{});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 lf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Jb({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=$t(n),u=b.useCallback(c=>{if(s){const l=typeof c=="function"?c(e):c;l!==e&&a(l)}else o(c)},[s,e,o,a]);return[i,u]}function Jb({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 Po=b.forwardRef((e,t)=>{const{children:n,...r}=e,o=b.Children.toArray(n),s=o.find(Zb);if(s){const i=s.props.children,a=o.map(u=>u===s?b.Children.count(i)>1?b.Children.only(null):b.isValidElement(i)?i.props.children:null:u);return v(Xi,{...r,ref:t,children:b.isValidElement(i)?b.cloneElement(i,void 0,a):null})}return v(Xi,{...r,ref:t,children:n})});Po.displayName="Slot";var Xi=b.forwardRef((e,t)=>{const{children:n,...r}=e;if(b.isValidElement(n)){const o=ew(n);return b.cloneElement(n,{...Xb(r,n.props),ref:t?uf(t,o):o})}return b.Children.count(n)>1?b.Children.only(null):null});Xi.displayName="SlotClone";var _b=({children:e})=>v(st,{children:e});function Zb(e){return b.isValidElement(e)&&e.type===_b}function Xb(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 ew(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 tw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=tw.reduce((e,t)=>{const n=b.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Po:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nw(e,t){e&&Td.flushSync(()=>e.dispatchEvent(t))}function rw(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 ow="DismissableLayer",ea="dismissableLayer.update",sw="dismissableLayer.pointerDownOutside",iw="dismissableLayer.focusOutside",Ol,cf=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,...u}=e,c=b.useContext(cf),[l,d]=b.useState(null),h=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=b.useState({}),g=ut(t,E=>d(E)),p=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),A=p.indexOf(m),w=l?p.indexOf(l):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,k=w>=A,y=lw(E=>{const D=E.target,O=[...c.branches].some(T=>T.contains(D));!k||O||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},h),x=cw(E=>{const D=E.target;[...c.branches].some(O=>O.contains(D))||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},h);return rw(E=>{w===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},h),b.useEffect(()=>{if(l)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ol=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(l)),c.layers.add(l),Nl(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ol)}},[l,h,n,c]),b.useEffect(()=>()=>{l&&(c.layers.delete(l),c.layersWithOutsidePointerEventsDisabled.delete(l),Nl())},[l,c]),b.useEffect(()=>{const E=()=>f({});return document.addEventListener(ea,E),()=>document.removeEventListener(ea,E)},[]),v(ve.div,{...u,ref:g,style:{pointerEvents:S?k?"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=ow;var aw="DismissableLayerBranch",uw=b.forwardRef((e,t)=>{const n=b.useContext(cf),r=b.useRef(null),o=ut(t,r);return b.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),v(ve.div,{...e,ref:o})});uw.displayName=aw;function lw(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 u=function(){df(sw,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}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 cw(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&&df(iw,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 Nl(){const e=new CustomEvent(ea);document.dispatchEvent(e)}function df(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?nw(o,s):o.dispatchEvent(s)}var ri=0;function ff(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dl()),document.body.insertAdjacentElement("beforeend",e[1]??Dl()),ri++,()=>{ri===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ri--}},[])}function Dl(){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",Rl={bubbles:!1,cancelable:!0},dw="FocusScope",eu=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=b.useState(null),c=$t(o),l=$t(s),d=b.useRef(null),h=ut(t,p=>u(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 k=S.target;a.contains(k)?d.current=k:jt(d.current,{select:!0})},m=function(S){if(f.paused||!a)return;const k=S.relatedTarget;k!==null&&(a.contains(k)||jt(d.current,{select:!0}))},A=function(S){if(document.activeElement===document.body)for(const k of S)k.removedNodes.length>0&&jt(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",m);const w=new MutationObserver(A);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",m),w.disconnect()}}},[r,a,f.paused]),b.useEffect(()=>{if(a){Tl.add(f);const p=document.activeElement;if(!a.contains(p)){const m=new CustomEvent(oi,Rl);a.addEventListener(oi,c),a.dispatchEvent(m),m.defaultPrevented||(fw(yw(hf(a)),{select:!0}),document.activeElement===p&&jt(a))}return()=>{a.removeEventListener(oi,c),setTimeout(()=>{const m=new CustomEvent(si,Rl);a.addEventListener(si,l),a.dispatchEvent(m),m.defaultPrevented||jt(p??document.body,{select:!0}),a.removeEventListener(si,l),Tl.remove(f)},0)}}},[a,c,l,f]);const g=b.useCallback(p=>{if(!n&&!r||f.paused)return;const m=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,A=document.activeElement;if(m&&A){const w=p.currentTarget,[S,k]=hw(w);S&&k?!p.shiftKey&&A===k?(p.preventDefault(),n&&jt(S,{select:!0})):p.shiftKey&&A===S&&(p.preventDefault(),n&&jt(k,{select:!0})):A===w&&p.preventDefault()}},[n,r,f.paused]);return v(ve.div,{tabIndex:-1,...i,ref:h,onKeyDown:g})});eu.displayName=dw;function fw(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jt(r,{select:t}),document.activeElement!==n)return}function hw(e){const t=hf(e),n=Fl(t,e),r=Fl(t.reverse(),e);return[n,r]}function hf(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 Fl(e,t){for(const n of e)if(!pw(n,{upTo:t}))return n}function pw(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 mw(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&&mw(e)&&t&&e.select()}}var Tl=gw();function gw(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Bl(e,t),e.unshift(t)},remove(t){var n;e=Bl(e,t),(n=e[0])==null||n.resume()}}}function Bl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yw(e){return e.filter(t=>t.tagName!=="A")}var An=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},bw=b.useId||(()=>{}),ww=0;function gt(e){const[t,n]=b.useState(bw());return An(()=>{n(r=>r??String(ww++))},[e]),t?`radix-${t}`:""}var ns=typeof document<"u"?Od: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 pf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ll(e,t){const n=pf(e);return Math.round(t*n)/n}function ii(e){const t=b.useRef(e);return ns(()=>{t.current=e}),t}function vw(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:u,open:c}=e,[l,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[g,p]=b.useState(null),[m,A]=b.useState(null),w=b.useCallback(Y=>{Y!==x.current&&(x.current=Y,p(Y))},[]),S=b.useCallback(Y=>{Y!==E.current&&(E.current=Y,A(Y))},[]),k=s||g,y=i||m,x=b.useRef(null),E=b.useRef(null),D=b.useRef(l),O=u!=null,T=ii(u),W=ii(o),I=ii(c),F=b.useCallback(()=>{if(!x.current||!E.current)return;const Y={placement:t,strategy:n,middleware:h};W.current&&(Y.platform=W.current),Kb(x.current,E.current,Y).then(Z=>{const ae={...Z,isPositioned:I.current!==!1};B.current&&!fs(D.current,ae)&&(D.current=ae,Td.flushSync(()=>{d(ae)}))})},[h,t,n,W,I]);ns(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(Y=>({...Y,isPositioned:!1})))},[c]);const B=b.useRef(!1);ns(()=>(B.current=!0,()=>{B.current=!1}),[]),ns(()=>{if(k&&(x.current=k),y&&(E.current=y),k&&y){if(T.current)return T.current(k,y,F);F()}},[k,y,F,T,O]);const q=b.useMemo(()=>({reference:x,floating:E,setReference:w,setFloating:S}),[w,S]),V=b.useMemo(()=>({reference:k,floating:y}),[k,y]),$=b.useMemo(()=>{const Y={position:n,left:0,top:0};if(!V.floating)return Y;const Z=Ll(V.floating,l.x),ae=Ll(V.floating,l.y);return a?{...Y,transform:"translate("+Z+"px, "+ae+"px)",...pf(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:ae}},[n,a,V.floating,l.x,l.y]);return b.useMemo(()=>({...l,update:F,refs:q,elements:V,floatingStyles:$}),[l,F,q,V,$])}const Aw=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?Il({element:r.current,padding:o}).fn(n):{}:r?Il({element:r,padding:o}).fn(n):{}}}},xw=(e,t)=>({...Qb(e),options:[e,t]}),Cw=(e,t)=>({...Wb(e),options:[e,t]}),Ew=(e,t)=>({...qb(e),options:[e,t]}),Sw=(e,t)=>({...Vb(e),options:[e,t]}),Pw=(e,t)=>({...Hb(e),options:[e,t]}),kw=(e,t)=>({...Gb(e),options:[e,t]}),Iw=(e,t)=>({...Aw(e),options:[e,t]});var Mw="Arrow",mf=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return v(ve.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v("polygon",{points:"0,0 30,0 15,10"})})});mf.displayName=Mw;var Ow=mf;function Nw(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 u=s.borderBoxSize,c=Array.isArray(u)?u[0]:u;i=c.inlineSize,a=c.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 tu="Popper",[gf,yf]=Za(tu),[Dw,bf]=gf(tu),wf=e=>{const{__scopePopper:t,children:n}=e,[r,o]=b.useState(null);return v(Dw,{scope:t,anchor:r,onAnchorChange:o,children:n})};wf.displayName=tu;var vf="PopperAnchor",Af=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=bf(vf,n),i=b.useRef(null),a=ut(t,i);return b.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:v(ve.div,{...o,ref:a})});Af.displayName=vf;var nu="PopperContent",[Rw,Fw]=gf(nu),xf=b.forwardRef((e,t)=>{var n,r,o,s,i,a;const{__scopePopper:u,side:c="bottom",sideOffset:l=0,align:d="center",alignOffset:h=0,arrowPadding:f=0,avoidCollisions:g=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:A="partial",hideWhenDetached:w=!1,updatePositionStrategy:S="optimized",onPlaced:k,...y}=e,x=bf(nu,u),[E,D]=b.useState(null),O=ut(t,Ft=>D(Ft)),[T,W]=b.useState(null),I=Nw(T),F=(I==null?void 0:I.width)??0,B=(I==null?void 0:I.height)??0,q=c+(d!=="center"?"-"+d:""),V=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},$=Array.isArray(p)?p:[p],Y=$.length>0,Z={padding:V,boundary:$.filter(Bw),altBoundary:Y},{refs:ae,floatingStyles:de,placement:R,isPositioned:H,middlewareData:X}=vw({strategy:"fixed",placement:q,whileElementsMounted:(...Ft)=>jb(...Ft,{animationFrame:S==="always"}),elements:{reference:x.anchor},middleware:[xw({mainAxis:l+B,alignmentAxis:h}),g&&Cw({mainAxis:!0,crossAxis:!1,limiter:A==="partial"?Ew():void 0,...Z}),g&&Sw({...Z}),Pw({...Z,apply:({elements:Ft,rects:Fo,availableWidth:C,availableHeight:M})=>{const{width:N,height:j}=Fo.reference,z=Ft.floating.style;z.setProperty("--radix-popper-available-width",`${C}px`),z.setProperty("--radix-popper-available-height",`${M}px`),z.setProperty("--radix-popper-anchor-width",`${N}px`),z.setProperty("--radix-popper-anchor-height",`${j}px`)}}),T&&Iw({element:T,padding:f}),Lw({arrowWidth:F,arrowHeight:B}),w&&kw({strategy:"referenceHidden",...Z})]}),[K,se]=Sf(R),J=$t(k);An(()=>{H&&(J==null||J())},[H,J]);const fe=(n=X.arrow)==null?void 0:n.x,Ae=(r=X.arrow)==null?void 0:r.y,Ze=((o=X.arrow)==null?void 0:o.centerOffset)!==0,[Ro,qs]=b.useState();return An(()=>{E&&qs(window.getComputedStyle(E).zIndex)},[E]),v("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...de,transform:H?de.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ro,"--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:v(Rw,{scope:u,placedSide:K,onArrowChange:W,arrowX:fe,arrowY:Ae,shouldHideArrow:Ze,children:v(ve.div,{"data-side":K,"data-align":se,...y,ref:O,style:{...y.style,animation:H?void 0:"none"}})})})});xf.displayName=nu;var Cf="PopperArrow",Tw={top:"bottom",right:"left",bottom:"top",left:"right"},Ef=b.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=Fw(Cf,n),s=Tw[o.placedSide];return v("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:v(Ow,{...r,ref:t,style:{...r.style,display:"block"}})})});Ef.displayName=Cf;function Bw(e){return e!==null}var Lw=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:s,rects:i,middlewareData:a}=t,u=((n=a.arrow)==null?void 0:n.centerOffset)!==0,c=u?0:e.arrowWidth,l=u?0:e.arrowHeight,[d,h]=Sf(s),f={start:"0%",center:"50%",end:"100%"}[h],g=(((r=a.arrow)==null?void 0:r.x)??0)+c/2,p=(((o=a.arrow)==null?void 0:o.y)??0)+l/2;let m="",A="";return d==="bottom"?(m=u?f:`${g}px`,A=`${-l}px`):d==="top"?(m=u?f:`${g}px`,A=`${i.floating.height+l}px`):d==="right"?(m=`${-l}px`,A=u?f:`${p}px`):d==="left"&&(m=`${i.floating.width+l}px`,A=u?f:`${p}px`),{data:{x:m,y:A}}}});function Sf(e){const[t,n="center"]=e.split("-");return[t,n]}var zw=wf,Pf=Af,Uw=xf,jw=Ef,Qw="Portal",ru=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?Fg.createPortal(v(ve.div,{...o,ref:t}),a):null});ru.displayName=Qw;function Ww(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var hr=e=>{const{present:t,children:n}=e,r=Vw(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),s=ut(r.ref,Hw(o));return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:s}):null};hr.displayName="Presence";function Vw(e){const[t,n]=b.useState(),r=b.useRef({}),o=b.useRef(e),s=b.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Ww(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const c=zo(r.current);s.current=a==="mounted"?c:"none"},[a]),An(()=>{const c=r.current,l=o.current;if(l!==e){const d=s.current,h=zo(c);e?u("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(l&&d!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),An(()=>{if(t){let c;const l=t.ownerDocument.defaultView??window,d=f=>{const g=zo(r.current).includes(f.animationName);if(f.target===t&&g&&(u("ANIMATION_END"),!o.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",c=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},h=f=>{f.target===t&&(s.current=zo(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{l.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function zo(e){return(e==null?void 0:e.animationName)||"none"}function Hw(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 Gw=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,jo={},ai=0,kf=function(e){return e&&(e.host||kf(e.parentNode))},qw=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kf(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})},Kw=function(e,t,n,r){var o=qw(t,Array.isArray(e)?e:[e]);jo[n]||(jo[n]=new WeakMap);var s=jo[n],i=[],a=new Set,u=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var l=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))l(h);else try{var f=h.getAttribute(r),g=f!==null&&f!=="false",p=(Nn.get(h)||0)+1,m=(s.get(h)||0)+1;Nn.set(h,p),s.set(h,m),i.push(h),p===1&&g&&Uo.set(h,!0),m===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(A){console.error("aria-hidden: cannot operate on ",h,A)}})};return l(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,jo={})}},If=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Gw(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Kw(r,o,n,"aria-hidden")):function(){return null}},ft=function(){return ft=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},ft.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 Yw(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",$w="with-scroll-bars-hidden",Jw="--removed-body-scroll-bar-size";function ui(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function _w(e,t){var n=Fe(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 Zw=typeof window<"u"?b.useLayoutEffect:b.useEffect,zl=new WeakMap;function Xw(e,t){var n=_w(null,function(r){return e.forEach(function(o){return ui(o,r)})});return Zw(function(){var r=zl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||ui(a,null)}),s.forEach(function(a){o.has(a)||ui(a,i)})}zl.set(n,e)},[e]),n}function ev(e){return e}function tv(e,t){t===void 0&&(t=ev);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 u=function(){var l=i;i=[],l.forEach(s)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(l){i.push(l),c()},filter:function(l){return i=i.filter(l),n}}}};return o}function nv(e){e===void 0&&(e={});var t=tv(null);return t.options=ft({async:!0,ssr:!1},e),t}var Of=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,ft({},n))};Of.isSideCarExport=!0;function rv(e,t){return e.useMedium(t),Of}var Nf=nv(),li=function(){},Ls=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:li,onWheelCapture:li,onTouchMoveCapture:li}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,l=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,g=e.inert,p=e.allowPinchZoom,m=e.as,A=m===void 0?"div":m,w=e.gapMode,S=Mf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,y=Xw([n,t]),x=ft(ft({},S),o);return b.createElement(b.Fragment,null,l&&b.createElement(k,{sideCar:Nf,removeScrollBar:c,shards:d,noIsolation:f,inert:g,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:w}),i?b.cloneElement(b.Children.only(a),ft(ft({},x),{ref:y})):b.createElement(A,ft({},x,{className:u,ref:y}),a))});Ls.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ls.classNames={fullWidth:os,zeroRight:rs};var ov=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sv(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ov();return t&&e.setAttribute("nonce",t),e}function iv(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function av(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var uv=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sv())&&(iv(t,n),av(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lv=function(){var e=uv();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Df=function(){var e=lv(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},cv={left:0,top:0,right:0,gap:0},ci=function(e){return parseInt(e||"",10)||0},dv=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[ci(n),ci(r),ci(o)]},fv=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cv;var t=dv(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])}},hv=Df(),Zn="data-scroll-locked",pv=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($w,` {
|
|
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(Jw,": ").concat(a,`px;
|
|
38
|
-
}
|
|
39
|
-
`)},Ul=function(){var e=parseInt(document.body.getAttribute(Zn)||"0",10);return isFinite(e)?e:0},mv=function(){b.useEffect(function(){return document.body.setAttribute(Zn,(Ul()+1).toString()),function(){var e=Ul()-1;e<=0?document.body.removeAttribute(Zn):document.body.setAttribute(Zn,e.toString())}},[])},gv=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;mv();var s=b.useMemo(function(){return fv(o)},[o]);return b.createElement(hv,{styles:pv(s,!t,o,n?"":"!important")})},ta=!1;if(typeof window<"u")try{var Qo=Object.defineProperty({},"passive",{get:function(){return ta=!0,!0}});window.addEventListener("test",Qo,Qo),window.removeEventListener("test",Qo,Qo)}catch{ta=!1}var Dn=ta?{passive:!1}:!1,yv=function(e){return e.tagName==="TEXTAREA"},Rf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!yv(e)&&n[t]==="visible")},bv=function(e){return Rf(e,"overflowY")},wv=function(e){return Rf(e,"overflowX")},jl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ff(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},vv=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Av=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ff=function(e,t){return e==="v"?bv(t):wv(t)},Tf=function(e,t){return e==="v"?vv(t):Av(t)},xv=function(e,t){return e==="h"&&t==="rtl"?-1:1},Cv=function(e,t,n,r,o){var s=xv(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,u=t.contains(a),c=!1,l=i>0,d=0,h=0;do{var f=Tf(e,a),g=f[0],p=f[1],m=f[2],A=p-m-s*g;(g||A)&&Ff(e,a)&&(d+=A,h+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(l&&Math.abs(d)<1||!l&&Math.abs(h)<1)&&(c=!0),c},Wo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ql=function(e){return[e.deltaX,e.deltaY]},Wl=function(e){return e&&"current"in e?e.current:e},Ev=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Sv=function(e){return`
|
|
40
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
41
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
42
|
-
`)},Pv=0,Rn=[];function kv(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),o=b.useState(Pv++)[0],s=b.useState(Df)[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=Yw([e.lockRef.current],(e.shards||[]).map(Wl)).filter(Boolean);return p.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=b.useCallback(function(p,m){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var A=Wo(p),w=n.current,S="deltaX"in p?p.deltaX:w[0]-A[0],k="deltaY"in p?p.deltaY:w[1]-A[1],y,x=p.target,E=Math.abs(S)>Math.abs(k)?"h":"v";if("touches"in p&&E==="h"&&x.type==="range")return!1;var D=jl(E,x);if(!D)return!0;if(D?y=E:(y=E==="v"?"h":"v",D=jl(E,x)),!D)return!1;if(!r.current&&"changedTouches"in p&&(S||k)&&(r.current=y),!y)return!0;var O=r.current||y;return Cv(O,m,p,O==="h"?S:k)},[]),u=b.useCallback(function(p){var m=p;if(!(!Rn.length||Rn[Rn.length-1]!==s)){var A="deltaY"in m?Ql(m):Wo(m),w=t.current.filter(function(y){return y.name===m.type&&(y.target===m.target||m.target===y.shadowParent)&&Ev(y.delta,A)})[0];if(w&&w.should){m.cancelable&&m.preventDefault();return}if(!w){var S=(i.current.shards||[]).map(Wl).filter(Boolean).filter(function(y){return y.contains(m.target)}),k=S.length>0?a(m,S[0]):!i.current.noIsolation;k&&m.cancelable&&m.preventDefault()}}},[]),c=b.useCallback(function(p,m,A,w){var S={name:p,delta:m,target:A,should:w,shadowParent:Iv(A)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(k){return k!==S})},1)},[]),l=b.useCallback(function(p){n.current=Wo(p),r.current=void 0},[]),d=b.useCallback(function(p){c(p.type,Ql(p),p.target,a(p,e.lockRef.current))},[]),h=b.useCallback(function(p){c(p.type,Wo(p),p.target,a(p,e.lockRef.current))},[]);b.useEffect(function(){return Rn.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Dn),document.addEventListener("touchmove",u,Dn),document.addEventListener("touchstart",l,Dn),function(){Rn=Rn.filter(function(p){return p!==s}),document.removeEventListener("wheel",u,Dn),document.removeEventListener("touchmove",u,Dn),document.removeEventListener("touchstart",l,Dn)}},[]);var f=e.removeScrollBar,g=e.inert;return b.createElement(b.Fragment,null,g?b.createElement(s,{styles:Sv(o)}):null,f?b.createElement(gv,{gapMode:e.gapMode}):null)}function Iv(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Mv=rv(Nf,kv);var ou=b.forwardRef(function(e,t){return b.createElement(Ls,ft({},e,{ref:t,sideCar:Mv}))});ou.classNames=Ls.classNames;const Bf="2.21.55";let Vo={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Bf}`},Q=class na extends Error{constructor(t,n={}){var r;const o=(()=>{var u;return n.cause instanceof na?n.cause.details:(u=n.cause)!=null&&u.message?n.cause.message:n.details})(),s=n.cause instanceof na&&n.cause.docsPath||n.docsPath,i=(r=Vo.getDocsUrl)==null?void 0:r.call(Vo,{...n,docsPath:s}),a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...o?[`Details: ${o}`]:[],...Vo.version?[`Version: ${Vo.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=Bf}walk(t){return Lf(this,t)}};function Lf(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Lf(e.cause,t):t?null:e}class zf 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 Ov 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 Nv extends Q{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}class Uf 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 jf 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 Vl 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"?Ht(e,{dir:t,size:n}):Dv(e,{dir:t,size:n})}function Ht(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new jf({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Dv(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new jf({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 Me(e){return On(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function su(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 Rv=new TextEncoder;function iu(e,t={}){return typeof e=="number"||typeof e=="bigint"?Tv(e,t):typeof e=="boolean"?Fv(e,t):On(e)?au(e,t):yn(e,t)}function Fv(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(At(n,{size:t.size}),pr(n,{size:t.size})):n}const Ct={zero:48,nine:57,A:65,F:70,a:97,f:102};function Hl(e){if(e>=Ct.zero&&e<=Ct.nine)return e-Ct.zero;if(e>=Ct.A&&e<=Ct.F)return e-(Ct.A-10);if(e>=Ct.a&&e<=Ct.f)return e-(Ct.a-10)}function au(e,t={}){let n=e;t.size&&(At(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 u=Hl(r.charCodeAt(a++)),c=Hl(r.charCodeAt(a++));if(u===void 0||c===void 0)throw new Q(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);s[i]=u*16+c}return s}function Tv(e,t){const n=ye(e,t);return au(n)}function yn(e,t={}){const n=Rv.encode(e);return typeof t.size=="number"?(At(n,{size:t.size}),pr(n,{dir:"right",size:t.size})):n}function At(e,{size:t}){if(Me(e)>t)throw new Nv({givenSize:Me(e),maxSize:t})}function Qf(e,t={}){const{signed:n}=t;t.size&&At(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 Bv(e,t={}){return Number(Qf(e,t))}const Lv=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function uu(e,t={}){return typeof e=="number"||typeof e=="bigint"?ye(e,t):typeof e=="string"?lu(e,t):typeof e=="boolean"?Wf(e,t):Je(e,t)}function Wf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(At(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+=Lv[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(At(r,{size:t.size}),pr(r,{dir:"right",size:t.size})):r}function ye(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 u=typeof e=="bigint"?"n":"";throw new zf({max:s?`${s}${u}`:void 0,min:`${i}${u}`,signed:n,size:r,value:`${e}${u}`})}const a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?pr(a,{size:r}):a}const zv=new TextEncoder;function lu(e,t={}){const n=zv.encode(e);return Je(n,t)}function or(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Jv(e.type);return`${e.name}(${cu(e.inputs,{includeName:t})})`}function cu(e,{includeName:t=!1}={}){return e?e.map(n=>Uv(n,{includeName:t})).join(t?", ":","):""}function Uv(e,{includeName:t}){return e.type.startsWith("tuple")?`(${cu(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class jv 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 Gl 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 Qv 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: (${cu(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 du extends Q{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class Wv 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 Vv extends Q{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${Me(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Hv 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 Vf 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 Gv 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 qv 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 Kv 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 Yv 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 $v extends Q{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
|
|
54
|
-
`),{name:"InvalidArrayError"})}}class Jv 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"?fu(e):_v(e)}function _v(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 fu(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 hu 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 ql(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Zv(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function pu(e,...t){if(!Zv(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 Kl(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 Xv(e,t){pu(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),Yl=BigInt(32);function e0(e,t=!1){return t?{h:Number(e&Ho),l:Number(e>>Yl&Ho)}:{h:Number(e>>Yl&Ho)|0,l:Number(e&Ho)|0}}function t0(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}=e0(e[o],t);[n[o],r[o]]=[s,i]}return[n,r]}const n0=(e,t,n)=>e<<n|t>>>32-n,r0=(e,t,n)=>t<<n|e>>>32-n,o0=(e,t,n)=>t<<n-32|e>>>64-n,s0=(e,t,n)=>e<<n-32|t>>>64-n;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const i0=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),$l=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,a0=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Jl(e){for(let t=0;t<e.length;t++)e[t]=a0(e[t])}function u0(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Hf(e){return typeof e=="string"&&(e=u0(e)),pu(e),e}class l0{clone(){return this._cloneInto()}}function c0(e){const t=r=>e().update(Hf(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const Gf=[],qf=[],Kf=[],d0=BigInt(0),vr=BigInt(1),f0=BigInt(2),h0=BigInt(7),p0=BigInt(256),m0=BigInt(113);for(let e=0,t=vr,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Gf.push(2*(5*r+n)),qf.push((e+1)*(e+2)/2%64);let o=d0;for(let s=0;s<7;s++)t=(t<<vr^(t>>h0)*m0)%p0,t&f0&&(o^=vr<<(vr<<BigInt(s))-vr);Kf.push(o)}const[g0,y0]=t0(Kf,!0),_l=(e,t,n)=>n>32?o0(e,t,n):n0(e,t,n),Zl=(e,t,n)=>n>32?s0(e,t,n):r0(e,t,n);function b0(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,u=(i+2)%10,c=n[u],l=n[u+1],d=_l(c,l,1)^n[a],h=Zl(c,l,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=qf[i],u=_l(o,s,a),c=Zl(o,s,a),l=Gf[i];o=e[l],s=e[l+1],e[l]=u,e[l+1]=c}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]^=g0[r],e[1]^=y0[r]}n.fill(0)}class mu extends l0{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,ql(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=i0(this.state)}keccak(){$l||Jl(this.state32),b0(this.state32,this.rounds),$l||Jl(this.state32),this.posOut=0,this.pos=0}update(t){Kl(this);const{blockLen:n,state:r}=this;t=Hf(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){Kl(this,!1),pu(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 ql(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Xv(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 mu(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 w0=(e,t,n)=>c0(()=>new mu(t,e,n)),v0=w0(1,136,256/8);function sr(e,t){const n=t||"hex",r=v0(On(e,{strict:!1})?iu(e):e);return n==="bytes"?r:uu(r)}const di=new hu(8192);function gu(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 Go(e,t){if(!wt(e,{strict:!1}))throw new xn({address:e});return gu(e,t)}const A0=/^0x[a-fA-F0-9]{40}$/,fi=new hu(8192);function wt(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(fi.has(r))return fi.get(r);const o=A0.test(e)?e.toLowerCase()===e?!0:n?gu(e)===e:!0:!1;return fi.set(r,o),o}function ps(e,t,n,{strict:r}={}){return On(e,{strict:!1})?x0(e,t,n,{strict:r}):Jf(e,t,n,{strict:r})}function Yf(e,t){if(typeof t=="number"&&t>0&&t>Me(e)-1)throw new Uf({offset:t,position:"start",size:Me(e)})}function $f(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Me(e)!==n-t)throw new Uf({offset:n,position:"end",size:Me(e)})}function Jf(e,t,n,{strict:r}={}){Yf(e,t);const o=e.slice(t,n);return r&&$f(o,t,n),o}function x0(e,t,n,{strict:r}={}){Yf(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&$f(o,t,n),o}const C0=/^(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 yu(e,t){if(e.length!==t.length)throw new Hv({expectedLength:e.length,givenLength:t.length});const n=E0({params:e,values:t}),r=wu(n);return r.length===0?"0x":r}function E0({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(bu({param:e[r],value:t[r]}));return n}function bu({param:e,value:t}){const n=vu(e.type);if(n){const[r,o]=n;return P0(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return N0(t,{param:e});if(e.type==="address")return S0(t);if(e.type==="bool")return I0(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=C0.exec(e.type)??[];return M0(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return k0(t,{param:e});if(e.type==="string")return O0(t);throw new Kv(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function wu(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:a}=e[s];i?t+=32:t+=Me(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(ye(t+o,{size:32})),r.push(a),o+=Me(a)):n.push(a)}return Jt([...n,...r])}function S0(e){if(!wt(e))throw new xn({address:e});return{dynamic:!1,encoded:Ht(e.toLowerCase())}}function P0(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new $v(e);if(!r&&e.length!==t)throw new Wv({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const a=bu({param:n,value:e[i]});a.dynamic&&(o=!0),s.push(a)}if(r||o){const i=wu(s);if(r){const a=ye(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 k0(e,{param:t}){const[,n]=t.type.split("bytes"),r=Me(e);if(!n){let o=e;return r%32!==0&&(o=Ht(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Jt([Ht(ye(r,{size:32})),o])}}if(r!==Number.parseInt(n))throw new Vv({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:Ht(e,{dir:"right"})}}function I0(e){if(typeof e!="boolean")throw new Q(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Ht(Wf(e))}}function M0(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 zf({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:ye(e,{size:32,signed:t})}}function O0(e){const t=lu(e),n=Math.ceil(Me(t)/32),r=[];for(let o=0;o<n;o++)r.push(Ht(ps(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Jt([Ht(ye(Me(t),{size:32})),...r])}}function N0(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=bu({param:s,value:e[i]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?wu(r):Jt(r.map(({encoded:o})=>o))}}function vu(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 jv({docsPath:hi});if(!("inputs"in o))throw new Gl({docsPath:hi});if(!o.inputs||o.inputs.length===0)throw new Gl({docsPath:hi});const s=yu(o.inputs,n);return fu([r,s])}function zs(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class Xl extends Q{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class D0 extends Q{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class R0 extends Q{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const F0={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 R0({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new D0({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Xl({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 Xl({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 T0(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(F0);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 Zf extends Q{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const B0={gwei:9,wei:18},L0={ether:-9,wei:9};function Xf(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 Xf(e,L0[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 ua 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(ua,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class la 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(la,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class ca 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(ca,"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 eh extends Q{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function z0(e,t="wei"){return Xf(e,B0[t])}function th(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 U0 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 yt=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n),j0=e=>e,ko=e=>e;class wn 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: ${ko(i)}`,t&&`Request body: ${yt(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 nh extends Q{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${ko(r)}`,`Request body: ${yt(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code}}class ec extends Q{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${ko(n)}`,`Request body: ${yt(t)}`],name:"TimeoutError"})}}const Q0=-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 nh?t.code:n??Q0}}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 Xr extends Qe{constructor(t){super(t,{code:Xr.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Xr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class eo extends Qe{constructor(t){super(t,{code:eo.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class to extends Qe{constructor(t,{method:n}={}){super(t,{code:to.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(to,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class no extends Qe{constructor(t){super(t,{code:no.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
61
|
-
`)})}}Object.defineProperty(no,"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 ro extends Qe{constructor(t){super(t,{code:ro.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
62
|
-
`)})}}Object.defineProperty(ro,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class oo extends Qe{constructor(t){super(t,{code:oo.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(oo,"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 so extends Qe{constructor(t){super(t,{code:so.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(so,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class io extends Qe{constructor(t,{method:n}={}){super(t,{code:io.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not implemented.`})}}Object.defineProperty(io,"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 ao extends Qe{constructor(t){super(t,{code:ao.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(ao,"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 uo extends mr{constructor(t){super(t,{code:uo.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(uo,"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 fo extends mr{constructor(t){super(t,{code:fo.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(fo,"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 W0 extends Qe{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function V0(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}):ua.nodeMessage.test(n)?new ua({cause:e}):la.nodeMessage.test(n)?new la({cause:e,gas:t==null?void 0:t.gas}):ca.nodeMessage.test(n)?new ca({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 eh({cause:e})}function H0(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 G0={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function q0(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=K0(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=ye(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=ye(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=ye(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=ye(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=ye(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=ye(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=G0[e.type]),typeof e.value<"u"&&(t.value=ye(e.value)),t}function K0(e){return e.map(t=>({address:t.contractAddress,r:t.r,s:t.s,chainId:ye(t.chainId),nonce:ye(t.nonce),...typeof t.yParity<"u"?{yParity:ye(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:ye(t.v)}:{}}))}function Us(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 Y0=2n**256n-1n;function $0(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:o,to:s}=e,i=t?zs(t):void 0;if(i&&!wt(i.address))throw new xn({address:i.address});if(s&&!wt(s))throw new xn({address:s});if(typeof n<"u"&&(typeof r<"u"||typeof o<"u"))throw new U0;if(r&&r>Y0)throw new ms({maxFeePerGas:r});if(o&&r&&o>r)throw new gs({maxFeePerGas:r,maxPriorityFeePerGas:o})}class J0 extends Q{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class _0 extends Q{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function tc(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
63
|
-
`,"")}function Z0(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+=tc(r.state)),r.stateDiff&&(o+=` stateDiff:
|
|
69
|
-
`,o+=tc(r.stateDiff)),o},` State Override:
|
|
70
|
-
`).slice(0,-1)}function nc(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Vl({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Vl({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function X0(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=ye(t)),n!==void 0&&(i.nonce=ye(n)),r!==void 0&&(i.state=nc(r)),o!==void 0){if(i.state)throw new _0;i.stateDiff=nc(o)}return i}function eA(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!wt(n,{strict:!1}))throw new xn({address:n});if(t[n])throw new J0({address:n});t[n]=X0(r)}return t}const rc=[{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"}],rh=[{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"}],tA=[...rh,{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"}]}],nA=[...rh,{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"}]}],oc=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}];function rA(e,t={}){typeof t.size<"u"&&At(e,{size:t.size});const n=Je(e,t);return Qf(n,t)}function oA(e,t={}){let n=e;if(typeof t.size<"u"&&(At(n,{size:t.size}),n=su(n)),n.length>1||n[0]>1)throw new Ov(n);return!!n[0]}function Nt(e,t={}){typeof t.size<"u"&&At(e,{size:t.size});const n=Je(e,t);return Bv(n,t)}function sA(e,t={}){let n=e;return typeof t.size<"u"&&(At(n,{size:t.size}),n=su(n,{dir:"right"})),new TextDecoder().decode(n)}function oh(e,t){const n=typeof t=="string"?au(t):t,r=T0(n);if(Me(n)===0&&e.length>0)throw new du;if(Me(t)&&Me(t)<32)throw new Qv({data:typeof t=="string"?t:Je(t),params:e,size:Me(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const a=e[i];r.setPosition(o);const[u,c]=Xn(r,a,{staticPosition:0});o+=c,s.push(u)}return s}function Xn(e,t,{staticPosition:n}){const r=vu(t.type);if(r){const[o,s]=r;return aA(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return dA(e,t,{staticPosition:n});if(t.type==="address")return iA(e);if(t.type==="bool")return uA(e);if(t.type.startsWith("bytes"))return lA(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return cA(e,t);if(t.type==="string")return fA(e,{staticPosition:n});throw new Yv(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const sc=32,fa=32;function iA(e){const t=e.readBytes(32);return[gu(Je(Jf(t,-20))),32]}function aA(e,t,{length:n,staticPosition:r}){if(!n){const i=Nt(e.readBytes(fa)),a=r+i,u=a+sc;e.setPosition(a);const c=Nt(e.readBytes(sc)),l=ho(t);let d=0;const h=[];for(let f=0;f<c;++f){e.setPosition(u+(l?f*32:d));const[g,p]=Xn(e,t,{staticPosition:u});d+=p,h.push(g)}return e.setPosition(r+32),[h,32]}if(ho(t)){const i=Nt(e.readBytes(fa)),a=r+i,u=[];for(let c=0;c<n;++c){e.setPosition(a+c*32);const[l]=Xn(e,t,{staticPosition:a});u.push(l)}return e.setPosition(r+32),[u,32]}let o=0;const s=[];for(let i=0;i<n;++i){const[a,u]=Xn(e,t,{staticPosition:r+o});o+=u,s.push(a)}return[s,o]}function uA(e){return[oA(e.readBytes(32),{size:32}),32]}function lA(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const s=Nt(e.readBytes(32));e.setPosition(n+s);const i=Nt(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 cA(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),o=e.readBytes(32);return[r>48?rA(o,{signed:n}):Nt(o,{signed:n}),32]}function dA(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(ho(t)){const i=Nt(e.readBytes(fa)),a=n+i;for(let u=0;u<t.components.length;++u){const c=t.components[u];e.setPosition(a+s);const[l,d]=Xn(e,c,{staticPosition:a});s+=d,o[r?u:c==null?void 0:c.name]=l}return e.setPosition(n+32),[o,32]}for(let i=0;i<t.components.length;++i){const a=t.components[i],[u,c]=Xn(e,a,{staticPosition:n});o[r?i:a==null?void 0:a.name]=u,s+=c}return[o,s]}function fA(e,{staticPosition:t}){const n=Nt(e.readBytes(32)),r=t+n;e.setPosition(r);const o=Nt(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=sA(su(s));return e.setPosition(t+32),[i,32]}function ho(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(ho);const r=vu(e.type);return!!(r&&ho({...e,type:r[1]}))}const hA=e=>sr(iu(e));function pA(e){return hA(e)}const mA="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@${mA}`].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 sh=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,ih=/^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)?$/,ah=/^\(.+?\).*?$/,ic=/^tuple(?<array>(\[(\d*)\])*)$/;function pa(e){let t=e.type;if(ic.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(ic,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 gA(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 uh=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function yA(e){return uh.test(e)}function bA(e){return Zt(uh,e)}const lh=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function wA(e){return lh.test(e)}function vA(e){return Zt(lh,e)}const ch=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function AA(e){return ch.test(e)}function xA(e){return Zt(ch,e)}const dh=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function fh(e){return dh.test(e)}function CA(e){return Zt(dh,e)}const hh=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function EA(e){return hh.test(e)}function SA(e){return Zt(hh,e)}const PA=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function kA(e){return PA.test(e)}const IA=/^receive\(\) external payable$/;function MA(e){return IA.test(e)}const OA=new Set(["indexed"]),ma=new Set(["calldata","memory","storage"]);class NA 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 DA 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 RA extends _e{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class FA 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 BA 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 LA 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 Hr 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 zA extends _e{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class UA 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 jA 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 QA 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 WA(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 VA(e,t={}){if(AA(e)){const n=xA(e);if(!n)throw new Hr({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),u=a.length;for(let c=0;c<u;c++)i.push(fn(a[c],{modifiers:ma,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}if(wA(e)){const n=vA(e);if(!n)throw new Hr({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:OA,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}if(yA(e)){const n=bA(e);if(!n)throw new Hr({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(EA(e)){const n=SA(e);if(!n)throw new Hr({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(kA(e))return{type:"fallback"};if(MA(e))return{type:"receive",stateMutability:"payable"};throw new zA({signature:e})}const HA=/^(?<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$_]*))?$/,GA=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,qA=/^u?int$/;function fn(e,t){var n,r;const o=WA(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(pi.has(o))return pi.get(o);const s=ah.test(e),i=Zt(s?GA:HA,e);if(!i)throw new RA({param:e});if(i.name&&YA(i.name))throw new FA({param:e,name:i.name});const a=i.name?{name:i.name}:{},u=i.modifier==="indexed"?{indexed:!0}:{},c=(t==null?void 0:t.structs)??{};let l,d={};if(s){l="tuple";const f=nt(i.type),g=[],p=f.length;for(let m=0;m<p;m++)g.push(fn(f[m],{structs:c}));d={components:g}}else if(i.type in c)l="tuple",d={components:c[i.type]};else if(qA.test(i.type))l=`${i.type}256`;else if(l=i.type,(t==null?void 0:t.type)!=="struct"&&!ph(l))throw new DA({type:l});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)&&!$A(l,!!i.array))throw new BA({param:e,type:t==null?void 0:t.type,modifier:i.modifier})}const h={type:`${l}${i.array??""}`,...a,...u,...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 QA({current:n,depth:r});return t.push(n.trim()),t}function ph(e){return e==="address"||e==="bool"||e==="function"||e==="string"||sh.test(e)||ih.test(e)}const KA=/^(?: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 YA(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||sh.test(e)||ih.test(e)||KA.test(e)}function $A(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function JA(e){const t={},n=e.length;for(let i=0;i<n;i++){const a=e[i];if(!fh(a))continue;const u=CA(a);if(!u)throw new Hr({signature:a,type:"struct"});const c=u.properties.split(";"),l=[],d=c.length;for(let h=0;h<d;h++){const f=c[h].trim();if(!f)continue;const g=fn(f,{type:"struct"});l.push(g)}if(!l.length)throw new UA({signature:a});t[u.name]=l}const r={},o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[a,u]=o[i];r[a]=mh(u,t)}return r}const _A=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function mh(e,t,n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(ah.test(i.type))r.push(i);else{const a=Zt(_A,i.type);if(!(a!=null&&a.type))throw new LA({abiParameter:i});const{array:u,type:c}=a;if(c in t){if(n.has(c))throw new jA({type:c});r.push({...i,type:`tuple${u??""}`,components:mh(t[c]??[],t,new Set([...n,c]))})}else if(ph(c))r.push(i);else throw new NA({type:c})}}return r}function gh(e){const t=JA(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];fh(s)||n.push(VA(s,t))}return n}function ZA(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 XA=e=>{const t=typeof e=="string"?e:gA(e);return ZA(t)};function yh(e){return pA(XA(e))}const ex=yh,Au=e=>ps(yh(e),0,4);function xu(e){const{abi:t,args:n=[],name:r}=e,o=On(r,{strict:!1}),s=t.filter(a=>o?a.type==="function"?Au(a)===r:a.type==="event"?ex(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((u,c)=>{const l="inputs"in a&&a.inputs[c];return l?ga(u,l):!1})){if(i&&"inputs"in i&&i.inputs){const u=bh(a.inputs,i.inputs,n);if(u)throw new qv({abiItem:a,type:u[0]},{abiItem:i,type:u[1]})}i=a}}return i||s[0]}function ga(e,t){const n=typeof e,r=t.type;switch(r){case"address":return wt(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 bh(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 bh(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")?wt(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")&&wt(n[r],{strict:!1})))return i}}const mi="/docs/contract/decodeFunctionResult";function Cu(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const a=xu({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 Gv(s.name,{docsPath:mi});const i=oh(s.outputs,o);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}const ac="/docs/contract/encodeFunctionData";function tx(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=xu({abi:t,args:n,name:r});if(!s)throw new hs(r,{docsPath:ac});o=s}if(o.type!=="function")throw new hs(void 0,{docsPath:ac});return{abi:[o],functionName:Au(or(o))}}function Eu(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var a;return e.abi.length===1&&(a=e.functionName)!=null&&a.startsWith("0x")?e:tx(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?yu(o.inputs,t??[]):void 0;return fu([s,i??"0x"])}function Su({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 wh={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."},nx={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},rx={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function vh(e){const{abi:t,data:n}=e,r=ps(n,0,4);if(r==="0x")throw new du;const o=[...t||[],nx,rx].find(s=>s.type==="error"&&r===Au(or(s)));if(!o)throw new Vf(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?oh(o.inputs,ps(n,4)):void 0,errorName:o.name}}function Ah({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"?yt(t[s]):t[s]}`).join(", ")})`}class ox extends Q{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:a,maxFeePerGas:u,maxPriorityFeePerGas:c,nonce:l,to:d,value:h,stateOverride:f}){var g;const p=n?zs(n):void 0;let m=th({from:p==null?void 0:p.address,to:d,value:typeof h<"u"&&`${z0(h)} ${((g=o==null?void 0:o.nativeCurrency)==null?void 0:g.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof a<"u"&&`${bn(a)} gwei`,maxFeePerGas:typeof u<"u"&&`${bn(u)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${bn(c)} gwei`,nonce:l});f&&(m+=`
|
|
72
|
-
${Z0(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class sx extends Q{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:s,functionName:i,sender:a}){const u=xu({abi:n,args:r,name:i}),c=u?Ah({abiItem:u,args:r,includeFunctionName:!1,includeName:!1}):void 0,l=u?or(u,{includeName:!0}):void 0,d=th({address:o&&j0(o),function:l,args:c&&c!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${c}`,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,u;if(n&&n!=="0x")try{i=vh({abi:t,data:n});const{abiItem:l,errorName:d,args:h}=i;if(d==="Error")u=h[0];else if(d==="Panic"){const[f]=h;u=wh[f]}else{const f=l?or(l,{includeName:!0}):void 0,g=l&&h?Ah({abiItem:l,args:h,includeFunctionName:!1,includeName:!1}):void 0;a=[f?`Error: ${f}`:"",g&&g!=="()"?` ${[...Array((d==null?void 0:d.length)??0).keys()].map(()=>" ").join("")}${g}`:""]}}catch(l){s=l}else o&&(u=o);let c;s instanceof Vf&&(c=s.signature,a=[`Unable to decode signature "${c}" 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=${c}.`]),super(u&&u!=="execution reverted"||c?[`The contract function "${r}" reverted with the following ${c?"signature":"reason"}:`,u||c].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=u,this.signature=c}}class ix 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 ax 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 xh 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 Ch(e,t){var n,r,o,s,i,a;if(!(e instanceof Q))return!1;const u=e.walk(c=>c instanceof ya);return u instanceof ya?!!(((n=u.data)==null?void 0:n.errorName)==="ResolverNotFound"||((r=u.data)==null?void 0:r.errorName)==="ResolverWildcardNotSupported"||((o=u.data)==null?void 0:o.errorName)==="ResolverNotContract"||((s=u.data)==null?void 0:s.errorName)==="ResolverError"||((i=u.data)==null?void 0:i.errorName)==="HttpError"||(a=u.reason)!=null&&a.includes("Wildcard on non-extended resolvers is not supported")||t==="reverse"&&u.reason===wh[50]):!1}function Eh(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 ux(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=Eh(n[r]),s=o?iu(o):sr(yn(n[r]),"bytes");t=sr(Jt([t,s]),"bytes")}return Je(t)}function lx(e){return`[${e.slice(2)}]`}function cx(e){const t=new Uint8Array(32).fill(0);return e?Eh(e)||sr(yn(e)):Je(t)}function Sh(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(lx(cx(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 dx=3;function fx(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const{code:a,data:u,message:c,shortMessage:l}=e instanceof xh?e:e instanceof Q?e.walk(h=>"data"in h)||e.walk():{},d=e instanceof du?new ix({functionName:s}):[dx,Cn.code].includes(a)&&(u||c||l)?new ya({abi:t,data:typeof u=="object"?u.data:u,functionName:s,message:l??c}):e;return new sx(d,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}const hx="0x82ad56cb",px="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",mx="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";function gx(e,{docsPath:t,...n}){const r=(()=>{const o=V0(e,n);return o instanceof eh?e:o})();return new ox(r,{docsPath:t,...n})}function yx(){let e=()=>{},t=()=>{};return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}const gi=new Map;function Ph({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const s=async()=>{const l=u();i();const d=l.map(({args:h})=>h);d.length!==0&&e(d).then(h=>{o&&Array.isArray(h)&&h.sort(o);for(let f=0;f<l.length;f++){const{resolve:g}=l[f];g==null||g([h[f],h])}}).catch(h=>{for(let f=0;f<l.length;f++){const{reject:g}=l[f];g==null||g(h)}})},i=()=>gi.delete(t),a=()=>u().map(({args:l})=>l),u=()=>gi.get(t)||[],c=l=>gi.set(t,[...u(),l]);return{flush:i,async schedule(l){const{promise:d,resolve:h,reject:f}=yx();return n!=null&&n([...a(),l])&&s(),u().length>0?(c({args:l,resolve:h,reject:f}),d):(c({args:l,resolve:h,reject:f}),setTimeout(s,r),d)}}}async function kh(e,t){var n,r,o,s;const{account:i=e.account,batch:a=!!((n=e.batch)!=null&&n.multicall),blockNumber:u,blockTag:c="latest",accessList:l,blobs:d,code:h,data:f,factory:g,factoryData:p,gas:m,gasPrice:A,maxFeePerBlobGas:w,maxFeePerGas:S,maxPriorityFeePerGas:k,nonce:y,to:x,value:E,stateOverride:D,...O}=t,T=i?zs(i):void 0;if(h&&(g||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 W=h&&f,I=g&&p&&x&&f,F=W||I,B=W?vx({code:h,data:f}):I?Ax({data:f,factory:g,factoryData:p,to:x}):f;try{$0(t);const q=(u?ye(u):void 0)||c,V=eA(D),$=(s=(o=(r=e.chain)==null?void 0:r.formatters)==null?void 0:o.transactionRequest)==null?void 0:s.format,Y=($||q0)({...H0(O,{format:$}),from:T==null?void 0:T.address,accessList:l,blobs:d,data:B,gas:m,gasPrice:A,maxFeePerBlobGas:w,maxFeePerGas:S,maxPriorityFeePerGas:k,nonce:y,to:F?void 0:x,value:E});if(a&&bx({request:Y})&&!V)try{return await wx(e,{...Y,blockNumber:u,blockTag:c})}catch(ae){if(!(ae instanceof Zf)&&!(ae instanceof ra))throw ae}const Z=await e.request({method:"eth_call",params:V?[Y,q,V]:[Y,q]});return Z==="0x"?{data:void 0}:{data:Z}}catch(q){const V=xx(q),{offchainLookup:$,offchainLookupSignature:Y}=await Promise.resolve().then(()=>Yx);if(e.ccipRead!==!1&&(V==null?void 0:V.slice(0,10))===Y&&x)return{data:await $(e,{data:V,to:x})};throw F&&(V==null?void 0:V.slice(0,10))==="0x101bb98d"?new ax({factory:g}):gx(q,{...t,account:T,chain:e.chain})}}function bx({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(hx)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function wx(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:u,to:c}=t;let l=u;if(!l){if(!e.chain)throw new Zf;l=Su({blockNumber:s,chain:e.chain,contract:"multicall3"})}const d=(s?ye(s):void 0)||i,{schedule:h}=Ph({id:`${e.uid}.${d}`,wait:o,shouldSplitBatch(p){return p.reduce((m,{data:A})=>m+(A.length-2),0)>r*2},fn:async p=>{const m=p.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),A=Eu({abi:rc,args:[m],functionName:"aggregate3"}),w=await e.request({method:"eth_call",params:[{data:A,to:l},d]});return Cu({abi:rc,args:[m],functionName:"aggregate3",data:w||"0x"})}}),[{returnData:f,success:g}]=await h({data:a,to:c});if(!g)throw new xh({data:f});return f==="0x"?{data:void 0}:{data:f}}function vx(e){const{code:t,data:n}=e;return _f({abi:gh(["constructor(bytes, bytes)"]),bytecode:px,args:[t,n]})}function Ax(e){const{data:t,factory:n,factoryData:r,to:o}=e;return _f({abi:gh(["constructor(address, bytes, address, bytes)"]),bytecode:mx,args:[o,t,n,r]})}function xx(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=Eu({abi:n,args:o,functionName:s});try{const{data:u}=await Us(e,kh,"call")({...i,data:a,to:r});return Cu({abi:n,args:o,functionName:s,data:u||"0x"})}catch(u){throw fx(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}class Cx 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 Pu 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 Ex extends Q{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Sx=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Px=/^(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>\/.*)?$/,kx=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Ix=/^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 uc(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Ih({uri:e,gatewayUrls:t}){const n=kx.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=uc(t==null?void 0:t.ipfs,"https://ipfs.io"),o=uc(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(Sx),{protocol:i,subpath:a,target:u,subtarget:c=""}=(s==null?void 0:s.groups)||{},l=i==="ipns:/"||a==="ipns/",d=i==="ipfs:/"||a==="ipfs/"||Px.test(e);if(e.startsWith("http")&&!l&&!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((l||d)&&u)return{uri:`${r}/${l?"ipns":"ipfs"}/${u}${c}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&u)return{uri:`${o}/${u}${c||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(Ix,"");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 Pu({uri:e})}function Mh(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Cx({data:e});return e.image||e.image_url||e.image_data}async function Ox({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(r=>r.json());return await ku({gatewayUrls:e,uri:Mh(n)})}catch{throw new Pu({uri:t})}}async function ku({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=Ih({uri:t,gatewayUrls:e});if(r||await Mx(n))return n;throw new Pu({uri:t})}function Nx(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,u]=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(!u)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:u,tokenID:o}}async function Dx(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 Ex({namespace:t.namespace})}async function Rx(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Fx(e,{gatewayUrls:t,record:n}):ku({uri:n,gatewayUrls:t})}async function Fx(e,{gatewayUrls:t,record:n}){const r=Nx(n),o=await Dx(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:a}=Ih({uri:o,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const c=a?atob(s.replace("data:application/json;base64,","")):s,l=JSON.parse(c);return ku({uri:Mh(l),gatewayUrls:t})}let u=r.tokenID;return r.namespace==="erc1155"&&(u=u.replace("0x","").padStart(64,"0")),Ox({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,u)})}async function Tx(e,{blockNumber:t,blockTag:n,name:r,key:o,gatewayUrls:s,strict:i,universalResolverAddress:a}){let u=a;if(!u){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");u=Su({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const c={address:u,abi:tA,functionName:"resolve",args:[uu(Sh(r)),Eu({abi:oc,functionName:"text",args:[ux(r),o]})],blockNumber:t,blockTag:n},l=Us(e,ys,"readContract"),d=s?await l({...c,args:[...c.args,s]}):await l(c);if(d[0]==="0x")return null;const h=Cu({abi:oc,functionName:"text",data:d[0]});return h===""?null:h}catch(c){if(i)throw c;if(Ch(c,"resolve"))return null;throw c}}async function Bx(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:a}){const u=await Us(e,Tx,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:a,gatewayUrls:s,strict:i});if(!u)return null;try{return await Rx(e,{record:u,gatewayUrls:r})}catch{return null}}async function Lx(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=Su({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const u=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const c={address:a,abi:nA,functionName:"reverse",args:[uu(Sh(u))],blockNumber:n,blockTag:r},l=Us(e,ys,"readContract"),[d,h]=o?await l({...c,args:[...c.args,o]}):await l(c);return t.toLowerCase()!==h.toLowerCase()?null:d}catch(c){if(s)throw c;if(Ch(c,"reverse"))return null;throw c}}function zx(e,t){if(!wt(e,{strict:!1}))throw new xn({address:e});if(!wt(t,{strict:!1}))throw new xn({address:t});return e.toLowerCase()===t.toLowerCase()}async function Ux(e){return new Promise(t=>setTimeout(t,e))}const qo=new hu(8192);function jx(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(qo.get(n))return qo.get(n);const r=e().finally(()=>qo.delete(n));return qo.set(n,r),r}function Oh(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((o,s)=>{const i=async({count:a=0}={})=>{const u=async({error:c})=>{const l=typeof t=="function"?t({count:a,error:c}):t;l&&await Ux(l),i({count:a+1})};try{const c=await e();o(c)}catch(c){if(a<n&&await r({count:a,error:c}))return u({error:c});s(c)}};i()})}function Qx(e,t={}){return async(n,r={})=>{const{dedupe:o=!1,retryDelay:s=150,retryCount:i=3,uid:a}={...t,...r},u=o?sr(lu(`${a}.${yt(n)}`)):void 0;return jx(()=>Oh(async()=>{try{return await e(n)}catch(c){const l=c;switch(l.code){case Xr.code:throw new Xr(l);case eo.code:throw new eo(l);case to.code:throw new to(l,{method:n.method});case no.code:throw new no(l);case Cn.code:throw new Cn(l);case ro.code:throw new ro(l);case oo.code:throw new oo(l);case Gt.code:throw new Gt(l);case so.code:throw new so(l);case io.code:throw new io(l,{method:n.method});case ir.code:throw new ir(l);case ao.code:throw new ao(l);case Ne.code:throw new Ne(l);case uo.code:throw new uo(l);case lo.code:throw new lo(l);case co.code:throw new co(l);case fo.code:throw new fo(l);case En.code:throw new En(l);case 5e3:throw new Ne(l);default:throw c instanceof Q?c:new W0(l)}}},{delay:({count:c,error:l})=>{var d;if(l&&l instanceof wn){const h=(d=l==null?void 0:l.headers)==null?void 0:d.get("Retry-After");if(h!=null&&h.match(/\d/))return Number.parseInt(h)*1e3}return~~(1<<c)*s},retryCount:i,shouldRetry:({error:c})=>Wx(c)}),{enabled:o,id:u})}}function Wx(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===ir.code||e.code===Cn.code:e instanceof wn&&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 Vx 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(u=>` ${ko(u)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class Hx extends Q{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${ko(n)}`,`Response: ${yt(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Gx 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 qx="0x556f1830",Nh={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 Kx(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=vh({data:r,abi:[Nh]}),[i,a,u,c,l]=s,{ccipRead:d}=e,h=d&&typeof(d==null?void 0:d.request)=="function"?d.request:Dh;try{if(!zx(o,i))throw new Gx({sender:i,to:o});const f=await h({data:u,sender:i,urls:a}),{data:g}=await kh(e,{blockNumber:t,blockTag:n,data:Jt([c,yu([{type:"bytes"},{type:"bytes"}],[f,l])]),to:o});return g}catch(f){throw new Vx({callbackSelector:c,cause:f,data:r,extraData:l,sender:i,urls:a})}}async function Dh({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",u=a==="POST"?{data:e,sender:t}:void 0,c=a==="POST"?{"Content-Type":"application/json"}:{};try{const l=await fetch(i.replace("{sender}",t).replace("{data}",e),{body:JSON.stringify(u),headers:c,method:a});let d;if((r=l.headers.get("Content-Type"))!=null&&r.startsWith("application/json")?d=(await l.json()).data:d=await l.text(),!l.ok){o=new wn({body:u,details:d!=null&&d.error?yt(d.error):l.statusText,headers:l.headers,status:l.status,url:i});continue}if(!On(d)){o=new Hx({result:d,url:i});continue}return d}catch(l){o=new wn({body:u,details:l.message,url:i})}}throw o}const Yx=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Dh,offchainLookup:Kx,offchainLookupAbiItem:Nh,offchainLookupSignature:qx},Symbol.toStringTag,{value:"Module"}));function $x(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function Rh(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 Jx(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const lc=Jx();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,u={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:l,signal:d}=u;try{const h=await Rh(async({signal:g})=>{const p={...u,body:Array.isArray(o)?yt(o.map(w=>({jsonrpc:"2.0",id:w.id??lc.take(),...w}))):yt({jsonrpc:"2.0",id:o.id??lc.take(),...o}),headers:{"Content-Type":"application/json",...c},method:l||"POST",signal:d||(a>0?g:null)},m=new Request(e,p),A=await(s==null?void 0:s(m,p))??{...p,url:e};return await fetch(A.url??e,A)},{errorInstance:new ec({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(g){if(h.ok)throw g;f={error:f}}}if(!h.ok)throw new wn({body:o,details:yt(f.error)||h.statusText,headers:h.headers,status:h.status,url:e});return f}catch(h){throw h instanceof wn||h instanceof ec?h:new wn({body:o,cause:h,url:e})}}}}function Fh(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",Zx=()=>`@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,Bh;let Iu=class ba extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Zx()}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",Bh).call(this,this,t)}};bs=new WeakSet,Bh=function e(t,n){return n!=null&&n(t)?t:t.cause?Th(this,bs,"m",e).call(this,t.cause,n):t};class wa extends Iu{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}const va=256;let Ko=va,Yo;function Lh(e=11){if(!Yo||Ko+e>va*2){Yo="",Ko=0;for(let t=0;t<va;t++)Yo+=(256+Math.random()*256|0).toString(16).substring(1)}return Yo.substring(Ko,Ko+++e)}function Xx(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,u=e.chain,c=e.account?zs(e.account):void 0,{config:l,request:d,value:h}=e.transport({chain:u,pollingInterval:i}),f={...l,...h},g={account:c,batch:t,cacheTime:n,ccipRead:r,chain:u,key:o,name:s,pollingInterval:i,request:d,transport:f,type:a,uid:Lh()};function p(m){return A=>{const w=A(m);for(const k in g)delete w[k];const S={...m,...w};return Object.assign(S,{extend:p(S)})}}return Object.assign(g,{extend:p(g)})}function e1({key:e,name:t,request:n,retryCount:r=3,retryDelay:o=150,timeout:s,type:i},a){const u=Lh();return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:o,timeout:s,type:i},request:Qx(n,{retryCount:r,retryDelay:o,uid:u}),value:a}}class t1 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 n1(e,t={}){const{batch:n,fetchOptions:r,key:o="http",name:s="HTTP JSON-RPC",onFetchRequest:i,onFetchResponse:a,retryDelay:u}=t;return({chain:c,retryCount:l,timeout:d})=>{const{batchSize:h=1e3,wait:f=0}=typeof n=="object"?n:{},g=t.retryCount??l,p=d??t.timeout??1e4,m=c==null?void 0:c.rpcUrls.default.http[0];if(!m)throw new t1;const A=_x(m,{fetchOptions:r,onRequest:i,onResponse:a,timeout:p});return e1({key:o,name:s,async request({method:w,params:S}){const k={method:w,params:S},{schedule:y}=Ph({id:m,wait:f,shouldSplitBatch(O){return O.length>h},fn:O=>A.request({body:O}),sort:(O,T)=>O.id-T.id}),x=async O=>n?y(O):[await A.request({body:O})],[{error:E,result:D}]=await x(k);if(E)throw new nh({body:k,error:E,url:m});return D},retryCount:g,retryDelay:u,timeout:p,type:"http"},{fetchOptions:r,url:m})}}function cc(e){return e.state.chainId}function r1(e,t){const{chainId:n,...r}=t,o=e.getClient({chainId:n});return Fh(o,Bx,"getEnsAvatar")(r)}function o1(e,t){const{chainId:n,...r}=t,o=e.getClient({chainId:n});return Fh(o,Lx,"getEnsName")(r)}let yi=!1;async function s1(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 u=!1;const c=[],l=[];for(const d of a){const h=await d.getProvider().catch(()=>{});if(!h||l.some(g=>g===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(g=>{const p=new Map(u?g.connections:new Map).set(d.uid,{accounts:f.accounts,chainId:f.chainId,connector:d});return{...g,current:u?g.current:d.uid,connections:p}}),c.push({accounts:f.accounts,chainId:f.chainId,connector:d}),l.push(h),u=!0)}return(e.state.status==="reconnecting"||e.state.status==="connecting")&&(u?e.setState(d=>({...d,status:"connected"})):e.setState(d=>({...d,connections:new Map,current:null,status:"disconnected"}))),yi=!1,c}class Fn extends Iu{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}function i1(e,t){const{onChange:n}=t;return e.subscribe(r=>r.chainId,n)}Mu.type="injected";function Mu(e={}){const{shimDisconnect:t=!0,unstable_shimAsyncInject:n}=e;function r(){const u=e.target;if(typeof u=="function"){const c=u();if(c)return c}return typeof u=="object"?u:typeof u=="string"?{...a1[u]??{id:u,name:`${u[0].toUpperCase()}${u.slice(1)}`,provider:`is${u[0].toUpperCase()}${u.slice(1)}`}}:{id:"injected",name:"Injected",provider(c){return c==null?void 0:c.ethereum}}}let o,s,i,a;return u=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:Mu.type,async setup(){const c=await this.getProvider();c!=null&&c.on&&e.target&&(i||(i=this.onConnect.bind(this),c.on("connect",i)),o||(o=this.onAccountsChanged.bind(this),c.on("accountsChanged",o)))},async connect({chainId:c,isReconnecting:l}={}){var d,h,f,g,p,m;const A=await this.getProvider();if(!A)throw new Fn;let w=[];if(l)w=await this.getAccounts().catch(()=>[]);else if(t)try{w=(g=(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:g.map(S=>Go(S)),w.length>0&&(w=await this.getAccounts())}catch(S){const k=S;if(k.code===Ne.code)throw new Ne(k);if(k.code===Gt.code)throw k}try{!(w!=null&&w.length)&&!l&&(w=(await A.request({method:"eth_requestAccounts"})).map(k=>Go(k))),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(c&&S!==c){const k=await this.switchChain({chainId:c}).catch(y=>{if(y.code===Ne.code)throw y;return{id:S}});S=(k==null?void 0:k.id)??S}return t&&await((p=u.storage)==null?void 0:p.removeItem(`${this.id}.disconnected`)),e.target||await((m=u.storage)==null?void 0:m.setItem("injected.connected",!0)),{accounts:w,chainId:S}}catch(S){const k=S;throw k.code===Ne.code?new Ne(k):k.code===Gt.code?new Gt(k):k}},async disconnect(){var c,l;const d=await this.getProvider();if(!d)throw new Fn;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 Rh(()=>d.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}t&&await((c=u.storage)==null?void 0:c.setItem(`${this.id}.disconnected`,!0)),e.target||await((l=u.storage)==null?void 0:l.removeItem("injected.connected"))},async getAccounts(){const c=await this.getProvider();if(!c)throw new Fn;return(await c.request({method:"eth_accounts"})).map(l=>Go(l))},async getChainId(){const c=await this.getProvider();if(!c)throw new Fn;const l=await c.request({method:"eth_chainId"});return Number(l)},async getProvider(){if(typeof window>"u")return;let c;const l=r();return typeof l.provider=="function"?c=l.provider(window):typeof l.provider=="string"?c=is(window,l.provider):c=l.provider,c&&!c.removeListener&&("off"in c&&typeof c.off=="function"?c.removeListener=c.off:c.removeListener=()=>{}),c},async isAuthorized(){var c,l;try{if(t&&await((c=u.storage)==null?void 0:c.getItem(`${this.id}.disconnected`))||!e.target&&!await((l=u.storage)==null?void 0:l.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 Fn}return!!(await Oh(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:l}){var d,h,f,g;const p=await this.getProvider();if(!p)throw new Fn;const m=u.chains.find(w=>w.id===l);if(!m)throw new En(new wa);const A=new Promise(w=>{const S=k=>{"chainId"in k&&k.chainId===l&&(u.emitter.off("change",S),w())};u.emitter.on("change",S)});try{return await Promise.all([p.request({method:"wallet_switchEthereumChain",params:[{chainId:ye(l)}]}).then(async()=>{await this.getChainId()===l&&u.emitter.emit("change",{chainId:l})}),A]),m}catch(w){const S=w;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:k,...y}=m.blockExplorers??{};let x;c!=null&&c.blockExplorerUrls?x=c.blockExplorerUrls:k&&(x=[k.url,...Object.values(y).map(O=>O.url)]);let E;(f=c==null?void 0:c.rpcUrls)!=null&&f.length?E=c.rpcUrls:E=[((g=m.rpcUrls.default)==null?void 0:g.http[0])??""];const D={blockExplorerUrls:x,chainId:ye(l),chainName:(c==null?void 0:c.chainName)??m.name,iconUrls:c==null?void 0:c.iconUrls,nativeCurrency:(c==null?void 0:c.nativeCurrency)??m.nativeCurrency,rpcUrls:E};return await Promise.all([p.request({method:"wallet_addEthereumChain",params:[D]}).then(async()=>{if(await this.getChainId()===l)u.emitter.emit("change",{chainId:l});else throw new Ne(new Error("User rejected switch after adding network."))}),A]),m}catch(k){throw new Ne(k)}throw S.code===Ne.code?new Ne(S):new En(S)}},async onAccountsChanged(c){var l;if(c.length===0)this.onDisconnect();else if(u.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),t&&await((l=u.storage)==null?void 0:l.removeItem(`${this.id}.disconnected`))}else u.emitter.emit("change",{accounts:c.map(d=>Go(d))})},onChainChanged(c){const l=Number(c);u.emitter.emit("change",{chainId:l})},async onConnect(c){const l=await this.getAccounts();if(l.length===0)return;const d=Number(c.chainId);u.emitter.emit("connect",{accounts:l,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(c){const l=await this.getProvider();c&&c.code===1013&&l&&(await this.getAccounts()).length||(u.emitter.emit("disconnect"),l&&(s&&(l.removeListener("chainChanged",s),s=void 0),a&&(l.removeListener("disconnect",a),a=void 0),i||(i=this.onConnect.bind(this),l.on("connect",i))))}})}const a1={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 u1(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 l1(){const e=new Set;let t=[];const n=()=>u1(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 c1=e=>(t,n,r)=>{const o=r.subscribe;return r.subscribe=(s,i,a)=>{let u=s;if(i){const c=(a==null?void 0:a.equalityFn)||Object.is;let l=s(r.getState());u=d=>{const h=s(d);if(!c(l,h)){const f=l;i(l=h,f)}},a!=null&&a.fireImmediately&&i(l,l)}return o(u)},e(t,n,r)},d1=c1;function f1(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)}}}},h1=(e,t)=>(n,r,o)=>{let s={storage:f1(()=>localStorage),partialize:p=>p,version:0,merge:(p,m)=>({...m,...p}),...t},i=!1;const a=new Set,u=new Set;let c=s.storage;if(!c)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 l=()=>{const p=s.partialize({...r()});return c.setItem(s.name,{state:p,version:s.version})},d=o.setState;o.setState=(p,m)=>{d(p,m),l()};const h=e((...p)=>{n(...p),l()},r,o);o.getInitialState=()=>h;let f;const g=()=>{var p,m;if(!c)return;i=!1,a.forEach(w=>{var S;return w((S=r())!=null?S:h)});const A=((m=s.onRehydrateStorage)==null?void 0:m.call(s,(p=r())!=null?p:h))||void 0;return Aa(c.getItem.bind(c))(s.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==s.version){if(s.migrate)return[!0,s.migrate(w.state,w.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var S;const[k,y]=w;if(f=s.merge(y,(S=r())!=null?S:h),n(f,!0),k)return l()}).then(()=>{A==null||A(f,void 0),f=r(),i=!0,u.forEach(w=>w(f))}).catch(w=>{A==null||A(void 0,w)})};return o.persist={setOptions:p=>{s={...s,...p},p.storage&&(c=p.storage)},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(u.add(p),()=>{u.delete(p)})},s.skipHydration||g(),f||h},p1=h1,dc=e=>{let t;const n=new Set,r=(a,u)=>{const c=typeof a=="function"?a(t):a;if(!Object.is(c,t)){const l=t;t=u??(typeof c!="object"||c===null)?c:Object.assign({},t,c),n.forEach(d=>d(t,l))}},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?dc(e):dc;var fc={exports:{}},hc;function m1(){return hc||(hc=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(u,c,l){this.fn=u,this.context=c,this.once=l||!1}function s(u,c,l,d,h){if(typeof l!="function")throw new TypeError("The listener must be a function");var f=new o(l,d||u,h),g=n?n+c:c;return u._events[g]?u._events[g].fn?u._events[g]=[u._events[g],f]:u._events[g].push(f):(u._events[g]=f,u._eventsCount++),u}function i(u,c){--u._eventsCount===0?u._events=new r:delete u._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],c,l;if(this._eventsCount===0)return u;for(l in c=this._events)t.call(c,l)&&u.push(n?l.slice(1):l);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},a.prototype.listeners=function(u){var c=n?n+u:u,l=this._events[c];if(!l)return[];if(l.fn)return[l.fn];for(var d=0,h=l.length,f=new Array(h);d<h;d++)f[d]=l[d].fn;return f},a.prototype.listenerCount=function(u){var c=n?n+u:u,l=this._events[c];return l?l.fn?1:l.length:0},a.prototype.emit=function(u,c,l,d,h,f){var g=n?n+u:u;if(!this._events[g])return!1;var p=this._events[g],m=arguments.length,A,w;if(p.fn){switch(p.once&&this.removeListener(u,p.fn,void 0,!0),m){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,l),!0;case 4:return p.fn.call(p.context,c,l,d),!0;case 5:return p.fn.call(p.context,c,l,d,h),!0;case 6:return p.fn.call(p.context,c,l,d,h,f),!0}for(w=1,A=new Array(m-1);w<m;w++)A[w-1]=arguments[w];p.fn.apply(p.context,A)}else{var S=p.length,k;for(w=0;w<S;w++)switch(p[w].once&&this.removeListener(u,p[w].fn,void 0,!0),m){case 1:p[w].fn.call(p[w].context);break;case 2:p[w].fn.call(p[w].context,c);break;case 3:p[w].fn.call(p[w].context,c,l);break;case 4:p[w].fn.call(p[w].context,c,l,d);break;default:if(!A)for(k=1,A=new Array(m-1);k<m;k++)A[k-1]=arguments[k];p[w].fn.apply(p[w].context,A)}}return!0},a.prototype.on=function(u,c,l){return s(this,u,c,l,!1)},a.prototype.once=function(u,c,l){return s(this,u,c,l,!0)},a.prototype.removeListener=function(u,c,l,d){var h=n?n+u:u;if(!this._events[h])return this;if(!c)return i(this,h),this;var f=this._events[h];if(f.fn)f.fn===c&&(!d||f.once)&&(!l||f.context===l)&&i(this,h);else{for(var g=0,p=[],m=f.length;g<m;g++)(f[g].fn!==c||d&&!f[g].once||l&&f[g].context!==l)&&p.push(f[g]);p.length?this._events[h]=p.length===1?p[0]:p:i(this,h)}return this},a.prototype.removeAllListeners=function(u){var c;return u?(c=n?n+u:u,this._events[c]&&i(this,c)):(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}(fc)),fc.exports}var g1=m1();const y1=rb(g1);class b1{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 y1})}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 w1(e){return new b1(e)}function v1(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 pc(e,t){return e.slice(0,t).join(".")||"."}function mc(e,t){const{length:n}=e;for(let r=0;r<n;++r)if(e[r]===t)return r+1;return 0}function A1(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 u=mc(o,this);u===0?o[o.length]=this:(o.splice(u),s.splice(u)),s[s.length]=i;const c=mc(o,a);if(c!==0)return r?t.call(this,i,a,pc(s,c)):`[ref=${pc(s,c)}]`}else o[0]=a,s[0]=i;return n?e.call(this,i,a):a}}function x1(e,t,n,r){return JSON.stringify(e,A1((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 C1(e){const{deserialize:t=v1,key:n="wagmi",serialize:r=x1,storage:o=zh}=e;function s(i){return i instanceof Promise?i.then(a=>a).catch(()=>null):i}return{...o,key:n,async getItem(i,a){const u=o.getItem(`${n}.${i}`),c=await s(u);return c?t(c)??null:a??null},async setItem(i,a){const u=`${n}.${i}`;a===null?await s(o.removeItem(u)):await s(o.setItem(u,r(a)))},async removeItem(i){await s(o.removeItem(`${n}.${i}`))}}}const zh={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},xa=256;let $o=xa,Jo;function E1(e=11){if(!Jo||$o+e>xa*2){Jo="",$o=0;for(let t=0;t<xa;t++)Jo+=(256+Math.random()*256|0).toString(16).substring(1)}return Jo.substring($o,$o+++e)}function S1(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=C1({storage:typeof window<"u"&&window.localStorage?window.localStorage:zh}),syncConnectedChain:r=!0,ssr:o=!1,...s}=e,i=typeof window<"u"&&t?l1():void 0,a=bi(()=>s.chains),u=bi(()=>{const y=[],x=new Set;for(const E of s.connectors??[]){const D=c(E);if(y.push(D),!o&&D.rdns){const O=typeof D.rdns=="string"?[D.rdns]:D.rdns;for(const T of O)x.add(T)}}if(!o&&i){const E=i.getProviders();for(const D of E)x.has(D.info.rdns)||y.push(c(l(D)))}return y});function c(y){var x;const E=w1(E1()),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 l(y){const{info:x}=y,E=y.provider;return Mu({target:{...x,id:x.rdns,provider:E}})}const d=new Map;function h(y={}){const x=y.chainId??m.getState().chainId,E=a.getState().find(O=>O.id===x);if(y.chainId&&!E)throw new wa;{const O=d.get(m.getState().chainId);if(O&&!E)return O;if(!E)throw new wa}{const O=d.get(x);if(O)return O}let D;if(s.client)D=s.client({chain:E});else{const O=E.id,T=a.getState().map(F=>F.id),W={},I=Object.entries(s);for(const[F,B]of I)if(!(F==="chains"||F==="client"||F==="connectors"||F==="transports"))if(typeof B=="object")if(O in B)W[F]=B[O];else{if(T.some(q=>q in B))continue;W[F]=B}else W[F]=B;D=Xx({...W,chain:E,batch:W.batch??{multicall:!0},transport:F=>s.transports[O]({...F,connectors:u})})}return d.set(x,D),D}function f(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let g;const p="0.0.0-canary-";ss.startsWith(p)?g=Number.parseInt(ss.replace(p,"")):g=Number.parseInt(ss.split(".")[0]??"0");const m=bi(d1(n?p1(f,{migrate(y,x){if(x===g)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:O,type:T,uid:W}=E.connector;return[x,{...E,connector:{id:D,name:O,type:T,uid:W}}]})},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:g}):f));m.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&&m.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 m.setState(x=>({...x,chainId:y??x.chainId}))}),i==null||i.subscribe(y=>{const x=new Set,E=new Set;for(const O of u.getState())if(x.add(O.id),O.rdns){const T=typeof O.rdns=="string"?[O.rdns]:O.rdns;for(const W of T)E.add(W)}const D=[];for(const O of y){if(E.has(O.info.rdns))continue;const T=c(l(O));x.has(T.id)||D.push(T)}n&&!m.persist.hasHydrated()||u.setState(O=>[...O,...D],!0)});function w(y){m.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){m.getState().status==="connecting"||m.getState().status==="reconnecting"||m.setState(x=>{const E=u.getState().find(D=>D.uid===y.uid);return E?(E.emitter.listenerCount("connect")&&E.emitter.off("connect",w),E.emitter.listenerCount("change")||E.emitter.on("change",w),E.emitter.listenerCount("disconnect")||E.emitter.on("disconnect",k),{...x,connections:new Map(x.connections).set(y.uid,{accounts:y.accounts,chainId:y.chainId,connector:E}),current:y.uid,status:"connected"}):x})}function k(y){m.setState(x=>{const E=x.connections.get(y.uid);if(E){const O=E.connector;O.emitter.listenerCount("change")&&E.connector.emitter.off("change",w),O.emitter.listenerCount("disconnect")&&E.connector.emitter.off("disconnect",k),O.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 u.getState()},storage:n,getClient:h,get state(){return m.getState()},setState(y){let x;typeof y=="function"?x=y(m.getState()):x=y;const E=f();typeof x!="object"&&(x=E),Object.keys(E).some(D=>!(D in x))&&(x=E),m.setState(x,!0)},subscribe(y,x,E){return m.subscribe(y,x,E?{...E,fireImmediately:E.emitImmediately}:void 0)},_internal:{mipd:i,store:m,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:l,setup:c,setState(y){return u.setState(typeof y=="function"?y(u.getState()):y,!0)},subscribe(y){return u.subscribe(y)}},events:{change:w,connect:S,disconnect:k}}}}function P1(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 c of o??[])if(c.rdns){const l=Array.isArray(c.rdns)?c.rdns:[c.rdns];for(const d of l)i.add(d)}const a=[],u=((s=e._internal.mipd)==null?void 0:s.getProviders())??[];for(const c of u){if(i.has(c.info.rdns))continue;const l=e._internal.connectors.providerDetailToConnector(c),d=e._internal.connectors.setup(l);a.push(d)}return[...o,...a]})),r?s1(e):e.storage&&e.setState(o=>({...o,connections:new Map}))}}}function k1(e){const{children:t,config:n,initialState:r,reconnectOnMount:o=!0}=e,{onMount:s}=P1(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 Uh=Ua(void 0);function I1(e){const{children:t,config:n}=e,r={value:n};return Jr(k1,e,Jr(Uh.Provider,r,t))}const M1="2.14.1",O1=()=>`wagmi@${M1}`;class N1 extends Iu{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 O1()}}class D1 extends N1{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function Ou(e={}){const t=e.config??za(Uh);if(!t)throw new D1;return t}var Io=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 R1(e,t){return typeof e=="function"?e(t):e}function Ca(e){return typeof e=="number"&&e>=0&&e!==1/0}function jh(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 gc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Nu(i,t.options))return!1}else if(!mo(t.queryKey,i))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function yc(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(po(t.options.mutationKey)!==po(s))return!1}else if(!mo(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Nu(e,t){return((t==null?void 0:t.queryKeyHashFn)||po)(e)}function po(e){return JSON.stringify(e,(t,n)=>Sa(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function mo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!mo(e[n],t[n])):!1}function Qh(e,t){if(e===t)return e;const n=bc(e)&&bc(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 u=0;for(let c=0;c<i;c++){const l=n?c:s[c];(!n&&r.includes(l)||n)&&e[l]===void 0&&t[l]===void 0?(a[l]=void 0,u++):(a[l]=Qh(e[l],t[l]),a[l]===e[l]&&e[l]!==void 0&&u++)}return o===i&&u===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 bc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sa(e){if(!wc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wc(e){return Object.prototype.toString.call(e)==="[object Object]"}function F1(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?Qh(e,t):t}function T1(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function B1(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Du=Symbol();function Wh(e,t){return!e.queryFn&&t!=null&&t.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Du?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Tn,nn,Cr,vc,L1=(vc=class extends Io{constructor(){super(),te(this,Tn),te(this,nn),te(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,Tn)!==e&&(G(this,Tn,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof P(this,Tn)=="boolean"?P(this,Tn):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Tn=new WeakMap,nn=new WeakMap,Cr=new WeakMap,vc),Ru=new L1,Er,rn,Sr,Ac,z1=(Ac=class extends Io{constructor(){super(),te(this,Er,!0),te(this,rn),te(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,Ac),ws=new z1;function ka(){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 U1(e){return Math.min(1e3*2**e,3e4)}function Vh(e){return(e??"online")==="online"?ws.isOnline():!0}var Hh=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wi(e){return e instanceof Hh}function Gh(e){let t=!1,n=0,r=!1,o;const s=ka(),i=p=>{var m;r||(h(new Hh(p)),(m=e.abort)==null||m.call(e))},a=()=>{t=!0},u=()=>{t=!1},c=()=>Ru.isFocused()&&(e.networkMode==="always"||ws.isOnline())&&e.canRun(),l=()=>Vh(e.networkMode)&&e.canRun(),d=p=>{var m;r||(r=!0,(m=e.onSuccess)==null||m.call(e,p),o==null||o(),s.resolve(p))},h=p=>{var m;r||(r=!0,(m=e.onError)==null||m.call(e,p),o==null||o(),s.reject(p))},f=()=>new Promise(p=>{var m;o=A=>{(r||c())&&p(A)},(m=e.onPause)==null||m.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),g=()=>{if(r)return;let p;const m=n===0?e.initialPromise:void 0;try{p=m??e.fn()}catch(A){p=Promise.reject(A)}Promise.resolve(p).then(d).catch(A=>{var w;if(r)return;const S=e.retry??(Sn?0:3),k=e.retryDelay??U1,y=typeof k=="function"?k(n,A):k,x=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,A);if(t||!x){h(A);return}n++,(w=e.onFail)==null||w.call(e,n,A),F1(y).then(()=>c()?void 0:f()).then(()=>{t?h(A):g()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:u,canStart:l,start:()=>(l()?g():f().then(g),s)}}function j1(){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(u=>{n(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||i()}return u},batchCalls:a=>(...u)=>{s(()=>{a(...u)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ie=j1(),Bn,xc,qh=(xc=class{constructor(){te(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,xc),Pr,kr,et,Oe,_o,Ln,dt,Et,Cc,Q1=(Cc=class extends qh{constructor(e){super(),te(this,dt),te(this,Pr),te(this,kr),te(this,et),te(this,Oe),te(this,_o),te(this,Ln),G(this,Ln,!1),G(this,_o,e.defaultOptions),this.setOptions(e.options),this.observers=[],G(this,et,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,G(this,Pr,W1(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,_o),...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 le(this,dt,Et).call(this,{data:n,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),n}setState(e,t){le(this,dt,Et).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===Du||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||!jh(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||le(this,dt,Et).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 l=this.observers.find(d=>d.options.queryFn);l&&this.setOptions(l.options)}const s=new AbortController,i=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(G(this,Ln,!0),s.signal)})},a=()=>{const l=Wh(this.options,t),d={queryKey:this.queryKey,meta:this.meta};return i(d),G(this,Ln,!1),this.options.persister?this.options.persister(l,d,this):l(d)},u={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};i(u),(n=this.options.behavior)==null||n.onFetch(u,this),G(this,kr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((r=u.fetchOptions)==null?void 0:r.meta))&&le(this,dt,Et).call(this,{type:"fetch",meta:(o=u.fetchOptions)==null?void 0:o.meta});const c=l=>{var d,h,f,g;wi(l)&&l.silent||le(this,dt,Et).call(this,{type:"error",error:l}),wi(l)||((h=(d=P(this,et).config).onError)==null||h.call(d,l,this),(g=(f=P(this,et).config).onSettled)==null||g.call(f,this.state.data,l,this)),this.scheduleGc()};return G(this,Oe,Gh({initialPromise:t==null?void 0:t.initialPromise,fn:u.fetchFn,abort:s.abort.bind(s),onSuccess:l=>{var d,h,f,g;if(l===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(l)}catch(p){c(p);return}(h=(d=P(this,et).config).onSuccess)==null||h.call(d,l,this),(g=(f=P(this,et).config).onSettled)==null||g.call(f,l,this.state.error,this),this.scheduleGc()},onError:c,onFail:(l,d)=>{le(this,dt,Et).call(this,{type:"failed",failureCount:l,error:d})},onPause:()=>{le(this,dt,Et).call(this,{type:"pause"})},onContinue:()=>{le(this,dt,Et).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0})),P(this,Oe).start()}},Pr=new WeakMap,kr=new WeakMap,et=new WeakMap,Oe=new WeakMap,_o=new WeakMap,Ln=new WeakMap,dt=new WeakSet,Et=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,...Kh(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 wi(r)&&r.revert&&P(this,kr)?{...P(this,kr),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),Ie.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),P(this,et).notify({query:this,type:"updated",action:e})})},Cc);function Kh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Vh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function W1(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 St,Ec,V1=(Ec=class extends Io{constructor(e={}){super(),te(this,St),this.config=e,G(this,St,new Map)}build(e,t,n){const r=t.queryKey,o=t.queryHash??Nu(r,t);let s=this.get(o);return s||(s=new Q1({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){P(this,St).has(e.queryHash)||(P(this,St).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=P(this,St).get(e.queryHash);t&&(e.destroy(),t===e&&P(this,St).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ie.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return P(this,St).get(e)}getAll(){return[...P(this,St).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>gc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>gc(e,n)):t}notify(e){Ie.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ie.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ie.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},St=new WeakMap,Ec),Pt,Te,zn,kt,zt,Sc,H1=(Sc=class extends qh{constructor(e){super(),te(this,kt),te(this,Pt),te(this,Te),te(this,zn),this.mutationId=e.mutationId,G(this,Te,e.mutationCache),G(this,Pt,[]),this.state=e.state||G1(),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,Pt).includes(e)||(P(this,Pt).push(e),this.clearGcTimeout(),P(this,Te).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){G(this,Pt,P(this,Pt).filter(t=>t!==e)),this.scheduleGc(),P(this,Te).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){P(this,Pt).length||(this.state.status==="pending"?this.scheduleGc():P(this,Te).remove(this))}continue(){var e;return((e=P(this,zn))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var t,n,r,o,s,i,a,u,c,l,d,h,f,g,p,m,A,w,S,k;G(this,zn,Gh({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,D)=>{le(this,kt,zt).call(this,{type:"failed",failureCount:E,error:D})},onPause:()=>{le(this,kt,zt).call(this,{type:"pause"})},onContinue:()=>{le(this,kt,zt).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,Te).canRun(this)}));const y=this.state.status==="pending",x=!P(this,zn).canStart();try{if(!y){le(this,kt,zt).call(this,{type:"pending",variables:e,isPaused:x}),await((n=(t=P(this,Te).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&&le(this,kt,zt).call(this,{type:"pending",context:D,variables:e,isPaused:x})}const E=await P(this,zn).start();return await((i=(s=P(this,Te).config).onSuccess)==null?void 0:i.call(s,E,e,this.state.context,this)),await((u=(a=this.options).onSuccess)==null?void 0:u.call(a,E,e,this.state.context)),await((l=(c=P(this,Te).config).onSettled)==null?void 0:l.call(c,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)),le(this,kt,zt).call(this,{type:"success",data:E}),E}catch(E){try{throw await((g=(f=P(this,Te).config).onError)==null?void 0:g.call(f,E,e,this.state.context,this)),await((m=(p=this.options).onError)==null?void 0:m.call(p,E,e,this.state.context)),await((w=(A=P(this,Te).config).onSettled)==null?void 0:w.call(A,void 0,E,this.state.variables,this.state.context,this)),await((k=(S=this.options).onSettled)==null?void 0:k.call(S,void 0,E,e,this.state.context)),E}finally{le(this,kt,zt).call(this,{type:"error",error:E})}}finally{P(this,Te).runNext(this)}}},Pt=new WeakMap,Te=new WeakMap,zn=new WeakMap,kt=new WeakSet,zt=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),Ie.batch(()=>{P(this,Pt).forEach(n=>{n.onMutationUpdate(e)}),P(this,Te).notify({mutation:this,type:"updated",action:e})})},Sc);function G1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ye,Zo,Pc,q1=(Pc=class extends Io{constructor(e={}){super(),te(this,Ye),te(this,Zo),this.config=e,G(this,Ye,new Map),G(this,Zo,Date.now())}build(e,t,n){const r=new H1({mutationCache:this,mutationId:++Yi(this,Zo)._,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=Xo(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=Xo(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(Xo(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(Xo(e)))==null?void 0:t.find(r=>r!==e&&r.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Ie.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=>yc(t,n))}findAll(e={}){return this.getAll().filter(t=>yc(e,t))}notify(e){Ie.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ie.batch(()=>Promise.all(e.map(t=>t.continue().catch($e))))}},Ye=new WeakMap,Zo=new WeakMap,Pc);function Xo(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function kc(e){return{onFetch:(t,n)=>{var r,o,s,i,a;const u=t.options,c=(s=(o=(r=t.fetchOptions)==null?void 0:r.meta)==null?void 0:o.fetchMore)==null?void 0:s.direction,l=((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 g=async()=>{let p=!1;const m=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},A=Wh(t.options,t.fetchOptions),w=async(S,k,y)=>{if(p)return Promise.reject();if(k==null&&S.pages.length)return Promise.resolve(S);const x={queryKey:t.queryKey,pageParam:k,direction:y?"backward":"forward",meta:t.options.meta};m(x);const E=await A(x),{maxPages:D}=t.options,O=y?B1:T1;return{pages:O(S.pages,E,D),pageParams:O(S.pageParams,k,D)}};if(c&&l.length){const S=c==="backward",k=S?K1:Ic,y={pages:l,pageParams:d},x=k(u,y);h=await w(y,x,S)}else{const S=e??l.length;do{const k=f===0?d[0]??u.initialPageParam:Ic(u,h);if(f>0&&k==null)break;h=await w(h,k),f++}while(f<S)}return h};t.options.persister?t.fetchFn=()=>{var p,m;return(m=(p=t.options).persister)==null?void 0:m.call(p,g,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=g}}}function Ic(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 K1(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 xe,on,sn,Ir,Mr,an,Or,Nr,Mc,Y1=(Mc=class{constructor(e={}){te(this,xe),te(this,on),te(this,sn),te(this,Ir),te(this,Mr),te(this,an),te(this,Or),te(this,Nr),G(this,xe,e.queryCache||new V1),G(this,on,e.mutationCache||new q1),G(this,sn,e.defaultOptions||{}),G(this,Ir,new Map),G(this,Mr,new Map),G(this,an,0)}mount(){Yi(this,an)._++,P(this,an)===1&&(G(this,Or,Ru.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,xe).onFocus())})),G(this,Nr,ws.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,xe).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,xe).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,xe).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,xe).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,xe).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,xe).get(r.queryHash),s=o==null?void 0:o.state.data,i=R1(t,s);if(i!==void 0)return P(this,xe).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ie.batch(()=>P(this,xe).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,xe).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const t=P(this,xe);Ie.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,xe),r={type:"active",...e};return Ie.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ie.batch(()=>P(this,xe).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then($e).catch($e)}invalidateQueries(e,t={}){return Ie.batch(()=>{if(P(this,xe).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=Ie.batch(()=>P(this,xe).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,xe).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=kc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($e).catch($e)}ensureInfiniteQueryData(e){return e.behavior=kc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ws.isOnline()?P(this,on).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,xe)}getMutationCache(){return P(this,on)}getDefaultOptions(){return P(this,sn)}setDefaultOptions(e){G(this,sn,e)}setQueryDefaults(e,t){P(this,Ir).set(po(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,Ir).values()],n={};return t.forEach(r=>{mo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,Mr).set(po(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Mr).values()];let n={};return t.forEach(r=>{mo(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=Nu(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===Du&&(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,xe).clear(),P(this,on).clear()}},xe=new WeakMap,on=new WeakMap,sn=new WeakMap,Ir=new WeakMap,Mr=new WeakMap,an=new WeakMap,Or=new WeakMap,Nr=new WeakMap,Mc),Ve,ue,es,Be,Un,Dr,un,It,ts,Rr,Fr,jn,Qn,ln,Tr,Ce,Br,vi,Ai,xi,Ci,Ei,Si,Pi,Oc,Nc,$1=(Nc=class extends Io{constructor(e,t){super(),te(this,Ce),te(this,Ve),te(this,ue),te(this,es),te(this,Be),te(this,Un),te(this,Dr),te(this,un),te(this,It),te(this,ts),te(this,Rr),te(this,Fr),te(this,jn),te(this,Qn),te(this,ln),te(this,Tr,new Set),this.options=t,G(this,Ve,e),G(this,It,null),G(this,un,ka()),this.options.experimental_prefetchInRender||P(this,un).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,ue).addObserver(this),Dc(P(this,ue),this.options)?le(this,Ce,Br).call(this):this.updateResult(),le(this,Ce,Ci).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ia(P(this,ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ia(P(this,ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,le(this,Ce,Ei).call(this),le(this,Ce,Si).call(this),P(this,ue).removeObserver(this)}setOptions(e,t){const n=this.options,r=P(this,ue);if(this.options=P(this,Ve).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof tt(this.options.enabled,P(this,ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");le(this,Ce,Pi).call(this),P(this,ue).setOptions(this.options),n._defaulted&&!Ea(this.options,n)&&P(this,Ve).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,ue),observer:this});const o=this.hasListeners();o&&Rc(P(this,ue),r,this.options,n)&&le(this,Ce,Br).call(this),this.updateResult(t),o&&(P(this,ue)!==r||tt(this.options.enabled,P(this,ue))!==tt(n.enabled,P(this,ue))||er(this.options.staleTime,P(this,ue))!==er(n.staleTime,P(this,ue)))&&le(this,Ce,vi).call(this);const s=le(this,Ce,Ai).call(this);o&&(P(this,ue)!==r||tt(this.options.enabled,P(this,ue))!==tt(n.enabled,P(this,ue))||s!==P(this,ln))&&le(this,Ce,xi).call(this,s)}getOptimisticResult(e){const t=P(this,Ve).getQueryCache().build(P(this,Ve),e),n=this.createResult(t,e);return _1(this,n)&&(G(this,Be,n),G(this,Dr,this.options),G(this,Un,P(this,ue).state)),n}getCurrentResult(){return P(this,Be)}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,Tr).add(e)}getCurrentQuery(){return P(this,ue)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=P(this,Ve).defaultQueryOptions(e),n=P(this,Ve).getQueryCache().build(P(this,Ve),t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return le(this,Ce,Br).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Be)))}createResult(e,t){var n;const r=P(this,ue),o=this.options,s=P(this,Be),i=P(this,Un),a=P(this,Dr),u=e!==r?e.state:P(this,es),{state:c}=e;let l={...c},d=!1,h;if(t._optimisticResults){const x=this.hasListeners(),E=!x&&Dc(e,t),D=x&&Rc(e,r,t,o);(E||D)&&(l={...l,...Kh(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:f,errorUpdatedAt:g,status:p}=l;if(t.select&&l.data!==void 0)if(s&&l.data===(i==null?void 0:i.data)&&t.select===P(this,ts))h=P(this,Rr);else try{G(this,ts,t.select),h=t.select(l.data),h=Pa(s==null?void 0:s.data,h,t),G(this,Rr,h),G(this,It,null)}catch(x){G(this,It,x)}else h=l.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,Fr))==null?void 0:n.state.data,P(this,Fr)):t.placeholderData,t.select&&x!==void 0)try{x=t.select(x),G(this,It,null)}catch(E){G(this,It,E)}x!==void 0&&(p="success",h=Pa(s==null?void 0:s.data,x,t),d=!0)}P(this,It)&&(f=P(this,It),h=P(this,Rr),g=Date.now(),p="error");const m=l.fetchStatus==="fetching",A=p==="pending",w=p==="error",S=A&&m,k=h!==void 0,y={status:p,fetchStatus:l.fetchStatus,isPending:A,isSuccess:p==="success",isError:w,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>u.dataUpdateCount||l.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!A,isLoadingError:w&&!k,isPaused:l.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&k,isStale:Fu(e,t),refetch:this.refetch,promise:P(this,un)};if(this.options.experimental_prefetchInRender){const x=O=>{y.status==="error"?O.reject(y.error):y.data!==void 0&&O.resolve(y.data)},E=()=>{const O=G(this,un,y.promise=ka());x(O)},D=P(this,un);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,Be),n=this.createResult(P(this,ue),this.options);if(G(this,Un,P(this,ue).state),G(this,Dr,this.options),P(this,Un).data!==void 0&&G(this,Fr,P(this,ue)),Ea(n,t))return;G(this,Be,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,Tr).size)return!0;const a=new Set(i??P(this,Tr));return this.options.throwOnError&&a.add("error"),Object.keys(P(this,Be)).some(u=>{const c=u;return P(this,Be)[c]!==t[c]&&a.has(c)})};(e==null?void 0:e.listeners)!==!1&&o()&&(r.listeners=!0),le(this,Ce,Oc).call(this,{...r,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&le(this,Ce,Ci).call(this)}},Ve=new WeakMap,ue=new WeakMap,es=new WeakMap,Be=new WeakMap,Un=new WeakMap,Dr=new WeakMap,un=new WeakMap,It=new WeakMap,ts=new WeakMap,Rr=new WeakMap,Fr=new WeakMap,jn=new WeakMap,Qn=new WeakMap,ln=new WeakMap,Tr=new WeakMap,Ce=new WeakSet,Br=function(e){le(this,Ce,Pi).call(this);let t=P(this,ue).fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch($e)),t},vi=function(){le(this,Ce,Ei).call(this);const e=er(this.options.staleTime,P(this,ue));if(Sn||P(this,Be).isStale||!Ca(e))return;const t=jh(P(this,Be).dataUpdatedAt,e)+1;G(this,jn,setTimeout(()=>{P(this,Be).isStale||this.updateResult()},t))},Ai=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,ue)):this.options.refetchInterval)??!1},xi=function(e){le(this,Ce,Si).call(this),G(this,ln,e),!(Sn||tt(this.options.enabled,P(this,ue))===!1||!Ca(P(this,ln))||P(this,ln)===0)&&G(this,Qn,setInterval(()=>{(this.options.refetchIntervalInBackground||Ru.isFocused())&&le(this,Ce,Br).call(this)},P(this,ln)))},Ci=function(){le(this,Ce,vi).call(this),le(this,Ce,xi).call(this,le(this,Ce,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,Ve).getQueryCache().build(P(this,Ve),this.options);if(e===P(this,ue))return;const t=P(this,ue);G(this,ue,e),G(this,es,e.state),this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))},Oc=function(e){Ie.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(P(this,Be))}),P(this,Ve).getQueryCache().notify({query:P(this,ue),type:"observerResultsUpdated"})})},Nc);function J1(e,t){return tt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Dc(e,t){return J1(e,t)||e.state.data!==void 0&&Ia(e,t,t.refetchOnMount)}function Ia(e,t,n){if(tt(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Fu(e,t)}return!1}function Rc(e,t,n,r){return(e!==t||tt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Fu(e,n)}function Fu(e,t){return tt(t.enabled,e)!==!1&&e.isStaleByTime(er(t.staleTime,e))}function _1(e,t){return!Ea(e.getCurrentResult(),t)}function Z1(e){return JSON.stringify(e,(t,n)=>X1(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):typeof n=="bigint"?n.toString():n)}function X1(e){if(!Fc(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Fc(n)||!n.hasOwnProperty("isPrototypeOf"))}function Fc(e){return Object.prototype.toString.call(e)==="[object Object]"}function Yh(e){const{_defaulted:t,behavior:n,gcTime:r,initialData:o,initialDataUpdatedAt:s,maxPages:i,meta:a,networkMode:u,queryFn:c,queryHash:l,queryKey:d,queryKeyHashFn:h,retry:f,retryDelay:g,structuralSharing:p,getPreviousPageParam:m,getNextPageParam:A,initialPageParam:w,_optimisticResults:S,enabled:k,notifyOnChangeProps:y,placeholderData:x,refetchInterval:E,refetchIntervalInBackground:D,refetchOnMount:O,refetchOnReconnect:T,refetchOnWindowFocus:W,retryOnMount:I,select:F,staleTime:B,suspense:q,throwOnError:V,config:$,connector:Y,query:Z,...ae}=e;return ae}function eC(e,t={}){return{async queryFn({queryKey:n}){const{name:r,scopeKey:o,...s}=n[1];if(!r)throw new Error("name is required");return r1(e,{...s,name:r})},queryKey:tC(t)}}function tC(e={}){return["ensAvatar",Yh(e)]}function nC(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:o,...s}=n[1];if(!r)throw new Error("address is required");return o1(e,{...s,address:r})},queryKey:rC(t)}}function rC(e={}){return["ensName",Yh(e)]}var $h=b.createContext(void 0),oC=e=>{const t=b.useContext($h);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sC=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v($h.Provider,{value:e,children:t})),Jh=b.createContext(!1),iC=()=>b.useContext(Jh);Jh.Provider;function aC(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var uC=b.createContext(aC()),lC=()=>b.useContext(uC);function cC(e,t){return typeof e=="function"?e(...t):!!e}function Tc(){}var dC=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},fC=e=>{b.useEffect(()=>{e.clearReset()},[e])},hC=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&cC(n,[e.error,r]),pC=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},mC=(e,t)=>e.isLoading&&e.isFetching&&!t,gC=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Bc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function yC(e,t,n){var r,o,s,i,a;const u=oC(),c=iC(),l=lC(),d=u.defaultQueryOptions(e);(o=(r=u.getDefaultOptions().queries)==null?void 0:r._experimental_beforeQuery)==null||o.call(r,d),d._optimisticResults=c?"isRestoring":"optimistic",pC(d),dC(d,l),fC(l);const h=!u.getQueryCache().get(d.queryHash),[f]=b.useState(()=>new t(u,d)),g=f.getOptimisticResult(d);if(b.useSyncExternalStore(b.useCallback(p=>{const m=c?Tc:f.subscribe(Ie.batchCalls(p));return f.updateResult(),m},[f,c]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(d,{listeners:!1})},[d,f]),gC(d,g))throw Bc(d,f,l);if(hC({result:g,errorResetBoundary:l,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash)}))throw g.error;if((i=(s=u.getDefaultOptions().queries)==null?void 0:s._experimental_afterQuery)==null||i.call(s,d,g),d.experimental_prefetchInRender&&!Sn&&mC(g,c)){const p=h?Bc(d,f,l):(a=u.getQueryCache().get(d.queryHash))==null?void 0:a.promise;p==null||p.catch(Tc).finally(()=>{f.updateResult()})}return d.notifyOnChangeProps?g:f.trackResult(g)}function bC(e,t){return yC(e,$1)}function _h(e){const t=bC({...e,queryKeyHashFn:Z1});return t.queryKey=e.queryKey,t}function Zh(e={}){const t=Ou(e);return fg(n=>i1(t,{onChange:n}),()=>cc(t),()=>cc(t))}function wC(e={}){const{name:t,query:n={}}=e,r=Ou(e),o=Zh({config:r}),s=eC(r,{...e,chainId:e.chainId??o}),i=!!(t&&(n.enabled??!0));return _h({...n,...s,enabled:i})}function Xh(e={}){const{address:t,query:n={}}=e,r=Ou(e),o=Zh({config:r}),s=nC(r,{...e,chainId:e.chainId??o}),i=!!(t&&(n.enabled??!0));return _h({...n,...s,enabled:i})}var Mo=e=>e.type==="checkbox",mn=e=>e instanceof Date,De=e=>e==null;const ep=e=>typeof e=="object";var Ee=e=>!De(e)&&!Array.isArray(e)&&ep(e)&&!mn(e),tp=e=>Ee(e)&&e.target?Mo(e.target)?e.target.checked:e.target.value:e,vC=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,np=(e,t)=>e.has(vC(t)),AC=e=>{const t=e.constructor&&e.constructor.prototype;return Ee(t)&&t.hasOwnProperty("isPrototypeOf")},Tu=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Le(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(!(Tu&&(e instanceof Blob||r))&&(n||Ee(e)))if(t=n?[]:{},!n&&!AC(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Le(e[o]));else return e;return t}var js=e=>Array.isArray(e)?e.filter(Boolean):[],we=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 we(r)||r===e?we(e[t])?n:e[t]:r},He=e=>typeof e=="boolean",Bu=e=>/^\w*$/.test(e),rp=e=>js(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ce=(e,t,n)=>{let r=-1;const o=Bu(t)?[t]:rp(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let u=n;if(r!==i){const c=e[a];u=Ee(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}return e};const vs={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"},op=re.createContext(null),Qs=()=>re.useContext(op),xC=e=>{const{children:t,...n}=e;return re.createElement(op.Provider,{value:n},t)};var sp=(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},ze=e=>Ee(e)&&!Object.keys(e).length,ip=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return ze(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!r||rt.all))},Kr=e=>Array.isArray(e)?e:[e],ap=(e,t,n)=>!e||!t||e===t||Kr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Lu(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 CC(e){const t=Qs(),{control:n=t.control,disabled:r,name:o,exact:s}=e,[i,a]=re.useState(n._formState),u=re.useRef(!0),c=re.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),l=re.useRef(o);return l.current=o,Lu({disabled:r,next:d=>u.current&&ap(l.current,d.name,s)&&ip(d,c.current,n._updateFormState)&&a({...n._formState,...d}),subject:n._subjects.state}),re.useEffect(()=>(u.current=!0,c.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),re.useMemo(()=>sp(i,n,c.current,!1),[i,n])}var pt=e=>typeof e=="string",up=(e,t,n,r,o)=>pt(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 EC(e){const t=Qs(),{control:n=t.control,name:r,defaultValue:o,disabled:s,exact:i}=e,a=re.useRef(r);a.current=r,Lu({disabled:s,subject:n._subjects.values,next:l=>{ap(a.current,l.name,i)&&c(Le(up(a.current,n._names,l.values||n._formValues,!1,o)))}});const[u,c]=re.useState(n._getWatch(r,o));return re.useEffect(()=>n._removeUnmounted()),u}function SC(e){const t=Qs(),{name:n,disabled:r,control:o=t.control,shouldUnregister:s}=e,i=np(o._names.array,n),a=EC({control:o,name:n,defaultValue:U(o._formValues,n,U(o._defaultValues,n,e.defaultValue)),exact:!0}),u=CC({control:o,name:n,exact:!0}),c=re.useRef(o.register(n,{...e.rules,value:a,...He(e.disabled)?{disabled:e.disabled}:{}})),l=re.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!U(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!U(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!U(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!U(u.validatingFields,n)},error:{enumerable:!0,get:()=>U(u.errors,n)}}),[u,n]),d=re.useMemo(()=>({name:n,value:a,...He(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h=>c.current.onChange({target:{value:tp(h),name:n},type:vs.CHANGE}),onBlur:()=>c.current.onBlur({target:{value:U(o._formValues,n),name:n},type:vs.BLUR}),ref:h=>{const f=U(o._fields,n);f&&h&&(f._f.ref={focus:()=>h.focus(),select:()=>h.select(),setCustomValidity:g=>h.setCustomValidity(g),reportValidity:()=>h.reportValidity()})}}),[n,o._formValues,r,u.disabled,a,o._fields]);return re.useEffect(()=>{const h=o._options.shouldUnregister||s,f=(g,p)=>{const m=U(o._fields,g);m&&m._f&&(m._f.mount=p)};if(f(n,!0),h){const g=Le(U(o._options.defaultValues,n));ce(o._defaultValues,n,g),we(U(o._formValues,n))&&ce(o._formValues,n,g)}return()=>{(i?h&&!o._state.action:h)?o.unregister(n):f(n,!1)}},[n,o,i,s]),re.useEffect(()=>{He(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:u,fieldState:l}),[d,u,l])}const PC=e=>e.render(SC(e));var lp=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Lc=e=>({isOnSubmit:!e||e===rt.onSubmit,isOnBlur:e===rt.onBlur,isOnChange:e===rt.onChange,isOnAll:e===rt.all,isOnTouch:e===rt.onTouched}),zc=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Yr=(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(Yr(a,t))break}else if(Ee(a)&&Yr(a,t))break}}};var kC=(e,t,n)=>{const r=Kr(U(e,n));return ce(r,"root",t[n]),ce(e,n,r),e},zu=e=>e.type==="file",ht=e=>typeof e=="function",As=e=>{if(!Tu)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},as=e=>pt(e),Uu=e=>e.type==="radio",xs=e=>e instanceof RegExp;const Uc={value:!1,isValid:!1},jc={value:!0,isValid:!0};var cp=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&&!we(e[0].attributes.value)?we(e[0].value)||e[0].value===""?jc:{value:e[0].value,isValid:!0}:jc:Uc}return Uc};const Qc={isValid:!1,value:null};var dp=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Qc):Qc;function Wc(e,t,n="validate"){if(as(e)||Array.isArray(e)&&e.every(as)||He(e)&&!e)return{type:n,message:as(e)?e:"",ref:t}}var Wn=e=>Ee(e)&&!xs(e)?e:{value:e,message:""},Vc=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:u,minLength:c,min:l,max:d,pattern:h,validate:f,name:g,valueAsNumber:p,mount:m,disabled:A}=e._f,w=U(t,g);if(!m||A)return{};const S=i?i[0]:s,k=I=>{r&&S.reportValidity&&(S.setCustomValidity(He(I)?"":I||""),S.reportValidity())},y={},x=Uu(s),E=Mo(s),D=x||E,O=(p||zu(s))&&we(s.value)&&we(w)||As(s)&&s.value===""||w===""||Array.isArray(w)&&!w.length,T=lp.bind(null,g,n,y),W=(I,F,B,q=Mt.maxLength,V=Mt.minLength)=>{const $=I?F:B;y[g]={type:I?q:V,message:$,ref:s,...T(I?q:V,$)}};if(o?!Array.isArray(w)||!w.length:a&&(!D&&(O||De(w))||He(w)&&!w||E&&!cp(i).isValid||x&&!dp(i).isValid)){const{value:I,message:F}=as(a)?{value:!!a,message:a}:Wn(a);if(I&&(y[g]={type:Mt.required,message:F,ref:S,...T(Mt.required,F)},!n))return k(F),y}if(!O&&(!De(l)||!De(d))){let I,F;const B=Wn(d),q=Wn(l);if(!De(w)&&!isNaN(w)){const V=s.valueAsNumber||w&&+w;De(B.value)||(I=V>B.value),De(q.value)||(F=V<q.value)}else{const V=s.valueAsDate||new Date(w),$=ae=>new Date(new Date().toDateString()+" "+ae),Y=s.type=="time",Z=s.type=="week";pt(B.value)&&w&&(I=Y?$(w)>$(B.value):Z?w>B.value:V>new Date(B.value)),pt(q.value)&&w&&(F=Y?$(w)<$(q.value):Z?w<q.value:V<new Date(q.value))}if((I||F)&&(W(!!I,B.message,q.message,Mt.max,Mt.min),!n))return k(y[g].message),y}if((u||c)&&!O&&(pt(w)||o&&Array.isArray(w))){const I=Wn(u),F=Wn(c),B=!De(I.value)&&w.length>+I.value,q=!De(F.value)&&w.length<+F.value;if((B||q)&&(W(B,I.message,F.message),!n))return k(y[g].message),y}if(h&&!O&&pt(w)){const{value:I,message:F}=Wn(h);if(xs(I)&&!w.match(I)&&(y[g]={type:Mt.pattern,message:F,ref:s,...T(Mt.pattern,F)},!n))return k(F),y}if(f){if(ht(f)){const I=await f(w,t),F=Wc(I,S);if(F&&(y[g]={...F,...T(Mt.validate,F.message)},!n))return k(F.message),y}else if(Ee(f)){let I={};for(const F in f){if(!ze(I)&&!n)break;const B=Wc(await f[F](w,t),S,F);B&&(I={...B,...T(F,B.message)},k(B.message),n&&(y[g]=I))}if(!ze(I)&&(y[g]={ref:S,...I},!n))return y}}return k(!0),y};function IC(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=we(e)?r++:e[t[r++]];return e}function MC(e){for(const t in e)if(e.hasOwnProperty(t)&&!we(e[t]))return!1;return!0}function Se(e,t){const n=Array.isArray(t)?t:Bu(t)?[t]:rp(t),r=n.length===1?e:IC(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Ee(r)&&ze(r)||Array.isArray(r)&&MC(r))&&Se(e,n.slice(0,-1)),e}var ki=()=>{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=[]}}},Ma=e=>De(e)||!ep(e);function Qt(e,t){if(Ma(e)||Ma(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 fp=e=>e.type==="select-multiple",OC=e=>Uu(e)||Mo(e),Ii=e=>As(e)&&e.isConnected,hp=e=>{for(const t in e)if(ht(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])&&!hp(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Cs(e[r],t[r])):De(e[r])||(t[r]=!0);return t}function pp(e,t,n){const r=Array.isArray(e);if(Ee(e)||r)for(const o in e)Array.isArray(e[o])||Ee(e[o])&&!hp(e[o])?we(t)||Ma(n[o])?n[o]=Array.isArray(e[o])?Cs(e[o],[]):{...Cs(e[o])}:pp(e[o],De(t)?{}:t[o],n[o]):n[o]=!Qt(e[o],t[o]);return n}var Lr=(e,t)=>pp(e,t,Cs(t)),mp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>we(e)?e:t?e===""?NaN:e&&+e:n&&pt(e)?new Date(e):r?r(e):e;function Mi(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return zu(t)?t.files:Uu(t)?dp(e.refs).value:fp(t)?[...t.selectedOptions].map(({value:n})=>n):Mo(t)?cp(e.refs).value:mp(we(t.value)?e.ref.value:t.value,e)}var NC=(e,t,n,r)=>{const o={};for(const s of e){const i=U(t,s);i&&ce(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},zr=e=>we(e)?e:xs(e)?e.source:Ee(e)?xs(e.value)?e.value.source:e.value:e;const Hc="AsyncFunction";var DC=e=>!!e&&!!e.validate&&!!(ht(e.validate)&&e.validate.constructor.name===Hc||Ee(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Hc)),RC=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Gc(e,t,n){const r=U(e,n);if(r||Bu(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 FC=(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 BC={mode:rt.onSubmit,reValidateMode:rt.onChange,shouldFocusError:!0};function LC(e={}){let t={...BC,...e},n={submitCount:0,isDirty:!1,isLoading:ht(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)?Le(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Le(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const l={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:ki(),array:ki(),state:ki()},h=Lc(t.mode),f=Lc(t.reValidateMode),g=t.criteriaMode===rt.all,p=C=>M=>{clearTimeout(c),c=setTimeout(C,M)},m=async C=>{if(!t.disabled&&(l.isValid||C)){const M=t.resolver?ze((await D()).errors):await T(r,!0);M!==n.isValid&&d.state.next({isValid:M})}},A=(C,M)=>{!t.disabled&&(l.isValidating||l.validatingFields)&&((C||Array.from(a.mount)).forEach(N=>{N&&(M?ce(n.validatingFields,N,M):Se(n.validatingFields,N))}),d.state.next({validatingFields:n.validatingFields,isValidating:!ze(n.validatingFields)}))},w=(C,M=[],N,j,z=!0,L=!0)=>{if(j&&N&&!t.disabled){if(i.action=!0,L&&Array.isArray(U(r,C))){const _=N(U(r,C),j.argA,j.argB);z&&ce(r,C,_)}if(L&&Array.isArray(U(n.errors,C))){const _=N(U(n.errors,C),j.argA,j.argB);z&&ce(n.errors,C,_),TC(n.errors,C)}if(l.touchedFields&&L&&Array.isArray(U(n.touchedFields,C))){const _=N(U(n.touchedFields,C),j.argA,j.argB);z&&ce(n.touchedFields,C,_)}l.dirtyFields&&(n.dirtyFields=Lr(o,s)),d.state.next({name:C,isDirty:I(C,M),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ce(s,C,M)},S=(C,M)=>{ce(n.errors,C,M),d.state.next({errors:n.errors})},k=C=>{n.errors=C,d.state.next({errors:n.errors,isValid:!1})},y=(C,M,N,j)=>{const z=U(r,C);if(z){const L=U(s,C,we(N)?U(o,C):N);we(L)||j&&j.defaultChecked||M?ce(s,C,M?L:Mi(z._f)):q(C,L),i.mount&&m()}},x=(C,M,N,j,z)=>{let L=!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){l.isDirty&&(_=n.isDirty,n.isDirty=oe.isDirty=I(),L=_!==oe.isDirty);const ke=Pe||Qt(U(o,C),M);_=!!(!Pe&&U(n.dirtyFields,C)),ke||Pe?Se(n.dirtyFields,C):ce(n.dirtyFields,C,!0),oe.dirtyFields=n.dirtyFields,L=L||l.dirtyFields&&_!==!ke}if(N){const ke=U(n.touchedFields,C);ke||(ce(n.touchedFields,C,N),oe.touchedFields=n.touchedFields,L=L||l.touchedFields&&ke!==N)}L&&z&&d.state.next(oe)}return L?oe:{}},E=(C,M,N,j)=>{const z=U(n.errors,C),L=l.isValid&&He(M)&&n.isValid!==M;if(t.delayError&&N?(u=p(()=>S(C,N)),u(t.delayError)):(clearTimeout(c),u=null,N?ce(n.errors,C,N):Se(n.errors,C)),(N?!Qt(z,N):z)||!ze(j)||L){const _={...j,...L&&He(M)?{isValid:M}:{},errors:n.errors,name:C};n={...n,..._},d.state.next(_)}},D=async C=>{A(C,!0);const M=await t.resolver(s,t.context,NC(C||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return A(C),M},O=async C=>{const{errors:M}=await D(C);if(C)for(const N of C){const j=U(M,N);j?ce(n.errors,N,j):Se(n.errors,N)}else n.errors=M;return M},T=async(C,M,N={valid:!0})=>{for(const j in C){const z=C[j];if(z){const{_f:L,..._}=z;if(L){const oe=a.array.has(L.name),Pe=z._f&&DC(z._f);Pe&&l.validatingFields&&A([j],!0);const ke=await Vc(z,s,g,t.shouldUseNativeValidation&&!M,oe);if(Pe&&l.validatingFields&&A([j]),ke[L.name]&&(N.valid=!1,M))break;!M&&(U(ke,L.name)?oe?kC(n.errors,ke,L.name):ce(n.errors,L.name,ke[L.name]):Se(n.errors,L.name))}!ze(_)&&await T(_,M,N)}}return N.valid},W=()=>{for(const C of a.unMount){const M=U(r,C);M&&(M._f.refs?M._f.refs.every(N=>!Ii(N)):!Ii(M._f.ref))&&se(C)}a.unMount=new Set},I=(C,M)=>!t.disabled&&(C&&M&&ce(s,C,M),!Qt(de(),o)),F=(C,M,N)=>up(C,a,{...i.mount?s:we(M)?o:pt(C)?{[C]:M}:M},N,M),B=C=>js(U(i.mount?s:o,C,t.shouldUnregister?U(o,C,[]):[])),q=(C,M,N={})=>{const j=U(r,C);let z=M;if(j){const L=j._f;L&&(!L.disabled&&ce(s,C,mp(M,L)),z=As(L.ref)&&De(M)?"":M,fp(L.ref)?[...L.ref.options].forEach(_=>_.selected=z.includes(_.value)):L.refs?Mo(L.ref)?L.refs.length>1?L.refs.forEach(_=>(!_.defaultChecked||!_.disabled)&&(_.checked=Array.isArray(z)?!!z.find(oe=>oe===_.value):z===_.value)):L.refs[0]&&(L.refs[0].checked=!!z):L.refs.forEach(_=>_.checked=_.value===z):zu(L.ref)?L.ref.value="":(L.ref.value=z,L.ref.type||d.values.next({name:C,values:{...s}})))}(N.shouldDirty||N.shouldTouch)&&x(C,z,N.shouldTouch,N.shouldDirty,!0),N.shouldValidate&&ae(C)},V=(C,M,N)=>{for(const j in M){const z=M[j],L=`${C}.${j}`,_=U(r,L);(a.array.has(C)||Ee(z)||_&&!_._f)&&!mn(z)?V(L,z,N):q(L,z,N)}},$=(C,M,N={})=>{const j=U(r,C),z=a.array.has(C),L=Le(M);ce(s,C,L),z?(d.array.next({name:C,values:{...s}}),(l.isDirty||l.dirtyFields)&&N.shouldDirty&&d.state.next({name:C,dirtyFields:Lr(o,s),isDirty:I(C,L)})):j&&!j._f&&!De(L)?V(C,L,N):q(C,L,N),zc(C,a)&&d.state.next({...n}),d.values.next({name:i.mount?C:void 0,values:{...s}})},Y=async C=>{i.mount=!0;const M=C.target;let N=M.name,j=!0;const z=U(r,N),L=()=>M.type?Mi(z._f):tp(C),_=oe=>{j=Number.isNaN(oe)||mn(oe)&&isNaN(oe.getTime())||Qt(oe,U(s,N,oe))};if(z){let oe,Pe;const ke=L(),en=C.type===vs.BLUR||C.type===vs.FOCUS_OUT,$m=!RC(z._f)&&!t.resolver&&!U(n.errors,N)&&!z._f.deps||FC(en,U(n.touchedFields,N),n.isSubmitted,f,h),Ks=zc(N,a,en);ce(s,N,ke),en?(z._f.onBlur&&z._f.onBlur(C),u&&u(0)):z._f.onChange&&z._f.onChange(C);const Ys=x(N,ke,en,!1),Jm=!ze(Ys)||Ks;if(!en&&d.values.next({name:N,type:C.type,values:{...s}}),$m)return l.isValid&&(t.mode==="onBlur"?en&&m():m()),Jm&&d.state.next({name:N,...Ks?{}:Ys});if(!en&&Ks&&d.state.next({...n}),t.resolver){const{errors:al}=await D([N]);if(_(ke),j){const _m=Gc(n.errors,r,N),ul=Gc(al,r,_m.name||N);oe=ul.error,N=ul.name,Pe=ze(al)}}else A([N],!0),oe=(await Vc(z,s,g,t.shouldUseNativeValidation))[N],A([N]),_(ke),j&&(oe?Pe=!1:l.isValid&&(Pe=await T(r,!0)));j&&(z._f.deps&&ae(z._f.deps),E(N,Pe,oe,Ys))}},Z=(C,M)=>{if(U(n.errors,M)&&C.focus)return C.focus(),1},ae=async(C,M={})=>{let N,j;const z=Kr(C);if(t.resolver){const L=await O(we(C)?C:z);N=ze(L),j=C?!z.some(_=>U(L,_)):N}else C?(j=(await Promise.all(z.map(async L=>{const _=U(r,L);return await T(_&&_._f?{[L]:_}:_)}))).every(Boolean),!(!j&&!n.isValid)&&m()):j=N=await T(r);return d.state.next({...!pt(C)||l.isValid&&N!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:N}:{},errors:n.errors}),M.shouldFocus&&!j&&Yr(r,Z,C?z:a.mount),j},de=C=>{const M={...i.mount?s:o};return we(C)?M:pt(C)?U(M,C):C.map(N=>U(M,N))},R=(C,M)=>({invalid:!!U((M||n).errors,C),isDirty:!!U((M||n).dirtyFields,C),error:U((M||n).errors,C),isValidating:!!U(n.validatingFields,C),isTouched:!!U((M||n).touchedFields,C)}),H=C=>{C&&Kr(C).forEach(M=>Se(n.errors,M)),d.state.next({errors:C?n.errors:{}})},X=(C,M,N)=>{const j=(U(r,C,{_f:{}})._f||{}).ref,z=U(n.errors,C)||{},{ref:L,message:_,type:oe,...Pe}=z;ce(n.errors,C,{...Pe,...M,ref:j}),d.state.next({name:C,errors:n.errors,isValid:!1}),N&&N.shouldFocus&&j&&j.focus&&j.focus()},K=(C,M)=>ht(C)?d.values.subscribe({next:N=>C(F(void 0,M),N)}):F(C,M,!0),se=(C,M={})=>{for(const N of C?Kr(C):a.mount)a.mount.delete(N),a.array.delete(N),M.keepValue||(Se(r,N),Se(s,N)),!M.keepError&&Se(n.errors,N),!M.keepDirty&&Se(n.dirtyFields,N),!M.keepTouched&&Se(n.touchedFields,N),!M.keepIsValidating&&Se(n.validatingFields,N),!t.shouldUnregister&&!M.keepDefaultValue&&Se(o,N);d.values.next({values:{...s}}),d.state.next({...n,...M.keepDirty?{isDirty:I()}:{}}),!M.keepIsValid&&m()},J=({disabled:C,name:M,field:N,fields:j,value:z})=>{if(He(C)&&i.mount||C){const L=C?void 0:we(z)?Mi(N?N._f:U(j,M)._f):z;(C||!C&&!we(L))&&ce(s,M,L),x(M,L,!1,!1,!0)}},fe=(C,M={})=>{let N=U(r,C);const j=He(M.disabled)||He(t.disabled);return ce(r,C,{...N||{},_f:{...N&&N._f?N._f:{ref:{name:C}},name:C,mount:!0,...M}}),a.mount.add(C),N?J({field:N,disabled:He(M.disabled)?M.disabled:t.disabled,name:C,value:M.value}):y(C,!0,M.value),{...j?{disabled:M.disabled||t.disabled}:{},...t.progressive?{required:!!M.required,min:zr(M.min),max:zr(M.max),minLength:zr(M.minLength),maxLength:zr(M.maxLength),pattern:zr(M.pattern)}:{},name:C,onChange:Y,onBlur:Y,ref:z=>{if(z){fe(C,M),N=U(r,C);const L=we(z.value)&&z.querySelectorAll&&z.querySelectorAll("input,select,textarea")[0]||z,_=OC(L),oe=N._f.refs||[];if(_?oe.find(Pe=>Pe===L):L===N._f.ref)return;ce(r,C,{_f:{...N._f,..._?{refs:[...oe.filter(Ii),L,...Array.isArray(U(o,C))?[{}]:[]],ref:{type:L.type,name:C}}:{ref:L}}}),y(C,!1,void 0,L)}else N=U(r,C,{}),N._f&&(N._f.mount=!1),(t.shouldUnregister||M.shouldUnregister)&&!(np(a.array,C)&&i.action)&&a.unMount.add(C)}}},Ae=()=>t.shouldFocusError&&Yr(r,Z,a.mount),Ze=C=>{He(C)&&(d.state.next({disabled:C}),Yr(r,(M,N)=>{const j=U(r,N);j&&(M.disabled=j._f.disabled||C,Array.isArray(j._f.refs)&&j._f.refs.forEach(z=>{z.disabled=j._f.disabled||C}))},0,!1))},Ro=(C,M)=>async N=>{let j;if(N&&(N.preventDefault&&N.preventDefault(),N.persist&&N.persist()),t.disabled){M&&await M({...n.errors},N);return}let z=Le(s);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:_}=await D();n.errors=L,z=_}else await T(r);if(Se(n.errors,"root"),ze(n.errors)){d.state.next({errors:{}});try{await C(z,N)}catch(L){j=L}}else M&&await M({...n.errors},N),Ae(),setTimeout(Ae);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ze(n.errors)&&!j,submitCount:n.submitCount+1,errors:n.errors}),j)throw j},qs=(C,M={})=>{U(r,C)&&(we(M.defaultValue)?$(C,Le(U(o,C))):($(C,M.defaultValue),ce(o,C,Le(M.defaultValue))),M.keepTouched||Se(n.touchedFields,C),M.keepDirty||(Se(n.dirtyFields,C),n.isDirty=M.defaultValue?I(C,Le(U(o,C))):I()),M.keepError||(Se(n.errors,C),l.isValid&&m()),d.state.next({...n}))},Ft=(C,M={})=>{const N=C?Le(C):o,j=Le(N),z=ze(C),L=z?o:j;if(M.keepDefaultValues||(o=N),!M.keepValues){if(M.keepDirtyValues){const _=new Set([...a.mount,...Object.keys(Lr(o,s))]);for(const oe of Array.from(_))U(n.dirtyFields,oe)?ce(L,oe,U(s,oe)):$(oe,U(L,oe))}else{if(Tu&&we(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 ke=Pe.closest("form");if(ke){ke.reset();break}}}}r={}}s=t.shouldUnregister?M.keepDefaultValues?Le(o):{}:Le(L),d.array.next({values:{...L}}),d.values.next({values:{...L}})}a={mount:M.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!l.isValid||!!M.keepIsValid||!!M.keepDirtyValues,i.watch=!!t.shouldUnregister,d.state.next({submitCount:M.keepSubmitCount?n.submitCount:0,isDirty:z?!1:M.keepDirty?n.isDirty:!!(M.keepDefaultValues&&!Qt(C,o)),isSubmitted:M.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:z?{}:M.keepDirtyValues?M.keepDefaultValues&&s?Lr(o,s):n.dirtyFields:M.keepDefaultValues&&C?Lr(o,C):M.keepDirty?n.dirtyFields:{},touchedFields:M.keepTouched?n.touchedFields:{},errors:M.keepErrors?n.errors:{},isSubmitSuccessful:M.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Fo=(C,M)=>Ft(ht(C)?C(s):C,M);return{control:{register:fe,unregister:se,getFieldState:R,handleSubmit:Ro,setError:X,_executeSchema:D,_getWatch:F,_getDirty:I,_updateValid:m,_removeUnmounted:W,_updateFieldArray:w,_updateDisabledField:J,_getFieldArray:B,_reset:Ft,_resetDefaultValues:()=>ht(t.defaultValues)&&t.defaultValues().then(C=>{Fo(C,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:Ze,_subjects:d,_proxyFormState:l,_setErrors:k,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:Ro,watch:K,setValue:$,getValues:de,reset:Fo,resetField:qs,clearErrors:H,unregister:se,setError:X,setFocus:(C,M={})=>{const N=U(r,C),j=N&&N._f;if(j){const z=j.refs?j.refs[0]:j.ref;z.focus&&(z.focus(),M.shouldSelect&&ht(z.select)&&z.select())}},getFieldState:R}}function gp(e={}){const t=re.useRef(void 0),n=re.useRef(void 0),[r,o]=re.useState({isDirty:!1,isValidating:!1,isLoading:ht(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ht(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...LC(e),formState:r});const s=t.current.control;return s._options=e,Lu({subject:s._subjects.state,next:i=>{ip(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=sp(r,s),t.current}var ju="Dialog",[yp,OI]=Za(ju),[zC,lt]=yp(ju),bp=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=b.useRef(null),u=b.useRef(null),[c=!1,l]=lf({prop:r,defaultProp:o,onChange:s});return v(zC,{scope:t,triggerRef:a,contentRef:u,contentId:gt(),titleId:gt(),descriptionId:gt(),open:c,onOpenChange:l,onOpenToggle:b.useCallback(()=>l(d=>!d),[l]),modal:i,children:n})};bp.displayName=ju;var wp="DialogTrigger",UC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lt(wp,n),s=ut(t,o.triggerRef);return v(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Vu(o.open),...r,ref:s,onClick:Ke(e.onClick,o.onOpenToggle)})});UC.displayName=wp;var Qu="DialogPortal",[jC,vp]=yp(Qu,{forceMount:void 0}),Ap=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=lt(Qu,t);return v(jC,{scope:t,forceMount:n,children:b.Children.map(r,i=>v(hr,{present:n||s.open,children:v(ru,{asChild:!0,container:o,children:i})}))})};Ap.displayName=Qu;var Es="DialogOverlay",xp=b.forwardRef((e,t)=>{const n=vp(Es,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=lt(Es,e.__scopeDialog);return s.modal?v(hr,{present:r||s.open,children:v(QC,{...o,ref:t})}):null});xp.displayName=Es;var QC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lt(Es,n);return v(ou,{as:Po,allowPinchZoom:!0,shards:[o.contentRef],children:v(ve.div,{"data-state":Vu(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",Cp=b.forwardRef((e,t)=>{const n=vp(Pn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=lt(Pn,e.__scopeDialog);return v(hr,{present:r||s.open,children:s.modal?v(WC,{...o,ref:t}):v(VC,{...o,ref:t})})});Cp.displayName=Pn;var WC=b.forwardRef((e,t)=>{const n=lt(Pn,e.__scopeDialog),r=b.useRef(null),o=ut(t,n.contentRef,r);return b.useEffect(()=>{const s=r.current;if(s)return If(s)},[]),v(Ep,{...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())})}),VC=b.forwardRef((e,t)=>{const n=lt(Pn,e.__scopeDialog),r=b.useRef(!1),o=b.useRef(!1);return v(Ep,{...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 u=s.target;(a=n.triggerRef.current)!=null&&a.contains(u)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Ep=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=lt(Pn,n),u=b.useRef(null),c=ut(t,u);return ff(),ee(st,{children:[v(eu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:v(Xa,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Vu(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),ee(st,{children:[v(HC,{titleId:a.titleId}),v(qC,{contentRef:u,descriptionId:a.descriptionId})]})]})}),Wu="DialogTitle",Sp=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lt(Wu,n);return v(ve.h2,{id:o.titleId,...r,ref:t})});Sp.displayName=Wu;var Pp="DialogDescription",kp=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lt(Pp,n);return v(ve.p,{id:o.descriptionId,...r,ref:t})});kp.displayName=Pp;var Ip="DialogClose",Mp=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lt(Ip,n);return v(ve.button,{type:"button",...r,ref:t,onClick:Ke(e.onClick,()=>o.onOpenChange(!1))})});Mp.displayName=Ip;function Vu(e){return e?"open":"closed"}var Op="DialogTitleWarning",[NI,Np]=Yb(Op,{contentName:Pn,titleName:Wu,docsSlug:"dialog"}),HC=({titleId:e})=>{const t=Np(Op),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},GC="DialogDescriptionWarning",qC=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Np(GC).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},KC=bp,Dp=Ap,Hu=xp,Gu=Cp,Rp=Sp,Fp=kp,YC=Mp;const Tp=6048e5,$C=864e5,qc=Symbol.for("constructDateFrom");function _t(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&qc in e?e[qc](t):e instanceof Date?new e.constructor(t):new Date(t)}function ct(e,t){return _t(t||e,e)}let JC={};function Oo(){return JC}function go(e,t){var n,r,o,s;const i=Oo(),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,u=ct(e,t==null?void 0:t.in),c=u.getDay(),l=(c<a?7:0)+c-a;return u.setDate(u.getDate()-l),u.setHours(0,0,0,0),u}function Ss(e,t){return go(e,{...t,weekStartsOn:1})}function Bp(e,t){const n=ct(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 Kc(e){const t=ct(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 Yc(e,t){const n=ct(e,void 0);return n.setHours(0,0,0,0),n}function ZC(e,t,n){const[r,o]=_C(void 0,e,t),s=Yc(r),i=Yc(o),a=+s-Kc(s),u=+i-Kc(i);return Math.round((a-u)/$C)}function XC(e,t){const n=Bp(e),r=_t(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ss(r)}function eE(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function tE(e){return!(!eE(e)&&typeof e!="number"||isNaN(+ct(e)))}function nE(e,t){const n=ct(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const rE={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"}},oE=(e,t,n)=>{let r;const o=rE[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 sE={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},iE={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},aE={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uE={date:Oi({formats:sE,defaultWidth:"full"}),time:Oi({formats:iE,defaultWidth:"full"}),dateTime:Oi({formats:aE,defaultWidth:"full"})},lE={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},cE=(e,t,n,r)=>lE[e];function Ur(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 dE={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},fE={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},hE={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"]},pE={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"]},mE={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"}},gE={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"}},yE=(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"},bE={ordinalNumber:yE,era:Ur({values:dE,defaultWidth:"wide"}),quarter:Ur({values:fE,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ur({values:hE,defaultWidth:"wide"}),day:Ur({values:pE,defaultWidth:"wide"}),dayPeriod:Ur({values:mE,defaultWidth:"wide",formattingValues:gE,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],u=Array.isArray(a)?vE(a,d=>d.test(i)):wE(a,d=>d.test(i));let c;c=e.valueCallback?e.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;const l=t.slice(i.length);return{value:c,rest:l}}}function wE(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function vE(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function AE(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 xE=/^(\d+)(th|st|nd|rd)?/i,CE=/\d+/i,EE={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},SE={any:[/^b/i,/^(a|c)/i]},PE={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},kE={any:[/1/i,/2/i,/3/i,/4/i]},IE={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]},OE={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},NE={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]},DE={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},RE={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}},FE={ordinalNumber:AE({matchPattern:xE,parsePattern:CE,valueCallback:e=>parseInt(e,10)}),era:jr({matchPatterns:EE,defaultMatchWidth:"wide",parsePatterns:SE,defaultParseWidth:"any"}),quarter:jr({matchPatterns:PE,defaultMatchWidth:"wide",parsePatterns:kE,defaultParseWidth:"any",valueCallback:e=>e+1}),month:jr({matchPatterns:IE,defaultMatchWidth:"wide",parsePatterns:ME,defaultParseWidth:"any"}),day:jr({matchPatterns:OE,defaultMatchWidth:"wide",parsePatterns:NE,defaultParseWidth:"any"}),dayPeriod:jr({matchPatterns:DE,defaultMatchWidth:"any",parsePatterns:RE,defaultParseWidth:"any"})},TE={code:"en-US",formatDistance:oE,formatLong:uE,formatRelative:cE,localize:bE,match:FE,options:{weekStartsOn:0,firstWeekContainsDate:1}};function BE(e,t){const n=ct(e,void 0);return ZC(n,nE(n))+1}function LE(e,t){const n=ct(e,void 0),r=+Ss(n)-+XC(n);return Math.round(r/Tp)+1}function Lp(e,t){var n,r,o,s;const i=ct(e,t==null?void 0:t.in),a=i.getFullYear(),u=Oo(),c=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??u.firstWeekContainsDate??((s=(o=u.locale)==null?void 0:o.options)==null?void 0:s.firstWeekContainsDate)??1,l=_t((t==null?void 0:t.in)||e,0);l.setFullYear(a+1,0,c),l.setHours(0,0,0,0);const d=go(l,t),h=_t((t==null?void 0:t.in)||e,0);h.setFullYear(a,0,c),h.setHours(0,0,0,0);const f=go(h,t);return+i>=+d?a+1:+i>=+f?a:a-1}function zE(e,t){var n,r,o,s;const i=Oo(),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,u=Lp(e,t),c=_t((t==null?void 0:t.in)||e,0);return c.setFullYear(u,0,a),c.setHours(0,0,0,0),go(c,t)}function UE(e,t){const n=ct(e,t==null?void 0:t.in),r=+go(n,t)-+zE(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 Ut={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)}},Vn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},$c={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 Ut.y(e,t)},Y:function(e,t,n,r){const o=Lp(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=Bp(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 Ut.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=UE(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):he(o,t.length)},I:function(e,t,n){const r=LE(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"}):Ut.d(e,t)},D:function(e,t,n){const r=BE(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=Vn.noon:r===0?o=Vn.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=Vn.evening:r>=12?o=Vn.afternoon:r>=4?o=Vn.morning:o=Vn.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 Ut.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ut.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"}):Ut.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ut.s(e,t)},S:function(e,t){return Ut.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return _c(r);case"XXXX":case"XX":return cn(r);case"XXXXX":case"XXX":default:return cn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return _c(r);case"xxxx":case"xx":return cn(r);case"xxxxx":case"xxx":default:return cn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Jc(r,":");case"OOOO":default:return"GMT"+cn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Jc(r,":");case"zzzz":default:return"GMT"+cn(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 Jc(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 _c(e,t){return e%60===0?(e>0?"-":"+")+he(Math.abs(e)/60,2):cn(e,t)}function cn(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 Zc=(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"})}},zp=(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"})}},jE=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Zc(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}}",Zc(r,t)).replace("{{time}}",zp(o,t))},QE={p:zp,P:jE},WE=/^D+$/,VE=/^Y+$/,HE=["D","DD","YY","YYYY"];function GE(e){return WE.test(e)}function qE(e){return VE.test(e)}function KE(e,t,n){const r=YE(e,t,n);if(console.warn(r),HE.includes(e))throw new RangeError(r)}function YE(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 $E=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,JE=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_E=/^'([^]*?)'?$/,ZE=/''/g,XE=/[a-zA-Z]/;function eS(e,t,n){var r,o,s,i,a,u,c,l;const d=Oo(),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,g=(n==null?void 0:n.weekStartsOn)??((u=(a=n==null?void 0:n.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)??d.weekStartsOn??((l=(c=d.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??0,p=ct(e,n==null?void 0:n.in);if(!tE(p))throw new RangeError("Invalid time value");let m=t.match(JE).map(w=>{const S=w[0];if(S==="p"||S==="P"){const k=QE[S];return k(w,h.formatLong)}return w}).join("").match($E).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const S=w[0];if(S==="'")return{isToken:!1,value:tS(w)};if($c[S])return{isToken:!0,value:w};if(S.match(XE))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:w}});h.localize.preprocessor&&(m=h.localize.preprocessor(p,m));const A={firstWeekContainsDate:f,weekStartsOn:g,locale:h};return m.map(w=>{if(!w.isToken)return w.value;const S=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&qE(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&GE(S))&&KE(S,t,String(e));const k=$c[S[0]];return k(p,S,h.localize,A)}).join("")}function tS(e){const t=e.match(_E);return t?t[1].replace(ZE,"'"):e}function nS(){return Object.assign({},Oo())}function rS(e){return`${e.slice(0,7)}...${e.slice(-5)}`}function Up(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=Up(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Up(e))&&(r&&(r+=" "),r+=t);return r}const Xc=$x({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}}}),oS=S1({chains:[Xc],transports:{[Xc.id]:n1()}}),sS=new Y1;function iS(e){const{children:t,wagmiProviderProps:n,queryClientProviderProps:r}=e,{config:o=oS,...s}=n??{},{client:i=sS,...a}=r??{};return v(I1,{config:o,...s,children:v(sC,{client:i,...a,children:t})})}function ed(e,t,n){const r=nS(),o=lS(e,n.timeZone,n.locale??r.locale);return"formatToParts"in o?aS(o,t):uS(o,t)}function aS(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 uS(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}function lS(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function cS(e,t){const n=mS(t);return"formatToParts"in n?fS(n,e):hS(n,e)}const dS={year:0,month:1,day:2,hour:3,minute:4,second:5};function fS(e,t){try{const n=e.formatToParts(t),r=[];for(let o=0;o<n.length;o++){const s=dS[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 hS(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={},td=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")),pS=td==="06/25/2014, 00:00:00"||td==="06/25/2014 00:00:00";function mS(e){return Ni[e]||(Ni[e]=pS?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 Qp(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 nd=36e5,gS=6e4,Di={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function qu(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),rd(o)?-(o*nd):NaN;if(r=Di.timezoneHHMM.exec(e),r){o=parseInt(r[2],10);const i=parseInt(r[3],10);return rd(o,i)?(s=Math.abs(o)*nd+i*gS,r[1]==="+"?-s:s):NaN}if(wS(e)){t=new Date(t||Date.now());const i=n?t:yS(t),a=Oa(i,e);return-(n?a:bS(t,a,e))}return NaN}function yS(e){return Qp(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Oa(e,t){const n=cS(e,t),r=Qp(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 bS(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 rd(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const od={};function wS(e){if(od[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),od[e]=!0,!0}catch{return!1}}const vS=60*1e3,AS={X:function(e,t,n){const r=Ri(n.timeZone,e);if(r===0)return"Z";switch(t){case"X":return sd(r);case"XXXX":case"XX":return qn(r);case"XXXXX":case"XXX":default:return qn(r,":")}},x:function(e,t,n){const r=Ri(n.timeZone,e);switch(t){case"x":return sd(r);case"xxxx":case"xx":return qn(r);case"xxxxx":case"xxx":default:return qn(r,":")}},O:function(e,t,n){const r=Ri(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+xS(r,":");case"OOOO":default:return"GMT"+qn(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return ed("short",e,n);case"zzzz":default:return ed("long",e,n)}}};function Ri(e,t){const n=e?qu(e,t,!0)/vS:(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 sd(e,t){return e%60===0?(e>0?"-":"+")+Ps(Math.abs(e)/60,2):qn(e,t)}function xS(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 id(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 CS=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Fi=36e5,ad=6e4,ES=2,Re={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:CS};function Wp(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?ES: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=SS(e),{year:o,restDateString:s}=PS(r.date,n),i=kS(s,o);if(i===null||isNaN(i.getTime()))return new Date(NaN);if(i){const a=i.getTime();let u=0,c;if(r.time&&(u=IS(r.time),u===null||isNaN(u)))return new Date(NaN);if(r.timeZone||t.timeZone){if(c=qu(r.timeZone||t.timeZone,new Date(a+u)),isNaN(c))return new Date(NaN)}else c=id(new Date(a+u)),c=id(new Date(a+u+c));return new Date(a+u+c)}else return new Date(NaN)}function SS(e){const t={};let n=Re.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=Re.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const o=Re.timeZone.exec(r);o?(t.time=r.replace(o[1],""),t.timeZone=o[1].trim()):t.time=r}return t}function PS(e,t){if(e){const n=Re.YYY[t],r=Re.YYYYY[t];let o=Re.YYYY.exec(e)||r.exec(e);if(o){const s=o[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(o=Re.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 kS(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=Re.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=Re.DDD.exec(e),s){n=new Date(0);const i=parseInt(s[1],10);return NS(t,i)?(n.setUTCFullYear(t,0,i),n):new Date(NaN)}if(s=Re.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=Re.Www.exec(e),s)return o=parseInt(s[1],10)-1,cd(o)?ud(t,o):new Date(NaN);if(s=Re.WwwD.exec(e),s){o=parseInt(s[1],10)-1;const i=parseInt(s[2],10)-1;return cd(o,i)?ud(t,o,i):new Date(NaN)}return null}function IS(e){let t,n,r=Re.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),Ti(t)?t%24*Fi:NaN;if(r=Re.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),Ti(t,n)?t%24*Fi+n*ad:NaN;if(r=Re.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const o=parseFloat(r[3].replace(",","."));return Ti(t,n,o)?t%24*Fi+n*ad+o*1e3:NaN}return null}function ud(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],OS=[31,29,31,30,31,30,31,31,30,31,30,31];function Vp(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=Vp(e);if(r&&n>OS[t]||!r&&n>MS[t])return!1}return!0}function NS(e,t){if(t<1)return!1;const n=Vp(e);return!(n&&t>366||!n&&t>365)}function cd(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Ti(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const DS=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function RS(e,t,n={}){t=String(t);const r=t.match(DS);if(r){const o=Wp(n.originalDate||e,n);t=r.reduce(function(s,i){if(i[0]==="'")return s;const a=s.indexOf(i),u=s[a-1]==="'",c=s.replace(i,"'"+AS[i[0]](o,i,n)+"'");return u?c.substring(0,a-1)+c.substring(a+1):c},t)}return eS(e,t,n)}function FS(e,t,n){e=Wp(e,n);const r=qu(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},RS(FS(e,t,{timeZone:r.timeZone}),n,r)}const Ot={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 Hp(e){const t=new CustomEvent(Ot.CREATE_ISSUE,{detail:{notionIds:e}});window.dispatchEvent(t)}function BS(e,t){const n=new CustomEvent(Ot.ADD_NOTION_ID_TO_ISSUE,{detail:{notionId:e,phid:t}});window.dispatchEvent(n)}function LS(e,t){const n=new CustomEvent(Ot.REMOVE_NOTION_ID_FROM_ISSUE,{detail:{notionId:e,phid:t}});window.dispatchEvent(n)}function Gp(e,t){const n=[];for(const r of e){const o=t.includes(r.slugSuffix),s=Gp(r.subDocuments,t);o?n.push({...r,subDocuments:s}):s.length>0&&n.push(...s)}return n}function zS(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 Zd(jp(e))}function US(){const e=ge(()=>{console.log("login")},[]);return v("div",{children:v("button",{onClick:()=>e(),children:"Login"})})}var dd=1,jS=.9,QS=.8,WS=.17,Bi=.1,Li=.999,VS=.9999,HS=.99,GS=/[\\\/_+.#"@\[\(\{&]/,qS=/[\\\/_+.#"@\[\(\{&]/g,KS=/[\s-]/,qp=/[\s-]/g;function Na(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?dd:HS;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var u=r.charAt(s),c=n.indexOf(u,o),l=0,d,h,f,g;c>=0;)d=Na(e,t,n,r,c+1,s+1,i),d>l&&(c===o?d*=dd:GS.test(e.charAt(c-1))?(d*=QS,f=e.slice(o,c-1).match(qS),f&&o>0&&(d*=Math.pow(Li,f.length))):KS.test(e.charAt(c-1))?(d*=jS,g=e.slice(o,c-1).match(qp),g&&o>0&&(d*=Math.pow(Li,g.length))):(d*=WS,o>0&&(d*=Math.pow(Li,c-o))),e.charAt(c)!==t.charAt(s)&&(d*=VS)),(d<Bi&&n.charAt(c-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(c-1)!==r.charAt(s))&&(h=Na(e,t,n,r,c+1,s+2,i),h*Bi>d&&(d=h*Bi)),d>l&&(l=d),c=n.indexOf(u,c+1);return i[a]=l,l}function fd(e){return e.toLowerCase().replace(qp," ")}function YS(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Na(e,t,fd(e),fd(t),0,0,{})}var hd={exports:{}},zi={};/**
|
|
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 pd;function $S(){if(pd)return zi;pd=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(),g=r({inst:{value:f,getSnapshot:h}}),p=g[0].inst,m=g[1];return s(function(){p.value=f,p.getSnapshot=h,u(p)&&m({inst:p})},[d,f,h]),o(function(){return u(p)&&m({inst:p}),d(function(){u(p)&&m({inst:p})})},[d]),i(f),f}function u(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function c(d,h){return h()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return zi.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,zi}var md;function JS(){return md||(md=1,hd.exports=$S()),hd.exports}var _S=JS(),Qr='[cmdk-group=""]',Ui='[cmdk-group-items=""]',ZS='[cmdk-group-heading=""]',Ku='[cmdk-item=""]',gd=`${Ku}:not([aria-disabled="true"])`,Da="cmdk-item-select",hn="data-value",XS=(e,t,n)=>YS(e,t,n),Kp=b.createContext(void 0),No=()=>b.useContext(Kp),Yp=b.createContext(void 0),Yu=()=>b.useContext(Yp),$p=b.createContext(void 0),Jp=b.forwardRef((e,t)=>{let n=Kn(()=>{var R,H;return{search:"",value:(H=(R=e.value)!=null?R: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:u,children:c,value:l,onValueChange:d,filter:h,shouldFilter:f,loop:g,disablePointerSelection:p=!1,vimBindings:m=!0,...A}=e,w=gt(),S=gt(),k=gt(),y=b.useRef(null),x=cP();kn(()=>{if(l!==void 0){let R=l.trim();n.current.value=R,E.emit()}},[l]),kn(()=>{x(6,F)},[]);let E=b.useMemo(()=>({subscribe:R=>(i.current.add(R),()=>i.current.delete(R)),snapshot:()=>n.current,setState:(R,H,X)=>{var K,se,J;if(!Object.is(n.current[R],H)){if(n.current[R]=H,R==="search")I(),T(),x(1,W);else if(R==="value"&&(X||x(5,F),((K=a.current)==null?void 0:K.value)!==void 0)){let fe=H??"";(J=(se=a.current).onValueChange)==null||J.call(se,fe);return}E.emit()}},emit:()=>{i.current.forEach(R=>R())}}),[]),D=b.useMemo(()=>({value:(R,H,X)=>{var K;H!==((K=s.current.get(R))==null?void 0:K.value)&&(s.current.set(R,{value:H,keywords:X}),n.current.filtered.items.set(R,O(H,X)),x(2,()=>{T(),E.emit()}))},item:(R,H)=>(r.current.add(R),H&&(o.current.has(H)?o.current.get(H).add(R):o.current.set(H,new Set([R]))),x(3,()=>{I(),T(),n.current.value||W(),E.emit()}),()=>{s.current.delete(R),r.current.delete(R),n.current.filtered.items.delete(R);let X=B();x(4,()=>{I(),(X==null?void 0:X.getAttribute("id"))===R&&W(),E.emit()})}),group:R=>(o.current.has(R)||o.current.set(R,new Set),()=>{s.current.delete(R),o.current.delete(R)}),filter:()=>a.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:k,labelId:S,listInnerRef:y}),[]);function O(R,H){var X,K;let se=(K=(X=a.current)==null?void 0:X.filter)!=null?K:XS;return R?se(R,n.current.search,H):0}function T(){if(!n.current.search||a.current.shouldFilter===!1)return;let R=n.current.filtered.items,H=[];n.current.filtered.groups.forEach(K=>{let se=o.current.get(K),J=0;se.forEach(fe=>{let Ae=R.get(fe);J=Math.max(Ae,J)}),H.push([K,J])});let X=y.current;q().sort((K,se)=>{var J,fe;let Ae=K.getAttribute("id"),Ze=se.getAttribute("id");return((J=R.get(Ze))!=null?J:0)-((fe=R.get(Ae))!=null?fe:0)}).forEach(K=>{let se=K.closest(Ui);se?se.appendChild(K.parentElement===se?K:K.closest(`${Ui} > *`)):X.appendChild(K.parentElement===X?K:K.closest(`${Ui} > *`))}),H.sort((K,se)=>se[1]-K[1]).forEach(K=>{var se;let J=(se=y.current)==null?void 0:se.querySelector(`${Qr}[${hn}="${encodeURIComponent(K[0])}"]`);J==null||J.parentElement.appendChild(J)})}function W(){let R=q().find(X=>X.getAttribute("aria-disabled")!=="true"),H=R==null?void 0:R.getAttribute(hn);E.setState("value",H||void 0)}function I(){var R,H,X,K;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=(R=s.current.get(J))==null?void 0:R.value)!=null?H:"",Ae=(K=(X=s.current.get(J))==null?void 0:X.keywords)!=null?K:[],Ze=O(fe,Ae);n.current.filtered.items.set(J,Ze),Ze>0&&se++}for(let[J,fe]of o.current)for(let Ae of fe)if(n.current.filtered.items.get(Ae)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=se}function F(){var R,H,X;let K=B();K&&(((R=K.parentElement)==null?void 0:R.firstChild)===K&&((X=(H=K.closest(Qr))==null?void 0:H.querySelector(ZS))==null||X.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function B(){var R;return(R=y.current)==null?void 0:R.querySelector(`${Ku}[aria-selected="true"]`)}function q(){var R;return Array.from(((R=y.current)==null?void 0:R.querySelectorAll(gd))||[])}function V(R){let H=q()[R];H&&E.setState("value",H.getAttribute(hn))}function $(R){var H;let X=B(),K=q(),se=K.findIndex(fe=>fe===X),J=K[se+R];(H=a.current)!=null&&H.loop&&(J=se+R<0?K[K.length-1]:se+R===K.length?K[0]:K[se+R]),J&&E.setState("value",J.getAttribute(hn))}function Y(R){let H=B(),X=H==null?void 0:H.closest(Qr),K;for(;X&&!K;)X=R>0?uP(X,Qr):lP(X,Qr),K=X==null?void 0:X.querySelector(gd);K?E.setState("value",K.getAttribute(hn)):$(R)}let Z=()=>V(q().length-1),ae=R=>{R.preventDefault(),R.metaKey?Z():R.altKey?Y(1):$(1)},de=R=>{R.preventDefault(),R.metaKey?V(0):R.altKey?Y(-1):$(-1)};return b.createElement(ve.div,{ref:t,tabIndex:-1,...A,"cmdk-root":"",onKeyDown:R=>{var H;if((H=A.onKeyDown)==null||H.call(A,R),!R.defaultPrevented)switch(R.key){case"n":case"j":{m&&R.ctrlKey&&ae(R);break}case"ArrowDown":{ae(R);break}case"p":case"k":{m&&R.ctrlKey&&de(R);break}case"ArrowUp":{de(R);break}case"Home":{R.preventDefault(),V(0);break}case"End":{R.preventDefault(),Z();break}case"Enter":if(!R.nativeEvent.isComposing&&R.keyCode!==229){R.preventDefault();let X=B();if(X){let K=new Event(Da);X.dispatchEvent(K)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:fP},u),Ws(e,R=>b.createElement(Yp.Provider,{value:E},b.createElement(Kp.Provider,{value:D},R))))}),eP=b.forwardRef((e,t)=>{var n,r;let o=gt(),s=b.useRef(null),i=b.useContext($p),a=No(),u=_p(e),c=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;kn(()=>{if(!c)return a.item(o,i==null?void 0:i.id)},[c]);let l=Zp(o,s,[e.value,e.children,s],e.keywords),d=Yu(),h=In(x=>x.value&&x.value===l.current),f=In(x=>c||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,g),()=>x.removeEventListener(Da,g)},[f,e.onSelect,e.disabled]);function g(){var x,E;p(),(E=(x=u.current).onSelect)==null||E.call(x,l.current)}function p(){d.setState("value",l.current,!0)}if(!f)return null;let{disabled:m,value:A,onSelect:w,forceMount:S,keywords:k,...y}=e;return b.createElement(ve.div,{ref:yo([s,t]),...y,id:o,"cmdk-item":"",role:"option","aria-disabled":!!m,"aria-selected":!!h,"data-disabled":!!m,"data-selected":!!h,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:g},e.children)}),tP=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=gt(),a=b.useRef(null),u=b.useRef(null),c=gt(),l=No(),d=In(f=>o||l.filter()===!1?!0:f.search?f.filtered.groups.has(i):!0);kn(()=>l.group(i),[]),Zp(i,a,[e.value,e.heading,u]);let h=b.useMemo(()=>({id:i,forceMount:o}),[o]);return b.createElement(ve.div,{ref:yo([a,t]),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&b.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Ws(e,f=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},b.createElement($p.Provider,{value:h},f))))}),nP=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=b.useRef(null),s=In(i=>!i.search);return!n&&!s?null:b.createElement(ve.div,{ref:yo([o,t]),...r,"cmdk-separator":"",role:"separator"})}),rP=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=Yu(),i=In(l=>l.search),a=In(l=>l.value),u=No(),c=b.useMemo(()=>{var l;let d=(l=u.listInnerRef.current)==null?void 0:l.querySelector(`${Ku}[${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":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":c,id:u.inputId,type:"text",value:o?e.value:i,onChange:l=>{o||s.setState("search",l.target.value),n==null||n(l.target.value)}})}),oP=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=b.useRef(null),i=b.useRef(null),a=No();return b.useEffect(()=>{if(i.current&&s.current){let u=i.current,c=s.current,l,d=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let h=u.offsetHeight;c.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return d.observe(u),()=>{cancelAnimationFrame(l),d.unobserve(u)}}},[]),b.createElement(ve.div,{ref:yo([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},Ws(e,u=>b.createElement("div",{ref:yo([i,a.listInnerRef]),"cmdk-list-sizer":""},u)))}),sP=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=e;return b.createElement(KC,{open:n,onOpenChange:r},b.createElement(Dp,{container:i},b.createElement(Hu,{"cmdk-overlay":"",className:o}),b.createElement(Gu,{"aria-label":e.label,"cmdk-dialog":"",className:s},b.createElement(Jp,{ref:t,...a}))))}),iP=b.forwardRef((e,t)=>In(n=>n.filtered.count===0)?b.createElement(ve.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),aP=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(Jp,{List:oP,Item:eP,Input:rP,Group:tP,Separator:nP,Dialog:sP,Empty:iP,Loading:aP});function uP(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function lP(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 kn(()=>{t.current=e}),t}var kn=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Kn(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function yo(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function In(e){let t=Yu(),n=()=>e(t.snapshot());return _S.useSyncExternalStore(t.subscribe,n,n)}function Zp(e,t,n,r=[]){let o=b.useRef(),s=No();return kn(()=>{var i;let a=(()=>{var c;for(let l of n){if(typeof l=="string")return l.trim();if(typeof l=="object"&&"current"in l)return l.current?(c=l.current.textContent)==null?void 0:c.trim():o.current}})(),u=r.map(c=>c.trim());s.value(e,a,u),(i=t.current)==null||i.setAttribute(hn,a),o.current=a}),o}var cP=()=>{let[e,t]=b.useState(),n=Kn(()=>new Map);return kn(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function dP(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(dP(t),{ref:t.ref},n(t.props.children)):n(t)}var fP={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const hP=Dp,Xp=je(({className:e,...t},n)=>v(Hu,{className:be("fixed inset-0 z-50 bg-black/80",e),ref:n,...t}));Xp.displayName=Hu.displayName;const pP=je(({className:e,children:t,...n},r)=>ee(hP,{children:[v(Xp,{}),ee(Gu,{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,ee(YC,{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",v("span",{className:"sr-only",children:"Close"})]})]})]}));pP.displayName=Gu.displayName;const mP=je(({className:e,...t},n)=>v(Rp,{className:be("text-lg font-semibold leading-none tracking-tight",e),ref:n,...t}));mP.displayName=Rp.displayName;const gP=je(({className:e,...t},n)=>v(Fp,{className:be("text-muted-foreground text-sm",e),ref:n,...t}));gP.displayName=Fp.displayName;const bo=je(({className:e,...t},n)=>v(We,{className:be("flex size-full flex-col overflow-hidden rounded-md bg-white text-gray-900",e),ref:n,...t}));bo.displayName=We.displayName;const em=je(({className:e,...t},n)=>v("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:v(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})}));em.displayName=We.Input.displayName;const wo=je(({className:e,...t},n)=>v(We.List,{className:be("max-h-[300px] overflow-y-auto overflow-x-hidden",e),ref:n,...t}));wo.displayName=We.List.displayName;const tm=je((e,t)=>v(We.Empty,{className:"py-6 text-center text-sm",ref:t,...e}));tm.displayName=We.Empty.displayName;const vo=je(({className:e,...t},n)=>v(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 yP=je(({className:e,...t},n)=>v(We.Separator,{className:be("-mx-1 h-px bg-gray-200",e),ref:n,...t}));yP.displayName=We.Separator.displayName;const ot=je(({className:e,...t},n)=>v(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}));ot.displayName=We.Item.displayName;var $u="Popover",[nm,DI]=Za($u,[yf]),Do=yf(),[bP,Xt]=nm($u),rm=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=Do(t),u=b.useRef(null),[c,l]=b.useState(!1),[d=!1,h]=lf({prop:r,defaultProp:o,onChange:s});return v(zw,{...a,children:v(bP,{scope:t,contentId:gt(),triggerRef:u,open:d,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(f=>!f),[h]),hasCustomAnchor:c,onCustomAnchorAdd:b.useCallback(()=>l(!0),[]),onCustomAnchorRemove:b.useCallback(()=>l(!1),[]),modal:i,children:n})})};rm.displayName=$u;var om="PopoverAnchor",wP=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xt(om,n),s=Do(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return b.useEffect(()=>(i(),()=>a()),[i,a]),v(Pf,{...s,...r,ref:t})});wP.displayName=om;var sm="PopoverTrigger",im=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xt(sm,n),s=Do(n),i=ut(t,o.triggerRef),a=v(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":dm(o.open),...r,ref:i,onClick:Ke(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:v(Pf,{asChild:!0,...s,children:a})});im.displayName=sm;var Ju="PopoverPortal",[vP,AP]=nm(Ju,{forceMount:void 0}),am=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Xt(Ju,t);return v(vP,{scope:t,forceMount:n,children:v(hr,{present:n||s.open,children:v(ru,{asChild:!0,container:o,children:r})})})};am.displayName=Ju;var ar="PopoverContent",um=b.forwardRef((e,t)=>{const n=AP(ar,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Xt(ar,e.__scopePopover);return v(hr,{present:r||s.open,children:s.modal?v(xP,{...o,ref:t}):v(CP,{...o,ref:t})})});um.displayName=ar;var xP=b.forwardRef((e,t)=>{const n=Xt(ar,e.__scopePopover),r=b.useRef(null),o=ut(t,r),s=b.useRef(!1);return b.useEffect(()=>{const i=r.current;if(i)return If(i)},[]),v(ou,{as:Po,allowPinchZoom:!0,children:v(lm,{...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,u=a.button===0&&a.ctrlKey===!0,c=a.button===2||u;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ke(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),CP=b.forwardRef((e,t)=>{const n=Xt(ar,e.__scopePopover),r=b.useRef(!1),o=b.useRef(!1);return v(lm,{...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 u=s.target;(a=n.triggerRef.current)!=null&&a.contains(u)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),lm=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:l,...d}=e,h=Xt(ar,n),f=Do(n);return ff(),v(eu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:v(Xa,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:l,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:v(Uw,{"data-state":dm(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)"}})})})}),cm="PopoverClose",EP=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xt(cm,n);return v(ve.button,{type:"button",...r,ref:t,onClick:Ke(e.onClick,()=>o.onOpenChange(!1))})});EP.displayName=cm;var SP="PopoverArrow",PP=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Do(n);return v(jw,{...o,...r,ref:t})});PP.displayName=SP;function dm(e){return e?"open":"closed"}var kP=rm,IP=im,MP=am,fm=um;const _u=kP,Zu=IP,Vs=je(({className:e,align:t="center",sideOffset:n=4,...r},o)=>v(MP,{children:v(fm,{align:t,className:be("rounded-md border bg-white p-4 text-gray-900 outline-none",e),ref:o,sideOffset:n,...r})}));Vs.displayName=fm.displayName;function Xu(e){const{issueId:t,notionId:n,commentId:r}=e,o=window.location.href,[,s]=sb(),i=ge(a=>{s(a).catch(u=>{console.error("Failed to copy!",u)})},[s]);return ge(()=>{const a=new URL(o),u=new URLSearchParams(window.location.search);t&&u.set("issueId",t),n&&u.set("notionId",n),r&&u.set("commentId",r),a.search=u.toString(),i(a.toString())},[t,n,r,o,i])}function OP(e){const{viewNode:t,issues:n,issue:r}=e,[o,s]=Fe(!1),[i,a]=Fe(!1),u=n.filter(m=>m.phid!==(r==null?void 0:r.phid)),c=u.length>0,l=(r?r.comments.filter(m=>m.notionId===t.slugSuffix):n.flatMap(m=>m.comments).filter(m=>m.notionId===t.slugSuffix)).length??0,d=l>0,h=Xu({issueId:r==null?void 0:r.phid,notionId:t.slugSuffix}),f=v("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:v("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"})}),g=v(bo,{children:v(wo,{children:ee(vo,{children:[v(ot,{onSelect:()=>{a(!1),s(!1),Hp([t.slugSuffix])},value:"create-new-issue",children:"Create new issue"}),c?v(ot,{onSelect:()=>{a(!0)},value:"add-to-existing-issue",children:"Add to existing issue"},"add-to-existing-issue"):null,!!r&&ee(st,{children:[v(ot,{onSelect:()=>{LS(t.slugSuffix,r.phid),a(!1),s(!1)},value:"remove-from-issue",children:"Remove from issue"},"remove-from-issue"),v(ot,{onSelect:()=>{h(),s(!1)},children:"Copy link"},"copy-link")]})]})})}),p=ee(bo,{children:[v(em,{placeholder:"Search issue..."}),ee(wo,{children:[v(tm,{children:"No issue found."}),v(vo,{children:u.map((m,A)=>ee(ot,{onSelect:w=>{BS(t.slugSuffix,w),s(!1)},value:m.phid,children:["Issue #",A+1]},m.phid))})]})]});return ee(_u,{onOpenChange:m=>{s(m),m||a(!1)},open:o,children:[v(Zu,{asChild:!0,children:v("button",{"aria-expanded":o,className:be("text-gray-400 hover:text-gray-900 transition",!d&&"opacity-0 group-hover:opacity-100"),onClick:m=>m.stopPropagation(),role:"combobox",children:ee("span",{className:"flex items-center gap-1",children:[v("span",{className:"w-4",children:f}),d?v("span",{children:l}):null]})})}),v(Vs,{className:"p-0",onClick:m=>{m.stopPropagation()},children:i?p:g})]})}function hm(e){const{open:t,className:n,...r}=e;return v("svg",{...r,className:Zd("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:v("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 pm(e){const{viewNode:t,issue:n,tempIsDisplay:r=!1,level:o=0,selectedNotionId:s,handleNodeClick:i}=e,[a,u]=Fe(!!s&&(s===t.slugSuffix||t.descendantSlugSuffixes.includes(s))),c=t.subDocuments.length>0,l=t.type==="category"?t.title.title:zS(t),d=ge(f=>{f.stopPropagation(),u(g=>!g),!r&&i(t,n)},[r,t,n,i]),h=v("svg",{className:"flex-none",height:"16",viewBox:"0 0 16 16",width:"16",xmlns:"http://www.w3.org/2000/svg",children:v("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 ee("div",{className:"mb-3",style:{marginLeft:`${(o??0)*8}px`},children:[ee("li",{className:"flex gap-2 items-start group cursor-pointer",onClick:d,children:[ee("div",{className:"flex items-center gap-2 h-6",children:[v(hm,{className:c?"visible":"invisible",open:a}),h]}),v("span",{className:be("font-normal text-sm text-gray-700",s===t.slugSuffix?"font-medium":""),children:l}),v("div",{className:"flex items-center h-6",children:v(OP,{...e})})]}),a?ee(st,{children:[r?v("p",{children:t.content.map(f=>f.text.map(g=>g.text).join("")).join("")}):null,t.subDocuments.map(f=>Jr(pm,{...e,key:f.slugSuffix,level:o+1,viewNode:f}))]}):null]})}function NP(e){const{scopes:t}=e;return v("ul",{children:t.map(n=>v(pm,{...e,viewNode:n},n.slugSuffix))})}const mm=je(function(e,t){const{className:n,open:r,onClick:o,...s}=e,i=v("svg",{fill:"none",height:"15",viewBox:"0 0 15 15",width:"15",xmlns:"http://www.w3.org/2000/svg",children:v("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 v("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 DP(e){const[t,n]=Fe(!1),{issue:r,handleDeleteIssue:o}=e,s=Xu({issueId:r.phid});return ee(_u,{onOpenChange:n,open:t,children:[v(Zu,{asChild:!0,children:v(mm,{open:t})}),v(Vs,{className:"p-0",onClick:i=>{i.stopPropagation()},children:v(bo,{children:v(wo,{children:ee(vo,{children:[v(ot,{onSelect:()=>{s(),n(!1)},children:"Copy link"}),v(ot,{onSelect:()=>{o({phid:r.phid}),n(!1)},children:"Delete issue"})]})})})})]})}function RP(e){const{issue:t,state:n,issueNumber:r,scopes:o,handleDeleteIssue:s,selectedIssuePhid:i,selectedNotionId:a,handleIssueClick:u,handleNodeClick:c}=e,l=i===t.phid,d=qr(()=>Gp(o,t.notionIds),[o,t.notionIds]);return ee("li",{children:[ee("button",{className:"flex items-center justify-between cursor-pointer text-gray-800 text-sm mb-3 group w-full",onClick:()=>{u(t)},children:[ee("div",{className:"flex items-center gap-3",children:[v(hm,{className:"ml-1",open:l}),ee("span",{className:"font-medium",children:["Issue #",r]})]}),v(DP,{handleDeleteIssue:s,issue:t})]}),l?v("div",{className:"pl-2",children:v(NP,{handleNodeClick:c,issue:t,issues:n.issues,scopes:d,selectedNotionId:a})}):null]})}function FP(e){const{issues:t,scopes:n,selectedIssuePhid:r,handleDeleteIssue:o,handleIssueClick:s,handleNodeClick:i,selectedNotionId:a,state:u}=e;return v("ul",{children:t.map((c,l)=>v(RP,{handleDeleteIssue:o,handleIssueClick:s,handleNodeClick:i,issue:c,issueNumber:l+1,scopes:n,selectedIssuePhid:r,selectedNotionId:a,state:u},c.phid))})}const yd=(e,t,n)=>{if(e&&"reportValidity"in e){const r=U(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},gm=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?yd(r.ref,n,e):r.refs&&r.refs.forEach(o=>yd(o,n,e))}},TP=(e,t)=>{t.shouldUseNativeValidation&&gm(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(BP(t.names||Object.keys(e),r)){const i=Object.assign({},U(n,r));ce(i,"root",s),ce(n,r,i)}else ce(n,r,s)}return n},BP=(e,t)=>e.some(n=>n.startsWith(t+"."));var LP=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(l){return l.errors.forEach(function(d){return e.push(d)})}),t){var u=n[i].types,c=u&&u[r.code];n[i]=lp(i,t,n,o,c?[].concat(c,r.message):r.message)}e.shift()}return n},ym=function(e,t,n){return n===void 0&&(n={}),function(r,o,s){try{return Promise.resolve(function(i,a){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return s.shouldUseNativeValidation&&gm({},s),{errors:{},values:n.raw?r:c}})}catch(c){return a(c)}return u&&u.then?u.then(void 0,a):u}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:TP(LP(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}}};const el=je(({className:e,...t},n)=>{const r=nr(null),o=ge(i=>{i.style.height="auto";const a=Math.max(i.scrollHeight,i.offsetHeight);i.style.height=`${a}px`},[]),s=ge(i=>{o(i.currentTarget)},[o]);return b.useEffect(()=>{r.current&&o(r.current)},[o]),cg(n,()=>({focus:()=>{var i;return(i=r.current)==null?void 0:i.focus()},element:r.current})),v("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})});el.displayName="Textarea";const bm=re.createContext({}),wm=re.createContext({});var zP="Label",vm=b.forwardRef((e,t)=>v(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())}}));vm.displayName=zP;var Am=vm;const UP=jp,jP=(e,t)=>n=>UP(e,n==null?void 0:n.class,n==null?void 0:n.className),QP=jP("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xm=b.forwardRef(({className:e,...t},n)=>v(Am,{className:be(QP(),e),ref:n,...t}));xm.displayName=Am.displayName;const Hs=()=>{const e=re.useContext(bm),t=re.useContext(wm),{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}},Cm=xC,Em=({...e})=>v(bm.Provider,{value:{name:e.name},children:v(PC,{...e})}),tl=re.forwardRef(({className:e,...t},n)=>{const r=re.useId();return v(wm.Provider,{value:{id:r},children:v("div",{className:be("",e),ref:n,...t})})});tl.displayName="FormItem";const WP=re.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=Hs();return v(xm,{className:be(r&&"text-destructive",e),htmlFor:o,ref:n,...t})});WP.displayName="FormLabel";const nl=re.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:s}=Hs();return v(Po,{"aria-describedby":n?`${o} ${s}`:o,"aria-invalid":!!n,id:r,ref:t,...e})});nl.displayName="FormControl";const VP=re.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Hs();return v("p",{className:be("text-[0.8rem] text-gray-600",e),id:r,ref:n,...t})});VP.displayName="FormDescription";const rl=re.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:s}=Hs(),i=o?String(o.message):t;return i?v("p",{className:be("text-[0.8rem] font-medium text-red-800",e),id:s,ref:r,...n,children:i}):null});rl.displayName="FormMessage";function HP(e){const{issue:t,notionId:n,state:r,handleCreateComment:o}=e,s=mg(r),i={content:"",notionId:n,issuePhid:t.phid,phid:Nd.hashKey()},a=gp({resolver:ym(s),defaultValues:i}),u=ge(l=>{o({...l,createdAt:new Date().toISOString()})},[o]),c=ge(l=>{l.key==="Escape"&&(l.preventDefault(),l.currentTarget.blur()),l.key==="Enter"&&!l.shiftKey&&(l.preventDefault(),a.handleSubmit(u)())},[a,u]);return Ue(()=>{a.formState.isSubmitSuccessful&&a.reset(i)},[a.formState.isSubmitSuccessful,a.reset,i]),v(Cm,{...a,children:ee("form",{className:"bg-white p-3 rounded-md",onSubmit:a.handleSubmit(u),children:[v(Em,{control:a.control,name:"content",render:({field:l})=>ee(tl,{children:[v(nl,{children:v(el,{...l,className:"placeholder:text-gray-600 placeholder:text-sm text-sm",onKeyDown:c,placeholder:"Add comment",rows:1})}),v(rl,{})]})}),v("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 GP(e){const{issue:t,comment:n,state:r,isEditing:o,onSubmitEditComment:s,handleDeleteComment:i,onCancel:a}=e,u=gg(r),c={content:n.content,notionId:n.notionId,issuePhid:t.phid,phid:n.phid},l=gp({resolver:ym(u),defaultValues:c}),d=ge(g=>{s({...g,editedAt:new Date().toISOString()})},[s]),h=ge(g=>{g.key==="Escape"&&(g.preventDefault(),l.reset(c),g.currentTarget.blur(),a()),g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),l.handleSubmit(d)())},[l,d,a,c]),f=ge(()=>{l.reset(c),a()},[l,c,a]);return v(Cm,{...l,children:v("form",{onSubmit:l.handleSubmit(d),children:v(Em,{control:l.control,name:"content",render:({field:g})=>ee(tl,{children:[v(nl,{children:v(el,{...g,autoFocus:!0,className:"text-right",disabled:!o,onBlur:f,onKeyDown:h,rows:1})}),v(rl,{})]})})})})}function qP(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function KP(e,t=!0,n=!1){const r=t?"HH:mm dd/MM/yy":"dd/MM/yy",o=n?"UTC":qP();return TS(e,o,r)}var YP="AEkU4AngDVgB0QKRAQYBOwDqATEAnwDbAIUApABsAOAAbwCRAEYAiQBPAHYAPgA+ACsANwAlAGMAHwAvACsAJQAWAC8AGwAiACIALwAUACsAEQAiAAsAGwARABcAGAA6ACkALAAsADUAFgAsABEAHQAhAA8AGwAdABUAFgAZAA0ADQAXABAAGQAUABIEqgYJAR4UFjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqfu75wzbIM8IuykDsRQ7APcta6MAoX0YABcEJdcWAR0AuRnNBPoJIEw3CZcJiB4bVllM44NCABMADAAVAA5rVAAhAA4AR+4V2D3zOVjKleYuChAdX01YPewAEwAMABUADmsgXECXAMPrABsAOQzFABsVW6n7Adq4HB0FWwXiAtCfAsSwCkwcpGUUcxptTPUAuw1nAuEACy00iRfJkQKBewETGwC9DWcC4QALLQFIUCWRTAoDLfsFMgnXaRetAddDAEkrEncCMRYhAusnuTdrADnhAfUlAMcOy7UBG2OBALEFAAUAitNJBRvDHwcXAKgn0QGhKy0DmwBnAQoZPu03dAQYFwCqAccCIQDTKxJzOvNQsAWQOncnNUgF+icFWQVYr7gFaTtdQhI6WEGXe5NmX6H4CxMDxQcl8XcjBKNLAlNTAnUbqycBj6OlNVsDRRcEg2EJANEGqz8vIwcpAjldAGsBYR9xAIMdGQCVAUm3ACdpFwGvxQM3LSFDUwFvWQZlAmUA8UkXAykBBQBJQQCrAF0AcwArtQYH8+8ZjX8ACSEAKQCzG0cB0QHbBwsxl3iB6AAKABEANAA9ADgzd3nTwBBfEFwBTQlMbDoVCwKsD6YL5REVDNEqy9PYADSpB+sDUwfrA1MDUwfrB+sDUwfrA1MDUwNTA1McCvAa08AQXw9IBG0FjgWLBNYIgyZJEYEHKAjSVA10HhxHA0UA/CMlSRw7kzMLJUJMDE0DB/w2QmynfTgDRzGrVPWQogPLMk85bAEecRKgACoPcxw1tU5+ekdxoApLT661f0liTmcCvjqoP/gKIQmTb7t3TgY9EBcnoRDzDC8BsQE3DelL1ATtBjcExR95GRUPyZWYCKEt2QzpJt8unYBWI/EqfwXpS/A82QtJUWQPVQthCd86X4FKAx0BCSKHCtkNNQhpEO8KxWcN4RFBBzUD0UmWAKEG/QsNHTEVsSYMYqgLBTlzBvca8guLJqsTJXr4Bc8aHQZJASUa+wDLLuOFrFotXBhPWwX/CyEjwxSkUBwNIUCzeEQaFwcRJaUCjUNsSoNRMh6PIfI8OQ1iLg9ReAfxPAEZSwt9PJpGp0UKEc4+iT1EIkVMKAQxeywrJ4cJyw+BDLV8bgFVCR0JrQxtEy0REzfBCDUHFSmXICcRCB1GkWCWBPObA+8TzQMHBTsJPQcPA7EcKRMqFSUFCYEg0wLvNtEurwKLVnwBEwXHDyEf2xBMR9wO5QiXAmEDfyXnACkVHQATIpcIP18AW4/UUwEuxwjDamgjcANjFONdEW8HjQ5TB6McLxW7HN1wxF4HhgQon6sJVwFxCZUBWwTfCAU1V4ycID1nT4tUGJcgXUE7XfgCLQxhFZtEuYd0AocPZxIXATEBbwc1DP0CcxHpEWcQkQjnhgA1sTP0OiEESyF/IA0KIwNLbMoLIyb1DPRlAZ8SXgMINDl36menYLIgF/kHFTLBQVwh7QuOT8kMmBq9GD5UKhngB7sD7xrvJ+ZBUwX7A58POkkz6gS5C2UIhwk7AEUOnxMH0xhmCm2MzAEthwGzlQNTjX8Ca4sGMwcHAGMHgwV14QAZAqMInwABAMsDUwA1AqkHmQAVAIE9ATkDIysBHeECiwOPCC3HAZErAe8lBBe/DBEA8zNuRgLDrQKAZmaeBdlUAooCRTEBSSEEAUpDTQOrbd0A1wBHBg/bQwERp0bHFt8/AdtrJwDDAPcAATEHAT0ByQHvaQCzAVsLLQmer7EBSeUlAH8AEWcB0wKFANkAMQB77QFPAEkFVfUFzwJLRQENLRQnU10BtwMbAS8BCQB1BseJocUDGwRpB88CEBcV3QLvKgexAyLbE8lCwQK92lEAMhIKNAq1CrQfX/NcLwItbj1MAAofpD7DP0oFTTtPO1Q7TztUO087VDtPO1Q7TztUA5O73rveCmhfQWHnDKIN0ETEOkUT12BNYC4TxC2zFL0VyiVSGTkauCcBJeBVBQ8ALc9mLAgoNHEXuAA7KWSDPWOCHiwKRxzjU41U9C0XAK1LnjOrDagbEUQ8BUN16WImFgoKHgJkfQJiPldJq1c3HAKh8wJolAJmBQKfgDgXBwJmNwJmIgRqBHsDfw8Dfo45AjlzEzl+Oh8fAmwZAjIyOAYCbcMCbarrhi9jQScBYwDaAN0ARgEHlAyJAPoHvgAJsQJ3KwJ2njsCeUc/Ani2GVjXRapG0wJ8OwJ6xAJ9BQJ87AVVBRxH/Eh5XyAAJxFJVEpXERNKyALQ/QLQyEsjA4hLA4fiRMGRLgLynVz/AwOqS8pMKSHLTUhNqwKLOwKK1L0XAxk/YwGzAo4zAo5YPJN9Ao7VAo5YdFGwUzEGUtBUgQKT9wKTCADlABhVGlWrVcwCLBcpkYIy3XhiRTc1ApebAu+uWB2kAFUhApaLApZ4mAClWahaBX1JADcClrEClkpcQFzNApnHAplgXMZdAxUCnJc5vjqZApwSAp+XAp60hgAZCy0mCwKd7QKejgCxOWEwYesCns8CoGoBpQKemxsCnkqhY8RkIyEnAierAiZ6AqD3AqBIAqLZAqHAAqYrAqXKAqf7AHkCp+5oeGit/0VqGGrNAqzfAqyqAq1jAqz+AlcZAlXYArHd0wMfSmyTArK5CQKy5BNs3G1fbURbAyXJArZYNztujAMpQQK4WgK5QxECuSZzcDJw3QK9FQK71nCSAzINAr6Ecf4DM20CvhZzHnNLAsPHAsMAc350RzFBdNwDPKMDPJYDPbsCxXgCxkMCxgyFAshlTQLIQALJSwLJKgJkmQLdznh1XXiqeSFLzAMYn2b+AmHwGe+VIHsHXo5etw0Cz2cCz2grR0/O7w+bAMKpAs9vASXmA04OfkcBAtwjAtuGAtJLA1JYA1NbAP0DVYiAhTvHEulcQYIYgs+CyoOJAtrDAtnahAyERac4A4ahACsDZAqGbVX1AFEC32EC3rRvcwLiK+0QAfMsIwH0lwHyzoMC6+8C6Wx1Aur1AurgAPVDAbUC7oUC65iWppb/Au47A4XcmHVw3HGdAvL/AGUDjhKZjwL3DwORagOSgwL3lAL51QL4YpoYmqe3M5saA51/Av72ARcANZ8Yn68DBYkDpmYDptUAzcEDBmahhKIBBQMMRQELARsHaQZdtWMBALcEZ7sNhx6vCQATcTUAHwMvEkkDhXsBXyMdAIzrAB0A5p8Dm40IswYbn8EApwURu+kdPT4WeAVoNz5AK0IhQrRfcRFfvACWxQUyAJBMGZu5OyZgMhG6zw4vGMYYicn2BVcFWAVXBVgFYwVYBVcFWAVXBVgFVwVYBVcFWEYVCNeFZwICAgpkXukrBMkDsQYvu7sAuwSnuwDnQCkWsgVGPmk+cEI/QrZfdTdf6ABYETOrAIz+zGvL/KbnRno9JiMEKxYnNjV+bd9qwfEZwixpAWvXbjAXBV8FasnBybgIz0lbAAAACnxefYu+ADM/gQADFtEG5a0jBQCMwwsDAQ0A5WUdPSQfSkKxQrxBOCNfJ2A2JzgjCcE9CkQ/Qz54PoE+cD5xAolCvElCO1/LTk9qTQosa1QvagtuH1/gMzobCWebCmIjKzwdJkKrQrwrzAHL/F/JDh8uCQgJIn6d32o6LUoXyavJrAllwcvMCmBBXw/lEKMRAJONHUVCJRupbTnOOAozP0M+cEI/HAcKHUxHbFssLVrhvBIKfe0dK0I/HF0ISgkOM1RDQjcEO0OcLAqBGy1CPxv1CFMiIxgwMQAFj2HwXgpxZMlgC2AtI25DYBk5AhseYLMGAmsQZU5gTREBZOdgFWCVYH1gs2BLYJFoFhcGtQ7cVam8WgtDFqsBuyvNwQIfFQAcAx4BeQJsLzCVUoABigq4RxoA5CN0jgrKDaZN6gGbAoecTwVAXwD39wkANBZXDAulDCQfuq9HAE8MNAAVE58rggh6AtILS2URGwDYTgZ1BAoeWgAxALa4AZonCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cKAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4AZonLTsOzgKQGHtQu1jIdHKO16WbDvWZFT0b7AEpEFwSBg8bAccJOhCTBRArDDYLABEAs84BAgCkAOEAmIIABWtXLwAUAFsbxi5sdioNwRACOyQz0+EcHgsbfQJ7Ls6hHATBCqrxbAA3OS0Opge7CQAQOi7OERkAfavaHA+7GkcczaF3HgE9Kl8cAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvC7OoSoJPA67BZgBG2sKD4sa4QHDARELuxY7AKALOxC7BBige9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewAHuwG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOwAuuwLrDlaouwAeuwJVICp/AAG7AALjAAg7FTwVuwAbuwG9KOClWw6/xAD0AGj7L7ZtvgNIo7vIqDsDAbuVJ0sAAlsACrsEAOfdGbsIGnsIoQUK/3AA37unuxjbGruji3lyBvupm4MAErsGGwsBvAAAhgBtuwYAC7unOwEaO7oIoZzKAbsL7QfAqTsA4XsBvwAA5QAVuwAG+wAJuwBpiwAauwAOuwIYu45pFfsAAVsADmsALkseAAa7ABe7CCEADUoBwgC3ryYBwAAAtAAOmwG+J+QAsloAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAAFDsAEWsAD4sADesADbsAGQsGFhsAFTsAbpsWswG7ALoAEzsDAGkrCgDhSwACOwAEUgAXewUbAAbQABi7AAv7AF+7AGv7AOSLAbsAF3YBvAABcguhAAVKHgF7KFIAOUUA/gcNDHIAKCpwAaQFCF4BvF4jDAkHb0tsXyqJHzwUYi02A6EKtAHYABYC0QNuAXZyR1IUIQNPAhU+ASwGA3NGvHtSekAAKQAxAfsAUwrbAHuQLAErAHblDREyRgFKAFcFAAFQAQeKzAB4OwQgpQBaANYVAJVoNx+LAM1rsQDP1BYIwnVzGxhWHQnRAYiQqyJTU01IEjzCifkAfxw3QCkr4BGXTwByASksMClCGQ8DMFUE98XuAEtl3ABqAnECPxF6Osd4LjXVBgUAEBsdCggMKgQfHSlOU04IuboAChLNACYAARoAhgCJAI41AO4AtADgAJ08ALsAqwCmAKEA8gCfANMAnADrAQwBBwDAAHkAWgDLAM0BBwDXAOsAiACiATUA4wDYANUDAQcqM9TU1NS2wNzN0M5DMhcBTQFXL0cBVQFkAWMBVgFHS0NFaA0BThUHCAMyNgwHACINJCYpLDg6Oj09PT4/DkAeUVFRUVNTUlMpVFVXVlYcXWFhYGJhI2ZocG9ycnJycnJ0dHR0dHR0dHR0dHZ2d3Z1WwBA7ABFAJYAdAAuAGLyAIoAUwBTADMCc+kAh//y8gBgAI/sAJsASwBeAGD5+aoAgQCBAGUAUgCtAB4AsgB/AjwCPwD4AOMA+gD6AOQA+wDlAOUA5ADiACkCdwFNATwBOgFQAToBOgE6ATUBNAE0ATQBGAFUDwArCAAATRcKFgMVFg4AigCSAKIASwBkGAItAHAAaQCRAxIDJCoDHkE+RykAiwJLAMMCUwKgALoCkgKSApICkgKSApIChwKSApICkgKSApICkgKRApEClAKcApMCkgKSApACkAKQApACjgKRAnEB0AKTApsCkgKSApEWeQsA+gUDpwJdAjYXAVAQNQLeEQorEwFKNxNNkQF3pDwBZVkA/wM9RwEAAJMpHhiPagApYABpAC4AiQOUzIvwroRaBborDsIRAZ3VdCoLBCMxbAEzWmwBsgDdfoB/foB+gYKCfoOGhH6FiIaAh4KIgol+in6LfoyKjX6Ofo+CkH6RfpJ+k36Ug5WIloKXftoC2WzhAtdsAIJsJGygAINsbARCBD8EQQREBEIESARFBEAERgRIBEcEQwRFBEgAlmZsAKMDh2wAtGYBBWwAyVFsbADPbAIMbAD2WmwA9gEZAPYA9AD0APUA9AN8XmzUhCNlvwD2APQA9AD1APQcbGwAiVpsAPYAiQEZAPYAiQLsAPYAiQN8XmzUhCNlvxxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN8XmzUhCNlvxxsbACJWmwBGQD2AIkA9gCJAuwA9gCJA3xebNSEI2W/HGwCQwE2bAJKATlsAkvBbGwCV2xsA54C7AOeA54DnwOfA58DnwN8XmzUhCNlvxxsbACJWmwBGQOeAIkDngCJAuwDngCJA3xebNSEI2W/HGwEN2wAiQQ4AIkGjTFtIC9s1m4DJmwA/QDGWgJsbABVWv4UMgJsbACJAmwAVAEAuV5sAmxebGwAiV5sAmxebD3YAEls1gJsbEZFNiJ9FGVAe8xvEZKvxVfKZszAVTBzYBH2d1iyUXEHH7twNw7eZF5JJRHI5EgaRr5D20/3dfONrFLSq5qSrrgd2CEUq722WBQ/LzpA+bx1oREI5xy4BDSZNun0ZWORUJqInZSyMaioyvfSI0l5uFDzbWaQ28/zdB0hwR4OQZ0/jn9ALSLNikjFYGfqR389qtFlhD3a6KdIh97rhZYpywuLc7o8ql5/X8KCbPU3L/QlmCowhRXhsGDvg6wUNprA9bM/49uxlAj7ZVy3ouEY/BgFXBNyK0TLrSjZWeJm/T4nz6QGLT3cJNtWRZVZTvIdtaxMMJRHgig9+S11LjBh7Inr06ykoch1U097Rw0hvgmOrydQyaWcEQDg0RavuMuT0zYabUZl1e33HNSK1oNUCS03eh+9C2EvF3fq9h+XBaAMFuoWeZf+mfZgL4HzyiKDIUtfNU4oFu0aE9qt3VA3U4D3fOSrAcYVnjG3cSkp1vhXZnp3JQm4JknKdBitO2NVnGCYQwU3YMWHWB87NEd+4AHuOKI8BSIH92reW0pfs+kWCTJxDCbRjFv8Cfc4/DSBYJScJYTeAEgg9wTEvcwd/QuHRHqGzAQ4fXf5FUI1lPrO+fvEcPl4JInM1z9AtBT2bL4QYEREe7KiSnnxTwtmAFjn8lqT3mND8qTktX2F16Ae9cakqJ6/pEQsHURqyqWlRMCzKXRKfCHT7sYHWx9/T/ugYTFY6iVN3Btm58ATJR5alYZybKMWojwOw3HbFn23NFyeLl7+Er82RchyYuBoGQ3j7SAWNxiYvp5U+Fq/DEzB9cG5DlJWsqkosRze92OVlCtQEYo1S1lF72Z8xWc4ld/+fFcfTEDTFb9d8tJGQ75dpJEvcWyGmGBiTbiWDdGOcw93Dmxq5ISUrmasygONfHLvhgo83HQZenbdBtSzBkvYrCEQ/xEDMhMZsN6gqplx5jGG9mSQLhM81UEdEeJ59sdNJDAFy/gPyJoKlwPZgB/MkC/kICLiCB8va+nCdO2ry4aDfkmPFpF/H/SGQ3LJ6aAv9dtJ8DniHtLOckZix0BVb0iR5V3LAp521LBSIi6AtV7r2ZB/hQEvAw54EFNOQcFnl1xGUIc67tqK1INNwD2n/RbwgzO9h45LM6VMuN8V1ZNIQ6t+Xy3lTqyVCD5kqLy/t3/b8MLbgDg8JIWDkSZ+LrGhhr+gYpH+pr1TnCUnZPjpUdw6bSL6MWVXoDDciQDWECwU2e6VEpfrcOBbrSOijqGkEIoJPbpmeJLkcwbvA0yWIixQVjo0HnYh7fji+Dfdq1mtV1lG2Zz9R7eFMHS+FK7nybutu2fwzDpFldO2pZBshsHJWaltn3PWOoGJpCT2jE8EHOuC6FkejNWcfsWCqNqMLP9xTwcWArj2EiiI7D+EaDi7/2cqHL1gPiF6C/J7aUo7RQqogPZ11WqbyP97nsoMxPOC78wZMF7B1Y0g7JNXJV/nN1m4xx8hbqWz07KSaqr5hE4icB326DMR/vUKX9LoNjle/ZWtbUhrTAcsdgrLlG5Ne8aiR0bS/2ZhpNOVVxavWIZsEM/rd68EB4vjbbD13NkMK1qvMk74vGbSkL7ULO0sZ9R6APSCo6KH+Xn98wEdw1bCPAnDTaBsD6sidAGN58uiH4a3ovG1KyZAu2XtyGgF/vgWKGxw9R1lfAVcfuYE71DHuxtTzfGZnHaDpDGWmfEq0N4GawE7yIkaoz8jcmVmzJe1ydM8q0p08YIxFcY1YcqQc1djWBEoNETDFcgk5waRftEJasPREkrV++N/TOKkERF1fCLrXS8DFGYGRBeECMQRNEs0ES3FzUtXCcNxpYEM3Uei6XodZruXUIRnn+UXf2b/r7n1vQutoi6WoIbW7svDNWBbUWcDUc7F9SJK3bvSy9KIqhgyJHoW2Kpvv0J4ob14HFXGWWVsYXJzjwxS+SADShTgCRjhoDgjAYRGxwJ1Vonw+cpnCKhz8NQPrb0SFxHIRbmG95Q2hlC4mDxvPBRbkFa60cvWakd7f0kVBxxktzZ9agPJEWyA63RSHYVqt8cPrs2uFJ3rS3k9ETGKn5+A6F9IOrdZHfT1biEyUJKEvwzuscwshGCBJvd16TrefW03xVnJf4xvs72PdxrMidjJO8EiWyN/VWyB3fv9kc34YIuZTFtXGo9DuG3H1Uka5FgBMwDPEvRcSabi3WakNQkXFecJlFk6buLVk5YHpuKWTw6oF632FPPSVIVl5hgUAeHhj0t/sw/PEEvThLQDDFE34eCg/rLOyXT3r+L98oRKrlTO0MdALYQ3rRQqC7d822dJPGxF1K4J2TtfPSMFaCAg0n0NGk9yiaKKOJD1v2aBX9HUOIawjjfvwCmjHZJTR62R9c9x33JnBjWrN4QYEOmehy0oZMP9XM9Zyi6TYoe07PaLceRXcCWZiY/imRUWW6+mci7+wMxSdwMdbXckXtvhJH8sc4iQcTwm7yp+3f7CaesTTQB2qkgeXh+wFiSMXfMlH7Yil0OoZ2QTtRLTip2O0cLZ4SstqWHZ6H+8A2kZXhpm0kPbL9dUanTOvziqIUh6Ambwa3WrCb2eWbuCN3L1hgWUmjRC3JoL3dBhR3imSQI8xuCMfsszlji7cSShNSYdqCXPxEVwbqO9i5B6hf93YI7aeyI8jxgcVXK0I/klbvhSXjkjOIwZgPdVwmsFW7HGPLUAvDRuKm+itybRg7c8+Yqqjg824Qf+/NxsBSUNAK9KCoJpauFqK0XQULrWYj4FnxeKDuvr54iokpi+D57e6Y1zxRJJdsHnDR3JyraCUufHBRTKODWBVzthjm4k3/Hv+Q990XDVR+KW+TcJX045LW86EKhz/97aqj89A8ZvTk1//tczosU90loIPVaHuWegJU3wP//7XHcO7c0yQM2jM/IhQKrf8hiObHWiWDZManF8Uf/HzbmDfC2wT//aiZ4hGTv/xzgKwdb1sD6cGEkceow0s3b89/zg+3plyRm0HlZi886j5wUwFhdHiDTaBidZRo5cx/tMeLyguOATbzq17ydhzbrpxunuHx6lbFGiO97gsd4dk//7iCIo+Ew+hG2so5kvv+ITG4c1fzHPtu1Xn5QfUnqY3/uByVmB7gmnE/E+5zdm+6nDmoews5fr+NzThdSHzK4bBQOL9c4O8OI0xLSqjJ4lbniLJg1aFpQRLwaSMZmpkC9e/j6FOVrTQ6a/a4alGgfrl2ZL1sbHUQ3DOI7ntq9diHFfm3t1mul3rdJEJCHnlW/hlQntipMrpeMs7fUr6wK370D7VbXH0DUHzdYfRg/6Z11Ult1sffJS+heHbco15Sxy3+rDnPesqH1lajk0yu02hPUvEUqvcUXWXL7Ad0wNGMx5gOle4XJxq/r/YY0xdco2wRSEGwcT7YADlBrHc9ZbvzOL0QwyWCWWChB9Obg800v7tyBWaNvdwz+fL7Ph9i2irEeJkRgOzeEDw+JiD/V93vH9FgMEoFIJMoIuogmicZohf94SBuPn6hXaV9jP4VVVA/bu+Wg8S88GLtmEPSNRLdtlXx2XL/nuM8nKkhnlnjaropiKKLIH94pLIASci0pDBfj9Hi5BfaTSXQg5+PMjQX91Ktk4MOqK1K99l4BRPv5+vNovGZ3IxQv8ICvjV4/diThpoaM8uvd3D9d/DE477w3yAbW3IDm2i73pZ9aEj38JqS6h/s8/xgmUIVcuq2JTgefAyuoafzQxAuRASeg3NtG3ach/JEkyuX+JDt2PnDZTShUhyHHG3ttBg/6lhAchGjLJBtopj4e01MlCp2yqQRTr4sBBXru+lKaoanwYX8y2aWCJiR3KnhCOkYVFSvsO0oDRujUFOEptiNDTYrJoUbvOyvl4AhC9h3wORiTXK1MrpMfnvdnndnR/HRVSusMBgIxwrLdn3vq1VcncPiD0SquTx/kNmxeFyCT4uXVUd9AL+rSGmuq7OOCzDKeVPjiNWVaoP5KOFqYq5Xcuf/xW9S+u9eIq9GAtZWtQlgkRecjRtvG1NR4WXXpn+pwsTBTIy079Ikg8rSef1aVapIFcXCd6C2wHVjLXR+N0tw4Taw6x6H90BFRgNrtlq2up6hHKuV3inM5RJaQWZHd84e6RsKkk9po3dk9by54tpPw7cBkFas/G+GbHwuG+AwP55BZyXILTHCIVrPpXHEaUPYfL6nphJP1Rc10xG4UaCeY4IHCwuur8xmSQDgY4aVwhzWhjbtSHG8JO6P2i2nC9/0Bfx0zk6dYQq3aw7k5vIObD7SEKrxhz0fQ0+YTOfHW23CBNeZci1qNsUDhoeqmfyP6PvjoEjHk8QbrFyQVZPHVWijnb8YCM65iYNoEbvnchStZ/9cKg5Vd45j8KnB6UjzXl/bkyZx7VoD47ocUUi117WwgySSb4rXgLJ52Mv5XJbp3I+uBP81BUvOjy4Cacgi+GWWlC/8dwgqwiojjUBDnEOxyRyowwLQfytFra1OZS4XvRYr4uoamAfG3I/p2bA7G90yqKThH8Ke00Tqd+3l3dmJpaCZelBMYjGqNLVa3SM4+LQeL56gY6Bymy2LQPVOxjWfj5tq4o74swcxhyGJPynkS5xAjOXZP1/FAYcBT3u6qLoIkEfErwo4gozmyI1YCvM0oyI3ghjGPQSsof2sKUhq91WsKy9cYWN+4A2v4pG/Mxpdc6w6kI/HX7Xb0TuihmsiOy2wQIsrZbUmr3OBSUo6oDJNgQp+YqYkgTgYcWZDgawJw3DFfdzT//PhVUidgB2qa8uw/j9ToHBAS33iT8YLhhAfyXG0bQUFp7QmH7oQ3i6Flf4OTZLvJdh8pfuflmWu2ohm5pTiSg1pl3vq9uluTJwqXfh1hqy8e2iHoD+Y35gCIViTo6VOtK5dD8HYClucJucXASzwe2kPj4S4eYQtmkYHagXhAzp/F541xE8YFYqSPszDuz3soWzHy0p3E2jwZNQaIcGU9FNQwQxeDw0ZlK9dxXrj9IUHGUPTOyib8CqXmbZ7Ex54bn1rLx3qqAavu/gh6XjV0GmN1p+yyMK9HN5uYEvxgbAk43tsheREhyI+Q5WLIneKTGPmYiM/lxOp8fvqHy8YgXK0TlMiX0tliLI2JtfmWZP8eVV732sdYm+pcWzDzEmKLJZyeelyaZKkjPnnUO9keDwtgiLnmd5+t+Sr5y8brRnlvxcWEWfCqIALQYHvaXx6jTg4dAlye469uGwwOZVZCILLfGjaMg4LUCNMTtMSp1aC2y/3wR2t1v3w/iNBRQ+bNbtDqL2NAr7K4rUcyqbSpNrXZgAWXvjxBBtfYLK1uRYt3q2pfXJOAL0HtWcEwJLddOSJKV1SwvcvEuzg/4MPnA8MIUJOLqm3qI6wFyN99Ck6zYaV/zGSAzF/PGsaNa4vPLe5QnyuqVUnVQ6xELA6gbe53aGgeke+R/ycb2LJVyc7BhuzI90zA+c6wUDTb7NH//gdDSl2u/aW7lRJm8m1fLtPxcNuEM5JbkOCZKPM88HUsLRoC1pmKKlvWyeAXuxILbu0snpSxf8N+RgtLUSe5n2gdjOjoSTaN7mMZ7bF+cWk/MS8mFD4pcyl5UN7CbpFZH2a+Pm1VAnUTVfbw8qrmz1G9m5aKmRzY1SMhhPrlCn2t4uNUXNA3IFe6NOjSC1DEaAFZAfDlEkQCsbNhsZPj6NQPDSB3tLiTo0ZYoEbIeEIaKtU3Wk60rEszawTFuyHVd365LA/c/uarABN5M5rGq/dqTG3Ilye/5EKiYisisuzqNaZjmWv0z9TORc0CKbaTea214oNM9u2sXUZub/eqM3Pi/PjRSyQiOSwPWif2asTgu6hS6fb5UGosCWxdedMqdViIUUSSdIJx+qQ4KShfTT39VAWZbi+mB+iKICNwpt6cflY57Rcbs6d1kA26Iru73cuxYVlSvuJdcR5VfDYZRk8X0AXePROyw3Le6LaUdmTLzYsoNhhgQpd67xVNiHgk3pakmndeIAtTC4DCXy9oS6eU4CWxDdVmY53pKNbdAKmQsP37lrJZC6iDXMELGKcHjNuuZgcDyY8W/yv6ha3DX7OWm/35fpvhw55oitf4V+GULlcPWYyGGuVBdro19c8u0RDddDun40W7G5cSIzHLh/qZxb59R+EPY+wZ2XerkUim92hhXpKyW6WtAh6zQS97DrPyjCvKi3pCw96LeKynOpyjtsMQc2RmI/20zFOZcSa2AK++PoRcT6zeJyxlBZ7kk5mhqXGkLlM2hFKc+/T544xXP0Ua38Q6xdPTLTeG1PHnLMaOvksUQMrEFTB/lizCirmFQL8zYVU+OTeYQEFaITsBSMMYexS9HkajO2gGIf2micvntCZJsZQEwIH3/4JGJQGflBuH5rNXmnRRYXDQs3ZoEQoMtYDr1kFKUS/siiQSUxcTH9XYeBZiKDDFQoExREO9dddKQLO3BwMHvymCSTFyY+vxn3D27NDx6OlU092D5EDUwilttqVHpjJQDUceJYCLsK2swfXeNUVrBJT/w/sk+7si8rPtiMFis+oxvGdGQxirMBID700T39mULuNHzOyN+xBfcFACZcyngF1aSpv0JPkNUrAZTqfplv509cGXFUiEEm5dZb+OsP/blizqdK45/dSsIrufYTrCPY2lgJD6k6QljTfXVlHfYKSq+MsagyUcaMintyr95bD8kdTAeYNLNsMmo/Wdd8a2nStBP49ARIjqqpUHWY4q4mvO5Cq/CgCP+4/B+5zutGwX5pssgVLr1+fIM7WWLfiUQDk4c6ZdHZOWv5hG3g2dgQ5NXnpIY+BWwJpaouf25bXnjDzbHnQNofH/c6m+dEAS9Gs2h7pFRPKOBDnqswZ8KZjhId1ytHUTs533KwBoSiImoxKQUgZ7z6pA9QB3sZ8Cq0vwutJTTkfbX8AzCpm2cFXx/P22niUMHauU8IGc+78R6TsutoonoqFuoNA3l80t387YHMoL5KGAT1JO4zmx+vJ0LbLHlicHraSVYvJjnO9p++qnWgKw9OwFVVUagvZuf9qfiuum+hIicxP1q4zDnzkHsCNriLxBpxY9N+UOmqzdY1MunLMDgkMyi3uvnN3UBXJeZ8YLs5xr8QrOhimYoKuGBebZHAiBIkViv3DG8k2oNpp5OIgX6ulqaRN8V62QUPjn5tl1kPXhT9bcd8qIm8gi4or/FGbvQ6pgGSHmnayrugmf5E0upGxPRf/3xOtitGMaHLKJVm5zhglmVfI91o0yxhJZVS/5wQ8zfxK8Ylw0WmHXoGfRkoBRx9Hsnl/6sgTjAVwpmNuSeZtBwlX4qB8Bh8lxjqBDIuFGJ4I1wxN0XRlAAslzqMKwQfyA7OkuivCXfv+i+3XmhcBFM2n4jdT+NyUmBnQJPV3F2sZfKvJhUlXzSosFR4VevVVcOkFnnjdiRWc0TeSYxj41sJGYMbZTeLI3GvyZ8/gAAudQ1+4oFX+enX5V49MczGCYVBuoC4kHjp7ZVxj+clBwPr9k+v05SsezQK3enxLs1Nt/N7c7AImVUysjGou4iOohHo83Zs9/MI/OWB+OyXzOBD93NbApGHXrv8CVRHp2bwH+xB55cfNrdqFD35HSMx4iVmtzYAmSCIV8kXsHoq3DIb93riTWbubnjxbBW5zConVtbxLRStXHkIyAByaozME952Gc9aAdAbBpZSVCH88Uwb/4bPTVOVl+WoMYD7JIvK8VcMrJ8zHV4bbG0Dg7Kx17A4ej/ZcZ2Z5pVuVLUH1E/AccUTKm81SE+LQ6STTUDscUk0x2OWIbEORhg69tdoTGNkA1RfkGIRZHr5mCXOpLC55WWzCZoGPFUVtZRHwh0nq039CDdjEPo+JyaxSQAvDgR6Iqvxy0frrtEG1A385N81l05SSzN+IDm9bypF9m92EUqblnauZ5sjc37wRykOdl7w4o8WMgQsjii3EE/aJYDfHs1cH6DNBEujjcCc8qAefYFyIAURDcDnzun5UmkbBQsU4eu/W8I9nBE0qJKTdg2hwjq0+XV7a3TJ7R+alvJZCRia9lJ+grNB9dbrOmWEvUotMjvDhq4wV/kq4fvIBkzUGpDeYH74rne8uU3dgoNZdR9pUL6q9YDNRfOiF6Dyk+SYXQIghTjm9qR4tBHh0gnmF/9q3Qv22EzaLhSvDlDOxMrrCNRmLCl1jApzLrBCPn2mjn5zqK7OYK7VxOfQ5GfBfoPdyQwqFEgCVHkJ9oTnagRM3R0+rsuN5jQv9icCav/p1WqiEXSzCdLd/WEA6z6dDP7tPqPbeDYKAkVcz1lLGbFOC9b7cBd3MV0Ve8dZ89oR7OnxGS7uVpSry8banVZwpJg+nkH1jRBYa2BvBMY2xITH9ERXCjHzdZxs+ipdXP2DY7X+eWiBhtT2L0RRGTLPeazn5tpl4tu8iE2rWig731iuJDRbCHHy+g/Mb9+miAyVqfIpXT/iZeOxOxODO0hEpLM78I1+G2Z45yi3lS1K3m4WMQ559Lp4UML5vZUjYGJuxl+OPpUH5klpyBujkjprhei0TmUik10gjvNUp8mDkWlNKikmYspaVTqewbnOzJrmz8FLIpsT67EJLHIIfeDcWEfiP+DJrZ1jfxpoAb2abeMqLx+9RuZGzQoYtYVGgAWwEM9Kek2vPIeBNAKD6ao7nw6sgvfeLZPoXkbYO/tStHJdKzk+WFSFEU2NcALJAEP6S8pcnqqBBt57dwTrzQNCIdk2SocK4dLRbD/pu/VryKnm65ZYXiJCfHJk3mx9MRSl+nSK6OqEBSoGjz0/LADddwF/HqcfK3K3O+6YUGQcmj8pZL4PhZ6KrGkb8B38FmDvvLd3XQXbvS/FQmrXFTvJNkaN/FGo83KuS43BK1UfVnIqigGkCoP5fBda2MwAGTGNKX9K9t4Bx83pMFc5KSORmWKv+8VoVggWxoaBz3/9IBh6RwLd1tebwy89xvE5z6EEpXpDfrXWfRsMs6+ekUHH6idVosno55+xQ8Zqzelh0bxtJTgCcH3Z3/Cxlx9eNIS4JIFKOAVrDqbrXRszmY55a5+niJGHtkO3b6mnIDxLa1WXc7BAe33mt2KyM4Fbc3R6/WVTQN8QhlqAtave2WsQTqzWeSlKuGUVIJRqtObpv294rS0kDN1RKzdstZTXJebR2HlzsQ4P3NbMHUqFZMZw+/IKXnh4t+lY8qocp/B1oMszR03EFs3bPeND8QkItMvllObeCz3SZAjqZrobmLcrpFyQV7mwBjg3C3C8/bc5goQhv8j/IXMLGnt4mF7tybRDG5G0polxoUScQkPvmnga2/K+aapKeqSL0BTmo1Cm5g+booNOtdyKva2KoefRURaBk7113QKo3y+WTuFKtgETIK8HRluYS9DvlcciCDvnG8UaJRfZE2siZsiTHvRmN80xkUIInHeRZl5Re/+ATL6VhKFi8CZ/n/jbFV6T5pZ+Uoppvsi3qjacVFOJgWWfdlwVHKPW/TJO3na9hRM9bS2yo2rEsC6IBzRReVO6IesJU7PItzOamr+ROFfwGZmZ7ue8HNxAgLJKb7P3p8dMqk6Be5PJaT/5Rdc1deYVihWH9cjVKc9uz5EnfHqxLUkOO8iJUENBNVf5LyNy8zjLu/78k5WNTywiPfYeX3CPk7yc6CI3lum/CEZwfUaNpcI3KsPqfn2lmz3kd/acQjKA1ebkJaiuLD+epQ/Fc1llHXXMzofWzz/Kd29SNmOhcjMWw1jq1g3YfrXZ9rzXDYW4ZttfgfMi6oCUtBs0PkMVuxmq5lxEoCaSXPSqCJJ7MlKdRDidVt0AFlxk5cTdX++sBF2+E35mjwfm8ERVxH0FvuAQtsfA4V2G0TKTUxeyRGVjd/u6F1SvuAiU2/WaQjcNCU4Ep7VunXCYSbZj3U3wzu/LWM5MPlYuyQ3FOOCD/zt7K295hY2JhwF+ODDIZ676vGQFKveEQYkWj7lkK7rVmD7MhU0Y/tF8EcTTpo4/yqOufbd/zWIpMajnbDuWK2vn6OPPtz2rc9MIBNlPd8tt+yf+7SC4wqEPbozKMCwY5Bygx4JmoIEDsixWRDcdHd6S3/dZMHXOJAAv7+NIstl00crgSqHZKAEe4g3G4dzIV51EeZB01r7p8GNlfUnG/GjZgNGsqXZdYMBVtAtFNv3hJWPve4GvqZ2XxuiNkHTz5kxWgr0PjQdJlVywJ9Zf2ZvqeeTbolKtvK54re2Lq5BoyzfsRtvDfyao3kmyFzDQ88nM+qx83w74RDlkngtYiArI05Epre3GgBeSlMig0pE6RGQaFznKkGeb0SozLCyiOtxh7hgwZlbKbClzUUfC8ntMiHUOZE375RhTy9c4DA+oMLkUDkztSybZbdmP1xpaIbjUpPAHBq3cIq+CBFzbMlMMCCkUQ6d9LGV6GYCsYiEWZIy3nBnuxOYXeU4YTGDSin9e4/pCjPtQSHlg5LMEvIlF0ElthqrF129iK2RPBEWd3XWOl3SWV5uz5VUyZYp5kEFmz7QfP/B1W1BBzQ2iTGbSVT79lUHzcGXz3PJceSgz4uknETUwo0xffpr2KUvZF0i/r2sL3IFIClYx8CbIZE6Qt7MDJbOPB3xMScwaOcWG66IJfCnDkb0D2Mb+PHzX+oiCbxeTIogtyN+s2NJirNACk/OACSOTtV6vscwbzW4M168xqaI+RzR47S1nlV/rOoZnid87n/Ima2XYa3un3BuGAisNjb8eLMT9OnMtazQROFCuO1HiZXaOc0oUDbNC4eKLToOx8DzVhMgGA8XIAQ2x3b6I0uEyLssQjJX3QphcUMx4KsMgJ+72km4N2aqkBF2coKmUEt1eqIMGn+5txMT4kYVGd3ALO+y9Z4PP3d3l48JQK8s9ZZ/Qx/+NBKgBEJFlQ32psoJiihGO7FSYM5L81q72kaAYcilEFMG+ZK1BcMqELkflyCV7v8JEXLO4Rf/oZYNZHZVjJhfL6fnpP9Tio3Euue5uS7FMkfGOeRCTrBZ06Caev7tgufeTrX34Ur/Vvc+b8ksiIShNJtuF9WmYxOZ4xg8y6zTdy3KAB2y5kYkcRnXsptWwAFyKZ2I/QGySNeoQLkINUMloC+5L3WuMMx297Q1xUYLKqZ9XHavaobo6QQv4auMm+i84IhxRpPt9nUmcav9NcjCcP+TcMmxsQZ/F3mgeoA0fQgwvTsyXuuTaM3Sqtv2jaaajmaFQpK9W6uIbeqwvSDo34ZrY6elDUHwSCjHRRmlwmyy+eOra64Ssq0XSXYljMHtKY+FShcMkHsEUY/4Bw63dJ6KpwDaxmthlDdbdE+TvYF3v33cGSKqO+1H1pKYhJMvZD5ckQcHyNF8zrtiR5b0ko6NPGoRexUZTYP6VbUdn3zzxGBOi8Z0OqHjGqYxRXwN3mYi0GYEEZYq+Q3QvdKcEHILLLj8S+VFepSfErtmfZCdvxbfIifFSpEzKi+7VJsLMT+zEFeyp1OdwRC1VZrfTLIyR7xTPUcZFYPD9qI7D70uTb4hdpqPXsJIRNYbZtNwch1OI3trh3u2ScoQyM9POnInsUa+OovcwkUP1UfIzPb95n4BaF2ev57NHAej0+BVMF9/Cj9663HN2/JN3SQgslL914bKfiTTDFAz9PlQEL/dSv1H8xl3mtWxh1McFO9EJXlRDaKQDsyKO4vOJW90NFE6yw2tjbc2GeF95sbs0I9enAa6QwQVf/kJQhAD2BzUDKggOyjy1TEhED6sfk+418lQy3c/uj8aw8UEzZ6hIMCd8RohAkumMtIj9m73l2yPWoGHVTPaywkC7Yj9tBM1NxMgcrDwRtk4RO2WHT7Ql5kQCKdJj6kNuOTeyEBYBjLMhGz+O5/YGa84HEiTYEpZ6fFzy26GG2hWtTyteuYrhSyG56BjsT/wQeLRytpTY3D7sIMqZnJ9z1FDrfyjFlGl2TNw9BQysbaxOuwYYZs/7I6BANgkqCknWZC7/BBXvaeKwAmC959I+G39BUE9bExkNlbRoFRyEtNzv+NJ91FuisG3JCS6uYBeRnfv8AkAfKTeg9EYamqnsGfAV7d0f9DghHEQ5IsPGDIUhgoSj7obM4Bu5uhQ3/CYEDTHc92AsFvDK4XGrwUeGBWBHPlS+f4x+CxmmHz2sAGmSFNt65kwZC64mnaoWlu2310laYn8r62AqsR5dfjyK18MEdurdagldzfJtjFXlZs7St4QhdPiye6TPh2/ZAQLU/Fip5s7TDEM16KtRWrK9hmxnQ7bmfa/+7pa10Z8WDPK3NuJ+NN/RAbQ5vHx2uX0Lm7/w7cAEH/hvZA+mt7J7zGw7YtQYwnNN6dpgwkGjjrS3yQoeoYt1EnczmtmJfQZWzUlP3Hlg9Wzlr9IH23q3thGth+QNEANFettxKfskkGOlLk8AqoKJwDqOxAa6UzAx07plSSyNBJSGco9zjnC5gGbDoKvsMDuBR6bGRlGzJ+hFsGa/Izt78aI+WZ6dJlZKp4pGISuv9rV0sAS0MWEwCmfauO7oQZMiakHU35LBxiyJoOMddhUWgcZuC8r4Ksvn75TTcQXLJ7kWtYhGuGqPd9dZuFjBWQHNwosXY5snbHFQq72CvHXhIg+shQxycuLOuWYErwCLZeF24b7F78pO7xw4X6lIAR02hUOf5087Rl0nOaeb6CK4i/KA/EZv76ftOWZtjwxslNr0E/u8rWUmnf3amfg6UZmBAluuoj3Dd7UV+9IAJ6iYcDfSJlgmIImohjfIUMJ27z+opj50Ak9af2LCNrWrBJvMovA1OeNO+MF/MwZvnaCxTgG7Cw4QfSPF6AYCGFt21M8PySZFeV3t2Rqqs5JMzMYzGRgq4o+UaKRgBf9GHi/9X9HXA3wxkCsd/UhnHSh2zUVDiraio/6nP4y3XJqs8ABfALAtCYU7DHPMPRjgcM6Ad/HiSXDAbOdSMkvGZPAkHs8wuQTy6X2Ov/JFvcPuKfV3/r9Q28";const bd=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),wd=4;function $P(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 u=0,c=0;function l(){return u==0&&(c=c<<8|e[t++],u=8),c>>--u&1}const d=31,h=2**d,f=h>>>1,g=f>>1,p=h-1;let m=0;for(let y=0;y<d;y++)m=m<<1|l();let A=[],w=0,S=h;for(;;){let y=Math.floor(((m-w+1)*o-1)/S),x=0,E=r;for(;E-x>1;){let T=x+E>>>1;y<s[T]?E=T:x=T}if(x==0)break;A.push(x);let D=w+Math.floor(S*s[x]/o),O=w+Math.floor(S*s[x+1]/o)-1;for(;!((D^O)&f);)m=m<<1&p|l(),D=D<<1&p,O=O<<1&p|1;for(;D&~O&g;)m=m&f|m<<1&p>>>1|l(),D=D<<1^f,O=(O^f)<<1|f|1;w=D,S=1+O-D}let k=r-4;return A.map(y=>{switch(y-k){case 3:return k+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return k+256+(e[a++]<<8|e[a++]);case 1:return k+e[a++];default:return y-1}})}function JP(e){let t=0;return()=>e[t++]}function Sm(e){return JP($P(_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 ZP(e){return e&1?~e>>1:e>>1}function XP(e,t){let n=Array(e);for(let r=0,o=0;r<e;r++)n[r]=o+=ZP(t());return n}function Ao(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 Pm(e){return xo(()=>{let t=Ao(e);if(t.length)return t})}function km(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(ek(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(tk(n,e))}return t.flat()}function xo(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function Im(e,t,n){let r=Array(e).fill().map(()=>[]);for(let o=0;o<t;o++)XP(e,n).forEach((s,i)=>r[i].push(s));return r}function ek(e,t){let n=1+t(),r=t(),o=xo(t);return Im(o.length,1+e,t).flatMap((s,i)=>{let[a,...u]=s;return Array(o[i]).fill().map((c,l)=>{let d=l*r;return[a+l*n,u.map(h=>h+d)]})})}function tk(e,t){let n=1+t();return Im(n,1+e,t).map(r=>[r[0],r.slice(1)])}function nk(e){let t=[],n=Ao(e);return o(r([]),[]),t;function r(s){let i=e(),a=xo(()=>{let u=Ao(e).map(c=>n[c]);if(u.length)return r(u)});return{S:i,B:a,Q:s}}function o({S:s,B:i},a,u){if(!(s&4&&u===a[a.length-1])){s&2&&(u=a[a.length-1]),s&1&&t.push(a);for(let c of i)for(let l of c.Q)o(c,[...a,l],u)}}}function rk(e){return e.toString(16).toUpperCase().padStart(2,"0")}function Mm(e){return`{${rk(e)}}`}function ok(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 ur(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 sk(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 ik="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";const Co=44032,ks=4352,Is=4449,Ms=4519,Om=19,Nm=21,lr=28,Os=Nm*lr,ak=Om*Os,uk=Co+ak,lk=ks+Om,ck=Is+Nm,dk=Ms+lr;function Gr(e){return e>>24&255}function Dm(e){return e&16777215}let Ra,vd,Fa,us;function fk(){let e=Sm(ik);Ra=new Map(Pm(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),vd=new Set(Ao(e)),Fa=new Map,us=new Map;for(let[t,n]of km(e)){if(!vd.has(t)&&n.length==2){let[r,o]=n,s=us.get(r);s||(s=new Map,us.set(r,s)),s.set(o,t)}Fa.set(t,n.reverse())}}function Rm(e){return e>=Co&&e<uk}function hk(e,t){if(e>=ks&&e<lk&&t>=Is&&t<ck)return Co+(e-ks)*Os+(t-Is)*lr;if(Rm(e)&&t>Ms&&t<dk&&(e-Co)%lr==0)return e+(t-Ms);{let n=us.get(e);return n&&(n=n.get(t),n)?n:-1}}function Fm(e){Ra||fk();let t=[],n=[],r=!1;function o(s){let i=Ra.get(s);i&&(r=!0,s|=i),t.push(s)}for(let s of e)for(;;){if(s<128)t.push(s);else if(Rm(s)){let i=s-Co,a=i/Os|0,u=i%Os/lr|0,c=i%lr;o(ks+a),o(Is+u),c>0&&o(Ms+c)}else{let i=Fa.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 u=i-1;for(;;){let c=t[u+1];if(t[u+1]=t[u],t[u]=c,!u||(s=Gr(t[--u]),s<=a))break}s=Gr(t[i])}}return t}function pk(e){let t=[],n=[],r=-1,o=0;for(let s of e){let i=Gr(s),a=Dm(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 u=hk(r,a);u>=0?r=u: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 Fm(e).map(Dm)}function mk(e){return pk(Fm(e))}const Ad=45,Bm=".",Lm=65039,zm=1,Ns=e=>Array.from(e);function Eo(e,t){return e.P.has(t)||e.Q.has(t)}class gk extends Array{get is_emoji(){return!0}}let Ta,Um,gn,Ba,jm,tr,ji,Yn,dn,xd,La;function ol(){if(Ta)return;let e=Sm(YP);const t=()=>Ao(e),n=()=>new Set(t()),r=(l,d)=>d.forEach(h=>l.add(h));Ta=new Map(km(e)),Um=n(),gn=t(),Ba=new Set(t().map(l=>gn[l])),gn=new Set(gn),jm=n(),n();let o=Pm(e),s=e();const i=()=>{let l=new Set;return t().forEach(d=>r(l,o[d])),r(l,t()),l};tr=xo(l=>{let d=xo(e).map(h=>h+96);if(d.length){let h=l>=s;d[0]-=32,d=ur(d),h&&(d=`Restricted[${d}]`);let f=i(),g=i(),p=!e();return{N:d,P:f,Q:g,M:p,R:h}}}),ji=n(),Yn=new Map;let a=t().concat(Ns(ji)).sort((l,d)=>l-d);a.forEach((l,d)=>{let h=e(),f=a[d]=h?a[d-h]:{V:[],M:new Map};f.V.push(l),ji.has(l)||Yn.set(l,f)});for(let{V:l,M:d}of new Set(Yn.values())){let h=[];for(let g of l){let p=tr.filter(A=>Eo(A,g)),m=h.find(({G:A})=>p.some(w=>A.has(w)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(g),r(m.G,p)}let f=h.flatMap(g=>Ns(g.G));for(let{G:g,V:p}of h){let m=new Set(f.filter(A=>!g.has(A)));for(let A of p)d.set(A,m)}}dn=new Set;let u=new Set;const c=l=>dn.has(l)?u.add(l):dn.add(l);for(let l of tr){for(let d of l.P)c(d);for(let d of l.Q)c(d)}for(let l of dn)!Yn.has(l)&&!u.has(l)&&Yn.set(l,zm);r(dn,Tm(dn)),xd=nk(e).map(l=>gk.from(l)).sort(sk),La=new Map;for(let l of xd){let d=[La];for(let h of l){let f=d.map(g=>{let p=g.get(h);return p||(p=new Map,g.set(h,p)),p});h===Lm?d.push(...f):d=f}for(let h of d)h.V=l}}function sl(e){return(Qm(e)?"":`${il(Gs([e]))} `)+Mm(e)}function il(e){return`"${e}"`}function yk(e){if(e.length>=4&&e[2]==Ad&&e[3]==Ad)throw new Error(`invalid label extension: "${ur(e.slice(0,4))}"`)}function bk(e){for(let t=e.lastIndexOf(95);t>0;)if(e[--t]!==95)throw new Error("underscore allowed only at start")}function wk(e){let t=e[0],n=bd.get(t);if(n)throw $r(`leading ${n}`);let r=e.length,o=-1;for(let s=1;s<r;s++){t=e[s];let i=bd.get(t);if(i){if(o==s)throw $r(`${n} + ${i}`);o=s+1,n=i}}if(o==r)throw $r(`trailing ${n}`)}function Gs(e,t=1/0,n=Mm){let r=[];vk(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];Qm(a)&&(r.push(ur(e.slice(o,i))),r.push(n(a)),o=i+1)}return r.push(ur(e.slice(o,s))),r.join("")}function vk(e,t){return ol(),gn.has(e)}function Qm(e){return ol(),jm.has(e)}function Ak(e){return Sk(xk(e,mk,Ik))}function xk(e,t,n){if(!e)return[];ol();let r=0;return e.split(Bm).map(o=>{let s=ok(o),i={input:s,offset:r};r+=s.length+1;try{let a=i.tokens=kk(s,t,n),u=a.length,c;if(!u)throw new Error("empty label");let l=i.output=a.flat();if(bk(l),!(i.emoji=u>1||a[0].is_emoji)&&l.every(d=>d<128))yk(l),c="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)c="Emoji";else{if(gn.has(l[0]))throw $r("leading combining mark");for(let g=1;g<u;g++){let p=a[g];if(!p.is_emoji&&gn.has(p[0]))throw $r(`emoji + combining mark: "${ur(a[g-1])} + ${Gs([p[0]])}"`)}wk(l);let h=Ns(new Set(d)),[f]=Ek(h);Pk(f,d),Ck(f,h),c=f.N}}i.type=c}catch(a){i.error=a}return i})}function Ck(e,t){let n,r=[];for(let o of t){let s=Yn.get(o);if(s===zm)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=>Eo(o,s)))throw new Error(`whole-script confusable: ${e.N}/${o.N}`)}}function Ek(e){let t=tr;for(let n of e){let r=t.filter(o=>Eo(o,n));if(!r.length)throw tr.some(o=>Eo(o,n))?Vm(t[0],n):Wm(n);if(t=r,r.length==1)break}return t}function Sk(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 ${il(Gs(t,63))}: ${o}`)}return ur(r)}).join(Bm)}function Wm(e){return new Error(`disallowed character: ${sl(e)}`)}function Vm(e,t){let n=sl(t),r=tr.find(o=>o.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function $r(e){return new Error(`illegal placement: ${e}`)}function Pk(e,t){for(let n of t)if(!Eo(e,n))throw Vm(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: ${sl(i)}`);if(s-r>wd)throw new Error(`excessive non-spacing marks: ${il(Gs(n.slice(r-1,s)))} (${s-r}/${wd})`);r=s}}}function kk(e,t,n){let r=[],o=[];for(e=e.slice().reverse();e.length;){let s=Mk(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=Ta.get(i);if(a)o.push(...a);else if(!Um.has(i))throw Wm(i)}}}return o.length&&r.push(t(o)),r}function Ik(e){return e.filter(t=>t!=Lm)}function Mk(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 Hm(e){return Ak(e)}Hm.parseError=e=>e;function Ok(e){return Hm(e)}const Nk=e=>{const{address:t}=e,n=Xh({address:t}),r=n.data?Ok(n.data):void 0,{data:o}=wC({name:r});return o?v("img",{alt:r,className:"size-4 rounded-full",src:o}):null};function Dk(e){const[t,n]=Fe(!1),{comment:r,issue:o,userIsCreator:s,onEditComment:i,handleDeleteComment:a}=e,u=Xu({issueId:o.phid,commentId:r.phid,notionId:r.notionId});return ee(_u,{onOpenChange:n,open:t,children:[v(Zu,{asChild:!0,children:v(mm,{className:be(!s&&"text-gray-400 hover:text-gray-200"),open:t})}),v(Vs,{className:"p-0",onClick:c=>{c.stopPropagation()},children:v(bo,{children:v(wo,{children:ee(vo,{children:[s?ee(st,{children:[v(ot,{onSelect:()=>{i(),n(!1)},children:"Edit comment"}),v(ot,{onSelect:()=>{a({issuePhid:o.phid,phid:r.phid}),n(!1)},children:"Delete comment"})]}):null,v(ot,{onSelect:()=>{u(),n(!1)},children:"Copy link"},"copy-link")]})})})})]})}function Rk(e){const{issue:t,comment:n,user:r,state:o,handleEditComment:s,handleDeleteComment:i,handleCommentClick:a}=e,[u,c]=Fe(!1),l=Xh({address:n.creatorAddress}).data??void 0,d=rS(n.creatorAddress),h=r.address===n.creatorAddress,f=l??(h?"You":d),g=ge(S=>{s(S),c(!1)},[s]),p=ge(()=>{c(!1)},[]),m=h?"bg-gray-300 text-gray-900 ml-4 text-right":"bg-gray-900 text-gray-50 mr-4",A=h?"text-right text-gray-600":"text-right text-gray-400",w=n.content.split(`
|
|
88
|
-
`).map((S,k)=>ee(dg,{children:[S,v("br",{})]},k));return ee("div",{className:be(m,"p-2 rounded-lg group"),onClick:()=>a(n,t),children:[ee("div",{className:be("flex text-left items-center justify-between",h?"text-gray-600":"text-gray-400"),children:[ee("div",{className:"flex items-center gap-1",children:[v(Nk,{address:n.creatorAddress}),h?"You":f]}),v(Dk,{comment:n,handleDeleteComment:i,issue:t,onEditComment:()=>c(!0),userIsCreator:h})]}),u?v("div",{className:"px-2",children:v(GP,{comment:n,handleDeleteComment:i,isEditing:u,issue:t,onCancel:p,onSubmitEditComment:g,state:o})}):v("div",{className:"px-2",children:v("p",{className:"text-inherit pb-1.5",children:w})}),v("span",{className:be(A,"block text-right mr-1 mt-1"),children:KP(n.lastEditedAt)})]})}function Fk(e){var t;const{notionId:n,issue:r,handleDeleteComment:o,handleEditComment:s,handleCommentClick:i,state:a,user:u}=e,c=(t=a.issues.find(l=>l.phid===r.phid))==null?void 0:t.comments;return c?v("ul",{children:c.filter(l=>l.notionId===n).map(l=>v("li",{className:"my-2",children:v(Rk,{comment:l,handleCommentClick:i,handleDeleteComment:o,handleEditComment:s,issue:r,state:a,user:u})},l.phid))}):null}function Tk(e){const{document:t,context:n,scopes:r,dispatch:o,selectedIssuePhid:s,selectedNotionId:i,selectedCommentPhid:a,setSelectedIssuePhid:u,setSelectedNotionId:c,setSelectedCommentPhid:l}=e,{user:d}=n,h=t.state.global,f=t.state.global.issues,g=qr(()=>f.flatMap(I=>I.comments),[f]),p=f.find(I=>I.phid===s)??null,m=g.find(I=>I.phid===a)??null,A=ge(I=>{I&&(u(s===I.phid?null:I.phid),c(null),l(null))},[u,s,c,l]),w=ge((I,F)=>{F&&(c(I.slugSuffix),u(F.phid),l(null))},[u,c,l]),S=ge((I,F)=>{!F||!I||(l(I.phid),u(F.phid),c(I.notionId))},[l,u,c]),k=ge(I=>{const{notionIds:F}=I.detail,B=Nd.hashKey(),q={phid:B,notionIds:F,createdAt:new Date().toISOString()};o(tn.createIssue(q)),u(B),c(F[0]??null),l(null)},[o,u,c,l]),y=ge(I=>{o(tn.deleteIssue(I)),I.phid===s&&(u(null),c(null),l(null))},[o,u,s,c,l]),x=ge(I=>{const{notionId:F,phid:B}=I.detail,q={phid:B,notionId:F};o(tn.addNotionId(q)),u(B),c(F),l(null)},[o,c,u,l]),E=ge(I=>{const{notionId:F,phid:B}=I.detail,q={phid:B,notionId:F};o(tn.removeNotionId(q)),i===F&&c(null),(m==null?void 0:m.notionId)===F&&l(null)},[o,i,m==null?void 0:m.notionId,c,l]),D=ge(I=>{o(tn.createComment(I)),u(I.issuePhid),c(I.notionId),l(I.phid)},[o,l,u,c]),O=ge(I=>{o(tn.deleteComment(I)),I.phid===a&&l(null)},[o,a,l]),T=ge(I=>{o(tn.editComment({...I,editedAt:new Date().toISOString()}))},[o]);Ue(()=>(window.addEventListener(Ot.CREATE_ISSUE,k),window.addEventListener(Ot.ADD_NOTION_ID_TO_ISSUE,x),window.addEventListener(Ot.REMOVE_NOTION_ID_FROM_ISSUE,E),()=>{window.removeEventListener(Ot.CREATE_ISSUE,k),window.removeEventListener(Ot.ADD_NOTION_ID_TO_ISSUE,x),window.removeEventListener(Ot.REMOVE_NOTION_ID_FROM_ISSUE,E)}),[k,x,E]);const W=!!d&&pg.includes(d.address);return v(iS,{children:W?ee("section",{className:"h-full p-2",children:[ee("h2",{className:"flex items-center relative mb-3",children:[v("span",{className:"w-full text-center text-gray-900 text-lg font-semibold",children:"Coordination Group"}),v("div",{className:"absolute right-0",children:v("svg",{className:"justify-self-end",height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",children:v("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"})})})]}),v(FP,{handleDeleteIssue:y,handleIssueClick:A,handleNodeClick:w,issues:f,scopes:r,selectedIssuePhid:s,selectedNotionId:i,setSelectedIssuePhid:u,setSelectedNotionId:c,state:h}),!!p&&!!i&&ee(st,{children:[v("div",{className:"h-px bg-gray-300 mt-3.5 mb-5"}),ee("div",{className:"bg-gray-100 p-2 rounded-xl",children:[v(Fk,{handleCommentClick:S,handleDeleteComment:O,handleEditComment:T,issue:p,notionId:i,state:h,user:d}),v(HP,{handleCreateComment:D,issue:p,notionId:i,state:h},"new-comment")]})]}),v("div",{className:"px-5",children:v("button",{className:"mt-2 bg-gray-900 text-gray-50 w-full flex justify-center items-center py-2 px-4 rounded-md",onClick:()=>Hp([]),children:"Create new issue"})})]}):v(US,{})})}const Gm={Component:Tk,documentTypes:["makerdao/feedback-issues"],config:{id:"makerdao/feedback-issues",disableExternalControls:!0,documentToolbarEnabled:!0,showSwitchboardLink:!0}},Bk=window.__VITE_ENVS.PH_CONNECT_ATLAS_BASE_URL||"https://mips-portal-staging-beta.vercel.app";async function Lk(){const e=new URL("/api/view-node-tree",Bk);try{return await(await fetch(e)).json()}catch(t){return Rd.error(t),{}}}const zk=yg(Lk),Uk=Dd(async e=>{const t=await e(zk);return Object.values(t).filter(r=>(r==null?void 0:r.type)==="scope")}),jk=()=>ja(Uk);function Qk(e){const t=jk(),[n,r]=Fe(null),[o,s]=Fe(null),[i,a]=Fe(null);return v(Gm.Component,{...e,selectedIssuePhid:n,setSelectedIssuePhid:r,selectedNotionId:o,setSelectedNotionId:s,selectedCommentPhid:i,setSelectedCommentPhid:a,scopes:t})}const Wk={...Gm,Component:Qk},Vk=window.__VITE_ENVS.LOCAL_DOCUMENT_EDITORS;async function Hk(){const e=await dl(()=>import("./editors-Cp2pNRWI.js").then(n=>n.e),__vite__mapDeps([0,1,2,3,4])),t=Object.values(e);if(t.push(Wk),!Vk)return t;try{const n=await dl(()=>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 qm=Hk(),Gk=Dd(qm),qk=bg(Gk),Kk=()=>ja(qk),Yk=()=>qm,Km=(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},$k=()=>{const e=Kk(),[t]=wg();return n=>e?Km(n,e,t.value):void 0},Jk=()=>{const e=Yk();return async t=>{const n=await e,r=Km(t,n);r&&"preload"in r.Component&&await r.Component.preload()}};function Cd(e){const[t,n]=Fe(!1);if(Ue(()=>{setTimeout(()=>{n(!0)},e.loadingTimeout??200)},[e]),!t)return null;const{customEditorLoader:r,...o}=e;return r?v(st,{children:r}):v(Zm,{...o})}function Qi({message:e}){return v("div",{className:"flex size-full items-center justify-center",children:v("h3",{className:"text-lg font-semibold",children:e})})}function _k(e){const{selectedNode:t,fileNodeDocument:n,selectedParentNode:r,document:o,setSelectedNode:s,onChange:i,onExport:a,onAddOperation:u,onOpenSwitchboardLink:c}=e,[l,d]=Fe(!1),h=ja(Pg),f=vg()||void 0,g=Ag(),{sign:p}=xg(),m=Cg(),A=$k(),w=n==null?void 0:n.documentType,S=qr(()=>w?m(w):void 0,[w,m]),k=qr(()=>w?A(w):void 0,[w,A]),[y,x,E]=Eg(S==null?void 0:S.reducer,o),D=qr(()=>({theme:h,user:f}),[h,f]),O=Sg(),T=(n==null?void 0:n.status)==="LOADING"||!y,W=k===void 0||!!y&&k&&!k.documentTypes.includes(y.documentType)&&!k.documentTypes.includes("*"),I=!!y&&(y.revision.global>0||y.revision.local>0),F=!!(y!=null&&y.clipboard.length);Sy({undo:q,redo:V,canUndo:I,canRedo:F});function B(R,H){const X=(K,se)=>{if(!t)return;const{prevState:J}=se;Ig(K,p,t.id,J,S==null?void 0:S.reducer,f).then(fe=>{var Ae;return(Ae=window.documentEditorDebugTools)==null||Ae.pushOperation(K),u(fe)}).catch(Rd.error)};x(kg(R,g,f),X,H)}Ue(()=>()=>{var R;(R=window.documentEditorDebugTools)==null||R.clear()},[]),Ue(()=>{var R;y&&((R=window.documentEditorDebugTools)==null||R.setDocument(y),i==null||i(y))},[y]);function q(){B(ll.undo())}function V(){B(ll.redo())}function $(){s(r)}if((n==null?void 0:n.status)==="ERROR")return v(Qi,{message:"Error loading document"});if(T||W)return v(Cd,{message:T?"Loading document":"Loading editor"});if((t==null?void 0:t.kind)!==Ds)return null;if(!S)return v(Qi,{message:`Document of type '${w}' is not supported`});if(k===null)return v(Qi,{message:`No editor available for document of type '${w}'`});const Y=k.Component,{disableExternalControls:Z,documentToolbarEnabled:ae,showSwitchboardLink:de}=k.config||{};return ee("div",{className:"relative h-full",id:"document-editor-context",children:[ae&&Z&&!l&&v(Xm,{onClose:$,onExport:a,onShowRevisionHistory:()=>d(!0),title:y.name,...de&&{onSwitchboardLinkClick:c}}),!Z&&ee("div",{className:"mb-4 flex justify-end gap-10",children:[v(Vr,{onClick:a,children:"Export"}),ee("div",{className:"flex gap-4",children:[v(Vr,{onClick:q,disabled:!I,children:"Undo"}),v(Vr,{onClick:V,disabled:!F,children:"Redo"})]}),v("div",{className:"flex gap-4",children:v(Vr,{onClick:$,children:"Close"})})]}),v(st,{children:l?v(eg,{documentTitle:y.name,documentId:t.id,globalOperations:y.operations.global,localOperations:y.operations.local,onClose:()=>d(!1)}):v(hg,{fallback:v(Cd,{}),children:v(Y,{error:E,context:D,document:y,documentNodeName:t.name,dispatch:B,onClose:$,onExport:a,canUndo:I,canRedo:F,undo:q,redo:V,onSwitchboardLinkClick:c,onShowRevisionHistory:()=>d(!0),isAllowedToCreateDocuments:(O==null?void 0:O.isAllowedToCreateDocuments)??!1,isAllowedToEditDocuments:(O==null?void 0:O.isAllowedToEditDocuments)??!1})})})]})}const Ed=({title:e,children:t,...n})=>ee("div",{...n,children:[e&&v("div",{className:"mb-4 text-base font-semibold text-gray-600",children:e}),v("div",{className:"flex flex-wrap gap-2",children:t})]});function Hn(e,t,n){let r=n.initialDeps??[],o;return()=>{var s,i,a,u;let c;n.key&&((s=n.debug)!=null&&s.call(n))&&(c=Date.now());const l=e();if(!(l.length!==r.length||l.some((f,g)=>r[g]!==f)))return o;r=l;let h;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(h=Date.now()),o=t(...l),n.key&&((a=n.debug)!=null&&a.call(n))){const f=Math.round((Date.now()-c)*100)/100,g=Math.round((Date.now()-h)*100)/100,p=g/16,m=(A,w)=>{for(A=String(A);A.length<w;)A=" "+A;return A};console.info(`%c⏱ ${m(g,5)} /${m(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(u=n==null?void 0:n.onChange)==null||u.call(n,o),o}}function Wi(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Zk=(e,t)=>Math.abs(e-t)<1,Xk=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},eI=e=>e,tI=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},nI=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=i=>{const{width:a,height:u}=i;t({width:Math.round(a),height:Math.round(u)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(i=>{const a=i[0];if(a!=null&&a.borderBoxSize){const u=a.borderBoxSize[0];if(u){o({width:u.inlineSize,height:u.blockSize});return}}o(n.getBoundingClientRect())});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},Sd={passive:!0},rI=typeof window>"u"?!0:"onscrollend"in window,oI=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const s=e.options.useScrollendEvent&&rI?()=>{}:Xk(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),i=c=>()=>{const{horizontal:l,isRtl:d}=e.options;o=l?n.scrollLeft*(d&&-1||1):n.scrollTop,s(),t(o,c)},a=i(!0),u=i(!1);return u(),n.addEventListener("scroll",a,Sd),n.addEventListener("scrollend",u,Sd),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",u)}},sI=(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"])},iI=(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 aI{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:eI,rangeExtractor:tI,onChange:()=>{},measureElement:sI,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=Hn(()=>(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 u=s.get(a.lane);if(u==null||a.end>u.end?s.set(a.lane,a):a.end<u.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=Hn(()=>[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=Hn(()=>[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(l=>{this.itemSizeCache.set(l.key,l.size)}));const u=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,u);for(let l=u;l<n;l++){const d=s(l),h=this.options.lanes===1?c[l-1]:this.getFurthestMeasurement(c,l),f=h?h.end+this.options.gap:r+o,g=a.get(d),p=typeof g=="number"?g:this.options.estimateSize(l),m=f+p,A=h?h.lane:l%this.options.lanes;c[l]={index:l,start:f,size:p,end:m,key:d,lane:A}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Hn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,o)=>this.range=n.length>0&&r>0?uI({measurements:n,outerSize:r,scrollOffset:o}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=Hn(()=>[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=Hn(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let s=0,i=n.length;s<i;s++){const a=n[s],u=r[a];o.push(u)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Wi(r[Ym(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+o&&(r="end"),r==="end"&&(n-=o);const i=this.options.horizontal?"scrollWidth":"scrollHeight",u=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-o;return Math.max(Math.min(u,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=o.start-this.options.scrollPaddingStart+(o.size-s)/2;switch(r){case"center":return[this.getOffsetForAlignment(a,r),r];case"end":return[this.getOffsetForAlignment(o.end+this.options.scrollPaddingEnd,r),r];default:return[this.getOffsetForAlignment(o.start-this.options.scrollPaddingStart,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[c]=Wi(this.getOffsetForIndex(n,a));Zk(c,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 Ym=(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 uI({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,s=Ym(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 Pd=typeof document<"u"?b.useLayoutEffect:b.useEffect;function lI(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 aI(n));return r.setOptions(n),Pd(()=>r._didMount(),[]),Pd(()=>r._willUpdate()),r}function kd(e){return lI({observeElementRect:nI,observeElementOffset:oI,scrollToFn:iI,...e})}const cI=()=>{const[e,t]=Fe({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,Vi=256,Id=48,dI=420;function fI(e){const t=nr(null),{t:n}=Rs(),r=cI(),{fileNodes:o}=e,s=r.innerWidth-dI,i=Math.floor(s/(Vi+Wr))||1,a=Math.ceil(o.length/i),u=kd({count:a,getScrollElement:()=>t.current,estimateSize:f=>f>0?Id+Wr:Id,overscan:5}),c=kd({horizontal:!0,count:i,getScrollElement:()=>t.current,estimateSize:f=>f>0?Vi+Wr:Vi,overscan:5}),l=(f,g)=>f*i+g,d=(f,g)=>{const p=l(f,g);return o[p]||null};if(o.length===0)return v("div",{className:"mb-8 text-sm text-gray-400",children:n("folderView.sections.documents.empty")});const h=(f,g)=>{const p=d(f,g);return p?v("div",{style:{marginLeft:g===0?0:Wr},children:Jr(tg,{...e,key:p.id,uiNode:p})}):null};return v("div",{ref:t,style:{height:"400px",width:"100%",overflow:"auto"},children:v("div",{style:{height:`${u.getTotalSize()}px`,width:`${c.getTotalSize()}px`,position:"relative"},children:u.getVirtualItems().map(f=>v(re.Fragment,{children:c.getVirtualItems().map(g=>v("div",{style:{position:"absolute",top:0,left:0,marginTop:f.index===0?0:Wr,width:`${g.size}px`,height:`${f.size}px`,transform:`translateX(${g.start}px) translateY(${f.start}px)`},children:h(f.index,g.index)},g.key))},f.key))})})}function hI(e){const{t}=Rs(),{selectedParentNode:n}=e,{isDropTarget:r,dropProps:o}=ng({...e,uiNode:n}),s=(n==null?void 0:n.children.filter(a=>a.kind===rg).sort(hl))??[],i=(n==null?void 0:n.children.filter(a=>a.kind===Ds).sort(hl))??[];return ee("div",{...o,className:qi("rounded-md border-2 border-transparent p-2",r&&"border-dashed border-blue-100"),children:[v(Ed,{title:t("folderView.sections.folders.title"),className:"mb-4",children:s.length>0?s.map(a=>Jr(og,{...e,key:a.id,uiNode:a})):v("div",{className:"mb-8 text-sm text-gray-400",children:t("folderView.sections.folders.empty")})}),v(Ed,{title:t("folderView.sections.documents.title"),children:v("div",{className:qi("w-full",i.length>0?"min-h-[400px]":"min-h-14"),children:v(fI,{...e,fileNodes:i})})})]})}const pI=()=>{const{showModal:e}=Fd(),[,t]=Mg();return ee(sg,{children:[v($s,{onClick:()=>{t(!0)},children:v(Js,{i18nKey:"footer.cookiePolicy"})}),v($s,{onClick:()=>e("disclaimerModal",{}),children:v(Js,{i18nKey:"footer.disclaimer"})}),v($s,{id:"ph-logo-link",onClick:()=>Bg("https://www.powerhouse.inc/"),children:v(Js,{i18nKey:"footer.builtWith",components:{icon:v(Gn,{name:"PowerhouseLogoSmall",size:16,className:"mx-1"})}})})]})},mI=[{id:"project",label:".project",icon:v(Gn,{name:"Project",color:"#FF6A55",size:16})},{id:"budget",label:".budget",icon:v(Gn,{name:"BarChart",color:"#8E55EA",size:16})},{id:"profile",label:".profile",icon:v(Gn,{name:"Person",color:"#3E90F0",size:16})},{id:"legal",label:".legal",icon:v(Gn,{name:"Briefcase",color:"#4BAB71",size:16})},{id:"atlas",label:".Atlas",icon:v(Gn,{name:"Globe",color:"#FF8A00",size:16})}],gI=()=>{const{t:e}=Rs();return v(ig,{className:"max-w-searchbar-width m-4 shrink-0 bg-gray-100",placeholder:e("searchbar.placeholder"),filterLabel:e("searchbar.filterLabel"),filterItems:mI})};function yI(e){const t=e[0];if(!t)return;if(t.kind!==ug)throw new Error("Node path is invalid, first node is not a drive node.");const n=bI(t),r=e.slice(1).map(s=>encodeURIComponent(s.slug||s.name));return[n,...r].join("/")}function bI(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 u=i.children.find(c=>c.slug===a||c.name===a);if(!u){console.error("Node not found:",a);break}i=u}return i}const wI=()=>{const e=Og(),t=Ng(),{search:n,pathname:r}=t,o=Dg(),{driveNodes:s,selectedNode:i,selectedNodePath:a,setSelectedNode:u}=ag(),c=o.driveId,l=o["*"],d=Md(s,c,l),h=yI(a);Ue(()=>{!h||h===r||e({pathname:h,search:n})},[n,e,h]),Ue(()=>{i||!d||u(d)},[i,d,u]),Ue(()=>{const f=Md(s,c,l);f&&u(f)},[s,c,l,u])},vI=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,u)=>{const c=u;return[...a,..._s.validateInitialState(r.state[c].initialValue,c!=="global").map(l=>({...l,message:`${l.message}. Scope: ${c}`,details:{...l.details,scope:c}}))]},[]),s=Object.keys(r.state).reduce((a,u)=>{var d;const c=u,l=c==="global";return[...a,..._s.validateStateSchemaName(r.state[c].schema,e.name||((d=e.state.global)==null?void 0:d.name)||"",l?"":c,!l).map(h=>({...h,message:`${h.message}. Scope: ${c}`,details:{...h.details,scope:c}}))]},[]),i=_s.validateModules(r.modules);return[...o,...s,...i]},AI=e=>e==="RealWorldAssets"?"RWA Portfolio":e;function RI(){const[e]=Rg(),{t}=Rs(),n=fl(),{selectedNode:r,selectedDriveNode:o,selectedParentNode:s,isRemoteDrive:i,isAllowedToCreateDocuments:a,fileNodeDocument:u,selectedDocument:c,documentModels:l,setSelectedNode:d,openSwitchboardLink:h,setSelectedDocument:f,addOperationToSelectedDocument:g,addFile:p,renameNode:m,getDocumentModel:A}=fl(),{showModal:w}=Fd(),S=Jk();wI(),Ue(()=>{if(!l)return;const O=window.requestIdleCallback??setTimeout,T=window.cancelIdleCallback??clearTimeout,W=O(async()=>{for(const I of l)await S(I.documentModel.id)});return()=>T(W)},[l,S]),Ue(()=>{var O;return(O=window.electronAPI)==null?void 0:O.handleFileOpen(async T=>{!o||(r==null?void 0:r.kind)!==Ds||await p(T.content,o.id,T.name,r.parentFolder)})},[o,r,p]);async function k(O){if(!c)throw new Error("No document selected");if(!g)throw new Error("No add operation function defined");await g(O)}function y(O){o&&w("createDocument",{documentModel:O,selectedParentNode:s,setSelectedNode:d})}function x(O){const T=vI(O);if(T.length)w("confirmationModal",{title:t("modals.exportDocumentWithErrors.title"),body:ee("div",{children:[v("p",{children:t("modals.exportDocumentWithErrors.body")}),v("ul",{className:"mt-4 flex list-disc flex-col items-start px-4 text-xs",children:T.map((W,I)=>v("li",{children:W.message},I))})]}),cancelLabel:t("common.cancel"),continueLabel:t("common.export"),onCancel(W){W()},onContinue(W){return W(),cl(O,A)}});else return cl(O,A)}return ee("div",{className:"flex h-full flex-col overflow-auto bg-gray-100 p-6 pb-3",id:"content-view",children:[u?v("div",{className:"flex-1 rounded-2xl bg-gray-50 p-4",children:v(_k,{...n,document:c,onChange:O=>{if(f(O),r&&O.name!==""&&r.name!==O.name)return m(r.driveId,r.id,O.name)},onExport:()=>c&&x(c),onAddOperation:k,...i&&{onOpenSwitchboardLink:async()=>{await h(r)}}})}):v(st,{children:ee("div",{className:"grow overflow-auto rounded-2xl bg-gray-50 p-2",children:[v(lg,{...n}),e.content.showSearchBar&&v(gI,{}),ee("div",{className:"px-4",children:[v("div",{className:"mb-5",children:v(hI,{...n})}),a&&ee(st,{children:[v("h3",{className:"mb-3 mt-4 text-xl font-bold text-gray-600",children:"New document"}),v("div",{className:"flex w-full flex-wrap gap-4",children:l==null?void 0:l.map(O=>v(Vr,{"aria-details":O.documentModel.description,className:"bg-gray-200 text-slate-800",onClick:()=>y(O),children:v("span",{className:"text-sm",children:AI(O.documentModel.name)})},O.documentModel.id))})]})]})]})}),v("div",{className:"flex w-full flex-row justify-end pr-3 pt-3",children:v(pI,{})})]})}export{RI as default};
|
|
92
|
-
//# sourceMappingURL=content-3KD38dCg.js.map
|