@mcp-use/inspector 0.5.3-canary.8 → 0.5.3

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.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/winston-aczCAaEE.js","assets/__vite-browser-external-DFygW7-s.js","assets/index-DRz5BQNA.js","assets/path-C9FudP8b.js","assets/index-8Ks-K928.js","assets/index-CVk-gUlK.js","assets/chunk-VL2OQCWN-BFKzE0YG.js","assets/embeddings-Bb7BB9oH.js","assets/index-C0BW8vHr.js","assets/index-DueuvgmI.js","assets/langfuse-C4HKZ3NL-1laIPiUg.js"])))=>i.map(i=>d[i]);
2
- var E6=Object.defineProperty;var S6=(t,e,r)=>e in t?E6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var mp=(t,e,r)=>S6(t,typeof e!="symbol"?e+"":e,r);function x6(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in t)){const s=Object.getOwnPropertyDescriptor(n,a);s&&Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(a){if(a.ep)return;a.ep=!0;const s=r(a);fetch(a.href,s)}})();function fc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function SEe(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var a=!1;try{a=this instanceof n}catch{}return a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var jv={exports:{}},gu={};var $k;function w6(){if($k)return gu;$k=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,a,s){var l=null;if(s!==void 0&&(l=""+s),a.key!==void 0&&(l=""+a.key),"key"in a){s={};for(var c in a)c!=="key"&&(s[c]=a[c])}else s=a;return a=s.ref,{$$typeof:t,type:n,key:l,ref:a!==void 0?a:null,props:s}}return gu.Fragment=e,gu.jsx=r,gu.jsxs=r,gu}var Bk;function _6(){return Bk||(Bk=1,jv.exports=w6()),jv.exports}var g=_6();const T6="modulepreload",R6=function(t){return"/inspector/"+t},qk={},cs=function(e,r,n){let a=Promise.resolve();if(r&&r.length>0){let d=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");a=d(r.map(f=>{if(f=R6(f),f in qk)return;qk[f]=!0;const m=f.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":T6,m||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),m)return new Promise((y,w)=>{v.addEventListener("load",y),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return a.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};var C6=Object.defineProperty,Ze=(t,e)=>C6(t,"name",{value:e,configurable:!0}),Hk=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),vl={};async function a2(){if(typeof process<"u")try{const t=await cs(()=>import("./__vite-browser-external-DFygW7-s.js").then(r=>r.o),[]),e=await cs(()=>import("./path-C9FudP8b.js").then(r=>r.p),[]);return{fs:t.default,path:e.default}}catch{return{fs:null,path:null}}return{fs:null,path:null}}Ze(a2,"getNodeModules");var Pn=null;function o2(){if(typeof Hk<"u")try{Pn=Hk("winston")}catch{}}Ze(o2,"loadWinstonSync");async function i2(){return Pn||(Pn=await cs(()=>import("./winston-aczCAaEE.js").then(t=>t.w),__vite__mapDeps([0,1,2,3]))),Pn}Ze(i2,"getWinston");var g_="mcp-use";function em(){try{return typeof navigator<"u"&&navigator.userAgent?.includes("Cloudflare-Workers")||typeof globalThis.EdgeRuntime<"u"||typeof globalThis.Deno<"u"?!1:typeof process<"u"&&!0&&typeof __dirname<"u"}catch{return!1}}Ze(em,"isNodeJSEnvironment");var Hl,A6=(Hl=class{_level;name;constructor(e=g_,r="info"){this.name=e,this._level=r}shouldLog(e){const r=["error","warn","info","http","verbose","debug","silly"],n=r.indexOf(this._level);return r.indexOf(e)<=n}formatMessage(e,r){return`${new Date().toLocaleTimeString("en-US",{hour12:!1})} [${this.name}] ${e}: ${r}`}error(e){this.shouldLog("error")&&console.error(this.formatMessage("error",e))}warn(e){this.shouldLog("warn")&&console.warn(this.formatMessage("warn",e))}info(e){this.shouldLog("info")&&console.info(this.formatMessage("info",e))}debug(e){this.shouldLog("debug")&&console.debug(this.formatMessage("debug",e))}http(e){this.shouldLog("http")&&console.log(this.formatMessage("http",e))}verbose(e){this.shouldLog("verbose")&&console.log(this.formatMessage("verbose",e))}silly(e){this.shouldLog("silly")&&console.log(this.formatMessage("silly",e))}get level(){return this._level}set level(e){this._level=e}},Ze(Hl,"SimpleConsoleLogger"),Hl);function Mp(t){switch((typeof process<"u"&&vl?t:void 0)?.trim()){case"2":return"debug";case"1":return"info";default:return"info"}}Ze(Mp,"resolveLevel");var wo,s2=(wo=class{static get(e=g_){if(!em()){if(!this.simpleInstances[e]){const r=typeof process<"u"&&vl?.DEBUG||void 0;this.simpleInstances[e]=new A6(e,Mp(r))}return this.simpleInstances[e]}if(!this.instances[e]){if(!Pn)throw new Error("Winston not loaded - call Logger.configure() first");const{createLogger:r,format:n}=Pn,{combine:a,timestamp:s,label:l,colorize:c,splat:d}=n;this.instances[e]=r({level:Mp(vl.DEBUG),format:a(c(),d(),l({label:e}),s({format:"HH:mm:ss"}),this.getFormatter()),transports:[]})}return this.instances[e]}static getFormatter(){if(!Pn)throw new Error("Winston not loaded");const{format:e}=Pn,{printf:r}=e,n=r(({level:l,message:c,label:d,timestamp:f})=>`${f} [${d}] ${l}: ${c}`),a=r(({level:l,message:c,label:d,timestamp:f})=>`${f} [${d}] ${l.toUpperCase()}: ${c}`),s=r(({level:l,message:c,label:d,timestamp:f})=>`${f} [${d}] ${l.toUpperCase()}: ${c}`);switch(this.currentFormat){case"minimal":return n;case"detailed":return a;case"emoji":return s;default:return n}}static async configure(e={}){const{level:r,console:n=!0,file:a,format:s="minimal"}=e,l=typeof process<"u"&&vl?.DEBUG||void 0,c=r??Mp(l);if(this.currentFormat=s,!em()){Object.values(this.simpleInstances).forEach(R=>{R.level=c});return}if(await i2(),!Pn)throw new Error("Failed to load winston");const d=this.get();d.level=c;const f=d;if(f.clear(),n&&f.add(new Pn.transports.Console),a){const{fs:R,path:x}=await a2();if(R&&x){const _=x.dirname(x.resolve(a));R.existsSync(_)||R.mkdirSync(_,{recursive:!0}),f.add(new Pn.transports.File({filename:a}))}}const{format:m}=Pn,{combine:h,timestamp:v,label:y,colorize:w,splat:S}=m;Object.values(this.instances).forEach(R=>{R&&"format"in R&&(R.level=c,R.format=h(w(),S(),y({label:g_}),v({format:"HH:mm:ss"}),this.getFormatter()))})}static setDebug(e){let r;e===2||e===!0?r="debug":r="info",Object.values(this.simpleInstances).forEach(n=>{n.level=r}),Object.values(this.instances).forEach(n=>{n&&(n.level=r)}),typeof process<"u"&&vl&&(vl.DEBUG=e?e===!0?"2":String(e):"0")}static setFormat(e){this.currentFormat=e,this.configure({format:e})}},Ze(wo,"Logger"),mp(wo,"instances",{}),mp(wo,"simpleInstances",{}),mp(wo,"currentFormat","minimal"),wo);em()&&(o2(),Pn&&s2.configure());var Le=s2.get(),At;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const s={};for(const l of a)s[l]=l;return s},t.getValidEnumValues=a=>{const s=t.objectKeys(a).filter(c=>typeof a[a[c]]!="number"),l={};for(const c of s)l[c]=a[c];return t.objectValues(l)},t.objectValues=a=>t.objectKeys(a).map(function(s){return a[s]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&s.push(l);return s},t.find=(a,s)=>{for(const l of a)if(s(l))return l},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(At||(At={}));var Vk;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Vk||(Vk={}));const qe=At.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vi=t=>{switch(typeof t){case"undefined":return qe.undefined;case"string":return qe.string;case"number":return Number.isNaN(t)?qe.nan:qe.number;case"boolean":return qe.boolean;case"function":return qe.function;case"bigint":return qe.bigint;case"symbol":return qe.symbol;case"object":return Array.isArray(t)?qe.array:t===null?qe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?qe.promise:typeof Map<"u"&&t instanceof Map?qe.map:typeof Set<"u"&&t instanceof Set?qe.set:typeof Date<"u"&&t instanceof Date?qe.date:qe.object;default:return qe.unknown}},Ie=At.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class na extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(s){return s.message},n={_errors:[]},a=s=>{for(const l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let c=n,d=0;for(;d<l.path.length;){const f=l.path[d];d===l.path.length-1?(c[f]=c[f]||{_errors:[]},c[f]._errors.push(r(l))):c[f]=c[f]||{_errors:[]},c=c[f],d++}}};return a(this),n}static assert(e){if(!(e instanceof na))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,At.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const s=a.path[0];r[s]=r[s]||[],r[s].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}na.create=t=>new na(t);const ad=(t,e)=>{let r;switch(t.code){case Ie.invalid_type:t.received===qe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,At.jsonStringifyReplacer)}`;break;case Ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${At.joinValues(t.keys,", ")}`;break;case Ie.invalid_union:r="Invalid input";break;case Ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${At.joinValues(t.options)}`;break;case Ie.invalid_enum_value:r=`Invalid enum value. Expected ${At.joinValues(t.options)}, received '${t.received}'`;break;case Ie.invalid_arguments:r="Invalid function arguments";break;case Ie.invalid_return_type:r="Invalid function return type";break;case Ie.invalid_date:r="Invalid date";break;case Ie.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:At.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ie.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ie.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ie.custom:r="Invalid input";break;case Ie.invalid_intersection_types:r="Intersection results could not be merged";break;case Ie.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ie.not_finite:r="Number must be finite";break;default:r=e.defaultError,At.assertNever(t)}return{message:r}};let N6=ad;function v_(){return N6}const b_=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,s=[...r,...a.path||[]],l={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let c="";const d=n.filter(f=>!!f).slice().reverse();for(const f of d)c=f(l,{data:e,defaultError:c}).message;return{...a,path:s,message:c}};function Ue(t,e){const r=v_(),n=b_({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===ad?void 0:ad].filter(a=>!!a)});t.common.issues.push(n)}class un{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return nt;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const s=await a.key,l=await a.value;n.push({key:s,value:l})}return un.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:s,value:l}=a;if(s.status==="aborted"||l.status==="aborted")return nt;s.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(n[s.value]=l.value)}return{status:e.value,value:n}}}const nt=Object.freeze({status:"aborted"}),_u=t=>({status:"dirty",value:t}),_n=t=>({status:"valid",value:t}),Gk=t=>t.status==="aborted",Wk=t=>t.status==="dirty",tc=t=>t.status==="valid",tm=t=>typeof Promise<"u"&&t instanceof Promise;var Xe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Xe||(Xe={}));class qa{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Yk=(t,e)=>{if(tc(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new na(t.common.issues);return this._error=r,this._error}}};function ft(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(l,c)=>{const{message:d}=t;return l.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:d??n??c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:d??r??c.defaultError}},description:a}}class wt{get description(){return this._def.description}_getType(e){return vi(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:vi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new un,ctx:{common:e.parent.common,data:e.data,parsedType:vi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(tm(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vi(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Yk(n,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vi(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return tc(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>tc(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vi(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(tm(a)?a:Promise.resolve(a));return Yk(n,s)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,s)=>{const l=e(a),c=()=>s.addIssue({code:Ie.custom,...n(a)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(c(),!1)):l?!0:(c(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new ys({schema:this,typeName:lt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ro.create(this,this._def)}nullable(){return Es.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fa.create(this)}promise(){return ld.create(this,this._def)}or(e){return om.create([this,e],this._def)}and(e){return im.create(this,e,this._def)}transform(e){return new ys({...ft(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new cm({...ft(this._def),innerType:this,defaultValue:r,typeName:lt.ZodDefault})}brand(){return new d2({typeName:lt.ZodBranded,type:this,...ft(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new um({...ft(this._def),innerType:this,catchValue:r,typeName:lt.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return YT.create(this,e)}readonly(){return dm.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const k6=/^c[^\s-]{8,}$/i,I6=/^[0-9a-z]+$/,O6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,D6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,L6=/^[a-z0-9_-]{21}$/i,M6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,P6=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,j6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,U6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Uv;const F6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,z6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,B6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,q6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,H6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,l2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",V6=new RegExp(`^${l2}$`);function c2(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function G6(t){return new RegExp(`^${c2(t)}$`)}function W6(t){let e=`${l2}T${c2(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Y6(t,e){return!!((e==="v4"||!e)&&F6.test(t)||(e==="v6"||!e)&&$6.test(t))}function K6(t,e){if(!M6.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Z6(t,e){return!!((e==="v4"||!e)&&z6.test(t)||(e==="v6"||!e)&&B6.test(t))}class To extends wt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==qe.string){const s=this._getOrReturnCtx(e);return Ue(s,{code:Ie.invalid_type,expected:qe.string,received:s.parsedType}),nt}const n=new un;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,c=e.data.length<s.value;(l||c)&&(a=this._getOrReturnCtx(e,a),l?Ue(a,{code:Ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&Ue(a,{code:Ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")j6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"email",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Uv||(Uv=new RegExp(U6,"u")),Uv.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"emoji",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")D6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"uuid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")L6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"nanoid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")k6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"cuid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")I6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"cuid2",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")O6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"ulid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),Ue(a,{validation:"url",code:Ie.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"regex",code:Ie.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?W6(s).test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?V6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?G6(s).test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?P6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"duration",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Y6(e.data,s.version)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"ip",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?K6(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"jwt",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Z6(e.data,s.version)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"cidr",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?q6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"base64",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?H6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"base64url",code:Ie.invalid_string,message:s.message}),n.dirty()):At.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:Ie.invalid_string,...Xe.errToObj(n)})}_addCheck(e){return new To({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Xe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Xe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Xe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Xe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Xe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Xe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Xe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Xe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Xe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Xe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Xe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Xe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Xe.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Xe.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Xe.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Xe.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Xe.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Xe.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Xe.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Xe.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Xe.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Xe.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Xe.errToObj(r)})}nonempty(e){return this.min(1,Xe.errToObj(e))}trim(){return new To({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new To({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new To({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}To.create=t=>new To({checks:[],typeName:lt.ZodString,coerce:t?.coerce??!1,...ft(t)});function X6(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,s=Number.parseInt(t.toFixed(a).replace(".","")),l=Number.parseInt(e.toFixed(a).replace(".",""));return s%l/10**a}class rc extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==qe.number){const s=this._getOrReturnCtx(e);return Ue(s,{code:Ie.invalid_type,expected:qe.number,received:s.parsedType}),nt}let n;const a=new un;for(const s of this._def.checks)s.kind==="int"?At.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?X6(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.not_finite,message:s.message}),a.dirty()):At.assertNever(s);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Xe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Xe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Xe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Xe.toString(r))}setLimit(e,r,n,a){return new rc({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Xe.toString(a)}]})}_addCheck(e){return new rc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Xe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Xe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Xe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Xe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Xe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Xe.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Xe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Xe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Xe.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&At.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}rc.create=t=>new rc({checks:[],typeName:lt.ZodNumber,coerce:t?.coerce||!1,...ft(t)});class od extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==qe.bigint)return this._getInvalidInput(e);let n;const a=new un;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):At.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return Ue(r,{code:Ie.invalid_type,expected:qe.bigint,received:r.parsedType}),nt}gte(e,r){return this.setLimit("min",e,!0,Xe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Xe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Xe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Xe.toString(r))}setLimit(e,r,n,a){return new od({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Xe.toString(a)}]})}_addCheck(e){return new od({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Xe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Xe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Xe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Xe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Xe.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}od.create=t=>new od({checks:[],typeName:lt.ZodBigInt,coerce:t?.coerce??!1,...ft(t)});class y_ extends wt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==qe.boolean){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.boolean,received:n.parsedType}),nt}return _n(e.data)}}y_.create=t=>new y_({typeName:lt.ZodBoolean,coerce:t?.coerce||!1,...ft(t)});class rm extends wt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==qe.date){const s=this._getOrReturnCtx(e);return Ue(s,{code:Ie.invalid_type,expected:qe.date,received:s.parsedType}),nt}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Ue(s,{code:Ie.invalid_date}),nt}const n=new un;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):At.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new rm({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Xe.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Xe.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}rm.create=t=>new rm({checks:[],coerce:t?.coerce||!1,typeName:lt.ZodDate,...ft(t)});class Kk extends wt{_parse(e){if(this._getType(e)!==qe.symbol){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.symbol,received:n.parsedType}),nt}return _n(e.data)}}Kk.create=t=>new Kk({typeName:lt.ZodSymbol,...ft(t)});class nm extends wt{_parse(e){if(this._getType(e)!==qe.undefined){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.undefined,received:n.parsedType}),nt}return _n(e.data)}}nm.create=t=>new nm({typeName:lt.ZodUndefined,...ft(t)});class am extends wt{_parse(e){if(this._getType(e)!==qe.null){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.null,received:n.parsedType}),nt}return _n(e.data)}}am.create=t=>new am({typeName:lt.ZodNull,...ft(t)});class id extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return _n(e.data)}}id.create=t=>new id({typeName:lt.ZodAny,...ft(t)});class jl extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _n(e.data)}}jl.create=t=>new jl({typeName:lt.ZodUnknown,...ft(t)});class wi extends wt{_parse(e){const r=this._getOrReturnCtx(e);return Ue(r,{code:Ie.invalid_type,expected:qe.never,received:r.parsedType}),nt}}wi.create=t=>new wi({typeName:lt.ZodNever,...ft(t)});class Zk extends wt{_parse(e){if(this._getType(e)!==qe.undefined){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.void,received:n.parsedType}),nt}return _n(e.data)}}Zk.create=t=>new Zk({typeName:lt.ZodVoid,...ft(t)});class Fa extends wt{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==qe.array)return Ue(r,{code:Ie.invalid_type,expected:qe.array,received:r.parsedType}),nt;if(a.exactLength!==null){const l=r.data.length>a.exactLength.value,c=r.data.length<a.exactLength.value;(l||c)&&(Ue(r,{code:l?Ie.too_big:Ie.too_small,minimum:c?a.exactLength.value:void 0,maximum:l?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(Ue(r,{code:Ie.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(Ue(r,{code:Ie.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,c)=>a.type._parseAsync(new qa(r,l,r.path,c)))).then(l=>un.mergeArray(n,l));const s=[...r.data].map((l,c)=>a.type._parseSync(new qa(r,l,r.path,c)));return un.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Fa({...this._def,minLength:{value:e,message:Xe.toString(r)}})}max(e,r){return new Fa({...this._def,maxLength:{value:e,message:Xe.toString(r)}})}length(e,r){return new Fa({...this._def,exactLength:{value:e,message:Xe.toString(r)}})}nonempty(e){return this.min(1,e)}}Fa.create=(t,e)=>new Fa({type:t,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...ft(e)});function bl(t){if(t instanceof Rr){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Ro.create(bl(n))}return new Rr({...t._def,shape:()=>e})}else return t instanceof Fa?new Fa({...t._def,type:bl(t.element)}):t instanceof Ro?Ro.create(bl(t.unwrap())):t instanceof Es?Es.create(bl(t.unwrap())):t instanceof Ao?Ao.create(t.items.map(e=>bl(e))):t}class Rr extends wt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=At.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==qe.object){const f=this._getOrReturnCtx(e);return Ue(f,{code:Ie.invalid_type,expected:qe.object,received:f.parsedType}),nt}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof wi&&this._def.unknownKeys==="strip"))for(const f in a.data)l.includes(f)||c.push(f);const d=[];for(const f of l){const m=s[f],h=a.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new qa(a,h,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof wi){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of c)d.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(f==="strict")c.length>0&&(Ue(a,{code:Ie.unrecognized_keys,keys:c}),n.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of c){const h=a.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new qa(a,h,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of d){const h=await m.key,v=await m.value;f.push({key:h,value:v,alwaysSet:m.alwaysSet})}return f}).then(f=>un.mergeObjectSync(n,f)):un.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return Xe.errToObj,new Rr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Xe.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new Rr({...this._def,unknownKeys:"strip"})}passthrough(){return new Rr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Rr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Rr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lt.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Rr({...this._def,catchall:e})}pick(e){const r={};for(const n of At.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Rr({...this._def,shape:()=>r})}omit(e){const r={};for(const n of At.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new Rr({...this._def,shape:()=>r})}deepPartial(){return bl(this)}partial(e){const r={};for(const n of At.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}return new Rr({...this._def,shape:()=>r})}required(e){const r={};for(const n of At.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Ro;)s=s._def.innerType;r[n]=s}return new Rr({...this._def,shape:()=>r})}keyof(){return u2(At.objectKeys(this.shape))}}Rr.create=(t,e)=>new Rr({shape:()=>t,unknownKeys:"strip",catchall:wi.create(),typeName:lt.ZodObject,...ft(e)});Rr.strictCreate=(t,e)=>new Rr({shape:()=>t,unknownKeys:"strict",catchall:wi.create(),typeName:lt.ZodObject,...ft(e)});Rr.lazycreate=(t,e)=>new Rr({shape:t,unknownKeys:"strip",catchall:wi.create(),typeName:lt.ZodObject,...ft(e)});class om extends wt{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;const l=s.map(c=>new na(c.ctx.common.issues));return Ue(r,{code:Ie.invalid_union,unionErrors:l}),nt}if(r.common.async)return Promise.all(n.map(async s=>{const l={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(a);{let s;const l=[];for(const d of n){const f={...r,common:{...r.common,issues:[]},parent:null},m=d._parseSync({data:r.data,path:r.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const c=l.map(d=>new na(d));return Ue(r,{code:Ie.invalid_union,unionErrors:c}),nt}}get options(){return this._def.options}}om.create=(t,e)=>new om({options:t,typeName:lt.ZodUnion,...ft(e)});const So=t=>t instanceof S_?So(t.schema):t instanceof ys?So(t.innerType()):t instanceof lm?[t.value]:t instanceof bs?t.options:t instanceof x_?At.objectValues(t.enum):t instanceof cm?So(t._def.innerType):t instanceof nm?[void 0]:t instanceof am?[null]:t instanceof Ro?[void 0,...So(t.unwrap())]:t instanceof Es?[null,...So(t.unwrap())]:t instanceof d2||t instanceof dm?So(t.unwrap()):t instanceof um?So(t._def.innerType):[];class WT extends wt{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==qe.object)return Ue(r,{code:Ie.invalid_type,expected:qe.object,received:r.parsedType}),nt;const n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(Ue(r,{code:Ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),nt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const a=new Map;for(const s of r){const l=So(s.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of l){if(a.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);a.set(c,s)}}return new WT({typeName:lt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:a,...ft(n)})}}function E_(t,e){const r=vi(t),n=vi(e);if(t===e)return{valid:!0,data:t};if(r===qe.object&&n===qe.object){const a=At.objectKeys(e),s=At.objectKeys(t).filter(c=>a.indexOf(c)!==-1),l={...t,...e};for(const c of s){const d=E_(t[c],e[c]);if(!d.valid)return{valid:!1};l[c]=d.data}return{valid:!0,data:l}}else if(r===qe.array&&n===qe.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<t.length;s++){const l=t[s],c=e[s],d=E_(l,c);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===qe.date&&n===qe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class im extends wt{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(s,l)=>{if(Gk(s)||Gk(l))return nt;const c=E_(s.value,l.value);return c.valid?((Wk(s)||Wk(l))&&r.dirty(),{status:r.value,value:c.data}):(Ue(n,{code:Ie.invalid_intersection_types}),nt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,l])=>a(s,l)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}im.create=(t,e,r)=>new im({left:t,right:e,typeName:lt.ZodIntersection,...ft(r)});class Ao extends wt{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.array)return Ue(n,{code:Ie.invalid_type,expected:qe.array,received:n.parsedType}),nt;if(n.data.length<this._def.items.length)return Ue(n,{code:Ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nt;!this._def.rest&&n.data.length>this._def.items.length&&(Ue(n,{code:Ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((l,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new qa(n,l,n.path,c)):null}).filter(l=>!!l);return n.common.async?Promise.all(s).then(l=>un.mergeArray(r,l)):un.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Ao({...this._def,rest:e})}}Ao.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ao({items:t,typeName:lt.ZodTuple,rest:null,...ft(e)})};class sm extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.object)return Ue(n,{code:Ie.invalid_type,expected:qe.object,received:n.parsedType}),nt;const a=[],s=this._def.keyType,l=this._def.valueType;for(const c in n.data)a.push({key:s._parse(new qa(n,c,n.path,c)),value:l._parse(new qa(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?un.mergeObjectAsync(r,a):un.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof wt?new sm({keyType:e,valueType:r,typeName:lt.ZodRecord,...ft(n)}):new sm({keyType:To.create(),valueType:e,typeName:lt.ZodRecord,...ft(r)})}}class Xk extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.map)return Ue(n,{code:Ie.invalid_type,expected:qe.map,received:n.parsedType}),nt;const a=this._def.keyType,s=this._def.valueType,l=[...n.data.entries()].map(([c,d],f)=>({key:a._parse(new qa(n,c,n.path,[f,"key"])),value:s._parse(new qa(n,d,n.path,[f,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of l){const f=await d.key,m=await d.value;if(f.status==="aborted"||m.status==="aborted")return nt;(f.status==="dirty"||m.status==="dirty")&&r.dirty(),c.set(f.value,m.value)}return{status:r.value,value:c}})}else{const c=new Map;for(const d of l){const f=d.key,m=d.value;if(f.status==="aborted"||m.status==="aborted")return nt;(f.status==="dirty"||m.status==="dirty")&&r.dirty(),c.set(f.value,m.value)}return{status:r.value,value:c}}}}Xk.create=(t,e,r)=>new Xk({valueType:e,keyType:t,typeName:lt.ZodMap,...ft(r)});class sd extends wt{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.set)return Ue(n,{code:Ie.invalid_type,expected:qe.set,received:n.parsedType}),nt;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(Ue(n,{code:Ie.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(Ue(n,{code:Ie.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const s=this._def.valueType;function l(d){const f=new Set;for(const m of d){if(m.status==="aborted")return nt;m.status==="dirty"&&r.dirty(),f.add(m.value)}return{status:r.value,value:f}}const c=[...n.data.values()].map((d,f)=>s._parse(new qa(n,d,n.path,f)));return n.common.async?Promise.all(c).then(d=>l(d)):l(c)}min(e,r){return new sd({...this._def,minSize:{value:e,message:Xe.toString(r)}})}max(e,r){return new sd({...this._def,maxSize:{value:e,message:Xe.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}sd.create=(t,e)=>new sd({valueType:t,minSize:null,maxSize:null,typeName:lt.ZodSet,...ft(e)});class ju extends wt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==qe.function)return Ue(r,{code:Ie.invalid_type,expected:qe.function,received:r.parsedType}),nt;function n(c,d){return b_({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,v_(),ad].filter(f=>!!f),issueData:{code:Ie.invalid_arguments,argumentsError:d}})}function a(c,d){return b_({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,v_(),ad].filter(f=>!!f),issueData:{code:Ie.invalid_return_type,returnTypeError:d}})}const s={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof ld){const c=this;return _n(async function(...d){const f=new na([]),m=await c._def.args.parseAsync(d,s).catch(y=>{throw f.addIssue(n(d,y)),f}),h=await Reflect.apply(l,this,m);return await c._def.returns._def.type.parseAsync(h,s).catch(y=>{throw f.addIssue(a(h,y)),f})})}else{const c=this;return _n(function(...d){const f=c._def.args.safeParse(d,s);if(!f.success)throw new na([n(d,f.error)]);const m=Reflect.apply(l,this,f.data),h=c._def.returns.safeParse(m,s);if(!h.success)throw new na([a(m,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ju({...this._def,args:Ao.create(e).rest(jl.create())})}returns(e){return new ju({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new ju({args:e||Ao.create([]).rest(jl.create()),returns:r||jl.create(),typeName:lt.ZodFunction,...ft(n)})}}class S_ extends wt{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}S_.create=(t,e)=>new S_({getter:t,typeName:lt.ZodLazy,...ft(e)});class lm extends wt{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return Ue(r,{received:r.data,code:Ie.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:e.data}}get value(){return this._def.value}}lm.create=(t,e)=>new lm({value:t,typeName:lt.ZodLiteral,...ft(e)});function u2(t,e){return new bs({values:t,typeName:lt.ZodEnum,...ft(e)})}class bs extends wt{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return Ue(r,{expected:At.joinValues(n),received:r.parsedType,code:Ie.invalid_type}),nt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return Ue(r,{received:r.data,code:Ie.invalid_enum_value,options:n}),nt}return _n(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return bs.create(e,{...this._def,...r})}exclude(e,r=this._def){return bs.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}bs.create=u2;class x_ extends wt{_parse(e){const r=At.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==qe.string&&n.parsedType!==qe.number){const a=At.objectValues(r);return Ue(n,{expected:At.joinValues(a),received:n.parsedType,code:Ie.invalid_type}),nt}if(this._cache||(this._cache=new Set(At.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=At.objectValues(r);return Ue(n,{received:n.data,code:Ie.invalid_enum_value,options:a}),nt}return _n(e.data)}get enum(){return this._def.values}}x_.create=(t,e)=>new x_({values:t,typeName:lt.ZodNativeEnum,...ft(e)});class ld extends wt{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==qe.promise&&r.common.async===!1)return Ue(r,{code:Ie.invalid_type,expected:qe.promise,received:r.parsedType}),nt;const n=r.parsedType===qe.promise?r.data:Promise.resolve(r.data);return _n(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ld.create=(t,e)=>new ld({type:t,typeName:lt.ZodPromise,...ft(e)});class ys extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:l=>{Ue(n,l),l.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const l=a.transform(n.data,s);if(n.common.async)return Promise.resolve(l).then(async c=>{if(r.value==="aborted")return nt;const d=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return d.status==="aborted"?nt:d.status==="dirty"||r.value==="dirty"?_u(d.value):d});{if(r.value==="aborted")return nt;const c=this._def.schema._parseSync({data:l,path:n.path,parent:n});return c.status==="aborted"?nt:c.status==="dirty"||r.value==="dirty"?_u(c.value):c}}if(a.type==="refinement"){const l=c=>{const d=a.refinement(c,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?nt:(c.status==="dirty"&&r.dirty(),l(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?nt:(c.status==="dirty"&&r.dirty(),l(c.value).then(()=>({status:r.value,value:c.value}))))}if(a.type==="transform")if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!tc(l))return nt;const c=a.transform(l.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>tc(l)?Promise.resolve(a.transform(l.value,s)).then(c=>({status:r.value,value:c})):nt);At.assertNever(a)}}ys.create=(t,e,r)=>new ys({schema:t,typeName:lt.ZodEffects,effect:e,...ft(r)});ys.createWithPreprocess=(t,e,r)=>new ys({schema:e,effect:{type:"preprocess",transform:t},typeName:lt.ZodEffects,...ft(r)});class Ro extends wt{_parse(e){return this._getType(e)===qe.undefined?_n(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ro.create=(t,e)=>new Ro({innerType:t,typeName:lt.ZodOptional,...ft(e)});class Es extends wt{_parse(e){return this._getType(e)===qe.null?_n(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Es.create=(t,e)=>new Es({innerType:t,typeName:lt.ZodNullable,...ft(e)});class cm extends wt{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===qe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}cm.create=(t,e)=>new cm({innerType:t,typeName:lt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ft(e)});class um extends wt{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return tm(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new na(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new na(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}um.create=(t,e)=>new um({innerType:t,typeName:lt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ft(e)});class Qk extends wt{_parse(e){if(this._getType(e)!==qe.nan){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.nan,received:n.parsedType}),nt}return{status:"valid",value:e.data}}}Qk.create=t=>new Qk({typeName:lt.ZodNaN,...ft(t)});class d2 extends wt{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class YT extends wt{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?nt:s.status==="dirty"?(r.dirty(),_u(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?nt:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new YT({in:e,out:r,typeName:lt.ZodPipeline})}}class dm extends wt{_parse(e){const r=this._def.innerType._parse(e),n=a=>(tc(a)&&(a.value=Object.freeze(a.value)),a);return tm(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}dm.create=(t,e)=>new dm({innerType:t,typeName:lt.ZodReadonly,...ft(e)});function Jk(t,e){const r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Q6(t,e={},r){return t?id.create().superRefine((n,a)=>{const s=t(n);if(s instanceof Promise)return s.then(l=>{if(!l){const c=Jk(e,n),d=c.fatal??r??!0;a.addIssue({code:"custom",...c,fatal:d})}});if(!s){const l=Jk(e,n),c=l.fatal??r??!0;a.addIssue({code:"custom",...l,fatal:c})}}):id.create()}var lt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(lt||(lt={}));const xEe=(t,e={message:`Input not instance of ${t.name}`})=>Q6(r=>r instanceof t,e),ve=To.create,$r=rc.create,Dr=y_.create,wEe=nm.create,_Ee=am.create,J6=id.create,Nd=jl.create;wi.create;const Ye=Fa.create,Me=Rr.create,dn=om.create,e9=WT.create;im.create;Ao.create;const kd=sm.create,TEe=ju.create,pt=lm.create,No=bs.create,REe=ld.create,ke=Ro.create;Es.create;const t9=nt,jm="2025-06-18",r9=[jm,"2025-03-26","2024-11-05","2024-10-07"],Um="2.0",f2=dn([ve(),$r().int()]),p2=ve(),n9=Me({progressToken:ke(f2)}).passthrough(),sa=Me({_meta:ke(n9)}).passthrough(),Tn=Me({method:ve(),params:ke(sa)}),Id=Me({_meta:ke(Me({}).passthrough())}).passthrough(),Ka=Me({method:ve(),params:ke(Id)}),la=Me({_meta:ke(Me({}).passthrough())}).passthrough(),Fm=dn([ve(),$r().int()]),m2=Me({jsonrpc:pt(Um),id:Fm}).merge(Tn).strict(),h2=t=>m2.safeParse(t).success,g2=Me({jsonrpc:pt(Um)}).merge(Ka).strict(),a9=t=>g2.safeParse(t).success,v2=Me({jsonrpc:pt(Um),id:Fm,result:la}).strict(),w_=t=>v2.safeParse(t).success;var Da;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(Da||(Da={}));const b2=Me({jsonrpc:pt(Um),id:Fm,error:Me({code:$r().int(),message:ve(),data:ke(Nd())})}).strict(),o9=t=>b2.safeParse(t).success,Pp=dn([m2,g2,v2,b2]),Al=la.strict(),KT=Ka.extend({method:pt("notifications/cancelled"),params:Id.extend({requestId:Fm,reason:ve().optional()})}),i9=Me({src:ve(),mimeType:ke(ve()),sizes:ke(Ye(ve()))}).passthrough(),Od=Me({icons:Ye(i9).optional()}).passthrough(),Dd=Me({name:ve(),title:ke(ve())}).passthrough(),y2=Dd.extend({version:ve(),websiteUrl:ke(ve())}).merge(Od),s9=Me({experimental:ke(Me({}).passthrough()),sampling:ke(Me({}).passthrough()),elicitation:ke(Me({}).passthrough()),roots:ke(Me({listChanged:ke(Dr())}).passthrough())}).passthrough(),l9=Tn.extend({method:pt("initialize"),params:sa.extend({protocolVersion:ve(),capabilities:s9,clientInfo:y2})}),c9=Me({experimental:ke(Me({}).passthrough()),logging:ke(Me({}).passthrough()),completions:ke(Me({}).passthrough()),prompts:ke(Me({listChanged:ke(Dr())}).passthrough()),resources:ke(Me({subscribe:ke(Dr()),listChanged:ke(Dr())}).passthrough()),tools:ke(Me({listChanged:ke(Dr())}).passthrough())}).passthrough(),E2=la.extend({protocolVersion:ve(),capabilities:c9,serverInfo:y2,instructions:ke(ve())}),S2=Ka.extend({method:pt("notifications/initialized")}),u9=t=>S2.safeParse(t).success,ZT=Tn.extend({method:pt("ping")}),d9=Me({progress:$r(),total:ke($r()),message:ke(ve())}).passthrough(),XT=Ka.extend({method:pt("notifications/progress"),params:Id.merge(d9).extend({progressToken:f2})}),zm=Tn.extend({params:sa.extend({cursor:ke(p2)}).optional()}),$m=la.extend({nextCursor:ke(p2)}),x2=Me({uri:ve(),mimeType:ke(ve()),_meta:ke(Me({}).passthrough())}).passthrough(),w2=x2.extend({text:ve()}),QT=ve().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),_2=x2.extend({blob:QT}),T2=Dd.extend({uri:ve(),description:ke(ve()),mimeType:ke(ve()),_meta:ke(Me({}).passthrough())}).merge(Od),f9=Dd.extend({uriTemplate:ve(),description:ke(ve()),mimeType:ke(ve()),_meta:ke(Me({}).passthrough())}).merge(Od),p9=zm.extend({method:pt("resources/list")}),R2=$m.extend({resources:Ye(T2)}),m9=zm.extend({method:pt("resources/templates/list")}),C2=$m.extend({resourceTemplates:Ye(f9)}),h9=Tn.extend({method:pt("resources/read"),params:sa.extend({uri:ve()})}),A2=la.extend({contents:Ye(dn([w2,_2]))}),g9=Ka.extend({method:pt("notifications/resources/list_changed")}),v9=Tn.extend({method:pt("resources/subscribe"),params:sa.extend({uri:ve()})}),b9=Tn.extend({method:pt("resources/unsubscribe"),params:sa.extend({uri:ve()})}),y9=Ka.extend({method:pt("notifications/resources/updated"),params:Id.extend({uri:ve()})}),E9=Me({name:ve(),description:ke(ve()),required:ke(Dr())}).passthrough(),S9=Dd.extend({description:ke(ve()),arguments:ke(Ye(E9)),_meta:ke(Me({}).passthrough())}).merge(Od),x9=zm.extend({method:pt("prompts/list")}),N2=$m.extend({prompts:Ye(S9)}),w9=Tn.extend({method:pt("prompts/get"),params:sa.extend({name:ve(),arguments:ke(kd(ve()))})}),JT=Me({type:pt("text"),text:ve(),_meta:ke(Me({}).passthrough())}).passthrough(),eR=Me({type:pt("image"),data:QT,mimeType:ve(),_meta:ke(Me({}).passthrough())}).passthrough(),tR=Me({type:pt("audio"),data:QT,mimeType:ve(),_meta:ke(Me({}).passthrough())}).passthrough(),_9=Me({type:pt("resource"),resource:dn([w2,_2]),_meta:ke(Me({}).passthrough())}).passthrough(),T9=T2.extend({type:pt("resource_link")}),k2=dn([JT,eR,tR,T9,_9]),R9=Me({role:No(["user","assistant"]),content:k2}).passthrough(),I2=la.extend({description:ke(ve()),messages:Ye(R9)}),C9=Ka.extend({method:pt("notifications/prompts/list_changed")}),A9=Me({title:ke(ve()),readOnlyHint:ke(Dr()),destructiveHint:ke(Dr()),idempotentHint:ke(Dr()),openWorldHint:ke(Dr())}).passthrough(),N9=Dd.extend({description:ke(ve()),inputSchema:Me({type:pt("object"),properties:ke(Me({}).passthrough()),required:ke(Ye(ve()))}).passthrough(),outputSchema:ke(Me({type:pt("object"),properties:ke(Me({}).passthrough()),required:ke(Ye(ve()))}).passthrough()),annotations:ke(A9),_meta:ke(Me({}).passthrough())}).merge(Od),k9=zm.extend({method:pt("tools/list")}),O2=$m.extend({tools:Ye(N9)}),rR=la.extend({content:Ye(k2).default([]),structuredContent:Me({}).passthrough().optional(),isError:ke(Dr())});rR.or(la.extend({toolResult:Nd()}));const I9=Tn.extend({method:pt("tools/call"),params:sa.extend({name:ve(),arguments:ke(kd(Nd()))})}),O9=Ka.extend({method:pt("notifications/tools/list_changed")}),D2=No(["debug","info","notice","warning","error","critical","alert","emergency"]),D9=Tn.extend({method:pt("logging/setLevel"),params:sa.extend({level:D2})}),L9=Ka.extend({method:pt("notifications/message"),params:Id.extend({level:D2,logger:ke(ve()),data:Nd()})}),M9=Me({name:ve().optional()}).passthrough(),P9=Me({hints:ke(Ye(M9)),costPriority:ke($r().min(0).max(1)),speedPriority:ke($r().min(0).max(1)),intelligencePriority:ke($r().min(0).max(1))}).passthrough(),j9=Me({role:No(["user","assistant"]),content:dn([JT,eR,tR])}).passthrough(),U9=Tn.extend({method:pt("sampling/createMessage"),params:sa.extend({messages:Ye(j9),systemPrompt:ke(ve()),includeContext:ke(No(["none","thisServer","allServers"])),temperature:ke($r()),maxTokens:$r().int(),stopSequences:ke(Ye(ve())),metadata:ke(Me({}).passthrough()),modelPreferences:ke(P9)})}),F9=la.extend({model:ve(),stopReason:ke(No(["endTurn","stopSequence","maxTokens"]).or(ve())),role:No(["user","assistant"]),content:e9("type",[JT,eR,tR])}),z9=Me({type:pt("boolean"),title:ke(ve()),description:ke(ve()),default:ke(Dr())}).passthrough(),$9=Me({type:pt("string"),title:ke(ve()),description:ke(ve()),minLength:ke($r()),maxLength:ke($r()),format:ke(No(["email","uri","date","date-time"]))}).passthrough(),B9=Me({type:No(["number","integer"]),title:ke(ve()),description:ke(ve()),minimum:ke($r()),maximum:ke($r())}).passthrough(),q9=Me({type:pt("string"),title:ke(ve()),description:ke(ve()),enum:Ye(ve()),enumNames:ke(Ye(ve()))}).passthrough(),H9=dn([z9,$9,B9,q9]),V9=Tn.extend({method:pt("elicitation/create"),params:sa.extend({message:ve(),requestedSchema:Me({type:pt("object"),properties:kd(ve(),H9),required:ke(Ye(ve()))}).passthrough()})}),G9=la.extend({action:No(["accept","decline","cancel"]),content:ke(kd(ve(),Nd()))}),W9=Me({type:pt("ref/resource"),uri:ve()}).passthrough(),Y9=Me({type:pt("ref/prompt"),name:ve()}).passthrough(),K9=Tn.extend({method:pt("completion/complete"),params:sa.extend({ref:dn([Y9,W9]),argument:Me({name:ve(),value:ve()}).passthrough(),context:ke(Me({arguments:ke(kd(ve(),ve()))}))})}),L2=la.extend({completion:Me({values:Ye(ve()).max(100),total:ke($r().int()),hasMore:ke(Dr())}).passthrough()}),Z9=Me({uri:ve().startsWith("file://"),name:ke(ve()),_meta:ke(Me({}).passthrough())}).passthrough(),X9=Tn.extend({method:pt("roots/list")}),Q9=la.extend({roots:Ye(Z9)}),J9=Ka.extend({method:pt("notifications/roots/list_changed")});dn([ZT,l9,K9,D9,w9,x9,p9,m9,h9,v9,b9,I9,k9]);dn([KT,XT,S2,J9]);dn([Al,F9,G9,Q9]);dn([ZT,U9,V9,X9]);dn([KT,XT,L9,y9,g9,O9,C9]);dn([Al,E2,L2,I2,N2,R2,C2,A2,rR,O2]);class Si extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}}const e8=6e4;class t8{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(KT,r=>{const n=this._requestHandlerAbortControllers.get(r.params.requestId);n?.abort(r.params.reason)}),this.setNotificationHandler(XT,r=>{this._onprogress(r)}),this.setRequestHandler(ZT,r=>({}))}_setupTimeout(e,r,n,a,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:a})}_resetTimeout(e){const r=this._timeoutInfo.get(e);if(!r)return!1;const n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Si(Da.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){const r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var r,n,a;this._transport=e;const s=(r=this.transport)===null||r===void 0?void 0:r.onclose;this._transport.onclose=()=>{s?.(),this._onclose()};const l=(n=this.transport)===null||n===void 0?void 0:n.onerror;this._transport.onerror=d=>{l?.(d),this._onerror(d)};const c=(a=this._transport)===null||a===void 0?void 0:a.onmessage;this._transport.onmessage=(d,f)=>{c?.(d,f),w_(d)||o9(d)?this._onresponse(d):h2(d)?this._onrequest(d,f):a9(d)?this._onnotification(d):this._onerror(new Error(`Unknown message type: ${JSON.stringify(d)}`))},await this._transport.start()}_onclose(){var e;const r=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);const n=new Si(Da.ConnectionClosed,"Connection closed");for(const a of r.values())a(n)}_onerror(e){var r;(r=this.onerror)===null||r===void 0||r.call(this,e)}_onnotification(e){var r;const n=(r=this._notificationHandlers.get(e.method))!==null&&r!==void 0?r:this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(a=>this._onerror(new Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(e,r){var n,a;const s=(n=this._requestHandlers.get(e.method))!==null&&n!==void 0?n:this.fallbackRequestHandler,l=this._transport;if(s===void 0){l?.send({jsonrpc:"2.0",id:e.id,error:{code:Da.MethodNotFound,message:"Method not found"}}).catch(f=>this._onerror(new Error(`Failed to send an error response: ${f}`)));return}const c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);const d={signal:c.signal,sessionId:l?.sessionId,_meta:(a=e.params)===null||a===void 0?void 0:a._meta,sendNotification:f=>this.notification(f,{relatedRequestId:e.id}),sendRequest:(f,m,h)=>this.request(f,m,{...h,relatedRequestId:e.id}),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo};Promise.resolve().then(()=>s(e,d)).then(f=>{if(!c.signal.aborted)return l?.send({result:f,jsonrpc:"2.0",id:e.id})},f=>{var m;if(!c.signal.aborted)return l?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Da.InternalError,message:(m=f.message)!==null&&m!==void 0?m:"Internal error"}})}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:r,...n}=e.params,a=Number(r),s=this._progressHandlers.get(a);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const l=this._responseHandlers.get(a),c=this._timeoutInfo.get(a);if(c&&l&&c.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(d){l(d);return}s(n)}_onresponse(e){const r=Number(e.id),n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),w_(e))n(e);else{const a=new Si(e.error.code,e.error.message,e.error.data);n(a)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,r,n){const{relatedRequestId:a,resumptionToken:s,onresumptiontoken:l}=n??{};return new Promise((c,d)=>{var f,m,h,v,y,w;if(!this._transport){d(new Error("Not connected"));return}((f=this._options)===null||f===void 0?void 0:f.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(m=n?.signal)===null||m===void 0||m.throwIfAborted();const S=this._requestMessageId++,R={...e,jsonrpc:"2.0",id:S};n?.onprogress&&(this._progressHandlers.set(S,n.onprogress),R.params={...e.params,_meta:{...((h=e.params)===null||h===void 0?void 0:h._meta)||{},progressToken:S}});const x=N=>{var k;this._responseHandlers.delete(S),this._progressHandlers.delete(S),this._cleanupTimeout(S),(k=this._transport)===null||k===void 0||k.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:S,reason:String(N)}},{relatedRequestId:a,resumptionToken:s,onresumptiontoken:l}).catch(A=>this._onerror(new Error(`Failed to send cancellation: ${A}`))),d(N)};this._responseHandlers.set(S,N=>{var k;if(!(!((k=n?.signal)===null||k===void 0)&&k.aborted)){if(N instanceof Error)return d(N);try{const A=r.parse(N.result);c(A)}catch(A){d(A)}}}),(v=n?.signal)===null||v===void 0||v.addEventListener("abort",()=>{var N;x((N=n?.signal)===null||N===void 0?void 0:N.reason)});const _=(y=n?.timeout)!==null&&y!==void 0?y:e8,C=()=>x(new Si(Da.RequestTimeout,"Request timed out",{timeout:_}));this._setupTimeout(S,_,n?.maxTotalTimeout,C,(w=n?.resetTimeoutOnProgress)!==null&&w!==void 0?w:!1),this._transport.send(R,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:l}).catch(N=>{this._cleanupTimeout(S),d(N)})})}async notification(e,r){var n,a;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((a=(n=this._options)===null||n===void 0?void 0:n.debouncedNotificationMethods)!==null&&a!==void 0?a:[]).includes(e.method)&&!e.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var d;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const f={...e,jsonrpc:"2.0"};(d=this._transport)===null||d===void 0||d.send(f,r).catch(m=>this._onerror(m))});return}const c={...e,jsonrpc:"2.0"};await this._transport.send(c,r)}setRequestHandler(e,r){const n=e.shape.method.value;this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(a,s)=>Promise.resolve(r(e.parse(a),s)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){this._notificationHandlers.set(e.shape.method.value,n=>Promise.resolve(r(e.parse(n))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}function r8(t,e){return Object.entries(e).reduce((r,[n,a])=>(a&&typeof a=="object"?r[n]=r[n]?{...r[n],...a}:a:r[n]=a,r),{...t})}var Tu={exports:{}};var n8=Tu.exports,eI;function a8(){return eI||(eI=1,(function(t,e){(function(r,n){n(e)})(n8,(function(r){function n(){for(var oe=arguments.length,Z=Array(oe),ie=0;ie<oe;ie++)Z[ie]=arguments[ie];if(Z.length>1){Z[0]=Z[0].slice(0,-1);for(var ye=Z.length-1,ge=1;ge<ye;++ge)Z[ge]=Z[ge].slice(1,-1);return Z[ye]=Z[ye].slice(1),Z.join("")}else return Z[0]}function a(oe){return"(?:"+oe+")"}function s(oe){return oe===void 0?"undefined":oe===null?"null":Object.prototype.toString.call(oe).split(" ").pop().split("]").shift().toLowerCase()}function l(oe){return oe.toUpperCase()}function c(oe){return oe!=null?oe instanceof Array?oe:typeof oe.length!="number"||oe.split||oe.setInterval||oe.call?[oe]:Array.prototype.slice.call(oe):[]}function d(oe,Z){var ie=oe;if(Z)for(var ye in Z)ie[ye]=Z[ye];return ie}function f(oe){var Z="[A-Za-z]",ie="[0-9]",ye=n(ie,"[A-Fa-f]"),ge=a(a("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+a("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+a("%"+ye+ye)),je="[\\:\\/\\?\\#\\[\\]\\@]",Be="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",mt=n(je,Be),Ut=oe?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",sr=oe?"[\\uE000-\\uF8FF]":"[]",yt=n(Z,ie,"[\\-\\.\\_\\~]",Ut);a(Z+n(Z,ie,"[\\+\\-\\.]")+"*"),a(a(ge+"|"+n(yt,Be,"[\\:]"))+"*");var Ft=a(a("25[0-5]")+"|"+a("2[0-4]"+ie)+"|"+a("1"+ie+ie)+"|"+a("0?[1-9]"+ie)+"|0?0?"+ie),Wt=a(Ft+"\\."+Ft+"\\."+Ft+"\\."+Ft),it=a(ye+"{1,4}"),Dt=a(a(it+"\\:"+it)+"|"+Wt),Yt=a(a(it+"\\:")+"{6}"+Dt),Pt=a("\\:\\:"+a(it+"\\:")+"{5}"+Dt),on=a(a(it)+"?\\:\\:"+a(it+"\\:")+"{4}"+Dt),zt=a(a(a(it+"\\:")+"{0,1}"+it)+"?\\:\\:"+a(it+"\\:")+"{3}"+Dt),An=a(a(a(it+"\\:")+"{0,2}"+it)+"?\\:\\:"+a(it+"\\:")+"{2}"+Dt),Ja=a(a(a(it+"\\:")+"{0,3}"+it)+"?\\:\\:"+it+"\\:"+Dt),sn=a(a(a(it+"\\:")+"{0,4}"+it)+"?\\:\\:"+Dt),Ar=a(a(a(it+"\\:")+"{0,5}"+it)+"?\\:\\:"+it),Bn=a(a(a(it+"\\:")+"{0,6}"+it)+"?\\:\\:"),Ta=a([Yt,Pt,on,zt,An,Ja,sn,Ar,Bn].join("|")),qn=a(a(yt+"|"+ge)+"+");a("[vV]"+ye+"+\\."+n(yt,Be,"[\\:]")+"+"),a(a(ge+"|"+n(yt,Be))+"*");var Mi=a(ge+"|"+n(yt,Be,"[\\:\\@]"));return a(a(ge+"|"+n(yt,Be,"[\\@]"))+"+"),a(a(Mi+"|"+n("[\\/\\?]",sr))+"*"),{NOT_SCHEME:new RegExp(n("[^]",Z,ie,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",yt,Be),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",yt,Be),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",yt,Be),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",yt,Be),"g"),NOT_QUERY:new RegExp(n("[^\\%]",yt,Be,"[\\:\\@\\/\\?]",sr),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",yt,Be,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",yt,Be),"g"),UNRESERVED:new RegExp(yt,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",yt,mt),"g"),PCT_ENCODED:new RegExp(ge,"g"),IPV4ADDRESS:new RegExp("^("+Wt+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Ta+")"+a(a("\\%25|\\%(?!"+ye+"{2})")+"("+qn+")")+"?\\]?$")}}var m=f(!1),h=f(!0),v=(function(){function oe(Z,ie){var ye=[],ge=!0,je=!1,Be=void 0;try{for(var mt=Z[Symbol.iterator](),Ut;!(ge=(Ut=mt.next()).done)&&(ye.push(Ut.value),!(ie&&ye.length===ie));ge=!0);}catch(sr){je=!0,Be=sr}finally{try{!ge&&mt.return&&mt.return()}finally{if(je)throw Be}}return ye}return function(Z,ie){if(Array.isArray(Z))return Z;if(Symbol.iterator in Object(Z))return oe(Z,ie);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),y=function(oe){if(Array.isArray(oe)){for(var Z=0,ie=Array(oe.length);Z<oe.length;Z++)ie[Z]=oe[Z];return ie}else return Array.from(oe)},w=2147483647,S=36,R=1,x=26,_=38,C=700,N=72,k=128,A="-",I=/^xn--/,O=/[^\0-\x7E]/,L=/[\x2E\u3002\uFF0E\uFF61]/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=S-R,W=Math.floor,X=String.fromCharCode;function ee(oe){throw new RangeError(M[oe])}function J(oe,Z){for(var ie=[],ye=oe.length;ye--;)ie[ye]=Z(oe[ye]);return ie}function j(oe,Z){var ie=oe.split("@"),ye="";ie.length>1&&(ye=ie[0]+"@",oe=ie[1]),oe=oe.replace(L,".");var ge=oe.split("."),je=J(ge,Z).join(".");return ye+je}function G(oe){for(var Z=[],ie=0,ye=oe.length;ie<ye;){var ge=oe.charCodeAt(ie++);if(ge>=55296&&ge<=56319&&ie<ye){var je=oe.charCodeAt(ie++);(je&64512)==56320?Z.push(((ge&1023)<<10)+(je&1023)+65536):(Z.push(ge),ie--)}else Z.push(ge)}return Z}var V=function(Z){return String.fromCodePoint.apply(String,y(Z))},te=function(Z){return Z-48<10?Z-22:Z-65<26?Z-65:Z-97<26?Z-97:S},re=function(Z,ie){return Z+22+75*(Z<26)-((ie!=0)<<5)},U=function(Z,ie,ye){var ge=0;for(Z=ye?W(Z/C):Z>>1,Z+=W(Z/ie);Z>P*x>>1;ge+=S)Z=W(Z/P);return W(ge+(P+1)*Z/(Z+_))},q=function(Z){var ie=[],ye=Z.length,ge=0,je=k,Be=N,mt=Z.lastIndexOf(A);mt<0&&(mt=0);for(var Ut=0;Ut<mt;++Ut)Z.charCodeAt(Ut)>=128&&ee("not-basic"),ie.push(Z.charCodeAt(Ut));for(var sr=mt>0?mt+1:0;sr<ye;){for(var yt=ge,Ft=1,Wt=S;;Wt+=S){sr>=ye&&ee("invalid-input");var it=te(Z.charCodeAt(sr++));(it>=S||it>W((w-ge)/Ft))&&ee("overflow"),ge+=it*Ft;var Dt=Wt<=Be?R:Wt>=Be+x?x:Wt-Be;if(it<Dt)break;var Yt=S-Dt;Ft>W(w/Yt)&&ee("overflow"),Ft*=Yt}var Pt=ie.length+1;Be=U(ge-yt,Pt,yt==0),W(ge/Pt)>w-je&&ee("overflow"),je+=W(ge/Pt),ge%=Pt,ie.splice(ge++,0,je)}return String.fromCodePoint.apply(String,ie)},$=function(Z){var ie=[];Z=G(Z);var ye=Z.length,ge=k,je=0,Be=N,mt=!0,Ut=!1,sr=void 0;try{for(var yt=Z[Symbol.iterator](),Ft;!(mt=(Ft=yt.next()).done);mt=!0){var Wt=Ft.value;Wt<128&&ie.push(X(Wt))}}catch(zo){Ut=!0,sr=zo}finally{try{!mt&&yt.return&&yt.return()}finally{if(Ut)throw sr}}var it=ie.length,Dt=it;for(it&&ie.push(A);Dt<ye;){var Yt=w,Pt=!0,on=!1,zt=void 0;try{for(var An=Z[Symbol.iterator](),Ja;!(Pt=(Ja=An.next()).done);Pt=!0){var sn=Ja.value;sn>=ge&&sn<Yt&&(Yt=sn)}}catch(zo){on=!0,zt=zo}finally{try{!Pt&&An.return&&An.return()}finally{if(on)throw zt}}var Ar=Dt+1;Yt-ge>W((w-je)/Ar)&&ee("overflow"),je+=(Yt-ge)*Ar,ge=Yt;var Bn=!0,Ta=!1,qn=void 0;try{for(var Mi=Z[Symbol.iterator](),Pi;!(Bn=(Pi=Mi.next()).done);Bn=!0){var ji=Pi.value;if(ji<ge&&++je>w&&ee("overflow"),ji==ge){for(var mn=je,qr=S;;qr+=S){var Ui=qr<=Be?R:qr>=Be+x?x:qr-Be;if(mn<Ui)break;var rf=mn-Ui,Os=S-Ui;ie.push(X(re(Ui+rf%Os,0))),mn=W(rf/Os)}ie.push(X(re(mn,0))),Be=U(je,Ar,Dt==it),je=0,++Dt}}}catch(zo){Ta=!0,qn=zo}finally{try{!Bn&&Mi.return&&Mi.return()}finally{if(Ta)throw qn}}++je,++ge}return ie.join("")},Y=function(Z){return j(Z,function(ie){return I.test(ie)?q(ie.slice(4).toLowerCase()):ie})},Q=function(Z){return j(Z,function(ie){return O.test(ie)?"xn--"+$(ie):ie})},F={version:"2.1.0",ucs2:{decode:G,encode:V},decode:q,encode:$,toASCII:Q,toUnicode:Y},z={};function K(oe){var Z=oe.charCodeAt(0),ie=void 0;return Z<16?ie="%0"+Z.toString(16).toUpperCase():Z<128?ie="%"+Z.toString(16).toUpperCase():Z<2048?ie="%"+(Z>>6|192).toString(16).toUpperCase()+"%"+(Z&63|128).toString(16).toUpperCase():ie="%"+(Z>>12|224).toString(16).toUpperCase()+"%"+(Z>>6&63|128).toString(16).toUpperCase()+"%"+(Z&63|128).toString(16).toUpperCase(),ie}function ae(oe){for(var Z="",ie=0,ye=oe.length;ie<ye;){var ge=parseInt(oe.substr(ie+1,2),16);if(ge<128)Z+=String.fromCharCode(ge),ie+=3;else if(ge>=194&&ge<224){if(ye-ie>=6){var je=parseInt(oe.substr(ie+4,2),16);Z+=String.fromCharCode((ge&31)<<6|je&63)}else Z+=oe.substr(ie,6);ie+=6}else if(ge>=224){if(ye-ie>=9){var Be=parseInt(oe.substr(ie+4,2),16),mt=parseInt(oe.substr(ie+7,2),16);Z+=String.fromCharCode((ge&15)<<12|(Be&63)<<6|mt&63)}else Z+=oe.substr(ie,9);ie+=9}else Z+=oe.substr(ie,3),ie+=3}return Z}function H(oe,Z){function ie(ye){var ge=ae(ye);return ge.match(Z.UNRESERVED)?ge:ye}return oe.scheme&&(oe.scheme=String(oe.scheme).replace(Z.PCT_ENCODED,ie).toLowerCase().replace(Z.NOT_SCHEME,"")),oe.userinfo!==void 0&&(oe.userinfo=String(oe.userinfo).replace(Z.PCT_ENCODED,ie).replace(Z.NOT_USERINFO,K).replace(Z.PCT_ENCODED,l)),oe.host!==void 0&&(oe.host=String(oe.host).replace(Z.PCT_ENCODED,ie).toLowerCase().replace(Z.NOT_HOST,K).replace(Z.PCT_ENCODED,l)),oe.path!==void 0&&(oe.path=String(oe.path).replace(Z.PCT_ENCODED,ie).replace(oe.scheme?Z.NOT_PATH:Z.NOT_PATH_NOSCHEME,K).replace(Z.PCT_ENCODED,l)),oe.query!==void 0&&(oe.query=String(oe.query).replace(Z.PCT_ENCODED,ie).replace(Z.NOT_QUERY,K).replace(Z.PCT_ENCODED,l)),oe.fragment!==void 0&&(oe.fragment=String(oe.fragment).replace(Z.PCT_ENCODED,ie).replace(Z.NOT_FRAGMENT,K).replace(Z.PCT_ENCODED,l)),oe}function de(oe){return oe.replace(/^0*(.*)/,"$1")||"0"}function me(oe,Z){var ie=oe.match(Z.IPV4ADDRESS)||[],ye=v(ie,2),ge=ye[1];return ge?ge.split(".").map(de).join("."):oe}function xe(oe,Z){var ie=oe.match(Z.IPV6ADDRESS)||[],ye=v(ie,3),ge=ye[1],je=ye[2];if(ge){for(var Be=ge.toLowerCase().split("::").reverse(),mt=v(Be,2),Ut=mt[0],sr=mt[1],yt=sr?sr.split(":").map(de):[],Ft=Ut.split(":").map(de),Wt=Z.IPV4ADDRESS.test(Ft[Ft.length-1]),it=Wt?7:8,Dt=Ft.length-it,Yt=Array(it),Pt=0;Pt<it;++Pt)Yt[Pt]=yt[Pt]||Ft[Dt+Pt]||"";Wt&&(Yt[it-1]=me(Yt[it-1],Z));var on=Yt.reduce(function(Ar,Bn,Ta){if(!Bn||Bn==="0"){var qn=Ar[Ar.length-1];qn&&qn.index+qn.length===Ta?qn.length++:Ar.push({index:Ta,length:1})}return Ar},[]),zt=on.sort(function(Ar,Bn){return Bn.length-Ar.length})[0],An=void 0;if(zt&&zt.length>1){var Ja=Yt.slice(0,zt.index),sn=Yt.slice(zt.index+zt.length);An=Ja.join(":")+"::"+sn.join(":")}else An=Yt.join(":");return je&&(An+="%"+je),An}else return oe}var be=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,_e="".match(/(){0}/)[1]===void 0;function Ae(oe){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie={},ye=Z.iri!==!1?h:m;Z.reference==="suffix"&&(oe=(Z.scheme?Z.scheme+":":"")+"//"+oe);var ge=oe.match(be);if(ge){_e?(ie.scheme=ge[1],ie.userinfo=ge[3],ie.host=ge[4],ie.port=parseInt(ge[5],10),ie.path=ge[6]||"",ie.query=ge[7],ie.fragment=ge[8],isNaN(ie.port)&&(ie.port=ge[5])):(ie.scheme=ge[1]||void 0,ie.userinfo=oe.indexOf("@")!==-1?ge[3]:void 0,ie.host=oe.indexOf("//")!==-1?ge[4]:void 0,ie.port=parseInt(ge[5],10),ie.path=ge[6]||"",ie.query=oe.indexOf("?")!==-1?ge[7]:void 0,ie.fragment=oe.indexOf("#")!==-1?ge[8]:void 0,isNaN(ie.port)&&(ie.port=oe.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?ge[4]:void 0)),ie.host&&(ie.host=xe(me(ie.host,ye),ye)),ie.scheme===void 0&&ie.userinfo===void 0&&ie.host===void 0&&ie.port===void 0&&!ie.path&&ie.query===void 0?ie.reference="same-document":ie.scheme===void 0?ie.reference="relative":ie.fragment===void 0?ie.reference="absolute":ie.reference="uri",Z.reference&&Z.reference!=="suffix"&&Z.reference!==ie.reference&&(ie.error=ie.error||"URI is not a "+Z.reference+" reference.");var je=z[(Z.scheme||ie.scheme||"").toLowerCase()];if(!Z.unicodeSupport&&(!je||!je.unicodeSupport)){if(ie.host&&(Z.domainHost||je&&je.domainHost))try{ie.host=F.toASCII(ie.host.replace(ye.PCT_ENCODED,ae).toLowerCase())}catch(Be){ie.error=ie.error||"Host's domain name can not be converted to ASCII via punycode: "+Be}H(ie,m)}else H(ie,ye);je&&je.parse&&je.parse(ie,Z)}else ie.error=ie.error||"URI can not be parsed.";return ie}function Fe(oe,Z){var ie=Z.iri!==!1?h:m,ye=[];return oe.userinfo!==void 0&&(ye.push(oe.userinfo),ye.push("@")),oe.host!==void 0&&ye.push(xe(me(String(oe.host),ie),ie).replace(ie.IPV6ADDRESS,function(ge,je,Be){return"["+je+(Be?"%25"+Be:"")+"]"})),(typeof oe.port=="number"||typeof oe.port=="string")&&(ye.push(":"),ye.push(String(oe.port))),ye.length?ye.join(""):void 0}var Pe=/^\.\.?\//,$e=/^\/\.(\/|$)/,at=/^\/\.\.(\/|$)/,ce=/^\/?(?:.|\n)*?(?=\/|$)/;function Ce(oe){for(var Z=[];oe.length;)if(oe.match(Pe))oe=oe.replace(Pe,"");else if(oe.match($e))oe=oe.replace($e,"/");else if(oe.match(at))oe=oe.replace(at,"/"),Z.pop();else if(oe==="."||oe==="..")oe="";else{var ie=oe.match(ce);if(ie){var ye=ie[0];oe=oe.slice(ye.length),Z.push(ye)}else throw new Error("Unexpected dot segment condition")}return Z.join("")}function ze(oe){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie=Z.iri?h:m,ye=[],ge=z[(Z.scheme||oe.scheme||"").toLowerCase()];if(ge&&ge.serialize&&ge.serialize(oe,Z),oe.host&&!ie.IPV6ADDRESS.test(oe.host)){if(Z.domainHost||ge&&ge.domainHost)try{oe.host=Z.iri?F.toUnicode(oe.host):F.toASCII(oe.host.replace(ie.PCT_ENCODED,ae).toLowerCase())}catch(mt){oe.error=oe.error||"Host's domain name can not be converted to "+(Z.iri?"Unicode":"ASCII")+" via punycode: "+mt}}H(oe,ie),Z.reference!=="suffix"&&oe.scheme&&(ye.push(oe.scheme),ye.push(":"));var je=Fe(oe,Z);if(je!==void 0&&(Z.reference!=="suffix"&&ye.push("//"),ye.push(je),oe.path&&oe.path.charAt(0)!=="/"&&ye.push("/")),oe.path!==void 0){var Be=oe.path;!Z.absolutePath&&(!ge||!ge.absolutePath)&&(Be=Ce(Be)),je===void 0&&(Be=Be.replace(/^\/\//,"/%2F")),ye.push(Be)}return oe.query!==void 0&&(ye.push("?"),ye.push(oe.query)),oe.fragment!==void 0&&(ye.push("#"),ye.push(oe.fragment)),ye.join("")}function we(oe,Z){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ye=arguments[3],ge={};return ye||(oe=Ae(ze(oe,ie),ie),Z=Ae(ze(Z,ie),ie)),ie=ie||{},!ie.tolerant&&Z.scheme?(ge.scheme=Z.scheme,ge.userinfo=Z.userinfo,ge.host=Z.host,ge.port=Z.port,ge.path=Ce(Z.path||""),ge.query=Z.query):(Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0?(ge.userinfo=Z.userinfo,ge.host=Z.host,ge.port=Z.port,ge.path=Ce(Z.path||""),ge.query=Z.query):(Z.path?(Z.path.charAt(0)==="/"?ge.path=Ce(Z.path):((oe.userinfo!==void 0||oe.host!==void 0||oe.port!==void 0)&&!oe.path?ge.path="/"+Z.path:oe.path?ge.path=oe.path.slice(0,oe.path.lastIndexOf("/")+1)+Z.path:ge.path=Z.path,ge.path=Ce(ge.path)),ge.query=Z.query):(ge.path=oe.path,Z.query!==void 0?ge.query=Z.query:ge.query=oe.query),ge.userinfo=oe.userinfo,ge.host=oe.host,ge.port=oe.port),ge.scheme=oe.scheme),ge.fragment=Z.fragment,ge}function Ne(oe,Z,ie){var ye=d({scheme:"null"},ie);return ze(we(Ae(oe,ye),Ae(Z,ye),ye,!0),ye)}function Oe(oe,Z){return typeof oe=="string"?oe=ze(Ae(oe,Z),Z):s(oe)==="object"&&(oe=Ae(ze(oe,Z),Z)),oe}function Je(oe,Z,ie){return typeof oe=="string"?oe=ze(Ae(oe,ie),ie):s(oe)==="object"&&(oe=ze(oe,ie)),typeof Z=="string"?Z=ze(Ae(Z,ie),ie):s(Z)==="object"&&(Z=ze(Z,ie)),oe===Z}function ot(oe,Z){return oe&&oe.toString().replace(!Z||!Z.iri?m.ESCAPE:h.ESCAPE,K)}function Rt(oe,Z){return oe&&oe.toString().replace(!Z||!Z.iri?m.PCT_ENCODED:h.PCT_ENCODED,ae)}var Ot={scheme:"http",domainHost:!0,parse:function(Z,ie){return Z.host||(Z.error=Z.error||"HTTP URIs must have a host."),Z},serialize:function(Z,ie){var ye=String(Z.scheme).toLowerCase()==="https";return(Z.port===(ye?443:80)||Z.port==="")&&(Z.port=void 0),Z.path||(Z.path="/"),Z}},Cn={scheme:"https",domainHost:Ot.domainHost,parse:Ot.parse,serialize:Ot.serialize};function vr(oe){return typeof oe.secure=="boolean"?oe.secure:String(oe.scheme).toLowerCase()==="wss"}var or={scheme:"ws",domainHost:!0,parse:function(Z,ie){var ye=Z;return ye.secure=vr(ye),ye.resourceName=(ye.path||"/")+(ye.query?"?"+ye.query:""),ye.path=void 0,ye.query=void 0,ye},serialize:function(Z,ie){if((Z.port===(vr(Z)?443:80)||Z.port==="")&&(Z.port=void 0),typeof Z.secure=="boolean"&&(Z.scheme=Z.secure?"wss":"ws",Z.secure=void 0),Z.resourceName){var ye=Z.resourceName.split("?"),ge=v(ye,2),je=ge[0],Be=ge[1];Z.path=je&&je!=="/"?je:void 0,Z.query=Be,Z.resourceName=void 0}return Z.fragment=void 0,Z}},Mt={scheme:"wss",domainHost:or.domainHost,parse:or.parse,serialize:or.serialize},Zt={},fr="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Sr="[0-9A-Fa-f]",zn=a(a("%[EFef]"+Sr+"%"+Sr+Sr+"%"+Sr+Sr)+"|"+a("%[89A-Fa-f]"+Sr+"%"+Sr+Sr)+"|"+a("%"+Sr+Sr)),ir="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Gt="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",pn=n(Gt,'[\\"\\\\]'),ua="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",an=new RegExp(fr,"g"),Qe=new RegExp(zn,"g"),jt=new RegExp(n("[^]",ir,"[\\.]",'[\\"]',pn),"g"),Qt=new RegExp(n("[^]",fr,ua),"g"),Lr=Qt;function $n(oe){var Z=ae(oe);return Z.match(an)?Z:oe}var Xt={scheme:"mailto",parse:function(Z,ie){var ye=Z,ge=ye.to=ye.path?ye.path.split(","):[];if(ye.path=void 0,ye.query){for(var je=!1,Be={},mt=ye.query.split("&"),Ut=0,sr=mt.length;Ut<sr;++Ut){var yt=mt[Ut].split("=");switch(yt[0]){case"to":for(var Ft=yt[1].split(","),Wt=0,it=Ft.length;Wt<it;++Wt)ge.push(Ft[Wt]);break;case"subject":ye.subject=Rt(yt[1],ie);break;case"body":ye.body=Rt(yt[1],ie);break;default:je=!0,Be[Rt(yt[0],ie)]=Rt(yt[1],ie);break}}je&&(ye.headers=Be)}ye.query=void 0;for(var Dt=0,Yt=ge.length;Dt<Yt;++Dt){var Pt=ge[Dt].split("@");if(Pt[0]=Rt(Pt[0]),ie.unicodeSupport)Pt[1]=Rt(Pt[1],ie).toLowerCase();else try{Pt[1]=F.toASCII(Rt(Pt[1],ie).toLowerCase())}catch(on){ye.error=ye.error||"Email address's domain name can not be converted to ASCII via punycode: "+on}ge[Dt]=Pt.join("@")}return ye},serialize:function(Z,ie){var ye=Z,ge=c(Z.to);if(ge){for(var je=0,Be=ge.length;je<Be;++je){var mt=String(ge[je]),Ut=mt.lastIndexOf("@"),sr=mt.slice(0,Ut).replace(Qe,$n).replace(Qe,l).replace(jt,K),yt=mt.slice(Ut+1);try{yt=ie.iri?F.toUnicode(yt):F.toASCII(Rt(yt,ie).toLowerCase())}catch(Dt){ye.error=ye.error||"Email address's domain name can not be converted to "+(ie.iri?"Unicode":"ASCII")+" via punycode: "+Dt}ge[je]=sr+"@"+yt}ye.path=ge.join(",")}var Ft=Z.headers=Z.headers||{};Z.subject&&(Ft.subject=Z.subject),Z.body&&(Ft.body=Z.body);var Wt=[];for(var it in Ft)Ft[it]!==Zt[it]&&Wt.push(it.replace(Qe,$n).replace(Qe,l).replace(Qt,K)+"="+Ft[it].replace(Qe,$n).replace(Qe,l).replace(Lr,K));return Wt.length&&(ye.query=Wt.join("&")),ye}},Jr=/^([^\:]+)\:(.*)/,_a={scheme:"urn",parse:function(Z,ie){var ye=Z.path&&Z.path.match(Jr),ge=Z;if(ye){var je=ie.scheme||ge.scheme||"urn",Be=ye[1].toLowerCase(),mt=ye[2],Ut=je+":"+(ie.nid||Be),sr=z[Ut];ge.nid=Be,ge.nss=mt,ge.path=void 0,sr&&(ge=sr.parse(ge,ie))}else ge.error=ge.error||"URN can not be parsed.";return ge},serialize:function(Z,ie){var ye=ie.scheme||Z.scheme||"urn",ge=Z.nid,je=ye+":"+(ie.nid||ge),Be=z[je];Be&&(Z=Be.serialize(Z,ie));var mt=Z,Ut=Z.nss;return mt.path=(ge||ie.nid)+":"+Ut,mt}},en=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Br={scheme:"urn:uuid",parse:function(Z,ie){var ye=Z;return ye.uuid=ye.nss,ye.nss=void 0,!ie.tolerant&&(!ye.uuid||!ye.uuid.match(en))&&(ye.error=ye.error||"UUID is not valid."),ye},serialize:function(Z,ie){var ye=Z;return ye.nss=(Z.uuid||"").toLowerCase(),ye}};z[Ot.scheme]=Ot,z[Cn.scheme]=Cn,z[or.scheme]=or,z[Mt.scheme]=Mt,z[Xt.scheme]=Xt,z[_a.scheme]=_a,z[Br.scheme]=Br,r.SCHEMES=z,r.pctEncChar=K,r.pctDecChars=ae,r.parse=Ae,r.removeDotSegments=Ce,r.serialize=ze,r.resolveComponents=we,r.resolve=Ne,r.normalize=Oe,r.equal=Je,r.escapeComponent=ot,r.unescapeComponent=Rt,Object.defineProperty(r,"__esModule",{value:!0})}))})(Tu,Tu.exports)),Tu.exports}var Fv,tI;function nR(){return tI||(tI=1,Fv=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return!1;for(a=n;a--!==0;){var l=s[a];if(!t(e[l],r[l]))return!1}return!0}return e!==e&&r!==r}),Fv}var zv,rI;function o8(){return rI||(rI=1,zv=function(e){for(var r=0,n=e.length,a=0,s;a<n;)r++,s=e.charCodeAt(a++),s>=55296&&s<=56319&&a<n&&(s=e.charCodeAt(a),(s&64512)==56320&&a++);return r}),zv}var $v,nI;function pc(){if(nI)return $v;nI=1,$v={copy:t,checkDataType:e,checkDataTypes:r,coerceToTypes:a,toHash:s,getProperty:d,escapeQuotes:f,equal:nR(),ucs2length:o8(),varOccurences:m,varReplace:h,schemaHasRules:v,schemaHasRulesExcept:y,schemaUnknownRules:w,toQuotedString:S,getPathExpr:R,getPath:x,getData:N,unescapeFragment:A,unescapeJsonPointer:L,escapeFragment:I,escapeJsonPointer:O};function t(M,P){P=P||{};for(var W in M)P[W]=M[W];return P}function e(M,P,W,X){var ee=X?" !== ":" === ",J=X?" || ":" && ",j=X?"!":"",G=X?"":"!";switch(M){case"null":return P+ee+"null";case"array":return j+"Array.isArray("+P+")";case"object":return"("+j+P+J+"typeof "+P+ee+'"object"'+J+G+"Array.isArray("+P+"))";case"integer":return"(typeof "+P+ee+'"number"'+J+G+"("+P+" % 1)"+J+P+ee+P+(W?J+j+"isFinite("+P+")":"")+")";case"number":return"(typeof "+P+ee+'"'+M+'"'+(W?J+j+"isFinite("+P+")":"")+")";default:return"typeof "+P+ee+'"'+M+'"'}}function r(M,P,W){switch(M.length){case 1:return e(M[0],P,W,!0);default:var X="",ee=s(M);ee.array&&ee.object&&(X=ee.null?"(":"(!"+P+" || ",X+="typeof "+P+' !== "object")',delete ee.null,delete ee.array,delete ee.object),ee.number&&delete ee.integer;for(var J in ee)X+=(X?" && ":"")+e(J,P,W,!0);return X}}var n=s(["string","number","integer","boolean","null"]);function a(M,P){if(Array.isArray(P)){for(var W=[],X=0;X<P.length;X++){var ee=P[X];(n[ee]||M==="array"&&ee==="array")&&(W[W.length]=ee)}if(W.length)return W}else{if(n[P])return[P];if(M==="array"&&P==="array")return["array"]}}function s(M){for(var P={},W=0;W<M.length;W++)P[M[W]]=!0;return P}var l=/^[a-z$_][a-z$_0-9]*$/i,c=/'|\\/g;function d(M){return typeof M=="number"?"["+M+"]":l.test(M)?"."+M:"['"+f(M)+"']"}function f(M){return M.replace(c,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function m(M,P){P+="[^0-9]";var W=M.match(new RegExp(P,"g"));return W?W.length:0}function h(M,P,W){return P+="([^0-9])",W=W.replace(/\$/g,"$$$$"),M.replace(new RegExp(P,"g"),W+"$1")}function v(M,P){if(typeof M=="boolean")return!M;for(var W in M)if(P[W])return!0}function y(M,P,W){if(typeof M=="boolean")return!M&&W!="not";for(var X in M)if(X!=W&&P[X])return!0}function w(M,P){if(typeof M!="boolean"){for(var W in M)if(!P[W])return W}}function S(M){return"'"+f(M)+"'"}function R(M,P,W,X){var ee=W?"'/' + "+P+(X?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):X?"'[' + "+P+" + ']'":"'[\\'' + "+P+" + '\\']'";return k(M,ee)}function x(M,P,W){var X=S(W?"/"+O(P):d(P));return k(M,X)}var _=/^\/(?:[^~]|~0|~1)*$/,C=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N(M,P,W){var X,ee,J,j;if(M==="")return"rootData";if(M[0]=="/"){if(!_.test(M))throw new Error("Invalid JSON-pointer: "+M);ee=M,J="rootData"}else{if(j=M.match(C),!j)throw new Error("Invalid JSON-pointer: "+M);if(X=+j[1],ee=j[2],ee=="#"){if(X>=P)throw new Error("Cannot access property/index "+X+" levels up, current level is "+P);return W[P-X]}if(X>P)throw new Error("Cannot access data "+X+" levels up, current level is "+P);if(J="data"+(P-X||""),!ee)return J}for(var G=J,V=ee.split("/"),te=0;te<V.length;te++){var re=V[te];re&&(J+=d(L(re)),G+=" && "+J)}return G}function k(M,P){return M=='""'?P:(M+" + "+P).replace(/([^\\])' \+ '/g,"$1")}function A(M){return L(decodeURIComponent(M))}function I(M){return encodeURIComponent(O(M))}function O(M){return M.replace(/~/g,"~0").replace(/\//g,"~1")}function L(M){return M.replace(/~1/g,"/").replace(/~0/g,"~")}return $v}var Bv,aI;function M2(){if(aI)return Bv;aI=1;var t=pc();Bv=e;function e(r){t.copy(r,this)}return Bv}var qv={exports:{}},oI;function i8(){if(oI)return qv.exports;oI=1;var t=qv.exports=function(n,a,s){typeof a=="function"&&(s=a,a={}),s=a.cb||s;var l=typeof s=="function"?s:s.pre||function(){},c=s.post||function(){};e(a,l,c,n,"",n)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(n,a,s,l,c,d,f,m,h,v){if(l&&typeof l=="object"&&!Array.isArray(l)){a(l,c,d,f,m,h,v);for(var y in l){var w=l[y];if(Array.isArray(w)){if(y in t.arrayKeywords)for(var S=0;S<w.length;S++)e(n,a,s,w[S],c+"/"+y+"/"+S,d,c,y,l,S)}else if(y in t.propsKeywords){if(w&&typeof w=="object")for(var R in w)e(n,a,s,w[R],c+"/"+y+"/"+r(R),d,c,y,l,R)}else(y in t.keywords||n.allKeys&&!(y in t.skipKeywords))&&e(n,a,s,w,c+"/"+y,d,c,y,l)}s(l,c,d,f,m,h,v)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return qv.exports}var Hv,iI;function aR(){if(iI)return Hv;iI=1;var t=a8(),e=nR(),r=pc(),n=M2(),a=i8();Hv=s,s.normalizeId=x,s.fullPath=w,s.url=_,s.ids=C,s.inlineRef=h,s.schema=l;function s(N,k,A){var I=this._refs[A];if(typeof I=="string")if(this._refs[I])I=this._refs[I];else return s.call(this,N,k,I);if(I=I||this._schemas[A],I instanceof n)return h(I.schema,this._opts.inlineRefs)?I.schema:I.validate||this._compile(I);var O=l.call(this,k,A),L,M,P;return O&&(L=O.schema,k=O.root,P=O.baseId),L instanceof n?M=L.validate||N.call(this,L.schema,k,void 0,P):L!==void 0&&(M=h(L,this._opts.inlineRefs)?L:N.call(this,L,k,void 0,P)),M}function l(N,k){var A=t.parse(k),I=S(A),O=w(this._getId(N.schema));if(Object.keys(N.schema).length===0||I!==O){var L=x(I),M=this._refs[L];if(typeof M=="string")return c.call(this,N,M,A);if(M instanceof n)M.validate||this._compile(M),N=M;else if(M=this._schemas[L],M instanceof n){if(M.validate||this._compile(M),L==x(k))return{schema:M,root:N,baseId:O};N=M}else return;if(!N.schema)return;O=w(this._getId(N.schema))}return f.call(this,A,O,N.schema,N)}function c(N,k,A){var I=l.call(this,N,k);if(I){var O=I.schema,L=I.baseId;N=I.root;var M=this._getId(O);return M&&(L=_(L,M)),f.call(this,A,L,O,N)}}var d=r.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function f(N,k,A,I){if(N.fragment=N.fragment||"",N.fragment.slice(0,1)=="/"){for(var O=N.fragment.split("/"),L=1;L<O.length;L++){var M=O[L];if(M){if(M=r.unescapeFragment(M),A=A[M],A===void 0)break;var P;if(!d[M]&&(P=this._getId(A),P&&(k=_(k,P)),A.$ref)){var W=_(k,A.$ref),X=l.call(this,I,W);X&&(A=X.schema,I=X.root,k=X.baseId)}}}if(A!==void 0&&A!==I.schema)return{schema:A,root:I,baseId:k}}}var m=r.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function h(N,k){if(k===!1)return!1;if(k===void 0||k===!0)return v(N);if(k)return y(N)<=k}function v(N){var k;if(Array.isArray(N)){for(var A=0;A<N.length;A++)if(k=N[A],typeof k=="object"&&!v(k))return!1}else for(var I in N)if(I=="$ref"||(k=N[I],typeof k=="object"&&!v(k)))return!1;return!0}function y(N){var k=0,A;if(Array.isArray(N)){for(var I=0;I<N.length;I++)if(A=N[I],typeof A=="object"&&(k+=y(A)),k==1/0)return 1/0}else for(var O in N){if(O=="$ref")return 1/0;if(m[O])k++;else if(A=N[O],typeof A=="object"&&(k+=y(A)+1),k==1/0)return 1/0}return k}function w(N,k){k!==!1&&(N=x(N));var A=t.parse(N);return S(A)}function S(N){return t.serialize(N).split("#")[0]+"#"}var R=/#\/?$/;function x(N){return N?N.replace(R,""):""}function _(N,k){return k=x(k),t.resolve(N,k)}function C(N){var k=x(this._getId(N)),A={"":k},I={"":w(k,!1)},O={},L=this;return a(N,{allKeys:!0},function(M,P,W,X,ee,J,j){if(P!==""){var G=L._getId(M),V=A[X],te=I[X]+"/"+ee;if(j!==void 0&&(te+="/"+(typeof j=="number"?j:r.escapeFragment(j))),typeof G=="string"){G=V=x(V?t.resolve(V,G):G);var re=L._refs[G];if(typeof re=="string"&&(re=L._refs[re]),re&&re.schema){if(!e(M,re.schema))throw new Error('id "'+G+'" resolves to more than one schema')}else if(G!=x(te))if(G[0]=="#"){if(O[G]&&!e(M,O[G]))throw new Error('id "'+G+'" resolves to more than one schema');O[G]=M}else L._refs[G]=te}A[P]=V,I[P]=te}}),O}return Hv}var Vv,sI;function oR(){if(sI)return Vv;sI=1;var t=aR();Vv={Validation:n(e),MissingRef:n(r)};function e(a){this.message="validation failed",this.errors=a,this.ajv=this.validation=!0}r.message=function(a,s){return"can't resolve reference "+s+" from id "+a};function r(a,s,l){this.message=l||r.message(a,s),this.missingRef=t.url(a,s),this.missingSchema=t.normalizeId(t.fullPath(this.missingRef))}function n(a){return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a}return Vv}var Gv,lI;function P2(){return lI||(lI=1,Gv=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&(function(s){return function(l){return function(c,d){var f={key:c,value:l[c]},m={key:d,value:l[d]};return s(f,m)}}})(e.cmp),a=[];return(function s(l){if(l&&l.toJSON&&typeof l.toJSON=="function"&&(l=l.toJSON()),l!==void 0){if(typeof l=="number")return isFinite(l)?""+l:"null";if(typeof l!="object")return JSON.stringify(l);var c,d;if(Array.isArray(l)){for(d="[",c=0;c<l.length;c++)c&&(d+=","),d+=s(l[c])||"null";return d+"]"}if(l===null)return"null";if(a.indexOf(l)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var f=a.push(l)-1,m=Object.keys(l).sort(n&&n(l));for(d="",c=0;c<m.length;c++){var h=m[c],v=s(l[h]);v&&(d&&(d+=","),d+=JSON.stringify(h)+":"+v)}return a.splice(f,1),"{"+d+"}"}})(t)}),Gv}var Wv,cI;function j2(){return cI||(cI=1,Wv=function(e,r,n){var a="",s=e.schema.$async===!0,l=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),c=e.self._getId(e.schema);if(e.opts.strictKeywords){var d=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(d){var f="unknown keyword: "+d;if(e.opts.strictKeywords==="log")e.logger.warn(f);else throw new Error(f)}}if(e.isTop&&(a+=" var validate = ",s&&(e.async=!0,a+="async "),a+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",c&&(e.opts.sourceCode||e.opts.processCode)&&(a+=" "+("/*# sourceURL="+c+" */")+" ")),typeof e.schema=="boolean"||!(l||e.schema.$ref)){var r="false schema",m=e.level,h=e.dataLevel,v=e.schema[r],y=e.schemaPath+e.util.getProperty(r),w=e.errSchemaPath+"/"+r,k=!e.opts.allErrors,O,S="data"+(h||""),N="valid"+m;if(e.schema===!1){e.isTop?k=!0:a+=" var "+N+" = false; ";var R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(O||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'boolean schema is false' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+S+" "),a+=" } "):a+=" {} ";var x=a;a=R.pop(),!e.compositeRule&&k?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?s?a+=" return data; ":a+=" validate.errors = null; return true; ":a+=" var "+N+" = true; ";return e.isTop&&(a+=" }; return validate; "),a}if(e.isTop){var _=e.isTop,m=e.level=0,h=e.dataLevel=0,S="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var C="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(C);else throw new Error(C)}a+=" var vErrors = null; ",a+=" var errors = 0; ",a+=" if (rootData === undefined) rootData = data; "}else{var m=e.level,h=e.dataLevel,S="data"+(h||"");if(c&&(e.baseId=e.resolve.url(e.baseId,c)),s&&!e.async)throw new Error("async schema in sync schema");a+=" var errs_"+m+" = errors;"}var N="valid"+m,k=!e.opts.allErrors,A="",I="",O,L=e.schema.type,M=Array.isArray(L);if(L&&e.opts.nullable&&e.schema.nullable===!0&&(M?L.indexOf("null")==-1&&(L=L.concat("null")):L!="null"&&(L=[L,"null"],M=!0)),M&&L.length==1&&(L=L[0],M=!1),e.schema.$ref&&l){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(l=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(a+=" "+e.RULES.all.$comment.code(e,"$comment")),L){if(e.opts.coerceTypes)var P=e.util.coerceToTypes(e.opts.coerceTypes,L);var W=e.RULES.types[L];if(P||M||W===!0||W&&!$e(W)){var y=e.schemaPath+".type",w=e.errSchemaPath+"/type",y=e.schemaPath+".type",w=e.errSchemaPath+"/type",X=M?"checkDataTypes":"checkDataType";if(a+=" if ("+e.util[X](L,S,e.opts.strictNumbers,!0)+") { ",P){var ee="dataType"+m,J="coerced"+m;a+=" var "+ee+" = typeof "+S+"; var "+J+" = undefined; ",e.opts.coerceTypes=="array"&&(a+=" if ("+ee+" == 'object' && Array.isArray("+S+") && "+S+".length == 1) { "+S+" = "+S+"[0]; "+ee+" = typeof "+S+"; if ("+e.util.checkDataType(e.schema.type,S,e.opts.strictNumbers)+") "+J+" = "+S+"; } "),a+=" if ("+J+" !== undefined) ; ";var j=P;if(j)for(var G,V=-1,te=j.length-1;V<te;)G=j[V+=1],G=="string"?a+=" else if ("+ee+" == 'number' || "+ee+" == 'boolean') "+J+" = '' + "+S+"; else if ("+S+" === null) "+J+" = ''; ":G=="number"||G=="integer"?(a+=" else if ("+ee+" == 'boolean' || "+S+" === null || ("+ee+" == 'string' && "+S+" && "+S+" == +"+S+" ",G=="integer"&&(a+=" && !("+S+" % 1)"),a+=")) "+J+" = +"+S+"; "):G=="boolean"?a+=" else if ("+S+" === 'false' || "+S+" === 0 || "+S+" === null) "+J+" = false; else if ("+S+" === 'true' || "+S+" === 1) "+J+" = true; ":G=="null"?a+=" else if ("+S+" === '' || "+S+" === 0 || "+S+" === false) "+J+" = null; ":e.opts.coerceTypes=="array"&&G=="array"&&(a+=" else if ("+ee+" == 'string' || "+ee+" == 'number' || "+ee+" == 'boolean' || "+S+" == null) "+J+" = ["+S+"]; ");a+=" else { ";var R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(O||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",M?a+=""+L.join(","):a+=""+L,a+="' } ",e.opts.messages!==!1&&(a+=" , message: 'should be ",M?a+=""+L.join(","):a+=""+L,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+y+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+S+" "),a+=" } "):a+=" {} ";var x=a;a=R.pop(),!e.compositeRule&&k?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } if ("+J+" !== undefined) { ";var re=h?"data"+(h-1||""):"parentData",U=h?e.dataPathArr[h]:"parentDataProperty";a+=" "+S+" = "+J+"; ",h||(a+="if ("+re+" !== undefined)"),a+=" "+re+"["+U+"] = "+J+"; } "}else{var R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(O||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",M?a+=""+L.join(","):a+=""+L,a+="' } ",e.opts.messages!==!1&&(a+=" , message: 'should be ",M?a+=""+L.join(","):a+=""+L,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+y+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+S+" "),a+=" } "):a+=" {} ";var x=a;a=R.pop(),!e.compositeRule&&k?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } "}}if(e.schema.$ref&&!l)a+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",k&&(a+=" } if (errors === ",_?a+="0":a+="errs_"+m,a+=") { ",I+="}");else{var q=e.RULES;if(q){for(var W,$=-1,Y=q.length-1;$<Y;)if(W=q[$+=1],$e(W)){if(W.type&&(a+=" if ("+e.util.checkDataType(W.type,S,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(W.type=="object"&&e.schema.properties){var v=e.schema.properties,Q=Object.keys(v),F=Q;if(F)for(var z,K=-1,ae=F.length-1;K<ae;){z=F[K+=1];var H=v[z];if(H.default!==void 0){var de=S+e.util.getProperty(z);if(e.compositeRule){if(e.opts.strictDefaults){var C="default is ignored for: "+de;if(e.opts.strictDefaults==="log")e.logger.warn(C);else throw new Error(C)}}else a+=" if ("+de+" === undefined ",e.opts.useDefaults=="empty"&&(a+=" || "+de+" === null || "+de+" === '' "),a+=" ) "+de+" = ",e.opts.useDefaults=="shared"?a+=" "+e.useDefault(H.default)+" ":a+=" "+JSON.stringify(H.default)+" ",a+="; "}}}else if(W.type=="array"&&Array.isArray(e.schema.items)){var me=e.schema.items;if(me){for(var H,V=-1,xe=me.length-1;V<xe;)if(H=me[V+=1],H.default!==void 0){var de=S+"["+V+"]";if(e.compositeRule){if(e.opts.strictDefaults){var C="default is ignored for: "+de;if(e.opts.strictDefaults==="log")e.logger.warn(C);else throw new Error(C)}}else a+=" if ("+de+" === undefined ",e.opts.useDefaults=="empty"&&(a+=" || "+de+" === null || "+de+" === '' "),a+=" ) "+de+" = ",e.opts.useDefaults=="shared"?a+=" "+e.useDefault(H.default)+" ":a+=" "+JSON.stringify(H.default)+" ",a+="; "}}}}var be=W.rules;if(be){for(var _e,Ae=-1,Fe=be.length-1;Ae<Fe;)if(_e=be[Ae+=1],at(_e)){var Pe=_e.code(e,_e.keyword,W.type);Pe&&(a+=" "+Pe+" ",k&&(A+="}"))}}if(k&&(a+=" "+A+" ",A=""),W.type&&(a+=" } ",L&&L===W.type&&!P)){a+=" else { ";var y=e.schemaPath+".type",w=e.errSchemaPath+"/type",R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(O||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",M?a+=""+L.join(","):a+=""+L,a+="' } ",e.opts.messages!==!1&&(a+=" , message: 'should be ",M?a+=""+L.join(","):a+=""+L,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+y+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+S+" "),a+=" } "):a+=" {} ";var x=a;a=R.pop(),!e.compositeRule&&k?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } "}k&&(a+=" if (errors === ",_?a+="0":a+="errs_"+m,a+=") { ",I+="}")}}}k&&(a+=" "+I+" "),_?(s?(a+=" if (errors === 0) return data; ",a+=" else throw new ValidationError(vErrors); "):(a+=" validate.errors = vErrors; ",a+=" return errors === 0; "),a+=" }; return validate;"):a+=" var "+N+" = errors === errs_"+m+";";function $e(Ce){for(var ze=Ce.rules,we=0;we<ze.length;we++)if(at(ze[we]))return!0}function at(Ce){return e.schema[Ce.keyword]!==void 0||Ce.implements&&ce(Ce)}function ce(Ce){for(var ze=Ce.implements,we=0;we<ze.length;we++)if(e.schema[ze[we]]!==void 0)return!0}return a}),Wv}var Yv,uI;function s8(){if(uI)return Yv;uI=1;var t=aR(),e=pc(),r=oR(),n=P2(),a=j2(),s=e.ucs2length,l=nR(),c=r.Validation;Yv=d;function d(x,_,C,N){var k=this,A=this._opts,I=[void 0],O={},L=[],M={},P=[],W={},X=[];_=_||{schema:x,refVal:I,refs:O};var ee=f.call(this,x,_,N),J=this._compilations[ee.index];if(ee.compiling)return J.callValidate=re;var j=this._formats,G=this.RULES;try{var V=U(x,_,C,N);J.validate=V;var te=J.callValidate;return te&&(te.schema=V.schema,te.errors=null,te.refs=V.refs,te.refVal=V.refVal,te.root=V.root,te.$async=V.$async,A.sourceCode&&(te.source=V.source)),V}finally{m.call(this,x,_,N)}function re(){var H=J.validate,de=H.apply(this,arguments);return re.errors=H.errors,de}function U(H,de,me,xe){var be=!de||de&&de.schema==H;if(de.schema!=_.schema)return d.call(k,H,de,me,xe);var _e=H.$async===!0,Ae=a({isTop:!0,schema:H,isRoot:be,baseId:xe,root:de,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:r.MissingRef,RULES:G,validate:a,util:e,resolve:t,resolveRef:q,usePattern:z,useDefault:K,useCustomRule:ae,opts:A,formats:j,logger:k.logger,self:k});Ae=R(I,w)+R(L,v)+R(P,y)+R(X,S)+Ae,A.processCode&&(Ae=A.processCode(Ae,H));var Fe;try{var Pe=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",Ae);Fe=Pe(k,G,j,_,I,P,X,l,s,c),I[0]=Fe}catch($e){throw k.logger.error("Error compiling schema, function code:",Ae),$e}return Fe.schema=H,Fe.errors=null,Fe.refs=O,Fe.refVal=I,Fe.root=be?Fe:de,_e&&(Fe.$async=!0),A.sourceCode===!0&&(Fe.source={code:Ae,patterns:L,defaults:P}),Fe}function q(H,de,me){de=t.url(H,de);var xe=O[de],be,_e;if(xe!==void 0)return be=I[xe],_e="refVal["+xe+"]",F(be,_e);if(!me&&_.refs){var Ae=_.refs[de];if(Ae!==void 0)return be=_.refVal[Ae],_e=$(de,be),F(be,_e)}_e=$(de);var Fe=t.call(k,U,_,de);if(Fe===void 0){var Pe=C&&C[de];Pe&&(Fe=t.inlineRef(Pe,A.inlineRefs)?Pe:d.call(k,Pe,_,C,H))}if(Fe===void 0)Y(de);else return Q(de,Fe),F(Fe,_e)}function $(H,de){var me=I.length;return I[me]=de,O[H]=me,"refVal"+me}function Y(H){delete O[H]}function Q(H,de){var me=O[H];I[me]=de}function F(H,de){return typeof H=="object"||typeof H=="boolean"?{code:de,schema:H,inline:!0}:{code:de,$async:H&&!!H.$async}}function z(H){var de=M[H];return de===void 0&&(de=M[H]=L.length,L[de]=H),"pattern"+de}function K(H){switch(typeof H){case"boolean":case"number":return""+H;case"string":return e.toQuotedString(H);case"object":if(H===null)return"null";var de=n(H),me=W[de];return me===void 0&&(me=W[de]=P.length,P[me]=H),"default"+me}}function ae(H,de,me,xe){if(k._opts.validateSchema!==!1){var be=H.definition.dependencies;if(be&&!be.every(function(ze){return Object.prototype.hasOwnProperty.call(me,ze)}))throw new Error("parent schema must have all required keywords: "+be.join(","));var _e=H.definition.validateSchema;if(_e){var Ae=_e(de);if(!Ae){var Fe="keyword schema is invalid: "+k.errorsText(_e.errors);if(k._opts.validateSchema=="log")k.logger.error(Fe);else throw new Error(Fe)}}}var Pe=H.definition.compile,$e=H.definition.inline,at=H.definition.macro,ce;if(Pe)ce=Pe.call(k,de,me,xe);else if(at)ce=at.call(k,de,me,xe),A.validateSchema!==!1&&k.validateSchema(ce,!0);else if($e)ce=$e.call(k,xe,H.keyword,de,me);else if(ce=H.definition.validate,!ce)return;if(ce===void 0)throw new Error('custom keyword "'+H.keyword+'"failed to compile');var Ce=X.length;return X[Ce]=ce,{code:"customRule"+Ce,validate:ce}}}function f(x,_,C){var N=h.call(this,x,_,C);return N>=0?{index:N,compiling:!0}:(N=this._compilations.length,this._compilations[N]={schema:x,root:_,baseId:C},{index:N,compiling:!1})}function m(x,_,C){var N=h.call(this,x,_,C);N>=0&&this._compilations.splice(N,1)}function h(x,_,C){for(var N=0;N<this._compilations.length;N++){var k=this._compilations[N];if(k.schema==x&&k.root==_&&k.baseId==C)return N}return-1}function v(x,_){return"var pattern"+x+" = new RegExp("+e.toQuotedString(_[x])+");"}function y(x){return"var default"+x+" = defaults["+x+"];"}function w(x,_){return _[x]===void 0?"":"var refVal"+x+" = refVal["+x+"];"}function S(x){return"var customRule"+x+" = customRules["+x+"];"}function R(x,_){if(!x.length)return"";for(var C="",N=0;N<x.length;N++)C+=_(N,x);return C}return Yv}var Kv={exports:{}},dI;function l8(){if(dI)return Kv.exports;dI=1;var t=Kv.exports=function(){this._cache={}};return t.prototype.put=function(r,n){this._cache[r]=n},t.prototype.get=function(r){return this._cache[r]},t.prototype.del=function(r){delete this._cache[r]},t.prototype.clear=function(){this._cache={}},Kv.exports}var Zv,fI;function c8(){if(fI)return Zv;fI=1;var t=pc(),e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,r=[0,31,28,31,30,31,30,31,31,30,31,30,31],n=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,a=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,s=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,l=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,c=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,d=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,m=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,v=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Zv=y;function y(I){return I=I=="full"?"full":"fast",t.copy(y[I])}y.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:d,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:A,uuid:f,"json-pointer":m,"json-pointer-uri-fragment":h,"relative-json-pointer":v},y.full={date:S,time:R,"date-time":_,uri:N,"uri-reference":l,"uri-template":c,url:d,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:A,uuid:f,"json-pointer":m,"json-pointer-uri-fragment":h,"relative-json-pointer":v};function w(I){return I%4===0&&(I%100!==0||I%400===0)}function S(I){var O=I.match(e);if(!O)return!1;var L=+O[1],M=+O[2],P=+O[3];return M>=1&&M<=12&&P>=1&&P<=(M==2&&w(L)?29:r[M])}function R(I,O){var L=I.match(n);if(!L)return!1;var M=L[1],P=L[2],W=L[3],X=L[5];return(M<=23&&P<=59&&W<=59||M==23&&P==59&&W==60)&&(!O||X)}var x=/t|\s/i;function _(I){var O=I.split(x);return O.length==2&&S(O[0])&&R(O[1],!0)}var C=/\/|:/;function N(I){return C.test(I)&&s.test(I)}var k=/[^\\]\\Z/;function A(I){if(k.test(I))return!1;try{return new RegExp(I),!0}catch{return!1}}return Zv}var Xv,pI;function u8(){return pI||(pI=1,Xv=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,m="data"+(l||""),h="valid"+s,v,y;if(c=="#"||c=="#/")e.isRoot?(v=e.async,y="validate"):(v=e.root.schema.$async===!0,y="root.refVal[0]");else{var w=e.resolveRef(e.baseId,c,e.isRoot);if(w===void 0){var S=e.MissingRefError.message(e.baseId,c);if(e.opts.missingRefs=="fail"){e.logger.error(S);var R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",e.opts.messages!==!1&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),a+=" } "):a+=" {} ";var x=a;a=R.pop(),!e.compositeRule&&f?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f&&(a+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(S),f&&(a+=" if (true) { ");else throw new e.MissingRefError(e.baseId,c,S)}else if(w.inline){var _=e.util.copy(e);_.level++;var C="valid"+_.level;_.schema=w.schema,_.schemaPath="",_.errSchemaPath=c;var N=e.validate(_).replace(/validate\.schema/g,w.code);a+=" "+N+" ",f&&(a+=" if ("+C+") { ")}else v=w.$async===!0||e.async&&w.$async!==!1,y=w.code}if(y){var R=R||[];R.push(a),a="",e.opts.passContext?a+=" "+y+".call(this, ":a+=" "+y+"( ",a+=" "+m+", (dataPath || '')",e.errorPath!='""'&&(a+=" + "+e.errorPath);var k=l?"data"+(l-1||""):"parentData",A=l?e.dataPathArr[l]:"parentDataProperty";a+=" , "+k+" , "+A+", rootData) ";var I=a;if(a=R.pop(),v){if(!e.async)throw new Error("async schema referenced by sync schema");f&&(a+=" var "+h+"; "),a+=" try { await "+I+"; ",f&&(a+=" "+h+" = true; "),a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",f&&(a+=" "+h+" = false; "),a+=" } ",f&&(a+=" if ("+h+") { ")}else a+=" if (!"+I+") { if (vErrors === null) vErrors = "+y+".errors; else vErrors = vErrors.concat("+y+".errors); errors = vErrors.length; } ",f&&(a+=" else { ")}return a}),Xv}var Qv,mI;function d8(){return mI||(mI=1,Qv=function(e,r,n){var a=" ",s=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f=e.util.copy(e),m="";f.level++;var h="valid"+f.level,v=f.baseId,y=!0,w=s;if(w)for(var S,R=-1,x=w.length-1;R<x;)S=w[R+=1],(e.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===!1:e.util.schemaHasRules(S,e.RULES.all))&&(y=!1,f.schema=S,f.schemaPath=l+"["+R+"]",f.errSchemaPath=c+"/"+R,a+=" "+e.validate(f)+" ",f.baseId=v,d&&(a+=" if ("+h+") { ",m+="}"));return d&&(y?a+=" if (true) { ":a+=" "+m.slice(0,-1)+" "),a}),Qv}var Jv,hI;function f8(){return hI||(hI=1,Jv=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y="errs__"+s,w=e.util.copy(e),S="";w.level++;var R="valid"+w.level,x=c.every(function(O){return e.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:e.util.schemaHasRules(O,e.RULES.all)});if(x){var _=w.baseId;a+=" var "+y+" = errors; var "+v+" = false; ";var C=e.compositeRule;e.compositeRule=w.compositeRule=!0;var N=c;if(N)for(var k,A=-1,I=N.length-1;A<I;)k=N[A+=1],w.schema=k,w.schemaPath=d+"["+A+"]",w.errSchemaPath=f+"/"+A,a+=" "+e.validate(w)+" ",w.baseId=_,a+=" "+v+" = "+v+" || "+R+"; if (!"+v+") { ",S+="}";e.compositeRule=w.compositeRule=C,a+=" "+S+" if (!"+v+") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } else { errors = "+y+"; if (vErrors !== null) { if ("+y+") vErrors.length = "+y+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else m&&(a+=" if (true) { ");return a}),Jv}var eb,gI;function p8(){return gI||(gI=1,eb=function(e,r,n){var a=" ",s=e.schema[r],l=e.errSchemaPath+"/"+r;e.opts.allErrors;var c=e.util.toQuotedString(s);return e.opts.$comment===!0?a+=" console.log("+c+");":typeof e.opts.$comment=="function"&&(a+=" self._opts.$comment("+c+", "+e.util.toQuotedString(l)+", validate.root.schema);"),a}),eb}var tb,vI;function m8(){return vI||(vI=1,tb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y=e.opts.$data&&c&&c.$data;y&&(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; "),y||(a+=" var schema"+s+" = validate.schema"+d+";"),a+="var "+v+" = equal("+h+", schema"+s+"); if (!"+v+") { ";var w=w||[];w.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { allowedValue: schema"+s+" } ",e.opts.messages!==!1&&(a+=" , message: 'should be equal to constant' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var S=a;return a=w.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+S+"]); ":a+=" validate.errors = ["+S+"]; return false; ":a+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",m&&(a+=" else { "),a}),tb}var rb,bI;function h8(){return bI||(bI=1,rb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y="errs__"+s,w=e.util.copy(e),S="";w.level++;var R="valid"+w.level,x="i"+s,_=w.dataLevel=e.dataLevel+1,C="data"+_,N=e.baseId,k=e.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:e.util.schemaHasRules(c,e.RULES.all);if(a+="var "+y+" = errors;var "+v+";",k){var A=e.compositeRule;e.compositeRule=w.compositeRule=!0,w.schema=c,w.schemaPath=d,w.errSchemaPath=f,a+=" var "+R+" = false; for (var "+x+" = 0; "+x+" < "+h+".length; "+x+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var I=h+"["+x+"]";w.dataPathArr[_]=x;var O=e.validate(w);w.baseId=N,e.util.varOccurences(O,C)<2?a+=" "+e.util.varReplace(O,C,I)+" ":a+=" var "+C+" = "+I+"; "+O+" ",a+=" if ("+R+") break; } ",e.compositeRule=w.compositeRule=A,a+=" "+S+" if (!"+R+") {"}else a+=" if ("+h+".length == 0) {";var L=L||[];L.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var M=a;return a=L.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+M+"]); ":a+=" validate.errors = ["+M+"]; return false; ":a+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",k&&(a+=" errors = "+y+"; if (vErrors !== null) { if ("+y+") vErrors.length = "+y+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a}),rb}var nb,yI;function g8(){return yI||(yI=1,nb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="errs__"+s,y=e.util.copy(e),w="";y.level++;var S="valid"+y.level,R={},x={},_=e.opts.ownProperties;for(A in c)if(A!="__proto__"){var C=c[A],N=Array.isArray(C)?x:R;N[A]=C}a+="var "+v+" = errors;";var k=e.errorPath;a+="var missing"+s+";";for(var A in x)if(N=x[A],N.length){if(a+=" if ( "+h+e.util.getProperty(A)+" !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(A)+"') "),m){a+=" && ( ";var I=N;if(I)for(var O,L=-1,M=I.length-1;L<M;){O=I[L+=1],L&&(a+=" || ");var P=e.util.getProperty(O),W=h+P;a+=" ( ( "+W+" === undefined ",_&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(O)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?O:P)+") ) "}a+=")) { ";var X="missing"+s,ee="' + "+X+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(k,X,!0):k+" + "+X);var J=J||[];J.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { property: '"+e.util.escapeQuotes(A)+"', missingProperty: '"+ee+"', depsCount: "+N.length+", deps: '"+e.util.escapeQuotes(N.length==1?N[0]:N.join(", "))+"' } ",e.opts.messages!==!1&&(a+=" , message: 'should have ",N.length==1?a+="property "+e.util.escapeQuotes(N[0]):a+="properties "+e.util.escapeQuotes(N.join(", ")),a+=" when property "+e.util.escapeQuotes(A)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var j=a;a=J.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+j+"]); ":a+=" validate.errors = ["+j+"]; return false; ":a+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{a+=" ) { ";var G=N;if(G)for(var O,V=-1,te=G.length-1;V<te;){O=G[V+=1];var P=e.util.getProperty(O),ee=e.util.escapeQuotes(O),W=h+P;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(k,O,e.opts.jsonPointers)),a+=" if ( "+W+" === undefined ",_&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(O)+"') "),a+=") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { property: '"+e.util.escapeQuotes(A)+"', missingProperty: '"+ee+"', depsCount: "+N.length+", deps: '"+e.util.escapeQuotes(N.length==1?N[0]:N.join(", "))+"' } ",e.opts.messages!==!1&&(a+=" , message: 'should have ",N.length==1?a+="property "+e.util.escapeQuotes(N[0]):a+="properties "+e.util.escapeQuotes(N.join(", ")),a+=" when property "+e.util.escapeQuotes(A)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}a+=" } ",m&&(w+="}",a+=" else { ")}e.errorPath=k;var re=y.baseId;for(var A in R){var C=R[A];(e.opts.strictKeywords?typeof C=="object"&&Object.keys(C).length>0||C===!1:e.util.schemaHasRules(C,e.RULES.all))&&(a+=" "+S+" = true; if ( "+h+e.util.getProperty(A)+" !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(A)+"') "),a+=") { ",y.schema=C,y.schemaPath=d+e.util.getProperty(A),y.errSchemaPath=f+"/"+e.util.escapeFragment(A),a+=" "+e.validate(y)+" ",y.baseId=re,a+=" } ",m&&(a+=" if ("+S+") { ",w+="}"))}return m&&(a+=" "+w+" if ("+v+" == errors) {"),a}),nb}var ab,EI;function v8(){return EI||(EI=1,ab=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y=e.opts.$data&&c&&c.$data;y&&(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ");var w="i"+s,S="schema"+s;y||(a+=" var "+S+" = validate.schema"+d+";"),a+="var "+v+";",y&&(a+=" if (schema"+s+" === undefined) "+v+" = true; else if (!Array.isArray(schema"+s+")) "+v+" = false; else {"),a+=""+v+" = false;for (var "+w+"=0; "+w+"<"+S+".length; "+w+"++) if (equal("+h+", "+S+"["+w+"])) { "+v+" = true; break; }",y&&(a+=" } "),a+=" if (!"+v+") { ";var R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { allowedValues: schema"+s+" } ",e.opts.messages!==!1&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var x=a;return a=R.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",m&&(a+=" else { "),a}),ab}var ob,SI;function b8(){return SI||(SI=1,ob=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||"");if(e.opts.format===!1)return m&&(a+=" if (true) { "),a;var v=e.opts.$data&&c&&c.$data,y;v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c;var w=e.opts.unknownFormats,S=Array.isArray(w);if(v){var R="format"+s,x="isObject"+s,_="formatType"+s;a+=" var "+R+" = formats["+y+"]; var "+x+" = typeof "+R+" == 'object' && !("+R+" instanceof RegExp) && "+R+".validate; var "+_+" = "+x+" && "+R+".type || 'string'; if ("+x+") { ",e.async&&(a+=" var async"+s+" = "+R+".async; "),a+=" "+R+" = "+R+".validate; } if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'string') || "),a+=" (",w!="ignore"&&(a+=" ("+y+" && !"+R+" ",S&&(a+=" && self._opts.unknownFormats.indexOf("+y+") == -1 "),a+=") || "),a+=" ("+R+" && "+_+" == '"+n+"' && !(typeof "+R+" == 'function' ? ",e.async?a+=" (async"+s+" ? await "+R+"("+h+") : "+R+"("+h+")) ":a+=" "+R+"("+h+") ",a+=" : "+R+".test("+h+"))))) {"}else{var R=e.formats[c];if(!R){if(w=="ignore")return e.logger.warn('unknown format "'+c+'" ignored in schema at path "'+e.errSchemaPath+'"'),m&&(a+=" if (true) { "),a;if(S&&w.indexOf(c)>=0)return m&&(a+=" if (true) { "),a;throw new Error('unknown format "'+c+'" is used in schema at path "'+e.errSchemaPath+'"')}var x=typeof R=="object"&&!(R instanceof RegExp)&&R.validate,_=x&&R.type||"string";if(x){var C=R.async===!0;R=R.validate}if(_!=n)return m&&(a+=" if (true) { "),a;if(C){if(!e.async)throw new Error("async format in sync schema");var N="formats"+e.util.getProperty(c)+".validate";a+=" if (!(await "+N+"("+h+"))) { "}else{a+=" if (! ";var N="formats"+e.util.getProperty(c);x&&(N+=".validate"),typeof R=="function"?a+=" "+N+"("+h+") ":a+=" "+N+".test("+h+") ",a+=") { "}}var k=k||[];k.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { format: ",v?a+=""+y:a+=""+e.util.toQuotedString(c),a+=" } ",e.opts.messages!==!1&&(a+=` , message: 'should match format "`,v?a+="' + "+y+" + '":a+=""+e.util.escapeQuotes(c),a+=`"' `),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+e.util.toQuotedString(c),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var A=a;return a=k.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+A+"]); ":a+=" validate.errors = ["+A+"]; return false; ":a+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",m&&(a+=" else { "),a}),ob}var ib,xI;function y8(){return xI||(xI=1,ib=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y="errs__"+s,w=e.util.copy(e);w.level++;var S="valid"+w.level,R=e.schema.then,x=e.schema.else,_=R!==void 0&&(e.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:e.util.schemaHasRules(R,e.RULES.all)),C=x!==void 0&&(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all)),N=w.baseId;if(_||C){var k;w.createErrors=!1,w.schema=c,w.schemaPath=d,w.errSchemaPath=f,a+=" var "+y+" = errors; var "+v+" = true; ";var A=e.compositeRule;e.compositeRule=w.compositeRule=!0,a+=" "+e.validate(w)+" ",w.baseId=N,w.createErrors=!0,a+=" errors = "+y+"; if (vErrors !== null) { if ("+y+") vErrors.length = "+y+"; else vErrors = null; } ",e.compositeRule=w.compositeRule=A,_?(a+=" if ("+S+") { ",w.schema=e.schema.then,w.schemaPath=e.schemaPath+".then",w.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(w)+" ",w.baseId=N,a+=" "+v+" = "+S+"; ",_&&C?(k="ifClause"+s,a+=" var "+k+" = 'then'; "):k="'then'",a+=" } ",C&&(a+=" else { ")):a+=" if (!"+S+") { ",C&&(w.schema=e.schema.else,w.schemaPath=e.schemaPath+".else",w.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(w)+" ",w.baseId=N,a+=" "+v+" = "+S+"; ",_&&C?(k="ifClause"+s,a+=" var "+k+" = 'else'; "):k="'else'",a+=" } "),a+=" if (!"+v+") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { failingKeyword: "+k+" } ",e.opts.messages!==!1&&(a+=` , message: 'should match "' + `+k+` + '" schema' `),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",m&&(a+=" else { ")}else m&&(a+=" if (true) { ");return a}),ib}var sb,wI;function E8(){return wI||(wI=1,sb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y="errs__"+s,w=e.util.copy(e),S="";w.level++;var R="valid"+w.level,x="i"+s,_=w.dataLevel=e.dataLevel+1,C="data"+_,N=e.baseId;if(a+="var "+y+" = errors;var "+v+";",Array.isArray(c)){var k=e.schema.additionalItems;if(k===!1){a+=" "+v+" = "+h+".length <= "+c.length+"; ";var A=f;f=e.errSchemaPath+"/additionalItems",a+=" if (!"+v+") { ";var I=I||[];I.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+c.length+" } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT have more than "+c.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var O=a;a=I.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+O+"]); ":a+=" validate.errors = ["+O+"]; return false; ":a+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",f=A,m&&(S+="}",a+=" else { ")}var L=c;if(L){for(var M,P=-1,W=L.length-1;P<W;)if(M=L[P+=1],e.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:e.util.schemaHasRules(M,e.RULES.all)){a+=" "+R+" = true; if ("+h+".length > "+P+") { ";var X=h+"["+P+"]";w.schema=M,w.schemaPath=d+"["+P+"]",w.errSchemaPath=f+"/"+P,w.errorPath=e.util.getPathExpr(e.errorPath,P,e.opts.jsonPointers,!0),w.dataPathArr[_]=P;var ee=e.validate(w);w.baseId=N,e.util.varOccurences(ee,C)<2?a+=" "+e.util.varReplace(ee,C,X)+" ":a+=" var "+C+" = "+X+"; "+ee+" ",a+=" } ",m&&(a+=" if ("+R+") { ",S+="}")}}if(typeof k=="object"&&(e.opts.strictKeywords?typeof k=="object"&&Object.keys(k).length>0||k===!1:e.util.schemaHasRules(k,e.RULES.all))){w.schema=k,w.schemaPath=e.schemaPath+".additionalItems",w.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+R+" = true; if ("+h+".length > "+c.length+") { for (var "+x+" = "+c.length+"; "+x+" < "+h+".length; "+x+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var X=h+"["+x+"]";w.dataPathArr[_]=x;var ee=e.validate(w);w.baseId=N,e.util.varOccurences(ee,C)<2?a+=" "+e.util.varReplace(ee,C,X)+" ":a+=" var "+C+" = "+X+"; "+ee+" ",m&&(a+=" if (!"+R+") break; "),a+=" } } ",m&&(a+=" if ("+R+") { ",S+="}")}}else if(e.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:e.util.schemaHasRules(c,e.RULES.all)){w.schema=c,w.schemaPath=d,w.errSchemaPath=f,a+=" for (var "+x+" = 0; "+x+" < "+h+".length; "+x+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var X=h+"["+x+"]";w.dataPathArr[_]=x;var ee=e.validate(w);w.baseId=N,e.util.varOccurences(ee,C)<2?a+=" "+e.util.varReplace(ee,C,X)+" ":a+=" var "+C+" = "+X+"; "+ee+" ",m&&(a+=" if (!"+R+") break; "),a+=" }"}return m&&(a+=" "+S+" if ("+y+" == errors) {"),a}),sb}var lb,_I;function TI(){return _I||(_I=1,lb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,N,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c;var w=r=="maximum",S=w?"exclusiveMaximum":"exclusiveMinimum",R=e.schema[S],x=e.opts.$data&&R&&R.$data,_=w?"<":">",C=w?">":"<",N=void 0;if(!(v||typeof c=="number"||c===void 0))throw new Error(r+" must be number");if(!(x||R===void 0||typeof R=="number"||typeof R=="boolean"))throw new Error(S+" must be number or boolean");if(x){var k=e.util.getData(R.$data,l,e.dataPathArr),A="exclusive"+s,I="exclType"+s,O="exclIsNumber"+s,L="op"+s,M="' + "+L+" + '";a+=" var schemaExcl"+s+" = "+k+"; ",k="schemaExcl"+s,a+=" var "+A+"; var "+I+" = typeof "+k+"; if ("+I+" != 'boolean' && "+I+" != 'undefined' && "+I+" != 'number') { ";var N=S,P=P||[];P.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(N||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: '"+S+" should be boolean' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var W=a;a=P.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+W+"]); ":a+=" validate.errors = ["+W+"]; return false; ":a+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),a+=" "+I+" == 'number' ? ( ("+A+" = "+y+" === undefined || "+k+" "+_+"= "+y+") ? "+h+" "+C+"= "+k+" : "+h+" "+C+" "+y+" ) : ( ("+A+" = "+k+" === true) ? "+h+" "+C+"= "+y+" : "+h+" "+C+" "+y+" ) || "+h+" !== "+h+") { var op"+s+" = "+A+" ? '"+_+"' : '"+_+"='; ",c===void 0&&(N=S,f=e.errSchemaPath+"/"+S,y=k,v=x)}else{var O=typeof R=="number",M=_;if(O&&v){var L="'"+M+"'";a+=" if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),a+=" ( "+y+" === undefined || "+R+" "+_+"= "+y+" ? "+h+" "+C+"= "+R+" : "+h+" "+C+" "+y+" ) || "+h+" !== "+h+") { "}else{O&&c===void 0?(A=!0,N=S,f=e.errSchemaPath+"/"+S,y=R,C+="="):(O&&(y=Math[w?"min":"max"](R,c)),R===(O?y:!0)?(A=!0,N=S,f=e.errSchemaPath+"/"+S,C+="="):(A=!1,M+="="));var L="'"+M+"'";a+=" if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),a+=" "+h+" "+C+" "+y+" || "+h+" !== "+h+") { "}}N=N||r;var P=P||[];P.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(N||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { comparison: "+L+", limit: "+y+", exclusive: "+A+" } ",e.opts.messages!==!1&&(a+=" , message: 'should be "+M+" ",v?a+="' + "+y:a+=""+y+"'"),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var W=a;return a=P.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+W+"]); ":a+=" validate.errors = ["+W+"]; return false; ":a+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",m&&(a+=" else { "),a}),lb}var cb,RI;function CI(){return RI||(RI=1,cb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,S,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;if(v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c,!(v||typeof c=="number"))throw new Error(r+" must be number");var w=r=="maxItems"?">":"<";a+="if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),a+=" "+h+".length "+w+" "+y+") { ";var S=r,R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(S||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+y+" } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT have ",r=="maxItems"?a+="more":a+="fewer",a+=" than ",v?a+="' + "+y+" + '":a+=""+c,a+=" items' "),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var x=a;return a=R.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",m&&(a+=" else { "),a}),cb}var ub,AI;function NI(){return AI||(AI=1,ub=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,S,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;if(v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c,!(v||typeof c=="number"))throw new Error(r+" must be number");var w=r=="maxLength"?">":"<";a+="if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),e.opts.unicode===!1?a+=" "+h+".length ":a+=" ucs2length("+h+") ",a+=" "+w+" "+y+") { ";var S=r,R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(S||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+y+" } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT be ",r=="maxLength"?a+="longer":a+="shorter",a+=" than ",v?a+="' + "+y+" + '":a+=""+c,a+=" characters' "),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var x=a;return a=R.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",m&&(a+=" else { "),a}),ub}var db,kI;function II(){return kI||(kI=1,db=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,S,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;if(v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c,!(v||typeof c=="number"))throw new Error(r+" must be number");var w=r=="maxProperties"?">":"<";a+="if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),a+=" Object.keys("+h+").length "+w+" "+y+") { ";var S=r,R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(S||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+y+" } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT have ",r=="maxProperties"?a+="more":a+="fewer",a+=" than ",v?a+="' + "+y+" + '":a+=""+c,a+=" properties' "),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var x=a;return a=R.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",m&&(a+=" else { "),a}),db}var fb,OI;function S8(){return OI||(OI=1,fb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;if(v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c,!(v||typeof c=="number"))throw new Error(r+" must be number");a+="var division"+s+";if (",v&&(a+=" "+y+" !== undefined && ( typeof "+y+" != 'number' || "),a+=" (division"+s+" = "+h+" / "+y+", ",e.opts.multipleOfPrecision?a+=" Math.abs(Math.round(division"+s+") - division"+s+") > 1e-"+e.opts.multipleOfPrecision+" ":a+=" division"+s+" !== parseInt(division"+s+") ",a+=" ) ",v&&(a+=" ) "),a+=" ) { ";var w=w||[];w.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { multipleOf: "+y+" } ",e.opts.messages!==!1&&(a+=" , message: 'should be multiple of ",v?a+="' + "+y:a+=""+y+"'"),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var S=a;return a=w.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+S+"]); ":a+=" validate.errors = ["+S+"]; return false; ":a+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",m&&(a+=" else { "),a}),fb}var pb,DI;function x8(){return DI||(DI=1,pb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="errs__"+s,y=e.util.copy(e);y.level++;var w="valid"+y.level;if(e.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:e.util.schemaHasRules(c,e.RULES.all)){y.schema=c,y.schemaPath=d,y.errSchemaPath=f,a+=" var "+v+" = errors; ";var S=e.compositeRule;e.compositeRule=y.compositeRule=!0,y.createErrors=!1;var R;y.opts.allErrors&&(R=y.opts.allErrors,y.opts.allErrors=!1),a+=" "+e.validate(y)+" ",y.createErrors=!0,R&&(y.opts.allErrors=R),e.compositeRule=y.compositeRule=S,a+=" if ("+w+") { ";var x=x||[];x.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var _=a;a=x.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+_+"]); ":a+=" validate.errors = ["+_+"]; return false; ":a+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",e.createErrors!==!1?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",m&&(a+=" if (false) { ");return a}),pb}var mb,LI;function w8(){return LI||(LI=1,mb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y="errs__"+s,w=e.util.copy(e),S="";w.level++;var R="valid"+w.level,x=w.baseId,_="prevValid"+s,C="passingSchemas"+s;a+="var "+y+" = errors , "+_+" = false , "+v+" = false , "+C+" = null; ";var N=e.compositeRule;e.compositeRule=w.compositeRule=!0;var k=c;if(k)for(var A,I=-1,O=k.length-1;I<O;)A=k[I+=1],(e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all))?(w.schema=A,w.schemaPath=d+"["+I+"]",w.errSchemaPath=f+"/"+I,a+=" "+e.validate(w)+" ",w.baseId=x):a+=" var "+R+" = true; ",I&&(a+=" if ("+R+" && "+_+") { "+v+" = false; "+C+" = ["+C+", "+I+"]; } else { ",S+="}"),a+=" if ("+R+") { "+v+" = "+_+" = true; "+C+" = "+I+"; }";return e.compositeRule=w.compositeRule=N,a+=""+S+"if (!"+v+") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { passingSchemas: "+C+" } ",e.opts.messages!==!1&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+y+"; if (vErrors !== null) { if ("+y+") vErrors.length = "+y+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}),mb}var hb,MI;function _8(){return MI||(MI=1,hb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c;var w=v?"(new RegExp("+y+"))":e.usePattern(c);a+="if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'string') || "),a+=" !"+w+".test("+h+") ) { ";var S=S||[];S.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { pattern: ",v?a+=""+y:a+=""+e.util.toQuotedString(c),a+=" } ",e.opts.messages!==!1&&(a+=` , message: 'should match pattern "`,v?a+="' + "+y+" + '":a+=""+e.util.escapeQuotes(c),a+=`"' `),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+e.util.toQuotedString(c),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var R=a;return a=S.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+R+"]); ":a+=" validate.errors = ["+R+"]; return false; ":a+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",m&&(a+=" else { "),a}),hb}var gb,PI;function T8(){return PI||(PI=1,gb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="errs__"+s,y=e.util.copy(e),w="";y.level++;var S="valid"+y.level,R="key"+s,x="idx"+s,_=y.dataLevel=e.dataLevel+1,C="data"+_,N="dataProperties"+s,k=Object.keys(c||{}).filter(V),A=e.schema.patternProperties||{},I=Object.keys(A).filter(V),O=e.schema.additionalProperties,L=k.length||I.length,M=O===!1,P=typeof O=="object"&&Object.keys(O).length,W=e.opts.removeAdditional,X=M||P||W,ee=e.opts.ownProperties,J=e.baseId,j=e.schema.required;if(j&&!(e.opts.$data&&j.$data)&&j.length<e.opts.loopRequired)var G=e.util.toHash(j);function V(Je){return Je!=="__proto__"}if(a+="var "+v+" = errors;var "+S+" = true;",ee&&(a+=" var "+N+" = undefined;"),X){if(ee?a+=" "+N+" = "+N+" || Object.keys("+h+"); for (var "+x+"=0; "+x+"<"+N+".length; "+x+"++) { var "+R+" = "+N+"["+x+"]; ":a+=" for (var "+R+" in "+h+") { ",L){if(a+=" var isAdditional"+s+" = !(false ",k.length)if(k.length>8)a+=" || validate.schema"+d+".hasOwnProperty("+R+") ";else{var te=k;if(te)for(var re,U=-1,q=te.length-1;U<q;)re=te[U+=1],a+=" || "+R+" == "+e.util.toQuotedString(re)+" "}if(I.length){var $=I;if($)for(var Y,Q=-1,F=$.length-1;Q<F;)Y=$[Q+=1],a+=" || "+e.usePattern(Y)+".test("+R+") "}a+=" ); if (isAdditional"+s+") { "}if(W=="all")a+=" delete "+h+"["+R+"]; ";else{var z=e.errorPath,K="' + "+R+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,R,e.opts.jsonPointers)),M)if(W)a+=" delete "+h+"["+R+"]; ";else{a+=" "+S+" = false; ";var ae=f;f=e.errSchemaPath+"/additionalProperties";var H=H||[];H.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { additionalProperty: '"+K+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is an invalid additional property":a+="should NOT have additional properties",a+="' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var de=a;a=H.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+de+"]); ":a+=" validate.errors = ["+de+"]; return false; ":a+=" var err = "+de+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f=ae,m&&(a+=" break; ")}else if(P)if(W=="failing"){a+=" var "+v+" = errors; ";var me=e.compositeRule;e.compositeRule=y.compositeRule=!0,y.schema=O,y.schemaPath=e.schemaPath+".additionalProperties",y.errSchemaPath=e.errSchemaPath+"/additionalProperties",y.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,R,e.opts.jsonPointers);var xe=h+"["+R+"]";y.dataPathArr[_]=R;var be=e.validate(y);y.baseId=J,e.util.varOccurences(be,C)<2?a+=" "+e.util.varReplace(be,C,xe)+" ":a+=" var "+C+" = "+xe+"; "+be+" ",a+=" if (!"+S+") { errors = "+v+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+h+"["+R+"]; } ",e.compositeRule=y.compositeRule=me}else{y.schema=O,y.schemaPath=e.schemaPath+".additionalProperties",y.errSchemaPath=e.errSchemaPath+"/additionalProperties",y.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,R,e.opts.jsonPointers);var xe=h+"["+R+"]";y.dataPathArr[_]=R;var be=e.validate(y);y.baseId=J,e.util.varOccurences(be,C)<2?a+=" "+e.util.varReplace(be,C,xe)+" ":a+=" var "+C+" = "+xe+"; "+be+" ",m&&(a+=" if (!"+S+") break; ")}e.errorPath=z}L&&(a+=" } "),a+=" } ",m&&(a+=" if ("+S+") { ",w+="}")}var _e=e.opts.useDefaults&&!e.compositeRule;if(k.length){var Ae=k;if(Ae)for(var re,Fe=-1,Pe=Ae.length-1;Fe<Pe;){re=Ae[Fe+=1];var $e=c[re];if(e.opts.strictKeywords?typeof $e=="object"&&Object.keys($e).length>0||$e===!1:e.util.schemaHasRules($e,e.RULES.all)){var at=e.util.getProperty(re),xe=h+at,ce=_e&&$e.default!==void 0;y.schema=$e,y.schemaPath=d+at,y.errSchemaPath=f+"/"+e.util.escapeFragment(re),y.errorPath=e.util.getPath(e.errorPath,re,e.opts.jsonPointers),y.dataPathArr[_]=e.util.toQuotedString(re);var be=e.validate(y);if(y.baseId=J,e.util.varOccurences(be,C)<2){be=e.util.varReplace(be,C,xe);var Ce=xe}else{var Ce=C;a+=" var "+C+" = "+xe+"; "}if(ce)a+=" "+be+" ";else{if(G&&G[re]){a+=" if ( "+Ce+" === undefined ",ee&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(re)+"') "),a+=") { "+S+" = false; ";var z=e.errorPath,ae=f,ze=e.util.escapeQuotes(re);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(z,re,e.opts.jsonPointers)),f=e.errSchemaPath+"/required";var H=H||[];H.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+ze+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+ze+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var de=a;a=H.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+de+"]); ":a+=" validate.errors = ["+de+"]; return false; ":a+=" var err = "+de+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f=ae,e.errorPath=z,a+=" } else { "}else m?(a+=" if ( "+Ce+" === undefined ",ee&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(re)+"') "),a+=") { "+S+" = true; } else { "):(a+=" if ("+Ce+" !== undefined ",ee&&(a+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(re)+"') "),a+=" ) { ");a+=" "+be+" } "}}m&&(a+=" if ("+S+") { ",w+="}")}}if(I.length){var we=I;if(we)for(var Y,Ne=-1,Oe=we.length-1;Ne<Oe;){Y=we[Ne+=1];var $e=A[Y];if(e.opts.strictKeywords?typeof $e=="object"&&Object.keys($e).length>0||$e===!1:e.util.schemaHasRules($e,e.RULES.all)){y.schema=$e,y.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(Y),y.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(Y),ee?a+=" "+N+" = "+N+" || Object.keys("+h+"); for (var "+x+"=0; "+x+"<"+N+".length; "+x+"++) { var "+R+" = "+N+"["+x+"]; ":a+=" for (var "+R+" in "+h+") { ",a+=" if ("+e.usePattern(Y)+".test("+R+")) { ",y.errorPath=e.util.getPathExpr(e.errorPath,R,e.opts.jsonPointers);var xe=h+"["+R+"]";y.dataPathArr[_]=R;var be=e.validate(y);y.baseId=J,e.util.varOccurences(be,C)<2?a+=" "+e.util.varReplace(be,C,xe)+" ":a+=" var "+C+" = "+xe+"; "+be+" ",m&&(a+=" if (!"+S+") break; "),a+=" } ",m&&(a+=" else "+S+" = true; "),a+=" } ",m&&(a+=" if ("+S+") { ",w+="}")}}}return m&&(a+=" "+w+" if ("+v+" == errors) {"),a}),gb}var vb,jI;function R8(){return jI||(jI=1,vb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="errs__"+s,y=e.util.copy(e),w="";y.level++;var S="valid"+y.level;if(a+="var "+v+" = errors;",e.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:e.util.schemaHasRules(c,e.RULES.all)){y.schema=c,y.schemaPath=d,y.errSchemaPath=f;var R="key"+s,x="idx"+s,_="i"+s,C="' + "+R+" + '",N=y.dataLevel=e.dataLevel+1,k="data"+N,A="dataProperties"+s,I=e.opts.ownProperties,O=e.baseId;I&&(a+=" var "+A+" = undefined; "),I?a+=" "+A+" = "+A+" || Object.keys("+h+"); for (var "+x+"=0; "+x+"<"+A+".length; "+x+"++) { var "+R+" = "+A+"["+x+"]; ":a+=" for (var "+R+" in "+h+") { ",a+=" var startErrs"+s+" = errors; ";var L=R,M=e.compositeRule;e.compositeRule=y.compositeRule=!0;var P=e.validate(y);y.baseId=O,e.util.varOccurences(P,k)<2?a+=" "+e.util.varReplace(P,k,L)+" ":a+=" var "+k+" = "+L+"; "+P+" ",e.compositeRule=y.compositeRule=M,a+=" if (!"+S+") { for (var "+_+"=startErrs"+s+"; "+_+"<errors; "+_+"++) { vErrors["+_+"].propertyName = "+R+"; } var err = ",e.createErrors!==!1?(a+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { propertyName: '"+C+"' } ",e.opts.messages!==!1&&(a+=" , message: 'property name \\'"+C+"\\' is invalid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),m&&(a+=" break; "),a+=" } }"}return m&&(a+=" "+w+" if ("+v+" == errors) {"),a}),vb}var bb,UI;function C8(){return UI||(UI=1,bb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y=e.opts.$data&&c&&c.$data;y&&(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ");var w="schema"+s;if(!y)if(c.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var S=[],R=c;if(R)for(var x,_=-1,C=R.length-1;_<C;){x=R[_+=1];var N=e.schema.properties[x];N&&(e.opts.strictKeywords?typeof N=="object"&&Object.keys(N).length>0||N===!1:e.util.schemaHasRules(N,e.RULES.all))||(S[S.length]=x)}}else var S=c;if(y||S.length){var k=e.errorPath,A=y||S.length>=e.opts.loopRequired,I=e.opts.ownProperties;if(m)if(a+=" var missing"+s+"; ",A){y||(a+=" var "+w+" = validate.schema"+d+"; ");var O="i"+s,L="schema"+s+"["+O+"]",M="' + "+L+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(k,L,e.opts.jsonPointers)),a+=" var "+v+" = true; ",y&&(a+=" if (schema"+s+" === undefined) "+v+" = true; else if (!Array.isArray(schema"+s+")) "+v+" = false; else {"),a+=" for (var "+O+" = 0; "+O+" < "+w+".length; "+O+"++) { "+v+" = "+h+"["+w+"["+O+"]] !== undefined ",I&&(a+=" && Object.prototype.hasOwnProperty.call("+h+", "+w+"["+O+"]) "),a+="; if (!"+v+") break; } ",y&&(a+=" } "),a+=" if (!"+v+") { ";var P=P||[];P.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+M+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var W=a;a=P.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+W+"]); ":a+=" validate.errors = ["+W+"]; return false; ":a+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var X=S;if(X)for(var ee,O=-1,J=X.length-1;O<J;){ee=X[O+=1],O&&(a+=" || ");var j=e.util.getProperty(ee),G=h+j;a+=" ( ( "+G+" === undefined ",I&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(ee)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?ee:j)+") ) "}a+=") { ";var L="missing"+s,M="' + "+L+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(k,L,!0):k+" + "+L);var P=P||[];P.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+M+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var W=a;a=P.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+W+"]); ":a+=" validate.errors = ["+W+"]; return false; ":a+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else if(A){y||(a+=" var "+w+" = validate.schema"+d+"; ");var O="i"+s,L="schema"+s+"["+O+"]",M="' + "+L+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(k,L,e.opts.jsonPointers)),y&&(a+=" if ("+w+" && !Array.isArray("+w+")) { var err = ",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+M+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+w+" !== undefined) { "),a+=" for (var "+O+" = 0; "+O+" < "+w+".length; "+O+"++) { if ("+h+"["+w+"["+O+"]] === undefined ",I&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", "+w+"["+O+"]) "),a+=") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+M+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",y&&(a+=" } ")}else{var V=S;if(V)for(var ee,te=-1,re=V.length-1;te<re;){ee=V[te+=1];var j=e.util.getProperty(ee),M=e.util.escapeQuotes(ee),G=h+j;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(k,ee,e.opts.jsonPointers)),a+=" if ( "+G+" === undefined ",I&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(ee)+"') "),a+=") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+M+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=k}else m&&(a+=" if (true) {");return a}),bb}var yb,FI;function A8(){return FI||(FI=1,yb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y=e.opts.$data&&c&&c.$data,w;if(y?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",w="schema"+s):w=c,(c||y)&&e.opts.uniqueItems!==!1){y&&(a+=" var "+v+"; if ("+w+" === false || "+w+" === undefined) "+v+" = true; else if (typeof "+w+" != 'boolean') "+v+" = false; else { "),a+=" var i = "+h+".length , "+v+" = true , j; if (i > 1) { ";var S=e.schema.items&&e.schema.items.type,R=Array.isArray(S);if(!S||S=="object"||S=="array"||R&&(S.indexOf("object")>=0||S.indexOf("array")>=0))a+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+v+" = false; break outer; } } } ";else{a+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ";var x="checkDataType"+(R?"s":"");a+=" if ("+e.util[x](S,"item",e.opts.strictNumbers,!0)+") continue; ",R&&(a+=` if (typeof item == 'string') item = '"' + item; `),a+=" if (typeof itemIndices[item] == 'number') { "+v+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}a+=" } ",y&&(a+=" } "),a+=" if (!"+v+") { ";var _=_||[];_.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(a+=" , schema: ",y?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var C=a;a=_.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+C+"]); ":a+=" validate.errors = ["+C+"]; return false; ":a+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",m&&(a+=" else { ")}else m&&(a+=" if (true) { ");return a}),yb}var Eb,zI;function N8(){return zI||(zI=1,Eb={$ref:u8(),allOf:d8(),anyOf:f8(),$comment:p8(),const:m8(),contains:h8(),dependencies:g8(),enum:v8(),format:b8(),if:y8(),items:E8(),maximum:TI(),minimum:TI(),maxItems:CI(),minItems:CI(),maxLength:NI(),minLength:NI(),maxProperties:II(),minProperties:II(),multipleOf:S8(),not:x8(),oneOf:w8(),pattern:_8(),properties:T8(),propertyNames:R8(),required:C8(),uniqueItems:A8(),validate:j2()}),Eb}var Sb,$I;function k8(){if($I)return Sb;$I=1;var t=N8(),e=pc().toHash;return Sb=function(){var n=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],a=["type","$comment"],s=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],l=["number","integer","string","array","object","boolean","null"];return n.all=e(a),n.types=e(l),n.forEach(function(c){c.rules=c.rules.map(function(d){var f;if(typeof d=="object"){var m=Object.keys(d)[0];f=d[m],d=m,f.forEach(function(v){a.push(v),n.all[v]=!0})}a.push(d);var h=n.all[d]={keyword:d,code:t[d],implements:f};return h}),n.all.$comment={keyword:"$comment",code:t.$comment},c.type&&(n.types[c.type]=c)}),n.keywords=e(a.concat(s)),n.custom={},n},Sb}var xb,BI;function I8(){if(BI)return xb;BI=1;var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];return xb=function(e,r){for(var n=0;n<r.length;n++){e=JSON.parse(JSON.stringify(e));var a=r[n].split("/"),s=e,l;for(l=1;l<a.length;l++)s=s[a[l]];for(l=0;l<t.length;l++){var c=t[l],d=s[c];d&&(s[c]={anyOf:[d,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e},xb}var wb,qI;function O8(){if(qI)return wb;qI=1;var t=oR().MissingRef;wb=e;function e(r,n,a){var s=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof n=="function"&&(a=n,n=void 0);var l=c(r).then(function(){var f=s._addSchema(r,void 0,n);return f.validate||d(f)});return a&&l.then(function(f){a(null,f)},a),l;function c(f){var m=f.$schema;return m&&!s.getSchema(m)?e.call(s,{$ref:m},!0):Promise.resolve()}function d(f){try{return s._compile(f)}catch(h){if(h instanceof t)return m(h);throw h}function m(h){var v=h.missingSchema;if(S(v))throw new Error("Schema "+v+" is loaded but "+h.missingRef+" cannot be resolved");var y=s._loadingSchemas[v];return y||(y=s._loadingSchemas[v]=s._opts.loadSchema(v),y.then(w,w)),y.then(function(R){if(!S(v))return c(R).then(function(){S(v)||s.addSchema(R,v,void 0,n)})}).then(function(){return d(f)});function w(){delete s._loadingSchemas[v]}function S(R){return s._refs[R]||s._schemas[R]}}}}return wb}var _b,HI;function D8(){return HI||(HI=1,_b=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h,v="data"+(l||""),y="valid"+s,w="errs__"+s,S=e.opts.$data&&c&&c.$data,R;S?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",R="schema"+s):R=c;var x=this,_="definition"+s,C=x.definition,N="",k,A,I,O,L;if(S&&C.$data){L="keywordValidate"+s;var M=C.validateSchema;a+=" var "+_+" = RULES.custom['"+r+"'].definition; var "+L+" = "+_+".validate;"}else{if(O=e.useCustomRule(x,c,e.schema,e),!O)return;R="validate.schema"+d,L=O.code,k=C.compile,A=C.inline,I=C.macro}var P=L+".errors",W="i"+s,X="ruleErr"+s,ee=C.async;if(ee&&!e.async)throw new Error("async keyword in sync schema");if(A||I||(a+=""+P+" = null;"),a+="var "+w+" = errors;var "+y+";",S&&C.$data&&(N+="}",a+=" if ("+R+" === undefined) { "+y+" = true; } else { ",M&&(N+="}",a+=" "+y+" = "+_+".validateSchema("+R+"); if ("+y+") { ")),A)C.statements?a+=" "+O.validate+" ":a+=" "+y+" = "+O.validate+"; ";else if(I){var J=e.util.copy(e),N="";J.level++;var j="valid"+J.level;J.schema=O.validate,J.schemaPath="";var G=e.compositeRule;e.compositeRule=J.compositeRule=!0;var V=e.validate(J).replace(/validate\.schema/g,L);e.compositeRule=J.compositeRule=G,a+=" "+V}else{var te=te||[];te.push(a),a="",a+=" "+L+".call( ",e.opts.passContext?a+="this":a+="self",k||C.schema===!1?a+=" , "+v+" ":a+=" , "+R+" , "+v+" , validate.schema"+e.schemaPath+" ",a+=" , (dataPath || '')",e.errorPath!='""'&&(a+=" + "+e.errorPath);var re=l?"data"+(l-1||""):"parentData",U=l?e.dataPathArr[l]:"parentDataProperty";a+=" , "+re+" , "+U+" , rootData ) ";var q=a;a=te.pop(),C.errors===!1?(a+=" "+y+" = ",ee&&(a+="await "),a+=""+q+"; "):ee?(P="customErrors"+s,a+=" var "+P+" = null; try { "+y+" = await "+q+"; } catch (e) { "+y+" = false; if (e instanceof ValidationError) "+P+" = e.errors; else throw e; } "):a+=" "+P+" = null; "+y+" = "+q+"; "}if(C.modifying&&(a+=" if ("+re+") "+v+" = "+re+"["+U+"];"),a+=""+N,C.valid)m&&(a+=" if (true) { ");else{a+=" if ( ",C.valid===void 0?(a+=" !",I?a+=""+j:a+=""+y):a+=" "+!C.valid+" ",a+=") { ",h=x.keyword;var te=te||[];te.push(a),a="";var te=te||[];te.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==!1&&(a+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),a+=" } "):a+=" {} ";var $=a;a=te.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+$+"]); ":a+=" validate.errors = ["+$+"]; return false; ":a+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var Y=a;a=te.pop(),A?C.errors?C.errors!="full"&&(a+=" for (var "+W+"="+w+"; "+W+"<errors; "+W+"++) { var "+X+" = vErrors["+W+"]; if ("+X+".dataPath === undefined) "+X+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+X+".schemaPath === undefined) { "+X+'.schemaPath = "'+f+'"; } ',e.opts.verbose&&(a+=" "+X+".schema = "+R+"; "+X+".data = "+v+"; "),a+=" } "):C.errors===!1?a+=" "+Y+" ":(a+=" if ("+w+" == errors) { "+Y+" } else { for (var "+W+"="+w+"; "+W+"<errors; "+W+"++) { var "+X+" = vErrors["+W+"]; if ("+X+".dataPath === undefined) "+X+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+X+".schemaPath === undefined) { "+X+'.schemaPath = "'+f+'"; } ',e.opts.verbose&&(a+=" "+X+".schema = "+R+"; "+X+".data = "+v+"; "),a+=" } } "):I?(a+=" var err = ",e.createErrors!==!1?(a+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==!1&&(a+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; ")):C.errors===!1?a+=" "+Y+" ":(a+=" if (Array.isArray("+P+")) { if (vErrors === null) vErrors = "+P+"; else vErrors = vErrors.concat("+P+"); errors = vErrors.length; for (var "+W+"="+w+"; "+W+"<errors; "+W+"++) { var "+X+" = vErrors["+W+"]; if ("+X+".dataPath === undefined) "+X+".dataPath = (dataPath || '') + "+e.errorPath+"; "+X+'.schemaPath = "'+f+'"; ',e.opts.verbose&&(a+=" "+X+".schema = "+R+"; "+X+".data = "+v+"; "),a+=" } } else { "+Y+" } "),a+=" } ",m&&(a+=" else { ")}return a}),_b}const L8="http://json-schema.org/draft-07/schema#",M8="http://json-schema.org/draft-07/schema#",P8="Core schema meta-schema",j8={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},U8=["object","boolean"],F8={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},U2={$schema:L8,$id:M8,title:P8,definitions:j8,type:U8,properties:F8,default:!0};var Tb,VI;function z8(){if(VI)return Tb;VI=1;var t=U2;return Tb={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:t.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:t.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}},Tb}var Rb,GI;function $8(){if(GI)return Rb;GI=1;var t=/^[a-z_$][a-z0-9_$-]*$/i,e=D8(),r=z8();Rb={add:n,get:a,remove:s,validate:l};function n(c,d){var f=this.RULES;if(f.keywords[c])throw new Error("Keyword "+c+" is already defined");if(!t.test(c))throw new Error("Keyword "+c+" is not a valid identifier");if(d){this.validateKeyword(d,!0);var m=d.type;if(Array.isArray(m))for(var h=0;h<m.length;h++)y(c,m[h],d);else y(c,m,d);var v=d.metaSchema;v&&(d.$data&&this._opts.$data&&(v={anyOf:[v,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),d.validateSchema=this.compile(v,!0))}f.keywords[c]=f.all[c]=!0;function y(w,S,R){for(var x,_=0;_<f.length;_++){var C=f[_];if(C.type==S){x=C;break}}x||(x={type:S,rules:[]},f.push(x));var N={keyword:w,definition:R,custom:!0,code:e,implements:R.implements};x.rules.push(N),f.custom[w]=N}return this}function a(c){var d=this.RULES.custom[c];return d?d.definition:this.RULES.keywords[c]||!1}function s(c){var d=this.RULES;delete d.keywords[c],delete d.all[c],delete d.custom[c];for(var f=0;f<d.length;f++)for(var m=d[f].rules,h=0;h<m.length;h++)if(m[h].keyword==c){m.splice(h,1);break}return this}function l(c,d){l.errors=null;var f=this._validateKeyword=this._validateKeyword||this.compile(r,!0);if(f(c))return!0;if(l.errors=f.errors,d)throw new Error("custom keyword definition is invalid: "+this.errorsText(f.errors));return!1}return Rb}const B8="http://json-schema.org/draft-07/schema#",q8="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",H8="Meta-schema for $data reference (JSON Schema extension proposal)",V8="object",G8=["$data"],W8={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Y8=!1,K8={$schema:B8,$id:q8,description:H8,type:V8,required:G8,properties:W8,additionalProperties:Y8};var Cb,WI;function Z8(){if(WI)return Cb;WI=1;var t=s8(),e=aR(),r=l8(),n=M2(),a=P2(),s=c8(),l=k8(),c=I8(),d=pc();Cb=w,w.prototype.validate=S,w.prototype.compile=R,w.prototype.addSchema=x,w.prototype.addMetaSchema=_,w.prototype.validateSchema=C,w.prototype.getSchema=k,w.prototype.removeSchema=O,w.prototype.addFormat=G,w.prototype.errorsText=j,w.prototype._addSchema=M,w.prototype._compile=P,w.prototype.compileAsync=O8();var f=$8();w.prototype.addKeyword=f.add,w.prototype.getKeyword=f.get,w.prototype.removeKeyword=f.remove,w.prototype.validateKeyword=f.validate;var m=oR();w.ValidationError=m.Validation,w.MissingRefError=m.MissingRef,w.$dataMetaSchema=c;var h="http://json-schema.org/draft-07/schema",v=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],y=["/properties"];function w(F){if(!(this instanceof w))return new w(F);F=this._opts=d.copy(F)||{},Y(this),this._schemas={},this._refs={},this._fragments={},this._formats=s(F.format),this._cache=F.cache||new r,this._loadingSchemas={},this._compilations=[],this.RULES=l(),this._getId=W(F),F.loopRequired=F.loopRequired||1/0,F.errorDataPath=="property"&&(F._errorDataPathProperty=!0),F.serialize===void 0&&(F.serialize=a),this._metaOpts=$(this),F.formats&&re(this),F.keywords&&U(this),V(this),typeof F.meta=="object"&&this.addMetaSchema(F.meta),F.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),te(this)}function S(F,z){var K;if(typeof F=="string"){if(K=this.getSchema(F),!K)throw new Error('no schema with key or ref "'+F+'"')}else{var ae=this._addSchema(F);K=ae.validate||this._compile(ae)}var H=K(z);return K.$async!==!0&&(this.errors=K.errors),H}function R(F,z){var K=this._addSchema(F,void 0,z);return K.validate||this._compile(K)}function x(F,z,K,ae){if(Array.isArray(F)){for(var H=0;H<F.length;H++)this.addSchema(F[H],void 0,K,ae);return this}var de=this._getId(F);if(de!==void 0&&typeof de!="string")throw new Error("schema id must be string");return z=e.normalizeId(z||de),q(this,z),this._schemas[z]=this._addSchema(F,K,ae,!0),this}function _(F,z,K){return this.addSchema(F,z,K,!0),this}function C(F,z){var K=F.$schema;if(K!==void 0&&typeof K!="string")throw new Error("$schema must be a string");if(K=K||this._opts.defaultMeta||N(this),!K)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var ae=this.validate(K,F);if(!ae&&z){var H="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(H);else throw new Error(H)}return ae}function N(F){var z=F._opts.meta;return F._opts.defaultMeta=typeof z=="object"?F._getId(z)||z:F.getSchema(h)?h:void 0,F._opts.defaultMeta}function k(F){var z=I(this,F);switch(typeof z){case"object":return z.validate||this._compile(z);case"string":return this.getSchema(z);case"undefined":return A(this,F)}}function A(F,z){var K=e.schema.call(F,{schema:{}},z);if(K){var ae=K.schema,H=K.root,de=K.baseId,me=t.call(F,ae,H,void 0,de);return F._fragments[z]=new n({ref:z,fragment:!0,schema:ae,root:H,baseId:de,validate:me}),me}}function I(F,z){return z=e.normalizeId(z),F._schemas[z]||F._refs[z]||F._fragments[z]}function O(F){if(F instanceof RegExp)return L(this,this._schemas,F),L(this,this._refs,F),this;switch(typeof F){case"undefined":return L(this,this._schemas),L(this,this._refs),this._cache.clear(),this;case"string":var z=I(this,F);return z&&this._cache.del(z.cacheKey),delete this._schemas[F],delete this._refs[F],this;case"object":var K=this._opts.serialize,ae=K?K(F):F;this._cache.del(ae);var H=this._getId(F);H&&(H=e.normalizeId(H),delete this._schemas[H],delete this._refs[H])}return this}function L(F,z,K){for(var ae in z){var H=z[ae];!H.meta&&(!K||K.test(ae))&&(F._cache.del(H.cacheKey),delete z[ae])}}function M(F,z,K,ae){if(typeof F!="object"&&typeof F!="boolean")throw new Error("schema should be object or boolean");var H=this._opts.serialize,de=H?H(F):F,me=this._cache.get(de);if(me)return me;ae=ae||this._opts.addUsedSchema!==!1;var xe=e.normalizeId(this._getId(F));xe&&ae&&q(this,xe);var be=this._opts.validateSchema!==!1&&!z,_e;be&&!(_e=xe&&xe==e.normalizeId(F.$schema))&&this.validateSchema(F,!0);var Ae=e.ids.call(this,F),Fe=new n({id:xe,schema:F,localRefs:Ae,cacheKey:de,meta:K});return xe[0]!="#"&&ae&&(this._refs[xe]=Fe),this._cache.put(de,Fe),be&&_e&&this.validateSchema(F,!0),Fe}function P(F,z){if(F.compiling)return F.validate=H,H.schema=F.schema,H.errors=null,H.root=z||H,F.schema.$async===!0&&(H.$async=!0),H;F.compiling=!0;var K;F.meta&&(K=this._opts,this._opts=this._metaOpts);var ae;try{ae=t.call(this,F.schema,z,F.localRefs)}catch(de){throw delete F.validate,de}finally{F.compiling=!1,F.meta&&(this._opts=K)}return F.validate=ae,F.refs=ae.refs,F.refVal=ae.refVal,F.root=ae.root,ae;function H(){var de=F.validate,me=de.apply(this,arguments);return H.errors=de.errors,me}}function W(F){switch(F.schemaId){case"auto":return J;case"id":return X;default:return ee}}function X(F){return F.$id&&this.logger.warn("schema $id ignored",F.$id),F.id}function ee(F){return F.id&&this.logger.warn("schema id ignored",F.id),F.$id}function J(F){if(F.$id&&F.id&&F.$id!=F.id)throw new Error("schema $id is different from id");return F.$id||F.id}function j(F,z){if(F=F||this.errors,!F)return"No errors";z=z||{};for(var K=z.separator===void 0?", ":z.separator,ae=z.dataVar===void 0?"data":z.dataVar,H="",de=0;de<F.length;de++){var me=F[de];me&&(H+=ae+me.dataPath+" "+me.message+K)}return H.slice(0,-K.length)}function G(F,z){return typeof z=="string"&&(z=new RegExp(z)),this._formats[F]=z,this}function V(F){var z;if(F._opts.$data&&(z=K8,F.addMetaSchema(z,z.$id,!0)),F._opts.meta!==!1){var K=U2;F._opts.$data&&(K=c(K,y)),F.addMetaSchema(K,h,!0),F._refs["http://json-schema.org/schema"]=h}}function te(F){var z=F._opts.schemas;if(z)if(Array.isArray(z))F.addSchema(z);else for(var K in z)F.addSchema(z[K],K)}function re(F){for(var z in F._opts.formats){var K=F._opts.formats[z];F.addFormat(z,K)}}function U(F){for(var z in F._opts.keywords){var K=F._opts.keywords[z];F.addKeyword(z,K)}}function q(F,z){if(F._schemas[z]||F._refs[z])throw new Error('schema with key or id "'+z+'" already exists')}function $(F){for(var z=d.copy(F._opts),K=0;K<v.length;K++)delete z[v[K]];return z}function Y(F){var z=F._opts.logger;if(z===!1)F.logger={log:Q,warn:Q,error:Q};else{if(z===void 0&&(z=console),!(typeof z=="object"&&z.log&&z.warn&&z.error))throw new Error("logger must implement log, warn and error methods");F.logger=z}}function Q(){}return Cb}var X8=Z8();const Q8=fc(X8);class YI extends t8{constructor(e,r){var n;super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(n=r?.capabilities)!==null&&n!==void 0?n:{},this._ajv=new Q8}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=r8(this._capabilities,e)}assertCapability(e,r){var n;if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n[e]))throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{const n=await this.request({method:"initialize",params:{protocolVersion:jm,capabilities:this._capabilities,clientInfo:this._clientInfo}},E2,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!r9.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"})}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var r,n,a,s,l;switch(e){case"logging/setLevel":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((l=this._serverCapabilities)===null||l===void 0)&&l.completions))throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){var r;switch(e){case"notifications/roots/list_changed":if(!(!((r=this._capabilities.roots)===null||r===void 0)&&r.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break}}async ping(e){return this.request({method:"ping"},Al,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},L2,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},Al,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},I2,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},N2,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},R2,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},C2,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},A2,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},Al,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},Al,r)}async callTool(e,r=rR,n){const a=await this.request({method:"tools/call",params:e},r,n),s=this.getToolOutputValidator(e.name);if(s){if(!a.structuredContent&&!a.isError)throw new Si(Da.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(a.structuredContent)try{if(!s(a.structuredContent))throw new Si(Da.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(s.errors)}`)}catch(l){throw l instanceof Si?l:new Si(Da.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)}}return a}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(const r of e)if(r.outputSchema)try{const n=this._ajv.compile(r.outputSchema);this._cachedToolOutputValidators.set(r.name,n)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){const n=await this.request({method:"tools/list",params:e},O2,r);return this.cacheToolOutputSchemas(n.tools),n}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}let iR;iR=globalThis.crypto;async function J8(t){return(await iR).getRandomValues(new Uint8Array(t))}async function eW(t){const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";let r="";const n=await J8(t);for(let a=0;a<t;a++){const s=n[a]%e.length;r+=e[s]}return r}async function tW(t){return await eW(t)}async function rW(t){const e=await(await iR).subtle.digest("SHA-256",new TextEncoder().encode(t));return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function nW(t){if(t||(t=43),t<43||t>128)throw`Expected a length between 43 and 128. Received ${t}.`;const e=await tW(t),r=await rW(e);return{code_verifier:e,code_challenge:r}}const Pr=ve().url().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:Ie.custom,message:"URL must be parseable",fatal:!0}),t9}).refine(t=>{const e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),aW=Me({resource:ve().url(),authorization_servers:Ye(Pr).optional(),jwks_uri:ve().url().optional(),scopes_supported:Ye(ve()).optional(),bearer_methods_supported:Ye(ve()).optional(),resource_signing_alg_values_supported:Ye(ve()).optional(),resource_name:ve().optional(),resource_documentation:ve().optional(),resource_policy_uri:ve().url().optional(),resource_tos_uri:ve().url().optional(),tls_client_certificate_bound_access_tokens:Dr().optional(),authorization_details_types_supported:Ye(ve()).optional(),dpop_signing_alg_values_supported:Ye(ve()).optional(),dpop_bound_access_tokens_required:Dr().optional()}).passthrough(),F2=Me({issuer:ve(),authorization_endpoint:Pr,token_endpoint:Pr,registration_endpoint:Pr.optional(),scopes_supported:Ye(ve()).optional(),response_types_supported:Ye(ve()),response_modes_supported:Ye(ve()).optional(),grant_types_supported:Ye(ve()).optional(),token_endpoint_auth_methods_supported:Ye(ve()).optional(),token_endpoint_auth_signing_alg_values_supported:Ye(ve()).optional(),service_documentation:Pr.optional(),revocation_endpoint:Pr.optional(),revocation_endpoint_auth_methods_supported:Ye(ve()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Ye(ve()).optional(),introspection_endpoint:ve().optional(),introspection_endpoint_auth_methods_supported:Ye(ve()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Ye(ve()).optional(),code_challenge_methods_supported:Ye(ve()).optional()}).passthrough(),oW=Me({issuer:ve(),authorization_endpoint:Pr,token_endpoint:Pr,userinfo_endpoint:Pr.optional(),jwks_uri:Pr,registration_endpoint:Pr.optional(),scopes_supported:Ye(ve()).optional(),response_types_supported:Ye(ve()),response_modes_supported:Ye(ve()).optional(),grant_types_supported:Ye(ve()).optional(),acr_values_supported:Ye(ve()).optional(),subject_types_supported:Ye(ve()),id_token_signing_alg_values_supported:Ye(ve()),id_token_encryption_alg_values_supported:Ye(ve()).optional(),id_token_encryption_enc_values_supported:Ye(ve()).optional(),userinfo_signing_alg_values_supported:Ye(ve()).optional(),userinfo_encryption_alg_values_supported:Ye(ve()).optional(),userinfo_encryption_enc_values_supported:Ye(ve()).optional(),request_object_signing_alg_values_supported:Ye(ve()).optional(),request_object_encryption_alg_values_supported:Ye(ve()).optional(),request_object_encryption_enc_values_supported:Ye(ve()).optional(),token_endpoint_auth_methods_supported:Ye(ve()).optional(),token_endpoint_auth_signing_alg_values_supported:Ye(ve()).optional(),display_values_supported:Ye(ve()).optional(),claim_types_supported:Ye(ve()).optional(),claims_supported:Ye(ve()).optional(),service_documentation:ve().optional(),claims_locales_supported:Ye(ve()).optional(),ui_locales_supported:Ye(ve()).optional(),claims_parameter_supported:Dr().optional(),request_parameter_supported:Dr().optional(),request_uri_parameter_supported:Dr().optional(),require_request_uri_registration:Dr().optional(),op_policy_uri:Pr.optional(),op_tos_uri:Pr.optional()}).passthrough(),iW=oW.merge(F2.pick({code_challenge_methods_supported:!0})),z2=Me({access_token:ve(),id_token:ve().optional(),token_type:ve(),expires_in:$r().optional(),scope:ve().optional(),refresh_token:ve().optional()}).strip(),sW=Me({error:ve(),error_description:ve().optional(),error_uri:ve().optional()}),lW=Me({redirect_uris:Ye(Pr),token_endpoint_auth_method:ve().optional(),grant_types:Ye(ve()).optional(),response_types:Ye(ve()).optional(),client_name:ve().optional(),client_uri:Pr.optional(),logo_uri:Pr.optional(),scope:ve().optional(),contacts:Ye(ve()).optional(),tos_uri:Pr.optional(),policy_uri:ve().optional(),jwks_uri:Pr.optional(),jwks:J6().optional(),software_id:ve().optional(),software_version:ve().optional(),software_statement:ve().optional()}).strip(),cW=Me({client_id:ve(),client_secret:ve().optional(),client_id_issued_at:$r().optional(),client_secret_expires_at:$r().optional()}).strip(),uW=lW.merge(cW);Me({error:ve(),error_description:ve().optional()}).strip();Me({token:ve(),token_type_hint:ve().optional()}).strip();function dW(t){const e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}function fW({requestedResource:t,configuredResource:e}){const r=typeof t=="string"?new URL(t):new URL(t.href),n=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;const a=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",s=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return a.startsWith(s)}class Qr extends Error{constructor(e,r){super(e),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){const e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}}class __ extends Qr{}__.errorCode="invalid_request";class fm extends Qr{}fm.errorCode="invalid_client";class pm extends Qr{}pm.errorCode="invalid_grant";class mm extends Qr{}mm.errorCode="unauthorized_client";class T_ extends Qr{}T_.errorCode="unsupported_grant_type";class R_ extends Qr{}R_.errorCode="invalid_scope";class C_ extends Qr{}C_.errorCode="access_denied";class nc extends Qr{}nc.errorCode="server_error";class A_ extends Qr{}A_.errorCode="temporarily_unavailable";class N_ extends Qr{}N_.errorCode="unsupported_response_type";class k_ extends Qr{}k_.errorCode="unsupported_token_type";class I_ extends Qr{}I_.errorCode="invalid_token";class O_ extends Qr{}O_.errorCode="method_not_allowed";class D_ extends Qr{}D_.errorCode="too_many_requests";class L_ extends Qr{}L_.errorCode="invalid_client_metadata";class M_ extends Qr{}M_.errorCode="insufficient_scope";const pW={[__.errorCode]:__,[fm.errorCode]:fm,[pm.errorCode]:pm,[mm.errorCode]:mm,[T_.errorCode]:T_,[R_.errorCode]:R_,[C_.errorCode]:C_,[nc.errorCode]:nc,[A_.errorCode]:A_,[N_.errorCode]:N_,[k_.errorCode]:k_,[I_.errorCode]:I_,[O_.errorCode]:O_,[D_.errorCode]:D_,[L_.errorCode]:L_,[M_.errorCode]:M_};class La extends Error{constructor(e){super(e??"Unauthorized")}}const Ab="code",Nb="S256";function $2(t,e){const r=t.client_secret!==void 0;return e.length===0?r?"client_secret_post":"none":r&&e.includes("client_secret_basic")?"client_secret_basic":r&&e.includes("client_secret_post")?"client_secret_post":e.includes("none")?"none":r?"client_secret_post":"none"}function B2(t,e,r,n){const{client_id:a,client_secret:s}=e;switch(t){case"client_secret_basic":mW(a,s,r);return;case"client_secret_post":hW(a,s,n);return;case"none":gW(a,n);return;default:throw new Error(`Unsupported client authentication method: ${t}`)}}function mW(t,e,r){if(!e)throw new Error("client_secret_basic authentication requires a client_secret");const n=btoa(`${t}:${e}`);r.set("Authorization",`Basic ${n}`)}function hW(t,e,r){r.set("client_id",t),e&&r.set("client_secret",e)}function gW(t,e){e.set("client_id",t)}async function sR(t){const e=t instanceof Response?t.status:void 0,r=t instanceof Response?await t.text():t;try{const n=sW.parse(JSON.parse(r)),{error:a,error_description:s,error_uri:l}=n,c=pW[a]||nc;return new c(s||"",l)}catch(n){const a=`${e?`HTTP ${e}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new nc(a)}}async function ps(t,e){var r,n;try{return await kb(t,e)}catch(a){if(a instanceof fm||a instanceof mm)return await((r=t.invalidateCredentials)===null||r===void 0?void 0:r.call(t,"all")),await kb(t,e);if(a instanceof pm)return await((n=t.invalidateCredentials)===null||n===void 0?void 0:n.call(t,"tokens")),await kb(t,e);throw a}}async function kb(t,{serverUrl:e,authorizationCode:r,scope:n,resourceMetadataUrl:a,fetchFn:s}){let l,c;try{l=await bW(e,{resourceMetadataUrl:a},s),l.authorization_servers&&l.authorization_servers.length>0&&(c=l.authorization_servers[0])}catch{}c||(c=e);const d=await vW(e,t,l),f=await wW(c,{fetchFn:s});let m=await Promise.resolve(t.clientInformation());if(!m){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!t.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await CW(c,{metadata:f,clientMetadata:t.clientMetadata,fetchFn:s});await t.saveClientInformation(S),m=S}if(r!==void 0){const S=await t.codeVerifier(),R=await TW(c,{metadata:f,clientInformation:m,authorizationCode:r,codeVerifier:S,redirectUri:t.redirectUrl,resource:d,addClientAuthentication:t.addClientAuthentication,fetchFn:s});return await t.saveTokens(R),"AUTHORIZED"}const h=await t.tokens();if(h?.refresh_token)try{const S=await RW(c,{metadata:f,clientInformation:m,refreshToken:h.refresh_token,resource:d,addClientAuthentication:t.addClientAuthentication,fetchFn:s});return await t.saveTokens(S),"AUTHORIZED"}catch(S){if(!(!(S instanceof Qr)||S instanceof nc))throw S}const v=t.state?await t.state():void 0,{authorizationUrl:y,codeVerifier:w}=await _W(c,{metadata:f,clientInformation:m,state:v,redirectUrl:t.redirectUrl,scope:n||t.clientMetadata.scope,resource:d});return await t.saveCodeVerifier(w),await t.redirectToAuthorization(y),"REDIRECT"}async function vW(t,e,r){const n=dW(t);if(e.validateResourceURL)return await e.validateResourceURL(n,r?.resource);if(r){if(!fW({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function P_(t){const e=t.headers.get("WWW-Authenticate");if(!e)return;const[r,n]=e.split(" ");if(r.toLowerCase()!=="bearer"||!n)return;const s=/resource_metadata="([^"]*)"/.exec(e);if(s)try{return new URL(s[1])}catch{return}}async function bW(t,e,r=fetch){const n=await SW(t,"oauth-protected-resource",r,{protocolVersion:e?.protocolVersion,metadataUrl:e?.resourceMetadataUrl});if(!n||n.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return aW.parse(await n.json())}async function lR(t,e,r=fetch){try{return await r(t,{headers:e})}catch(n){if(n instanceof TypeError)return e?lR(t,void 0,r):void 0;throw n}}function yW(t,e="",r={}){return e.endsWith("/")&&(e=e.slice(0,-1)),r.prependPathname?`${e}/.well-known/${t}`:`/.well-known/${t}${e}`}async function KI(t,e,r=fetch){return await lR(t,{"MCP-Protocol-Version":e},r)}function EW(t,e){return!t||t.status>=400&&t.status<500&&e!=="/"}async function SW(t,e,r,n){var a,s;const l=new URL(t),c=(a=n?.protocolVersion)!==null&&a!==void 0?a:jm;let d;if(n?.metadataUrl)d=new URL(n.metadataUrl);else{const m=yW(e,l.pathname);d=new URL(m,(s=n?.metadataServerUrl)!==null&&s!==void 0?s:l),d.search=l.search}let f=await KI(d,c,r);if(!n?.metadataUrl&&EW(f,l.pathname)){const m=new URL(`/.well-known/${e}`,l);f=await KI(m,c,r)}return f}function xW(t){const e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),n;let a=e.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${a}`,e.origin),type:"oidc"}),n.push({url:new URL(`${a}/.well-known/openid-configuration`,e.origin),type:"oidc"}),n}async function wW(t,{fetchFn:e=fetch,protocolVersion:r=jm}={}){const n={"MCP-Protocol-Version":r},a=xW(t);for(const{url:s,type:l}of a){const c=await lR(s,n,e);if(c){if(!c.ok){if(c.status>=400&&c.status<500)continue;throw new Error(`HTTP ${c.status} trying to load ${l==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}return l==="oauth"?F2.parse(await c.json()):iW.parse(await c.json())}}}async function _W(t,{metadata:e,clientInformation:r,redirectUrl:n,scope:a,state:s,resource:l}){let c;if(e){if(c=new URL(e.authorization_endpoint),!e.response_types_supported.includes(Ab))throw new Error(`Incompatible auth server: does not support response type ${Ab}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(Nb))throw new Error(`Incompatible auth server: does not support code challenge method ${Nb}`)}else c=new URL("/authorize",t);const d=await nW(),f=d.code_verifier,m=d.code_challenge;return c.searchParams.set("response_type",Ab),c.searchParams.set("client_id",r.client_id),c.searchParams.set("code_challenge",m),c.searchParams.set("code_challenge_method",Nb),c.searchParams.set("redirect_uri",String(n)),s&&c.searchParams.set("state",s),a&&c.searchParams.set("scope",a),a?.includes("offline_access")&&c.searchParams.append("prompt","consent"),l&&c.searchParams.set("resource",l.href),{authorizationUrl:c,codeVerifier:f}}async function TW(t,{metadata:e,clientInformation:r,authorizationCode:n,codeVerifier:a,redirectUri:s,resource:l,addClientAuthentication:c,fetchFn:d}){var f;const m="authorization_code",h=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t);if(e?.grant_types_supported&&!e.grant_types_supported.includes(m))throw new Error(`Incompatible auth server: does not support grant type ${m}`);const v=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),y=new URLSearchParams({grant_type:m,code:n,code_verifier:a,redirect_uri:String(s)});if(c)c(v,y,t,e);else{const S=(f=e?.token_endpoint_auth_methods_supported)!==null&&f!==void 0?f:[],R=$2(r,S);B2(R,r,v,y)}l&&y.set("resource",l.href);const w=await(d??fetch)(h,{method:"POST",headers:v,body:y});if(!w.ok)throw await sR(w);return z2.parse(await w.json())}async function RW(t,{metadata:e,clientInformation:r,refreshToken:n,resource:a,addClientAuthentication:s,fetchFn:l}){var c;const d="refresh_token";let f;if(e){if(f=new URL(e.token_endpoint),e.grant_types_supported&&!e.grant_types_supported.includes(d))throw new Error(`Incompatible auth server: does not support grant type ${d}`)}else f=new URL("/token",t);const m=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),h=new URLSearchParams({grant_type:d,refresh_token:n});if(s)s(m,h,t,e);else{const y=(c=e?.token_endpoint_auth_methods_supported)!==null&&c!==void 0?c:[],w=$2(r,y);B2(w,r,m,h)}a&&h.set("resource",a.href);const v=await(l??fetch)(f,{method:"POST",headers:m,body:h});if(!v.ok)throw await sR(v);return z2.parse({refresh_token:n,...await v.json()})}async function CW(t,{metadata:e,clientMetadata:r,fetchFn:n}){let a;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");a=new URL(e.registration_endpoint)}else a=new URL("/register",t);const s=await(n??fetch)(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!s.ok)throw await sR(s);return uW.parse(await s.json())}class ZI extends Error{constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function Ib(t){}function q2(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=Ib,onError:r=Ib,onRetry:n=Ib,onComment:a}=t;let s="",l=!0,c,d="",f="";function m(S){const R=l?S.replace(/^\xEF\xBB\xBF/,""):S,[x,_]=AW(`${s}${R}`);for(const C of x)h(C);s=_,l=!1}function h(S){if(S===""){y();return}if(S.startsWith(":")){a&&a(S.slice(S.startsWith(": ")?2:1));return}const R=S.indexOf(":");if(R!==-1){const x=S.slice(0,R),_=S[R+1]===" "?2:1,C=S.slice(R+_);v(x,C,S);return}v(S,"",S)}function v(S,R,x){switch(S){case"event":f=R;break;case"data":d=`${d}${R}
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/winston-DaYIuPyF.js","assets/__vite-browser-external-DFygW7-s.js","assets/index-DRz5BQNA.js","assets/path-C9FudP8b.js","assets/index-BiSYQqGa.js","assets/index-D0nLMG1E.js","assets/chunk-VL2OQCWN-lvFdpsKs.js","assets/embeddings-0wcwzrOS.js","assets/index-BDWwgNIO.js","assets/index-BbXTQtxh.js","assets/langfuse-C4HKZ3NL-CsiDw8Wb.js"])))=>i.map(i=>d[i]);
2
+ var E6=Object.defineProperty;var S6=(t,e,r)=>e in t?E6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var mp=(t,e,r)=>S6(t,typeof e!="symbol"?e+"":e,r);function x6(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in t)){const s=Object.getOwnPropertyDescriptor(n,a);s&&Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(a){if(a.ep)return;a.ep=!0;const s=r(a);fetch(a.href,s)}})();function fc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function SEe(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var a=!1;try{a=this instanceof n}catch{}return a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var jv={exports:{}},gu={};var $k;function w6(){if($k)return gu;$k=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,a,s){var l=null;if(s!==void 0&&(l=""+s),a.key!==void 0&&(l=""+a.key),"key"in a){s={};for(var c in a)c!=="key"&&(s[c]=a[c])}else s=a;return a=s.ref,{$$typeof:t,type:n,key:l,ref:a!==void 0?a:null,props:s}}return gu.Fragment=e,gu.jsx=r,gu.jsxs=r,gu}var Bk;function _6(){return Bk||(Bk=1,jv.exports=w6()),jv.exports}var g=_6();const T6="modulepreload",R6=function(t){return"/inspector/"+t},qk={},cs=function(e,r,n){let a=Promise.resolve();if(r&&r.length>0){let d=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");a=d(r.map(f=>{if(f=R6(f),f in qk)return;qk[f]=!0;const m=f.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":T6,m||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),m)return new Promise((y,w)=>{v.addEventListener("load",y),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return a.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};var C6=Object.defineProperty,Ze=(t,e)=>C6(t,"name",{value:e,configurable:!0}),Hk=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),vl={};async function a2(){if(typeof process<"u")try{const t=await cs(()=>import("./__vite-browser-external-DFygW7-s.js").then(r=>r.o),[]),e=await cs(()=>import("./path-C9FudP8b.js").then(r=>r.p),[]);return{fs:t.default,path:e.default}}catch{return{fs:null,path:null}}return{fs:null,path:null}}Ze(a2,"getNodeModules");var Pn=null;function o2(){if(typeof Hk<"u")try{Pn=Hk("winston")}catch{}}Ze(o2,"loadWinstonSync");async function i2(){return Pn||(Pn=await cs(()=>import("./winston-DaYIuPyF.js").then(t=>t.w),__vite__mapDeps([0,1,2,3]))),Pn}Ze(i2,"getWinston");var g_="mcp-use";function em(){try{return typeof navigator<"u"&&navigator.userAgent?.includes("Cloudflare-Workers")||typeof globalThis.EdgeRuntime<"u"||typeof globalThis.Deno<"u"?!1:typeof process<"u"&&!0&&typeof __dirname<"u"}catch{return!1}}Ze(em,"isNodeJSEnvironment");var Hl,A6=(Hl=class{_level;name;constructor(e=g_,r="info"){this.name=e,this._level=r}shouldLog(e){const r=["error","warn","info","http","verbose","debug","silly"],n=r.indexOf(this._level);return r.indexOf(e)<=n}formatMessage(e,r){return`${new Date().toLocaleTimeString("en-US",{hour12:!1})} [${this.name}] ${e}: ${r}`}error(e){this.shouldLog("error")&&console.error(this.formatMessage("error",e))}warn(e){this.shouldLog("warn")&&console.warn(this.formatMessage("warn",e))}info(e){this.shouldLog("info")&&console.info(this.formatMessage("info",e))}debug(e){this.shouldLog("debug")&&console.debug(this.formatMessage("debug",e))}http(e){this.shouldLog("http")&&console.log(this.formatMessage("http",e))}verbose(e){this.shouldLog("verbose")&&console.log(this.formatMessage("verbose",e))}silly(e){this.shouldLog("silly")&&console.log(this.formatMessage("silly",e))}get level(){return this._level}set level(e){this._level=e}},Ze(Hl,"SimpleConsoleLogger"),Hl);function Mp(t){switch((typeof process<"u"&&vl?t:void 0)?.trim()){case"2":return"debug";case"1":return"info";default:return"info"}}Ze(Mp,"resolveLevel");var wo,s2=(wo=class{static get(e=g_){if(!em()){if(!this.simpleInstances[e]){const r=typeof process<"u"&&vl?.DEBUG||void 0;this.simpleInstances[e]=new A6(e,Mp(r))}return this.simpleInstances[e]}if(!this.instances[e]){if(!Pn)throw new Error("Winston not loaded - call Logger.configure() first");const{createLogger:r,format:n}=Pn,{combine:a,timestamp:s,label:l,colorize:c,splat:d}=n;this.instances[e]=r({level:Mp(vl.DEBUG),format:a(c(),d(),l({label:e}),s({format:"HH:mm:ss"}),this.getFormatter()),transports:[]})}return this.instances[e]}static getFormatter(){if(!Pn)throw new Error("Winston not loaded");const{format:e}=Pn,{printf:r}=e,n=r(({level:l,message:c,label:d,timestamp:f})=>`${f} [${d}] ${l}: ${c}`),a=r(({level:l,message:c,label:d,timestamp:f})=>`${f} [${d}] ${l.toUpperCase()}: ${c}`),s=r(({level:l,message:c,label:d,timestamp:f})=>`${f} [${d}] ${l.toUpperCase()}: ${c}`);switch(this.currentFormat){case"minimal":return n;case"detailed":return a;case"emoji":return s;default:return n}}static async configure(e={}){const{level:r,console:n=!0,file:a,format:s="minimal"}=e,l=typeof process<"u"&&vl?.DEBUG||void 0,c=r??Mp(l);if(this.currentFormat=s,!em()){Object.values(this.simpleInstances).forEach(R=>{R.level=c});return}if(await i2(),!Pn)throw new Error("Failed to load winston");const d=this.get();d.level=c;const f=d;if(f.clear(),n&&f.add(new Pn.transports.Console),a){const{fs:R,path:x}=await a2();if(R&&x){const _=x.dirname(x.resolve(a));R.existsSync(_)||R.mkdirSync(_,{recursive:!0}),f.add(new Pn.transports.File({filename:a}))}}const{format:m}=Pn,{combine:h,timestamp:v,label:y,colorize:w,splat:S}=m;Object.values(this.instances).forEach(R=>{R&&"format"in R&&(R.level=c,R.format=h(w(),S(),y({label:g_}),v({format:"HH:mm:ss"}),this.getFormatter()))})}static setDebug(e){let r;e===2||e===!0?r="debug":r="info",Object.values(this.simpleInstances).forEach(n=>{n.level=r}),Object.values(this.instances).forEach(n=>{n&&(n.level=r)}),typeof process<"u"&&vl&&(vl.DEBUG=e?e===!0?"2":String(e):"0")}static setFormat(e){this.currentFormat=e,this.configure({format:e})}},Ze(wo,"Logger"),mp(wo,"instances",{}),mp(wo,"simpleInstances",{}),mp(wo,"currentFormat","minimal"),wo);em()&&(o2(),Pn&&s2.configure());var Le=s2.get(),At;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const s={};for(const l of a)s[l]=l;return s},t.getValidEnumValues=a=>{const s=t.objectKeys(a).filter(c=>typeof a[a[c]]!="number"),l={};for(const c of s)l[c]=a[c];return t.objectValues(l)},t.objectValues=a=>t.objectKeys(a).map(function(s){return a[s]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&s.push(l);return s},t.find=(a,s)=>{for(const l of a)if(s(l))return l},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(At||(At={}));var Vk;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Vk||(Vk={}));const qe=At.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vi=t=>{switch(typeof t){case"undefined":return qe.undefined;case"string":return qe.string;case"number":return Number.isNaN(t)?qe.nan:qe.number;case"boolean":return qe.boolean;case"function":return qe.function;case"bigint":return qe.bigint;case"symbol":return qe.symbol;case"object":return Array.isArray(t)?qe.array:t===null?qe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?qe.promise:typeof Map<"u"&&t instanceof Map?qe.map:typeof Set<"u"&&t instanceof Set?qe.set:typeof Date<"u"&&t instanceof Date?qe.date:qe.object;default:return qe.unknown}},Ie=At.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class na extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(s){return s.message},n={_errors:[]},a=s=>{for(const l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let c=n,d=0;for(;d<l.path.length;){const f=l.path[d];d===l.path.length-1?(c[f]=c[f]||{_errors:[]},c[f]._errors.push(r(l))):c[f]=c[f]||{_errors:[]},c=c[f],d++}}};return a(this),n}static assert(e){if(!(e instanceof na))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,At.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const s=a.path[0];r[s]=r[s]||[],r[s].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}na.create=t=>new na(t);const ad=(t,e)=>{let r;switch(t.code){case Ie.invalid_type:t.received===qe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,At.jsonStringifyReplacer)}`;break;case Ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${At.joinValues(t.keys,", ")}`;break;case Ie.invalid_union:r="Invalid input";break;case Ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${At.joinValues(t.options)}`;break;case Ie.invalid_enum_value:r=`Invalid enum value. Expected ${At.joinValues(t.options)}, received '${t.received}'`;break;case Ie.invalid_arguments:r="Invalid function arguments";break;case Ie.invalid_return_type:r="Invalid function return type";break;case Ie.invalid_date:r="Invalid date";break;case Ie.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:At.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ie.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ie.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ie.custom:r="Invalid input";break;case Ie.invalid_intersection_types:r="Intersection results could not be merged";break;case Ie.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ie.not_finite:r="Number must be finite";break;default:r=e.defaultError,At.assertNever(t)}return{message:r}};let N6=ad;function v_(){return N6}const b_=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,s=[...r,...a.path||[]],l={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let c="";const d=n.filter(f=>!!f).slice().reverse();for(const f of d)c=f(l,{data:e,defaultError:c}).message;return{...a,path:s,message:c}};function Ue(t,e){const r=v_(),n=b_({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===ad?void 0:ad].filter(a=>!!a)});t.common.issues.push(n)}class un{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return nt;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const s=await a.key,l=await a.value;n.push({key:s,value:l})}return un.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:s,value:l}=a;if(s.status==="aborted"||l.status==="aborted")return nt;s.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(n[s.value]=l.value)}return{status:e.value,value:n}}}const nt=Object.freeze({status:"aborted"}),_u=t=>({status:"dirty",value:t}),_n=t=>({status:"valid",value:t}),Gk=t=>t.status==="aborted",Wk=t=>t.status==="dirty",tc=t=>t.status==="valid",tm=t=>typeof Promise<"u"&&t instanceof Promise;var Xe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Xe||(Xe={}));class qa{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Yk=(t,e)=>{if(tc(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new na(t.common.issues);return this._error=r,this._error}}};function ft(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(l,c)=>{const{message:d}=t;return l.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:d??n??c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:d??r??c.defaultError}},description:a}}class wt{get description(){return this._def.description}_getType(e){return vi(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:vi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new un,ctx:{common:e.parent.common,data:e.data,parsedType:vi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(tm(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vi(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Yk(n,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vi(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return tc(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>tc(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vi(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(tm(a)?a:Promise.resolve(a));return Yk(n,s)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,s)=>{const l=e(a),c=()=>s.addIssue({code:Ie.custom,...n(a)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(c(),!1)):l?!0:(c(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new ys({schema:this,typeName:lt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ro.create(this,this._def)}nullable(){return Es.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fa.create(this)}promise(){return ld.create(this,this._def)}or(e){return om.create([this,e],this._def)}and(e){return im.create(this,e,this._def)}transform(e){return new ys({...ft(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new cm({...ft(this._def),innerType:this,defaultValue:r,typeName:lt.ZodDefault})}brand(){return new d2({typeName:lt.ZodBranded,type:this,...ft(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new um({...ft(this._def),innerType:this,catchValue:r,typeName:lt.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return YT.create(this,e)}readonly(){return dm.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const k6=/^c[^\s-]{8,}$/i,I6=/^[0-9a-z]+$/,O6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,D6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,L6=/^[a-z0-9_-]{21}$/i,M6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,P6=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,j6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,U6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Uv;const F6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,z6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,B6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,q6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,H6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,l2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",V6=new RegExp(`^${l2}$`);function c2(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function G6(t){return new RegExp(`^${c2(t)}$`)}function W6(t){let e=`${l2}T${c2(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Y6(t,e){return!!((e==="v4"||!e)&&F6.test(t)||(e==="v6"||!e)&&$6.test(t))}function K6(t,e){if(!M6.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Z6(t,e){return!!((e==="v4"||!e)&&z6.test(t)||(e==="v6"||!e)&&B6.test(t))}class To extends wt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==qe.string){const s=this._getOrReturnCtx(e);return Ue(s,{code:Ie.invalid_type,expected:qe.string,received:s.parsedType}),nt}const n=new un;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,c=e.data.length<s.value;(l||c)&&(a=this._getOrReturnCtx(e,a),l?Ue(a,{code:Ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&Ue(a,{code:Ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")j6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"email",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Uv||(Uv=new RegExp(U6,"u")),Uv.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"emoji",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")D6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"uuid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")L6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"nanoid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")k6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"cuid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")I6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"cuid2",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")O6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"ulid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),Ue(a,{validation:"url",code:Ie.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"regex",code:Ie.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?W6(s).test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?V6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?G6(s).test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?P6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"duration",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Y6(e.data,s.version)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"ip",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?K6(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"jwt",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Z6(e.data,s.version)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"cidr",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?q6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"base64",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?H6.test(e.data)||(a=this._getOrReturnCtx(e,a),Ue(a,{validation:"base64url",code:Ie.invalid_string,message:s.message}),n.dirty()):At.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:Ie.invalid_string,...Xe.errToObj(n)})}_addCheck(e){return new To({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Xe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Xe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Xe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Xe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Xe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Xe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Xe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Xe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Xe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Xe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Xe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Xe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Xe.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Xe.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Xe.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Xe.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Xe.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Xe.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Xe.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Xe.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Xe.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Xe.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Xe.errToObj(r)})}nonempty(e){return this.min(1,Xe.errToObj(e))}trim(){return new To({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new To({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new To({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}To.create=t=>new To({checks:[],typeName:lt.ZodString,coerce:t?.coerce??!1,...ft(t)});function X6(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,s=Number.parseInt(t.toFixed(a).replace(".","")),l=Number.parseInt(e.toFixed(a).replace(".",""));return s%l/10**a}class rc extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==qe.number){const s=this._getOrReturnCtx(e);return Ue(s,{code:Ie.invalid_type,expected:qe.number,received:s.parsedType}),nt}let n;const a=new un;for(const s of this._def.checks)s.kind==="int"?At.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?X6(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.not_finite,message:s.message}),a.dirty()):At.assertNever(s);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Xe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Xe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Xe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Xe.toString(r))}setLimit(e,r,n,a){return new rc({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Xe.toString(a)}]})}_addCheck(e){return new rc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Xe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Xe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Xe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Xe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Xe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Xe.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Xe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Xe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Xe.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&At.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}rc.create=t=>new rc({checks:[],typeName:lt.ZodNumber,coerce:t?.coerce||!1,...ft(t)});class od extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==qe.bigint)return this._getInvalidInput(e);let n;const a=new un;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Ue(n,{code:Ie.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):At.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return Ue(r,{code:Ie.invalid_type,expected:qe.bigint,received:r.parsedType}),nt}gte(e,r){return this.setLimit("min",e,!0,Xe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Xe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Xe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Xe.toString(r))}setLimit(e,r,n,a){return new od({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Xe.toString(a)}]})}_addCheck(e){return new od({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Xe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Xe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Xe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Xe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Xe.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}od.create=t=>new od({checks:[],typeName:lt.ZodBigInt,coerce:t?.coerce??!1,...ft(t)});class y_ extends wt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==qe.boolean){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.boolean,received:n.parsedType}),nt}return _n(e.data)}}y_.create=t=>new y_({typeName:lt.ZodBoolean,coerce:t?.coerce||!1,...ft(t)});class rm extends wt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==qe.date){const s=this._getOrReturnCtx(e);return Ue(s,{code:Ie.invalid_type,expected:qe.date,received:s.parsedType}),nt}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Ue(s,{code:Ie.invalid_date}),nt}const n=new un;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),Ue(a,{code:Ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):At.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new rm({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Xe.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Xe.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}rm.create=t=>new rm({checks:[],coerce:t?.coerce||!1,typeName:lt.ZodDate,...ft(t)});class Kk extends wt{_parse(e){if(this._getType(e)!==qe.symbol){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.symbol,received:n.parsedType}),nt}return _n(e.data)}}Kk.create=t=>new Kk({typeName:lt.ZodSymbol,...ft(t)});class nm extends wt{_parse(e){if(this._getType(e)!==qe.undefined){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.undefined,received:n.parsedType}),nt}return _n(e.data)}}nm.create=t=>new nm({typeName:lt.ZodUndefined,...ft(t)});class am extends wt{_parse(e){if(this._getType(e)!==qe.null){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.null,received:n.parsedType}),nt}return _n(e.data)}}am.create=t=>new am({typeName:lt.ZodNull,...ft(t)});class id extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return _n(e.data)}}id.create=t=>new id({typeName:lt.ZodAny,...ft(t)});class jl extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _n(e.data)}}jl.create=t=>new jl({typeName:lt.ZodUnknown,...ft(t)});class wi extends wt{_parse(e){const r=this._getOrReturnCtx(e);return Ue(r,{code:Ie.invalid_type,expected:qe.never,received:r.parsedType}),nt}}wi.create=t=>new wi({typeName:lt.ZodNever,...ft(t)});class Zk extends wt{_parse(e){if(this._getType(e)!==qe.undefined){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.void,received:n.parsedType}),nt}return _n(e.data)}}Zk.create=t=>new Zk({typeName:lt.ZodVoid,...ft(t)});class Fa extends wt{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==qe.array)return Ue(r,{code:Ie.invalid_type,expected:qe.array,received:r.parsedType}),nt;if(a.exactLength!==null){const l=r.data.length>a.exactLength.value,c=r.data.length<a.exactLength.value;(l||c)&&(Ue(r,{code:l?Ie.too_big:Ie.too_small,minimum:c?a.exactLength.value:void 0,maximum:l?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(Ue(r,{code:Ie.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(Ue(r,{code:Ie.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,c)=>a.type._parseAsync(new qa(r,l,r.path,c)))).then(l=>un.mergeArray(n,l));const s=[...r.data].map((l,c)=>a.type._parseSync(new qa(r,l,r.path,c)));return un.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Fa({...this._def,minLength:{value:e,message:Xe.toString(r)}})}max(e,r){return new Fa({...this._def,maxLength:{value:e,message:Xe.toString(r)}})}length(e,r){return new Fa({...this._def,exactLength:{value:e,message:Xe.toString(r)}})}nonempty(e){return this.min(1,e)}}Fa.create=(t,e)=>new Fa({type:t,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...ft(e)});function bl(t){if(t instanceof Rr){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Ro.create(bl(n))}return new Rr({...t._def,shape:()=>e})}else return t instanceof Fa?new Fa({...t._def,type:bl(t.element)}):t instanceof Ro?Ro.create(bl(t.unwrap())):t instanceof Es?Es.create(bl(t.unwrap())):t instanceof Ao?Ao.create(t.items.map(e=>bl(e))):t}class Rr extends wt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=At.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==qe.object){const f=this._getOrReturnCtx(e);return Ue(f,{code:Ie.invalid_type,expected:qe.object,received:f.parsedType}),nt}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof wi&&this._def.unknownKeys==="strip"))for(const f in a.data)l.includes(f)||c.push(f);const d=[];for(const f of l){const m=s[f],h=a.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new qa(a,h,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof wi){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of c)d.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(f==="strict")c.length>0&&(Ue(a,{code:Ie.unrecognized_keys,keys:c}),n.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of c){const h=a.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new qa(a,h,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of d){const h=await m.key,v=await m.value;f.push({key:h,value:v,alwaysSet:m.alwaysSet})}return f}).then(f=>un.mergeObjectSync(n,f)):un.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return Xe.errToObj,new Rr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Xe.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new Rr({...this._def,unknownKeys:"strip"})}passthrough(){return new Rr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Rr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Rr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lt.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Rr({...this._def,catchall:e})}pick(e){const r={};for(const n of At.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Rr({...this._def,shape:()=>r})}omit(e){const r={};for(const n of At.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new Rr({...this._def,shape:()=>r})}deepPartial(){return bl(this)}partial(e){const r={};for(const n of At.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}return new Rr({...this._def,shape:()=>r})}required(e){const r={};for(const n of At.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Ro;)s=s._def.innerType;r[n]=s}return new Rr({...this._def,shape:()=>r})}keyof(){return u2(At.objectKeys(this.shape))}}Rr.create=(t,e)=>new Rr({shape:()=>t,unknownKeys:"strip",catchall:wi.create(),typeName:lt.ZodObject,...ft(e)});Rr.strictCreate=(t,e)=>new Rr({shape:()=>t,unknownKeys:"strict",catchall:wi.create(),typeName:lt.ZodObject,...ft(e)});Rr.lazycreate=(t,e)=>new Rr({shape:t,unknownKeys:"strip",catchall:wi.create(),typeName:lt.ZodObject,...ft(e)});class om extends wt{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;const l=s.map(c=>new na(c.ctx.common.issues));return Ue(r,{code:Ie.invalid_union,unionErrors:l}),nt}if(r.common.async)return Promise.all(n.map(async s=>{const l={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(a);{let s;const l=[];for(const d of n){const f={...r,common:{...r.common,issues:[]},parent:null},m=d._parseSync({data:r.data,path:r.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const c=l.map(d=>new na(d));return Ue(r,{code:Ie.invalid_union,unionErrors:c}),nt}}get options(){return this._def.options}}om.create=(t,e)=>new om({options:t,typeName:lt.ZodUnion,...ft(e)});const So=t=>t instanceof S_?So(t.schema):t instanceof ys?So(t.innerType()):t instanceof lm?[t.value]:t instanceof bs?t.options:t instanceof x_?At.objectValues(t.enum):t instanceof cm?So(t._def.innerType):t instanceof nm?[void 0]:t instanceof am?[null]:t instanceof Ro?[void 0,...So(t.unwrap())]:t instanceof Es?[null,...So(t.unwrap())]:t instanceof d2||t instanceof dm?So(t.unwrap()):t instanceof um?So(t._def.innerType):[];class WT extends wt{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==qe.object)return Ue(r,{code:Ie.invalid_type,expected:qe.object,received:r.parsedType}),nt;const n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(Ue(r,{code:Ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),nt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const a=new Map;for(const s of r){const l=So(s.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of l){if(a.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);a.set(c,s)}}return new WT({typeName:lt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:a,...ft(n)})}}function E_(t,e){const r=vi(t),n=vi(e);if(t===e)return{valid:!0,data:t};if(r===qe.object&&n===qe.object){const a=At.objectKeys(e),s=At.objectKeys(t).filter(c=>a.indexOf(c)!==-1),l={...t,...e};for(const c of s){const d=E_(t[c],e[c]);if(!d.valid)return{valid:!1};l[c]=d.data}return{valid:!0,data:l}}else if(r===qe.array&&n===qe.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<t.length;s++){const l=t[s],c=e[s],d=E_(l,c);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===qe.date&&n===qe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class im extends wt{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(s,l)=>{if(Gk(s)||Gk(l))return nt;const c=E_(s.value,l.value);return c.valid?((Wk(s)||Wk(l))&&r.dirty(),{status:r.value,value:c.data}):(Ue(n,{code:Ie.invalid_intersection_types}),nt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,l])=>a(s,l)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}im.create=(t,e,r)=>new im({left:t,right:e,typeName:lt.ZodIntersection,...ft(r)});class Ao extends wt{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.array)return Ue(n,{code:Ie.invalid_type,expected:qe.array,received:n.parsedType}),nt;if(n.data.length<this._def.items.length)return Ue(n,{code:Ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nt;!this._def.rest&&n.data.length>this._def.items.length&&(Ue(n,{code:Ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((l,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new qa(n,l,n.path,c)):null}).filter(l=>!!l);return n.common.async?Promise.all(s).then(l=>un.mergeArray(r,l)):un.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Ao({...this._def,rest:e})}}Ao.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ao({items:t,typeName:lt.ZodTuple,rest:null,...ft(e)})};class sm extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.object)return Ue(n,{code:Ie.invalid_type,expected:qe.object,received:n.parsedType}),nt;const a=[],s=this._def.keyType,l=this._def.valueType;for(const c in n.data)a.push({key:s._parse(new qa(n,c,n.path,c)),value:l._parse(new qa(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?un.mergeObjectAsync(r,a):un.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof wt?new sm({keyType:e,valueType:r,typeName:lt.ZodRecord,...ft(n)}):new sm({keyType:To.create(),valueType:e,typeName:lt.ZodRecord,...ft(r)})}}class Xk extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.map)return Ue(n,{code:Ie.invalid_type,expected:qe.map,received:n.parsedType}),nt;const a=this._def.keyType,s=this._def.valueType,l=[...n.data.entries()].map(([c,d],f)=>({key:a._parse(new qa(n,c,n.path,[f,"key"])),value:s._parse(new qa(n,d,n.path,[f,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of l){const f=await d.key,m=await d.value;if(f.status==="aborted"||m.status==="aborted")return nt;(f.status==="dirty"||m.status==="dirty")&&r.dirty(),c.set(f.value,m.value)}return{status:r.value,value:c}})}else{const c=new Map;for(const d of l){const f=d.key,m=d.value;if(f.status==="aborted"||m.status==="aborted")return nt;(f.status==="dirty"||m.status==="dirty")&&r.dirty(),c.set(f.value,m.value)}return{status:r.value,value:c}}}}Xk.create=(t,e,r)=>new Xk({valueType:e,keyType:t,typeName:lt.ZodMap,...ft(r)});class sd extends wt{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.set)return Ue(n,{code:Ie.invalid_type,expected:qe.set,received:n.parsedType}),nt;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(Ue(n,{code:Ie.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(Ue(n,{code:Ie.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const s=this._def.valueType;function l(d){const f=new Set;for(const m of d){if(m.status==="aborted")return nt;m.status==="dirty"&&r.dirty(),f.add(m.value)}return{status:r.value,value:f}}const c=[...n.data.values()].map((d,f)=>s._parse(new qa(n,d,n.path,f)));return n.common.async?Promise.all(c).then(d=>l(d)):l(c)}min(e,r){return new sd({...this._def,minSize:{value:e,message:Xe.toString(r)}})}max(e,r){return new sd({...this._def,maxSize:{value:e,message:Xe.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}sd.create=(t,e)=>new sd({valueType:t,minSize:null,maxSize:null,typeName:lt.ZodSet,...ft(e)});class ju extends wt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==qe.function)return Ue(r,{code:Ie.invalid_type,expected:qe.function,received:r.parsedType}),nt;function n(c,d){return b_({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,v_(),ad].filter(f=>!!f),issueData:{code:Ie.invalid_arguments,argumentsError:d}})}function a(c,d){return b_({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,v_(),ad].filter(f=>!!f),issueData:{code:Ie.invalid_return_type,returnTypeError:d}})}const s={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof ld){const c=this;return _n(async function(...d){const f=new na([]),m=await c._def.args.parseAsync(d,s).catch(y=>{throw f.addIssue(n(d,y)),f}),h=await Reflect.apply(l,this,m);return await c._def.returns._def.type.parseAsync(h,s).catch(y=>{throw f.addIssue(a(h,y)),f})})}else{const c=this;return _n(function(...d){const f=c._def.args.safeParse(d,s);if(!f.success)throw new na([n(d,f.error)]);const m=Reflect.apply(l,this,f.data),h=c._def.returns.safeParse(m,s);if(!h.success)throw new na([a(m,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ju({...this._def,args:Ao.create(e).rest(jl.create())})}returns(e){return new ju({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new ju({args:e||Ao.create([]).rest(jl.create()),returns:r||jl.create(),typeName:lt.ZodFunction,...ft(n)})}}class S_ extends wt{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}S_.create=(t,e)=>new S_({getter:t,typeName:lt.ZodLazy,...ft(e)});class lm extends wt{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return Ue(r,{received:r.data,code:Ie.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:e.data}}get value(){return this._def.value}}lm.create=(t,e)=>new lm({value:t,typeName:lt.ZodLiteral,...ft(e)});function u2(t,e){return new bs({values:t,typeName:lt.ZodEnum,...ft(e)})}class bs extends wt{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return Ue(r,{expected:At.joinValues(n),received:r.parsedType,code:Ie.invalid_type}),nt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return Ue(r,{received:r.data,code:Ie.invalid_enum_value,options:n}),nt}return _n(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return bs.create(e,{...this._def,...r})}exclude(e,r=this._def){return bs.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}bs.create=u2;class x_ extends wt{_parse(e){const r=At.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==qe.string&&n.parsedType!==qe.number){const a=At.objectValues(r);return Ue(n,{expected:At.joinValues(a),received:n.parsedType,code:Ie.invalid_type}),nt}if(this._cache||(this._cache=new Set(At.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=At.objectValues(r);return Ue(n,{received:n.data,code:Ie.invalid_enum_value,options:a}),nt}return _n(e.data)}get enum(){return this._def.values}}x_.create=(t,e)=>new x_({values:t,typeName:lt.ZodNativeEnum,...ft(e)});class ld extends wt{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==qe.promise&&r.common.async===!1)return Ue(r,{code:Ie.invalid_type,expected:qe.promise,received:r.parsedType}),nt;const n=r.parsedType===qe.promise?r.data:Promise.resolve(r.data);return _n(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ld.create=(t,e)=>new ld({type:t,typeName:lt.ZodPromise,...ft(e)});class ys extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:l=>{Ue(n,l),l.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const l=a.transform(n.data,s);if(n.common.async)return Promise.resolve(l).then(async c=>{if(r.value==="aborted")return nt;const d=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return d.status==="aborted"?nt:d.status==="dirty"||r.value==="dirty"?_u(d.value):d});{if(r.value==="aborted")return nt;const c=this._def.schema._parseSync({data:l,path:n.path,parent:n});return c.status==="aborted"?nt:c.status==="dirty"||r.value==="dirty"?_u(c.value):c}}if(a.type==="refinement"){const l=c=>{const d=a.refinement(c,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?nt:(c.status==="dirty"&&r.dirty(),l(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?nt:(c.status==="dirty"&&r.dirty(),l(c.value).then(()=>({status:r.value,value:c.value}))))}if(a.type==="transform")if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!tc(l))return nt;const c=a.transform(l.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>tc(l)?Promise.resolve(a.transform(l.value,s)).then(c=>({status:r.value,value:c})):nt);At.assertNever(a)}}ys.create=(t,e,r)=>new ys({schema:t,typeName:lt.ZodEffects,effect:e,...ft(r)});ys.createWithPreprocess=(t,e,r)=>new ys({schema:e,effect:{type:"preprocess",transform:t},typeName:lt.ZodEffects,...ft(r)});class Ro extends wt{_parse(e){return this._getType(e)===qe.undefined?_n(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ro.create=(t,e)=>new Ro({innerType:t,typeName:lt.ZodOptional,...ft(e)});class Es extends wt{_parse(e){return this._getType(e)===qe.null?_n(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Es.create=(t,e)=>new Es({innerType:t,typeName:lt.ZodNullable,...ft(e)});class cm extends wt{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===qe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}cm.create=(t,e)=>new cm({innerType:t,typeName:lt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ft(e)});class um extends wt{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return tm(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new na(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new na(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}um.create=(t,e)=>new um({innerType:t,typeName:lt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ft(e)});class Qk extends wt{_parse(e){if(this._getType(e)!==qe.nan){const n=this._getOrReturnCtx(e);return Ue(n,{code:Ie.invalid_type,expected:qe.nan,received:n.parsedType}),nt}return{status:"valid",value:e.data}}}Qk.create=t=>new Qk({typeName:lt.ZodNaN,...ft(t)});class d2 extends wt{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class YT extends wt{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?nt:s.status==="dirty"?(r.dirty(),_u(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?nt:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new YT({in:e,out:r,typeName:lt.ZodPipeline})}}class dm extends wt{_parse(e){const r=this._def.innerType._parse(e),n=a=>(tc(a)&&(a.value=Object.freeze(a.value)),a);return tm(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}dm.create=(t,e)=>new dm({innerType:t,typeName:lt.ZodReadonly,...ft(e)});function Jk(t,e){const r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Q6(t,e={},r){return t?id.create().superRefine((n,a)=>{const s=t(n);if(s instanceof Promise)return s.then(l=>{if(!l){const c=Jk(e,n),d=c.fatal??r??!0;a.addIssue({code:"custom",...c,fatal:d})}});if(!s){const l=Jk(e,n),c=l.fatal??r??!0;a.addIssue({code:"custom",...l,fatal:c})}}):id.create()}var lt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(lt||(lt={}));const xEe=(t,e={message:`Input not instance of ${t.name}`})=>Q6(r=>r instanceof t,e),ve=To.create,$r=rc.create,Dr=y_.create,wEe=nm.create,_Ee=am.create,J6=id.create,Nd=jl.create;wi.create;const Ye=Fa.create,Me=Rr.create,dn=om.create,e9=WT.create;im.create;Ao.create;const kd=sm.create,TEe=ju.create,pt=lm.create,No=bs.create,REe=ld.create,ke=Ro.create;Es.create;const t9=nt,jm="2025-06-18",r9=[jm,"2025-03-26","2024-11-05","2024-10-07"],Um="2.0",f2=dn([ve(),$r().int()]),p2=ve(),n9=Me({progressToken:ke(f2)}).passthrough(),sa=Me({_meta:ke(n9)}).passthrough(),Tn=Me({method:ve(),params:ke(sa)}),Id=Me({_meta:ke(Me({}).passthrough())}).passthrough(),Ka=Me({method:ve(),params:ke(Id)}),la=Me({_meta:ke(Me({}).passthrough())}).passthrough(),Fm=dn([ve(),$r().int()]),m2=Me({jsonrpc:pt(Um),id:Fm}).merge(Tn).strict(),h2=t=>m2.safeParse(t).success,g2=Me({jsonrpc:pt(Um)}).merge(Ka).strict(),a9=t=>g2.safeParse(t).success,v2=Me({jsonrpc:pt(Um),id:Fm,result:la}).strict(),w_=t=>v2.safeParse(t).success;var Da;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(Da||(Da={}));const b2=Me({jsonrpc:pt(Um),id:Fm,error:Me({code:$r().int(),message:ve(),data:ke(Nd())})}).strict(),o9=t=>b2.safeParse(t).success,Pp=dn([m2,g2,v2,b2]),Al=la.strict(),KT=Ka.extend({method:pt("notifications/cancelled"),params:Id.extend({requestId:Fm,reason:ve().optional()})}),i9=Me({src:ve(),mimeType:ke(ve()),sizes:ke(Ye(ve()))}).passthrough(),Od=Me({icons:Ye(i9).optional()}).passthrough(),Dd=Me({name:ve(),title:ke(ve())}).passthrough(),y2=Dd.extend({version:ve(),websiteUrl:ke(ve())}).merge(Od),s9=Me({experimental:ke(Me({}).passthrough()),sampling:ke(Me({}).passthrough()),elicitation:ke(Me({}).passthrough()),roots:ke(Me({listChanged:ke(Dr())}).passthrough())}).passthrough(),l9=Tn.extend({method:pt("initialize"),params:sa.extend({protocolVersion:ve(),capabilities:s9,clientInfo:y2})}),c9=Me({experimental:ke(Me({}).passthrough()),logging:ke(Me({}).passthrough()),completions:ke(Me({}).passthrough()),prompts:ke(Me({listChanged:ke(Dr())}).passthrough()),resources:ke(Me({subscribe:ke(Dr()),listChanged:ke(Dr())}).passthrough()),tools:ke(Me({listChanged:ke(Dr())}).passthrough())}).passthrough(),E2=la.extend({protocolVersion:ve(),capabilities:c9,serverInfo:y2,instructions:ke(ve())}),S2=Ka.extend({method:pt("notifications/initialized")}),u9=t=>S2.safeParse(t).success,ZT=Tn.extend({method:pt("ping")}),d9=Me({progress:$r(),total:ke($r()),message:ke(ve())}).passthrough(),XT=Ka.extend({method:pt("notifications/progress"),params:Id.merge(d9).extend({progressToken:f2})}),zm=Tn.extend({params:sa.extend({cursor:ke(p2)}).optional()}),$m=la.extend({nextCursor:ke(p2)}),x2=Me({uri:ve(),mimeType:ke(ve()),_meta:ke(Me({}).passthrough())}).passthrough(),w2=x2.extend({text:ve()}),QT=ve().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),_2=x2.extend({blob:QT}),T2=Dd.extend({uri:ve(),description:ke(ve()),mimeType:ke(ve()),_meta:ke(Me({}).passthrough())}).merge(Od),f9=Dd.extend({uriTemplate:ve(),description:ke(ve()),mimeType:ke(ve()),_meta:ke(Me({}).passthrough())}).merge(Od),p9=zm.extend({method:pt("resources/list")}),R2=$m.extend({resources:Ye(T2)}),m9=zm.extend({method:pt("resources/templates/list")}),C2=$m.extend({resourceTemplates:Ye(f9)}),h9=Tn.extend({method:pt("resources/read"),params:sa.extend({uri:ve()})}),A2=la.extend({contents:Ye(dn([w2,_2]))}),g9=Ka.extend({method:pt("notifications/resources/list_changed")}),v9=Tn.extend({method:pt("resources/subscribe"),params:sa.extend({uri:ve()})}),b9=Tn.extend({method:pt("resources/unsubscribe"),params:sa.extend({uri:ve()})}),y9=Ka.extend({method:pt("notifications/resources/updated"),params:Id.extend({uri:ve()})}),E9=Me({name:ve(),description:ke(ve()),required:ke(Dr())}).passthrough(),S9=Dd.extend({description:ke(ve()),arguments:ke(Ye(E9)),_meta:ke(Me({}).passthrough())}).merge(Od),x9=zm.extend({method:pt("prompts/list")}),N2=$m.extend({prompts:Ye(S9)}),w9=Tn.extend({method:pt("prompts/get"),params:sa.extend({name:ve(),arguments:ke(kd(ve()))})}),JT=Me({type:pt("text"),text:ve(),_meta:ke(Me({}).passthrough())}).passthrough(),eR=Me({type:pt("image"),data:QT,mimeType:ve(),_meta:ke(Me({}).passthrough())}).passthrough(),tR=Me({type:pt("audio"),data:QT,mimeType:ve(),_meta:ke(Me({}).passthrough())}).passthrough(),_9=Me({type:pt("resource"),resource:dn([w2,_2]),_meta:ke(Me({}).passthrough())}).passthrough(),T9=T2.extend({type:pt("resource_link")}),k2=dn([JT,eR,tR,T9,_9]),R9=Me({role:No(["user","assistant"]),content:k2}).passthrough(),I2=la.extend({description:ke(ve()),messages:Ye(R9)}),C9=Ka.extend({method:pt("notifications/prompts/list_changed")}),A9=Me({title:ke(ve()),readOnlyHint:ke(Dr()),destructiveHint:ke(Dr()),idempotentHint:ke(Dr()),openWorldHint:ke(Dr())}).passthrough(),N9=Dd.extend({description:ke(ve()),inputSchema:Me({type:pt("object"),properties:ke(Me({}).passthrough()),required:ke(Ye(ve()))}).passthrough(),outputSchema:ke(Me({type:pt("object"),properties:ke(Me({}).passthrough()),required:ke(Ye(ve()))}).passthrough()),annotations:ke(A9),_meta:ke(Me({}).passthrough())}).merge(Od),k9=zm.extend({method:pt("tools/list")}),O2=$m.extend({tools:Ye(N9)}),rR=la.extend({content:Ye(k2).default([]),structuredContent:Me({}).passthrough().optional(),isError:ke(Dr())});rR.or(la.extend({toolResult:Nd()}));const I9=Tn.extend({method:pt("tools/call"),params:sa.extend({name:ve(),arguments:ke(kd(Nd()))})}),O9=Ka.extend({method:pt("notifications/tools/list_changed")}),D2=No(["debug","info","notice","warning","error","critical","alert","emergency"]),D9=Tn.extend({method:pt("logging/setLevel"),params:sa.extend({level:D2})}),L9=Ka.extend({method:pt("notifications/message"),params:Id.extend({level:D2,logger:ke(ve()),data:Nd()})}),M9=Me({name:ve().optional()}).passthrough(),P9=Me({hints:ke(Ye(M9)),costPriority:ke($r().min(0).max(1)),speedPriority:ke($r().min(0).max(1)),intelligencePriority:ke($r().min(0).max(1))}).passthrough(),j9=Me({role:No(["user","assistant"]),content:dn([JT,eR,tR])}).passthrough(),U9=Tn.extend({method:pt("sampling/createMessage"),params:sa.extend({messages:Ye(j9),systemPrompt:ke(ve()),includeContext:ke(No(["none","thisServer","allServers"])),temperature:ke($r()),maxTokens:$r().int(),stopSequences:ke(Ye(ve())),metadata:ke(Me({}).passthrough()),modelPreferences:ke(P9)})}),F9=la.extend({model:ve(),stopReason:ke(No(["endTurn","stopSequence","maxTokens"]).or(ve())),role:No(["user","assistant"]),content:e9("type",[JT,eR,tR])}),z9=Me({type:pt("boolean"),title:ke(ve()),description:ke(ve()),default:ke(Dr())}).passthrough(),$9=Me({type:pt("string"),title:ke(ve()),description:ke(ve()),minLength:ke($r()),maxLength:ke($r()),format:ke(No(["email","uri","date","date-time"]))}).passthrough(),B9=Me({type:No(["number","integer"]),title:ke(ve()),description:ke(ve()),minimum:ke($r()),maximum:ke($r())}).passthrough(),q9=Me({type:pt("string"),title:ke(ve()),description:ke(ve()),enum:Ye(ve()),enumNames:ke(Ye(ve()))}).passthrough(),H9=dn([z9,$9,B9,q9]),V9=Tn.extend({method:pt("elicitation/create"),params:sa.extend({message:ve(),requestedSchema:Me({type:pt("object"),properties:kd(ve(),H9),required:ke(Ye(ve()))}).passthrough()})}),G9=la.extend({action:No(["accept","decline","cancel"]),content:ke(kd(ve(),Nd()))}),W9=Me({type:pt("ref/resource"),uri:ve()}).passthrough(),Y9=Me({type:pt("ref/prompt"),name:ve()}).passthrough(),K9=Tn.extend({method:pt("completion/complete"),params:sa.extend({ref:dn([Y9,W9]),argument:Me({name:ve(),value:ve()}).passthrough(),context:ke(Me({arguments:ke(kd(ve(),ve()))}))})}),L2=la.extend({completion:Me({values:Ye(ve()).max(100),total:ke($r().int()),hasMore:ke(Dr())}).passthrough()}),Z9=Me({uri:ve().startsWith("file://"),name:ke(ve()),_meta:ke(Me({}).passthrough())}).passthrough(),X9=Tn.extend({method:pt("roots/list")}),Q9=la.extend({roots:Ye(Z9)}),J9=Ka.extend({method:pt("notifications/roots/list_changed")});dn([ZT,l9,K9,D9,w9,x9,p9,m9,h9,v9,b9,I9,k9]);dn([KT,XT,S2,J9]);dn([Al,F9,G9,Q9]);dn([ZT,U9,V9,X9]);dn([KT,XT,L9,y9,g9,O9,C9]);dn([Al,E2,L2,I2,N2,R2,C2,A2,rR,O2]);class Si extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}}const e8=6e4;class t8{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(KT,r=>{const n=this._requestHandlerAbortControllers.get(r.params.requestId);n?.abort(r.params.reason)}),this.setNotificationHandler(XT,r=>{this._onprogress(r)}),this.setRequestHandler(ZT,r=>({}))}_setupTimeout(e,r,n,a,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:a})}_resetTimeout(e){const r=this._timeoutInfo.get(e);if(!r)return!1;const n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Si(Da.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){const r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var r,n,a;this._transport=e;const s=(r=this.transport)===null||r===void 0?void 0:r.onclose;this._transport.onclose=()=>{s?.(),this._onclose()};const l=(n=this.transport)===null||n===void 0?void 0:n.onerror;this._transport.onerror=d=>{l?.(d),this._onerror(d)};const c=(a=this._transport)===null||a===void 0?void 0:a.onmessage;this._transport.onmessage=(d,f)=>{c?.(d,f),w_(d)||o9(d)?this._onresponse(d):h2(d)?this._onrequest(d,f):a9(d)?this._onnotification(d):this._onerror(new Error(`Unknown message type: ${JSON.stringify(d)}`))},await this._transport.start()}_onclose(){var e;const r=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);const n=new Si(Da.ConnectionClosed,"Connection closed");for(const a of r.values())a(n)}_onerror(e){var r;(r=this.onerror)===null||r===void 0||r.call(this,e)}_onnotification(e){var r;const n=(r=this._notificationHandlers.get(e.method))!==null&&r!==void 0?r:this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(a=>this._onerror(new Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(e,r){var n,a;const s=(n=this._requestHandlers.get(e.method))!==null&&n!==void 0?n:this.fallbackRequestHandler,l=this._transport;if(s===void 0){l?.send({jsonrpc:"2.0",id:e.id,error:{code:Da.MethodNotFound,message:"Method not found"}}).catch(f=>this._onerror(new Error(`Failed to send an error response: ${f}`)));return}const c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);const d={signal:c.signal,sessionId:l?.sessionId,_meta:(a=e.params)===null||a===void 0?void 0:a._meta,sendNotification:f=>this.notification(f,{relatedRequestId:e.id}),sendRequest:(f,m,h)=>this.request(f,m,{...h,relatedRequestId:e.id}),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo};Promise.resolve().then(()=>s(e,d)).then(f=>{if(!c.signal.aborted)return l?.send({result:f,jsonrpc:"2.0",id:e.id})},f=>{var m;if(!c.signal.aborted)return l?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Da.InternalError,message:(m=f.message)!==null&&m!==void 0?m:"Internal error"}})}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:r,...n}=e.params,a=Number(r),s=this._progressHandlers.get(a);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const l=this._responseHandlers.get(a),c=this._timeoutInfo.get(a);if(c&&l&&c.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(d){l(d);return}s(n)}_onresponse(e){const r=Number(e.id),n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),w_(e))n(e);else{const a=new Si(e.error.code,e.error.message,e.error.data);n(a)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,r,n){const{relatedRequestId:a,resumptionToken:s,onresumptiontoken:l}=n??{};return new Promise((c,d)=>{var f,m,h,v,y,w;if(!this._transport){d(new Error("Not connected"));return}((f=this._options)===null||f===void 0?void 0:f.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(m=n?.signal)===null||m===void 0||m.throwIfAborted();const S=this._requestMessageId++,R={...e,jsonrpc:"2.0",id:S};n?.onprogress&&(this._progressHandlers.set(S,n.onprogress),R.params={...e.params,_meta:{...((h=e.params)===null||h===void 0?void 0:h._meta)||{},progressToken:S}});const x=N=>{var k;this._responseHandlers.delete(S),this._progressHandlers.delete(S),this._cleanupTimeout(S),(k=this._transport)===null||k===void 0||k.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:S,reason:String(N)}},{relatedRequestId:a,resumptionToken:s,onresumptiontoken:l}).catch(A=>this._onerror(new Error(`Failed to send cancellation: ${A}`))),d(N)};this._responseHandlers.set(S,N=>{var k;if(!(!((k=n?.signal)===null||k===void 0)&&k.aborted)){if(N instanceof Error)return d(N);try{const A=r.parse(N.result);c(A)}catch(A){d(A)}}}),(v=n?.signal)===null||v===void 0||v.addEventListener("abort",()=>{var N;x((N=n?.signal)===null||N===void 0?void 0:N.reason)});const _=(y=n?.timeout)!==null&&y!==void 0?y:e8,C=()=>x(new Si(Da.RequestTimeout,"Request timed out",{timeout:_}));this._setupTimeout(S,_,n?.maxTotalTimeout,C,(w=n?.resetTimeoutOnProgress)!==null&&w!==void 0?w:!1),this._transport.send(R,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:l}).catch(N=>{this._cleanupTimeout(S),d(N)})})}async notification(e,r){var n,a;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((a=(n=this._options)===null||n===void 0?void 0:n.debouncedNotificationMethods)!==null&&a!==void 0?a:[]).includes(e.method)&&!e.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var d;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const f={...e,jsonrpc:"2.0"};(d=this._transport)===null||d===void 0||d.send(f,r).catch(m=>this._onerror(m))});return}const c={...e,jsonrpc:"2.0"};await this._transport.send(c,r)}setRequestHandler(e,r){const n=e.shape.method.value;this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(a,s)=>Promise.resolve(r(e.parse(a),s)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){this._notificationHandlers.set(e.shape.method.value,n=>Promise.resolve(r(e.parse(n))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}function r8(t,e){return Object.entries(e).reduce((r,[n,a])=>(a&&typeof a=="object"?r[n]=r[n]?{...r[n],...a}:a:r[n]=a,r),{...t})}var Tu={exports:{}};var n8=Tu.exports,eI;function a8(){return eI||(eI=1,(function(t,e){(function(r,n){n(e)})(n8,(function(r){function n(){for(var oe=arguments.length,Z=Array(oe),ie=0;ie<oe;ie++)Z[ie]=arguments[ie];if(Z.length>1){Z[0]=Z[0].slice(0,-1);for(var ye=Z.length-1,ge=1;ge<ye;++ge)Z[ge]=Z[ge].slice(1,-1);return Z[ye]=Z[ye].slice(1),Z.join("")}else return Z[0]}function a(oe){return"(?:"+oe+")"}function s(oe){return oe===void 0?"undefined":oe===null?"null":Object.prototype.toString.call(oe).split(" ").pop().split("]").shift().toLowerCase()}function l(oe){return oe.toUpperCase()}function c(oe){return oe!=null?oe instanceof Array?oe:typeof oe.length!="number"||oe.split||oe.setInterval||oe.call?[oe]:Array.prototype.slice.call(oe):[]}function d(oe,Z){var ie=oe;if(Z)for(var ye in Z)ie[ye]=Z[ye];return ie}function f(oe){var Z="[A-Za-z]",ie="[0-9]",ye=n(ie,"[A-Fa-f]"),ge=a(a("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+a("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+a("%"+ye+ye)),je="[\\:\\/\\?\\#\\[\\]\\@]",Be="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",mt=n(je,Be),Ut=oe?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",sr=oe?"[\\uE000-\\uF8FF]":"[]",yt=n(Z,ie,"[\\-\\.\\_\\~]",Ut);a(Z+n(Z,ie,"[\\+\\-\\.]")+"*"),a(a(ge+"|"+n(yt,Be,"[\\:]"))+"*");var Ft=a(a("25[0-5]")+"|"+a("2[0-4]"+ie)+"|"+a("1"+ie+ie)+"|"+a("0?[1-9]"+ie)+"|0?0?"+ie),Wt=a(Ft+"\\."+Ft+"\\."+Ft+"\\."+Ft),it=a(ye+"{1,4}"),Dt=a(a(it+"\\:"+it)+"|"+Wt),Yt=a(a(it+"\\:")+"{6}"+Dt),Pt=a("\\:\\:"+a(it+"\\:")+"{5}"+Dt),on=a(a(it)+"?\\:\\:"+a(it+"\\:")+"{4}"+Dt),zt=a(a(a(it+"\\:")+"{0,1}"+it)+"?\\:\\:"+a(it+"\\:")+"{3}"+Dt),An=a(a(a(it+"\\:")+"{0,2}"+it)+"?\\:\\:"+a(it+"\\:")+"{2}"+Dt),Ja=a(a(a(it+"\\:")+"{0,3}"+it)+"?\\:\\:"+it+"\\:"+Dt),sn=a(a(a(it+"\\:")+"{0,4}"+it)+"?\\:\\:"+Dt),Ar=a(a(a(it+"\\:")+"{0,5}"+it)+"?\\:\\:"+it),Bn=a(a(a(it+"\\:")+"{0,6}"+it)+"?\\:\\:"),Ta=a([Yt,Pt,on,zt,An,Ja,sn,Ar,Bn].join("|")),qn=a(a(yt+"|"+ge)+"+");a("[vV]"+ye+"+\\."+n(yt,Be,"[\\:]")+"+"),a(a(ge+"|"+n(yt,Be))+"*");var Mi=a(ge+"|"+n(yt,Be,"[\\:\\@]"));return a(a(ge+"|"+n(yt,Be,"[\\@]"))+"+"),a(a(Mi+"|"+n("[\\/\\?]",sr))+"*"),{NOT_SCHEME:new RegExp(n("[^]",Z,ie,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",yt,Be),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",yt,Be),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",yt,Be),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",yt,Be),"g"),NOT_QUERY:new RegExp(n("[^\\%]",yt,Be,"[\\:\\@\\/\\?]",sr),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",yt,Be,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",yt,Be),"g"),UNRESERVED:new RegExp(yt,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",yt,mt),"g"),PCT_ENCODED:new RegExp(ge,"g"),IPV4ADDRESS:new RegExp("^("+Wt+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Ta+")"+a(a("\\%25|\\%(?!"+ye+"{2})")+"("+qn+")")+"?\\]?$")}}var m=f(!1),h=f(!0),v=(function(){function oe(Z,ie){var ye=[],ge=!0,je=!1,Be=void 0;try{for(var mt=Z[Symbol.iterator](),Ut;!(ge=(Ut=mt.next()).done)&&(ye.push(Ut.value),!(ie&&ye.length===ie));ge=!0);}catch(sr){je=!0,Be=sr}finally{try{!ge&&mt.return&&mt.return()}finally{if(je)throw Be}}return ye}return function(Z,ie){if(Array.isArray(Z))return Z;if(Symbol.iterator in Object(Z))return oe(Z,ie);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),y=function(oe){if(Array.isArray(oe)){for(var Z=0,ie=Array(oe.length);Z<oe.length;Z++)ie[Z]=oe[Z];return ie}else return Array.from(oe)},w=2147483647,S=36,R=1,x=26,_=38,C=700,N=72,k=128,A="-",I=/^xn--/,O=/[^\0-\x7E]/,L=/[\x2E\u3002\uFF0E\uFF61]/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=S-R,W=Math.floor,X=String.fromCharCode;function ee(oe){throw new RangeError(M[oe])}function J(oe,Z){for(var ie=[],ye=oe.length;ye--;)ie[ye]=Z(oe[ye]);return ie}function j(oe,Z){var ie=oe.split("@"),ye="";ie.length>1&&(ye=ie[0]+"@",oe=ie[1]),oe=oe.replace(L,".");var ge=oe.split("."),je=J(ge,Z).join(".");return ye+je}function G(oe){for(var Z=[],ie=0,ye=oe.length;ie<ye;){var ge=oe.charCodeAt(ie++);if(ge>=55296&&ge<=56319&&ie<ye){var je=oe.charCodeAt(ie++);(je&64512)==56320?Z.push(((ge&1023)<<10)+(je&1023)+65536):(Z.push(ge),ie--)}else Z.push(ge)}return Z}var V=function(Z){return String.fromCodePoint.apply(String,y(Z))},te=function(Z){return Z-48<10?Z-22:Z-65<26?Z-65:Z-97<26?Z-97:S},re=function(Z,ie){return Z+22+75*(Z<26)-((ie!=0)<<5)},U=function(Z,ie,ye){var ge=0;for(Z=ye?W(Z/C):Z>>1,Z+=W(Z/ie);Z>P*x>>1;ge+=S)Z=W(Z/P);return W(ge+(P+1)*Z/(Z+_))},q=function(Z){var ie=[],ye=Z.length,ge=0,je=k,Be=N,mt=Z.lastIndexOf(A);mt<0&&(mt=0);for(var Ut=0;Ut<mt;++Ut)Z.charCodeAt(Ut)>=128&&ee("not-basic"),ie.push(Z.charCodeAt(Ut));for(var sr=mt>0?mt+1:0;sr<ye;){for(var yt=ge,Ft=1,Wt=S;;Wt+=S){sr>=ye&&ee("invalid-input");var it=te(Z.charCodeAt(sr++));(it>=S||it>W((w-ge)/Ft))&&ee("overflow"),ge+=it*Ft;var Dt=Wt<=Be?R:Wt>=Be+x?x:Wt-Be;if(it<Dt)break;var Yt=S-Dt;Ft>W(w/Yt)&&ee("overflow"),Ft*=Yt}var Pt=ie.length+1;Be=U(ge-yt,Pt,yt==0),W(ge/Pt)>w-je&&ee("overflow"),je+=W(ge/Pt),ge%=Pt,ie.splice(ge++,0,je)}return String.fromCodePoint.apply(String,ie)},$=function(Z){var ie=[];Z=G(Z);var ye=Z.length,ge=k,je=0,Be=N,mt=!0,Ut=!1,sr=void 0;try{for(var yt=Z[Symbol.iterator](),Ft;!(mt=(Ft=yt.next()).done);mt=!0){var Wt=Ft.value;Wt<128&&ie.push(X(Wt))}}catch(zo){Ut=!0,sr=zo}finally{try{!mt&&yt.return&&yt.return()}finally{if(Ut)throw sr}}var it=ie.length,Dt=it;for(it&&ie.push(A);Dt<ye;){var Yt=w,Pt=!0,on=!1,zt=void 0;try{for(var An=Z[Symbol.iterator](),Ja;!(Pt=(Ja=An.next()).done);Pt=!0){var sn=Ja.value;sn>=ge&&sn<Yt&&(Yt=sn)}}catch(zo){on=!0,zt=zo}finally{try{!Pt&&An.return&&An.return()}finally{if(on)throw zt}}var Ar=Dt+1;Yt-ge>W((w-je)/Ar)&&ee("overflow"),je+=(Yt-ge)*Ar,ge=Yt;var Bn=!0,Ta=!1,qn=void 0;try{for(var Mi=Z[Symbol.iterator](),Pi;!(Bn=(Pi=Mi.next()).done);Bn=!0){var ji=Pi.value;if(ji<ge&&++je>w&&ee("overflow"),ji==ge){for(var mn=je,qr=S;;qr+=S){var Ui=qr<=Be?R:qr>=Be+x?x:qr-Be;if(mn<Ui)break;var rf=mn-Ui,Os=S-Ui;ie.push(X(re(Ui+rf%Os,0))),mn=W(rf/Os)}ie.push(X(re(mn,0))),Be=U(je,Ar,Dt==it),je=0,++Dt}}}catch(zo){Ta=!0,qn=zo}finally{try{!Bn&&Mi.return&&Mi.return()}finally{if(Ta)throw qn}}++je,++ge}return ie.join("")},Y=function(Z){return j(Z,function(ie){return I.test(ie)?q(ie.slice(4).toLowerCase()):ie})},Q=function(Z){return j(Z,function(ie){return O.test(ie)?"xn--"+$(ie):ie})},F={version:"2.1.0",ucs2:{decode:G,encode:V},decode:q,encode:$,toASCII:Q,toUnicode:Y},z={};function K(oe){var Z=oe.charCodeAt(0),ie=void 0;return Z<16?ie="%0"+Z.toString(16).toUpperCase():Z<128?ie="%"+Z.toString(16).toUpperCase():Z<2048?ie="%"+(Z>>6|192).toString(16).toUpperCase()+"%"+(Z&63|128).toString(16).toUpperCase():ie="%"+(Z>>12|224).toString(16).toUpperCase()+"%"+(Z>>6&63|128).toString(16).toUpperCase()+"%"+(Z&63|128).toString(16).toUpperCase(),ie}function ae(oe){for(var Z="",ie=0,ye=oe.length;ie<ye;){var ge=parseInt(oe.substr(ie+1,2),16);if(ge<128)Z+=String.fromCharCode(ge),ie+=3;else if(ge>=194&&ge<224){if(ye-ie>=6){var je=parseInt(oe.substr(ie+4,2),16);Z+=String.fromCharCode((ge&31)<<6|je&63)}else Z+=oe.substr(ie,6);ie+=6}else if(ge>=224){if(ye-ie>=9){var Be=parseInt(oe.substr(ie+4,2),16),mt=parseInt(oe.substr(ie+7,2),16);Z+=String.fromCharCode((ge&15)<<12|(Be&63)<<6|mt&63)}else Z+=oe.substr(ie,9);ie+=9}else Z+=oe.substr(ie,3),ie+=3}return Z}function H(oe,Z){function ie(ye){var ge=ae(ye);return ge.match(Z.UNRESERVED)?ge:ye}return oe.scheme&&(oe.scheme=String(oe.scheme).replace(Z.PCT_ENCODED,ie).toLowerCase().replace(Z.NOT_SCHEME,"")),oe.userinfo!==void 0&&(oe.userinfo=String(oe.userinfo).replace(Z.PCT_ENCODED,ie).replace(Z.NOT_USERINFO,K).replace(Z.PCT_ENCODED,l)),oe.host!==void 0&&(oe.host=String(oe.host).replace(Z.PCT_ENCODED,ie).toLowerCase().replace(Z.NOT_HOST,K).replace(Z.PCT_ENCODED,l)),oe.path!==void 0&&(oe.path=String(oe.path).replace(Z.PCT_ENCODED,ie).replace(oe.scheme?Z.NOT_PATH:Z.NOT_PATH_NOSCHEME,K).replace(Z.PCT_ENCODED,l)),oe.query!==void 0&&(oe.query=String(oe.query).replace(Z.PCT_ENCODED,ie).replace(Z.NOT_QUERY,K).replace(Z.PCT_ENCODED,l)),oe.fragment!==void 0&&(oe.fragment=String(oe.fragment).replace(Z.PCT_ENCODED,ie).replace(Z.NOT_FRAGMENT,K).replace(Z.PCT_ENCODED,l)),oe}function de(oe){return oe.replace(/^0*(.*)/,"$1")||"0"}function me(oe,Z){var ie=oe.match(Z.IPV4ADDRESS)||[],ye=v(ie,2),ge=ye[1];return ge?ge.split(".").map(de).join("."):oe}function xe(oe,Z){var ie=oe.match(Z.IPV6ADDRESS)||[],ye=v(ie,3),ge=ye[1],je=ye[2];if(ge){for(var Be=ge.toLowerCase().split("::").reverse(),mt=v(Be,2),Ut=mt[0],sr=mt[1],yt=sr?sr.split(":").map(de):[],Ft=Ut.split(":").map(de),Wt=Z.IPV4ADDRESS.test(Ft[Ft.length-1]),it=Wt?7:8,Dt=Ft.length-it,Yt=Array(it),Pt=0;Pt<it;++Pt)Yt[Pt]=yt[Pt]||Ft[Dt+Pt]||"";Wt&&(Yt[it-1]=me(Yt[it-1],Z));var on=Yt.reduce(function(Ar,Bn,Ta){if(!Bn||Bn==="0"){var qn=Ar[Ar.length-1];qn&&qn.index+qn.length===Ta?qn.length++:Ar.push({index:Ta,length:1})}return Ar},[]),zt=on.sort(function(Ar,Bn){return Bn.length-Ar.length})[0],An=void 0;if(zt&&zt.length>1){var Ja=Yt.slice(0,zt.index),sn=Yt.slice(zt.index+zt.length);An=Ja.join(":")+"::"+sn.join(":")}else An=Yt.join(":");return je&&(An+="%"+je),An}else return oe}var be=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,_e="".match(/(){0}/)[1]===void 0;function Ae(oe){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie={},ye=Z.iri!==!1?h:m;Z.reference==="suffix"&&(oe=(Z.scheme?Z.scheme+":":"")+"//"+oe);var ge=oe.match(be);if(ge){_e?(ie.scheme=ge[1],ie.userinfo=ge[3],ie.host=ge[4],ie.port=parseInt(ge[5],10),ie.path=ge[6]||"",ie.query=ge[7],ie.fragment=ge[8],isNaN(ie.port)&&(ie.port=ge[5])):(ie.scheme=ge[1]||void 0,ie.userinfo=oe.indexOf("@")!==-1?ge[3]:void 0,ie.host=oe.indexOf("//")!==-1?ge[4]:void 0,ie.port=parseInt(ge[5],10),ie.path=ge[6]||"",ie.query=oe.indexOf("?")!==-1?ge[7]:void 0,ie.fragment=oe.indexOf("#")!==-1?ge[8]:void 0,isNaN(ie.port)&&(ie.port=oe.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?ge[4]:void 0)),ie.host&&(ie.host=xe(me(ie.host,ye),ye)),ie.scheme===void 0&&ie.userinfo===void 0&&ie.host===void 0&&ie.port===void 0&&!ie.path&&ie.query===void 0?ie.reference="same-document":ie.scheme===void 0?ie.reference="relative":ie.fragment===void 0?ie.reference="absolute":ie.reference="uri",Z.reference&&Z.reference!=="suffix"&&Z.reference!==ie.reference&&(ie.error=ie.error||"URI is not a "+Z.reference+" reference.");var je=z[(Z.scheme||ie.scheme||"").toLowerCase()];if(!Z.unicodeSupport&&(!je||!je.unicodeSupport)){if(ie.host&&(Z.domainHost||je&&je.domainHost))try{ie.host=F.toASCII(ie.host.replace(ye.PCT_ENCODED,ae).toLowerCase())}catch(Be){ie.error=ie.error||"Host's domain name can not be converted to ASCII via punycode: "+Be}H(ie,m)}else H(ie,ye);je&&je.parse&&je.parse(ie,Z)}else ie.error=ie.error||"URI can not be parsed.";return ie}function Fe(oe,Z){var ie=Z.iri!==!1?h:m,ye=[];return oe.userinfo!==void 0&&(ye.push(oe.userinfo),ye.push("@")),oe.host!==void 0&&ye.push(xe(me(String(oe.host),ie),ie).replace(ie.IPV6ADDRESS,function(ge,je,Be){return"["+je+(Be?"%25"+Be:"")+"]"})),(typeof oe.port=="number"||typeof oe.port=="string")&&(ye.push(":"),ye.push(String(oe.port))),ye.length?ye.join(""):void 0}var Pe=/^\.\.?\//,$e=/^\/\.(\/|$)/,at=/^\/\.\.(\/|$)/,ce=/^\/?(?:.|\n)*?(?=\/|$)/;function Ce(oe){for(var Z=[];oe.length;)if(oe.match(Pe))oe=oe.replace(Pe,"");else if(oe.match($e))oe=oe.replace($e,"/");else if(oe.match(at))oe=oe.replace(at,"/"),Z.pop();else if(oe==="."||oe==="..")oe="";else{var ie=oe.match(ce);if(ie){var ye=ie[0];oe=oe.slice(ye.length),Z.push(ye)}else throw new Error("Unexpected dot segment condition")}return Z.join("")}function ze(oe){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie=Z.iri?h:m,ye=[],ge=z[(Z.scheme||oe.scheme||"").toLowerCase()];if(ge&&ge.serialize&&ge.serialize(oe,Z),oe.host&&!ie.IPV6ADDRESS.test(oe.host)){if(Z.domainHost||ge&&ge.domainHost)try{oe.host=Z.iri?F.toUnicode(oe.host):F.toASCII(oe.host.replace(ie.PCT_ENCODED,ae).toLowerCase())}catch(mt){oe.error=oe.error||"Host's domain name can not be converted to "+(Z.iri?"Unicode":"ASCII")+" via punycode: "+mt}}H(oe,ie),Z.reference!=="suffix"&&oe.scheme&&(ye.push(oe.scheme),ye.push(":"));var je=Fe(oe,Z);if(je!==void 0&&(Z.reference!=="suffix"&&ye.push("//"),ye.push(je),oe.path&&oe.path.charAt(0)!=="/"&&ye.push("/")),oe.path!==void 0){var Be=oe.path;!Z.absolutePath&&(!ge||!ge.absolutePath)&&(Be=Ce(Be)),je===void 0&&(Be=Be.replace(/^\/\//,"/%2F")),ye.push(Be)}return oe.query!==void 0&&(ye.push("?"),ye.push(oe.query)),oe.fragment!==void 0&&(ye.push("#"),ye.push(oe.fragment)),ye.join("")}function we(oe,Z){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ye=arguments[3],ge={};return ye||(oe=Ae(ze(oe,ie),ie),Z=Ae(ze(Z,ie),ie)),ie=ie||{},!ie.tolerant&&Z.scheme?(ge.scheme=Z.scheme,ge.userinfo=Z.userinfo,ge.host=Z.host,ge.port=Z.port,ge.path=Ce(Z.path||""),ge.query=Z.query):(Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0?(ge.userinfo=Z.userinfo,ge.host=Z.host,ge.port=Z.port,ge.path=Ce(Z.path||""),ge.query=Z.query):(Z.path?(Z.path.charAt(0)==="/"?ge.path=Ce(Z.path):((oe.userinfo!==void 0||oe.host!==void 0||oe.port!==void 0)&&!oe.path?ge.path="/"+Z.path:oe.path?ge.path=oe.path.slice(0,oe.path.lastIndexOf("/")+1)+Z.path:ge.path=Z.path,ge.path=Ce(ge.path)),ge.query=Z.query):(ge.path=oe.path,Z.query!==void 0?ge.query=Z.query:ge.query=oe.query),ge.userinfo=oe.userinfo,ge.host=oe.host,ge.port=oe.port),ge.scheme=oe.scheme),ge.fragment=Z.fragment,ge}function Ne(oe,Z,ie){var ye=d({scheme:"null"},ie);return ze(we(Ae(oe,ye),Ae(Z,ye),ye,!0),ye)}function Oe(oe,Z){return typeof oe=="string"?oe=ze(Ae(oe,Z),Z):s(oe)==="object"&&(oe=Ae(ze(oe,Z),Z)),oe}function Je(oe,Z,ie){return typeof oe=="string"?oe=ze(Ae(oe,ie),ie):s(oe)==="object"&&(oe=ze(oe,ie)),typeof Z=="string"?Z=ze(Ae(Z,ie),ie):s(Z)==="object"&&(Z=ze(Z,ie)),oe===Z}function ot(oe,Z){return oe&&oe.toString().replace(!Z||!Z.iri?m.ESCAPE:h.ESCAPE,K)}function Rt(oe,Z){return oe&&oe.toString().replace(!Z||!Z.iri?m.PCT_ENCODED:h.PCT_ENCODED,ae)}var Ot={scheme:"http",domainHost:!0,parse:function(Z,ie){return Z.host||(Z.error=Z.error||"HTTP URIs must have a host."),Z},serialize:function(Z,ie){var ye=String(Z.scheme).toLowerCase()==="https";return(Z.port===(ye?443:80)||Z.port==="")&&(Z.port=void 0),Z.path||(Z.path="/"),Z}},Cn={scheme:"https",domainHost:Ot.domainHost,parse:Ot.parse,serialize:Ot.serialize};function vr(oe){return typeof oe.secure=="boolean"?oe.secure:String(oe.scheme).toLowerCase()==="wss"}var or={scheme:"ws",domainHost:!0,parse:function(Z,ie){var ye=Z;return ye.secure=vr(ye),ye.resourceName=(ye.path||"/")+(ye.query?"?"+ye.query:""),ye.path=void 0,ye.query=void 0,ye},serialize:function(Z,ie){if((Z.port===(vr(Z)?443:80)||Z.port==="")&&(Z.port=void 0),typeof Z.secure=="boolean"&&(Z.scheme=Z.secure?"wss":"ws",Z.secure=void 0),Z.resourceName){var ye=Z.resourceName.split("?"),ge=v(ye,2),je=ge[0],Be=ge[1];Z.path=je&&je!=="/"?je:void 0,Z.query=Be,Z.resourceName=void 0}return Z.fragment=void 0,Z}},Mt={scheme:"wss",domainHost:or.domainHost,parse:or.parse,serialize:or.serialize},Zt={},fr="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Sr="[0-9A-Fa-f]",zn=a(a("%[EFef]"+Sr+"%"+Sr+Sr+"%"+Sr+Sr)+"|"+a("%[89A-Fa-f]"+Sr+"%"+Sr+Sr)+"|"+a("%"+Sr+Sr)),ir="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Gt="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",pn=n(Gt,'[\\"\\\\]'),ua="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",an=new RegExp(fr,"g"),Qe=new RegExp(zn,"g"),jt=new RegExp(n("[^]",ir,"[\\.]",'[\\"]',pn),"g"),Qt=new RegExp(n("[^]",fr,ua),"g"),Lr=Qt;function $n(oe){var Z=ae(oe);return Z.match(an)?Z:oe}var Xt={scheme:"mailto",parse:function(Z,ie){var ye=Z,ge=ye.to=ye.path?ye.path.split(","):[];if(ye.path=void 0,ye.query){for(var je=!1,Be={},mt=ye.query.split("&"),Ut=0,sr=mt.length;Ut<sr;++Ut){var yt=mt[Ut].split("=");switch(yt[0]){case"to":for(var Ft=yt[1].split(","),Wt=0,it=Ft.length;Wt<it;++Wt)ge.push(Ft[Wt]);break;case"subject":ye.subject=Rt(yt[1],ie);break;case"body":ye.body=Rt(yt[1],ie);break;default:je=!0,Be[Rt(yt[0],ie)]=Rt(yt[1],ie);break}}je&&(ye.headers=Be)}ye.query=void 0;for(var Dt=0,Yt=ge.length;Dt<Yt;++Dt){var Pt=ge[Dt].split("@");if(Pt[0]=Rt(Pt[0]),ie.unicodeSupport)Pt[1]=Rt(Pt[1],ie).toLowerCase();else try{Pt[1]=F.toASCII(Rt(Pt[1],ie).toLowerCase())}catch(on){ye.error=ye.error||"Email address's domain name can not be converted to ASCII via punycode: "+on}ge[Dt]=Pt.join("@")}return ye},serialize:function(Z,ie){var ye=Z,ge=c(Z.to);if(ge){for(var je=0,Be=ge.length;je<Be;++je){var mt=String(ge[je]),Ut=mt.lastIndexOf("@"),sr=mt.slice(0,Ut).replace(Qe,$n).replace(Qe,l).replace(jt,K),yt=mt.slice(Ut+1);try{yt=ie.iri?F.toUnicode(yt):F.toASCII(Rt(yt,ie).toLowerCase())}catch(Dt){ye.error=ye.error||"Email address's domain name can not be converted to "+(ie.iri?"Unicode":"ASCII")+" via punycode: "+Dt}ge[je]=sr+"@"+yt}ye.path=ge.join(",")}var Ft=Z.headers=Z.headers||{};Z.subject&&(Ft.subject=Z.subject),Z.body&&(Ft.body=Z.body);var Wt=[];for(var it in Ft)Ft[it]!==Zt[it]&&Wt.push(it.replace(Qe,$n).replace(Qe,l).replace(Qt,K)+"="+Ft[it].replace(Qe,$n).replace(Qe,l).replace(Lr,K));return Wt.length&&(ye.query=Wt.join("&")),ye}},Jr=/^([^\:]+)\:(.*)/,_a={scheme:"urn",parse:function(Z,ie){var ye=Z.path&&Z.path.match(Jr),ge=Z;if(ye){var je=ie.scheme||ge.scheme||"urn",Be=ye[1].toLowerCase(),mt=ye[2],Ut=je+":"+(ie.nid||Be),sr=z[Ut];ge.nid=Be,ge.nss=mt,ge.path=void 0,sr&&(ge=sr.parse(ge,ie))}else ge.error=ge.error||"URN can not be parsed.";return ge},serialize:function(Z,ie){var ye=ie.scheme||Z.scheme||"urn",ge=Z.nid,je=ye+":"+(ie.nid||ge),Be=z[je];Be&&(Z=Be.serialize(Z,ie));var mt=Z,Ut=Z.nss;return mt.path=(ge||ie.nid)+":"+Ut,mt}},en=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Br={scheme:"urn:uuid",parse:function(Z,ie){var ye=Z;return ye.uuid=ye.nss,ye.nss=void 0,!ie.tolerant&&(!ye.uuid||!ye.uuid.match(en))&&(ye.error=ye.error||"UUID is not valid."),ye},serialize:function(Z,ie){var ye=Z;return ye.nss=(Z.uuid||"").toLowerCase(),ye}};z[Ot.scheme]=Ot,z[Cn.scheme]=Cn,z[or.scheme]=or,z[Mt.scheme]=Mt,z[Xt.scheme]=Xt,z[_a.scheme]=_a,z[Br.scheme]=Br,r.SCHEMES=z,r.pctEncChar=K,r.pctDecChars=ae,r.parse=Ae,r.removeDotSegments=Ce,r.serialize=ze,r.resolveComponents=we,r.resolve=Ne,r.normalize=Oe,r.equal=Je,r.escapeComponent=ot,r.unescapeComponent=Rt,Object.defineProperty(r,"__esModule",{value:!0})}))})(Tu,Tu.exports)),Tu.exports}var Fv,tI;function nR(){return tI||(tI=1,Fv=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return!1;for(a=n;a--!==0;){var l=s[a];if(!t(e[l],r[l]))return!1}return!0}return e!==e&&r!==r}),Fv}var zv,rI;function o8(){return rI||(rI=1,zv=function(e){for(var r=0,n=e.length,a=0,s;a<n;)r++,s=e.charCodeAt(a++),s>=55296&&s<=56319&&a<n&&(s=e.charCodeAt(a),(s&64512)==56320&&a++);return r}),zv}var $v,nI;function pc(){if(nI)return $v;nI=1,$v={copy:t,checkDataType:e,checkDataTypes:r,coerceToTypes:a,toHash:s,getProperty:d,escapeQuotes:f,equal:nR(),ucs2length:o8(),varOccurences:m,varReplace:h,schemaHasRules:v,schemaHasRulesExcept:y,schemaUnknownRules:w,toQuotedString:S,getPathExpr:R,getPath:x,getData:N,unescapeFragment:A,unescapeJsonPointer:L,escapeFragment:I,escapeJsonPointer:O};function t(M,P){P=P||{};for(var W in M)P[W]=M[W];return P}function e(M,P,W,X){var ee=X?" !== ":" === ",J=X?" || ":" && ",j=X?"!":"",G=X?"":"!";switch(M){case"null":return P+ee+"null";case"array":return j+"Array.isArray("+P+")";case"object":return"("+j+P+J+"typeof "+P+ee+'"object"'+J+G+"Array.isArray("+P+"))";case"integer":return"(typeof "+P+ee+'"number"'+J+G+"("+P+" % 1)"+J+P+ee+P+(W?J+j+"isFinite("+P+")":"")+")";case"number":return"(typeof "+P+ee+'"'+M+'"'+(W?J+j+"isFinite("+P+")":"")+")";default:return"typeof "+P+ee+'"'+M+'"'}}function r(M,P,W){switch(M.length){case 1:return e(M[0],P,W,!0);default:var X="",ee=s(M);ee.array&&ee.object&&(X=ee.null?"(":"(!"+P+" || ",X+="typeof "+P+' !== "object")',delete ee.null,delete ee.array,delete ee.object),ee.number&&delete ee.integer;for(var J in ee)X+=(X?" && ":"")+e(J,P,W,!0);return X}}var n=s(["string","number","integer","boolean","null"]);function a(M,P){if(Array.isArray(P)){for(var W=[],X=0;X<P.length;X++){var ee=P[X];(n[ee]||M==="array"&&ee==="array")&&(W[W.length]=ee)}if(W.length)return W}else{if(n[P])return[P];if(M==="array"&&P==="array")return["array"]}}function s(M){for(var P={},W=0;W<M.length;W++)P[M[W]]=!0;return P}var l=/^[a-z$_][a-z$_0-9]*$/i,c=/'|\\/g;function d(M){return typeof M=="number"?"["+M+"]":l.test(M)?"."+M:"['"+f(M)+"']"}function f(M){return M.replace(c,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function m(M,P){P+="[^0-9]";var W=M.match(new RegExp(P,"g"));return W?W.length:0}function h(M,P,W){return P+="([^0-9])",W=W.replace(/\$/g,"$$$$"),M.replace(new RegExp(P,"g"),W+"$1")}function v(M,P){if(typeof M=="boolean")return!M;for(var W in M)if(P[W])return!0}function y(M,P,W){if(typeof M=="boolean")return!M&&W!="not";for(var X in M)if(X!=W&&P[X])return!0}function w(M,P){if(typeof M!="boolean"){for(var W in M)if(!P[W])return W}}function S(M){return"'"+f(M)+"'"}function R(M,P,W,X){var ee=W?"'/' + "+P+(X?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):X?"'[' + "+P+" + ']'":"'[\\'' + "+P+" + '\\']'";return k(M,ee)}function x(M,P,W){var X=S(W?"/"+O(P):d(P));return k(M,X)}var _=/^\/(?:[^~]|~0|~1)*$/,C=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N(M,P,W){var X,ee,J,j;if(M==="")return"rootData";if(M[0]=="/"){if(!_.test(M))throw new Error("Invalid JSON-pointer: "+M);ee=M,J="rootData"}else{if(j=M.match(C),!j)throw new Error("Invalid JSON-pointer: "+M);if(X=+j[1],ee=j[2],ee=="#"){if(X>=P)throw new Error("Cannot access property/index "+X+" levels up, current level is "+P);return W[P-X]}if(X>P)throw new Error("Cannot access data "+X+" levels up, current level is "+P);if(J="data"+(P-X||""),!ee)return J}for(var G=J,V=ee.split("/"),te=0;te<V.length;te++){var re=V[te];re&&(J+=d(L(re)),G+=" && "+J)}return G}function k(M,P){return M=='""'?P:(M+" + "+P).replace(/([^\\])' \+ '/g,"$1")}function A(M){return L(decodeURIComponent(M))}function I(M){return encodeURIComponent(O(M))}function O(M){return M.replace(/~/g,"~0").replace(/\//g,"~1")}function L(M){return M.replace(/~1/g,"/").replace(/~0/g,"~")}return $v}var Bv,aI;function M2(){if(aI)return Bv;aI=1;var t=pc();Bv=e;function e(r){t.copy(r,this)}return Bv}var qv={exports:{}},oI;function i8(){if(oI)return qv.exports;oI=1;var t=qv.exports=function(n,a,s){typeof a=="function"&&(s=a,a={}),s=a.cb||s;var l=typeof s=="function"?s:s.pre||function(){},c=s.post||function(){};e(a,l,c,n,"",n)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(n,a,s,l,c,d,f,m,h,v){if(l&&typeof l=="object"&&!Array.isArray(l)){a(l,c,d,f,m,h,v);for(var y in l){var w=l[y];if(Array.isArray(w)){if(y in t.arrayKeywords)for(var S=0;S<w.length;S++)e(n,a,s,w[S],c+"/"+y+"/"+S,d,c,y,l,S)}else if(y in t.propsKeywords){if(w&&typeof w=="object")for(var R in w)e(n,a,s,w[R],c+"/"+y+"/"+r(R),d,c,y,l,R)}else(y in t.keywords||n.allKeys&&!(y in t.skipKeywords))&&e(n,a,s,w,c+"/"+y,d,c,y,l)}s(l,c,d,f,m,h,v)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return qv.exports}var Hv,iI;function aR(){if(iI)return Hv;iI=1;var t=a8(),e=nR(),r=pc(),n=M2(),a=i8();Hv=s,s.normalizeId=x,s.fullPath=w,s.url=_,s.ids=C,s.inlineRef=h,s.schema=l;function s(N,k,A){var I=this._refs[A];if(typeof I=="string")if(this._refs[I])I=this._refs[I];else return s.call(this,N,k,I);if(I=I||this._schemas[A],I instanceof n)return h(I.schema,this._opts.inlineRefs)?I.schema:I.validate||this._compile(I);var O=l.call(this,k,A),L,M,P;return O&&(L=O.schema,k=O.root,P=O.baseId),L instanceof n?M=L.validate||N.call(this,L.schema,k,void 0,P):L!==void 0&&(M=h(L,this._opts.inlineRefs)?L:N.call(this,L,k,void 0,P)),M}function l(N,k){var A=t.parse(k),I=S(A),O=w(this._getId(N.schema));if(Object.keys(N.schema).length===0||I!==O){var L=x(I),M=this._refs[L];if(typeof M=="string")return c.call(this,N,M,A);if(M instanceof n)M.validate||this._compile(M),N=M;else if(M=this._schemas[L],M instanceof n){if(M.validate||this._compile(M),L==x(k))return{schema:M,root:N,baseId:O};N=M}else return;if(!N.schema)return;O=w(this._getId(N.schema))}return f.call(this,A,O,N.schema,N)}function c(N,k,A){var I=l.call(this,N,k);if(I){var O=I.schema,L=I.baseId;N=I.root;var M=this._getId(O);return M&&(L=_(L,M)),f.call(this,A,L,O,N)}}var d=r.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function f(N,k,A,I){if(N.fragment=N.fragment||"",N.fragment.slice(0,1)=="/"){for(var O=N.fragment.split("/"),L=1;L<O.length;L++){var M=O[L];if(M){if(M=r.unescapeFragment(M),A=A[M],A===void 0)break;var P;if(!d[M]&&(P=this._getId(A),P&&(k=_(k,P)),A.$ref)){var W=_(k,A.$ref),X=l.call(this,I,W);X&&(A=X.schema,I=X.root,k=X.baseId)}}}if(A!==void 0&&A!==I.schema)return{schema:A,root:I,baseId:k}}}var m=r.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function h(N,k){if(k===!1)return!1;if(k===void 0||k===!0)return v(N);if(k)return y(N)<=k}function v(N){var k;if(Array.isArray(N)){for(var A=0;A<N.length;A++)if(k=N[A],typeof k=="object"&&!v(k))return!1}else for(var I in N)if(I=="$ref"||(k=N[I],typeof k=="object"&&!v(k)))return!1;return!0}function y(N){var k=0,A;if(Array.isArray(N)){for(var I=0;I<N.length;I++)if(A=N[I],typeof A=="object"&&(k+=y(A)),k==1/0)return 1/0}else for(var O in N){if(O=="$ref")return 1/0;if(m[O])k++;else if(A=N[O],typeof A=="object"&&(k+=y(A)+1),k==1/0)return 1/0}return k}function w(N,k){k!==!1&&(N=x(N));var A=t.parse(N);return S(A)}function S(N){return t.serialize(N).split("#")[0]+"#"}var R=/#\/?$/;function x(N){return N?N.replace(R,""):""}function _(N,k){return k=x(k),t.resolve(N,k)}function C(N){var k=x(this._getId(N)),A={"":k},I={"":w(k,!1)},O={},L=this;return a(N,{allKeys:!0},function(M,P,W,X,ee,J,j){if(P!==""){var G=L._getId(M),V=A[X],te=I[X]+"/"+ee;if(j!==void 0&&(te+="/"+(typeof j=="number"?j:r.escapeFragment(j))),typeof G=="string"){G=V=x(V?t.resolve(V,G):G);var re=L._refs[G];if(typeof re=="string"&&(re=L._refs[re]),re&&re.schema){if(!e(M,re.schema))throw new Error('id "'+G+'" resolves to more than one schema')}else if(G!=x(te))if(G[0]=="#"){if(O[G]&&!e(M,O[G]))throw new Error('id "'+G+'" resolves to more than one schema');O[G]=M}else L._refs[G]=te}A[P]=V,I[P]=te}}),O}return Hv}var Vv,sI;function oR(){if(sI)return Vv;sI=1;var t=aR();Vv={Validation:n(e),MissingRef:n(r)};function e(a){this.message="validation failed",this.errors=a,this.ajv=this.validation=!0}r.message=function(a,s){return"can't resolve reference "+s+" from id "+a};function r(a,s,l){this.message=l||r.message(a,s),this.missingRef=t.url(a,s),this.missingSchema=t.normalizeId(t.fullPath(this.missingRef))}function n(a){return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a}return Vv}var Gv,lI;function P2(){return lI||(lI=1,Gv=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&(function(s){return function(l){return function(c,d){var f={key:c,value:l[c]},m={key:d,value:l[d]};return s(f,m)}}})(e.cmp),a=[];return(function s(l){if(l&&l.toJSON&&typeof l.toJSON=="function"&&(l=l.toJSON()),l!==void 0){if(typeof l=="number")return isFinite(l)?""+l:"null";if(typeof l!="object")return JSON.stringify(l);var c,d;if(Array.isArray(l)){for(d="[",c=0;c<l.length;c++)c&&(d+=","),d+=s(l[c])||"null";return d+"]"}if(l===null)return"null";if(a.indexOf(l)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var f=a.push(l)-1,m=Object.keys(l).sort(n&&n(l));for(d="",c=0;c<m.length;c++){var h=m[c],v=s(l[h]);v&&(d&&(d+=","),d+=JSON.stringify(h)+":"+v)}return a.splice(f,1),"{"+d+"}"}})(t)}),Gv}var Wv,cI;function j2(){return cI||(cI=1,Wv=function(e,r,n){var a="",s=e.schema.$async===!0,l=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),c=e.self._getId(e.schema);if(e.opts.strictKeywords){var d=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(d){var f="unknown keyword: "+d;if(e.opts.strictKeywords==="log")e.logger.warn(f);else throw new Error(f)}}if(e.isTop&&(a+=" var validate = ",s&&(e.async=!0,a+="async "),a+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",c&&(e.opts.sourceCode||e.opts.processCode)&&(a+=" "+("/*# sourceURL="+c+" */")+" ")),typeof e.schema=="boolean"||!(l||e.schema.$ref)){var r="false schema",m=e.level,h=e.dataLevel,v=e.schema[r],y=e.schemaPath+e.util.getProperty(r),w=e.errSchemaPath+"/"+r,k=!e.opts.allErrors,O,S="data"+(h||""),N="valid"+m;if(e.schema===!1){e.isTop?k=!0:a+=" var "+N+" = false; ";var R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(O||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'boolean schema is false' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+S+" "),a+=" } "):a+=" {} ";var x=a;a=R.pop(),!e.compositeRule&&k?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?s?a+=" return data; ":a+=" validate.errors = null; return true; ":a+=" var "+N+" = true; ";return e.isTop&&(a+=" }; return validate; "),a}if(e.isTop){var _=e.isTop,m=e.level=0,h=e.dataLevel=0,S="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var C="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(C);else throw new Error(C)}a+=" var vErrors = null; ",a+=" var errors = 0; ",a+=" if (rootData === undefined) rootData = data; "}else{var m=e.level,h=e.dataLevel,S="data"+(h||"");if(c&&(e.baseId=e.resolve.url(e.baseId,c)),s&&!e.async)throw new Error("async schema in sync schema");a+=" var errs_"+m+" = errors;"}var N="valid"+m,k=!e.opts.allErrors,A="",I="",O,L=e.schema.type,M=Array.isArray(L);if(L&&e.opts.nullable&&e.schema.nullable===!0&&(M?L.indexOf("null")==-1&&(L=L.concat("null")):L!="null"&&(L=[L,"null"],M=!0)),M&&L.length==1&&(L=L[0],M=!1),e.schema.$ref&&l){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(l=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(a+=" "+e.RULES.all.$comment.code(e,"$comment")),L){if(e.opts.coerceTypes)var P=e.util.coerceToTypes(e.opts.coerceTypes,L);var W=e.RULES.types[L];if(P||M||W===!0||W&&!$e(W)){var y=e.schemaPath+".type",w=e.errSchemaPath+"/type",y=e.schemaPath+".type",w=e.errSchemaPath+"/type",X=M?"checkDataTypes":"checkDataType";if(a+=" if ("+e.util[X](L,S,e.opts.strictNumbers,!0)+") { ",P){var ee="dataType"+m,J="coerced"+m;a+=" var "+ee+" = typeof "+S+"; var "+J+" = undefined; ",e.opts.coerceTypes=="array"&&(a+=" if ("+ee+" == 'object' && Array.isArray("+S+") && "+S+".length == 1) { "+S+" = "+S+"[0]; "+ee+" = typeof "+S+"; if ("+e.util.checkDataType(e.schema.type,S,e.opts.strictNumbers)+") "+J+" = "+S+"; } "),a+=" if ("+J+" !== undefined) ; ";var j=P;if(j)for(var G,V=-1,te=j.length-1;V<te;)G=j[V+=1],G=="string"?a+=" else if ("+ee+" == 'number' || "+ee+" == 'boolean') "+J+" = '' + "+S+"; else if ("+S+" === null) "+J+" = ''; ":G=="number"||G=="integer"?(a+=" else if ("+ee+" == 'boolean' || "+S+" === null || ("+ee+" == 'string' && "+S+" && "+S+" == +"+S+" ",G=="integer"&&(a+=" && !("+S+" % 1)"),a+=")) "+J+" = +"+S+"; "):G=="boolean"?a+=" else if ("+S+" === 'false' || "+S+" === 0 || "+S+" === null) "+J+" = false; else if ("+S+" === 'true' || "+S+" === 1) "+J+" = true; ":G=="null"?a+=" else if ("+S+" === '' || "+S+" === 0 || "+S+" === false) "+J+" = null; ":e.opts.coerceTypes=="array"&&G=="array"&&(a+=" else if ("+ee+" == 'string' || "+ee+" == 'number' || "+ee+" == 'boolean' || "+S+" == null) "+J+" = ["+S+"]; ");a+=" else { ";var R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(O||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",M?a+=""+L.join(","):a+=""+L,a+="' } ",e.opts.messages!==!1&&(a+=" , message: 'should be ",M?a+=""+L.join(","):a+=""+L,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+y+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+S+" "),a+=" } "):a+=" {} ";var x=a;a=R.pop(),!e.compositeRule&&k?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } if ("+J+" !== undefined) { ";var re=h?"data"+(h-1||""):"parentData",U=h?e.dataPathArr[h]:"parentDataProperty";a+=" "+S+" = "+J+"; ",h||(a+="if ("+re+" !== undefined)"),a+=" "+re+"["+U+"] = "+J+"; } "}else{var R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(O||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",M?a+=""+L.join(","):a+=""+L,a+="' } ",e.opts.messages!==!1&&(a+=" , message: 'should be ",M?a+=""+L.join(","):a+=""+L,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+y+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+S+" "),a+=" } "):a+=" {} ";var x=a;a=R.pop(),!e.compositeRule&&k?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } "}}if(e.schema.$ref&&!l)a+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",k&&(a+=" } if (errors === ",_?a+="0":a+="errs_"+m,a+=") { ",I+="}");else{var q=e.RULES;if(q){for(var W,$=-1,Y=q.length-1;$<Y;)if(W=q[$+=1],$e(W)){if(W.type&&(a+=" if ("+e.util.checkDataType(W.type,S,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(W.type=="object"&&e.schema.properties){var v=e.schema.properties,Q=Object.keys(v),F=Q;if(F)for(var z,K=-1,ae=F.length-1;K<ae;){z=F[K+=1];var H=v[z];if(H.default!==void 0){var de=S+e.util.getProperty(z);if(e.compositeRule){if(e.opts.strictDefaults){var C="default is ignored for: "+de;if(e.opts.strictDefaults==="log")e.logger.warn(C);else throw new Error(C)}}else a+=" if ("+de+" === undefined ",e.opts.useDefaults=="empty"&&(a+=" || "+de+" === null || "+de+" === '' "),a+=" ) "+de+" = ",e.opts.useDefaults=="shared"?a+=" "+e.useDefault(H.default)+" ":a+=" "+JSON.stringify(H.default)+" ",a+="; "}}}else if(W.type=="array"&&Array.isArray(e.schema.items)){var me=e.schema.items;if(me){for(var H,V=-1,xe=me.length-1;V<xe;)if(H=me[V+=1],H.default!==void 0){var de=S+"["+V+"]";if(e.compositeRule){if(e.opts.strictDefaults){var C="default is ignored for: "+de;if(e.opts.strictDefaults==="log")e.logger.warn(C);else throw new Error(C)}}else a+=" if ("+de+" === undefined ",e.opts.useDefaults=="empty"&&(a+=" || "+de+" === null || "+de+" === '' "),a+=" ) "+de+" = ",e.opts.useDefaults=="shared"?a+=" "+e.useDefault(H.default)+" ":a+=" "+JSON.stringify(H.default)+" ",a+="; "}}}}var be=W.rules;if(be){for(var _e,Ae=-1,Fe=be.length-1;Ae<Fe;)if(_e=be[Ae+=1],at(_e)){var Pe=_e.code(e,_e.keyword,W.type);Pe&&(a+=" "+Pe+" ",k&&(A+="}"))}}if(k&&(a+=" "+A+" ",A=""),W.type&&(a+=" } ",L&&L===W.type&&!P)){a+=" else { ";var y=e.schemaPath+".type",w=e.errSchemaPath+"/type",R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(O||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",M?a+=""+L.join(","):a+=""+L,a+="' } ",e.opts.messages!==!1&&(a+=" , message: 'should be ",M?a+=""+L.join(","):a+=""+L,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+y+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+S+" "),a+=" } "):a+=" {} ";var x=a;a=R.pop(),!e.compositeRule&&k?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } "}k&&(a+=" if (errors === ",_?a+="0":a+="errs_"+m,a+=") { ",I+="}")}}}k&&(a+=" "+I+" "),_?(s?(a+=" if (errors === 0) return data; ",a+=" else throw new ValidationError(vErrors); "):(a+=" validate.errors = vErrors; ",a+=" return errors === 0; "),a+=" }; return validate;"):a+=" var "+N+" = errors === errs_"+m+";";function $e(Ce){for(var ze=Ce.rules,we=0;we<ze.length;we++)if(at(ze[we]))return!0}function at(Ce){return e.schema[Ce.keyword]!==void 0||Ce.implements&&ce(Ce)}function ce(Ce){for(var ze=Ce.implements,we=0;we<ze.length;we++)if(e.schema[ze[we]]!==void 0)return!0}return a}),Wv}var Yv,uI;function s8(){if(uI)return Yv;uI=1;var t=aR(),e=pc(),r=oR(),n=P2(),a=j2(),s=e.ucs2length,l=nR(),c=r.Validation;Yv=d;function d(x,_,C,N){var k=this,A=this._opts,I=[void 0],O={},L=[],M={},P=[],W={},X=[];_=_||{schema:x,refVal:I,refs:O};var ee=f.call(this,x,_,N),J=this._compilations[ee.index];if(ee.compiling)return J.callValidate=re;var j=this._formats,G=this.RULES;try{var V=U(x,_,C,N);J.validate=V;var te=J.callValidate;return te&&(te.schema=V.schema,te.errors=null,te.refs=V.refs,te.refVal=V.refVal,te.root=V.root,te.$async=V.$async,A.sourceCode&&(te.source=V.source)),V}finally{m.call(this,x,_,N)}function re(){var H=J.validate,de=H.apply(this,arguments);return re.errors=H.errors,de}function U(H,de,me,xe){var be=!de||de&&de.schema==H;if(de.schema!=_.schema)return d.call(k,H,de,me,xe);var _e=H.$async===!0,Ae=a({isTop:!0,schema:H,isRoot:be,baseId:xe,root:de,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:r.MissingRef,RULES:G,validate:a,util:e,resolve:t,resolveRef:q,usePattern:z,useDefault:K,useCustomRule:ae,opts:A,formats:j,logger:k.logger,self:k});Ae=R(I,w)+R(L,v)+R(P,y)+R(X,S)+Ae,A.processCode&&(Ae=A.processCode(Ae,H));var Fe;try{var Pe=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",Ae);Fe=Pe(k,G,j,_,I,P,X,l,s,c),I[0]=Fe}catch($e){throw k.logger.error("Error compiling schema, function code:",Ae),$e}return Fe.schema=H,Fe.errors=null,Fe.refs=O,Fe.refVal=I,Fe.root=be?Fe:de,_e&&(Fe.$async=!0),A.sourceCode===!0&&(Fe.source={code:Ae,patterns:L,defaults:P}),Fe}function q(H,de,me){de=t.url(H,de);var xe=O[de],be,_e;if(xe!==void 0)return be=I[xe],_e="refVal["+xe+"]",F(be,_e);if(!me&&_.refs){var Ae=_.refs[de];if(Ae!==void 0)return be=_.refVal[Ae],_e=$(de,be),F(be,_e)}_e=$(de);var Fe=t.call(k,U,_,de);if(Fe===void 0){var Pe=C&&C[de];Pe&&(Fe=t.inlineRef(Pe,A.inlineRefs)?Pe:d.call(k,Pe,_,C,H))}if(Fe===void 0)Y(de);else return Q(de,Fe),F(Fe,_e)}function $(H,de){var me=I.length;return I[me]=de,O[H]=me,"refVal"+me}function Y(H){delete O[H]}function Q(H,de){var me=O[H];I[me]=de}function F(H,de){return typeof H=="object"||typeof H=="boolean"?{code:de,schema:H,inline:!0}:{code:de,$async:H&&!!H.$async}}function z(H){var de=M[H];return de===void 0&&(de=M[H]=L.length,L[de]=H),"pattern"+de}function K(H){switch(typeof H){case"boolean":case"number":return""+H;case"string":return e.toQuotedString(H);case"object":if(H===null)return"null";var de=n(H),me=W[de];return me===void 0&&(me=W[de]=P.length,P[me]=H),"default"+me}}function ae(H,de,me,xe){if(k._opts.validateSchema!==!1){var be=H.definition.dependencies;if(be&&!be.every(function(ze){return Object.prototype.hasOwnProperty.call(me,ze)}))throw new Error("parent schema must have all required keywords: "+be.join(","));var _e=H.definition.validateSchema;if(_e){var Ae=_e(de);if(!Ae){var Fe="keyword schema is invalid: "+k.errorsText(_e.errors);if(k._opts.validateSchema=="log")k.logger.error(Fe);else throw new Error(Fe)}}}var Pe=H.definition.compile,$e=H.definition.inline,at=H.definition.macro,ce;if(Pe)ce=Pe.call(k,de,me,xe);else if(at)ce=at.call(k,de,me,xe),A.validateSchema!==!1&&k.validateSchema(ce,!0);else if($e)ce=$e.call(k,xe,H.keyword,de,me);else if(ce=H.definition.validate,!ce)return;if(ce===void 0)throw new Error('custom keyword "'+H.keyword+'"failed to compile');var Ce=X.length;return X[Ce]=ce,{code:"customRule"+Ce,validate:ce}}}function f(x,_,C){var N=h.call(this,x,_,C);return N>=0?{index:N,compiling:!0}:(N=this._compilations.length,this._compilations[N]={schema:x,root:_,baseId:C},{index:N,compiling:!1})}function m(x,_,C){var N=h.call(this,x,_,C);N>=0&&this._compilations.splice(N,1)}function h(x,_,C){for(var N=0;N<this._compilations.length;N++){var k=this._compilations[N];if(k.schema==x&&k.root==_&&k.baseId==C)return N}return-1}function v(x,_){return"var pattern"+x+" = new RegExp("+e.toQuotedString(_[x])+");"}function y(x){return"var default"+x+" = defaults["+x+"];"}function w(x,_){return _[x]===void 0?"":"var refVal"+x+" = refVal["+x+"];"}function S(x){return"var customRule"+x+" = customRules["+x+"];"}function R(x,_){if(!x.length)return"";for(var C="",N=0;N<x.length;N++)C+=_(N,x);return C}return Yv}var Kv={exports:{}},dI;function l8(){if(dI)return Kv.exports;dI=1;var t=Kv.exports=function(){this._cache={}};return t.prototype.put=function(r,n){this._cache[r]=n},t.prototype.get=function(r){return this._cache[r]},t.prototype.del=function(r){delete this._cache[r]},t.prototype.clear=function(){this._cache={}},Kv.exports}var Zv,fI;function c8(){if(fI)return Zv;fI=1;var t=pc(),e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,r=[0,31,28,31,30,31,30,31,31,30,31,30,31],n=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,a=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,s=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,l=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,c=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,d=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,m=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,v=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Zv=y;function y(I){return I=I=="full"?"full":"fast",t.copy(y[I])}y.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:d,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:A,uuid:f,"json-pointer":m,"json-pointer-uri-fragment":h,"relative-json-pointer":v},y.full={date:S,time:R,"date-time":_,uri:N,"uri-reference":l,"uri-template":c,url:d,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:A,uuid:f,"json-pointer":m,"json-pointer-uri-fragment":h,"relative-json-pointer":v};function w(I){return I%4===0&&(I%100!==0||I%400===0)}function S(I){var O=I.match(e);if(!O)return!1;var L=+O[1],M=+O[2],P=+O[3];return M>=1&&M<=12&&P>=1&&P<=(M==2&&w(L)?29:r[M])}function R(I,O){var L=I.match(n);if(!L)return!1;var M=L[1],P=L[2],W=L[3],X=L[5];return(M<=23&&P<=59&&W<=59||M==23&&P==59&&W==60)&&(!O||X)}var x=/t|\s/i;function _(I){var O=I.split(x);return O.length==2&&S(O[0])&&R(O[1],!0)}var C=/\/|:/;function N(I){return C.test(I)&&s.test(I)}var k=/[^\\]\\Z/;function A(I){if(k.test(I))return!1;try{return new RegExp(I),!0}catch{return!1}}return Zv}var Xv,pI;function u8(){return pI||(pI=1,Xv=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,m="data"+(l||""),h="valid"+s,v,y;if(c=="#"||c=="#/")e.isRoot?(v=e.async,y="validate"):(v=e.root.schema.$async===!0,y="root.refVal[0]");else{var w=e.resolveRef(e.baseId,c,e.isRoot);if(w===void 0){var S=e.MissingRefError.message(e.baseId,c);if(e.opts.missingRefs=="fail"){e.logger.error(S);var R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",e.opts.messages!==!1&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),a+=" } "):a+=" {} ";var x=a;a=R.pop(),!e.compositeRule&&f?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f&&(a+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(S),f&&(a+=" if (true) { ");else throw new e.MissingRefError(e.baseId,c,S)}else if(w.inline){var _=e.util.copy(e);_.level++;var C="valid"+_.level;_.schema=w.schema,_.schemaPath="",_.errSchemaPath=c;var N=e.validate(_).replace(/validate\.schema/g,w.code);a+=" "+N+" ",f&&(a+=" if ("+C+") { ")}else v=w.$async===!0||e.async&&w.$async!==!1,y=w.code}if(y){var R=R||[];R.push(a),a="",e.opts.passContext?a+=" "+y+".call(this, ":a+=" "+y+"( ",a+=" "+m+", (dataPath || '')",e.errorPath!='""'&&(a+=" + "+e.errorPath);var k=l?"data"+(l-1||""):"parentData",A=l?e.dataPathArr[l]:"parentDataProperty";a+=" , "+k+" , "+A+", rootData) ";var I=a;if(a=R.pop(),v){if(!e.async)throw new Error("async schema referenced by sync schema");f&&(a+=" var "+h+"; "),a+=" try { await "+I+"; ",f&&(a+=" "+h+" = true; "),a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",f&&(a+=" "+h+" = false; "),a+=" } ",f&&(a+=" if ("+h+") { ")}else a+=" if (!"+I+") { if (vErrors === null) vErrors = "+y+".errors; else vErrors = vErrors.concat("+y+".errors); errors = vErrors.length; } ",f&&(a+=" else { ")}return a}),Xv}var Qv,mI;function d8(){return mI||(mI=1,Qv=function(e,r,n){var a=" ",s=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f=e.util.copy(e),m="";f.level++;var h="valid"+f.level,v=f.baseId,y=!0,w=s;if(w)for(var S,R=-1,x=w.length-1;R<x;)S=w[R+=1],(e.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===!1:e.util.schemaHasRules(S,e.RULES.all))&&(y=!1,f.schema=S,f.schemaPath=l+"["+R+"]",f.errSchemaPath=c+"/"+R,a+=" "+e.validate(f)+" ",f.baseId=v,d&&(a+=" if ("+h+") { ",m+="}"));return d&&(y?a+=" if (true) { ":a+=" "+m.slice(0,-1)+" "),a}),Qv}var Jv,hI;function f8(){return hI||(hI=1,Jv=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y="errs__"+s,w=e.util.copy(e),S="";w.level++;var R="valid"+w.level,x=c.every(function(O){return e.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:e.util.schemaHasRules(O,e.RULES.all)});if(x){var _=w.baseId;a+=" var "+y+" = errors; var "+v+" = false; ";var C=e.compositeRule;e.compositeRule=w.compositeRule=!0;var N=c;if(N)for(var k,A=-1,I=N.length-1;A<I;)k=N[A+=1],w.schema=k,w.schemaPath=d+"["+A+"]",w.errSchemaPath=f+"/"+A,a+=" "+e.validate(w)+" ",w.baseId=_,a+=" "+v+" = "+v+" || "+R+"; if (!"+v+") { ",S+="}";e.compositeRule=w.compositeRule=C,a+=" "+S+" if (!"+v+") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } else { errors = "+y+"; if (vErrors !== null) { if ("+y+") vErrors.length = "+y+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else m&&(a+=" if (true) { ");return a}),Jv}var eb,gI;function p8(){return gI||(gI=1,eb=function(e,r,n){var a=" ",s=e.schema[r],l=e.errSchemaPath+"/"+r;e.opts.allErrors;var c=e.util.toQuotedString(s);return e.opts.$comment===!0?a+=" console.log("+c+");":typeof e.opts.$comment=="function"&&(a+=" self._opts.$comment("+c+", "+e.util.toQuotedString(l)+", validate.root.schema);"),a}),eb}var tb,vI;function m8(){return vI||(vI=1,tb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y=e.opts.$data&&c&&c.$data;y&&(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; "),y||(a+=" var schema"+s+" = validate.schema"+d+";"),a+="var "+v+" = equal("+h+", schema"+s+"); if (!"+v+") { ";var w=w||[];w.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { allowedValue: schema"+s+" } ",e.opts.messages!==!1&&(a+=" , message: 'should be equal to constant' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var S=a;return a=w.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+S+"]); ":a+=" validate.errors = ["+S+"]; return false; ":a+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",m&&(a+=" else { "),a}),tb}var rb,bI;function h8(){return bI||(bI=1,rb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y="errs__"+s,w=e.util.copy(e),S="";w.level++;var R="valid"+w.level,x="i"+s,_=w.dataLevel=e.dataLevel+1,C="data"+_,N=e.baseId,k=e.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:e.util.schemaHasRules(c,e.RULES.all);if(a+="var "+y+" = errors;var "+v+";",k){var A=e.compositeRule;e.compositeRule=w.compositeRule=!0,w.schema=c,w.schemaPath=d,w.errSchemaPath=f,a+=" var "+R+" = false; for (var "+x+" = 0; "+x+" < "+h+".length; "+x+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var I=h+"["+x+"]";w.dataPathArr[_]=x;var O=e.validate(w);w.baseId=N,e.util.varOccurences(O,C)<2?a+=" "+e.util.varReplace(O,C,I)+" ":a+=" var "+C+" = "+I+"; "+O+" ",a+=" if ("+R+") break; } ",e.compositeRule=w.compositeRule=A,a+=" "+S+" if (!"+R+") {"}else a+=" if ("+h+".length == 0) {";var L=L||[];L.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var M=a;return a=L.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+M+"]); ":a+=" validate.errors = ["+M+"]; return false; ":a+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",k&&(a+=" errors = "+y+"; if (vErrors !== null) { if ("+y+") vErrors.length = "+y+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a}),rb}var nb,yI;function g8(){return yI||(yI=1,nb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="errs__"+s,y=e.util.copy(e),w="";y.level++;var S="valid"+y.level,R={},x={},_=e.opts.ownProperties;for(A in c)if(A!="__proto__"){var C=c[A],N=Array.isArray(C)?x:R;N[A]=C}a+="var "+v+" = errors;";var k=e.errorPath;a+="var missing"+s+";";for(var A in x)if(N=x[A],N.length){if(a+=" if ( "+h+e.util.getProperty(A)+" !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(A)+"') "),m){a+=" && ( ";var I=N;if(I)for(var O,L=-1,M=I.length-1;L<M;){O=I[L+=1],L&&(a+=" || ");var P=e.util.getProperty(O),W=h+P;a+=" ( ( "+W+" === undefined ",_&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(O)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?O:P)+") ) "}a+=")) { ";var X="missing"+s,ee="' + "+X+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(k,X,!0):k+" + "+X);var J=J||[];J.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { property: '"+e.util.escapeQuotes(A)+"', missingProperty: '"+ee+"', depsCount: "+N.length+", deps: '"+e.util.escapeQuotes(N.length==1?N[0]:N.join(", "))+"' } ",e.opts.messages!==!1&&(a+=" , message: 'should have ",N.length==1?a+="property "+e.util.escapeQuotes(N[0]):a+="properties "+e.util.escapeQuotes(N.join(", ")),a+=" when property "+e.util.escapeQuotes(A)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var j=a;a=J.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+j+"]); ":a+=" validate.errors = ["+j+"]; return false; ":a+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{a+=" ) { ";var G=N;if(G)for(var O,V=-1,te=G.length-1;V<te;){O=G[V+=1];var P=e.util.getProperty(O),ee=e.util.escapeQuotes(O),W=h+P;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(k,O,e.opts.jsonPointers)),a+=" if ( "+W+" === undefined ",_&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(O)+"') "),a+=") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { property: '"+e.util.escapeQuotes(A)+"', missingProperty: '"+ee+"', depsCount: "+N.length+", deps: '"+e.util.escapeQuotes(N.length==1?N[0]:N.join(", "))+"' } ",e.opts.messages!==!1&&(a+=" , message: 'should have ",N.length==1?a+="property "+e.util.escapeQuotes(N[0]):a+="properties "+e.util.escapeQuotes(N.join(", ")),a+=" when property "+e.util.escapeQuotes(A)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}a+=" } ",m&&(w+="}",a+=" else { ")}e.errorPath=k;var re=y.baseId;for(var A in R){var C=R[A];(e.opts.strictKeywords?typeof C=="object"&&Object.keys(C).length>0||C===!1:e.util.schemaHasRules(C,e.RULES.all))&&(a+=" "+S+" = true; if ( "+h+e.util.getProperty(A)+" !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(A)+"') "),a+=") { ",y.schema=C,y.schemaPath=d+e.util.getProperty(A),y.errSchemaPath=f+"/"+e.util.escapeFragment(A),a+=" "+e.validate(y)+" ",y.baseId=re,a+=" } ",m&&(a+=" if ("+S+") { ",w+="}"))}return m&&(a+=" "+w+" if ("+v+" == errors) {"),a}),nb}var ab,EI;function v8(){return EI||(EI=1,ab=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y=e.opts.$data&&c&&c.$data;y&&(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ");var w="i"+s,S="schema"+s;y||(a+=" var "+S+" = validate.schema"+d+";"),a+="var "+v+";",y&&(a+=" if (schema"+s+" === undefined) "+v+" = true; else if (!Array.isArray(schema"+s+")) "+v+" = false; else {"),a+=""+v+" = false;for (var "+w+"=0; "+w+"<"+S+".length; "+w+"++) if (equal("+h+", "+S+"["+w+"])) { "+v+" = true; break; }",y&&(a+=" } "),a+=" if (!"+v+") { ";var R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { allowedValues: schema"+s+" } ",e.opts.messages!==!1&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var x=a;return a=R.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",m&&(a+=" else { "),a}),ab}var ob,SI;function b8(){return SI||(SI=1,ob=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||"");if(e.opts.format===!1)return m&&(a+=" if (true) { "),a;var v=e.opts.$data&&c&&c.$data,y;v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c;var w=e.opts.unknownFormats,S=Array.isArray(w);if(v){var R="format"+s,x="isObject"+s,_="formatType"+s;a+=" var "+R+" = formats["+y+"]; var "+x+" = typeof "+R+" == 'object' && !("+R+" instanceof RegExp) && "+R+".validate; var "+_+" = "+x+" && "+R+".type || 'string'; if ("+x+") { ",e.async&&(a+=" var async"+s+" = "+R+".async; "),a+=" "+R+" = "+R+".validate; } if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'string') || "),a+=" (",w!="ignore"&&(a+=" ("+y+" && !"+R+" ",S&&(a+=" && self._opts.unknownFormats.indexOf("+y+") == -1 "),a+=") || "),a+=" ("+R+" && "+_+" == '"+n+"' && !(typeof "+R+" == 'function' ? ",e.async?a+=" (async"+s+" ? await "+R+"("+h+") : "+R+"("+h+")) ":a+=" "+R+"("+h+") ",a+=" : "+R+".test("+h+"))))) {"}else{var R=e.formats[c];if(!R){if(w=="ignore")return e.logger.warn('unknown format "'+c+'" ignored in schema at path "'+e.errSchemaPath+'"'),m&&(a+=" if (true) { "),a;if(S&&w.indexOf(c)>=0)return m&&(a+=" if (true) { "),a;throw new Error('unknown format "'+c+'" is used in schema at path "'+e.errSchemaPath+'"')}var x=typeof R=="object"&&!(R instanceof RegExp)&&R.validate,_=x&&R.type||"string";if(x){var C=R.async===!0;R=R.validate}if(_!=n)return m&&(a+=" if (true) { "),a;if(C){if(!e.async)throw new Error("async format in sync schema");var N="formats"+e.util.getProperty(c)+".validate";a+=" if (!(await "+N+"("+h+"))) { "}else{a+=" if (! ";var N="formats"+e.util.getProperty(c);x&&(N+=".validate"),typeof R=="function"?a+=" "+N+"("+h+") ":a+=" "+N+".test("+h+") ",a+=") { "}}var k=k||[];k.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { format: ",v?a+=""+y:a+=""+e.util.toQuotedString(c),a+=" } ",e.opts.messages!==!1&&(a+=` , message: 'should match format "`,v?a+="' + "+y+" + '":a+=""+e.util.escapeQuotes(c),a+=`"' `),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+e.util.toQuotedString(c),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var A=a;return a=k.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+A+"]); ":a+=" validate.errors = ["+A+"]; return false; ":a+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",m&&(a+=" else { "),a}),ob}var ib,xI;function y8(){return xI||(xI=1,ib=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y="errs__"+s,w=e.util.copy(e);w.level++;var S="valid"+w.level,R=e.schema.then,x=e.schema.else,_=R!==void 0&&(e.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:e.util.schemaHasRules(R,e.RULES.all)),C=x!==void 0&&(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all)),N=w.baseId;if(_||C){var k;w.createErrors=!1,w.schema=c,w.schemaPath=d,w.errSchemaPath=f,a+=" var "+y+" = errors; var "+v+" = true; ";var A=e.compositeRule;e.compositeRule=w.compositeRule=!0,a+=" "+e.validate(w)+" ",w.baseId=N,w.createErrors=!0,a+=" errors = "+y+"; if (vErrors !== null) { if ("+y+") vErrors.length = "+y+"; else vErrors = null; } ",e.compositeRule=w.compositeRule=A,_?(a+=" if ("+S+") { ",w.schema=e.schema.then,w.schemaPath=e.schemaPath+".then",w.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(w)+" ",w.baseId=N,a+=" "+v+" = "+S+"; ",_&&C?(k="ifClause"+s,a+=" var "+k+" = 'then'; "):k="'then'",a+=" } ",C&&(a+=" else { ")):a+=" if (!"+S+") { ",C&&(w.schema=e.schema.else,w.schemaPath=e.schemaPath+".else",w.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(w)+" ",w.baseId=N,a+=" "+v+" = "+S+"; ",_&&C?(k="ifClause"+s,a+=" var "+k+" = 'else'; "):k="'else'",a+=" } "),a+=" if (!"+v+") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { failingKeyword: "+k+" } ",e.opts.messages!==!1&&(a+=` , message: 'should match "' + `+k+` + '" schema' `),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",m&&(a+=" else { ")}else m&&(a+=" if (true) { ");return a}),ib}var sb,wI;function E8(){return wI||(wI=1,sb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y="errs__"+s,w=e.util.copy(e),S="";w.level++;var R="valid"+w.level,x="i"+s,_=w.dataLevel=e.dataLevel+1,C="data"+_,N=e.baseId;if(a+="var "+y+" = errors;var "+v+";",Array.isArray(c)){var k=e.schema.additionalItems;if(k===!1){a+=" "+v+" = "+h+".length <= "+c.length+"; ";var A=f;f=e.errSchemaPath+"/additionalItems",a+=" if (!"+v+") { ";var I=I||[];I.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+c.length+" } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT have more than "+c.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var O=a;a=I.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+O+"]); ":a+=" validate.errors = ["+O+"]; return false; ":a+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",f=A,m&&(S+="}",a+=" else { ")}var L=c;if(L){for(var M,P=-1,W=L.length-1;P<W;)if(M=L[P+=1],e.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:e.util.schemaHasRules(M,e.RULES.all)){a+=" "+R+" = true; if ("+h+".length > "+P+") { ";var X=h+"["+P+"]";w.schema=M,w.schemaPath=d+"["+P+"]",w.errSchemaPath=f+"/"+P,w.errorPath=e.util.getPathExpr(e.errorPath,P,e.opts.jsonPointers,!0),w.dataPathArr[_]=P;var ee=e.validate(w);w.baseId=N,e.util.varOccurences(ee,C)<2?a+=" "+e.util.varReplace(ee,C,X)+" ":a+=" var "+C+" = "+X+"; "+ee+" ",a+=" } ",m&&(a+=" if ("+R+") { ",S+="}")}}if(typeof k=="object"&&(e.opts.strictKeywords?typeof k=="object"&&Object.keys(k).length>0||k===!1:e.util.schemaHasRules(k,e.RULES.all))){w.schema=k,w.schemaPath=e.schemaPath+".additionalItems",w.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+R+" = true; if ("+h+".length > "+c.length+") { for (var "+x+" = "+c.length+"; "+x+" < "+h+".length; "+x+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var X=h+"["+x+"]";w.dataPathArr[_]=x;var ee=e.validate(w);w.baseId=N,e.util.varOccurences(ee,C)<2?a+=" "+e.util.varReplace(ee,C,X)+" ":a+=" var "+C+" = "+X+"; "+ee+" ",m&&(a+=" if (!"+R+") break; "),a+=" } } ",m&&(a+=" if ("+R+") { ",S+="}")}}else if(e.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:e.util.schemaHasRules(c,e.RULES.all)){w.schema=c,w.schemaPath=d,w.errSchemaPath=f,a+=" for (var "+x+" = 0; "+x+" < "+h+".length; "+x+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var X=h+"["+x+"]";w.dataPathArr[_]=x;var ee=e.validate(w);w.baseId=N,e.util.varOccurences(ee,C)<2?a+=" "+e.util.varReplace(ee,C,X)+" ":a+=" var "+C+" = "+X+"; "+ee+" ",m&&(a+=" if (!"+R+") break; "),a+=" }"}return m&&(a+=" "+S+" if ("+y+" == errors) {"),a}),sb}var lb,_I;function TI(){return _I||(_I=1,lb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,N,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c;var w=r=="maximum",S=w?"exclusiveMaximum":"exclusiveMinimum",R=e.schema[S],x=e.opts.$data&&R&&R.$data,_=w?"<":">",C=w?">":"<",N=void 0;if(!(v||typeof c=="number"||c===void 0))throw new Error(r+" must be number");if(!(x||R===void 0||typeof R=="number"||typeof R=="boolean"))throw new Error(S+" must be number or boolean");if(x){var k=e.util.getData(R.$data,l,e.dataPathArr),A="exclusive"+s,I="exclType"+s,O="exclIsNumber"+s,L="op"+s,M="' + "+L+" + '";a+=" var schemaExcl"+s+" = "+k+"; ",k="schemaExcl"+s,a+=" var "+A+"; var "+I+" = typeof "+k+"; if ("+I+" != 'boolean' && "+I+" != 'undefined' && "+I+" != 'number') { ";var N=S,P=P||[];P.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(N||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: '"+S+" should be boolean' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var W=a;a=P.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+W+"]); ":a+=" validate.errors = ["+W+"]; return false; ":a+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),a+=" "+I+" == 'number' ? ( ("+A+" = "+y+" === undefined || "+k+" "+_+"= "+y+") ? "+h+" "+C+"= "+k+" : "+h+" "+C+" "+y+" ) : ( ("+A+" = "+k+" === true) ? "+h+" "+C+"= "+y+" : "+h+" "+C+" "+y+" ) || "+h+" !== "+h+") { var op"+s+" = "+A+" ? '"+_+"' : '"+_+"='; ",c===void 0&&(N=S,f=e.errSchemaPath+"/"+S,y=k,v=x)}else{var O=typeof R=="number",M=_;if(O&&v){var L="'"+M+"'";a+=" if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),a+=" ( "+y+" === undefined || "+R+" "+_+"= "+y+" ? "+h+" "+C+"= "+R+" : "+h+" "+C+" "+y+" ) || "+h+" !== "+h+") { "}else{O&&c===void 0?(A=!0,N=S,f=e.errSchemaPath+"/"+S,y=R,C+="="):(O&&(y=Math[w?"min":"max"](R,c)),R===(O?y:!0)?(A=!0,N=S,f=e.errSchemaPath+"/"+S,C+="="):(A=!1,M+="="));var L="'"+M+"'";a+=" if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),a+=" "+h+" "+C+" "+y+" || "+h+" !== "+h+") { "}}N=N||r;var P=P||[];P.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(N||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { comparison: "+L+", limit: "+y+", exclusive: "+A+" } ",e.opts.messages!==!1&&(a+=" , message: 'should be "+M+" ",v?a+="' + "+y:a+=""+y+"'"),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var W=a;return a=P.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+W+"]); ":a+=" validate.errors = ["+W+"]; return false; ":a+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",m&&(a+=" else { "),a}),lb}var cb,RI;function CI(){return RI||(RI=1,cb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,S,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;if(v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c,!(v||typeof c=="number"))throw new Error(r+" must be number");var w=r=="maxItems"?">":"<";a+="if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),a+=" "+h+".length "+w+" "+y+") { ";var S=r,R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(S||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+y+" } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT have ",r=="maxItems"?a+="more":a+="fewer",a+=" than ",v?a+="' + "+y+" + '":a+=""+c,a+=" items' "),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var x=a;return a=R.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",m&&(a+=" else { "),a}),cb}var ub,AI;function NI(){return AI||(AI=1,ub=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,S,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;if(v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c,!(v||typeof c=="number"))throw new Error(r+" must be number");var w=r=="maxLength"?">":"<";a+="if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),e.opts.unicode===!1?a+=" "+h+".length ":a+=" ucs2length("+h+") ",a+=" "+w+" "+y+") { ";var S=r,R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(S||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+y+" } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT be ",r=="maxLength"?a+="longer":a+="shorter",a+=" than ",v?a+="' + "+y+" + '":a+=""+c,a+=" characters' "),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var x=a;return a=R.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",m&&(a+=" else { "),a}),ub}var db,kI;function II(){return kI||(kI=1,db=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,S,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;if(v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c,!(v||typeof c=="number"))throw new Error(r+" must be number");var w=r=="maxProperties"?">":"<";a+="if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),a+=" Object.keys("+h+").length "+w+" "+y+") { ";var S=r,R=R||[];R.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(S||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+y+" } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT have ",r=="maxProperties"?a+="more":a+="fewer",a+=" than ",v?a+="' + "+y+" + '":a+=""+c,a+=" properties' "),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var x=a;return a=R.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",m&&(a+=" else { "),a}),db}var fb,OI;function S8(){return OI||(OI=1,fb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;if(v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c,!(v||typeof c=="number"))throw new Error(r+" must be number");a+="var division"+s+";if (",v&&(a+=" "+y+" !== undefined && ( typeof "+y+" != 'number' || "),a+=" (division"+s+" = "+h+" / "+y+", ",e.opts.multipleOfPrecision?a+=" Math.abs(Math.round(division"+s+") - division"+s+") > 1e-"+e.opts.multipleOfPrecision+" ":a+=" division"+s+" !== parseInt(division"+s+") ",a+=" ) ",v&&(a+=" ) "),a+=" ) { ";var w=w||[];w.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { multipleOf: "+y+" } ",e.opts.messages!==!1&&(a+=" , message: 'should be multiple of ",v?a+="' + "+y:a+=""+y+"'"),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var S=a;return a=w.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+S+"]); ":a+=" validate.errors = ["+S+"]; return false; ":a+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",m&&(a+=" else { "),a}),fb}var pb,DI;function x8(){return DI||(DI=1,pb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="errs__"+s,y=e.util.copy(e);y.level++;var w="valid"+y.level;if(e.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:e.util.schemaHasRules(c,e.RULES.all)){y.schema=c,y.schemaPath=d,y.errSchemaPath=f,a+=" var "+v+" = errors; ";var S=e.compositeRule;e.compositeRule=y.compositeRule=!0,y.createErrors=!1;var R;y.opts.allErrors&&(R=y.opts.allErrors,y.opts.allErrors=!1),a+=" "+e.validate(y)+" ",y.createErrors=!0,R&&(y.opts.allErrors=R),e.compositeRule=y.compositeRule=S,a+=" if ("+w+") { ";var x=x||[];x.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var _=a;a=x.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+_+"]); ":a+=" validate.errors = ["+_+"]; return false; ":a+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",e.createErrors!==!1?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",m&&(a+=" if (false) { ");return a}),pb}var mb,LI;function w8(){return LI||(LI=1,mb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y="errs__"+s,w=e.util.copy(e),S="";w.level++;var R="valid"+w.level,x=w.baseId,_="prevValid"+s,C="passingSchemas"+s;a+="var "+y+" = errors , "+_+" = false , "+v+" = false , "+C+" = null; ";var N=e.compositeRule;e.compositeRule=w.compositeRule=!0;var k=c;if(k)for(var A,I=-1,O=k.length-1;I<O;)A=k[I+=1],(e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all))?(w.schema=A,w.schemaPath=d+"["+I+"]",w.errSchemaPath=f+"/"+I,a+=" "+e.validate(w)+" ",w.baseId=x):a+=" var "+R+" = true; ",I&&(a+=" if ("+R+" && "+_+") { "+v+" = false; "+C+" = ["+C+", "+I+"]; } else { ",S+="}"),a+=" if ("+R+") { "+v+" = "+_+" = true; "+C+" = "+I+"; }";return e.compositeRule=w.compositeRule=N,a+=""+S+"if (!"+v+") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { passingSchemas: "+C+" } ",e.opts.messages!==!1&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+y+"; if (vErrors !== null) { if ("+y+") vErrors.length = "+y+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}),mb}var hb,MI;function _8(){return MI||(MI=1,hb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v=e.opts.$data&&c&&c.$data,y;v?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",y="schema"+s):y=c;var w=v?"(new RegExp("+y+"))":e.usePattern(c);a+="if ( ",v&&(a+=" ("+y+" !== undefined && typeof "+y+" != 'string') || "),a+=" !"+w+".test("+h+") ) { ";var S=S||[];S.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { pattern: ",v?a+=""+y:a+=""+e.util.toQuotedString(c),a+=" } ",e.opts.messages!==!1&&(a+=` , message: 'should match pattern "`,v?a+="' + "+y+" + '":a+=""+e.util.escapeQuotes(c),a+=`"' `),e.opts.verbose&&(a+=" , schema: ",v?a+="validate.schema"+d:a+=""+e.util.toQuotedString(c),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var R=a;return a=S.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+R+"]); ":a+=" validate.errors = ["+R+"]; return false; ":a+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",m&&(a+=" else { "),a}),hb}var gb,PI;function T8(){return PI||(PI=1,gb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="errs__"+s,y=e.util.copy(e),w="";y.level++;var S="valid"+y.level,R="key"+s,x="idx"+s,_=y.dataLevel=e.dataLevel+1,C="data"+_,N="dataProperties"+s,k=Object.keys(c||{}).filter(V),A=e.schema.patternProperties||{},I=Object.keys(A).filter(V),O=e.schema.additionalProperties,L=k.length||I.length,M=O===!1,P=typeof O=="object"&&Object.keys(O).length,W=e.opts.removeAdditional,X=M||P||W,ee=e.opts.ownProperties,J=e.baseId,j=e.schema.required;if(j&&!(e.opts.$data&&j.$data)&&j.length<e.opts.loopRequired)var G=e.util.toHash(j);function V(Je){return Je!=="__proto__"}if(a+="var "+v+" = errors;var "+S+" = true;",ee&&(a+=" var "+N+" = undefined;"),X){if(ee?a+=" "+N+" = "+N+" || Object.keys("+h+"); for (var "+x+"=0; "+x+"<"+N+".length; "+x+"++) { var "+R+" = "+N+"["+x+"]; ":a+=" for (var "+R+" in "+h+") { ",L){if(a+=" var isAdditional"+s+" = !(false ",k.length)if(k.length>8)a+=" || validate.schema"+d+".hasOwnProperty("+R+") ";else{var te=k;if(te)for(var re,U=-1,q=te.length-1;U<q;)re=te[U+=1],a+=" || "+R+" == "+e.util.toQuotedString(re)+" "}if(I.length){var $=I;if($)for(var Y,Q=-1,F=$.length-1;Q<F;)Y=$[Q+=1],a+=" || "+e.usePattern(Y)+".test("+R+") "}a+=" ); if (isAdditional"+s+") { "}if(W=="all")a+=" delete "+h+"["+R+"]; ";else{var z=e.errorPath,K="' + "+R+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,R,e.opts.jsonPointers)),M)if(W)a+=" delete "+h+"["+R+"]; ";else{a+=" "+S+" = false; ";var ae=f;f=e.errSchemaPath+"/additionalProperties";var H=H||[];H.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { additionalProperty: '"+K+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is an invalid additional property":a+="should NOT have additional properties",a+="' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var de=a;a=H.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+de+"]); ":a+=" validate.errors = ["+de+"]; return false; ":a+=" var err = "+de+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f=ae,m&&(a+=" break; ")}else if(P)if(W=="failing"){a+=" var "+v+" = errors; ";var me=e.compositeRule;e.compositeRule=y.compositeRule=!0,y.schema=O,y.schemaPath=e.schemaPath+".additionalProperties",y.errSchemaPath=e.errSchemaPath+"/additionalProperties",y.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,R,e.opts.jsonPointers);var xe=h+"["+R+"]";y.dataPathArr[_]=R;var be=e.validate(y);y.baseId=J,e.util.varOccurences(be,C)<2?a+=" "+e.util.varReplace(be,C,xe)+" ":a+=" var "+C+" = "+xe+"; "+be+" ",a+=" if (!"+S+") { errors = "+v+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+h+"["+R+"]; } ",e.compositeRule=y.compositeRule=me}else{y.schema=O,y.schemaPath=e.schemaPath+".additionalProperties",y.errSchemaPath=e.errSchemaPath+"/additionalProperties",y.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,R,e.opts.jsonPointers);var xe=h+"["+R+"]";y.dataPathArr[_]=R;var be=e.validate(y);y.baseId=J,e.util.varOccurences(be,C)<2?a+=" "+e.util.varReplace(be,C,xe)+" ":a+=" var "+C+" = "+xe+"; "+be+" ",m&&(a+=" if (!"+S+") break; ")}e.errorPath=z}L&&(a+=" } "),a+=" } ",m&&(a+=" if ("+S+") { ",w+="}")}var _e=e.opts.useDefaults&&!e.compositeRule;if(k.length){var Ae=k;if(Ae)for(var re,Fe=-1,Pe=Ae.length-1;Fe<Pe;){re=Ae[Fe+=1];var $e=c[re];if(e.opts.strictKeywords?typeof $e=="object"&&Object.keys($e).length>0||$e===!1:e.util.schemaHasRules($e,e.RULES.all)){var at=e.util.getProperty(re),xe=h+at,ce=_e&&$e.default!==void 0;y.schema=$e,y.schemaPath=d+at,y.errSchemaPath=f+"/"+e.util.escapeFragment(re),y.errorPath=e.util.getPath(e.errorPath,re,e.opts.jsonPointers),y.dataPathArr[_]=e.util.toQuotedString(re);var be=e.validate(y);if(y.baseId=J,e.util.varOccurences(be,C)<2){be=e.util.varReplace(be,C,xe);var Ce=xe}else{var Ce=C;a+=" var "+C+" = "+xe+"; "}if(ce)a+=" "+be+" ";else{if(G&&G[re]){a+=" if ( "+Ce+" === undefined ",ee&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(re)+"') "),a+=") { "+S+" = false; ";var z=e.errorPath,ae=f,ze=e.util.escapeQuotes(re);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(z,re,e.opts.jsonPointers)),f=e.errSchemaPath+"/required";var H=H||[];H.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+ze+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+ze+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var de=a;a=H.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+de+"]); ":a+=" validate.errors = ["+de+"]; return false; ":a+=" var err = "+de+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f=ae,e.errorPath=z,a+=" } else { "}else m?(a+=" if ( "+Ce+" === undefined ",ee&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(re)+"') "),a+=") { "+S+" = true; } else { "):(a+=" if ("+Ce+" !== undefined ",ee&&(a+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(re)+"') "),a+=" ) { ");a+=" "+be+" } "}}m&&(a+=" if ("+S+") { ",w+="}")}}if(I.length){var we=I;if(we)for(var Y,Ne=-1,Oe=we.length-1;Ne<Oe;){Y=we[Ne+=1];var $e=A[Y];if(e.opts.strictKeywords?typeof $e=="object"&&Object.keys($e).length>0||$e===!1:e.util.schemaHasRules($e,e.RULES.all)){y.schema=$e,y.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(Y),y.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(Y),ee?a+=" "+N+" = "+N+" || Object.keys("+h+"); for (var "+x+"=0; "+x+"<"+N+".length; "+x+"++) { var "+R+" = "+N+"["+x+"]; ":a+=" for (var "+R+" in "+h+") { ",a+=" if ("+e.usePattern(Y)+".test("+R+")) { ",y.errorPath=e.util.getPathExpr(e.errorPath,R,e.opts.jsonPointers);var xe=h+"["+R+"]";y.dataPathArr[_]=R;var be=e.validate(y);y.baseId=J,e.util.varOccurences(be,C)<2?a+=" "+e.util.varReplace(be,C,xe)+" ":a+=" var "+C+" = "+xe+"; "+be+" ",m&&(a+=" if (!"+S+") break; "),a+=" } ",m&&(a+=" else "+S+" = true; "),a+=" } ",m&&(a+=" if ("+S+") { ",w+="}")}}}return m&&(a+=" "+w+" if ("+v+" == errors) {"),a}),gb}var vb,jI;function R8(){return jI||(jI=1,vb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="errs__"+s,y=e.util.copy(e),w="";y.level++;var S="valid"+y.level;if(a+="var "+v+" = errors;",e.opts.strictKeywords?typeof c=="object"&&Object.keys(c).length>0||c===!1:e.util.schemaHasRules(c,e.RULES.all)){y.schema=c,y.schemaPath=d,y.errSchemaPath=f;var R="key"+s,x="idx"+s,_="i"+s,C="' + "+R+" + '",N=y.dataLevel=e.dataLevel+1,k="data"+N,A="dataProperties"+s,I=e.opts.ownProperties,O=e.baseId;I&&(a+=" var "+A+" = undefined; "),I?a+=" "+A+" = "+A+" || Object.keys("+h+"); for (var "+x+"=0; "+x+"<"+A+".length; "+x+"++) { var "+R+" = "+A+"["+x+"]; ":a+=" for (var "+R+" in "+h+") { ",a+=" var startErrs"+s+" = errors; ";var L=R,M=e.compositeRule;e.compositeRule=y.compositeRule=!0;var P=e.validate(y);y.baseId=O,e.util.varOccurences(P,k)<2?a+=" "+e.util.varReplace(P,k,L)+" ":a+=" var "+k+" = "+L+"; "+P+" ",e.compositeRule=y.compositeRule=M,a+=" if (!"+S+") { for (var "+_+"=startErrs"+s+"; "+_+"<errors; "+_+"++) { vErrors["+_+"].propertyName = "+R+"; } var err = ",e.createErrors!==!1?(a+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { propertyName: '"+C+"' } ",e.opts.messages!==!1&&(a+=" , message: 'property name \\'"+C+"\\' is invalid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),m&&(a+=" break; "),a+=" } }"}return m&&(a+=" "+w+" if ("+v+" == errors) {"),a}),vb}var bb,UI;function C8(){return UI||(UI=1,bb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y=e.opts.$data&&c&&c.$data;y&&(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ");var w="schema"+s;if(!y)if(c.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var S=[],R=c;if(R)for(var x,_=-1,C=R.length-1;_<C;){x=R[_+=1];var N=e.schema.properties[x];N&&(e.opts.strictKeywords?typeof N=="object"&&Object.keys(N).length>0||N===!1:e.util.schemaHasRules(N,e.RULES.all))||(S[S.length]=x)}}else var S=c;if(y||S.length){var k=e.errorPath,A=y||S.length>=e.opts.loopRequired,I=e.opts.ownProperties;if(m)if(a+=" var missing"+s+"; ",A){y||(a+=" var "+w+" = validate.schema"+d+"; ");var O="i"+s,L="schema"+s+"["+O+"]",M="' + "+L+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(k,L,e.opts.jsonPointers)),a+=" var "+v+" = true; ",y&&(a+=" if (schema"+s+" === undefined) "+v+" = true; else if (!Array.isArray(schema"+s+")) "+v+" = false; else {"),a+=" for (var "+O+" = 0; "+O+" < "+w+".length; "+O+"++) { "+v+" = "+h+"["+w+"["+O+"]] !== undefined ",I&&(a+=" && Object.prototype.hasOwnProperty.call("+h+", "+w+"["+O+"]) "),a+="; if (!"+v+") break; } ",y&&(a+=" } "),a+=" if (!"+v+") { ";var P=P||[];P.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+M+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var W=a;a=P.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+W+"]); ":a+=" validate.errors = ["+W+"]; return false; ":a+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var X=S;if(X)for(var ee,O=-1,J=X.length-1;O<J;){ee=X[O+=1],O&&(a+=" || ");var j=e.util.getProperty(ee),G=h+j;a+=" ( ( "+G+" === undefined ",I&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(ee)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?ee:j)+") ) "}a+=") { ";var L="missing"+s,M="' + "+L+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(k,L,!0):k+" + "+L);var P=P||[];P.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+M+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var W=a;a=P.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+W+"]); ":a+=" validate.errors = ["+W+"]; return false; ":a+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else if(A){y||(a+=" var "+w+" = validate.schema"+d+"; ");var O="i"+s,L="schema"+s+"["+O+"]",M="' + "+L+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(k,L,e.opts.jsonPointers)),y&&(a+=" if ("+w+" && !Array.isArray("+w+")) { var err = ",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+M+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+w+" !== undefined) { "),a+=" for (var "+O+" = 0; "+O+" < "+w+".length; "+O+"++) { if ("+h+"["+w+"["+O+"]] === undefined ",I&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", "+w+"["+O+"]) "),a+=") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+M+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",y&&(a+=" } ")}else{var V=S;if(V)for(var ee,te=-1,re=V.length-1;te<re;){ee=V[te+=1];var j=e.util.getProperty(ee),M=e.util.escapeQuotes(ee),G=h+j;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(k,ee,e.opts.jsonPointers)),a+=" if ( "+G+" === undefined ",I&&(a+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(ee)+"') "),a+=") { var err = ",e.createErrors!==!1?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+M+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=k}else m&&(a+=" if (true) {");return a}),bb}var yb,FI;function A8(){return FI||(FI=1,yb=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h="data"+(l||""),v="valid"+s,y=e.opts.$data&&c&&c.$data,w;if(y?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",w="schema"+s):w=c,(c||y)&&e.opts.uniqueItems!==!1){y&&(a+=" var "+v+"; if ("+w+" === false || "+w+" === undefined) "+v+" = true; else if (typeof "+w+" != 'boolean') "+v+" = false; else { "),a+=" var i = "+h+".length , "+v+" = true , j; if (i > 1) { ";var S=e.schema.items&&e.schema.items.type,R=Array.isArray(S);if(!S||S=="object"||S=="array"||R&&(S.indexOf("object")>=0||S.indexOf("array")>=0))a+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+v+" = false; break outer; } } } ";else{a+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ";var x="checkDataType"+(R?"s":"");a+=" if ("+e.util[x](S,"item",e.opts.strictNumbers,!0)+") continue; ",R&&(a+=` if (typeof item == 'string') item = '"' + item; `),a+=" if (typeof itemIndices[item] == 'number') { "+v+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}a+=" } ",y&&(a+=" } "),a+=" if (!"+v+") { ";var _=_||[];_.push(a),a="",e.createErrors!==!1?(a+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(a+=" , schema: ",y?a+="validate.schema"+d:a+=""+c,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var C=a;a=_.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+C+"]); ":a+=" validate.errors = ["+C+"]; return false; ":a+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",m&&(a+=" else { ")}else m&&(a+=" if (true) { ");return a}),yb}var Eb,zI;function N8(){return zI||(zI=1,Eb={$ref:u8(),allOf:d8(),anyOf:f8(),$comment:p8(),const:m8(),contains:h8(),dependencies:g8(),enum:v8(),format:b8(),if:y8(),items:E8(),maximum:TI(),minimum:TI(),maxItems:CI(),minItems:CI(),maxLength:NI(),minLength:NI(),maxProperties:II(),minProperties:II(),multipleOf:S8(),not:x8(),oneOf:w8(),pattern:_8(),properties:T8(),propertyNames:R8(),required:C8(),uniqueItems:A8(),validate:j2()}),Eb}var Sb,$I;function k8(){if($I)return Sb;$I=1;var t=N8(),e=pc().toHash;return Sb=function(){var n=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],a=["type","$comment"],s=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],l=["number","integer","string","array","object","boolean","null"];return n.all=e(a),n.types=e(l),n.forEach(function(c){c.rules=c.rules.map(function(d){var f;if(typeof d=="object"){var m=Object.keys(d)[0];f=d[m],d=m,f.forEach(function(v){a.push(v),n.all[v]=!0})}a.push(d);var h=n.all[d]={keyword:d,code:t[d],implements:f};return h}),n.all.$comment={keyword:"$comment",code:t.$comment},c.type&&(n.types[c.type]=c)}),n.keywords=e(a.concat(s)),n.custom={},n},Sb}var xb,BI;function I8(){if(BI)return xb;BI=1;var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];return xb=function(e,r){for(var n=0;n<r.length;n++){e=JSON.parse(JSON.stringify(e));var a=r[n].split("/"),s=e,l;for(l=1;l<a.length;l++)s=s[a[l]];for(l=0;l<t.length;l++){var c=t[l],d=s[c];d&&(s[c]={anyOf:[d,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e},xb}var wb,qI;function O8(){if(qI)return wb;qI=1;var t=oR().MissingRef;wb=e;function e(r,n,a){var s=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof n=="function"&&(a=n,n=void 0);var l=c(r).then(function(){var f=s._addSchema(r,void 0,n);return f.validate||d(f)});return a&&l.then(function(f){a(null,f)},a),l;function c(f){var m=f.$schema;return m&&!s.getSchema(m)?e.call(s,{$ref:m},!0):Promise.resolve()}function d(f){try{return s._compile(f)}catch(h){if(h instanceof t)return m(h);throw h}function m(h){var v=h.missingSchema;if(S(v))throw new Error("Schema "+v+" is loaded but "+h.missingRef+" cannot be resolved");var y=s._loadingSchemas[v];return y||(y=s._loadingSchemas[v]=s._opts.loadSchema(v),y.then(w,w)),y.then(function(R){if(!S(v))return c(R).then(function(){S(v)||s.addSchema(R,v,void 0,n)})}).then(function(){return d(f)});function w(){delete s._loadingSchemas[v]}function S(R){return s._refs[R]||s._schemas[R]}}}}return wb}var _b,HI;function D8(){return HI||(HI=1,_b=function(e,r,n){var a=" ",s=e.level,l=e.dataLevel,c=e.schema[r],d=e.schemaPath+e.util.getProperty(r),f=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,h,v="data"+(l||""),y="valid"+s,w="errs__"+s,S=e.opts.$data&&c&&c.$data,R;S?(a+=" var schema"+s+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ",R="schema"+s):R=c;var x=this,_="definition"+s,C=x.definition,N="",k,A,I,O,L;if(S&&C.$data){L="keywordValidate"+s;var M=C.validateSchema;a+=" var "+_+" = RULES.custom['"+r+"'].definition; var "+L+" = "+_+".validate;"}else{if(O=e.useCustomRule(x,c,e.schema,e),!O)return;R="validate.schema"+d,L=O.code,k=C.compile,A=C.inline,I=C.macro}var P=L+".errors",W="i"+s,X="ruleErr"+s,ee=C.async;if(ee&&!e.async)throw new Error("async keyword in sync schema");if(A||I||(a+=""+P+" = null;"),a+="var "+w+" = errors;var "+y+";",S&&C.$data&&(N+="}",a+=" if ("+R+" === undefined) { "+y+" = true; } else { ",M&&(N+="}",a+=" "+y+" = "+_+".validateSchema("+R+"); if ("+y+") { ")),A)C.statements?a+=" "+O.validate+" ":a+=" "+y+" = "+O.validate+"; ";else if(I){var J=e.util.copy(e),N="";J.level++;var j="valid"+J.level;J.schema=O.validate,J.schemaPath="";var G=e.compositeRule;e.compositeRule=J.compositeRule=!0;var V=e.validate(J).replace(/validate\.schema/g,L);e.compositeRule=J.compositeRule=G,a+=" "+V}else{var te=te||[];te.push(a),a="",a+=" "+L+".call( ",e.opts.passContext?a+="this":a+="self",k||C.schema===!1?a+=" , "+v+" ":a+=" , "+R+" , "+v+" , validate.schema"+e.schemaPath+" ",a+=" , (dataPath || '')",e.errorPath!='""'&&(a+=" + "+e.errorPath);var re=l?"data"+(l-1||""):"parentData",U=l?e.dataPathArr[l]:"parentDataProperty";a+=" , "+re+" , "+U+" , rootData ) ";var q=a;a=te.pop(),C.errors===!1?(a+=" "+y+" = ",ee&&(a+="await "),a+=""+q+"; "):ee?(P="customErrors"+s,a+=" var "+P+" = null; try { "+y+" = await "+q+"; } catch (e) { "+y+" = false; if (e instanceof ValidationError) "+P+" = e.errors; else throw e; } "):a+=" "+P+" = null; "+y+" = "+q+"; "}if(C.modifying&&(a+=" if ("+re+") "+v+" = "+re+"["+U+"];"),a+=""+N,C.valid)m&&(a+=" if (true) { ");else{a+=" if ( ",C.valid===void 0?(a+=" !",I?a+=""+j:a+=""+y):a+=" "+!C.valid+" ",a+=") { ",h=x.keyword;var te=te||[];te.push(a),a="";var te=te||[];te.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==!1&&(a+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),a+=" } "):a+=" {} ";var $=a;a=te.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+$+"]); ":a+=" validate.errors = ["+$+"]; return false; ":a+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var Y=a;a=te.pop(),A?C.errors?C.errors!="full"&&(a+=" for (var "+W+"="+w+"; "+W+"<errors; "+W+"++) { var "+X+" = vErrors["+W+"]; if ("+X+".dataPath === undefined) "+X+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+X+".schemaPath === undefined) { "+X+'.schemaPath = "'+f+'"; } ',e.opts.verbose&&(a+=" "+X+".schema = "+R+"; "+X+".data = "+v+"; "),a+=" } "):C.errors===!1?a+=" "+Y+" ":(a+=" if ("+w+" == errors) { "+Y+" } else { for (var "+W+"="+w+"; "+W+"<errors; "+W+"++) { var "+X+" = vErrors["+W+"]; if ("+X+".dataPath === undefined) "+X+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+X+".schemaPath === undefined) { "+X+'.schemaPath = "'+f+'"; } ',e.opts.verbose&&(a+=" "+X+".schema = "+R+"; "+X+".data = "+v+"; "),a+=" } } "):I?(a+=" var err = ",e.createErrors!==!1?(a+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==!1&&(a+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(a+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; ")):C.errors===!1?a+=" "+Y+" ":(a+=" if (Array.isArray("+P+")) { if (vErrors === null) vErrors = "+P+"; else vErrors = vErrors.concat("+P+"); errors = vErrors.length; for (var "+W+"="+w+"; "+W+"<errors; "+W+"++) { var "+X+" = vErrors["+W+"]; if ("+X+".dataPath === undefined) "+X+".dataPath = (dataPath || '') + "+e.errorPath+"; "+X+'.schemaPath = "'+f+'"; ',e.opts.verbose&&(a+=" "+X+".schema = "+R+"; "+X+".data = "+v+"; "),a+=" } } else { "+Y+" } "),a+=" } ",m&&(a+=" else { ")}return a}),_b}const L8="http://json-schema.org/draft-07/schema#",M8="http://json-schema.org/draft-07/schema#",P8="Core schema meta-schema",j8={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},U8=["object","boolean"],F8={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},U2={$schema:L8,$id:M8,title:P8,definitions:j8,type:U8,properties:F8,default:!0};var Tb,VI;function z8(){if(VI)return Tb;VI=1;var t=U2;return Tb={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:t.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:t.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}},Tb}var Rb,GI;function $8(){if(GI)return Rb;GI=1;var t=/^[a-z_$][a-z0-9_$-]*$/i,e=D8(),r=z8();Rb={add:n,get:a,remove:s,validate:l};function n(c,d){var f=this.RULES;if(f.keywords[c])throw new Error("Keyword "+c+" is already defined");if(!t.test(c))throw new Error("Keyword "+c+" is not a valid identifier");if(d){this.validateKeyword(d,!0);var m=d.type;if(Array.isArray(m))for(var h=0;h<m.length;h++)y(c,m[h],d);else y(c,m,d);var v=d.metaSchema;v&&(d.$data&&this._opts.$data&&(v={anyOf:[v,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),d.validateSchema=this.compile(v,!0))}f.keywords[c]=f.all[c]=!0;function y(w,S,R){for(var x,_=0;_<f.length;_++){var C=f[_];if(C.type==S){x=C;break}}x||(x={type:S,rules:[]},f.push(x));var N={keyword:w,definition:R,custom:!0,code:e,implements:R.implements};x.rules.push(N),f.custom[w]=N}return this}function a(c){var d=this.RULES.custom[c];return d?d.definition:this.RULES.keywords[c]||!1}function s(c){var d=this.RULES;delete d.keywords[c],delete d.all[c],delete d.custom[c];for(var f=0;f<d.length;f++)for(var m=d[f].rules,h=0;h<m.length;h++)if(m[h].keyword==c){m.splice(h,1);break}return this}function l(c,d){l.errors=null;var f=this._validateKeyword=this._validateKeyword||this.compile(r,!0);if(f(c))return!0;if(l.errors=f.errors,d)throw new Error("custom keyword definition is invalid: "+this.errorsText(f.errors));return!1}return Rb}const B8="http://json-schema.org/draft-07/schema#",q8="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",H8="Meta-schema for $data reference (JSON Schema extension proposal)",V8="object",G8=["$data"],W8={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Y8=!1,K8={$schema:B8,$id:q8,description:H8,type:V8,required:G8,properties:W8,additionalProperties:Y8};var Cb,WI;function Z8(){if(WI)return Cb;WI=1;var t=s8(),e=aR(),r=l8(),n=M2(),a=P2(),s=c8(),l=k8(),c=I8(),d=pc();Cb=w,w.prototype.validate=S,w.prototype.compile=R,w.prototype.addSchema=x,w.prototype.addMetaSchema=_,w.prototype.validateSchema=C,w.prototype.getSchema=k,w.prototype.removeSchema=O,w.prototype.addFormat=G,w.prototype.errorsText=j,w.prototype._addSchema=M,w.prototype._compile=P,w.prototype.compileAsync=O8();var f=$8();w.prototype.addKeyword=f.add,w.prototype.getKeyword=f.get,w.prototype.removeKeyword=f.remove,w.prototype.validateKeyword=f.validate;var m=oR();w.ValidationError=m.Validation,w.MissingRefError=m.MissingRef,w.$dataMetaSchema=c;var h="http://json-schema.org/draft-07/schema",v=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],y=["/properties"];function w(F){if(!(this instanceof w))return new w(F);F=this._opts=d.copy(F)||{},Y(this),this._schemas={},this._refs={},this._fragments={},this._formats=s(F.format),this._cache=F.cache||new r,this._loadingSchemas={},this._compilations=[],this.RULES=l(),this._getId=W(F),F.loopRequired=F.loopRequired||1/0,F.errorDataPath=="property"&&(F._errorDataPathProperty=!0),F.serialize===void 0&&(F.serialize=a),this._metaOpts=$(this),F.formats&&re(this),F.keywords&&U(this),V(this),typeof F.meta=="object"&&this.addMetaSchema(F.meta),F.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),te(this)}function S(F,z){var K;if(typeof F=="string"){if(K=this.getSchema(F),!K)throw new Error('no schema with key or ref "'+F+'"')}else{var ae=this._addSchema(F);K=ae.validate||this._compile(ae)}var H=K(z);return K.$async!==!0&&(this.errors=K.errors),H}function R(F,z){var K=this._addSchema(F,void 0,z);return K.validate||this._compile(K)}function x(F,z,K,ae){if(Array.isArray(F)){for(var H=0;H<F.length;H++)this.addSchema(F[H],void 0,K,ae);return this}var de=this._getId(F);if(de!==void 0&&typeof de!="string")throw new Error("schema id must be string");return z=e.normalizeId(z||de),q(this,z),this._schemas[z]=this._addSchema(F,K,ae,!0),this}function _(F,z,K){return this.addSchema(F,z,K,!0),this}function C(F,z){var K=F.$schema;if(K!==void 0&&typeof K!="string")throw new Error("$schema must be a string");if(K=K||this._opts.defaultMeta||N(this),!K)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var ae=this.validate(K,F);if(!ae&&z){var H="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(H);else throw new Error(H)}return ae}function N(F){var z=F._opts.meta;return F._opts.defaultMeta=typeof z=="object"?F._getId(z)||z:F.getSchema(h)?h:void 0,F._opts.defaultMeta}function k(F){var z=I(this,F);switch(typeof z){case"object":return z.validate||this._compile(z);case"string":return this.getSchema(z);case"undefined":return A(this,F)}}function A(F,z){var K=e.schema.call(F,{schema:{}},z);if(K){var ae=K.schema,H=K.root,de=K.baseId,me=t.call(F,ae,H,void 0,de);return F._fragments[z]=new n({ref:z,fragment:!0,schema:ae,root:H,baseId:de,validate:me}),me}}function I(F,z){return z=e.normalizeId(z),F._schemas[z]||F._refs[z]||F._fragments[z]}function O(F){if(F instanceof RegExp)return L(this,this._schemas,F),L(this,this._refs,F),this;switch(typeof F){case"undefined":return L(this,this._schemas),L(this,this._refs),this._cache.clear(),this;case"string":var z=I(this,F);return z&&this._cache.del(z.cacheKey),delete this._schemas[F],delete this._refs[F],this;case"object":var K=this._opts.serialize,ae=K?K(F):F;this._cache.del(ae);var H=this._getId(F);H&&(H=e.normalizeId(H),delete this._schemas[H],delete this._refs[H])}return this}function L(F,z,K){for(var ae in z){var H=z[ae];!H.meta&&(!K||K.test(ae))&&(F._cache.del(H.cacheKey),delete z[ae])}}function M(F,z,K,ae){if(typeof F!="object"&&typeof F!="boolean")throw new Error("schema should be object or boolean");var H=this._opts.serialize,de=H?H(F):F,me=this._cache.get(de);if(me)return me;ae=ae||this._opts.addUsedSchema!==!1;var xe=e.normalizeId(this._getId(F));xe&&ae&&q(this,xe);var be=this._opts.validateSchema!==!1&&!z,_e;be&&!(_e=xe&&xe==e.normalizeId(F.$schema))&&this.validateSchema(F,!0);var Ae=e.ids.call(this,F),Fe=new n({id:xe,schema:F,localRefs:Ae,cacheKey:de,meta:K});return xe[0]!="#"&&ae&&(this._refs[xe]=Fe),this._cache.put(de,Fe),be&&_e&&this.validateSchema(F,!0),Fe}function P(F,z){if(F.compiling)return F.validate=H,H.schema=F.schema,H.errors=null,H.root=z||H,F.schema.$async===!0&&(H.$async=!0),H;F.compiling=!0;var K;F.meta&&(K=this._opts,this._opts=this._metaOpts);var ae;try{ae=t.call(this,F.schema,z,F.localRefs)}catch(de){throw delete F.validate,de}finally{F.compiling=!1,F.meta&&(this._opts=K)}return F.validate=ae,F.refs=ae.refs,F.refVal=ae.refVal,F.root=ae.root,ae;function H(){var de=F.validate,me=de.apply(this,arguments);return H.errors=de.errors,me}}function W(F){switch(F.schemaId){case"auto":return J;case"id":return X;default:return ee}}function X(F){return F.$id&&this.logger.warn("schema $id ignored",F.$id),F.id}function ee(F){return F.id&&this.logger.warn("schema id ignored",F.id),F.$id}function J(F){if(F.$id&&F.id&&F.$id!=F.id)throw new Error("schema $id is different from id");return F.$id||F.id}function j(F,z){if(F=F||this.errors,!F)return"No errors";z=z||{};for(var K=z.separator===void 0?", ":z.separator,ae=z.dataVar===void 0?"data":z.dataVar,H="",de=0;de<F.length;de++){var me=F[de];me&&(H+=ae+me.dataPath+" "+me.message+K)}return H.slice(0,-K.length)}function G(F,z){return typeof z=="string"&&(z=new RegExp(z)),this._formats[F]=z,this}function V(F){var z;if(F._opts.$data&&(z=K8,F.addMetaSchema(z,z.$id,!0)),F._opts.meta!==!1){var K=U2;F._opts.$data&&(K=c(K,y)),F.addMetaSchema(K,h,!0),F._refs["http://json-schema.org/schema"]=h}}function te(F){var z=F._opts.schemas;if(z)if(Array.isArray(z))F.addSchema(z);else for(var K in z)F.addSchema(z[K],K)}function re(F){for(var z in F._opts.formats){var K=F._opts.formats[z];F.addFormat(z,K)}}function U(F){for(var z in F._opts.keywords){var K=F._opts.keywords[z];F.addKeyword(z,K)}}function q(F,z){if(F._schemas[z]||F._refs[z])throw new Error('schema with key or id "'+z+'" already exists')}function $(F){for(var z=d.copy(F._opts),K=0;K<v.length;K++)delete z[v[K]];return z}function Y(F){var z=F._opts.logger;if(z===!1)F.logger={log:Q,warn:Q,error:Q};else{if(z===void 0&&(z=console),!(typeof z=="object"&&z.log&&z.warn&&z.error))throw new Error("logger must implement log, warn and error methods");F.logger=z}}function Q(){}return Cb}var X8=Z8();const Q8=fc(X8);class YI extends t8{constructor(e,r){var n;super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(n=r?.capabilities)!==null&&n!==void 0?n:{},this._ajv=new Q8}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=r8(this._capabilities,e)}assertCapability(e,r){var n;if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n[e]))throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{const n=await this.request({method:"initialize",params:{protocolVersion:jm,capabilities:this._capabilities,clientInfo:this._clientInfo}},E2,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!r9.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"})}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var r,n,a,s,l;switch(e){case"logging/setLevel":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((l=this._serverCapabilities)===null||l===void 0)&&l.completions))throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){var r;switch(e){case"notifications/roots/list_changed":if(!(!((r=this._capabilities.roots)===null||r===void 0)&&r.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break}}async ping(e){return this.request({method:"ping"},Al,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},L2,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},Al,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},I2,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},N2,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},R2,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},C2,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},A2,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},Al,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},Al,r)}async callTool(e,r=rR,n){const a=await this.request({method:"tools/call",params:e},r,n),s=this.getToolOutputValidator(e.name);if(s){if(!a.structuredContent&&!a.isError)throw new Si(Da.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(a.structuredContent)try{if(!s(a.structuredContent))throw new Si(Da.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(s.errors)}`)}catch(l){throw l instanceof Si?l:new Si(Da.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)}}return a}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(const r of e)if(r.outputSchema)try{const n=this._ajv.compile(r.outputSchema);this._cachedToolOutputValidators.set(r.name,n)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){const n=await this.request({method:"tools/list",params:e},O2,r);return this.cacheToolOutputSchemas(n.tools),n}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}let iR;iR=globalThis.crypto;async function J8(t){return(await iR).getRandomValues(new Uint8Array(t))}async function eW(t){const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";let r="";const n=await J8(t);for(let a=0;a<t;a++){const s=n[a]%e.length;r+=e[s]}return r}async function tW(t){return await eW(t)}async function rW(t){const e=await(await iR).subtle.digest("SHA-256",new TextEncoder().encode(t));return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function nW(t){if(t||(t=43),t<43||t>128)throw`Expected a length between 43 and 128. Received ${t}.`;const e=await tW(t),r=await rW(e);return{code_verifier:e,code_challenge:r}}const Pr=ve().url().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:Ie.custom,message:"URL must be parseable",fatal:!0}),t9}).refine(t=>{const e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),aW=Me({resource:ve().url(),authorization_servers:Ye(Pr).optional(),jwks_uri:ve().url().optional(),scopes_supported:Ye(ve()).optional(),bearer_methods_supported:Ye(ve()).optional(),resource_signing_alg_values_supported:Ye(ve()).optional(),resource_name:ve().optional(),resource_documentation:ve().optional(),resource_policy_uri:ve().url().optional(),resource_tos_uri:ve().url().optional(),tls_client_certificate_bound_access_tokens:Dr().optional(),authorization_details_types_supported:Ye(ve()).optional(),dpop_signing_alg_values_supported:Ye(ve()).optional(),dpop_bound_access_tokens_required:Dr().optional()}).passthrough(),F2=Me({issuer:ve(),authorization_endpoint:Pr,token_endpoint:Pr,registration_endpoint:Pr.optional(),scopes_supported:Ye(ve()).optional(),response_types_supported:Ye(ve()),response_modes_supported:Ye(ve()).optional(),grant_types_supported:Ye(ve()).optional(),token_endpoint_auth_methods_supported:Ye(ve()).optional(),token_endpoint_auth_signing_alg_values_supported:Ye(ve()).optional(),service_documentation:Pr.optional(),revocation_endpoint:Pr.optional(),revocation_endpoint_auth_methods_supported:Ye(ve()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Ye(ve()).optional(),introspection_endpoint:ve().optional(),introspection_endpoint_auth_methods_supported:Ye(ve()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Ye(ve()).optional(),code_challenge_methods_supported:Ye(ve()).optional()}).passthrough(),oW=Me({issuer:ve(),authorization_endpoint:Pr,token_endpoint:Pr,userinfo_endpoint:Pr.optional(),jwks_uri:Pr,registration_endpoint:Pr.optional(),scopes_supported:Ye(ve()).optional(),response_types_supported:Ye(ve()),response_modes_supported:Ye(ve()).optional(),grant_types_supported:Ye(ve()).optional(),acr_values_supported:Ye(ve()).optional(),subject_types_supported:Ye(ve()),id_token_signing_alg_values_supported:Ye(ve()),id_token_encryption_alg_values_supported:Ye(ve()).optional(),id_token_encryption_enc_values_supported:Ye(ve()).optional(),userinfo_signing_alg_values_supported:Ye(ve()).optional(),userinfo_encryption_alg_values_supported:Ye(ve()).optional(),userinfo_encryption_enc_values_supported:Ye(ve()).optional(),request_object_signing_alg_values_supported:Ye(ve()).optional(),request_object_encryption_alg_values_supported:Ye(ve()).optional(),request_object_encryption_enc_values_supported:Ye(ve()).optional(),token_endpoint_auth_methods_supported:Ye(ve()).optional(),token_endpoint_auth_signing_alg_values_supported:Ye(ve()).optional(),display_values_supported:Ye(ve()).optional(),claim_types_supported:Ye(ve()).optional(),claims_supported:Ye(ve()).optional(),service_documentation:ve().optional(),claims_locales_supported:Ye(ve()).optional(),ui_locales_supported:Ye(ve()).optional(),claims_parameter_supported:Dr().optional(),request_parameter_supported:Dr().optional(),request_uri_parameter_supported:Dr().optional(),require_request_uri_registration:Dr().optional(),op_policy_uri:Pr.optional(),op_tos_uri:Pr.optional()}).passthrough(),iW=oW.merge(F2.pick({code_challenge_methods_supported:!0})),z2=Me({access_token:ve(),id_token:ve().optional(),token_type:ve(),expires_in:$r().optional(),scope:ve().optional(),refresh_token:ve().optional()}).strip(),sW=Me({error:ve(),error_description:ve().optional(),error_uri:ve().optional()}),lW=Me({redirect_uris:Ye(Pr),token_endpoint_auth_method:ve().optional(),grant_types:Ye(ve()).optional(),response_types:Ye(ve()).optional(),client_name:ve().optional(),client_uri:Pr.optional(),logo_uri:Pr.optional(),scope:ve().optional(),contacts:Ye(ve()).optional(),tos_uri:Pr.optional(),policy_uri:ve().optional(),jwks_uri:Pr.optional(),jwks:J6().optional(),software_id:ve().optional(),software_version:ve().optional(),software_statement:ve().optional()}).strip(),cW=Me({client_id:ve(),client_secret:ve().optional(),client_id_issued_at:$r().optional(),client_secret_expires_at:$r().optional()}).strip(),uW=lW.merge(cW);Me({error:ve(),error_description:ve().optional()}).strip();Me({token:ve(),token_type_hint:ve().optional()}).strip();function dW(t){const e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}function fW({requestedResource:t,configuredResource:e}){const r=typeof t=="string"?new URL(t):new URL(t.href),n=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;const a=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",s=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return a.startsWith(s)}class Qr extends Error{constructor(e,r){super(e),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){const e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}}class __ extends Qr{}__.errorCode="invalid_request";class fm extends Qr{}fm.errorCode="invalid_client";class pm extends Qr{}pm.errorCode="invalid_grant";class mm extends Qr{}mm.errorCode="unauthorized_client";class T_ extends Qr{}T_.errorCode="unsupported_grant_type";class R_ extends Qr{}R_.errorCode="invalid_scope";class C_ extends Qr{}C_.errorCode="access_denied";class nc extends Qr{}nc.errorCode="server_error";class A_ extends Qr{}A_.errorCode="temporarily_unavailable";class N_ extends Qr{}N_.errorCode="unsupported_response_type";class k_ extends Qr{}k_.errorCode="unsupported_token_type";class I_ extends Qr{}I_.errorCode="invalid_token";class O_ extends Qr{}O_.errorCode="method_not_allowed";class D_ extends Qr{}D_.errorCode="too_many_requests";class L_ extends Qr{}L_.errorCode="invalid_client_metadata";class M_ extends Qr{}M_.errorCode="insufficient_scope";const pW={[__.errorCode]:__,[fm.errorCode]:fm,[pm.errorCode]:pm,[mm.errorCode]:mm,[T_.errorCode]:T_,[R_.errorCode]:R_,[C_.errorCode]:C_,[nc.errorCode]:nc,[A_.errorCode]:A_,[N_.errorCode]:N_,[k_.errorCode]:k_,[I_.errorCode]:I_,[O_.errorCode]:O_,[D_.errorCode]:D_,[L_.errorCode]:L_,[M_.errorCode]:M_};class La extends Error{constructor(e){super(e??"Unauthorized")}}const Ab="code",Nb="S256";function $2(t,e){const r=t.client_secret!==void 0;return e.length===0?r?"client_secret_post":"none":r&&e.includes("client_secret_basic")?"client_secret_basic":r&&e.includes("client_secret_post")?"client_secret_post":e.includes("none")?"none":r?"client_secret_post":"none"}function B2(t,e,r,n){const{client_id:a,client_secret:s}=e;switch(t){case"client_secret_basic":mW(a,s,r);return;case"client_secret_post":hW(a,s,n);return;case"none":gW(a,n);return;default:throw new Error(`Unsupported client authentication method: ${t}`)}}function mW(t,e,r){if(!e)throw new Error("client_secret_basic authentication requires a client_secret");const n=btoa(`${t}:${e}`);r.set("Authorization",`Basic ${n}`)}function hW(t,e,r){r.set("client_id",t),e&&r.set("client_secret",e)}function gW(t,e){e.set("client_id",t)}async function sR(t){const e=t instanceof Response?t.status:void 0,r=t instanceof Response?await t.text():t;try{const n=sW.parse(JSON.parse(r)),{error:a,error_description:s,error_uri:l}=n,c=pW[a]||nc;return new c(s||"",l)}catch(n){const a=`${e?`HTTP ${e}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new nc(a)}}async function ps(t,e){var r,n;try{return await kb(t,e)}catch(a){if(a instanceof fm||a instanceof mm)return await((r=t.invalidateCredentials)===null||r===void 0?void 0:r.call(t,"all")),await kb(t,e);if(a instanceof pm)return await((n=t.invalidateCredentials)===null||n===void 0?void 0:n.call(t,"tokens")),await kb(t,e);throw a}}async function kb(t,{serverUrl:e,authorizationCode:r,scope:n,resourceMetadataUrl:a,fetchFn:s}){let l,c;try{l=await bW(e,{resourceMetadataUrl:a},s),l.authorization_servers&&l.authorization_servers.length>0&&(c=l.authorization_servers[0])}catch{}c||(c=e);const d=await vW(e,t,l),f=await wW(c,{fetchFn:s});let m=await Promise.resolve(t.clientInformation());if(!m){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!t.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await CW(c,{metadata:f,clientMetadata:t.clientMetadata,fetchFn:s});await t.saveClientInformation(S),m=S}if(r!==void 0){const S=await t.codeVerifier(),R=await TW(c,{metadata:f,clientInformation:m,authorizationCode:r,codeVerifier:S,redirectUri:t.redirectUrl,resource:d,addClientAuthentication:t.addClientAuthentication,fetchFn:s});return await t.saveTokens(R),"AUTHORIZED"}const h=await t.tokens();if(h?.refresh_token)try{const S=await RW(c,{metadata:f,clientInformation:m,refreshToken:h.refresh_token,resource:d,addClientAuthentication:t.addClientAuthentication,fetchFn:s});return await t.saveTokens(S),"AUTHORIZED"}catch(S){if(!(!(S instanceof Qr)||S instanceof nc))throw S}const v=t.state?await t.state():void 0,{authorizationUrl:y,codeVerifier:w}=await _W(c,{metadata:f,clientInformation:m,state:v,redirectUrl:t.redirectUrl,scope:n||t.clientMetadata.scope,resource:d});return await t.saveCodeVerifier(w),await t.redirectToAuthorization(y),"REDIRECT"}async function vW(t,e,r){const n=dW(t);if(e.validateResourceURL)return await e.validateResourceURL(n,r?.resource);if(r){if(!fW({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function P_(t){const e=t.headers.get("WWW-Authenticate");if(!e)return;const[r,n]=e.split(" ");if(r.toLowerCase()!=="bearer"||!n)return;const s=/resource_metadata="([^"]*)"/.exec(e);if(s)try{return new URL(s[1])}catch{return}}async function bW(t,e,r=fetch){const n=await SW(t,"oauth-protected-resource",r,{protocolVersion:e?.protocolVersion,metadataUrl:e?.resourceMetadataUrl});if(!n||n.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return aW.parse(await n.json())}async function lR(t,e,r=fetch){try{return await r(t,{headers:e})}catch(n){if(n instanceof TypeError)return e?lR(t,void 0,r):void 0;throw n}}function yW(t,e="",r={}){return e.endsWith("/")&&(e=e.slice(0,-1)),r.prependPathname?`${e}/.well-known/${t}`:`/.well-known/${t}${e}`}async function KI(t,e,r=fetch){return await lR(t,{"MCP-Protocol-Version":e},r)}function EW(t,e){return!t||t.status>=400&&t.status<500&&e!=="/"}async function SW(t,e,r,n){var a,s;const l=new URL(t),c=(a=n?.protocolVersion)!==null&&a!==void 0?a:jm;let d;if(n?.metadataUrl)d=new URL(n.metadataUrl);else{const m=yW(e,l.pathname);d=new URL(m,(s=n?.metadataServerUrl)!==null&&s!==void 0?s:l),d.search=l.search}let f=await KI(d,c,r);if(!n?.metadataUrl&&EW(f,l.pathname)){const m=new URL(`/.well-known/${e}`,l);f=await KI(m,c,r)}return f}function xW(t){const e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),n;let a=e.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${a}`,e.origin),type:"oidc"}),n.push({url:new URL(`${a}/.well-known/openid-configuration`,e.origin),type:"oidc"}),n}async function wW(t,{fetchFn:e=fetch,protocolVersion:r=jm}={}){const n={"MCP-Protocol-Version":r},a=xW(t);for(const{url:s,type:l}of a){const c=await lR(s,n,e);if(c){if(!c.ok){if(c.status>=400&&c.status<500)continue;throw new Error(`HTTP ${c.status} trying to load ${l==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}return l==="oauth"?F2.parse(await c.json()):iW.parse(await c.json())}}}async function _W(t,{metadata:e,clientInformation:r,redirectUrl:n,scope:a,state:s,resource:l}){let c;if(e){if(c=new URL(e.authorization_endpoint),!e.response_types_supported.includes(Ab))throw new Error(`Incompatible auth server: does not support response type ${Ab}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(Nb))throw new Error(`Incompatible auth server: does not support code challenge method ${Nb}`)}else c=new URL("/authorize",t);const d=await nW(),f=d.code_verifier,m=d.code_challenge;return c.searchParams.set("response_type",Ab),c.searchParams.set("client_id",r.client_id),c.searchParams.set("code_challenge",m),c.searchParams.set("code_challenge_method",Nb),c.searchParams.set("redirect_uri",String(n)),s&&c.searchParams.set("state",s),a&&c.searchParams.set("scope",a),a?.includes("offline_access")&&c.searchParams.append("prompt","consent"),l&&c.searchParams.set("resource",l.href),{authorizationUrl:c,codeVerifier:f}}async function TW(t,{metadata:e,clientInformation:r,authorizationCode:n,codeVerifier:a,redirectUri:s,resource:l,addClientAuthentication:c,fetchFn:d}){var f;const m="authorization_code",h=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t);if(e?.grant_types_supported&&!e.grant_types_supported.includes(m))throw new Error(`Incompatible auth server: does not support grant type ${m}`);const v=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),y=new URLSearchParams({grant_type:m,code:n,code_verifier:a,redirect_uri:String(s)});if(c)c(v,y,t,e);else{const S=(f=e?.token_endpoint_auth_methods_supported)!==null&&f!==void 0?f:[],R=$2(r,S);B2(R,r,v,y)}l&&y.set("resource",l.href);const w=await(d??fetch)(h,{method:"POST",headers:v,body:y});if(!w.ok)throw await sR(w);return z2.parse(await w.json())}async function RW(t,{metadata:e,clientInformation:r,refreshToken:n,resource:a,addClientAuthentication:s,fetchFn:l}){var c;const d="refresh_token";let f;if(e){if(f=new URL(e.token_endpoint),e.grant_types_supported&&!e.grant_types_supported.includes(d))throw new Error(`Incompatible auth server: does not support grant type ${d}`)}else f=new URL("/token",t);const m=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),h=new URLSearchParams({grant_type:d,refresh_token:n});if(s)s(m,h,t,e);else{const y=(c=e?.token_endpoint_auth_methods_supported)!==null&&c!==void 0?c:[],w=$2(r,y);B2(w,r,m,h)}a&&h.set("resource",a.href);const v=await(l??fetch)(f,{method:"POST",headers:m,body:h});if(!v.ok)throw await sR(v);return z2.parse({refresh_token:n,...await v.json()})}async function CW(t,{metadata:e,clientMetadata:r,fetchFn:n}){let a;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");a=new URL(e.registration_endpoint)}else a=new URL("/register",t);const s=await(n??fetch)(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!s.ok)throw await sR(s);return uW.parse(await s.json())}class ZI extends Error{constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function Ib(t){}function q2(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=Ib,onError:r=Ib,onRetry:n=Ib,onComment:a}=t;let s="",l=!0,c,d="",f="";function m(S){const R=l?S.replace(/^\xEF\xBB\xBF/,""):S,[x,_]=AW(`${s}${R}`);for(const C of x)h(C);s=_,l=!1}function h(S){if(S===""){y();return}if(S.startsWith(":")){a&&a(S.slice(S.startsWith(": ")?2:1));return}const R=S.indexOf(":");if(R!==-1){const x=S.slice(0,R),_=S[R+1]===" "?2:1,C=S.slice(R+_);v(x,C,S);return}v(S,"",S)}function v(S,R,x){switch(S){case"event":f=R;break;case"data":d=`${d}${R}
3
3
  `;break;case"id":c=R.includes("\0")?void 0:R;break;case"retry":/^\d+$/.test(R)?n(parseInt(R,10)):r(new ZI(`Invalid \`retry\` value: "${R}"`,{type:"invalid-retry",value:R,line:x}));break;default:r(new ZI(`Unknown field "${S.length>20?`${S.slice(0,20)}…`:S}"`,{type:"unknown-field",field:S,value:R,line:x}));break}}function y(){d.length>0&&e({id:c,event:f||void 0,data:d.endsWith(`
4
4
  `)?d.slice(0,-1):d}),c=void 0,d="",f=""}function w(S={}){s&&S.consume&&h(s),l=!0,c=void 0,d="",f="",s=""}return{feed:m,reset:w}}function AW(t){const e=[];let r="",n=0;for(;n<t.length;){const a=t.indexOf("\r",n),s=t.indexOf(`
5
5
  `,n);let l=-1;if(a!==-1&&s!==-1?l=Math.min(a,s):a!==-1?a===t.length-1?l=-1:l=a:s!==-1&&(l=s),l===-1){r=t.slice(n);break}else{const c=t.slice(n,l);e.push(c),n=l+1,t[n-1]==="\r"&&t[n]===`
@@ -22,7 +22,7 @@ Error generating stack: `+p.message+`
22
22
  `+p.stack}}var $e=Object.prototype.hasOwnProperty,at=t.unstable_scheduleCallback,ce=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,ze=t.unstable_requestPaint,we=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,Je=t.unstable_UserBlockingPriority,ot=t.unstable_NormalPriority,Rt=t.unstable_LowPriority,Ot=t.unstable_IdlePriority,Cn=t.log,vr=t.unstable_setDisableYieldValue,or=null,Mt=null;function Zt(o){if(typeof Cn=="function"&&vr(o),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(or,o)}catch{}}var fr=Math.clz32?Math.clz32:ir,Sr=Math.log,zn=Math.LN2;function ir(o){return o>>>=0,o===0?32:31-(Sr(o)/zn|0)|0}var Gt=256,pn=262144,ua=4194304;function an(o){var i=o&42;if(i!==0)return i;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Qe(o,i,u){var p=o.pendingLanes;if(p===0)return 0;var E=0,T=o.suspendedLanes,D=o.pingedLanes;o=o.warmLanes;var B=p&134217727;return B!==0?(p=B&~T,p!==0?E=an(p):(D&=B,D!==0?E=an(D):u||(u=B&~o,u!==0&&(E=an(u))))):(B=p&~T,B!==0?E=an(B):D!==0?E=an(D):u||(u=p&~o,u!==0&&(E=an(u)))),E===0?0:i!==0&&i!==E&&(i&T)===0&&(T=E&-E,u=i&-i,T>=u||T===32&&(u&4194048)!==0)?i:E}function jt(o,i){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&i)===0}function Qt(o,i){switch(o){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Lr(){var o=ua;return ua<<=1,(ua&62914560)===0&&(ua=4194304),o}function $n(o){for(var i=[],u=0;31>u;u++)i.push(o);return i}function Xt(o,i){o.pendingLanes|=i,i!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Jr(o,i,u,p,E,T){var D=o.pendingLanes;o.pendingLanes=u,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=u,o.entangledLanes&=u,o.errorRecoveryDisabledLanes&=u,o.shellSuspendCounter=0;var B=o.entanglements,ne=o.expirationTimes,pe=o.hiddenUpdates;for(u=D&~u;0<u;){var Se=31-fr(u),Re=1<<Se;B[Se]=0,ne[Se]=-1;var he=pe[Se];if(he!==null)for(pe[Se]=null,Se=0;Se<he.length;Se++){var Ee=he[Se];Ee!==null&&(Ee.lane&=-536870913)}u&=~Re}p!==0&&_a(o,p,0),T!==0&&E===0&&o.tag!==0&&(o.suspendedLanes|=T&~(D&~i))}function _a(o,i,u){o.pendingLanes|=i,o.suspendedLanes&=~i;var p=31-fr(i);o.entangledLanes|=i,o.entanglements[p]=o.entanglements[p]|1073741824|u&261930}function en(o,i){var u=o.entangledLanes|=i;for(o=o.entanglements;u;){var p=31-fr(u),E=1<<p;E&i|o[p]&i&&(o[p]|=i),u&=~E}}function Br(o,i){var u=i&-i;return u=(u&42)!==0?1:oe(u),(u&(o.suspendedLanes|i))!==0?0:u}function oe(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Z(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function ie(){var o=G.p;return o!==0?o:(o=window.event,o===void 0?32:Lk(o.type))}function ye(o,i){var u=G.p;try{return G.p=o,i()}finally{G.p=u}}var ge=Math.random().toString(36).slice(2),je="__reactFiber$"+ge,Be="__reactProps$"+ge,mt="__reactContainer$"+ge,Ut="__reactEvents$"+ge,sr="__reactListeners$"+ge,yt="__reactHandles$"+ge,Ft="__reactResources$"+ge,Wt="__reactMarker$"+ge;function it(o){delete o[je],delete o[Be],delete o[Ut],delete o[sr],delete o[yt]}function Dt(o){var i=o[je];if(i)return i;for(var u=o.parentNode;u;){if(i=u[mt]||u[je]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(o=bk(o);o!==null;){if(u=o[je])return u;o=bk(o)}return i}o=u,u=o.parentNode}return null}function Yt(o){if(o=o[je]||o[mt]){var i=o.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return o}return null}function Pt(o){var i=o.tag;if(i===5||i===26||i===27||i===6)return o.stateNode;throw Error(n(33))}function on(o){var i=o[Ft];return i||(i=o[Ft]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function zt(o){o[Wt]=!0}var An=new Set,Ja={};function sn(o,i){Ar(o,i),Ar(o+"Capture",i)}function Ar(o,i){for(Ja[o]=i,o=0;o<i.length;o++)An.add(i[o])}var Bn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ta={},qn={};function Mi(o){return $e.call(qn,o)?!0:$e.call(Ta,o)?!1:Bn.test(o)?qn[o]=!0:(Ta[o]=!0,!1)}function Pi(o,i,u){if(Mi(i))if(u===null)o.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":o.removeAttribute(i);return;case"boolean":var p=i.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){o.removeAttribute(i);return}}o.setAttribute(i,""+u)}}function ji(o,i,u){if(u===null)o.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(i);return}o.setAttribute(i,""+u)}}function mn(o,i,u,p){if(p===null)o.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttributeNS(i,u,""+p)}}function qr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ui(o){var i=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function rf(o,i,u){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,i);if(!o.hasOwnProperty(i)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var E=p.get,T=p.set;return Object.defineProperty(o,i,{configurable:!0,get:function(){return E.call(this)},set:function(D){u=""+D,T.call(this,D)}}),Object.defineProperty(o,i,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(D){u=""+D},stopTracking:function(){o._valueTracker=null,delete o[i]}}}}function Os(o){if(!o._valueTracker){var i=Ui(o)?"checked":"value";o._valueTracker=rf(o,i,""+o[i])}}function zo(o){if(!o)return!1;var i=o._valueTracker;if(!i)return!0;var u=i.getValue(),p="";return o&&(p=Ui(o)?o.checked?"true":"false":o.value),o=p,o!==u?(i.setValue(o),!0):!1}function nf(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var mV=/[\n"\\]/g;function Hn(o){return o.replace(mV,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Ih(o,i,u,p,E,T,D,B){o.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?o.type=D:o.removeAttribute("type"),i!=null?D==="number"?(i===0&&o.value===""||o.value!=i)&&(o.value=""+qr(i)):o.value!==""+qr(i)&&(o.value=""+qr(i)):D!=="submit"&&D!=="reset"||o.removeAttribute("value"),i!=null?Oh(o,D,qr(i)):u!=null?Oh(o,D,qr(u)):p!=null&&o.removeAttribute("value"),E==null&&T!=null&&(o.defaultChecked=!!T),E!=null&&(o.checked=E&&typeof E!="function"&&typeof E!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?o.name=""+qr(B):o.removeAttribute("name")}function aA(o,i,u,p,E,T,D,B){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(o.type=T),i!=null||u!=null){if(!(T!=="submit"&&T!=="reset"||i!=null)){Os(o);return}u=u!=null?""+qr(u):"",i=i!=null?""+qr(i):u,B||i===o.value||(o.value=i),o.defaultValue=i}p=p??E,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=B?o.checked:!!p,o.defaultChecked=!!p,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(o.name=D),Os(o)}function Oh(o,i,u){i==="number"&&nf(o.ownerDocument)===o||o.defaultValue===""+u||(o.defaultValue=""+u)}function Ds(o,i,u,p){if(o=o.options,i){i={};for(var E=0;E<u.length;E++)i["$"+u[E]]=!0;for(u=0;u<o.length;u++)E=i.hasOwnProperty("$"+o[u].value),o[u].selected!==E&&(o[u].selected=E),E&&p&&(o[u].defaultSelected=!0)}else{for(u=""+qr(u),i=null,E=0;E<o.length;E++){if(o[E].value===u){o[E].selected=!0,p&&(o[E].defaultSelected=!0);return}i!==null||o[E].disabled||(i=o[E])}i!==null&&(i.selected=!0)}}function oA(o,i,u){if(i!=null&&(i=""+qr(i),i!==o.value&&(o.value=i),u==null)){o.defaultValue!==i&&(o.defaultValue=i);return}o.defaultValue=u!=null?""+qr(u):""}function iA(o,i,u,p){if(i==null){if(p!=null){if(u!=null)throw Error(n(92));if(J(p)){if(1<p.length)throw Error(n(93));p=p[0]}u=p}u==null&&(u=""),i=u}u=qr(i),o.defaultValue=u,p=o.textContent,p===u&&p!==""&&p!==null&&(o.value=p),Os(o)}function Ls(o,i){if(i){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=i;return}}o.textContent=i}var hV=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function sA(o,i,u){var p=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?o.setProperty(i,""):i==="float"?o.cssFloat="":o[i]="":p?o.setProperty(i,u):typeof u!="number"||u===0||hV.has(i)?i==="float"?o.cssFloat=u:o[i]=(""+u).trim():o[i]=u+"px"}function lA(o,i,u){if(i!=null&&typeof i!="object")throw Error(n(62));if(o=o.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||i!=null&&i.hasOwnProperty(p)||(p.indexOf("--")===0?o.setProperty(p,""):p==="float"?o.cssFloat="":o[p]="");for(var E in i)p=i[E],i.hasOwnProperty(E)&&u[E]!==p&&sA(o,E,p)}else for(var T in i)i.hasOwnProperty(T)&&sA(o,T,i[T])}function Dh(o){if(o.indexOf("-")===-1)return!1;switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gV=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vV=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function af(o){return vV.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function eo(){}var Lh=null;function Mh(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Ms=null,Ps=null;function cA(o){var i=Yt(o);if(i&&(o=i.stateNode)){var u=o[Be]||null;e:switch(o=i.stateNode,i.type){case"input":if(Ih(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=o;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Hn(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var p=u[i];if(p!==o&&p.form===o.form){var E=p[Be]||null;if(!E)throw Error(n(90));Ih(p,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(i=0;i<u.length;i++)p=u[i],p.form===o.form&&zo(p)}break e;case"textarea":oA(o,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&Ds(o,!!u.multiple,i,!1)}}}var Ph=!1;function uA(o,i,u){if(Ph)return o(i,u);Ph=!0;try{var p=o(i);return p}finally{if(Ph=!1,(Ms!==null||Ps!==null)&&(Gf(),Ms&&(i=Ms,o=Ps,Ps=Ms=null,cA(i),o)))for(i=0;i<o.length;i++)cA(o[i])}}function Nc(o,i){var u=o.stateNode;if(u===null)return null;var p=u[Be]||null;if(p===null)return null;u=p[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(u&&typeof u!="function")throw Error(n(231,i,typeof u));return u}var to=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jh=!1;if(to)try{var kc={};Object.defineProperty(kc,"passive",{get:function(){jh=!0}}),window.addEventListener("test",kc,kc),window.removeEventListener("test",kc,kc)}catch{jh=!1}var $o=null,Uh=null,of=null;function dA(){if(of)return of;var o,i=Uh,u=i.length,p,E="value"in $o?$o.value:$o.textContent,T=E.length;for(o=0;o<u&&i[o]===E[o];o++);var D=u-o;for(p=1;p<=D&&i[u-p]===E[T-p];p++);return of=E.slice(o,1<p?1-p:void 0)}function sf(o){var i=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&i===13&&(o=13)):o=i,o===10&&(o=13),32<=o||o===13?o:0}function lf(){return!0}function fA(){return!1}function hn(o){function i(u,p,E,T,D){this._reactName=u,this._targetInst=E,this.type=p,this.nativeEvent=T,this.target=D,this.currentTarget=null;for(var B in o)o.hasOwnProperty(B)&&(u=o[B],this[B]=u?u(T):T[B]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?lf:fA,this.isPropagationStopped=fA,this}return h(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=lf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=lf)},persist:function(){},isPersistent:lf}),i}var Fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cf=hn(Fi),Ic=h({},Fi,{view:0,detail:0}),bV=hn(Ic),Fh,zh,Oc,uf=h({},Ic,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bh,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Oc&&(Oc&&o.type==="mousemove"?(Fh=o.screenX-Oc.screenX,zh=o.screenY-Oc.screenY):zh=Fh=0,Oc=o),Fh)},movementY:function(o){return"movementY"in o?o.movementY:zh}}),pA=hn(uf),yV=h({},uf,{dataTransfer:0}),EV=hn(yV),SV=h({},Ic,{relatedTarget:0}),$h=hn(SV),xV=h({},Fi,{animationName:0,elapsedTime:0,pseudoElement:0}),wV=hn(xV),_V=h({},Fi,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),TV=hn(_V),RV=h({},Fi,{data:0}),mA=hn(RV),CV={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AV={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},NV={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kV(o){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(o):(o=NV[o])?!!i[o]:!1}function Bh(){return kV}var IV=h({},Ic,{key:function(o){if(o.key){var i=CV[o.key]||o.key;if(i!=="Unidentified")return i}return o.type==="keypress"?(o=sf(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?AV[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bh,charCode:function(o){return o.type==="keypress"?sf(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?sf(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),OV=hn(IV),DV=h({},uf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hA=hn(DV),LV=h({},Ic,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bh}),MV=hn(LV),PV=h({},Fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),jV=hn(PV),UV=h({},uf,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),FV=hn(UV),zV=h({},Fi,{newState:0,oldState:0}),$V=hn(zV),BV=[9,13,27,32],qh=to&&"CompositionEvent"in window,Dc=null;to&&"documentMode"in document&&(Dc=document.documentMode);var qV=to&&"TextEvent"in window&&!Dc,gA=to&&(!qh||Dc&&8<Dc&&11>=Dc),vA=" ",bA=!1;function yA(o,i){switch(o){case"keyup":return BV.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function EA(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var js=!1;function HV(o,i){switch(o){case"compositionend":return EA(i);case"keypress":return i.which!==32?null:(bA=!0,vA);case"textInput":return o=i.data,o===vA&&bA?null:o;default:return null}}function VV(o,i){if(js)return o==="compositionend"||!qh&&yA(o,i)?(o=dA(),of=Uh=$o=null,js=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return gA&&i.locale!=="ko"?null:i.data;default:return null}}var GV={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function SA(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i==="input"?!!GV[o.type]:i==="textarea"}function xA(o,i,u,p){Ms?Ps?Ps.push(p):Ps=[p]:Ms=p,i=Jf(i,"onChange"),0<i.length&&(u=new cf("onChange","change",null,u,p),o.push({event:u,listeners:i}))}var Lc=null,Mc=null;function WV(o){ak(o,0)}function df(o){var i=Pt(o);if(zo(i))return o}function wA(o,i){if(o==="change")return i}var _A=!1;if(to){var Hh;if(to){var Vh="oninput"in document;if(!Vh){var TA=document.createElement("div");TA.setAttribute("oninput","return;"),Vh=typeof TA.oninput=="function"}Hh=Vh}else Hh=!1;_A=Hh&&(!document.documentMode||9<document.documentMode)}function RA(){Lc&&(Lc.detachEvent("onpropertychange",CA),Mc=Lc=null)}function CA(o){if(o.propertyName==="value"&&df(Mc)){var i=[];xA(i,Mc,o,Mh(o)),uA(WV,i)}}function YV(o,i,u){o==="focusin"?(RA(),Lc=i,Mc=u,Lc.attachEvent("onpropertychange",CA)):o==="focusout"&&RA()}function KV(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return df(Mc)}function ZV(o,i){if(o==="click")return df(i)}function XV(o,i){if(o==="input"||o==="change")return df(i)}function QV(o,i){return o===i&&(o!==0||1/o===1/i)||o!==o&&i!==i}var Nn=typeof Object.is=="function"?Object.is:QV;function Pc(o,i){if(Nn(o,i))return!0;if(typeof o!="object"||o===null||typeof i!="object"||i===null)return!1;var u=Object.keys(o),p=Object.keys(i);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var E=u[p];if(!$e.call(i,E)||!Nn(o[E],i[E]))return!1}return!0}function AA(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function NA(o,i){var u=AA(o);o=0;for(var p;u;){if(u.nodeType===3){if(p=o+u.textContent.length,o<=i&&p>=i)return{node:u,offset:i-o};o=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=AA(u)}}function kA(o,i){return o&&i?o===i?!0:o&&o.nodeType===3?!1:i&&i.nodeType===3?kA(o,i.parentNode):"contains"in o?o.contains(i):o.compareDocumentPosition?!!(o.compareDocumentPosition(i)&16):!1:!1}function IA(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var i=nf(o.document);i instanceof o.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)o=i.contentWindow;else break;i=nf(o.document)}return i}function Gh(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i&&(i==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||i==="textarea"||o.contentEditable==="true")}var JV=to&&"documentMode"in document&&11>=document.documentMode,Us=null,Wh=null,jc=null,Yh=!1;function OA(o,i,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Yh||Us==null||Us!==nf(p)||(p=Us,"selectionStart"in p&&Gh(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),jc&&Pc(jc,p)||(jc=p,p=Jf(Wh,"onSelect"),0<p.length&&(i=new cf("onSelect","select",null,i,u),o.push({event:i,listeners:p}),i.target=Us)))}function zi(o,i){var u={};return u[o.toLowerCase()]=i.toLowerCase(),u["Webkit"+o]="webkit"+i,u["Moz"+o]="moz"+i,u}var Fs={animationend:zi("Animation","AnimationEnd"),animationiteration:zi("Animation","AnimationIteration"),animationstart:zi("Animation","AnimationStart"),transitionrun:zi("Transition","TransitionRun"),transitionstart:zi("Transition","TransitionStart"),transitioncancel:zi("Transition","TransitionCancel"),transitionend:zi("Transition","TransitionEnd")},Kh={},DA={};to&&(DA=document.createElement("div").style,"AnimationEvent"in window||(delete Fs.animationend.animation,delete Fs.animationiteration.animation,delete Fs.animationstart.animation),"TransitionEvent"in window||delete Fs.transitionend.transition);function $i(o){if(Kh[o])return Kh[o];if(!Fs[o])return o;var i=Fs[o],u;for(u in i)if(i.hasOwnProperty(u)&&u in DA)return Kh[o]=i[u];return o}var LA=$i("animationend"),MA=$i("animationiteration"),PA=$i("animationstart"),eG=$i("transitionrun"),tG=$i("transitionstart"),rG=$i("transitioncancel"),jA=$i("transitionend"),UA=new Map,Zh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Zh.push("scrollEnd");function da(o,i){UA.set(o,i),sn(i,[o])}var ff=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Vn=[],zs=0,Xh=0;function pf(){for(var o=zs,i=Xh=zs=0;i<o;){var u=Vn[i];Vn[i++]=null;var p=Vn[i];Vn[i++]=null;var E=Vn[i];Vn[i++]=null;var T=Vn[i];if(Vn[i++]=null,p!==null&&E!==null){var D=p.pending;D===null?E.next=E:(E.next=D.next,D.next=E),p.pending=E}T!==0&&FA(u,E,T)}}function mf(o,i,u,p){Vn[zs++]=o,Vn[zs++]=i,Vn[zs++]=u,Vn[zs++]=p,Xh|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function Qh(o,i,u,p){return mf(o,i,u,p),hf(o)}function Bi(o,i){return mf(o,null,null,i),hf(o)}function FA(o,i,u){o.lanes|=u;var p=o.alternate;p!==null&&(p.lanes|=u);for(var E=!1,T=o.return;T!==null;)T.childLanes|=u,p=T.alternate,p!==null&&(p.childLanes|=u),T.tag===22&&(o=T.stateNode,o===null||o._visibility&1||(E=!0)),o=T,T=T.return;return o.tag===3?(T=o.stateNode,E&&i!==null&&(E=31-fr(u),o=T.hiddenUpdates,p=o[E],p===null?o[E]=[i]:p.push(i),i.lane=u|536870912),T):null}function hf(o){if(50<ou)throw ou=0,sv=null,Error(n(185));for(var i=o.return;i!==null;)o=i,i=o.return;return o.tag===3?o.stateNode:null}var $s={};function nG(o,i,u,p){this.tag=o,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kn(o,i,u,p){return new nG(o,i,u,p)}function Jh(o){return o=o.prototype,!(!o||!o.isReactComponent)}function ro(o,i){var u=o.alternate;return u===null?(u=kn(o.tag,i,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=i,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&65011712,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,i=o.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u.refCleanup=o.refCleanup,u}function zA(o,i){o.flags&=65011714;var u=o.alternate;return u===null?(o.childLanes=0,o.lanes=i,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=u.childLanes,o.lanes=u.lanes,o.child=u.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,o.type=u.type,i=u.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),o}function gf(o,i,u,p,E,T){var D=0;if(p=o,typeof o=="function")Jh(o)&&(D=1);else if(typeof o=="string")D=l6(o,u,Y.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case L:return o=kn(31,u,i,E),o.elementType=L,o.lanes=T,o;case S:return qi(u.children,E,T,i);case R:D=8,E|=24;break;case x:return o=kn(12,u,i,E|2),o.elementType=x,o.lanes=T,o;case k:return o=kn(13,u,i,E),o.elementType=k,o.lanes=T,o;case A:return o=kn(19,u,i,E),o.elementType=A,o.lanes=T,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case C:D=10;break e;case _:D=9;break e;case N:D=11;break e;case I:D=14;break e;case O:D=16,p=null;break e}D=29,u=Error(n(130,o===null?"null":typeof o,"")),p=null}return i=kn(D,u,i,E),i.elementType=o,i.type=p,i.lanes=T,i}function qi(o,i,u,p){return o=kn(7,o,p,i),o.lanes=u,o}function eg(o,i,u){return o=kn(6,o,null,i),o.lanes=u,o}function $A(o){var i=kn(18,null,null,0);return i.stateNode=o,i}function tg(o,i,u){return i=kn(4,o.children!==null?o.children:[],o.key,i),i.lanes=u,i.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},i}var BA=new WeakMap;function Gn(o,i){if(typeof o=="object"&&o!==null){var u=BA.get(o);return u!==void 0?u:(i={value:o,source:i,stack:Pe(i)},BA.set(o,i),i)}return{value:o,source:i,stack:Pe(i)}}var Bs=[],qs=0,vf=null,Uc=0,Wn=[],Yn=0,Bo=null,Ra=1,Ca="";function no(o,i){Bs[qs++]=Uc,Bs[qs++]=vf,vf=o,Uc=i}function qA(o,i,u){Wn[Yn++]=Ra,Wn[Yn++]=Ca,Wn[Yn++]=Bo,Bo=o;var p=Ra;o=Ca;var E=32-fr(p)-1;p&=~(1<<E),u+=1;var T=32-fr(i)+E;if(30<T){var D=E-E%5;T=(p&(1<<D)-1).toString(32),p>>=D,E-=D,Ra=1<<32-fr(i)+E|u<<E|p,Ca=T+o}else Ra=1<<T|u<<E|p,Ca=o}function rg(o){o.return!==null&&(no(o,1),qA(o,1,0))}function ng(o){for(;o===vf;)vf=Bs[--qs],Bs[qs]=null,Uc=Bs[--qs],Bs[qs]=null;for(;o===Bo;)Bo=Wn[--Yn],Wn[Yn]=null,Ca=Wn[--Yn],Wn[Yn]=null,Ra=Wn[--Yn],Wn[Yn]=null}function HA(o,i){Wn[Yn++]=Ra,Wn[Yn++]=Ca,Wn[Yn++]=Bo,Ra=i.id,Ca=i.overflow,Bo=o}var Hr=null,Jt=null,Ct=!1,qo=null,Kn=!1,ag=Error(n(519));function Ho(o){var i=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fc(Gn(i,o)),ag}function VA(o){var i=o.stateNode,u=o.type,p=o.memoizedProps;switch(i[je]=o,i[Be]=p,u){case"dialog":St("cancel",i),St("close",i);break;case"iframe":case"object":case"embed":St("load",i);break;case"video":case"audio":for(u=0;u<su.length;u++)St(su[u],i);break;case"source":St("error",i);break;case"img":case"image":case"link":St("error",i),St("load",i);break;case"details":St("toggle",i);break;case"input":St("invalid",i),aA(i,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":St("invalid",i);break;case"textarea":St("invalid",i),iA(i,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||p.suppressHydrationWarning===!0||lk(i.textContent,u)?(p.popover!=null&&(St("beforetoggle",i),St("toggle",i)),p.onScroll!=null&&St("scroll",i),p.onScrollEnd!=null&&St("scrollend",i),p.onClick!=null&&(i.onclick=eo),i=!0):i=!1,i||Ho(o,!0)}function GA(o){for(Hr=o.return;Hr;)switch(Hr.tag){case 5:case 31:case 13:Kn=!1;return;case 27:case 3:Kn=!0;return;default:Hr=Hr.return}}function Hs(o){if(o!==Hr)return!1;if(!Ct)return GA(o),Ct=!0,!1;var i=o.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=o.type,u=!(u!=="form"&&u!=="button")||xv(o.type,o.memoizedProps)),u=!u),u&&Jt&&Ho(o),GA(o),i===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));Jt=vk(o)}else if(i===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));Jt=vk(o)}else i===27?(i=Jt,ai(o.type)?(o=Cv,Cv=null,Jt=o):Jt=i):Jt=Hr?Xn(o.stateNode.nextSibling):null;return!0}function Hi(){Jt=Hr=null,Ct=!1}function og(){var o=qo;return o!==null&&(yn===null?yn=o:yn.push.apply(yn,o),qo=null),o}function Fc(o){qo===null?qo=[o]:qo.push(o)}var ig=U(null),Vi=null,ao=null;function Vo(o,i,u){$(ig,i._currentValue),i._currentValue=u}function oo(o){o._currentValue=ig.current,q(ig)}function sg(o,i,u){for(;o!==null;){var p=o.alternate;if((o.childLanes&i)!==i?(o.childLanes|=i,p!==null&&(p.childLanes|=i)):p!==null&&(p.childLanes&i)!==i&&(p.childLanes|=i),o===u)break;o=o.return}}function lg(o,i,u,p){var E=o.child;for(E!==null&&(E.return=o);E!==null;){var T=E.dependencies;if(T!==null){var D=E.child;T=T.firstContext;e:for(;T!==null;){var B=T;T=E;for(var ne=0;ne<i.length;ne++)if(B.context===i[ne]){T.lanes|=u,B=T.alternate,B!==null&&(B.lanes|=u),sg(T.return,u,o),p||(D=null);break e}T=B.next}}else if(E.tag===18){if(D=E.return,D===null)throw Error(n(341));D.lanes|=u,T=D.alternate,T!==null&&(T.lanes|=u),sg(D,u,o),D=null}else D=E.child;if(D!==null)D.return=E;else for(D=E;D!==null;){if(D===o){D=null;break}if(E=D.sibling,E!==null){E.return=D.return,D=E;break}D=D.return}E=D}}function Vs(o,i,u,p){o=null;for(var E=i,T=!1;E!==null;){if(!T){if((E.flags&524288)!==0)T=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var D=E.alternate;if(D===null)throw Error(n(387));if(D=D.memoizedProps,D!==null){var B=E.type;Nn(E.pendingProps.value,D.value)||(o!==null?o.push(B):o=[B])}}else if(E===z.current){if(D=E.alternate,D===null)throw Error(n(387));D.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(o!==null?o.push(fu):o=[fu])}E=E.return}o!==null&&lg(i,o,u,p),i.flags|=262144}function bf(o){for(o=o.firstContext;o!==null;){if(!Nn(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Gi(o){Vi=o,ao=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Vr(o){return WA(Vi,o)}function yf(o,i){return Vi===null&&Gi(o),WA(o,i)}function WA(o,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},ao===null){if(o===null)throw Error(n(308));ao=i,o.dependencies={lanes:0,firstContext:i},o.flags|=524288}else ao=ao.next=i;return u}var aG=typeof AbortController<"u"?AbortController:function(){var o=[],i=this.signal={aborted:!1,addEventListener:function(u,p){o.push(p)}};this.abort=function(){i.aborted=!0,o.forEach(function(u){return u()})}},oG=t.unstable_scheduleCallback,iG=t.unstable_NormalPriority,xr={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cg(){return{controller:new aG,data:new Map,refCount:0}}function zc(o){o.refCount--,o.refCount===0&&oG(iG,function(){o.controller.abort()})}var $c=null,ug=0,Gs=0,Ws=null;function sG(o,i){if($c===null){var u=$c=[];ug=0,Gs=pv(),Ws={status:"pending",value:void 0,then:function(p){u.push(p)}}}return ug++,i.then(YA,YA),i}function YA(){if(--ug===0&&$c!==null){Ws!==null&&(Ws.status="fulfilled");var o=$c;$c=null,Gs=0,Ws=null;for(var i=0;i<o.length;i++)(0,o[i])()}}function lG(o,i){var u=[],p={status:"pending",value:null,reason:null,then:function(E){u.push(E)}};return o.then(function(){p.status="fulfilled",p.value=i;for(var E=0;E<u.length;E++)(0,u[E])(i)},function(E){for(p.status="rejected",p.reason=E,E=0;E<u.length;E++)(0,u[E])(void 0)}),p}var KA=j.S;j.S=function(o,i){O1=we(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&sG(o,i),KA!==null&&KA(o,i)};var Wi=U(null);function dg(){var o=Wi.current;return o!==null?o:Kt.pooledCache}function Ef(o,i){i===null?$(Wi,Wi.current):$(Wi,i.pool)}function ZA(){var o=dg();return o===null?null:{parent:xr._currentValue,pool:o}}var Ys=Error(n(460)),fg=Error(n(474)),Sf=Error(n(542)),xf={then:function(){}};function XA(o){return o=o.status,o==="fulfilled"||o==="rejected"}function QA(o,i,u){switch(u=o[u],u===void 0?o.push(i):u!==i&&(i.then(eo,eo),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw o=i.reason,eN(o),o;default:if(typeof i.status=="string")i.then(eo,eo);else{if(o=Kt,o!==null&&100<o.shellSuspendCounter)throw Error(n(482));o=i,o.status="pending",o.then(function(p){if(i.status==="pending"){var E=i;E.status="fulfilled",E.value=p}},function(p){if(i.status==="pending"){var E=i;E.status="rejected",E.reason=p}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw o=i.reason,eN(o),o}throw Ki=i,Ys}}function Yi(o){try{var i=o._init;return i(o._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Ki=u,Ys):u}}var Ki=null;function JA(){if(Ki===null)throw Error(n(459));var o=Ki;return Ki=null,o}function eN(o){if(o===Ys||o===Sf)throw Error(n(483))}var Ks=null,Bc=0;function wf(o){var i=Bc;return Bc+=1,Ks===null&&(Ks=[]),QA(Ks,o,i)}function qc(o,i){i=i.props.ref,o.ref=i!==void 0?i:null}function _f(o,i){throw i.$$typeof===v?Error(n(525)):(o=Object.prototype.toString.call(i),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":o)))}function tN(o){function i(ue,se){if(o){var fe=ue.deletions;fe===null?(ue.deletions=[se],ue.flags|=16):fe.push(se)}}function u(ue,se){if(!o)return null;for(;se!==null;)i(ue,se),se=se.sibling;return null}function p(ue){for(var se=new Map;ue!==null;)ue.key!==null?se.set(ue.key,ue):se.set(ue.index,ue),ue=ue.sibling;return se}function E(ue,se){return ue=ro(ue,se),ue.index=0,ue.sibling=null,ue}function T(ue,se,fe){return ue.index=fe,o?(fe=ue.alternate,fe!==null?(fe=fe.index,fe<se?(ue.flags|=67108866,se):fe):(ue.flags|=67108866,se)):(ue.flags|=1048576,se)}function D(ue){return o&&ue.alternate===null&&(ue.flags|=67108866),ue}function B(ue,se,fe,Te){return se===null||se.tag!==6?(se=eg(fe,ue.mode,Te),se.return=ue,se):(se=E(se,fe),se.return=ue,se)}function ne(ue,se,fe,Te){var et=fe.type;return et===S?Se(ue,se,fe.props.children,Te,fe.key):se!==null&&(se.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===O&&Yi(et)===se.type)?(se=E(se,fe.props),qc(se,fe),se.return=ue,se):(se=gf(fe.type,fe.key,fe.props,null,ue.mode,Te),qc(se,fe),se.return=ue,se)}function pe(ue,se,fe,Te){return se===null||se.tag!==4||se.stateNode.containerInfo!==fe.containerInfo||se.stateNode.implementation!==fe.implementation?(se=tg(fe,ue.mode,Te),se.return=ue,se):(se=E(se,fe.children||[]),se.return=ue,se)}function Se(ue,se,fe,Te,et){return se===null||se.tag!==7?(se=qi(fe,ue.mode,Te,et),se.return=ue,se):(se=E(se,fe),se.return=ue,se)}function Re(ue,se,fe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=eg(""+se,ue.mode,fe),se.return=ue,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case y:return fe=gf(se.type,se.key,se.props,null,ue.mode,fe),qc(fe,se),fe.return=ue,fe;case w:return se=tg(se,ue.mode,fe),se.return=ue,se;case O:return se=Yi(se),Re(ue,se,fe)}if(J(se)||W(se))return se=qi(se,ue.mode,fe,null),se.return=ue,se;if(typeof se.then=="function")return Re(ue,wf(se),fe);if(se.$$typeof===C)return Re(ue,yf(ue,se),fe);_f(ue,se)}return null}function he(ue,se,fe,Te){var et=se!==null?se.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return et!==null?null:B(ue,se,""+fe,Te);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case y:return fe.key===et?ne(ue,se,fe,Te):null;case w:return fe.key===et?pe(ue,se,fe,Te):null;case O:return fe=Yi(fe),he(ue,se,fe,Te)}if(J(fe)||W(fe))return et!==null?null:Se(ue,se,fe,Te,null);if(typeof fe.then=="function")return he(ue,se,wf(fe),Te);if(fe.$$typeof===C)return he(ue,se,yf(ue,fe),Te);_f(ue,fe)}return null}function Ee(ue,se,fe,Te,et){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return ue=ue.get(fe)||null,B(se,ue,""+Te,et);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case y:return ue=ue.get(Te.key===null?fe:Te.key)||null,ne(se,ue,Te,et);case w:return ue=ue.get(Te.key===null?fe:Te.key)||null,pe(se,ue,Te,et);case O:return Te=Yi(Te),Ee(ue,se,fe,Te,et)}if(J(Te)||W(Te))return ue=ue.get(fe)||null,Se(se,ue,Te,et,null);if(typeof Te.then=="function")return Ee(ue,se,fe,wf(Te),et);if(Te.$$typeof===C)return Ee(ue,se,fe,yf(se,Te),et);_f(se,Te)}return null}function Ve(ue,se,fe,Te){for(var et=null,kt=null,Ke=se,ht=se=0,Tt=null;Ke!==null&&ht<fe.length;ht++){Ke.index>ht?(Tt=Ke,Ke=null):Tt=Ke.sibling;var It=he(ue,Ke,fe[ht],Te);if(It===null){Ke===null&&(Ke=Tt);break}o&&Ke&&It.alternate===null&&i(ue,Ke),se=T(It,se,ht),kt===null?et=It:kt.sibling=It,kt=It,Ke=Tt}if(ht===fe.length)return u(ue,Ke),Ct&&no(ue,ht),et;if(Ke===null){for(;ht<fe.length;ht++)Ke=Re(ue,fe[ht],Te),Ke!==null&&(se=T(Ke,se,ht),kt===null?et=Ke:kt.sibling=Ke,kt=Ke);return Ct&&no(ue,ht),et}for(Ke=p(Ke);ht<fe.length;ht++)Tt=Ee(Ke,ue,ht,fe[ht],Te),Tt!==null&&(o&&Tt.alternate!==null&&Ke.delete(Tt.key===null?ht:Tt.key),se=T(Tt,se,ht),kt===null?et=Tt:kt.sibling=Tt,kt=Tt);return o&&Ke.forEach(function(ci){return i(ue,ci)}),Ct&&no(ue,ht),et}function rt(ue,se,fe,Te){if(fe==null)throw Error(n(151));for(var et=null,kt=null,Ke=se,ht=se=0,Tt=null,It=fe.next();Ke!==null&&!It.done;ht++,It=fe.next()){Ke.index>ht?(Tt=Ke,Ke=null):Tt=Ke.sibling;var ci=he(ue,Ke,It.value,Te);if(ci===null){Ke===null&&(Ke=Tt);break}o&&Ke&&ci.alternate===null&&i(ue,Ke),se=T(ci,se,ht),kt===null?et=ci:kt.sibling=ci,kt=ci,Ke=Tt}if(It.done)return u(ue,Ke),Ct&&no(ue,ht),et;if(Ke===null){for(;!It.done;ht++,It=fe.next())It=Re(ue,It.value,Te),It!==null&&(se=T(It,se,ht),kt===null?et=It:kt.sibling=It,kt=It);return Ct&&no(ue,ht),et}for(Ke=p(Ke);!It.done;ht++,It=fe.next())It=Ee(Ke,ue,ht,It.value,Te),It!==null&&(o&&It.alternate!==null&&Ke.delete(It.key===null?ht:It.key),se=T(It,se,ht),kt===null?et=It:kt.sibling=It,kt=It);return o&&Ke.forEach(function(y6){return i(ue,y6)}),Ct&&no(ue,ht),et}function Vt(ue,se,fe,Te){if(typeof fe=="object"&&fe!==null&&fe.type===S&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case y:e:{for(var et=fe.key;se!==null;){if(se.key===et){if(et=fe.type,et===S){if(se.tag===7){u(ue,se.sibling),Te=E(se,fe.props.children),Te.return=ue,ue=Te;break e}}else if(se.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===O&&Yi(et)===se.type){u(ue,se.sibling),Te=E(se,fe.props),qc(Te,fe),Te.return=ue,ue=Te;break e}u(ue,se);break}else i(ue,se);se=se.sibling}fe.type===S?(Te=qi(fe.props.children,ue.mode,Te,fe.key),Te.return=ue,ue=Te):(Te=gf(fe.type,fe.key,fe.props,null,ue.mode,Te),qc(Te,fe),Te.return=ue,ue=Te)}return D(ue);case w:e:{for(et=fe.key;se!==null;){if(se.key===et)if(se.tag===4&&se.stateNode.containerInfo===fe.containerInfo&&se.stateNode.implementation===fe.implementation){u(ue,se.sibling),Te=E(se,fe.children||[]),Te.return=ue,ue=Te;break e}else{u(ue,se);break}else i(ue,se);se=se.sibling}Te=tg(fe,ue.mode,Te),Te.return=ue,ue=Te}return D(ue);case O:return fe=Yi(fe),Vt(ue,se,fe,Te)}if(J(fe))return Ve(ue,se,fe,Te);if(W(fe)){if(et=W(fe),typeof et!="function")throw Error(n(150));return fe=et.call(fe),rt(ue,se,fe,Te)}if(typeof fe.then=="function")return Vt(ue,se,wf(fe),Te);if(fe.$$typeof===C)return Vt(ue,se,yf(ue,fe),Te);_f(ue,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,se!==null&&se.tag===6?(u(ue,se.sibling),Te=E(se,fe),Te.return=ue,ue=Te):(u(ue,se),Te=eg(fe,ue.mode,Te),Te.return=ue,ue=Te),D(ue)):u(ue,se)}return function(ue,se,fe,Te){try{Bc=0;var et=Vt(ue,se,fe,Te);return Ks=null,et}catch(Ke){if(Ke===Ys||Ke===Sf)throw Ke;var kt=kn(29,Ke,null,ue.mode);return kt.lanes=Te,kt.return=ue,kt}finally{}}}var Zi=tN(!0),rN=tN(!1),Go=!1;function pg(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mg(o,i){o=o.updateQueue,i.updateQueue===o&&(i.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Wo(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Yo(o,i,u){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(Lt&2)!==0){var E=p.pending;return E===null?i.next=i:(i.next=E.next,E.next=i),p.pending=i,i=hf(o),FA(o,null,u),i}return mf(o,p,i,u),hf(o)}function Hc(o,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var p=i.lanes;p&=o.pendingLanes,u|=p,i.lanes=u,en(o,u)}}function hg(o,i){var u=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var E=null,T=null;if(u=u.firstBaseUpdate,u!==null){do{var D={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};T===null?E=T=D:T=T.next=D,u=u.next}while(u!==null);T===null?E=T=i:T=T.next=i}else E=T=i;u={baseState:p.baseState,firstBaseUpdate:E,lastBaseUpdate:T,shared:p.shared,callbacks:p.callbacks},o.updateQueue=u;return}o=u.lastBaseUpdate,o===null?u.firstBaseUpdate=i:o.next=i,u.lastBaseUpdate=i}var gg=!1;function Vc(){if(gg){var o=Ws;if(o!==null)throw o}}function Gc(o,i,u,p){gg=!1;var E=o.updateQueue;Go=!1;var T=E.firstBaseUpdate,D=E.lastBaseUpdate,B=E.shared.pending;if(B!==null){E.shared.pending=null;var ne=B,pe=ne.next;ne.next=null,D===null?T=pe:D.next=pe,D=ne;var Se=o.alternate;Se!==null&&(Se=Se.updateQueue,B=Se.lastBaseUpdate,B!==D&&(B===null?Se.firstBaseUpdate=pe:B.next=pe,Se.lastBaseUpdate=ne))}if(T!==null){var Re=E.baseState;D=0,Se=pe=ne=null,B=T;do{var he=B.lane&-536870913,Ee=he!==B.lane;if(Ee?(_t&he)===he:(p&he)===he){he!==0&&he===Gs&&(gg=!0),Se!==null&&(Se=Se.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var Ve=o,rt=B;he=i;var Vt=u;switch(rt.tag){case 1:if(Ve=rt.payload,typeof Ve=="function"){Re=Ve.call(Vt,Re,he);break e}Re=Ve;break e;case 3:Ve.flags=Ve.flags&-65537|128;case 0:if(Ve=rt.payload,he=typeof Ve=="function"?Ve.call(Vt,Re,he):Ve,he==null)break e;Re=h({},Re,he);break e;case 2:Go=!0}}he=B.callback,he!==null&&(o.flags|=64,Ee&&(o.flags|=8192),Ee=E.callbacks,Ee===null?E.callbacks=[he]:Ee.push(he))}else Ee={lane:he,tag:B.tag,payload:B.payload,callback:B.callback,next:null},Se===null?(pe=Se=Ee,ne=Re):Se=Se.next=Ee,D|=he;if(B=B.next,B===null){if(B=E.shared.pending,B===null)break;Ee=B,B=Ee.next,Ee.next=null,E.lastBaseUpdate=Ee,E.shared.pending=null}}while(!0);Se===null&&(ne=Re),E.baseState=ne,E.firstBaseUpdate=pe,E.lastBaseUpdate=Se,T===null&&(E.shared.lanes=0),Jo|=D,o.lanes=D,o.memoizedState=Re}}function nN(o,i){if(typeof o!="function")throw Error(n(191,o));o.call(i)}function aN(o,i){var u=o.callbacks;if(u!==null)for(o.callbacks=null,o=0;o<u.length;o++)nN(u[o],i)}var Zs=U(null),Tf=U(0);function oN(o,i){o=ho,$(Tf,o),$(Zs,i),ho=o|i.baseLanes}function vg(){$(Tf,ho),$(Zs,Zs.current)}function bg(){ho=Tf.current,q(Zs),q(Tf)}var In=U(null),Zn=null;function Ko(o){var i=o.alternate;$(br,br.current&1),$(In,o),Zn===null&&(i===null||Zs.current!==null||i.memoizedState!==null)&&(Zn=o)}function yg(o){$(br,br.current),$(In,o),Zn===null&&(Zn=o)}function iN(o){o.tag===22?($(br,br.current),$(In,o),Zn===null&&(Zn=o)):Zo()}function Zo(){$(br,br.current),$(In,In.current)}function On(o){q(In),Zn===o&&(Zn=null),q(br)}var br=U(0);function Rf(o){for(var i=o;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Tv(u)||Rv(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break;for(;i.sibling===null;){if(i.return===null||i.return===o)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var io=0,dt=null,qt=null,wr=null,Cf=!1,Xs=!1,Xi=!1,Af=0,Wc=0,Qs=null,cG=0;function pr(){throw Error(n(321))}function Eg(o,i){if(i===null)return!1;for(var u=0;u<i.length&&u<o.length;u++)if(!Nn(o[u],i[u]))return!1;return!0}function Sg(o,i,u,p,E,T){return io=T,dt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,j.H=o===null||o.memoizedState===null?qN:Pg,Xi=!1,T=u(p,E),Xi=!1,Xs&&(T=lN(i,u,p,E)),sN(o),T}function sN(o){j.H=Zc;var i=qt!==null&&qt.next!==null;if(io=0,wr=qt=dt=null,Cf=!1,Wc=0,Qs=null,i)throw Error(n(300));o===null||_r||(o=o.dependencies,o!==null&&bf(o)&&(_r=!0))}function lN(o,i,u,p){dt=o;var E=0;do{if(Xs&&(Qs=null),Wc=0,Xs=!1,25<=E)throw Error(n(301));if(E+=1,wr=qt=null,o.updateQueue!=null){var T=o.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}j.H=HN,T=i(u,p)}while(Xs);return T}function uG(){var o=j.H,i=o.useState()[0];return i=typeof i.then=="function"?Yc(i):i,o=o.useState()[0],(qt!==null?qt.memoizedState:null)!==o&&(dt.flags|=1024),i}function xg(){var o=Af!==0;return Af=0,o}function wg(o,i,u){i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~u}function _g(o){if(Cf){for(o=o.memoizedState;o!==null;){var i=o.queue;i!==null&&(i.pending=null),o=o.next}Cf=!1}io=0,wr=qt=dt=null,Xs=!1,Wc=Af=0,Qs=null}function ln(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wr===null?dt.memoizedState=wr=o:wr=wr.next=o,wr}function yr(){if(qt===null){var o=dt.alternate;o=o!==null?o.memoizedState:null}else o=qt.next;var i=wr===null?dt.memoizedState:wr.next;if(i!==null)wr=i,qt=o;else{if(o===null)throw dt.alternate===null?Error(n(467)):Error(n(310));qt=o,o={memoizedState:qt.memoizedState,baseState:qt.baseState,baseQueue:qt.baseQueue,queue:qt.queue,next:null},wr===null?dt.memoizedState=wr=o:wr=wr.next=o}return wr}function Nf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yc(o){var i=Wc;return Wc+=1,Qs===null&&(Qs=[]),o=QA(Qs,o,i),i=dt,(wr===null?i.memoizedState:wr.next)===null&&(i=i.alternate,j.H=i===null||i.memoizedState===null?qN:Pg),o}function kf(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Yc(o);if(o.$$typeof===C)return Vr(o)}throw Error(n(438,String(o)))}function Tg(o){var i=null,u=dt.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var p=dt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(i={data:p.data.map(function(E){return E.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Nf(),dt.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(o),p=0;p<o;p++)u[p]=M;return i.index++,u}function so(o,i){return typeof i=="function"?i(o):i}function If(o){var i=yr();return Rg(i,qt,o)}function Rg(o,i,u){var p=o.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=u;var E=o.baseQueue,T=p.pending;if(T!==null){if(E!==null){var D=E.next;E.next=T.next,T.next=D}i.baseQueue=E=T,p.pending=null}if(T=o.baseState,E===null)o.memoizedState=T;else{i=E.next;var B=D=null,ne=null,pe=i,Se=!1;do{var Re=pe.lane&-536870913;if(Re!==pe.lane?(_t&Re)===Re:(io&Re)===Re){var he=pe.revertLane;if(he===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null}),Re===Gs&&(Se=!0);else if((io&he)===he){pe=pe.next,he===Gs&&(Se=!0);continue}else Re={lane:0,revertLane:pe.revertLane,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},ne===null?(B=ne=Re,D=T):ne=ne.next=Re,dt.lanes|=he,Jo|=he;Re=pe.action,Xi&&u(T,Re),T=pe.hasEagerState?pe.eagerState:u(T,Re)}else he={lane:Re,revertLane:pe.revertLane,gesture:pe.gesture,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},ne===null?(B=ne=he,D=T):ne=ne.next=he,dt.lanes|=Re,Jo|=Re;pe=pe.next}while(pe!==null&&pe!==i);if(ne===null?D=T:ne.next=B,!Nn(T,o.memoizedState)&&(_r=!0,Se&&(u=Ws,u!==null)))throw u;o.memoizedState=T,o.baseState=D,o.baseQueue=ne,p.lastRenderedState=T}return E===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function Cg(o){var i=yr(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var p=u.dispatch,E=u.pending,T=i.memoizedState;if(E!==null){u.pending=null;var D=E=E.next;do T=o(T,D.action),D=D.next;while(D!==E);Nn(T,i.memoizedState)||(_r=!0),i.memoizedState=T,i.baseQueue===null&&(i.baseState=T),u.lastRenderedState=T}return[T,p]}function cN(o,i,u){var p=dt,E=yr(),T=Ct;if(T){if(u===void 0)throw Error(n(407));u=u()}else u=i();var D=!Nn((qt||E).memoizedState,u);if(D&&(E.memoizedState=u,_r=!0),E=E.queue,kg(fN.bind(null,p,E,o),[o]),E.getSnapshot!==i||D||wr!==null&&wr.memoizedState.tag&1){if(p.flags|=2048,Js(9,{destroy:void 0},dN.bind(null,p,E,u,i),null),Kt===null)throw Error(n(349));T||(io&127)!==0||uN(p,i,u)}return u}function uN(o,i,u){o.flags|=16384,o={getSnapshot:i,value:u},i=dt.updateQueue,i===null?(i=Nf(),dt.updateQueue=i,i.stores=[o]):(u=i.stores,u===null?i.stores=[o]:u.push(o))}function dN(o,i,u,p){i.value=u,i.getSnapshot=p,pN(i)&&mN(o)}function fN(o,i,u){return u(function(){pN(i)&&mN(o)})}function pN(o){var i=o.getSnapshot;o=o.value;try{var u=i();return!Nn(o,u)}catch{return!0}}function mN(o){var i=Bi(o,2);i!==null&&En(i,o,2)}function Ag(o){var i=ln();if(typeof o=="function"){var u=o;if(o=u(),Xi){Zt(!0);try{u()}finally{Zt(!1)}}}return i.memoizedState=i.baseState=o,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:o},i}function hN(o,i,u,p){return o.baseState=u,Rg(o,qt,typeof p=="function"?p:so)}function dG(o,i,u,p,E){if(Lf(o))throw Error(n(485));if(o=i.action,o!==null){var T={payload:E,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){T.listeners.push(D)}};j.T!==null?u(!0):T.isTransition=!1,p(T),u=i.pending,u===null?(T.next=i.pending=T,gN(i,T)):(T.next=u.next,i.pending=u.next=T)}}function gN(o,i){var u=i.action,p=i.payload,E=o.state;if(i.isTransition){var T=j.T,D={};j.T=D;try{var B=u(E,p),ne=j.S;ne!==null&&ne(D,B),vN(o,i,B)}catch(pe){Ng(o,i,pe)}finally{T!==null&&D.types!==null&&(T.types=D.types),j.T=T}}else try{T=u(E,p),vN(o,i,T)}catch(pe){Ng(o,i,pe)}}function vN(o,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){bN(o,i,p)},function(p){return Ng(o,i,p)}):bN(o,i,u)}function bN(o,i,u){i.status="fulfilled",i.value=u,yN(i),o.state=u,i=o.pending,i!==null&&(u=i.next,u===i?o.pending=null:(u=u.next,i.next=u,gN(o,u)))}function Ng(o,i,u){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do i.status="rejected",i.reason=u,yN(i),i=i.next;while(i!==p)}o.action=null}function yN(o){o=o.listeners;for(var i=0;i<o.length;i++)(0,o[i])()}function EN(o,i){return i}function SN(o,i){if(Ct){var u=Kt.formState;if(u!==null){e:{var p=dt;if(Ct){if(Jt){t:{for(var E=Jt,T=Kn;E.nodeType!==8;){if(!T){E=null;break t}if(E=Xn(E.nextSibling),E===null){E=null;break t}}T=E.data,E=T==="F!"||T==="F"?E:null}if(E){Jt=Xn(E.nextSibling),p=E.data==="F!";break e}}Ho(p)}p=!1}p&&(i=u[0])}}return u=ln(),u.memoizedState=u.baseState=i,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:EN,lastRenderedState:i},u.queue=p,u=zN.bind(null,dt,p),p.dispatch=u,p=Ag(!1),T=Mg.bind(null,dt,!1,p.queue),p=ln(),E={state:i,dispatch:null,action:o,pending:null},p.queue=E,u=dG.bind(null,dt,E,T,u),E.dispatch=u,p.memoizedState=o,[i,u,!1]}function xN(o){var i=yr();return wN(i,qt,o)}function wN(o,i,u){if(i=Rg(o,i,EN)[0],o=If(so)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var p=Yc(i)}catch(D){throw D===Ys?Sf:D}else p=i;i=yr();var E=i.queue,T=E.dispatch;return u!==i.memoizedState&&(dt.flags|=2048,Js(9,{destroy:void 0},fG.bind(null,E,u),null)),[p,T,o]}function fG(o,i){o.action=i}function _N(o){var i=yr(),u=qt;if(u!==null)return wN(i,u,o);yr(),i=i.memoizedState,u=yr();var p=u.queue.dispatch;return u.memoizedState=o,[i,p,!1]}function Js(o,i,u,p){return o={tag:o,create:u,deps:p,inst:i,next:null},i=dt.updateQueue,i===null&&(i=Nf(),dt.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=o.next=o:(p=u.next,u.next=o,o.next=p,i.lastEffect=o),o}function TN(){return yr().memoizedState}function Of(o,i,u,p){var E=ln();dt.flags|=o,E.memoizedState=Js(1|i,{destroy:void 0},u,p===void 0?null:p)}function Df(o,i,u,p){var E=yr();p=p===void 0?null:p;var T=E.memoizedState.inst;qt!==null&&p!==null&&Eg(p,qt.memoizedState.deps)?E.memoizedState=Js(i,T,u,p):(dt.flags|=o,E.memoizedState=Js(1|i,T,u,p))}function RN(o,i){Of(8390656,8,o,i)}function kg(o,i){Df(2048,8,o,i)}function pG(o){dt.flags|=4;var i=dt.updateQueue;if(i===null)i=Nf(),dt.updateQueue=i,i.events=[o];else{var u=i.events;u===null?i.events=[o]:u.push(o)}}function CN(o){var i=yr().memoizedState;return pG({ref:i,nextImpl:o}),function(){if((Lt&2)!==0)throw Error(n(440));return i.impl.apply(void 0,arguments)}}function AN(o,i){return Df(4,2,o,i)}function NN(o,i){return Df(4,4,o,i)}function kN(o,i){if(typeof i=="function"){o=o();var u=i(o);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return o=o(),i.current=o,function(){i.current=null}}function IN(o,i,u){u=u!=null?u.concat([o]):null,Df(4,4,kN.bind(null,i,o),u)}function Ig(){}function ON(o,i){var u=yr();i=i===void 0?null:i;var p=u.memoizedState;return i!==null&&Eg(i,p[1])?p[0]:(u.memoizedState=[o,i],o)}function DN(o,i){var u=yr();i=i===void 0?null:i;var p=u.memoizedState;if(i!==null&&Eg(i,p[1]))return p[0];if(p=o(),Xi){Zt(!0);try{o()}finally{Zt(!1)}}return u.memoizedState=[p,i],p}function Og(o,i,u){return u===void 0||(io&1073741824)!==0&&(_t&261930)===0?o.memoizedState=i:(o.memoizedState=u,o=L1(),dt.lanes|=o,Jo|=o,u)}function LN(o,i,u,p){return Nn(u,i)?u:Zs.current!==null?(o=Og(o,u,p),Nn(o,i)||(_r=!0),o):(io&42)===0||(io&1073741824)!==0&&(_t&261930)===0?(_r=!0,o.memoizedState=u):(o=L1(),dt.lanes|=o,Jo|=o,i)}function MN(o,i,u,p,E){var T=G.p;G.p=T!==0&&8>T?T:8;var D=j.T,B={};j.T=B,Mg(o,!1,i,u);try{var ne=E(),pe=j.S;if(pe!==null&&pe(B,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var Se=lG(ne,p);Kc(o,i,Se,Mn(o))}else Kc(o,i,p,Mn(o))}catch(Re){Kc(o,i,{then:function(){},status:"rejected",reason:Re},Mn())}finally{G.p=T,D!==null&&B.types!==null&&(D.types=B.types),j.T=D}}function mG(){}function Dg(o,i,u,p){if(o.tag!==5)throw Error(n(476));var E=PN(o).queue;MN(o,E,i,V,u===null?mG:function(){return jN(o),u(p)})}function PN(o){var i=o.memoizedState;if(i!==null)return i;i={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:V},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:u},next:null},o.memoizedState=i,o=o.alternate,o!==null&&(o.memoizedState=i),i}function jN(o){var i=PN(o);i.next===null&&(i=o.alternate.memoizedState),Kc(o,i.next.queue,{},Mn())}function Lg(){return Vr(fu)}function UN(){return yr().memoizedState}function FN(){return yr().memoizedState}function hG(o){for(var i=o.return;i!==null;){switch(i.tag){case 24:case 3:var u=Mn();o=Wo(u);var p=Yo(i,o,u);p!==null&&(En(p,i,u),Hc(p,i,u)),i={cache:cg()},o.payload=i;return}i=i.return}}function gG(o,i,u){var p=Mn();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Lf(o)?$N(i,u):(u=Qh(o,i,u,p),u!==null&&(En(u,o,p),BN(u,i,p)))}function zN(o,i,u){var p=Mn();Kc(o,i,u,p)}function Kc(o,i,u,p){var E={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Lf(o))$N(i,E);else{var T=o.alternate;if(o.lanes===0&&(T===null||T.lanes===0)&&(T=i.lastRenderedReducer,T!==null))try{var D=i.lastRenderedState,B=T(D,u);if(E.hasEagerState=!0,E.eagerState=B,Nn(B,D))return mf(o,i,E,0),Kt===null&&pf(),!1}catch{}finally{}if(u=Qh(o,i,E,p),u!==null)return En(u,o,p),BN(u,i,p),!0}return!1}function Mg(o,i,u,p){if(p={lane:2,revertLane:pv(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Lf(o)){if(i)throw Error(n(479))}else i=Qh(o,u,p,2),i!==null&&En(i,o,2)}function Lf(o){var i=o.alternate;return o===dt||i!==null&&i===dt}function $N(o,i){Xs=Cf=!0;var u=o.pending;u===null?i.next=i:(i.next=u.next,u.next=i),o.pending=i}function BN(o,i,u){if((u&4194048)!==0){var p=i.lanes;p&=o.pendingLanes,u|=p,i.lanes=u,en(o,u)}}var Zc={readContext:Vr,use:kf,useCallback:pr,useContext:pr,useEffect:pr,useImperativeHandle:pr,useLayoutEffect:pr,useInsertionEffect:pr,useMemo:pr,useReducer:pr,useRef:pr,useState:pr,useDebugValue:pr,useDeferredValue:pr,useTransition:pr,useSyncExternalStore:pr,useId:pr,useHostTransitionStatus:pr,useFormState:pr,useActionState:pr,useOptimistic:pr,useMemoCache:pr,useCacheRefresh:pr};Zc.useEffectEvent=pr;var qN={readContext:Vr,use:kf,useCallback:function(o,i){return ln().memoizedState=[o,i===void 0?null:i],o},useContext:Vr,useEffect:RN,useImperativeHandle:function(o,i,u){u=u!=null?u.concat([o]):null,Of(4194308,4,kN.bind(null,i,o),u)},useLayoutEffect:function(o,i){return Of(4194308,4,o,i)},useInsertionEffect:function(o,i){Of(4,2,o,i)},useMemo:function(o,i){var u=ln();i=i===void 0?null:i;var p=o();if(Xi){Zt(!0);try{o()}finally{Zt(!1)}}return u.memoizedState=[p,i],p},useReducer:function(o,i,u){var p=ln();if(u!==void 0){var E=u(i);if(Xi){Zt(!0);try{u(i)}finally{Zt(!1)}}}else E=i;return p.memoizedState=p.baseState=E,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:E},p.queue=o,o=o.dispatch=gG.bind(null,dt,o),[p.memoizedState,o]},useRef:function(o){var i=ln();return o={current:o},i.memoizedState=o},useState:function(o){o=Ag(o);var i=o.queue,u=zN.bind(null,dt,i);return i.dispatch=u,[o.memoizedState,u]},useDebugValue:Ig,useDeferredValue:function(o,i){var u=ln();return Og(u,o,i)},useTransition:function(){var o=Ag(!1);return o=MN.bind(null,dt,o.queue,!0,!1),ln().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,i,u){var p=dt,E=ln();if(Ct){if(u===void 0)throw Error(n(407));u=u()}else{if(u=i(),Kt===null)throw Error(n(349));(_t&127)!==0||uN(p,i,u)}E.memoizedState=u;var T={value:u,getSnapshot:i};return E.queue=T,RN(fN.bind(null,p,T,o),[o]),p.flags|=2048,Js(9,{destroy:void 0},dN.bind(null,p,T,u,i),null),u},useId:function(){var o=ln(),i=Kt.identifierPrefix;if(Ct){var u=Ca,p=Ra;u=(p&~(1<<32-fr(p)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Af++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=cG++,i="_"+i+"r_"+u.toString(32)+"_";return o.memoizedState=i},useHostTransitionStatus:Lg,useFormState:SN,useActionState:SN,useOptimistic:function(o){var i=ln();i.memoizedState=i.baseState=o;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=Mg.bind(null,dt,!0,u),u.dispatch=i,[o,i]},useMemoCache:Tg,useCacheRefresh:function(){return ln().memoizedState=hG.bind(null,dt)},useEffectEvent:function(o){var i=ln(),u={impl:o};return i.memoizedState=u,function(){if((Lt&2)!==0)throw Error(n(440));return u.impl.apply(void 0,arguments)}}},Pg={readContext:Vr,use:kf,useCallback:ON,useContext:Vr,useEffect:kg,useImperativeHandle:IN,useInsertionEffect:AN,useLayoutEffect:NN,useMemo:DN,useReducer:If,useRef:TN,useState:function(){return If(so)},useDebugValue:Ig,useDeferredValue:function(o,i){var u=yr();return LN(u,qt.memoizedState,o,i)},useTransition:function(){var o=If(so)[0],i=yr().memoizedState;return[typeof o=="boolean"?o:Yc(o),i]},useSyncExternalStore:cN,useId:UN,useHostTransitionStatus:Lg,useFormState:xN,useActionState:xN,useOptimistic:function(o,i){var u=yr();return hN(u,qt,o,i)},useMemoCache:Tg,useCacheRefresh:FN};Pg.useEffectEvent=CN;var HN={readContext:Vr,use:kf,useCallback:ON,useContext:Vr,useEffect:kg,useImperativeHandle:IN,useInsertionEffect:AN,useLayoutEffect:NN,useMemo:DN,useReducer:Cg,useRef:TN,useState:function(){return Cg(so)},useDebugValue:Ig,useDeferredValue:function(o,i){var u=yr();return qt===null?Og(u,o,i):LN(u,qt.memoizedState,o,i)},useTransition:function(){var o=Cg(so)[0],i=yr().memoizedState;return[typeof o=="boolean"?o:Yc(o),i]},useSyncExternalStore:cN,useId:UN,useHostTransitionStatus:Lg,useFormState:_N,useActionState:_N,useOptimistic:function(o,i){var u=yr();return qt!==null?hN(u,qt,o,i):(u.baseState=o,[o,u.queue.dispatch])},useMemoCache:Tg,useCacheRefresh:FN};HN.useEffectEvent=CN;function jg(o,i,u,p){i=o.memoizedState,u=u(p,i),u=u==null?i:h({},i,u),o.memoizedState=u,o.lanes===0&&(o.updateQueue.baseState=u)}var Ug={enqueueSetState:function(o,i,u){o=o._reactInternals;var p=Mn(),E=Wo(p);E.payload=i,u!=null&&(E.callback=u),i=Yo(o,E,p),i!==null&&(En(i,o,p),Hc(i,o,p))},enqueueReplaceState:function(o,i,u){o=o._reactInternals;var p=Mn(),E=Wo(p);E.tag=1,E.payload=i,u!=null&&(E.callback=u),i=Yo(o,E,p),i!==null&&(En(i,o,p),Hc(i,o,p))},enqueueForceUpdate:function(o,i){o=o._reactInternals;var u=Mn(),p=Wo(u);p.tag=2,i!=null&&(p.callback=i),i=Yo(o,p,u),i!==null&&(En(i,o,u),Hc(i,o,u))}};function VN(o,i,u,p,E,T,D){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,T,D):i.prototype&&i.prototype.isPureReactComponent?!Pc(u,p)||!Pc(E,T):!0}function GN(o,i,u,p){o=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,p),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,p),i.state!==o&&Ug.enqueueReplaceState(i,i.state,null)}function Qi(o,i){var u=i;if("ref"in i){u={};for(var p in i)p!=="ref"&&(u[p]=i[p])}if(o=o.defaultProps){u===i&&(u=h({},u));for(var E in o)u[E]===void 0&&(u[E]=o[E])}return u}function WN(o){ff(o)}function YN(o){console.error(o)}function KN(o){ff(o)}function Mf(o,i){try{var u=o.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(p){setTimeout(function(){throw p})}}function ZN(o,i,u){try{var p=o.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function Fg(o,i,u){return u=Wo(u),u.tag=3,u.payload={element:null},u.callback=function(){Mf(o,i)},u}function XN(o){return o=Wo(o),o.tag=3,o}function QN(o,i,u,p){var E=u.type.getDerivedStateFromError;if(typeof E=="function"){var T=p.value;o.payload=function(){return E(T)},o.callback=function(){ZN(i,u,p)}}var D=u.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(o.callback=function(){ZN(i,u,p),typeof E!="function"&&(ei===null?ei=new Set([this]):ei.add(this));var B=p.stack;this.componentDidCatch(p.value,{componentStack:B!==null?B:""})})}function vG(o,i,u,p,E){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(i=u.alternate,i!==null&&Vs(i,u,E,!0),u=In.current,u!==null){switch(u.tag){case 31:case 13:return Zn===null?Wf():u.alternate===null&&mr===0&&(mr=3),u.flags&=-257,u.flags|=65536,u.lanes=E,p===xf?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([p]):i.add(p),uv(o,p,E)),!1;case 22:return u.flags|=65536,p===xf?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([p]):u.add(p)),uv(o,p,E)),!1}throw Error(n(435,u.tag))}return uv(o,p,E),Wf(),!1}if(Ct)return i=In.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=E,p!==ag&&(o=Error(n(422),{cause:p}),Fc(Gn(o,u)))):(p!==ag&&(i=Error(n(423),{cause:p}),Fc(Gn(i,u))),o=o.current.alternate,o.flags|=65536,E&=-E,o.lanes|=E,p=Gn(p,u),E=Fg(o.stateNode,p,E),hg(o,E),mr!==4&&(mr=2)),!1;var T=Error(n(520),{cause:p});if(T=Gn(T,u),au===null?au=[T]:au.push(T),mr!==4&&(mr=2),i===null)return!0;p=Gn(p,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,o=E&-E,u.lanes|=o,o=Fg(u.stateNode,p,o),hg(u,o),!1;case 1:if(i=u.type,T=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(ei===null||!ei.has(T))))return u.flags|=65536,E&=-E,u.lanes|=E,E=XN(E),QN(E,o,u,p),hg(u,E),!1}u=u.return}while(u!==null);return!1}var zg=Error(n(461)),_r=!1;function Gr(o,i,u,p){i.child=o===null?rN(i,null,u,p):Zi(i,o.child,u,p)}function JN(o,i,u,p,E){u=u.render;var T=i.ref;if("ref"in p){var D={};for(var B in p)B!=="ref"&&(D[B]=p[B])}else D=p;return Gi(i),p=Sg(o,i,u,D,T,E),B=xg(),o!==null&&!_r?(wg(o,i,E),lo(o,i,E)):(Ct&&B&&rg(i),i.flags|=1,Gr(o,i,p,E),i.child)}function e1(o,i,u,p,E){if(o===null){var T=u.type;return typeof T=="function"&&!Jh(T)&&T.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=T,t1(o,i,T,p,E)):(o=gf(u.type,null,p,i,i.mode,E),o.ref=i.ref,o.return=i,i.child=o)}if(T=o.child,!Yg(o,E)){var D=T.memoizedProps;if(u=u.compare,u=u!==null?u:Pc,u(D,p)&&o.ref===i.ref)return lo(o,i,E)}return i.flags|=1,o=ro(T,p),o.ref=i.ref,o.return=i,i.child=o}function t1(o,i,u,p,E){if(o!==null){var T=o.memoizedProps;if(Pc(T,p)&&o.ref===i.ref)if(_r=!1,i.pendingProps=p=T,Yg(o,E))(o.flags&131072)!==0&&(_r=!0);else return i.lanes=o.lanes,lo(o,i,E)}return $g(o,i,u,p,E)}function r1(o,i,u,p){var E=p.children,T=o!==null?o.memoizedState:null;if(o===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((i.flags&128)!==0){if(T=T!==null?T.baseLanes|u:u,o!==null){for(p=i.child=o.child,E=0;p!==null;)E=E|p.lanes|p.childLanes,p=p.sibling;p=E&~T}else p=0,i.child=null;return n1(o,i,T,u,p)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},o!==null&&Ef(i,T!==null?T.cachePool:null),T!==null?oN(i,T):vg(),iN(i);else return p=i.lanes=536870912,n1(o,i,T!==null?T.baseLanes|u:u,u,p)}else T!==null?(Ef(i,T.cachePool),oN(i,T),Zo(),i.memoizedState=null):(o!==null&&Ef(i,null),vg(),Zo());return Gr(o,i,E,u),i.child}function Xc(o,i){return o!==null&&o.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function n1(o,i,u,p,E){var T=dg();return T=T===null?null:{parent:xr._currentValue,pool:T},i.memoizedState={baseLanes:u,cachePool:T},o!==null&&Ef(i,null),vg(),iN(i),o!==null&&Vs(o,i,p,!0),i.childLanes=E,null}function Pf(o,i){return i=Uf({mode:i.mode,children:i.children},o.mode),i.ref=o.ref,o.child=i,i.return=o,i}function a1(o,i,u){return Zi(i,o.child,null,u),o=Pf(i,i.pendingProps),o.flags|=2,On(i),i.memoizedState=null,o}function bG(o,i,u){var p=i.pendingProps,E=(i.flags&128)!==0;if(i.flags&=-129,o===null){if(Ct){if(p.mode==="hidden")return o=Pf(i,p),i.lanes=536870912,Xc(null,o);if(yg(i),(o=Jt)?(o=gk(o,Kn),o=o!==null&&o.data==="&"?o:null,o!==null&&(i.memoizedState={dehydrated:o,treeContext:Bo!==null?{id:Ra,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},u=$A(o),u.return=i,i.child=u,Hr=i,Jt=null)):o=null,o===null)throw Ho(i);return i.lanes=536870912,null}return Pf(i,p)}var T=o.memoizedState;if(T!==null){var D=T.dehydrated;if(yg(i),E)if(i.flags&256)i.flags&=-257,i=a1(o,i,u);else if(i.memoizedState!==null)i.child=o.child,i.flags|=128,i=null;else throw Error(n(558));else if(_r||Vs(o,i,u,!1),E=(u&o.childLanes)!==0,_r||E){if(p=Kt,p!==null&&(D=Br(p,u),D!==0&&D!==T.retryLane))throw T.retryLane=D,Bi(o,D),En(p,o,D),zg;Wf(),i=a1(o,i,u)}else o=T.treeContext,Jt=Xn(D.nextSibling),Hr=i,Ct=!0,qo=null,Kn=!1,o!==null&&HA(i,o),i=Pf(i,p),i.flags|=4096;return i}return o=ro(o.child,{mode:p.mode,children:p.children}),o.ref=i.ref,i.child=o,o.return=i,o}function jf(o,i){var u=i.ref;if(u===null)o!==null&&o.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(n(284));(o===null||o.ref!==u)&&(i.flags|=4194816)}}function $g(o,i,u,p,E){return Gi(i),u=Sg(o,i,u,p,void 0,E),p=xg(),o!==null&&!_r?(wg(o,i,E),lo(o,i,E)):(Ct&&p&&rg(i),i.flags|=1,Gr(o,i,u,E),i.child)}function o1(o,i,u,p,E,T){return Gi(i),i.updateQueue=null,u=lN(i,p,u,E),sN(o),p=xg(),o!==null&&!_r?(wg(o,i,T),lo(o,i,T)):(Ct&&p&&rg(i),i.flags|=1,Gr(o,i,u,T),i.child)}function i1(o,i,u,p,E){if(Gi(i),i.stateNode===null){var T=$s,D=u.contextType;typeof D=="object"&&D!==null&&(T=Vr(D)),T=new u(p,T),i.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=Ug,i.stateNode=T,T._reactInternals=i,T=i.stateNode,T.props=p,T.state=i.memoizedState,T.refs={},pg(i),D=u.contextType,T.context=typeof D=="object"&&D!==null?Vr(D):$s,T.state=i.memoizedState,D=u.getDerivedStateFromProps,typeof D=="function"&&(jg(i,u,D,p),T.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(D=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),D!==T.state&&Ug.enqueueReplaceState(T,T.state,null),Gc(i,p,T,E),Vc(),T.state=i.memoizedState),typeof T.componentDidMount=="function"&&(i.flags|=4194308),p=!0}else if(o===null){T=i.stateNode;var B=i.memoizedProps,ne=Qi(u,B);T.props=ne;var pe=T.context,Se=u.contextType;D=$s,typeof Se=="object"&&Se!==null&&(D=Vr(Se));var Re=u.getDerivedStateFromProps;Se=typeof Re=="function"||typeof T.getSnapshotBeforeUpdate=="function",B=i.pendingProps!==B,Se||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(B||pe!==D)&&GN(i,T,p,D),Go=!1;var he=i.memoizedState;T.state=he,Gc(i,p,T,E),Vc(),pe=i.memoizedState,B||he!==pe||Go?(typeof Re=="function"&&(jg(i,u,Re,p),pe=i.memoizedState),(ne=Go||VN(i,u,ne,p,he,pe,D))?(Se||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(i.flags|=4194308)):(typeof T.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=p,i.memoizedState=pe),T.props=p,T.state=pe,T.context=D,p=ne):(typeof T.componentDidMount=="function"&&(i.flags|=4194308),p=!1)}else{T=i.stateNode,mg(o,i),D=i.memoizedProps,Se=Qi(u,D),T.props=Se,Re=i.pendingProps,he=T.context,pe=u.contextType,ne=$s,typeof pe=="object"&&pe!==null&&(ne=Vr(pe)),B=u.getDerivedStateFromProps,(pe=typeof B=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(D!==Re||he!==ne)&&GN(i,T,p,ne),Go=!1,he=i.memoizedState,T.state=he,Gc(i,p,T,E),Vc();var Ee=i.memoizedState;D!==Re||he!==Ee||Go||o!==null&&o.dependencies!==null&&bf(o.dependencies)?(typeof B=="function"&&(jg(i,u,B,p),Ee=i.memoizedState),(Se=Go||VN(i,u,Se,p,he,Ee,ne)||o!==null&&o.dependencies!==null&&bf(o.dependencies))?(pe||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(p,Ee,ne),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(p,Ee,ne)),typeof T.componentDidUpdate=="function"&&(i.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof T.componentDidUpdate!="function"||D===o.memoizedProps&&he===o.memoizedState||(i.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||D===o.memoizedProps&&he===o.memoizedState||(i.flags|=1024),i.memoizedProps=p,i.memoizedState=Ee),T.props=p,T.state=Ee,T.context=ne,p=Se):(typeof T.componentDidUpdate!="function"||D===o.memoizedProps&&he===o.memoizedState||(i.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||D===o.memoizedProps&&he===o.memoizedState||(i.flags|=1024),p=!1)}return T=p,jf(o,i),p=(i.flags&128)!==0,T||p?(T=i.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:T.render(),i.flags|=1,o!==null&&p?(i.child=Zi(i,o.child,null,E),i.child=Zi(i,null,u,E)):Gr(o,i,u,E),i.memoizedState=T.state,o=i.child):o=lo(o,i,E),o}function s1(o,i,u,p){return Hi(),i.flags|=256,Gr(o,i,u,p),i.child}var Bg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qg(o){return{baseLanes:o,cachePool:ZA()}}function Hg(o,i,u){return o=o!==null?o.childLanes&~u:0,i&&(o|=Ln),o}function l1(o,i,u){var p=i.pendingProps,E=!1,T=(i.flags&128)!==0,D;if((D=T)||(D=o!==null&&o.memoizedState===null?!1:(br.current&2)!==0),D&&(E=!0,i.flags&=-129),D=(i.flags&32)!==0,i.flags&=-33,o===null){if(Ct){if(E?Ko(i):Zo(),(o=Jt)?(o=gk(o,Kn),o=o!==null&&o.data!=="&"?o:null,o!==null&&(i.memoizedState={dehydrated:o,treeContext:Bo!==null?{id:Ra,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},u=$A(o),u.return=i,i.child=u,Hr=i,Jt=null)):o=null,o===null)throw Ho(i);return Rv(o)?i.lanes=32:i.lanes=536870912,null}var B=p.children;return p=p.fallback,E?(Zo(),E=i.mode,B=Uf({mode:"hidden",children:B},E),p=qi(p,E,u,null),B.return=i,p.return=i,B.sibling=p,i.child=B,p=i.child,p.memoizedState=qg(u),p.childLanes=Hg(o,D,u),i.memoizedState=Bg,Xc(null,p)):(Ko(i),Vg(i,B))}var ne=o.memoizedState;if(ne!==null&&(B=ne.dehydrated,B!==null)){if(T)i.flags&256?(Ko(i),i.flags&=-257,i=Gg(o,i,u)):i.memoizedState!==null?(Zo(),i.child=o.child,i.flags|=128,i=null):(Zo(),B=p.fallback,E=i.mode,p=Uf({mode:"visible",children:p.children},E),B=qi(B,E,u,null),B.flags|=2,p.return=i,B.return=i,p.sibling=B,i.child=p,Zi(i,o.child,null,u),p=i.child,p.memoizedState=qg(u),p.childLanes=Hg(o,D,u),i.memoizedState=Bg,i=Xc(null,p));else if(Ko(i),Rv(B)){if(D=B.nextSibling&&B.nextSibling.dataset,D)var pe=D.dgst;D=pe,p=Error(n(419)),p.stack="",p.digest=D,Fc({value:p,source:null,stack:null}),i=Gg(o,i,u)}else if(_r||Vs(o,i,u,!1),D=(u&o.childLanes)!==0,_r||D){if(D=Kt,D!==null&&(p=Br(D,u),p!==0&&p!==ne.retryLane))throw ne.retryLane=p,Bi(o,p),En(D,o,p),zg;Tv(B)||Wf(),i=Gg(o,i,u)}else Tv(B)?(i.flags|=192,i.child=o.child,i=null):(o=ne.treeContext,Jt=Xn(B.nextSibling),Hr=i,Ct=!0,qo=null,Kn=!1,o!==null&&HA(i,o),i=Vg(i,p.children),i.flags|=4096);return i}return E?(Zo(),B=p.fallback,E=i.mode,ne=o.child,pe=ne.sibling,p=ro(ne,{mode:"hidden",children:p.children}),p.subtreeFlags=ne.subtreeFlags&65011712,pe!==null?B=ro(pe,B):(B=qi(B,E,u,null),B.flags|=2),B.return=i,p.return=i,p.sibling=B,i.child=p,Xc(null,p),p=i.child,B=o.child.memoizedState,B===null?B=qg(u):(E=B.cachePool,E!==null?(ne=xr._currentValue,E=E.parent!==ne?{parent:ne,pool:ne}:E):E=ZA(),B={baseLanes:B.baseLanes|u,cachePool:E}),p.memoizedState=B,p.childLanes=Hg(o,D,u),i.memoizedState=Bg,Xc(o.child,p)):(Ko(i),u=o.child,o=u.sibling,u=ro(u,{mode:"visible",children:p.children}),u.return=i,u.sibling=null,o!==null&&(D=i.deletions,D===null?(i.deletions=[o],i.flags|=16):D.push(o)),i.child=u,i.memoizedState=null,u)}function Vg(o,i){return i=Uf({mode:"visible",children:i},o.mode),i.return=o,o.child=i}function Uf(o,i){return o=kn(22,o,null,i),o.lanes=0,o}function Gg(o,i,u){return Zi(i,o.child,null,u),o=Vg(i,i.pendingProps.children),o.flags|=2,i.memoizedState=null,o}function c1(o,i,u){o.lanes|=i;var p=o.alternate;p!==null&&(p.lanes|=i),sg(o.return,i,u)}function Wg(o,i,u,p,E,T){var D=o.memoizedState;D===null?o.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:E,treeForkCount:T}:(D.isBackwards=i,D.rendering=null,D.renderingStartTime=0,D.last=p,D.tail=u,D.tailMode=E,D.treeForkCount=T)}function u1(o,i,u){var p=i.pendingProps,E=p.revealOrder,T=p.tail;p=p.children;var D=br.current,B=(D&2)!==0;if(B?(D=D&1|2,i.flags|=128):D&=1,$(br,D),Gr(o,i,p,u),p=Ct?Uc:0,!B&&o!==null&&(o.flags&128)!==0)e:for(o=i.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&c1(o,u,i);else if(o.tag===19)c1(o,u,i);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(E){case"forwards":for(u=i.child,E=null;u!==null;)o=u.alternate,o!==null&&Rf(o)===null&&(E=u),u=u.sibling;u=E,u===null?(E=i.child,i.child=null):(E=u.sibling,u.sibling=null),Wg(i,!1,E,u,T,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,E=i.child,i.child=null;E!==null;){if(o=E.alternate,o!==null&&Rf(o)===null){i.child=E;break}o=E.sibling,E.sibling=u,u=E,E=o}Wg(i,!0,u,null,T,p);break;case"together":Wg(i,!1,null,null,void 0,p);break;default:i.memoizedState=null}return i.child}function lo(o,i,u){if(o!==null&&(i.dependencies=o.dependencies),Jo|=i.lanes,(u&i.childLanes)===0)if(o!==null){if(Vs(o,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(o!==null&&i.child!==o.child)throw Error(n(153));if(i.child!==null){for(o=i.child,u=ro(o,o.pendingProps),i.child=u,u.return=i;o.sibling!==null;)o=o.sibling,u=u.sibling=ro(o,o.pendingProps),u.return=i;u.sibling=null}return i.child}function Yg(o,i){return(o.lanes&i)!==0?!0:(o=o.dependencies,!!(o!==null&&bf(o)))}function yG(o,i,u){switch(i.tag){case 3:K(i,i.stateNode.containerInfo),Vo(i,xr,o.memoizedState.cache),Hi();break;case 27:case 5:H(i);break;case 4:K(i,i.stateNode.containerInfo);break;case 10:Vo(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,yg(i),null;break;case 13:var p=i.memoizedState;if(p!==null)return p.dehydrated!==null?(Ko(i),i.flags|=128,null):(u&i.child.childLanes)!==0?l1(o,i,u):(Ko(i),o=lo(o,i,u),o!==null?o.sibling:null);Ko(i);break;case 19:var E=(o.flags&128)!==0;if(p=(u&i.childLanes)!==0,p||(Vs(o,i,u,!1),p=(u&i.childLanes)!==0),E){if(p)return u1(o,i,u);i.flags|=128}if(E=i.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),$(br,br.current),p)break;return null;case 22:return i.lanes=0,r1(o,i,u,i.pendingProps);case 24:Vo(i,xr,o.memoizedState.cache)}return lo(o,i,u)}function d1(o,i,u){if(o!==null)if(o.memoizedProps!==i.pendingProps)_r=!0;else{if(!Yg(o,u)&&(i.flags&128)===0)return _r=!1,yG(o,i,u);_r=(o.flags&131072)!==0}else _r=!1,Ct&&(i.flags&1048576)!==0&&qA(i,Uc,i.index);switch(i.lanes=0,i.tag){case 16:e:{var p=i.pendingProps;if(o=Yi(i.elementType),i.type=o,typeof o=="function")Jh(o)?(p=Qi(o,p),i.tag=1,i=i1(null,i,o,p,u)):(i.tag=0,i=$g(null,i,o,p,u));else{if(o!=null){var E=o.$$typeof;if(E===N){i.tag=11,i=JN(null,i,o,p,u);break e}else if(E===I){i.tag=14,i=e1(null,i,o,p,u);break e}}throw i=ee(o)||o,Error(n(306,i,""))}}return i;case 0:return $g(o,i,i.type,i.pendingProps,u);case 1:return p=i.type,E=Qi(p,i.pendingProps),i1(o,i,p,E,u);case 3:e:{if(K(i,i.stateNode.containerInfo),o===null)throw Error(n(387));p=i.pendingProps;var T=i.memoizedState;E=T.element,mg(o,i),Gc(i,p,null,u);var D=i.memoizedState;if(p=D.cache,Vo(i,xr,p),p!==T.cache&&lg(i,[xr],u,!0),Vc(),p=D.element,T.isDehydrated)if(T={element:p,isDehydrated:!1,cache:D.cache},i.updateQueue.baseState=T,i.memoizedState=T,i.flags&256){i=s1(o,i,p,u);break e}else if(p!==E){E=Gn(Error(n(424)),i),Fc(E),i=s1(o,i,p,u);break e}else{switch(o=i.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Jt=Xn(o.firstChild),Hr=i,Ct=!0,qo=null,Kn=!0,u=rN(i,null,p,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Hi(),p===E){i=lo(o,i,u);break e}Gr(o,i,p,u)}i=i.child}return i;case 26:return jf(o,i),o===null?(u=xk(i.type,null,i.pendingProps,null))?i.memoizedState=u:Ct||(u=i.type,o=i.pendingProps,p=ep(F.current).createElement(u),p[je]=i,p[Be]=o,Wr(p,u,o),zt(p),i.stateNode=p):i.memoizedState=xk(i.type,o.memoizedProps,i.pendingProps,o.memoizedState),null;case 27:return H(i),o===null&&Ct&&(p=i.stateNode=yk(i.type,i.pendingProps,F.current),Hr=i,Kn=!0,E=Jt,ai(i.type)?(Cv=E,Jt=Xn(p.firstChild)):Jt=E),Gr(o,i,i.pendingProps.children,u),jf(o,i),o===null&&(i.flags|=4194304),i.child;case 5:return o===null&&Ct&&((E=p=Jt)&&(p=KG(p,i.type,i.pendingProps,Kn),p!==null?(i.stateNode=p,Hr=i,Jt=Xn(p.firstChild),Kn=!1,E=!0):E=!1),E||Ho(i)),H(i),E=i.type,T=i.pendingProps,D=o!==null?o.memoizedProps:null,p=T.children,xv(E,T)?p=null:D!==null&&xv(E,D)&&(i.flags|=32),i.memoizedState!==null&&(E=Sg(o,i,uG,null,null,u),fu._currentValue=E),jf(o,i),Gr(o,i,p,u),i.child;case 6:return o===null&&Ct&&((o=u=Jt)&&(u=ZG(u,i.pendingProps,Kn),u!==null?(i.stateNode=u,Hr=i,Jt=null,o=!0):o=!1),o||Ho(i)),null;case 13:return l1(o,i,u);case 4:return K(i,i.stateNode.containerInfo),p=i.pendingProps,o===null?i.child=Zi(i,null,p,u):Gr(o,i,p,u),i.child;case 11:return JN(o,i,i.type,i.pendingProps,u);case 7:return Gr(o,i,i.pendingProps,u),i.child;case 8:return Gr(o,i,i.pendingProps.children,u),i.child;case 12:return Gr(o,i,i.pendingProps.children,u),i.child;case 10:return p=i.pendingProps,Vo(i,i.type,p.value),Gr(o,i,p.children,u),i.child;case 9:return E=i.type._context,p=i.pendingProps.children,Gi(i),E=Vr(E),p=p(E),i.flags|=1,Gr(o,i,p,u),i.child;case 14:return e1(o,i,i.type,i.pendingProps,u);case 15:return t1(o,i,i.type,i.pendingProps,u);case 19:return u1(o,i,u);case 31:return bG(o,i,u);case 22:return r1(o,i,u,i.pendingProps);case 24:return Gi(i),p=Vr(xr),o===null?(E=dg(),E===null&&(E=Kt,T=cg(),E.pooledCache=T,T.refCount++,T!==null&&(E.pooledCacheLanes|=u),E=T),i.memoizedState={parent:p,cache:E},pg(i),Vo(i,xr,E)):((o.lanes&u)!==0&&(mg(o,i),Gc(i,null,null,u),Vc()),E=o.memoizedState,T=i.memoizedState,E.parent!==p?(E={parent:p,cache:p},i.memoizedState=E,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=E),Vo(i,xr,p)):(p=T.cache,Vo(i,xr,p),p!==E.cache&&lg(i,[xr],u,!0))),Gr(o,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(n(156,i.tag))}function co(o){o.flags|=4}function Kg(o,i,u,p,E){if((i=(o.mode&32)!==0)&&(i=!1),i){if(o.flags|=16777216,(E&335544128)===E)if(o.stateNode.complete)o.flags|=8192;else if(U1())o.flags|=8192;else throw Ki=xf,fg}else o.flags&=-16777217}function f1(o,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!Ck(i))if(U1())o.flags|=8192;else throw Ki=xf,fg}function Ff(o,i){i!==null&&(o.flags|=4),o.flags&16384&&(i=o.tag!==22?Lr():536870912,o.lanes|=i,nl|=i)}function Qc(o,i){if(!Ct)switch(o.tailMode){case"hidden":i=o.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?o.tail=null:u.sibling=null;break;case"collapsed":u=o.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?i||o.tail===null?o.tail=null:o.tail.sibling=null:p.sibling=null}}function er(o){var i=o.alternate!==null&&o.alternate.child===o.child,u=0,p=0;if(i)for(var E=o.child;E!==null;)u|=E.lanes|E.childLanes,p|=E.subtreeFlags&65011712,p|=E.flags&65011712,E.return=o,E=E.sibling;else for(E=o.child;E!==null;)u|=E.lanes|E.childLanes,p|=E.subtreeFlags,p|=E.flags,E.return=o,E=E.sibling;return o.subtreeFlags|=p,o.childLanes=u,i}function EG(o,i,u){var p=i.pendingProps;switch(ng(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return er(i),null;case 1:return er(i),null;case 3:return u=i.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),i.memoizedState.cache!==p&&(i.flags|=2048),oo(xr),ae(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(o===null||o.child===null)&&(Hs(i)?co(i):o===null||o.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,og())),er(i),null;case 26:var E=i.type,T=i.memoizedState;return o===null?(co(i),T!==null?(er(i),f1(i,T)):(er(i),Kg(i,E,null,p,u))):T?T!==o.memoizedState?(co(i),er(i),f1(i,T)):(er(i),i.flags&=-16777217):(o=o.memoizedProps,o!==p&&co(i),er(i),Kg(i,E,o,p,u)),null;case 27:if(de(i),u=F.current,E=i.type,o!==null&&i.stateNode!=null)o.memoizedProps!==p&&co(i);else{if(!p){if(i.stateNode===null)throw Error(n(166));return er(i),null}o=Y.current,Hs(i)?VA(i):(o=yk(E,p,u),i.stateNode=o,co(i))}return er(i),null;case 5:if(de(i),E=i.type,o!==null&&i.stateNode!=null)o.memoizedProps!==p&&co(i);else{if(!p){if(i.stateNode===null)throw Error(n(166));return er(i),null}if(T=Y.current,Hs(i))VA(i);else{var D=ep(F.current);switch(T){case 1:T=D.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:T=D.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":T=D.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":T=D.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":T=D.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof p.is=="string"?D.createElement("select",{is:p.is}):D.createElement("select"),p.multiple?T.multiple=!0:p.size&&(T.size=p.size);break;default:T=typeof p.is=="string"?D.createElement(E,{is:p.is}):D.createElement(E)}}T[je]=i,T[Be]=p;e:for(D=i.child;D!==null;){if(D.tag===5||D.tag===6)T.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===i)break e;for(;D.sibling===null;){if(D.return===null||D.return===i)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}i.stateNode=T;e:switch(Wr(T,E,p),E){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&co(i)}}return er(i),Kg(i,i.type,o===null?null:o.memoizedProps,i.pendingProps,u),null;case 6:if(o&&i.stateNode!=null)o.memoizedProps!==p&&co(i);else{if(typeof p!="string"&&i.stateNode===null)throw Error(n(166));if(o=F.current,Hs(i)){if(o=i.stateNode,u=i.memoizedProps,p=null,E=Hr,E!==null)switch(E.tag){case 27:case 5:p=E.memoizedProps}o[je]=i,o=!!(o.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||lk(o.nodeValue,u)),o||Ho(i,!0)}else o=ep(o).createTextNode(p),o[je]=i,i.stateNode=o}return er(i),null;case 31:if(u=i.memoizedState,o===null||o.memoizedState!==null){if(p=Hs(i),u!==null){if(o===null){if(!p)throw Error(n(318));if(o=i.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(557));o[je]=i}else Hi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;er(i),o=!1}else u=og(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=u),o=!0;if(!o)return i.flags&256?(On(i),i):(On(i),null);if((i.flags&128)!==0)throw Error(n(558))}return er(i),null;case 13:if(p=i.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(E=Hs(i),p!==null&&p.dehydrated!==null){if(o===null){if(!E)throw Error(n(318));if(E=i.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[je]=i}else Hi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;er(i),E=!1}else E=og(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=E),E=!0;if(!E)return i.flags&256?(On(i),i):(On(i),null)}return On(i),(i.flags&128)!==0?(i.lanes=u,i):(u=p!==null,o=o!==null&&o.memoizedState!==null,u&&(p=i.child,E=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(E=p.alternate.memoizedState.cachePool.pool),T=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(T=p.memoizedState.cachePool.pool),T!==E&&(p.flags|=2048)),u!==o&&u&&(i.child.flags|=8192),Ff(i,i.updateQueue),er(i),null);case 4:return ae(),o===null&&vv(i.stateNode.containerInfo),er(i),null;case 10:return oo(i.type),er(i),null;case 19:if(q(br),p=i.memoizedState,p===null)return er(i),null;if(E=(i.flags&128)!==0,T=p.rendering,T===null)if(E)Qc(p,!1);else{if(mr!==0||o!==null&&(o.flags&128)!==0)for(o=i.child;o!==null;){if(T=Rf(o),T!==null){for(i.flags|=128,Qc(p,!1),o=T.updateQueue,i.updateQueue=o,Ff(i,o),i.subtreeFlags=0,o=u,u=i.child;u!==null;)zA(u,o),u=u.sibling;return $(br,br.current&1|2),Ct&&no(i,p.treeForkCount),i.child}o=o.sibling}p.tail!==null&&we()>Hf&&(i.flags|=128,E=!0,Qc(p,!1),i.lanes=4194304)}else{if(!E)if(o=Rf(T),o!==null){if(i.flags|=128,E=!0,o=o.updateQueue,i.updateQueue=o,Ff(i,o),Qc(p,!0),p.tail===null&&p.tailMode==="hidden"&&!T.alternate&&!Ct)return er(i),null}else 2*we()-p.renderingStartTime>Hf&&u!==536870912&&(i.flags|=128,E=!0,Qc(p,!1),i.lanes=4194304);p.isBackwards?(T.sibling=i.child,i.child=T):(o=p.last,o!==null?o.sibling=T:i.child=T,p.last=T)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=we(),o.sibling=null,u=br.current,$(br,E?u&1|2:u&1),Ct&&no(i,p.treeForkCount),o):(er(i),null);case 22:case 23:return On(i),bg(),p=i.memoizedState!==null,o!==null?o.memoizedState!==null!==p&&(i.flags|=8192):p&&(i.flags|=8192),p?(u&536870912)!==0&&(i.flags&128)===0&&(er(i),i.subtreeFlags&6&&(i.flags|=8192)):er(i),u=i.updateQueue,u!==null&&Ff(i,u.retryQueue),u=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),p=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(p=i.memoizedState.cachePool.pool),p!==u&&(i.flags|=2048),o!==null&&q(Wi),null;case 24:return u=null,o!==null&&(u=o.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),oo(xr),er(i),null;case 25:return null;case 30:return null}throw Error(n(156,i.tag))}function SG(o,i){switch(ng(i),i.tag){case 1:return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 3:return oo(xr),ae(),o=i.flags,(o&65536)!==0&&(o&128)===0?(i.flags=o&-65537|128,i):null;case 26:case 27:case 5:return de(i),null;case 31:if(i.memoizedState!==null){if(On(i),i.alternate===null)throw Error(n(340));Hi()}return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 13:if(On(i),o=i.memoizedState,o!==null&&o.dehydrated!==null){if(i.alternate===null)throw Error(n(340));Hi()}return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 19:return q(br),null;case 4:return ae(),null;case 10:return oo(i.type),null;case 22:case 23:return On(i),bg(),o!==null&&q(Wi),o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 24:return oo(xr),null;case 25:return null;default:return null}}function p1(o,i){switch(ng(i),i.tag){case 3:oo(xr),ae();break;case 26:case 27:case 5:de(i);break;case 4:ae();break;case 31:i.memoizedState!==null&&On(i);break;case 13:On(i);break;case 19:q(br);break;case 10:oo(i.type);break;case 22:case 23:On(i),bg(),o!==null&&q(Wi);break;case 24:oo(xr)}}function Jc(o,i){try{var u=i.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var E=p.next;u=E;do{if((u.tag&o)===o){p=void 0;var T=u.create,D=u.inst;p=T(),D.destroy=p}u=u.next}while(u!==E)}}catch(B){Bt(i,i.return,B)}}function Xo(o,i,u){try{var p=i.updateQueue,E=p!==null?p.lastEffect:null;if(E!==null){var T=E.next;p=T;do{if((p.tag&o)===o){var D=p.inst,B=D.destroy;if(B!==void 0){D.destroy=void 0,E=i;var ne=u,pe=B;try{pe()}catch(Se){Bt(E,ne,Se)}}}p=p.next}while(p!==T)}}catch(Se){Bt(i,i.return,Se)}}function m1(o){var i=o.updateQueue;if(i!==null){var u=o.stateNode;try{aN(i,u)}catch(p){Bt(o,o.return,p)}}}function h1(o,i,u){u.props=Qi(o.type,o.memoizedProps),u.state=o.memoizedState;try{u.componentWillUnmount()}catch(p){Bt(o,i,p)}}function eu(o,i){try{var u=o.ref;if(u!==null){switch(o.tag){case 26:case 27:case 5:var p=o.stateNode;break;case 30:p=o.stateNode;break;default:p=o.stateNode}typeof u=="function"?o.refCleanup=u(p):u.current=p}}catch(E){Bt(o,i,E)}}function Aa(o,i){var u=o.ref,p=o.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(E){Bt(o,i,E)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(E){Bt(o,i,E)}else u.current=null}function g1(o){var i=o.type,u=o.memoizedProps,p=o.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(E){Bt(o,o.return,E)}}function Zg(o,i,u){try{var p=o.stateNode;qG(p,o.type,u,i),p[Be]=i}catch(E){Bt(o,o.return,E)}}function v1(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&ai(o.type)||o.tag===4}function Xg(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||v1(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&ai(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Qg(o,i,u){var p=o.tag;if(p===5||p===6)o=o.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(o,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(o),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=eo));else if(p!==4&&(p===27&&ai(o.type)&&(u=o.stateNode,i=null),o=o.child,o!==null))for(Qg(o,i,u),o=o.sibling;o!==null;)Qg(o,i,u),o=o.sibling}function zf(o,i,u){var p=o.tag;if(p===5||p===6)o=o.stateNode,i?u.insertBefore(o,i):u.appendChild(o);else if(p!==4&&(p===27&&ai(o.type)&&(u=o.stateNode),o=o.child,o!==null))for(zf(o,i,u),o=o.sibling;o!==null;)zf(o,i,u),o=o.sibling}function b1(o){var i=o.stateNode,u=o.memoizedProps;try{for(var p=o.type,E=i.attributes;E.length;)i.removeAttributeNode(E[0]);Wr(i,p,u),i[je]=o,i[Be]=u}catch(T){Bt(o,o.return,T)}}var uo=!1,Tr=!1,Jg=!1,y1=typeof WeakSet=="function"?WeakSet:Set,Mr=null;function xG(o,i){if(o=o.containerInfo,Ev=sp,o=IA(o),Gh(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var E=p.anchorOffset,T=p.focusNode;p=p.focusOffset;try{u.nodeType,T.nodeType}catch{u=null;break e}var D=0,B=-1,ne=-1,pe=0,Se=0,Re=o,he=null;t:for(;;){for(var Ee;Re!==u||E!==0&&Re.nodeType!==3||(B=D+E),Re!==T||p!==0&&Re.nodeType!==3||(ne=D+p),Re.nodeType===3&&(D+=Re.nodeValue.length),(Ee=Re.firstChild)!==null;)he=Re,Re=Ee;for(;;){if(Re===o)break t;if(he===u&&++pe===E&&(B=D),he===T&&++Se===p&&(ne=D),(Ee=Re.nextSibling)!==null)break;Re=he,he=Re.parentNode}Re=Ee}u=B===-1||ne===-1?null:{start:B,end:ne}}else u=null}u=u||{start:0,end:0}}else u=null;for(Sv={focusedElem:o,selectionRange:u},sp=!1,Mr=i;Mr!==null;)if(i=Mr,o=i.child,(i.subtreeFlags&1028)!==0&&o!==null)o.return=i,Mr=o;else for(;Mr!==null;){switch(i=Mr,T=i.alternate,o=i.flags,i.tag){case 0:if((o&4)!==0&&(o=i.updateQueue,o=o!==null?o.events:null,o!==null))for(u=0;u<o.length;u++)E=o[u],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&T!==null){o=void 0,u=i,E=T.memoizedProps,T=T.memoizedState,p=u.stateNode;try{var Ve=Qi(u.type,E);o=p.getSnapshotBeforeUpdate(Ve,T),p.__reactInternalSnapshotBeforeUpdate=o}catch(rt){Bt(u,u.return,rt)}}break;case 3:if((o&1024)!==0){if(o=i.stateNode.containerInfo,u=o.nodeType,u===9)_v(o);else if(u===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":_v(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(n(163))}if(o=i.sibling,o!==null){o.return=i.return,Mr=o;break}Mr=i.return}}function E1(o,i,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:po(o,u),p&4&&Jc(5,u);break;case 1:if(po(o,u),p&4)if(o=u.stateNode,i===null)try{o.componentDidMount()}catch(D){Bt(u,u.return,D)}else{var E=Qi(u.type,i.memoizedProps);i=i.memoizedState;try{o.componentDidUpdate(E,i,o.__reactInternalSnapshotBeforeUpdate)}catch(D){Bt(u,u.return,D)}}p&64&&m1(u),p&512&&eu(u,u.return);break;case 3:if(po(o,u),p&64&&(o=u.updateQueue,o!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{aN(o,i)}catch(D){Bt(u,u.return,D)}}break;case 27:i===null&&p&4&&b1(u);case 26:case 5:po(o,u),i===null&&p&4&&g1(u),p&512&&eu(u,u.return);break;case 12:po(o,u);break;case 31:po(o,u),p&4&&w1(o,u);break;case 13:po(o,u),p&4&&_1(o,u),p&64&&(o=u.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(u=IG.bind(null,u),XG(o,u))));break;case 22:if(p=u.memoizedState!==null||uo,!p){i=i!==null&&i.memoizedState!==null||Tr,E=uo;var T=Tr;uo=p,(Tr=i)&&!T?mo(o,u,(u.subtreeFlags&8772)!==0):po(o,u),uo=E,Tr=T}break;case 30:break;default:po(o,u)}}function S1(o){var i=o.alternate;i!==null&&(o.alternate=null,S1(i)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(i=o.stateNode,i!==null&&it(i)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var tr=null,gn=!1;function fo(o,i,u){for(u=u.child;u!==null;)x1(o,i,u),u=u.sibling}function x1(o,i,u){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(or,u)}catch{}switch(u.tag){case 26:Tr||Aa(u,i),fo(o,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Tr||Aa(u,i);var p=tr,E=gn;ai(u.type)&&(tr=u.stateNode,gn=!1),fo(o,i,u),cu(u.stateNode),tr=p,gn=E;break;case 5:Tr||Aa(u,i);case 6:if(p=tr,E=gn,tr=null,fo(o,i,u),tr=p,gn=E,tr!==null)if(gn)try{(tr.nodeType===9?tr.body:tr.nodeName==="HTML"?tr.ownerDocument.body:tr).removeChild(u.stateNode)}catch(T){Bt(u,i,T)}else try{tr.removeChild(u.stateNode)}catch(T){Bt(u,i,T)}break;case 18:tr!==null&&(gn?(o=tr,mk(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,u.stateNode),dl(o)):mk(tr,u.stateNode));break;case 4:p=tr,E=gn,tr=u.stateNode.containerInfo,gn=!0,fo(o,i,u),tr=p,gn=E;break;case 0:case 11:case 14:case 15:Xo(2,u,i),Tr||Xo(4,u,i),fo(o,i,u);break;case 1:Tr||(Aa(u,i),p=u.stateNode,typeof p.componentWillUnmount=="function"&&h1(u,i,p)),fo(o,i,u);break;case 21:fo(o,i,u);break;case 22:Tr=(p=Tr)||u.memoizedState!==null,fo(o,i,u),Tr=p;break;default:fo(o,i,u)}}function w1(o,i){if(i.memoizedState===null&&(o=i.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{dl(o)}catch(u){Bt(i,i.return,u)}}}function _1(o,i){if(i.memoizedState===null&&(o=i.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{dl(o)}catch(u){Bt(i,i.return,u)}}function wG(o){switch(o.tag){case 31:case 13:case 19:var i=o.stateNode;return i===null&&(i=o.stateNode=new y1),i;case 22:return o=o.stateNode,i=o._retryCache,i===null&&(i=o._retryCache=new y1),i;default:throw Error(n(435,o.tag))}}function $f(o,i){var u=wG(o);i.forEach(function(p){if(!u.has(p)){u.add(p);var E=OG.bind(null,o,p);p.then(E,E)}})}function vn(o,i){var u=i.deletions;if(u!==null)for(var p=0;p<u.length;p++){var E=u[p],T=o,D=i,B=D;e:for(;B!==null;){switch(B.tag){case 27:if(ai(B.type)){tr=B.stateNode,gn=!1;break e}break;case 5:tr=B.stateNode,gn=!1;break e;case 3:case 4:tr=B.stateNode.containerInfo,gn=!0;break e}B=B.return}if(tr===null)throw Error(n(160));x1(T,D,E),tr=null,gn=!1,T=E.alternate,T!==null&&(T.return=null),E.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)T1(i,o),i=i.sibling}var fa=null;function T1(o,i){var u=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:vn(i,o),bn(o),p&4&&(Xo(3,o,o.return),Jc(3,o),Xo(5,o,o.return));break;case 1:vn(i,o),bn(o),p&512&&(Tr||u===null||Aa(u,u.return)),p&64&&uo&&(o=o.updateQueue,o!==null&&(p=o.callbacks,p!==null&&(u=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var E=fa;if(vn(i,o),bn(o),p&512&&(Tr||u===null||Aa(u,u.return)),p&4){var T=u!==null?u.memoizedState:null;if(p=o.memoizedState,u===null)if(p===null)if(o.stateNode===null){e:{p=o.type,u=o.memoizedProps,E=E.ownerDocument||E;t:switch(p){case"title":T=E.getElementsByTagName("title")[0],(!T||T[Wt]||T[je]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=E.createElement(p),E.head.insertBefore(T,E.querySelector("head > title"))),Wr(T,p,u),T[je]=o,zt(T),p=T;break e;case"link":var D=Tk("link","href",E).get(p+(u.href||""));if(D){for(var B=0;B<D.length;B++)if(T=D[B],T.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&T.getAttribute("rel")===(u.rel==null?null:u.rel)&&T.getAttribute("title")===(u.title==null?null:u.title)&&T.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){D.splice(B,1);break t}}T=E.createElement(p),Wr(T,p,u),E.head.appendChild(T);break;case"meta":if(D=Tk("meta","content",E).get(p+(u.content||""))){for(B=0;B<D.length;B++)if(T=D[B],T.getAttribute("content")===(u.content==null?null:""+u.content)&&T.getAttribute("name")===(u.name==null?null:u.name)&&T.getAttribute("property")===(u.property==null?null:u.property)&&T.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&T.getAttribute("charset")===(u.charSet==null?null:u.charSet)){D.splice(B,1);break t}}T=E.createElement(p),Wr(T,p,u),E.head.appendChild(T);break;default:throw Error(n(468,p))}T[je]=o,zt(T),p=T}o.stateNode=p}else Rk(E,o.type,o.stateNode);else o.stateNode=_k(E,p,o.memoizedProps);else T!==p?(T===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):T.count--,p===null?Rk(E,o.type,o.stateNode):_k(E,p,o.memoizedProps)):p===null&&o.stateNode!==null&&Zg(o,o.memoizedProps,u.memoizedProps)}break;case 27:vn(i,o),bn(o),p&512&&(Tr||u===null||Aa(u,u.return)),u!==null&&p&4&&Zg(o,o.memoizedProps,u.memoizedProps);break;case 5:if(vn(i,o),bn(o),p&512&&(Tr||u===null||Aa(u,u.return)),o.flags&32){E=o.stateNode;try{Ls(E,"")}catch(Ve){Bt(o,o.return,Ve)}}p&4&&o.stateNode!=null&&(E=o.memoizedProps,Zg(o,E,u!==null?u.memoizedProps:E)),p&1024&&(Jg=!0);break;case 6:if(vn(i,o),bn(o),p&4){if(o.stateNode===null)throw Error(n(162));p=o.memoizedProps,u=o.stateNode;try{u.nodeValue=p}catch(Ve){Bt(o,o.return,Ve)}}break;case 3:if(np=null,E=fa,fa=tp(i.containerInfo),vn(i,o),fa=E,bn(o),p&4&&u!==null&&u.memoizedState.isDehydrated)try{dl(i.containerInfo)}catch(Ve){Bt(o,o.return,Ve)}Jg&&(Jg=!1,R1(o));break;case 4:p=fa,fa=tp(o.stateNode.containerInfo),vn(i,o),bn(o),fa=p;break;case 12:vn(i,o),bn(o);break;case 31:vn(i,o),bn(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,$f(o,p)));break;case 13:vn(i,o),bn(o),o.child.flags&8192&&o.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(qf=we()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,$f(o,p)));break;case 22:E=o.memoizedState!==null;var ne=u!==null&&u.memoizedState!==null,pe=uo,Se=Tr;if(uo=pe||E,Tr=Se||ne,vn(i,o),Tr=Se,uo=pe,bn(o),p&8192)e:for(i=o.stateNode,i._visibility=E?i._visibility&-2:i._visibility|1,E&&(u===null||ne||uo||Tr||Ji(o)),u=null,i=o;;){if(i.tag===5||i.tag===26){if(u===null){ne=u=i;try{if(T=ne.stateNode,E)D=T.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{B=ne.stateNode;var Re=ne.memoizedProps.style,he=Re!=null&&Re.hasOwnProperty("display")?Re.display:null;B.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(Ve){Bt(ne,ne.return,Ve)}}}else if(i.tag===6){if(u===null){ne=i;try{ne.stateNode.nodeValue=E?"":ne.memoizedProps}catch(Ve){Bt(ne,ne.return,Ve)}}}else if(i.tag===18){if(u===null){ne=i;try{var Ee=ne.stateNode;E?hk(Ee,!0):hk(ne.stateNode,!1)}catch(Ve){Bt(ne,ne.return,Ve)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===o)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}p&4&&(p=o.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,$f(o,u))));break;case 19:vn(i,o),bn(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,$f(o,p)));break;case 30:break;case 21:break;default:vn(i,o),bn(o)}}function bn(o){var i=o.flags;if(i&2){try{for(var u,p=o.return;p!==null;){if(v1(p)){u=p;break}p=p.return}if(u==null)throw Error(n(160));switch(u.tag){case 27:var E=u.stateNode,T=Xg(o);zf(o,T,E);break;case 5:var D=u.stateNode;u.flags&32&&(Ls(D,""),u.flags&=-33);var B=Xg(o);zf(o,B,D);break;case 3:case 4:var ne=u.stateNode.containerInfo,pe=Xg(o);Qg(o,pe,ne);break;default:throw Error(n(161))}}catch(Se){Bt(o,o.return,Se)}o.flags&=-3}i&4096&&(o.flags&=-4097)}function R1(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var i=o;R1(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),o=o.sibling}}function po(o,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)E1(o,i.alternate,i),i=i.sibling}function Ji(o){for(o=o.child;o!==null;){var i=o;switch(i.tag){case 0:case 11:case 14:case 15:Xo(4,i,i.return),Ji(i);break;case 1:Aa(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&h1(i,i.return,u),Ji(i);break;case 27:cu(i.stateNode);case 26:case 5:Aa(i,i.return),Ji(i);break;case 22:i.memoizedState===null&&Ji(i);break;case 30:Ji(i);break;default:Ji(i)}o=o.sibling}}function mo(o,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var p=i.alternate,E=o,T=i,D=T.flags;switch(T.tag){case 0:case 11:case 15:mo(E,T,u),Jc(4,T);break;case 1:if(mo(E,T,u),p=T,E=p.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(pe){Bt(p,p.return,pe)}if(p=T,E=p.updateQueue,E!==null){var B=p.stateNode;try{var ne=E.shared.hiddenCallbacks;if(ne!==null)for(E.shared.hiddenCallbacks=null,E=0;E<ne.length;E++)nN(ne[E],B)}catch(pe){Bt(p,p.return,pe)}}u&&D&64&&m1(T),eu(T,T.return);break;case 27:b1(T);case 26:case 5:mo(E,T,u),u&&p===null&&D&4&&g1(T),eu(T,T.return);break;case 12:mo(E,T,u);break;case 31:mo(E,T,u),u&&D&4&&w1(E,T);break;case 13:mo(E,T,u),u&&D&4&&_1(E,T);break;case 22:T.memoizedState===null&&mo(E,T,u),eu(T,T.return);break;case 30:break;default:mo(E,T,u)}i=i.sibling}}function ev(o,i){var u=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==u&&(o!=null&&o.refCount++,u!=null&&zc(u))}function tv(o,i){o=null,i.alternate!==null&&(o=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==o&&(i.refCount++,o!=null&&zc(o))}function pa(o,i,u,p){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)C1(o,i,u,p),i=i.sibling}function C1(o,i,u,p){var E=i.flags;switch(i.tag){case 0:case 11:case 15:pa(o,i,u,p),E&2048&&Jc(9,i);break;case 1:pa(o,i,u,p);break;case 3:pa(o,i,u,p),E&2048&&(o=null,i.alternate!==null&&(o=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==o&&(i.refCount++,o!=null&&zc(o)));break;case 12:if(E&2048){pa(o,i,u,p),o=i.stateNode;try{var T=i.memoizedProps,D=T.id,B=T.onPostCommit;typeof B=="function"&&B(D,i.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(ne){Bt(i,i.return,ne)}}else pa(o,i,u,p);break;case 31:pa(o,i,u,p);break;case 13:pa(o,i,u,p);break;case 23:break;case 22:T=i.stateNode,D=i.alternate,i.memoizedState!==null?T._visibility&2?pa(o,i,u,p):tu(o,i):T._visibility&2?pa(o,i,u,p):(T._visibility|=2,el(o,i,u,p,(i.subtreeFlags&10256)!==0||!1)),E&2048&&ev(D,i);break;case 24:pa(o,i,u,p),E&2048&&tv(i.alternate,i);break;default:pa(o,i,u,p)}}function el(o,i,u,p,E){for(E=E&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var T=o,D=i,B=u,ne=p,pe=D.flags;switch(D.tag){case 0:case 11:case 15:el(T,D,B,ne,E),Jc(8,D);break;case 23:break;case 22:var Se=D.stateNode;D.memoizedState!==null?Se._visibility&2?el(T,D,B,ne,E):tu(T,D):(Se._visibility|=2,el(T,D,B,ne,E)),E&&pe&2048&&ev(D.alternate,D);break;case 24:el(T,D,B,ne,E),E&&pe&2048&&tv(D.alternate,D);break;default:el(T,D,B,ne,E)}i=i.sibling}}function tu(o,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=o,p=i,E=p.flags;switch(p.tag){case 22:tu(u,p),E&2048&&ev(p.alternate,p);break;case 24:tu(u,p),E&2048&&tv(p.alternate,p);break;default:tu(u,p)}i=i.sibling}}var ru=8192;function tl(o,i,u){if(o.subtreeFlags&ru)for(o=o.child;o!==null;)A1(o,i,u),o=o.sibling}function A1(o,i,u){switch(o.tag){case 26:tl(o,i,u),o.flags&ru&&o.memoizedState!==null&&c6(u,fa,o.memoizedState,o.memoizedProps);break;case 5:tl(o,i,u);break;case 3:case 4:var p=fa;fa=tp(o.stateNode.containerInfo),tl(o,i,u),fa=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=ru,ru=16777216,tl(o,i,u),ru=p):tl(o,i,u));break;default:tl(o,i,u)}}function N1(o){var i=o.alternate;if(i!==null&&(o=i.child,o!==null)){i.child=null;do i=o.sibling,o.sibling=null,o=i;while(o!==null)}}function nu(o){var i=o.deletions;if((o.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var p=i[u];Mr=p,I1(p,o)}N1(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)k1(o),o=o.sibling}function k1(o){switch(o.tag){case 0:case 11:case 15:nu(o),o.flags&2048&&Xo(9,o,o.return);break;case 3:nu(o);break;case 12:nu(o);break;case 22:var i=o.stateNode;o.memoizedState!==null&&i._visibility&2&&(o.return===null||o.return.tag!==13)?(i._visibility&=-3,Bf(o)):nu(o);break;default:nu(o)}}function Bf(o){var i=o.deletions;if((o.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var p=i[u];Mr=p,I1(p,o)}N1(o)}for(o=o.child;o!==null;){switch(i=o,i.tag){case 0:case 11:case 15:Xo(8,i,i.return),Bf(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Bf(i));break;default:Bf(i)}o=o.sibling}}function I1(o,i){for(;Mr!==null;){var u=Mr;switch(u.tag){case 0:case 11:case 15:Xo(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:zc(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,Mr=p;else e:for(u=o;Mr!==null;){p=Mr;var E=p.sibling,T=p.return;if(S1(p),p===u){Mr=null;break e}if(E!==null){E.return=T,Mr=E;break e}Mr=T}}}var _G={getCacheForType:function(o){var i=Vr(xr),u=i.data.get(o);return u===void 0&&(u=o(),i.data.set(o,u)),u},cacheSignal:function(){return Vr(xr).controller.signal}},TG=typeof WeakMap=="function"?WeakMap:Map,Lt=0,Kt=null,Et=null,_t=0,$t=0,Dn=null,Qo=!1,rl=!1,rv=!1,ho=0,mr=0,Jo=0,es=0,nv=0,Ln=0,nl=0,au=null,yn=null,av=!1,qf=0,O1=0,Hf=1/0,Vf=null,ei=null,Nr=0,ti=null,al=null,go=0,ov=0,iv=null,D1=null,ou=0,sv=null;function Mn(){return(Lt&2)!==0&&_t!==0?_t&-_t:j.T!==null?pv():ie()}function L1(){if(Ln===0)if((_t&536870912)===0||Ct){var o=pn;pn<<=1,(pn&3932160)===0&&(pn=262144),Ln=o}else Ln=536870912;return o=In.current,o!==null&&(o.flags|=32),Ln}function En(o,i,u){(o===Kt&&($t===2||$t===9)||o.cancelPendingCommit!==null)&&(ol(o,0),ri(o,_t,Ln,!1)),Xt(o,u),((Lt&2)===0||o!==Kt)&&(o===Kt&&((Lt&2)===0&&(es|=u),mr===4&&ri(o,_t,Ln,!1)),Na(o))}function M1(o,i,u){if((Lt&6)!==0)throw Error(n(327));var p=!u&&(i&127)===0&&(i&o.expiredLanes)===0||jt(o,i),E=p?AG(o,i):cv(o,i,!0),T=p;do{if(E===0){rl&&!p&&ri(o,i,0,!1);break}else{if(u=o.current.alternate,T&&!RG(u)){E=cv(o,i,!1),T=!1;continue}if(E===2){if(T=i,o.errorRecoveryDisabledLanes&T)var D=0;else D=o.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){i=D;e:{var B=o;E=au;var ne=B.current.memoizedState.isDehydrated;if(ne&&(ol(B,D).flags|=256),D=cv(B,D,!1),D!==2){if(rv&&!ne){B.errorRecoveryDisabledLanes|=T,es|=T,E=4;break e}T=yn,yn=E,T!==null&&(yn===null?yn=T:yn.push.apply(yn,T))}E=D}if(T=!1,E!==2)continue}}if(E===1){ol(o,0),ri(o,i,0,!0);break}e:{switch(p=o,T=E,T){case 0:case 1:throw Error(n(345));case 4:if((i&4194048)!==i)break;case 6:ri(p,i,Ln,!Qo);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(n(329))}if((i&62914560)===i&&(E=qf+300-we(),10<E)){if(ri(p,i,Ln,!Qo),Qe(p,0,!0)!==0)break e;go=i,p.timeoutHandle=fk(P1.bind(null,p,u,yn,Vf,av,i,Ln,es,nl,Qo,T,"Throttled",-0,0),E);break e}P1(p,u,yn,Vf,av,i,Ln,es,nl,Qo,T,null,-0,0)}}break}while(!0);Na(o)}function P1(o,i,u,p,E,T,D,B,ne,pe,Se,Re,he,Ee){if(o.timeoutHandle=-1,Re=i.subtreeFlags,Re&8192||(Re&16785408)===16785408){Re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:eo},A1(i,T,Re);var Ve=(T&62914560)===T?qf-we():(T&4194048)===T?O1-we():0;if(Ve=u6(Re,Ve),Ve!==null){go=T,o.cancelPendingCommit=Ve(H1.bind(null,o,i,T,u,p,E,D,B,ne,Se,Re,null,he,Ee)),ri(o,T,D,!pe);return}}H1(o,i,T,u,p,E,D,B,ne)}function RG(o){for(var i=o;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var E=u[p],T=E.getSnapshot;E=E.value;try{if(!Nn(T(),E))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===o)break;for(;i.sibling===null;){if(i.return===null||i.return===o)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ri(o,i,u,p){i&=~nv,i&=~es,o.suspendedLanes|=i,o.pingedLanes&=~i,p&&(o.warmLanes|=i),p=o.expirationTimes;for(var E=i;0<E;){var T=31-fr(E),D=1<<T;p[T]=-1,E&=~D}u!==0&&_a(o,u,i)}function Gf(){return(Lt&6)===0?(iu(0),!1):!0}function lv(){if(Et!==null){if($t===0)var o=Et.return;else o=Et,ao=Vi=null,_g(o),Ks=null,Bc=0,o=Et;for(;o!==null;)p1(o.alternate,o),o=o.return;Et=null}}function ol(o,i){var u=o.timeoutHandle;u!==-1&&(o.timeoutHandle=-1,GG(u)),u=o.cancelPendingCommit,u!==null&&(o.cancelPendingCommit=null,u()),go=0,lv(),Kt=o,Et=u=ro(o.current,null),_t=i,$t=0,Dn=null,Qo=!1,rl=jt(o,i),rv=!1,nl=Ln=nv=es=Jo=mr=0,yn=au=null,av=!1,(i&8)!==0&&(i|=i&32);var p=o.entangledLanes;if(p!==0)for(o=o.entanglements,p&=i;0<p;){var E=31-fr(p),T=1<<E;i|=o[E],p&=~T}return ho=i,pf(),u}function j1(o,i){dt=null,j.H=Zc,i===Ys||i===Sf?(i=JA(),$t=3):i===fg?(i=JA(),$t=4):$t=i===zg?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Dn=i,Et===null&&(mr=1,Mf(o,Gn(i,o.current)))}function U1(){var o=In.current;return o===null?!0:(_t&4194048)===_t?Zn===null:(_t&62914560)===_t||(_t&536870912)!==0?o===Zn:!1}function F1(){var o=j.H;return j.H=Zc,o===null?Zc:o}function z1(){var o=j.A;return j.A=_G,o}function Wf(){mr=4,Qo||(_t&4194048)!==_t&&In.current!==null||(rl=!0),(Jo&134217727)===0&&(es&134217727)===0||Kt===null||ri(Kt,_t,Ln,!1)}function cv(o,i,u){var p=Lt;Lt|=2;var E=F1(),T=z1();(Kt!==o||_t!==i)&&(Vf=null,ol(o,i)),i=!1;var D=mr;e:do try{if($t!==0&&Et!==null){var B=Et,ne=Dn;switch($t){case 8:lv(),D=6;break e;case 3:case 2:case 9:case 6:In.current===null&&(i=!0);var pe=$t;if($t=0,Dn=null,il(o,B,ne,pe),u&&rl){D=0;break e}break;default:pe=$t,$t=0,Dn=null,il(o,B,ne,pe)}}CG(),D=mr;break}catch(Se){j1(o,Se)}while(!0);return i&&o.shellSuspendCounter++,ao=Vi=null,Lt=p,j.H=E,j.A=T,Et===null&&(Kt=null,_t=0,pf()),D}function CG(){for(;Et!==null;)$1(Et)}function AG(o,i){var u=Lt;Lt|=2;var p=F1(),E=z1();Kt!==o||_t!==i?(Vf=null,Hf=we()+500,ol(o,i)):rl=jt(o,i);e:do try{if($t!==0&&Et!==null){i=Et;var T=Dn;t:switch($t){case 1:$t=0,Dn=null,il(o,i,T,1);break;case 2:case 9:if(XA(T)){$t=0,Dn=null,B1(i);break}i=function(){$t!==2&&$t!==9||Kt!==o||($t=7),Na(o)},T.then(i,i);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:XA(T)?($t=0,Dn=null,B1(i)):($t=0,Dn=null,il(o,i,T,7));break;case 5:var D=null;switch(Et.tag){case 26:D=Et.memoizedState;case 5:case 27:var B=Et;if(D?Ck(D):B.stateNode.complete){$t=0,Dn=null;var ne=B.sibling;if(ne!==null)Et=ne;else{var pe=B.return;pe!==null?(Et=pe,Yf(pe)):Et=null}break t}}$t=0,Dn=null,il(o,i,T,5);break;case 6:$t=0,Dn=null,il(o,i,T,6);break;case 8:lv(),mr=6;break e;default:throw Error(n(462))}}NG();break}catch(Se){j1(o,Se)}while(!0);return ao=Vi=null,j.H=p,j.A=E,Lt=u,Et!==null?0:(Kt=null,_t=0,pf(),mr)}function NG(){for(;Et!==null&&!Ce();)$1(Et)}function $1(o){var i=d1(o.alternate,o,ho);o.memoizedProps=o.pendingProps,i===null?Yf(o):Et=i}function B1(o){var i=o,u=i.alternate;switch(i.tag){case 15:case 0:i=o1(u,i,i.pendingProps,i.type,void 0,_t);break;case 11:i=o1(u,i,i.pendingProps,i.type.render,i.ref,_t);break;case 5:_g(i);default:p1(u,i),i=Et=zA(i,ho),i=d1(u,i,ho)}o.memoizedProps=o.pendingProps,i===null?Yf(o):Et=i}function il(o,i,u,p){ao=Vi=null,_g(i),Ks=null,Bc=0;var E=i.return;try{if(vG(o,E,i,u,_t)){mr=1,Mf(o,Gn(u,o.current)),Et=null;return}}catch(T){if(E!==null)throw Et=E,T;mr=1,Mf(o,Gn(u,o.current)),Et=null;return}i.flags&32768?(Ct||p===1?o=!0:rl||(_t&536870912)!==0?o=!1:(Qo=o=!0,(p===2||p===9||p===3||p===6)&&(p=In.current,p!==null&&p.tag===13&&(p.flags|=16384))),q1(i,o)):Yf(i)}function Yf(o){var i=o;do{if((i.flags&32768)!==0){q1(i,Qo);return}o=i.return;var u=EG(i.alternate,i,ho);if(u!==null){Et=u;return}if(i=i.sibling,i!==null){Et=i;return}Et=i=o}while(i!==null);mr===0&&(mr=5)}function q1(o,i){do{var u=SG(o.alternate,o);if(u!==null){u.flags&=32767,Et=u;return}if(u=o.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(o=o.sibling,o!==null)){Et=o;return}Et=o=u}while(o!==null);mr=6,Et=null}function H1(o,i,u,p,E,T,D,B,ne){o.cancelPendingCommit=null;do Kf();while(Nr!==0);if((Lt&6)!==0)throw Error(n(327));if(i!==null){if(i===o.current)throw Error(n(177));if(T=i.lanes|i.childLanes,T|=Xh,Jr(o,u,T,D,B,ne),o===Kt&&(Et=Kt=null,_t=0),al=i,ti=o,go=u,ov=T,iv=E,D1=p,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,DG(ot,function(){return K1(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||p){p=j.T,j.T=null,E=G.p,G.p=2,D=Lt,Lt|=4;try{xG(o,i,u)}finally{Lt=D,G.p=E,j.T=p}}Nr=1,V1(),G1(),W1()}}function V1(){if(Nr===1){Nr=0;var o=ti,i=al,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=j.T,j.T=null;var p=G.p;G.p=2;var E=Lt;Lt|=4;try{T1(i,o);var T=Sv,D=IA(o.containerInfo),B=T.focusedElem,ne=T.selectionRange;if(D!==B&&B&&B.ownerDocument&&kA(B.ownerDocument.documentElement,B)){if(ne!==null&&Gh(B)){var pe=ne.start,Se=ne.end;if(Se===void 0&&(Se=pe),"selectionStart"in B)B.selectionStart=pe,B.selectionEnd=Math.min(Se,B.value.length);else{var Re=B.ownerDocument||document,he=Re&&Re.defaultView||window;if(he.getSelection){var Ee=he.getSelection(),Ve=B.textContent.length,rt=Math.min(ne.start,Ve),Vt=ne.end===void 0?rt:Math.min(ne.end,Ve);!Ee.extend&&rt>Vt&&(D=Vt,Vt=rt,rt=D);var ue=NA(B,rt),se=NA(B,Vt);if(ue&&se&&(Ee.rangeCount!==1||Ee.anchorNode!==ue.node||Ee.anchorOffset!==ue.offset||Ee.focusNode!==se.node||Ee.focusOffset!==se.offset)){var fe=Re.createRange();fe.setStart(ue.node,ue.offset),Ee.removeAllRanges(),rt>Vt?(Ee.addRange(fe),Ee.extend(se.node,se.offset)):(fe.setEnd(se.node,se.offset),Ee.addRange(fe))}}}}for(Re=[],Ee=B;Ee=Ee.parentNode;)Ee.nodeType===1&&Re.push({element:Ee,left:Ee.scrollLeft,top:Ee.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;B<Re.length;B++){var Te=Re[B];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}sp=!!Ev,Sv=Ev=null}finally{Lt=E,G.p=p,j.T=u}}o.current=i,Nr=2}}function G1(){if(Nr===2){Nr=0;var o=ti,i=al,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=j.T,j.T=null;var p=G.p;G.p=2;var E=Lt;Lt|=4;try{E1(o,i.alternate,i)}finally{Lt=E,G.p=p,j.T=u}}Nr=3}}function W1(){if(Nr===4||Nr===3){Nr=0,ze();var o=ti,i=al,u=go,p=D1;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Nr=5:(Nr=0,al=ti=null,Y1(o,o.pendingLanes));var E=o.pendingLanes;if(E===0&&(ei=null),Z(u),i=i.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(or,i,void 0,(i.current.flags&128)===128)}catch{}if(p!==null){i=j.T,E=G.p,G.p=2,j.T=null;try{for(var T=o.onRecoverableError,D=0;D<p.length;D++){var B=p[D];T(B.value,{componentStack:B.stack})}}finally{j.T=i,G.p=E}}(go&3)!==0&&Kf(),Na(o),E=o.pendingLanes,(u&261930)!==0&&(E&42)!==0?o===sv?ou++:(ou=0,sv=o):ou=0,iu(0)}}function Y1(o,i){(o.pooledCacheLanes&=i)===0&&(i=o.pooledCache,i!=null&&(o.pooledCache=null,zc(i)))}function Kf(){return V1(),G1(),W1(),K1()}function K1(){if(Nr!==5)return!1;var o=ti,i=ov;ov=0;var u=Z(go),p=j.T,E=G.p;try{G.p=32>u?32:u,j.T=null,u=iv,iv=null;var T=ti,D=go;if(Nr=0,al=ti=null,go=0,(Lt&6)!==0)throw Error(n(331));var B=Lt;if(Lt|=4,k1(T.current),C1(T,T.current,D,u),Lt=B,iu(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(or,T)}catch{}return!0}finally{G.p=E,j.T=p,Y1(o,i)}}function Z1(o,i,u){i=Gn(u,i),i=Fg(o.stateNode,i,2),o=Yo(o,i,2),o!==null&&(Xt(o,2),Na(o))}function Bt(o,i,u){if(o.tag===3)Z1(o,o,u);else for(;i!==null;){if(i.tag===3){Z1(i,o,u);break}else if(i.tag===1){var p=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(ei===null||!ei.has(p))){o=Gn(u,o),u=XN(2),p=Yo(i,u,2),p!==null&&(QN(u,p,i,o),Xt(p,2),Na(p));break}}i=i.return}}function uv(o,i,u){var p=o.pingCache;if(p===null){p=o.pingCache=new TG;var E=new Set;p.set(i,E)}else E=p.get(i),E===void 0&&(E=new Set,p.set(i,E));E.has(u)||(rv=!0,E.add(u),o=kG.bind(null,o,i,u),i.then(o,o))}function kG(o,i,u){var p=o.pingCache;p!==null&&p.delete(i),o.pingedLanes|=o.suspendedLanes&u,o.warmLanes&=~u,Kt===o&&(_t&u)===u&&(mr===4||mr===3&&(_t&62914560)===_t&&300>we()-qf?(Lt&2)===0&&ol(o,0):nv|=u,nl===_t&&(nl=0)),Na(o)}function X1(o,i){i===0&&(i=Lr()),o=Bi(o,i),o!==null&&(Xt(o,i),Na(o))}function IG(o){var i=o.memoizedState,u=0;i!==null&&(u=i.retryLane),X1(o,u)}function OG(o,i){var u=0;switch(o.tag){case 31:case 13:var p=o.stateNode,E=o.memoizedState;E!==null&&(u=E.retryLane);break;case 19:p=o.stateNode;break;case 22:p=o.stateNode._retryCache;break;default:throw Error(n(314))}p!==null&&p.delete(i),X1(o,u)}function DG(o,i){return at(o,i)}var Zf=null,sl=null,dv=!1,Xf=!1,fv=!1,ni=0;function Na(o){o!==sl&&o.next===null&&(sl===null?Zf=sl=o:sl=sl.next=o),Xf=!0,dv||(dv=!0,MG())}function iu(o,i){if(!fv&&Xf){fv=!0;do for(var u=!1,p=Zf;p!==null;){if(o!==0){var E=p.pendingLanes;if(E===0)var T=0;else{var D=p.suspendedLanes,B=p.pingedLanes;T=(1<<31-fr(42|o)+1)-1,T&=E&~(D&~B),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(u=!0,tk(p,T))}else T=_t,T=Qe(p,p===Kt?T:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(T&3)===0||jt(p,T)||(u=!0,tk(p,T));p=p.next}while(u);fv=!1}}function LG(){Q1()}function Q1(){Xf=dv=!1;var o=0;ni!==0&&VG()&&(o=ni);for(var i=we(),u=null,p=Zf;p!==null;){var E=p.next,T=J1(p,i);T===0?(p.next=null,u===null?Zf=E:u.next=E,E===null&&(sl=u)):(u=p,(o!==0||(T&3)!==0)&&(Xf=!0)),p=E}Nr!==0&&Nr!==5||iu(o),ni!==0&&(ni=0)}function J1(o,i){for(var u=o.suspendedLanes,p=o.pingedLanes,E=o.expirationTimes,T=o.pendingLanes&-62914561;0<T;){var D=31-fr(T),B=1<<D,ne=E[D];ne===-1?((B&u)===0||(B&p)!==0)&&(E[D]=Qt(B,i)):ne<=i&&(o.expiredLanes|=B),T&=~B}if(i=Kt,u=_t,u=Qe(o,o===i?u:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,u===0||o===i&&($t===2||$t===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&ce(p),o.callbackNode=null,o.callbackPriority=0;if((u&3)===0||jt(o,u)){if(i=u&-u,i===o.callbackPriority)return i;switch(p!==null&&ce(p),Z(u)){case 2:case 8:u=Je;break;case 32:u=ot;break;case 268435456:u=Ot;break;default:u=ot}return p=ek.bind(null,o),u=at(u,p),o.callbackPriority=i,o.callbackNode=u,i}return p!==null&&p!==null&&ce(p),o.callbackPriority=2,o.callbackNode=null,2}function ek(o,i){if(Nr!==0&&Nr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var u=o.callbackNode;if(Kf()&&o.callbackNode!==u)return null;var p=_t;return p=Qe(o,o===Kt?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(M1(o,p,i),J1(o,we()),o.callbackNode!=null&&o.callbackNode===u?ek.bind(null,o):null)}function tk(o,i){if(Kf())return null;M1(o,i,!0)}function MG(){WG(function(){(Lt&6)!==0?at(Oe,LG):Q1()})}function pv(){if(ni===0){var o=Gs;o===0&&(o=Gt,Gt<<=1,(Gt&261888)===0&&(Gt=256)),ni=o}return ni}function rk(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:af(""+o)}function nk(o,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,o.id&&u.setAttribute("form",o.id),i.parentNode.insertBefore(u,i),o=new FormData(o),u.parentNode.removeChild(u),o}function PG(o,i,u,p,E){if(i==="submit"&&u&&u.stateNode===E){var T=rk((E[Be]||null).action),D=p.submitter;D&&(i=(i=D[Be]||null)?rk(i.formAction):D.getAttribute("formAction"),i!==null&&(T=i,D=null));var B=new cf("action","action",null,p,E);o.push({event:B,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ni!==0){var ne=D?nk(E,D):new FormData(E);Dg(u,{pending:!0,data:ne,method:E.method,action:T},null,ne)}}else typeof T=="function"&&(B.preventDefault(),ne=D?nk(E,D):new FormData(E),Dg(u,{pending:!0,data:ne,method:E.method,action:T},T,ne))},currentTarget:E}]})}}for(var mv=0;mv<Zh.length;mv++){var hv=Zh[mv],jG=hv.toLowerCase(),UG=hv[0].toUpperCase()+hv.slice(1);da(jG,"on"+UG)}da(LA,"onAnimationEnd"),da(MA,"onAnimationIteration"),da(PA,"onAnimationStart"),da("dblclick","onDoubleClick"),da("focusin","onFocus"),da("focusout","onBlur"),da(eG,"onTransitionRun"),da(tG,"onTransitionStart"),da(rG,"onTransitionCancel"),da(jA,"onTransitionEnd"),Ar("onMouseEnter",["mouseout","mouseover"]),Ar("onMouseLeave",["mouseout","mouseover"]),Ar("onPointerEnter",["pointerout","pointerover"]),Ar("onPointerLeave",["pointerout","pointerover"]),sn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),sn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),sn("onBeforeInput",["compositionend","keypress","textInput","paste"]),sn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),sn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),sn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var su="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),FG=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(su));function ak(o,i){i=(i&4)!==0;for(var u=0;u<o.length;u++){var p=o[u],E=p.event;p=p.listeners;e:{var T=void 0;if(i)for(var D=p.length-1;0<=D;D--){var B=p[D],ne=B.instance,pe=B.currentTarget;if(B=B.listener,ne!==T&&E.isPropagationStopped())break e;T=B,E.currentTarget=pe;try{T(E)}catch(Se){ff(Se)}E.currentTarget=null,T=ne}else for(D=0;D<p.length;D++){if(B=p[D],ne=B.instance,pe=B.currentTarget,B=B.listener,ne!==T&&E.isPropagationStopped())break e;T=B,E.currentTarget=pe;try{T(E)}catch(Se){ff(Se)}E.currentTarget=null,T=ne}}}}function St(o,i){var u=i[Ut];u===void 0&&(u=i[Ut]=new Set);var p=o+"__bubble";u.has(p)||(ok(i,o,2,!1),u.add(p))}function gv(o,i,u){var p=0;i&&(p|=4),ok(u,o,p,i)}var Qf="_reactListening"+Math.random().toString(36).slice(2);function vv(o){if(!o[Qf]){o[Qf]=!0,An.forEach(function(u){u!=="selectionchange"&&(FG.has(u)||gv(u,!1,o),gv(u,!0,o))});var i=o.nodeType===9?o:o.ownerDocument;i===null||i[Qf]||(i[Qf]=!0,gv("selectionchange",!1,i))}}function ok(o,i,u,p){switch(Lk(i)){case 2:var E=p6;break;case 8:E=m6;break;default:E=Ov}u=E.bind(null,i,u,o),E=void 0,!jh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(E=!0),p?E!==void 0?o.addEventListener(i,u,{capture:!0,passive:E}):o.addEventListener(i,u,!0):E!==void 0?o.addEventListener(i,u,{passive:E}):o.addEventListener(i,u,!1)}function bv(o,i,u,p,E){var T=p;if((i&1)===0&&(i&2)===0&&p!==null)e:for(;;){if(p===null)return;var D=p.tag;if(D===3||D===4){var B=p.stateNode.containerInfo;if(B===E)break;if(D===4)for(D=p.return;D!==null;){var ne=D.tag;if((ne===3||ne===4)&&D.stateNode.containerInfo===E)return;D=D.return}for(;B!==null;){if(D=Dt(B),D===null)return;if(ne=D.tag,ne===5||ne===6||ne===26||ne===27){p=T=D;continue e}B=B.parentNode}}p=p.return}uA(function(){var pe=T,Se=Mh(u),Re=[];e:{var he=UA.get(o);if(he!==void 0){var Ee=cf,Ve=o;switch(o){case"keypress":if(sf(u)===0)break e;case"keydown":case"keyup":Ee=OV;break;case"focusin":Ve="focus",Ee=$h;break;case"focusout":Ve="blur",Ee=$h;break;case"beforeblur":case"afterblur":Ee=$h;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ee=pA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ee=EV;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ee=MV;break;case LA:case MA:case PA:Ee=wV;break;case jA:Ee=jV;break;case"scroll":case"scrollend":Ee=bV;break;case"wheel":Ee=FV;break;case"copy":case"cut":case"paste":Ee=TV;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ee=hA;break;case"toggle":case"beforetoggle":Ee=$V}var rt=(i&4)!==0,Vt=!rt&&(o==="scroll"||o==="scrollend"),ue=rt?he!==null?he+"Capture":null:he;rt=[];for(var se=pe,fe;se!==null;){var Te=se;if(fe=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||fe===null||ue===null||(Te=Nc(se,ue),Te!=null&&rt.push(lu(se,Te,fe))),Vt)break;se=se.return}0<rt.length&&(he=new Ee(he,Ve,null,u,Se),Re.push({event:he,listeners:rt}))}}if((i&7)===0){e:{if(he=o==="mouseover"||o==="pointerover",Ee=o==="mouseout"||o==="pointerout",he&&u!==Lh&&(Ve=u.relatedTarget||u.fromElement)&&(Dt(Ve)||Ve[mt]))break e;if((Ee||he)&&(he=Se.window===Se?Se:(he=Se.ownerDocument)?he.defaultView||he.parentWindow:window,Ee?(Ve=u.relatedTarget||u.toElement,Ee=pe,Ve=Ve?Dt(Ve):null,Ve!==null&&(Vt=s(Ve),rt=Ve.tag,Ve!==Vt||rt!==5&&rt!==27&&rt!==6)&&(Ve=null)):(Ee=null,Ve=pe),Ee!==Ve)){if(rt=pA,Te="onMouseLeave",ue="onMouseEnter",se="mouse",(o==="pointerout"||o==="pointerover")&&(rt=hA,Te="onPointerLeave",ue="onPointerEnter",se="pointer"),Vt=Ee==null?he:Pt(Ee),fe=Ve==null?he:Pt(Ve),he=new rt(Te,se+"leave",Ee,u,Se),he.target=Vt,he.relatedTarget=fe,Te=null,Dt(Se)===pe&&(rt=new rt(ue,se+"enter",Ve,u,Se),rt.target=fe,rt.relatedTarget=Vt,Te=rt),Vt=Te,Ee&&Ve)t:{for(rt=zG,ue=Ee,se=Ve,fe=0,Te=ue;Te;Te=rt(Te))fe++;Te=0;for(var et=se;et;et=rt(et))Te++;for(;0<fe-Te;)ue=rt(ue),fe--;for(;0<Te-fe;)se=rt(se),Te--;for(;fe--;){if(ue===se||se!==null&&ue===se.alternate){rt=ue;break t}ue=rt(ue),se=rt(se)}rt=null}else rt=null;Ee!==null&&ik(Re,he,Ee,rt,!1),Ve!==null&&Vt!==null&&ik(Re,Vt,Ve,rt,!0)}}e:{if(he=pe?Pt(pe):window,Ee=he.nodeName&&he.nodeName.toLowerCase(),Ee==="select"||Ee==="input"&&he.type==="file")var kt=wA;else if(SA(he))if(_A)kt=XV;else{kt=KV;var Ke=YV}else Ee=he.nodeName,!Ee||Ee.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?pe&&Dh(pe.elementType)&&(kt=wA):kt=ZV;if(kt&&(kt=kt(o,pe))){xA(Re,kt,u,Se);break e}Ke&&Ke(o,he,pe),o==="focusout"&&pe&&he.type==="number"&&pe.memoizedProps.value!=null&&Oh(he,"number",he.value)}switch(Ke=pe?Pt(pe):window,o){case"focusin":(SA(Ke)||Ke.contentEditable==="true")&&(Us=Ke,Wh=pe,jc=null);break;case"focusout":jc=Wh=Us=null;break;case"mousedown":Yh=!0;break;case"contextmenu":case"mouseup":case"dragend":Yh=!1,OA(Re,u,Se);break;case"selectionchange":if(JV)break;case"keydown":case"keyup":OA(Re,u,Se)}var ht;if(qh)e:{switch(o){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else js?yA(o,u)&&(Tt="onCompositionEnd"):o==="keydown"&&u.keyCode===229&&(Tt="onCompositionStart");Tt&&(gA&&u.locale!=="ko"&&(js||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&js&&(ht=dA()):($o=Se,Uh="value"in $o?$o.value:$o.textContent,js=!0)),Ke=Jf(pe,Tt),0<Ke.length&&(Tt=new mA(Tt,o,null,u,Se),Re.push({event:Tt,listeners:Ke}),ht?Tt.data=ht:(ht=EA(u),ht!==null&&(Tt.data=ht)))),(ht=qV?HV(o,u):VV(o,u))&&(Tt=Jf(pe,"onBeforeInput"),0<Tt.length&&(Ke=new mA("onBeforeInput","beforeinput",null,u,Se),Re.push({event:Ke,listeners:Tt}),Ke.data=ht)),PG(Re,o,pe,u,Se)}ak(Re,i)})}function lu(o,i,u){return{instance:o,listener:i,currentTarget:u}}function Jf(o,i){for(var u=i+"Capture",p=[];o!==null;){var E=o,T=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||T===null||(E=Nc(o,u),E!=null&&p.unshift(lu(o,E,T)),E=Nc(o,i),E!=null&&p.push(lu(o,E,T))),o.tag===3)return p;o=o.return}return[]}function zG(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function ik(o,i,u,p,E){for(var T=i._reactName,D=[];u!==null&&u!==p;){var B=u,ne=B.alternate,pe=B.stateNode;if(B=B.tag,ne!==null&&ne===p)break;B!==5&&B!==26&&B!==27||pe===null||(ne=pe,E?(pe=Nc(u,T),pe!=null&&D.unshift(lu(u,pe,ne))):E||(pe=Nc(u,T),pe!=null&&D.push(lu(u,pe,ne)))),u=u.return}D.length!==0&&o.push({event:i,listeners:D})}var $G=/\r\n?/g,BG=/\u0000|\uFFFD/g;function sk(o){return(typeof o=="string"?o:""+o).replace($G,`
23
23
  `).replace(BG,"")}function lk(o,i){return i=sk(i),sk(o)===i}function Ht(o,i,u,p,E,T){switch(u){case"children":typeof p=="string"?i==="body"||i==="textarea"&&p===""||Ls(o,p):(typeof p=="number"||typeof p=="bigint")&&i!=="body"&&Ls(o,""+p);break;case"className":ji(o,"class",p);break;case"tabIndex":ji(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":ji(o,u,p);break;case"style":lA(o,p,T);break;case"data":if(i!=="object"){ji(o,"data",p);break}case"src":case"href":if(p===""&&(i!=="a"||u!=="href")){o.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(u);break}p=af(""+p),o.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){o.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof T=="function"&&(u==="formAction"?(i!=="input"&&Ht(o,i,"name",E.name,E,null),Ht(o,i,"formEncType",E.formEncType,E,null),Ht(o,i,"formMethod",E.formMethod,E,null),Ht(o,i,"formTarget",E.formTarget,E,null)):(Ht(o,i,"encType",E.encType,E,null),Ht(o,i,"method",E.method,E,null),Ht(o,i,"target",E.target,E,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(u);break}p=af(""+p),o.setAttribute(u,p);break;case"onClick":p!=null&&(o.onclick=eo);break;case"onScroll":p!=null&&St("scroll",o);break;case"onScrollEnd":p!=null&&St("scrollend",o);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(n(61));if(u=p.__html,u!=null){if(E.children!=null)throw Error(n(60));o.innerHTML=u}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}u=af(""+p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(u,""+p):o.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(u,""):o.removeAttribute(u);break;case"capture":case"download":p===!0?o.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(u,p):o.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(u,p):o.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(u):o.setAttribute(u,p);break;case"popover":St("beforetoggle",o),St("toggle",o),Pi(o,"popover",p);break;case"xlinkActuate":mn(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":mn(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":mn(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":mn(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":mn(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":mn(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":mn(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":mn(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":mn(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Pi(o,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=gV.get(u)||u,Pi(o,u,p))}}function yv(o,i,u,p,E,T){switch(u){case"style":lA(o,p,T);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(n(61));if(u=p.__html,u!=null){if(E.children!=null)throw Error(n(60));o.innerHTML=u}}break;case"children":typeof p=="string"?Ls(o,p):(typeof p=="number"||typeof p=="bigint")&&Ls(o,""+p);break;case"onScroll":p!=null&&St("scroll",o);break;case"onScrollEnd":p!=null&&St("scrollend",o);break;case"onClick":p!=null&&(o.onclick=eo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ja.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(E=u.endsWith("Capture"),i=u.slice(2,E?u.length-7:void 0),T=o[Be]||null,T=T!=null?T[u]:null,typeof T=="function"&&o.removeEventListener(i,T,E),typeof p=="function")){typeof T!="function"&&T!==null&&(u in o?o[u]=null:o.hasAttribute(u)&&o.removeAttribute(u)),o.addEventListener(i,p,E);break e}u in o?o[u]=p:p===!0?o.setAttribute(u,""):Pi(o,u,p)}}}function Wr(o,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",o),St("load",o);var p=!1,E=!1,T;for(T in u)if(u.hasOwnProperty(T)){var D=u[T];if(D!=null)switch(T){case"src":p=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,i));default:Ht(o,i,T,D,u,null)}}E&&Ht(o,i,"srcSet",u.srcSet,u,null),p&&Ht(o,i,"src",u.src,u,null);return;case"input":St("invalid",o);var B=T=D=E=null,ne=null,pe=null;for(p in u)if(u.hasOwnProperty(p)){var Se=u[p];if(Se!=null)switch(p){case"name":E=Se;break;case"type":D=Se;break;case"checked":ne=Se;break;case"defaultChecked":pe=Se;break;case"value":T=Se;break;case"defaultValue":B=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(n(137,i));break;default:Ht(o,i,p,Se,u,null)}}aA(o,T,B,ne,pe,D,E,!1);return;case"select":St("invalid",o),p=D=T=null;for(E in u)if(u.hasOwnProperty(E)&&(B=u[E],B!=null))switch(E){case"value":T=B;break;case"defaultValue":D=B;break;case"multiple":p=B;default:Ht(o,i,E,B,u,null)}i=T,u=D,o.multiple=!!p,i!=null?Ds(o,!!p,i,!1):u!=null&&Ds(o,!!p,u,!0);return;case"textarea":St("invalid",o),T=E=p=null;for(D in u)if(u.hasOwnProperty(D)&&(B=u[D],B!=null))switch(D){case"value":p=B;break;case"defaultValue":E=B;break;case"children":T=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(n(91));break;default:Ht(o,i,D,B,u,null)}iA(o,p,E,T);return;case"option":for(ne in u)if(u.hasOwnProperty(ne)&&(p=u[ne],p!=null))switch(ne){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Ht(o,i,ne,p,u,null)}return;case"dialog":St("beforetoggle",o),St("toggle",o),St("cancel",o),St("close",o);break;case"iframe":case"object":St("load",o);break;case"video":case"audio":for(p=0;p<su.length;p++)St(su[p],o);break;case"image":St("error",o),St("load",o);break;case"details":St("toggle",o);break;case"embed":case"source":case"link":St("error",o),St("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(pe in u)if(u.hasOwnProperty(pe)&&(p=u[pe],p!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,i));default:Ht(o,i,pe,p,u,null)}return;default:if(Dh(i)){for(Se in u)u.hasOwnProperty(Se)&&(p=u[Se],p!==void 0&&yv(o,i,Se,p,u,void 0));return}}for(B in u)u.hasOwnProperty(B)&&(p=u[B],p!=null&&Ht(o,i,B,p,u,null))}function qG(o,i,u,p){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,T=null,D=null,B=null,ne=null,pe=null,Se=null;for(Ee in u){var Re=u[Ee];if(u.hasOwnProperty(Ee)&&Re!=null)switch(Ee){case"checked":break;case"value":break;case"defaultValue":ne=Re;default:p.hasOwnProperty(Ee)||Ht(o,i,Ee,null,p,Re)}}for(var he in p){var Ee=p[he];if(Re=u[he],p.hasOwnProperty(he)&&(Ee!=null||Re!=null))switch(he){case"type":T=Ee;break;case"name":E=Ee;break;case"checked":pe=Ee;break;case"defaultChecked":Se=Ee;break;case"value":D=Ee;break;case"defaultValue":B=Ee;break;case"children":case"dangerouslySetInnerHTML":if(Ee!=null)throw Error(n(137,i));break;default:Ee!==Re&&Ht(o,i,he,Ee,p,Re)}}Ih(o,D,B,ne,pe,Se,T,E);return;case"select":Ee=D=B=he=null;for(T in u)if(ne=u[T],u.hasOwnProperty(T)&&ne!=null)switch(T){case"value":break;case"multiple":Ee=ne;default:p.hasOwnProperty(T)||Ht(o,i,T,null,p,ne)}for(E in p)if(T=p[E],ne=u[E],p.hasOwnProperty(E)&&(T!=null||ne!=null))switch(E){case"value":he=T;break;case"defaultValue":B=T;break;case"multiple":D=T;default:T!==ne&&Ht(o,i,E,T,p,ne)}i=B,u=D,p=Ee,he!=null?Ds(o,!!u,he,!1):!!p!=!!u&&(i!=null?Ds(o,!!u,i,!0):Ds(o,!!u,u?[]:"",!1));return;case"textarea":Ee=he=null;for(B in u)if(E=u[B],u.hasOwnProperty(B)&&E!=null&&!p.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:Ht(o,i,B,null,p,E)}for(D in p)if(E=p[D],T=u[D],p.hasOwnProperty(D)&&(E!=null||T!=null))switch(D){case"value":he=E;break;case"defaultValue":Ee=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(n(91));break;default:E!==T&&Ht(o,i,D,E,p,T)}oA(o,he,Ee);return;case"option":for(var Ve in u)if(he=u[Ve],u.hasOwnProperty(Ve)&&he!=null&&!p.hasOwnProperty(Ve))switch(Ve){case"selected":o.selected=!1;break;default:Ht(o,i,Ve,null,p,he)}for(ne in p)if(he=p[ne],Ee=u[ne],p.hasOwnProperty(ne)&&he!==Ee&&(he!=null||Ee!=null))switch(ne){case"selected":o.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:Ht(o,i,ne,he,p,Ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var rt in u)he=u[rt],u.hasOwnProperty(rt)&&he!=null&&!p.hasOwnProperty(rt)&&Ht(o,i,rt,null,p,he);for(pe in p)if(he=p[pe],Ee=u[pe],p.hasOwnProperty(pe)&&he!==Ee&&(he!=null||Ee!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(n(137,i));break;default:Ht(o,i,pe,he,p,Ee)}return;default:if(Dh(i)){for(var Vt in u)he=u[Vt],u.hasOwnProperty(Vt)&&he!==void 0&&!p.hasOwnProperty(Vt)&&yv(o,i,Vt,void 0,p,he);for(Se in p)he=p[Se],Ee=u[Se],!p.hasOwnProperty(Se)||he===Ee||he===void 0&&Ee===void 0||yv(o,i,Se,he,p,Ee);return}}for(var ue in u)he=u[ue],u.hasOwnProperty(ue)&&he!=null&&!p.hasOwnProperty(ue)&&Ht(o,i,ue,null,p,he);for(Re in p)he=p[Re],Ee=u[Re],!p.hasOwnProperty(Re)||he===Ee||he==null&&Ee==null||Ht(o,i,Re,he,p,Ee)}function ck(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function HG(){if(typeof performance.getEntriesByType=="function"){for(var o=0,i=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var E=u[p],T=E.transferSize,D=E.initiatorType,B=E.duration;if(T&&B&&ck(D)){for(D=0,B=E.responseEnd,p+=1;p<u.length;p++){var ne=u[p],pe=ne.startTime;if(pe>B)break;var Se=ne.transferSize,Re=ne.initiatorType;Se&&ck(Re)&&(ne=ne.responseEnd,D+=Se*(ne<B?1:(B-pe)/(ne-pe)))}if(--p,i+=8*(T+D)/(E.duration/1e3),o++,10<o)break}}if(0<o)return i/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Ev=null,Sv=null;function ep(o){return o.nodeType===9?o:o.ownerDocument}function uk(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dk(o,i){if(o===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&i==="foreignObject"?0:o}function xv(o,i){return o==="textarea"||o==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var wv=null;function VG(){var o=window.event;return o&&o.type==="popstate"?o===wv?!1:(wv=o,!0):(wv=null,!1)}var fk=typeof setTimeout=="function"?setTimeout:void 0,GG=typeof clearTimeout=="function"?clearTimeout:void 0,pk=typeof Promise=="function"?Promise:void 0,WG=typeof queueMicrotask=="function"?queueMicrotask:typeof pk<"u"?function(o){return pk.resolve(null).then(o).catch(YG)}:fk;function YG(o){setTimeout(function(){throw o})}function ai(o){return o==="head"}function mk(o,i){var u=i,p=0;do{var E=u.nextSibling;if(o.removeChild(u),E&&E.nodeType===8)if(u=E.data,u==="/$"||u==="/&"){if(p===0){o.removeChild(E),dl(i);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")cu(o.ownerDocument.documentElement);else if(u==="head"){u=o.ownerDocument.head,cu(u);for(var T=u.firstChild;T;){var D=T.nextSibling,B=T.nodeName;T[Wt]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&T.rel.toLowerCase()==="stylesheet"||u.removeChild(T),T=D}}else u==="body"&&cu(o.ownerDocument.body);u=E}while(u);dl(i)}function hk(o,i){var u=o;o=0;do{var p=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(o===0)break;o--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||o++;u=p}while(u)}function _v(o){var i=o.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":_v(u),it(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}o.removeChild(u)}}function KG(o,i,u,p){for(;o.nodeType===1;){var E=u;if(o.nodeName.toLowerCase()!==i.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[Wt])switch(i){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(T=o.getAttribute("rel"),T==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(T!==E.rel||o.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||o.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||o.getAttribute("title")!==(E.title==null?null:E.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(T=o.getAttribute("src"),(T!==(E.src==null?null:E.src)||o.getAttribute("type")!==(E.type==null?null:E.type)||o.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&T&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(i==="input"&&o.type==="hidden"){var T=E.name==null?null:""+E.name;if(E.type==="hidden"&&o.getAttribute("name")===T)return o}else return o;if(o=Xn(o.nextSibling),o===null)break}return null}function ZG(o,i,u){if(i==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=Xn(o.nextSibling),o===null))return null;return o}function gk(o,i){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!i||(o=Xn(o.nextSibling),o===null))return null;return o}function Tv(o){return o.data==="$?"||o.data==="$~"}function Rv(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function XG(o,i){var u=o.ownerDocument;if(o.data==="$~")o._reactRetry=i;else if(o.data!=="$?"||u.readyState!=="loading")i();else{var p=function(){i(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),o._reactRetry=p}}function Xn(o){for(;o!=null;o=o.nextSibling){var i=o.nodeType;if(i===1||i===3)break;if(i===8){if(i=o.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return o}var Cv=null;function vk(o){o=o.nextSibling;for(var i=0;o;){if(o.nodeType===8){var u=o.data;if(u==="/$"||u==="/&"){if(i===0)return Xn(o.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}o=o.nextSibling}return null}function bk(o){o=o.previousSibling;for(var i=0;o;){if(o.nodeType===8){var u=o.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return o;i--}else u!=="/$"&&u!=="/&"||i++}o=o.previousSibling}return null}function yk(o,i,u){switch(i=ep(u),o){case"html":if(o=i.documentElement,!o)throw Error(n(452));return o;case"head":if(o=i.head,!o)throw Error(n(453));return o;case"body":if(o=i.body,!o)throw Error(n(454));return o;default:throw Error(n(451))}}function cu(o){for(var i=o.attributes;i.length;)o.removeAttributeNode(i[0]);it(o)}var Qn=new Map,Ek=new Set;function tp(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var vo=G.d;G.d={f:QG,r:JG,D:e6,C:t6,L:r6,m:n6,X:o6,S:a6,M:i6};function QG(){var o=vo.f(),i=Gf();return o||i}function JG(o){var i=Yt(o);i!==null&&i.tag===5&&i.type==="form"?jN(i):vo.r(o)}var ll=typeof document>"u"?null:document;function Sk(o,i,u){var p=ll;if(p&&typeof i=="string"&&i){var E=Hn(i);E='link[rel="'+o+'"][href="'+E+'"]',typeof u=="string"&&(E+='[crossorigin="'+u+'"]'),Ek.has(E)||(Ek.add(E),o={rel:o,crossOrigin:u,href:i},p.querySelector(E)===null&&(i=p.createElement("link"),Wr(i,"link",o),zt(i),p.head.appendChild(i)))}}function e6(o){vo.D(o),Sk("dns-prefetch",o,null)}function t6(o,i){vo.C(o,i),Sk("preconnect",o,i)}function r6(o,i,u){vo.L(o,i,u);var p=ll;if(p&&o&&i){var E='link[rel="preload"][as="'+Hn(i)+'"]';i==="image"&&u&&u.imageSrcSet?(E+='[imagesrcset="'+Hn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(E+='[imagesizes="'+Hn(u.imageSizes)+'"]')):E+='[href="'+Hn(o)+'"]';var T=E;switch(i){case"style":T=cl(o);break;case"script":T=ul(o)}Qn.has(T)||(o=h({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:o,as:i},u),Qn.set(T,o),p.querySelector(E)!==null||i==="style"&&p.querySelector(uu(T))||i==="script"&&p.querySelector(du(T))||(i=p.createElement("link"),Wr(i,"link",o),zt(i),p.head.appendChild(i)))}}function n6(o,i){vo.m(o,i);var u=ll;if(u&&o){var p=i&&typeof i.as=="string"?i.as:"script",E='link[rel="modulepreload"][as="'+Hn(p)+'"][href="'+Hn(o)+'"]',T=E;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=ul(o)}if(!Qn.has(T)&&(o=h({rel:"modulepreload",href:o},i),Qn.set(T,o),u.querySelector(E)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(du(T)))return}p=u.createElement("link"),Wr(p,"link",o),zt(p),u.head.appendChild(p)}}}function a6(o,i,u){vo.S(o,i,u);var p=ll;if(p&&o){var E=on(p).hoistableStyles,T=cl(o);i=i||"default";var D=E.get(T);if(!D){var B={loading:0,preload:null};if(D=p.querySelector(uu(T)))B.loading=5;else{o=h({rel:"stylesheet",href:o,"data-precedence":i},u),(u=Qn.get(T))&&Av(o,u);var ne=D=p.createElement("link");zt(ne),Wr(ne,"link",o),ne._p=new Promise(function(pe,Se){ne.onload=pe,ne.onerror=Se}),ne.addEventListener("load",function(){B.loading|=1}),ne.addEventListener("error",function(){B.loading|=2}),B.loading|=4,rp(D,i,p)}D={type:"stylesheet",instance:D,count:1,state:B},E.set(T,D)}}}function o6(o,i){vo.X(o,i);var u=ll;if(u&&o){var p=on(u).hoistableScripts,E=ul(o),T=p.get(E);T||(T=u.querySelector(du(E)),T||(o=h({src:o,async:!0},i),(i=Qn.get(E))&&Nv(o,i),T=u.createElement("script"),zt(T),Wr(T,"link",o),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},p.set(E,T))}}function i6(o,i){vo.M(o,i);var u=ll;if(u&&o){var p=on(u).hoistableScripts,E=ul(o),T=p.get(E);T||(T=u.querySelector(du(E)),T||(o=h({src:o,async:!0,type:"module"},i),(i=Qn.get(E))&&Nv(o,i),T=u.createElement("script"),zt(T),Wr(T,"link",o),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},p.set(E,T))}}function xk(o,i,u,p){var E=(E=F.current)?tp(E):null;if(!E)throw Error(n(446));switch(o){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=cl(u.href),u=on(E).hoistableStyles,p=u.get(i),p||(p={type:"style",instance:null,count:0,state:null},u.set(i,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){o=cl(u.href);var T=on(E).hoistableStyles,D=T.get(o);if(D||(E=E.ownerDocument||E,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(o,D),(T=E.querySelector(uu(o)))&&!T._p&&(D.instance=T,D.state.loading=5),Qn.has(o)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Qn.set(o,u),T||s6(E,o,u,D.state))),i&&p===null)throw Error(n(528,""));return D}if(i&&p!==null)throw Error(n(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ul(u),u=on(E).hoistableScripts,p=u.get(i),p||(p={type:"script",instance:null,count:0,state:null},u.set(i,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,o))}}function cl(o){return'href="'+Hn(o)+'"'}function uu(o){return'link[rel="stylesheet"]['+o+"]"}function wk(o){return h({},o,{"data-precedence":o.precedence,precedence:null})}function s6(o,i,u,p){o.querySelector('link[rel="preload"][as="style"]['+i+"]")?p.loading=1:(i=o.createElement("link"),p.preload=i,i.addEventListener("load",function(){return p.loading|=1}),i.addEventListener("error",function(){return p.loading|=2}),Wr(i,"link",u),zt(i),o.head.appendChild(i))}function ul(o){return'[src="'+Hn(o)+'"]'}function du(o){return"script[async]"+o}function _k(o,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var p=o.querySelector('style[data-href~="'+Hn(u.href)+'"]');if(p)return i.instance=p,zt(p),p;var E=h({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),zt(p),Wr(p,"style",E),rp(p,u.precedence,o),i.instance=p;case"stylesheet":E=cl(u.href);var T=o.querySelector(uu(E));if(T)return i.state.loading|=4,i.instance=T,zt(T),T;p=wk(u),(E=Qn.get(E))&&Av(p,E),T=(o.ownerDocument||o).createElement("link"),zt(T);var D=T;return D._p=new Promise(function(B,ne){D.onload=B,D.onerror=ne}),Wr(T,"link",p),i.state.loading|=4,rp(T,u.precedence,o),i.instance=T;case"script":return T=ul(u.src),(E=o.querySelector(du(T)))?(i.instance=E,zt(E),E):(p=u,(E=Qn.get(T))&&(p=h({},u),Nv(p,E)),o=o.ownerDocument||o,E=o.createElement("script"),zt(E),Wr(E,"link",p),o.head.appendChild(E),i.instance=E);case"void":return null;default:throw Error(n(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(p=i.instance,i.state.loading|=4,rp(p,u.precedence,o));return i.instance}function rp(o,i,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=p.length?p[p.length-1]:null,T=E,D=0;D<p.length;D++){var B=p[D];if(B.dataset.precedence===i)T=B;else if(T!==E)break}T?T.parentNode.insertBefore(o,T.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(o,i.firstChild))}function Av(o,i){o.crossOrigin==null&&(o.crossOrigin=i.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=i.referrerPolicy),o.title==null&&(o.title=i.title)}function Nv(o,i){o.crossOrigin==null&&(o.crossOrigin=i.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=i.referrerPolicy),o.integrity==null&&(o.integrity=i.integrity)}var np=null;function Tk(o,i,u){if(np===null){var p=new Map,E=np=new Map;E.set(u,p)}else E=np,p=E.get(u),p||(p=new Map,E.set(u,p));if(p.has(o))return p;for(p.set(o,null),u=u.getElementsByTagName(o),E=0;E<u.length;E++){var T=u[E];if(!(T[Wt]||T[je]||o==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var D=T.getAttribute(i)||"";D=o+D;var B=p.get(D);B?B.push(T):p.set(D,[T])}}return p}function Rk(o,i,u){o=o.ownerDocument||o,o.head.insertBefore(u,i==="title"?o.querySelector("head > title"):null)}function l6(o,i,u){if(u===1||i.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return o=i.disabled,typeof i.precedence=="string"&&o==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Ck(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function c6(o,i,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var E=cl(p.href),T=i.querySelector(uu(E));if(T){i=T._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(o.count++,o=ap.bind(o),i.then(o,o)),u.state.loading|=4,u.instance=T,zt(T);return}T=i.ownerDocument||i,p=wk(p),(E=Qn.get(E))&&Av(p,E),T=T.createElement("link"),zt(T);var D=T;D._p=new Promise(function(B,ne){D.onload=B,D.onerror=ne}),Wr(T,"link",p),u.instance=T}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(o.count++,u=ap.bind(o),i.addEventListener("load",u),i.addEventListener("error",u))}}var kv=0;function u6(o,i){return o.stylesheets&&o.count===0&&ip(o,o.stylesheets),0<o.count||0<o.imgCount?function(u){var p=setTimeout(function(){if(o.stylesheets&&ip(o,o.stylesheets),o.unsuspend){var T=o.unsuspend;o.unsuspend=null,T()}},6e4+i);0<o.imgBytes&&kv===0&&(kv=62500*HG());var E=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&ip(o,o.stylesheets),o.unsuspend)){var T=o.unsuspend;o.unsuspend=null,T()}},(o.imgBytes>kv?50:800)+i);return o.unsuspend=u,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(E)}}:null}function ap(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ip(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var op=null;function ip(o,i){o.stylesheets=null,o.unsuspend!==null&&(o.count++,op=new Map,i.forEach(d6,o),op=null,ap.call(o))}function d6(o,i){if(!(i.state.loading&4)){var u=op.get(o);if(u)var p=u.get(null);else{u=new Map,op.set(o,u);for(var E=o.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<E.length;T++){var D=E[T];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(u.set(D.dataset.precedence,D),p=D)}p&&u.set(null,p)}E=i.instance,D=E.getAttribute("data-precedence"),T=u.get(D)||p,T===p&&u.set(null,E),u.set(D,E),this.count++,p=ap.bind(this),E.addEventListener("load",p),E.addEventListener("error",p),T?T.parentNode.insertBefore(E,T.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(E,o.firstChild)),i.state.loading|=4}}var fu={$$typeof:C,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function f6(o,i,u,p,E,T,D,B,ne){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=$n(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$n(0),this.hiddenUpdates=$n(null),this.identifierPrefix=p,this.onUncaughtError=E,this.onCaughtError=T,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function Ak(o,i,u,p,E,T,D,B,ne,pe,Se,Re){return o=new f6(o,i,u,D,ne,pe,Se,Re,B),i=1,T===!0&&(i|=24),T=kn(3,null,null,i),o.current=T,T.stateNode=o,i=cg(),i.refCount++,o.pooledCache=i,i.refCount++,T.memoizedState={element:p,isDehydrated:u,cache:i},pg(T),o}function Nk(o){return o?(o=$s,o):$s}function kk(o,i,u,p,E,T){E=Nk(E),p.context===null?p.context=E:p.pendingContext=E,p=Wo(i),p.payload={element:u},T=T===void 0?null:T,T!==null&&(p.callback=T),u=Yo(o,p,i),u!==null&&(En(u,o,i),Hc(u,o,i))}function Ik(o,i){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var u=o.retryLane;o.retryLane=u!==0&&u<i?u:i}}function Iv(o,i){Ik(o,i),(o=o.alternate)&&Ik(o,i)}function Ok(o){if(o.tag===13||o.tag===31){var i=Bi(o,67108864);i!==null&&En(i,o,67108864),Iv(o,67108864)}}function Dk(o){if(o.tag===13||o.tag===31){var i=Mn();i=oe(i);var u=Bi(o,i);u!==null&&En(u,o,i),Iv(o,i)}}var sp=!0;function p6(o,i,u,p){var E=j.T;j.T=null;var T=G.p;try{G.p=2,Ov(o,i,u,p)}finally{G.p=T,j.T=E}}function m6(o,i,u,p){var E=j.T;j.T=null;var T=G.p;try{G.p=8,Ov(o,i,u,p)}finally{G.p=T,j.T=E}}function Ov(o,i,u,p){if(sp){var E=Dv(p);if(E===null)bv(o,i,p,lp,u),Mk(o,p);else if(g6(E,o,i,u,p))p.stopPropagation();else if(Mk(o,p),i&4&&-1<h6.indexOf(o)){for(;E!==null;){var T=Yt(E);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var D=an(T.pendingLanes);if(D!==0){var B=T;for(B.pendingLanes|=2,B.entangledLanes|=2;D;){var ne=1<<31-fr(D);B.entanglements[1]|=ne,D&=~ne}Na(T),(Lt&6)===0&&(Hf=we()+500,iu(0))}}break;case 31:case 13:B=Bi(T,2),B!==null&&En(B,T,2),Gf(),Iv(T,2)}if(T=Dv(p),T===null&&bv(o,i,p,lp,u),T===E)break;E=T}E!==null&&p.stopPropagation()}else bv(o,i,p,null,u)}}function Dv(o){return o=Mh(o),Lv(o)}var lp=null;function Lv(o){if(lp=null,o=Dt(o),o!==null){var i=s(o);if(i===null)o=null;else{var u=i.tag;if(u===13){if(o=l(i),o!==null)return o;o=null}else if(u===31){if(o=c(i),o!==null)return o;o=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;o=null}else i!==o&&(o=null)}}return lp=o,null}function Lk(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ne()){case Oe:return 2;case Je:return 8;case ot:case Rt:return 32;case Ot:return 268435456;default:return 32}default:return 32}}var Mv=!1,oi=null,ii=null,si=null,pu=new Map,mu=new Map,li=[],h6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Mk(o,i){switch(o){case"focusin":case"focusout":oi=null;break;case"dragenter":case"dragleave":ii=null;break;case"mouseover":case"mouseout":si=null;break;case"pointerover":case"pointerout":pu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":mu.delete(i.pointerId)}}function hu(o,i,u,p,E,T){return o===null||o.nativeEvent!==T?(o={blockedOn:i,domEventName:u,eventSystemFlags:p,nativeEvent:T,targetContainers:[E]},i!==null&&(i=Yt(i),i!==null&&Ok(i)),o):(o.eventSystemFlags|=p,i=o.targetContainers,E!==null&&i.indexOf(E)===-1&&i.push(E),o)}function g6(o,i,u,p,E){switch(i){case"focusin":return oi=hu(oi,o,i,u,p,E),!0;case"dragenter":return ii=hu(ii,o,i,u,p,E),!0;case"mouseover":return si=hu(si,o,i,u,p,E),!0;case"pointerover":var T=E.pointerId;return pu.set(T,hu(pu.get(T)||null,o,i,u,p,E)),!0;case"gotpointercapture":return T=E.pointerId,mu.set(T,hu(mu.get(T)||null,o,i,u,p,E)),!0}return!1}function Pk(o){var i=Dt(o.target);if(i!==null){var u=s(i);if(u!==null){if(i=u.tag,i===13){if(i=l(u),i!==null){o.blockedOn=i,ye(o.priority,function(){Dk(u)});return}}else if(i===31){if(i=c(u),i!==null){o.blockedOn=i,ye(o.priority,function(){Dk(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){o.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}o.blockedOn=null}function cp(o){if(o.blockedOn!==null)return!1;for(var i=o.targetContainers;0<i.length;){var u=Dv(o.nativeEvent);if(u===null){u=o.nativeEvent;var p=new u.constructor(u.type,u);Lh=p,u.target.dispatchEvent(p),Lh=null}else return i=Yt(u),i!==null&&Ok(i),o.blockedOn=u,!1;i.shift()}return!0}function jk(o,i,u){cp(o)&&u.delete(i)}function v6(){Mv=!1,oi!==null&&cp(oi)&&(oi=null),ii!==null&&cp(ii)&&(ii=null),si!==null&&cp(si)&&(si=null),pu.forEach(jk),mu.forEach(jk)}function up(o,i){o.blockedOn===i&&(o.blockedOn=null,Mv||(Mv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,v6)))}var dp=null;function Uk(o){dp!==o&&(dp=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){dp===o&&(dp=null);for(var i=0;i<o.length;i+=3){var u=o[i],p=o[i+1],E=o[i+2];if(typeof p!="function"){if(Lv(p||u)===null)continue;break}var T=Yt(u);T!==null&&(o.splice(i,3),i-=3,Dg(T,{pending:!0,data:E,method:u.method,action:p},p,E))}}))}function dl(o){function i(ne){return up(ne,o)}oi!==null&&up(oi,o),ii!==null&&up(ii,o),si!==null&&up(si,o),pu.forEach(i),mu.forEach(i);for(var u=0;u<li.length;u++){var p=li[u];p.blockedOn===o&&(p.blockedOn=null)}for(;0<li.length&&(u=li[0],u.blockedOn===null);)Pk(u),u.blockedOn===null&&li.shift();if(u=(o.ownerDocument||o).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var E=u[p],T=u[p+1],D=E[Be]||null;if(typeof T=="function")D||Uk(u);else if(D){var B=null;if(T&&T.hasAttribute("formAction")){if(E=T,D=T[Be]||null)B=D.formAction;else if(Lv(E)!==null)continue}else B=D.action;typeof B=="function"?u[p+1]=B:(u.splice(p,3),p-=3),Uk(u)}}}function Fk(){function o(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(D){return E=D})},focusReset:"manual",scroll:"manual"})}function i(){E!==null&&(E(),E=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,E=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),E!==null&&(E(),E=null)}}}function Pv(o){this._internalRoot=o}fp.prototype.render=Pv.prototype.render=function(o){var i=this._internalRoot;if(i===null)throw Error(n(409));var u=i.current,p=Mn();kk(u,p,o,i,null,null)},fp.prototype.unmount=Pv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var i=o.containerInfo;kk(o.current,2,null,o,null,null),Gf(),i[mt]=null}};function fp(o){this._internalRoot=o}fp.prototype.unstable_scheduleHydration=function(o){if(o){var i=ie();o={blockedOn:null,target:o,priority:i};for(var u=0;u<li.length&&i!==0&&i<li[u].priority;u++);li.splice(u,0,o),u===0&&Pk(o)}};var zk=e.version;if(zk!=="19.2.0")throw Error(n(527,zk,"19.2.0"));G.findDOMNode=function(o){var i=o._reactInternals;if(i===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=f(i),o=o!==null?m(o):null,o=o===null?null:o.stateNode,o};var b6={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pp.isDisabled&&pp.supportsFiber)try{or=pp.inject(b6),Mt=pp}catch{}}return vu.createRoot=function(o,i){if(!a(o))throw Error(n(299));var u=!1,p="",E=WN,T=YN,D=KN;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(E=i.onUncaughtError),i.onCaughtError!==void 0&&(T=i.onCaughtError),i.onRecoverableError!==void 0&&(D=i.onRecoverableError)),i=Ak(o,1,!1,null,null,u,p,null,E,T,D,Fk),o[mt]=i.current,vv(o),new Pv(i)},vu.hydrateRoot=function(o,i,u){if(!a(o))throw Error(n(299));var p=!1,E="",T=WN,D=YN,B=KN,ne=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(E=u.identifierPrefix),u.onUncaughtError!==void 0&&(T=u.onUncaughtError),u.onCaughtError!==void 0&&(D=u.onCaughtError),u.onRecoverableError!==void 0&&(B=u.onRecoverableError),u.formState!==void 0&&(ne=u.formState)),i=Ak(o,1,!0,i,u??null,p,E,ne,T,D,B,Fk),i.context=Nk(null),u=i.current,p=Mn(),p=oe(p),E=Wo(p),E.callback=null,Yo(u,E,p),u=p,i.current.lanes=u,Xt(i,u),Na(i),o[mt]=i.current,vv(o),new fp(i)},vu.version="19.2.0",vu}var dO;function u7(){if(dO)return Mb.exports;dO=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Mb.exports=c7(),Mb.exports}var d7=u7();const f7=fc(d7);var fO="popstate";function p7(t={}){function e(n,a){let{pathname:s,search:l,hash:c}=n.location;return W_("",{pathname:s,search:l,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:cd(a)}return h7(e,r,null,t)}function dr(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Ha(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function m7(){return Math.random().toString(36).substring(2,10)}function pO(t,e){return{usr:t.state,key:t.key,idx:e}}function W_(t,e,r=null,n){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?hc(e):e,state:r,key:e&&e.key||n||m7()}}function cd({pathname:t="/",search:e="",hash:r=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function hc(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substring(r),t=t.substring(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substring(n),t=t.substring(0,n)),t&&(e.pathname=t)}return e}function h7(t,e,r,n={}){let{window:a=document.defaultView,v5Compat:s=!1}=n,l=a.history,c="POP",d=null,f=m();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function m(){return(l.state||{idx:null}).idx}function h(){c="POP";let R=m(),x=R==null?null:R-f;f=R,d&&d({action:c,location:S.location,delta:x})}function v(R,x){c="PUSH";let _=W_(S.location,R,x);f=m()+1;let C=pO(_,f),N=S.createHref(_);try{l.pushState(C,"",N)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;a.location.assign(N)}s&&d&&d({action:c,location:S.location,delta:1})}function y(R,x){c="REPLACE";let _=W_(S.location,R,x);f=m();let C=pO(_,f),N=S.createHref(_);l.replaceState(C,"",N),s&&d&&d({action:c,location:S.location,delta:0})}function w(R){return g7(R)}let S={get action(){return c},get location(){return t(a,l)},listen(R){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(fO,h),d=R,()=>{a.removeEventListener(fO,h),d=null}},createHref(R){return e(a,R)},createURL:w,encodeLocation(R){let x=w(R);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:v,replace:y,go(R){return l.go(R)}};return S}function g7(t,e=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),dr(r,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:cd(t);return n=n.replace(/ $/,"%20"),!e&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function Y2(t,e,r="/"){return v7(t,e,r,!1)}function v7(t,e,r,n){let a=typeof e=="string"?hc(e):e,s=ko(a.pathname||"/",r);if(s==null)return null;let l=K2(t);b7(l);let c=null;for(let d=0;c==null&&d<l.length;++d){let f=N7(s);c=C7(l[d],f,n)}return c}function K2(t,e=[],r=[],n="",a=!1){let s=(l,c,d=a,f)=>{let m={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(n)&&d)return;dr(m.relativePath.startsWith(n),`Absolute route path "${m.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(n.length)}let h=Co([n,m.relativePath]),v=r.concat(m);l.children&&l.children.length>0&&(dr(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),K2(l.children,e,v,h,d)),!(l.path==null&&!l.index)&&e.push({path:h,score:T7(h,l.index),routesMeta:v})};return t.forEach((l,c)=>{if(l.path===""||!l.path?.includes("?"))s(l,c);else for(let d of Z2(l.path))s(l,c,!0,d)}),e}function Z2(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,a=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return a?[s,""]:[s];let l=Z2(n.join("/")),c=[];return c.push(...l.map(d=>d===""?s:[s,d].join("/"))),a&&c.push(...l),c.map(d=>t.startsWith("/")&&d===""?"/":d)}function b7(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:R7(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var y7=/^:[\w-]+$/,E7=3,S7=2,x7=1,w7=10,_7=-2,mO=t=>t==="*";function T7(t,e){let r=t.split("/"),n=r.length;return r.some(mO)&&(n+=_7),e&&(n+=S7),r.filter(a=>!mO(a)).reduce((a,s)=>a+(y7.test(s)?E7:s===""?x7:w7),n)}function R7(t,e){return t.length===e.length&&t.slice(0,-1).every((n,a)=>n===e[a])?t[t.length-1]-e[e.length-1]:0}function C7(t,e,r=!1){let{routesMeta:n}=t,a={},s="/",l=[];for(let c=0;c<n.length;++c){let d=n[c],f=c===n.length-1,m=s==="/"?e:e.slice(s.length)||"/",h=gm({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},m),v=d.route;if(!h&&f&&r&&!n[n.length-1].route.index&&(h=gm({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},m)),!h)return null;Object.assign(a,h.params),l.push({params:a,pathname:Co([s,h.pathname]),pathnameBase:D7(Co([s,h.pathnameBase])),route:v}),h.pathnameBase!=="/"&&(s=Co([s,h.pathnameBase]))}return l}function gm(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=A7(t.path,t.caseSensitive,t.end),a=e.match(r);if(!a)return null;let s=a[0],l=s.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:n.reduce((f,{paramName:m,isOptional:h},v)=>{if(m==="*"){let w=c[v]||"";l=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const y=c[v];return h&&!y?f[m]=void 0:f[m]=(y||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:l,pattern:t}}function A7(t,e=!1,r=!0){Ha(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let n=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,d)=>(n.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(n.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),n]}function N7(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Ha(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function ko(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function k7(t,e="/"){let{pathname:r,search:n="",hash:a=""}=typeof t=="string"?hc(t):t;return{pathname:r?r.startsWith("/")?r:I7(r,e):e,search:L7(n),hash:M7(a)}}function I7(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Fb(t,e,r,n){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function O7(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function X2(t){let e=O7(t);return e.map((r,n)=>n===e.length-1?r.pathname:r.pathnameBase)}function Q2(t,e,r,n=!1){let a;typeof t=="string"?a=hc(t):(a={...t},dr(!a.pathname||!a.pathname.includes("?"),Fb("?","pathname","search",a)),dr(!a.pathname||!a.pathname.includes("#"),Fb("#","pathname","hash",a)),dr(!a.search||!a.search.includes("#"),Fb("#","search","hash",a)));let s=t===""||a.pathname==="",l=s?"/":a.pathname,c;if(l==null)c=r;else{let h=e.length-1;if(!n&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),h-=1;a.pathname=v.join("/")}c=h>=0?e[h]:"/"}let d=k7(a,c),f=l&&l!=="/"&&l.endsWith("/"),m=(s||l===".")&&r.endsWith("/");return!d.pathname.endsWith("/")&&(f||m)&&(d.pathname+="/"),d}var Co=t=>t.join("/").replace(/\/\/+/g,"/"),D7=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),L7=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,M7=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function P7(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var J2=["POST","PUT","PATCH","DELETE"];new Set(J2);var j7=["GET",...J2];new Set(j7);var gc=b.createContext(null);gc.displayName="DataRouter";var qm=b.createContext(null);qm.displayName="DataRouterState";b.createContext(!1);var e$=b.createContext({isTransitioning:!1});e$.displayName="ViewTransition";var U7=b.createContext(new Map);U7.displayName="Fetchers";var F7=b.createContext(null);F7.displayName="Await";var Za=b.createContext(null);Za.displayName="Navigation";var Ld=b.createContext(null);Ld.displayName="Location";var jo=b.createContext({outlet:null,matches:[],isDataRoute:!1});jo.displayName="Route";var pR=b.createContext(null);pR.displayName="RouteError";function z7(t,{relative:e}={}){dr(Md(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=b.useContext(Za),{hash:a,pathname:s,search:l}=Pd(t,{relative:e}),c=s;return r!=="/"&&(c=s==="/"?r:Co([r,s])),n.createHref({pathname:c,search:l,hash:a})}function Md(){return b.useContext(Ld)!=null}function Uo(){return dr(Md(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Ld).location}var t$="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function r$(t){b.useContext(Za).static||b.useLayoutEffect(t)}function vc(){let{isDataRoute:t}=b.useContext(jo);return t?J7():$7()}function $7(){dr(Md(),"useNavigate() may be used only in the context of a <Router> component.");let t=b.useContext(gc),{basename:e,navigator:r}=b.useContext(Za),{matches:n}=b.useContext(jo),{pathname:a}=Uo(),s=JSON.stringify(X2(n)),l=b.useRef(!1);return r$(()=>{l.current=!0}),b.useCallback((d,f={})=>{if(Ha(l.current,t$),!l.current)return;if(typeof d=="number"){r.go(d);return}let m=Q2(d,JSON.parse(s),a,f.relative==="path");t==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:Co([e,m.pathname])),(f.replace?r.replace:r.push)(m,f.state,f)},[e,r,s,a,t])}b.createContext(null);function Pd(t,{relative:e}={}){let{matches:r}=b.useContext(jo),{pathname:n}=Uo(),a=JSON.stringify(X2(r));return b.useMemo(()=>Q2(t,JSON.parse(a),n,e==="path"),[t,a,n,e])}function B7(t,e){return n$(t,e)}function n$(t,e,r,n,a){dr(Md(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=b.useContext(Za),{matches:l}=b.useContext(jo),c=l[l.length-1],d=c?c.params:{},f=c?c.pathname:"/",m=c?c.pathnameBase:"/",h=c&&c.route;{let _=h&&h.path||"";a$(f,!h||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
24
24
 
25
- Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let v=Uo(),y;if(e){let _=typeof e=="string"?hc(e):e;dr(m==="/"||_.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${_.pathname}" was given in the \`location\` prop.`),y=_}else y=v;let w=y.pathname||"/",S=w;if(m!=="/"){let _=m.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(_.length).join("/")}let R=Y2(t,{pathname:S});Ha(h||R!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Ha(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=W7(R&&R.map(_=>Object.assign({},_,{params:Object.assign({},d,_.params),pathname:Co([m,s.encodeLocation?s.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?m:Co([m,s.encodeLocation?s.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),l,r,n,a);return e&&x?b.createElement(Ld.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},x):x}function q7(){let t=Q7(),e=P7(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},s={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:s},"ErrorBoundary")," or"," ",b.createElement("code",{style:s},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},e),r?b.createElement("pre",{style:a},r):null,l)}var H7=b.createElement(q7,null),V7=class extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.unstable_onError?this.props.unstable_onError(t,e):console.error("React Router caught the following error during render",t)}render(){return this.state.error!==void 0?b.createElement(jo.Provider,{value:this.props.routeContext},b.createElement(pR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function G7({routeContext:t,match:e,children:r}){let n=b.useContext(gc);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),b.createElement(jo.Provider,{value:t},r)}function W7(t,e=[],r=null,n=null,a=null){if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let s=t,l=r?.errors;if(l!=null){let f=s.findIndex(m=>m.route.id&&l?.[m.route.id]!==void 0);dr(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,f+1))}let c=!1,d=-1;if(r)for(let f=0;f<s.length;f++){let m=s[f];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=f),m.route.id){let{loaderData:h,errors:v}=r,y=m.route.loader&&!h.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||y){c=!0,d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}return s.reduceRight((f,m,h)=>{let v,y=!1,w=null,S=null;r&&(v=l&&m.route.id?l[m.route.id]:void 0,w=m.route.errorElement||H7,c&&(d<0&&h===0?(a$("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,S=null):d===h&&(y=!0,S=m.route.hydrateFallbackElement||null)));let R=e.concat(s.slice(0,h+1)),x=()=>{let _;return v?_=w:y?_=S:m.route.Component?_=b.createElement(m.route.Component,null):m.route.element?_=m.route.element:_=f,b.createElement(G7,{match:m,routeContext:{outlet:f,matches:R,isDataRoute:r!=null},children:_})};return r&&(m.route.ErrorBoundary||m.route.errorElement||h===0)?b.createElement(V7,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:x(),routeContext:{outlet:null,matches:R,isDataRoute:!0},unstable_onError:n}):x()},null)}function mR(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y7(t){let e=b.useContext(gc);return dr(e,mR(t)),e}function K7(t){let e=b.useContext(qm);return dr(e,mR(t)),e}function Z7(t){let e=b.useContext(jo);return dr(e,mR(t)),e}function hR(t){let e=Z7(t),r=e.matches[e.matches.length-1];return dr(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function X7(){return hR("useRouteId")}function Q7(){let t=b.useContext(pR),e=K7("useRouteError"),r=hR("useRouteError");return t!==void 0?t:e.errors?.[r]}function J7(){let{router:t}=Y7("useNavigate"),e=hR("useNavigate"),r=b.useRef(!1);return r$(()=>{r.current=!0}),b.useCallback(async(a,s={})=>{Ha(r.current,t$),r.current&&(typeof a=="number"?t.navigate(a):await t.navigate(a,{fromRouteId:e,...s}))},[t,e])}var hO={};function a$(t,e,r){!e&&!hO[t]&&(hO[t]=!0,Ha(!1,r))}b.memo(eY);function eY({routes:t,future:e,state:r,unstable_onError:n}){return n$(t,void 0,r,n,e)}function o$(t){dr(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function tY({basename:t="/",children:e=null,location:r,navigationType:n="POP",navigator:a,static:s=!1}){dr(!Md(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),c=b.useMemo(()=>({basename:l,navigator:a,static:s,future:{}}),[l,a,s]);typeof r=="string"&&(r=hc(r));let{pathname:d="/",search:f="",hash:m="",state:h=null,key:v="default"}=r,y=b.useMemo(()=>{let w=ko(d,l);return w==null?null:{location:{pathname:w,search:f,hash:m,state:h,key:v},navigationType:n}},[l,d,f,m,h,v,n]);return Ha(y!=null,`<Router basename="${l}"> is not able to match the URL "${d}${f}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:b.createElement(Za.Provider,{value:c},b.createElement(Ld.Provider,{children:e,value:y}))}function rY({children:t,location:e}){return B7(Y_(t),e)}function Y_(t,e=[]){let r=[];return b.Children.forEach(t,(n,a)=>{if(!b.isValidElement(n))return;let s=[...e,a];if(n.type===b.Fragment){r.push.apply(r,Y_(n.props.children,s));return}dr(n.type===o$,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),dr(!n.props.index||!n.props.children,"An index route cannot have child routes.");let l={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(l.children=Y_(n.props.children,s)),r.push(l)}),r}var Fp="get",zp="application/x-www-form-urlencoded";function Hm(t){return t!=null&&typeof t.tagName=="string"}function nY(t){return Hm(t)&&t.tagName.toLowerCase()==="button"}function aY(t){return Hm(t)&&t.tagName.toLowerCase()==="form"}function oY(t){return Hm(t)&&t.tagName.toLowerCase()==="input"}function iY(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function sY(t,e){return t.button===0&&(!e||e==="_self")&&!iY(t)}var hp=null;function lY(){if(hp===null)try{new FormData(document.createElement("form"),0),hp=!1}catch{hp=!0}return hp}var cY=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function zb(t){return t!=null&&!cY.has(t)?(Ha(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${zp}"`),null):t}function uY(t,e){let r,n,a,s,l;if(aY(t)){let c=t.getAttribute("action");n=c?ko(c,e):null,r=t.getAttribute("method")||Fp,a=zb(t.getAttribute("enctype"))||zp,s=new FormData(t)}else if(nY(t)||oY(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||c.getAttribute("action");if(n=d?ko(d,e):null,r=t.getAttribute("formmethod")||c.getAttribute("method")||Fp,a=zb(t.getAttribute("formenctype"))||zb(c.getAttribute("enctype"))||zp,s=new FormData(c,t),!lY()){let{name:f,type:m,value:h}=t;if(m==="image"){let v=f?`${f}.`:"";s.append(`${v}x`,"0"),s.append(`${v}y`,"0")}else f&&s.append(f,h)}}else{if(Hm(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Fp,n=null,a=zp,l=t}return s&&a==="text/plain"&&(l=s,s=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gR(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function dY(t,e,r){let n=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n.pathname==="/"?n.pathname=`_root.${r}`:e&&ko(n.pathname,e)==="/"?n.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function fY(t,e){if(t.id in e)return e[t.id];try{let r=await import(t.module);return e[t.id]=r,r}catch(r){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pY(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function mY(t,e,r){let n=await Promise.all(t.map(async a=>{let s=e.routes[a.route.id];if(s){let l=await fY(s,r);return l.links?l.links():[]}return[]}));return bY(n.flat(1).filter(pY).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function gO(t,e,r,n,a,s){let l=(d,f)=>r[f]?d.route.id!==r[f].route.id:!0,c=(d,f)=>r[f].pathname!==d.pathname||r[f].route.path?.endsWith("*")&&r[f].params["*"]!==d.params["*"];return s==="assets"?e.filter((d,f)=>l(d,f)||c(d,f)):s==="data"?e.filter((d,f)=>{let m=n.routes[d.route.id];if(!m||!m.hasLoader)return!1;if(l(d,f)||c(d,f))return!0;if(d.route.shouldRevalidate){let h=d.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function hY(t,e,{includeHydrateFallback:r}={}){return gY(t.map(n=>{let a=e.routes[n.route.id];if(!a)return[];let s=[a.module];return a.clientActionModule&&(s=s.concat(a.clientActionModule)),a.clientLoaderModule&&(s=s.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(s=s.concat(a.hydrateFallbackModule)),a.imports&&(s=s.concat(a.imports)),s}).flat(1))}function gY(t){return[...new Set(t)]}function vY(t){let e={},r=Object.keys(t).sort();for(let n of r)e[n]=t[n];return e}function bY(t,e){let r=new Set;return new Set(e),t.reduce((n,a)=>{let s=JSON.stringify(vY(a));return r.has(s)||(r.add(s),n.push({key:s,link:a})),n},[])}function i$(){let t=b.useContext(gc);return gR(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function yY(){let t=b.useContext(qm);return gR(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var vR=b.createContext(void 0);vR.displayName="FrameworkContext";function s$(){let t=b.useContext(vR);return gR(t,"You must render this element inside a <HydratedRouter> element"),t}function EY(t,e){let r=b.useContext(vR),[n,a]=b.useState(!1),[s,l]=b.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:f,onMouseLeave:m,onTouchStart:h}=e,v=b.useRef(null);b.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let S=x=>{x.forEach(_=>{l(_.isIntersecting)})},R=new IntersectionObserver(S,{threshold:.5});return v.current&&R.observe(v.current),()=>{R.disconnect()}}},[t]),b.useEffect(()=>{if(n){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[n]);let y=()=>{a(!0)},w=()=>{a(!1),l(!1)};return r?t!=="intent"?[s,v,{}]:[s,v,{onFocus:bu(c,y),onBlur:bu(d,w),onMouseEnter:bu(f,y),onMouseLeave:bu(m,w),onTouchStart:bu(h,y)}]:[!1,v,{}]}function bu(t,e){return r=>{t&&t(r),r.defaultPrevented||e(r)}}function SY({page:t,...e}){let{router:r}=i$(),n=b.useMemo(()=>Y2(r.routes,t,r.basename),[r.routes,t,r.basename]);return n?b.createElement(wY,{page:t,matches:n,...e}):null}function xY(t){let{manifest:e,routeModules:r}=s$(),[n,a]=b.useState([]);return b.useEffect(()=>{let s=!1;return mY(t,e,r).then(l=>{s||a(l)}),()=>{s=!0}},[t,e,r]),n}function wY({page:t,matches:e,...r}){let n=Uo(),{manifest:a,routeModules:s}=s$(),{basename:l}=i$(),{loaderData:c,matches:d}=yY(),f=b.useMemo(()=>gO(t,e,d,a,n,"data"),[t,e,d,a,n]),m=b.useMemo(()=>gO(t,e,d,a,n,"assets"),[t,e,d,a,n]),h=b.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let w=new Set,S=!1;if(e.forEach(x=>{let _=a.routes[x.route.id];!_||!_.hasLoader||(!f.some(C=>C.route.id===x.route.id)&&x.route.id in c&&s[x.route.id]?.shouldRevalidate||_.hasClientLoader?S=!0:w.add(x.route.id))}),w.size===0)return[];let R=dY(t,l,"data");return S&&w.size>0&&R.searchParams.set("_routes",e.filter(x=>w.has(x.route.id)).map(x=>x.route.id).join(",")),[R.pathname+R.search]},[l,c,n,a,f,e,t,s]),v=b.useMemo(()=>hY(m,a),[m,a]),y=xY(m);return b.createElement(b.Fragment,null,h.map(w=>b.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),v.map(w=>b.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),y.map(({key:w,link:S})=>b.createElement("link",{key:w,nonce:r.nonce,...S})))}function _Y(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}var l$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{l$&&(window.__reactRouterVersion="7.9.5")}catch{}function TY({basename:t,children:e,window:r}){let n=b.useRef();n.current==null&&(n.current=p7({window:r,v5Compat:!0}));let a=n.current,[s,l]=b.useState({action:a.action,location:a.location}),c=b.useCallback(d=>{b.startTransition(()=>l(d))},[l]);return b.useLayoutEffect(()=>a.listen(c),[a,c]),b.createElement(tY,{basename:t,children:e,location:s.location,navigationType:s.action,navigator:a})}var c$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,u$=b.forwardRef(function({onClick:e,discover:r="render",prefetch:n="none",relative:a,reloadDocument:s,replace:l,state:c,target:d,to:f,preventScrollReset:m,viewTransition:h,...v},y){let{basename:w}=b.useContext(Za),S=typeof f=="string"&&c$.test(f),R,x=!1;if(typeof f=="string"&&S&&(R=f,l$))try{let L=new URL(window.location.href),M=f.startsWith("//")?new URL(L.protocol+f):new URL(f),P=ko(M.pathname,w);M.origin===L.origin&&P!=null?f=P+M.search+M.hash:x=!0}catch{Ha(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=z7(f,{relative:a}),[C,N,k]=EY(n,v),A=NY(f,{replace:l,state:c,target:d,preventScrollReset:m,relative:a,viewTransition:h});function I(L){e&&e(L),L.defaultPrevented||A(L)}let O=b.createElement("a",{...v,...k,href:R||_,onClick:x||s?e:I,ref:_Y(y,N),target:d,"data-discover":!S&&r==="render"?"true":void 0});return C&&!S?b.createElement(b.Fragment,null,O,b.createElement(SY,{page:_})):O});u$.displayName="Link";var RY=b.forwardRef(function({"aria-current":e="page",caseSensitive:r=!1,className:n="",end:a=!1,style:s,to:l,viewTransition:c,children:d,...f},m){let h=Pd(l,{relative:f.relative}),v=Uo(),y=b.useContext(qm),{navigator:w,basename:S}=b.useContext(Za),R=y!=null&&LY(h)&&c===!0,x=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,_=v.pathname,C=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(_=_.toLowerCase(),C=C?C.toLowerCase():null,x=x.toLowerCase()),C&&S&&(C=ko(C,S)||C);const N=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let k=_===x||!a&&_.startsWith(x)&&_.charAt(N)==="/",A=C!=null&&(C===x||!a&&C.startsWith(x)&&C.charAt(x.length)==="/"),I={isActive:k,isPending:A,isTransitioning:R},O=k?e:void 0,L;typeof n=="function"?L=n(I):L=[n,k?"active":null,A?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let M=typeof s=="function"?s(I):s;return b.createElement(u$,{...f,"aria-current":O,className:L,ref:m,style:M,to:l,viewTransition:c},typeof d=="function"?d(I):d)});RY.displayName="NavLink";var CY=b.forwardRef(({discover:t="render",fetcherKey:e,navigate:r,reloadDocument:n,replace:a,state:s,method:l=Fp,action:c,onSubmit:d,relative:f,preventScrollReset:m,viewTransition:h,...v},y)=>{let w=OY(),S=DY(c,{relative:f}),R=l.toLowerCase()==="get"?"get":"post",x=typeof c=="string"&&c$.test(c),_=C=>{if(d&&d(C),C.defaultPrevented)return;C.preventDefault();let N=C.nativeEvent.submitter,k=N?.getAttribute("formmethod")||l;w(N||C.currentTarget,{fetcherKey:e,method:k,navigate:r,replace:a,state:s,relative:f,preventScrollReset:m,viewTransition:h})};return b.createElement("form",{ref:y,method:R,action:S,onSubmit:n?d:_,...v,"data-discover":!x&&t==="render"?"true":void 0})});CY.displayName="Form";function AY(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function d$(t){let e=b.useContext(gc);return dr(e,AY(t)),e}function NY(t,{target:e,replace:r,state:n,preventScrollReset:a,relative:s,viewTransition:l}={}){let c=vc(),d=Uo(),f=Pd(t,{relative:s});return b.useCallback(m=>{if(sY(m,e)){m.preventDefault();let h=r!==void 0?r:cd(d)===cd(f);c(t,{replace:h,state:n,preventScrollReset:a,relative:s,viewTransition:l})}},[d,c,f,r,n,e,t,a,s,l])}var kY=0,IY=()=>`__${String(++kY)}__`;function OY(){let{router:t}=d$("useSubmit"),{basename:e}=b.useContext(Za),r=X7();return b.useCallback(async(n,a={})=>{let{action:s,method:l,encType:c,formData:d,body:f}=uY(n,e);if(a.navigate===!1){let m=a.fetcherKey||IY();await t.fetch(m,r,a.action||s,{preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||c,flushSync:a.flushSync})}else await t.navigate(a.action||s,{preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[t,e,r])}function DY(t,{relative:e}={}){let{basename:r}=b.useContext(Za),n=b.useContext(jo);dr(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),s={...Pd(t||".",{relative:e})},l=Uo();if(t==null){s.search=l.search;let c=new URLSearchParams(s.search),d=c.getAll("index");if(d.some(m=>m==="")){c.delete("index"),d.filter(h=>h).forEach(h=>c.append("index",h));let m=c.toString();s.search=m?`?${m}`:""}}return(!t||t===".")&&a.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Co([r,s.pathname])),cd(s)}function LY(t,{relative:e}={}){let r=b.useContext(e$);dr(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=d$("useViewTransitionState"),a=Pd(t,{relative:e});if(!r.isTransitioning)return!1;let s=ko(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=ko(r.nextLocation.pathname,n)||r.nextLocation.pathname;return gm(a.pathname,l)!=null||gm(a.pathname,s)!=null}var bc=W2();const f$=fc(bc);function vO(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Va(...t){return e=>{let r=!1;const n=t.map(a=>{const s=vO(a,e);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let a=0;a<n.length;a++){const s=n[a];typeof s=="function"?s():vO(t[a],null)}}}}function Nt(...t){return b.useCallback(Va(...t),t)}var MY=Symbol.for("react.lazy"),vm=Bm[" use ".trim().toString()];function PY(t){return typeof t=="object"&&t!==null&&"then"in t}function p$(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===MY&&"_payload"in t&&PY(t._payload)}function m$(t){const e=jY(t),r=b.forwardRef((n,a)=>{let{children:s,...l}=n;p$(s)&&typeof vm=="function"&&(s=vm(s._payload));const c=b.Children.toArray(s),d=c.find(FY);if(d){const f=d.props.children,m=c.map(h=>h===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:h);return g.jsx(e,{...l,ref:a,children:b.isValidElement(f)?b.cloneElement(f,void 0,m):null})}return g.jsx(e,{...l,ref:a,children:s})});return r.displayName=`${t}.Slot`,r}var h$=m$("Slot");function jY(t){const e=b.forwardRef((r,n)=>{let{children:a,...s}=r;if(p$(a)&&typeof vm=="function"&&(a=vm(a._payload)),b.isValidElement(a)){const l=$Y(a),c=zY(s,a.props);return a.type!==b.Fragment&&(c.ref=n?Va(n,l):l),b.cloneElement(a,c)}return b.Children.count(a)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var UY=Symbol("radix.slottable");function FY(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===UY}function zY(t,e){const r={...e};for(const n in e){const a=t[n],s=e[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...c)=>{const d=s(...c);return a(...c),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...t,...r}}function $Y(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function g$(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=g$(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function v$(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=g$(t))&&(n&&(n+=" "),n+=e);return n}const bO=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,yO=v$,b$=(t,e)=>r=>{var n;if(e?.variants==null)return yO(t,r?.class,r?.className);const{variants:a,defaultVariants:s}=e,l=Object.keys(a).map(f=>{const m=r?.[f],h=s?.[f];if(m===null)return null;const v=bO(m)||bO(h);return a[f][v]}),c=r&&Object.entries(r).reduce((f,m)=>{let[h,v]=m;return v===void 0||(f[h]=v),f},{}),d=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((f,m)=>{let{class:h,className:v,...y}=m;return Object.entries(y).every(w=>{let[S,R]=w;return Array.isArray(R)?R.includes({...s,...c}[S]):{...s,...c}[S]===R})?[...f,h,v]:f},[]);return yO(t,l,d,r?.class,r?.className)},BY=(t,e)=>{const r=new Array(t.length+e.length);for(let n=0;n<t.length;n++)r[n]=t[n];for(let n=0;n<e.length;n++)r[t.length+n]=e[n];return r},qY=(t,e)=>({classGroupId:t,validator:e}),y$=(t=new Map,e=null,r)=>({nextPart:t,validators:e,classGroupId:r}),bm="-",EO=[],HY="arbitrary..",VY=t=>{const e=WY(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return GY(l);const c=l.split(bm),d=c[0]===""&&c.length>1?1:0;return E$(c,d,e)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=n[l],f=r[l];return d?f?BY(f,d):d:f||EO}return r[l]||EO}}},E$=(t,e,r)=>{if(t.length-e===0)return r.classGroupId;const a=t[e],s=r.nextPart.get(a);if(s){const f=E$(t,e+1,s);if(f)return f}const l=r.validators;if(l===null)return;const c=e===0?t.join(bm):t.slice(e).join(bm),d=l.length;for(let f=0;f<d;f++){const m=l[f];if(m.validator(c))return m.classGroupId}},GY=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),r=e.indexOf(":"),n=e.slice(0,r);return n?HY+n:void 0})(),WY=t=>{const{theme:e,classGroups:r}=t;return YY(r,e)},YY=(t,e)=>{const r=y$();for(const n in t){const a=t[n];bR(a,r,n,e)}return r},bR=(t,e,r,n)=>{const a=t.length;for(let s=0;s<a;s++){const l=t[s];KY(l,e,r,n)}},KY=(t,e,r,n)=>{if(typeof t=="string"){ZY(t,e,r);return}if(typeof t=="function"){XY(t,e,r,n);return}QY(t,e,r,n)},ZY=(t,e,r)=>{const n=t===""?e:S$(e,t);n.classGroupId=r},XY=(t,e,r,n)=>{if(JY(t)){bR(t(n),e,r,n);return}e.validators===null&&(e.validators=[]),e.validators.push(qY(r,t))},QY=(t,e,r,n)=>{const a=Object.entries(t),s=a.length;for(let l=0;l<s;l++){const[c,d]=a[l];bR(d,S$(e,c),r,n)}},S$=(t,e)=>{let r=t;const n=e.split(bm),a=n.length;for(let s=0;s<a;s++){const l=n[s];let c=r.nextPart.get(l);c||(c=y$(),r.nextPart.set(l,c)),r=c}return r},JY=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,eK=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=Object.create(null),n=Object.create(null);const a=(s,l)=>{r[s]=l,e++,e>t&&(e=0,n=r,r=Object.create(null))};return{get(s){let l=r[s];if(l!==void 0)return l;if((l=n[s])!==void 0)return a(s,l),l},set(s,l){s in r?r[s]=l:a(s,l)}}},K_="!",SO=":",tK=[],xO=(t,e,r,n,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),rK=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=a=>{const s=[];let l=0,c=0,d=0,f;const m=a.length;for(let S=0;S<m;S++){const R=a[S];if(l===0&&c===0){if(R===SO){s.push(a.slice(d,S)),d=S+1;continue}if(R==="/"){f=S;continue}}R==="["?l++:R==="]"?l--:R==="("?c++:R===")"&&c--}const h=s.length===0?a:a.slice(d);let v=h,y=!1;h.endsWith(K_)?(v=h.slice(0,-1),y=!0):h.startsWith(K_)&&(v=h.slice(1),y=!0);const w=f&&f>d?f-d:void 0;return xO(s,y,v,w)};if(e){const a=e+SO,s=n;n=l=>l.startsWith(a)?s(l.slice(a.length)):xO(tK,!1,l,void 0,!0)}if(r){const a=n;n=s=>r({className:s,parseClassName:a})}return n},nK=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((r,n)=>{e.set(r,1e6+n)}),r=>{const n=[];let a=[];for(let s=0;s<r.length;s++){const l=r[s],c=l[0]==="[",d=e.has(l);c||d?(a.length>0&&(a.sort(),n.push(...a),a=[]),n.push(l)):a.push(l)}return a.length>0&&(a.sort(),n.push(...a)),n}},aK=t=>({cache:eK(t.cacheSize),parseClassName:rK(t),sortModifiers:nK(t),...VY(t)}),oK=/\s+/,iK=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=e,l=[],c=t.trim().split(oK);let d="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{isExternal:h,modifiers:v,hasImportantModifier:y,baseClassName:w,maybePostfixModifierPosition:S}=r(m);if(h){d=m+(d.length>0?" "+d:d);continue}let R=!!S,x=n(R?w.substring(0,S):w);if(!x){if(!R){d=m+(d.length>0?" "+d:d);continue}if(x=n(w),!x){d=m+(d.length>0?" "+d:d);continue}R=!1}const _=v.length===0?"":v.length===1?v[0]:s(v).join(":"),C=y?_+K_:_,N=C+x;if(l.indexOf(N)>-1)continue;l.push(N);const k=a(x,R);for(let A=0;A<k.length;++A){const I=k[A];l.push(C+I)}d=m+(d.length>0?" "+d:d)}return d},sK=(...t)=>{let e=0,r,n,a="";for(;e<t.length;)(r=t[e++])&&(n=x$(r))&&(a&&(a+=" "),a+=n);return a},x$=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=x$(t[n]))&&(r&&(r+=" "),r+=e);return r},lK=(t,...e)=>{let r,n,a,s;const l=d=>{const f=e.reduce((m,h)=>h(m),t());return r=aK(f),n=r.cache.get,a=r.cache.set,s=c,c(d)},c=d=>{const f=n(d);if(f)return f;const m=iK(d,r);return a(d,m),m};return s=l,(...d)=>s(sK(...d))},cK=[],Ir=t=>{const e=r=>r[t]||cK;return e.isThemeGetter=!0,e},w$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,uK=/^\d+\/\d+$/,dK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fK=/\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$/,pK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fl=t=>uK.test(t),vt=t=>!!t&&!Number.isNaN(Number(t)),ui=t=>!!t&&Number.isInteger(Number(t)),$b=t=>t.endsWith("%")&&vt(t.slice(0,-1)),bo=t=>dK.test(t),gK=()=>!0,vK=t=>fK.test(t)&&!pK.test(t),T$=()=>!1,bK=t=>mK.test(t),yK=t=>hK.test(t),EK=t=>!Ge(t)&&!We(t),SK=t=>yc(t,A$,T$),Ge=t=>w$.test(t),ts=t=>yc(t,N$,vK),Bb=t=>yc(t,RK,vt),wO=t=>yc(t,R$,T$),xK=t=>yc(t,C$,yK),gp=t=>yc(t,k$,bK),We=t=>_$.test(t),yu=t=>Ec(t,N$),wK=t=>Ec(t,CK),_O=t=>Ec(t,R$),_K=t=>Ec(t,A$),TK=t=>Ec(t,C$),vp=t=>Ec(t,k$,!0),yc=(t,e,r)=>{const n=w$.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},Ec=(t,e,r=!1)=>{const n=_$.exec(t);return n?n[1]?e(n[1]):r:!1},R$=t=>t==="position"||t==="percentage",C$=t=>t==="image"||t==="url",A$=t=>t==="length"||t==="size"||t==="bg-size",N$=t=>t==="length",RK=t=>t==="number",CK=t=>t==="family-name",k$=t=>t==="shadow",AK=()=>{const t=Ir("color"),e=Ir("font"),r=Ir("text"),n=Ir("font-weight"),a=Ir("tracking"),s=Ir("leading"),l=Ir("breakpoint"),c=Ir("container"),d=Ir("spacing"),f=Ir("radius"),m=Ir("shadow"),h=Ir("inset-shadow"),v=Ir("text-shadow"),y=Ir("drop-shadow"),w=Ir("blur"),S=Ir("perspective"),R=Ir("aspect"),x=Ir("ease"),_=Ir("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...N(),We,Ge],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],O=()=>[We,Ge,d],L=()=>[fl,"full","auto",...O()],M=()=>[ui,"none","subgrid",We,Ge],P=()=>["auto",{span:["full",ui,We,Ge]},ui,We,Ge],W=()=>[ui,"auto",We,Ge],X=()=>["auto","min","max","fr",We,Ge],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...O()],G=()=>[fl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],V=()=>[t,We,Ge],te=()=>[...N(),_O,wO,{position:[We,Ge]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",_K,SK,{size:[We,Ge]}],q=()=>[$b,yu,ts],$=()=>["","none","full",f,We,Ge],Y=()=>["",vt,yu,ts],Q=()=>["solid","dashed","dotted","double"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>[vt,$b,_O,wO],K=()=>["","none",w,We,Ge],ae=()=>["none",vt,We,Ge],H=()=>["none",vt,We,Ge],de=()=>[vt,We,Ge],me=()=>[fl,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bo],breakpoint:[bo],color:[gK],container:[bo],"drop-shadow":[bo],ease:["in","out","in-out"],font:[EK],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bo],shadow:[bo],spacing:["px",vt],text:[bo],"text-shadow":[bo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fl,Ge,We,R]}],container:["container"],columns:[{columns:[vt,Ge,We,c]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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"],sr:["sr-only","not-sr-only"],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:k()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[ui,"auto",We,Ge]}],basis:[{basis:[fl,"full","auto",c,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,fl,"auto","initial","none",Ge]}],grow:[{grow:["",vt,We,Ge]}],shrink:[{shrink:["",vt,We,Ge]}],order:[{order:[ui,"first","last","none",We,Ge]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[c,"screen",...G()]}],"min-w":[{"min-w":[c,"screen","none",...G()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",r,yu,ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,We,Bb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$b,Ge]}],"font-family":[{font:[wK,Ge,e]}],"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:[a,We,Ge]}],"line-clamp":[{"line-clamp":[vt,"none",We,Bb]}],leading:[{leading:[s,...O()]}],"list-image":[{"list-image":["none",We,Ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",We,Ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",We,ts]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[vt,"auto",We,Ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",We,Ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",We,Ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ui,We,Ge],radial:["",We,Ge],conic:[ui,We,Ge]},TK,xK]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,We,Ge]}],"outline-w":[{outline:["",vt,yu,ts]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",m,vp,gp]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",h,vp,gp]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[vt,ts]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",v,vp,gp]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[vt,We,Ge]}],"mix-blend":[{"mix-blend":[...F(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":F()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[We,Ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",We,Ge]}],filter:[{filter:["","none",We,Ge]}],blur:[{blur:K()}],brightness:[{brightness:[vt,We,Ge]}],contrast:[{contrast:[vt,We,Ge]}],"drop-shadow":[{"drop-shadow":["","none",y,vp,gp]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",vt,We,Ge]}],"hue-rotate":[{"hue-rotate":[vt,We,Ge]}],invert:[{invert:["",vt,We,Ge]}],saturate:[{saturate:[vt,We,Ge]}],sepia:[{sepia:["",vt,We,Ge]}],"backdrop-filter":[{"backdrop-filter":["","none",We,Ge]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[vt,We,Ge]}],"backdrop-contrast":[{"backdrop-contrast":[vt,We,Ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,We,Ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,We,Ge]}],"backdrop-invert":[{"backdrop-invert":["",vt,We,Ge]}],"backdrop-opacity":[{"backdrop-opacity":[vt,We,Ge]}],"backdrop-saturate":[{"backdrop-saturate":[vt,We,Ge]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,We,Ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",We,Ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",We,Ge]}],ease:[{ease:["linear","initial",x,We,Ge]}],delay:[{delay:[vt,We,Ge]}],animate:[{animate:["none",_,We,Ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,We,Ge]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[We,Ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",We,Ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",We,Ge]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[vt,yu,ts,Bb]}],stroke:[{stroke:["none",...V()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},NK=lK(AK);function De(...t){return NK(v$(t))}const kK=b$("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Ga({className:t,variant:e,asChild:r=!1,...n}){const a=r?h$:"span";return g.jsx(a,{"data-slot":"badge",className:De(kK({variant:e}),t),...n})}const IK=b$("inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-full gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-full px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function tt({className:t,variant:e,size:r,asChild:n=!1,...a}){const s=n?h$:"button";return g.jsx(s,{"data-slot":"button",className:De(IK({variant:e,size:r,className:t})),...a})}var OK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fo=OK.reduce((t,e)=>{const r=m$(`Primitive.${e}`),n=b.forwardRef((a,s)=>{const{asChild:l,...c}=a,d=l?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(d,{...c,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),DK="Label",I$=b.forwardRef((t,e)=>g.jsx(Fo.label,{...t,ref:e,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));I$.displayName=DK;var LK=I$;function lr({className:t,...e}){return g.jsx(LK,{"data-slot":"label",className:De("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function yR({message:t,className:e="",vertical:r,noBorder:n}){return g.jsx("div",{className:De(`mt-2 rounded-md p-6 ${e}`,!n&&"border"),children:g.jsxs("p",{className:De("text-sm text-muted-foreground flex items-center gap-4",r&&"flex-col"),children:[g.jsx("svg",{width:"40",height:"40",viewBox:"0 0 273 273",version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:g.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:g.jsxs("g",{transform:"translate(5.320900, 5.320900)",fillRule:"nonzero",className:"stroke-black dark:stroke-white",strokeWidth:"4",children:[g.jsx("path",{d:"M49.953025,-2.10854389 C63.26892,-2.21867124 76.6185256,2.70621155 86.9019463,12.6653164 L86.9019463,12.6653164 L87.505627,13.2592944 C97.5154947,23.2654892 102.640454,36.3074513 102.880738,49.4222247 C103.08932,77.4533067 113.877287,105.391753 135.242867,126.757333 C156.613383,148.127849 184.559216,158.914875 212.568138,159.119313 L212.568138,159.119313 L213.212264,159.134159 C225.843948,159.517566 238.363557,164.434972 248.121998,173.886137 L248.121998,173.886137 L248.725621,174.480088 C258.982114,184.732164 264.11035,198.171134 264.11035,211.6101 C264.11035,225.04592 258.984514,238.481745 248.732867,248.732867 C238.592792,258.872942 225.336706,263.997882 212.046872,264.107794 C198.731075,264.21792 185.381569,259.293085 175.098248,249.334078 L175.098248,249.334078 L174.494602,248.740134 C163.75802,238.008189 158.640853,223.784027 159.143413,209.719372 C158.258245,182.640933 147.489786,155.83332 126.828333,135.171867 C106.351297,114.694831 79.8363505,103.934873 53.0237258,102.891841 L53.0237258,102.891841 L52.2811438,102.865674 C38.4791718,103.347421 24.5325234,98.4328111 13.8776628,88.1140866 L13.8776628,88.1140866 L13.2739843,87.5201168 C3.12895117,77.3789607 -1.9984796,64.1195994 -2.10841888,50.8264755 C-2.21854669,37.5105567 2.70635908,24.1609269 12.6655135,13.8774565 L12.6655135,13.8774565 L13.2594878,13.2737797 C23.4005926,3.12880025 36.659927,-1.99860507 49.953025,-2.10854389 Z"}),g.jsx("circle",{cx:"50",cy:"212.0001",r:"52.5"}),g.jsx("circle",{cx:"212.0001",cy:"50",r:"52.5"})]})})}),t]})})}function O$({className:t,color:e,children:r,grayscaled:n=!1}){const a=b.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[1]||"0")}return n?0:.2},[e,n]),s=b.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[0]||"0.5")}return n?.3:.4},[e,n]),l=b.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[2]||"0")}return Math.floor(Math.random()*360)},[e]),c=b.useMemo(()=>e||`oklch(${Math.min(s,1)} ${a} ${l})`,[l,a,s]),d=b.useMemo(()=>`oklch(${Math.min(s*2,1)} ${a} ${l})`,[l,a,s,e]),f=b.useMemo(()=>Math.floor(Math.random()*360),[l]),m=b.useMemo(()=>"1000%",[]);return g.jsx("section",{className:De("relative w-full h-full overflow-hidden",t),style:{background:`${d}`},children:g.jsxs("div",{className:"isolate relative w-full h-full",children:[g.jsx("div",{className:"noise w-full h-full",style:{background:`linear-gradient(${f}deg, ${c}, transparent), url(https://grainy-gradients.vercel.app/noise.svg)`,filter:`contrast(120%) brightness(${m})`}}),r&&g.jsx("div",{className:"relative z-10 w-full h-full",children:r})]})})}function He(t,e,{checkForDefaultPrevented:r=!0}={}){return function(a){if(t?.(a),r===!1||!a.defaultPrevented)return e?.(a)}}function MK(t,e){const r=b.createContext(e),n=s=>{const{children:l,...c}=s,d=b.useMemo(()=>c,Object.values(c));return g.jsx(r.Provider,{value:d,children:l})};n.displayName=t+"Provider";function a(s){const l=b.useContext(r);if(l)return l;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[n,a]}function Xa(t,e=[]){let r=[];function n(s,l){const c=b.createContext(l),d=r.length;r=[...r,l];const f=h=>{const{scope:v,children:y,...w}=h,S=v?.[t]?.[d]||c,R=b.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:R,children:y})};f.displayName=s+"Provider";function m(h,v){const y=v?.[t]?.[d]||c,w=b.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[f,m]}const a=()=>{const s=r.map(l=>b.createContext(l));return function(c){const d=c?.[t]||s;return b.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return a.scopeName=t,[n,PK(a,...e)]}function PK(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const l=n.reduce((c,{useScope:d,scopeName:f})=>{const h=d(s)[`__scope${f}`];return{...c,...h}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return r.scopeName=e.scopeName,r}var nn=globalThis?.document?b.useLayoutEffect:()=>{},jK=Bm[" useInsertionEffect ".trim().toString()]||nn;function _i({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[a,s,l]=UK({defaultProp:e,onChange:r}),c=t!==void 0,d=c?t:a;{const m=b.useRef(t!==void 0);b.useEffect(()=>{const h=m.current;h!==c&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,n])}const f=b.useCallback(m=>{if(c){const h=FK(m)?m(t):m;h!==t&&l.current?.(h)}else s(m)},[c,t,s,l]);return[d,f]}function UK({defaultProp:t,onChange:e}){const[r,n]=b.useState(t),a=b.useRef(r),s=b.useRef(e);return jK(()=>{s.current=e},[e]),b.useEffect(()=>{a.current!==r&&(s.current?.(r),a.current=r)},[r,a]),[r,n,s]}function FK(t){return typeof t=="function"}function D$(t){const e=b.useRef({value:t,previous:t});return b.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function L$(t){const[e,r]=b.useState(void 0);return nn(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let l,c;if("borderBoxSize"in s){const d=s.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,c=f.blockSize}else l=t.offsetWidth,c=t.offsetHeight;r({width:l,height:c})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function Ss(t){const e=zK(t),r=b.forwardRef((n,a)=>{const{children:s,...l}=n,c=b.Children.toArray(s),d=c.find(BK);if(d){const f=d.props.children,m=c.map(h=>h===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:h);return g.jsx(e,{...l,ref:a,children:b.isValidElement(f)?b.cloneElement(f,void 0,m):null})}return g.jsx(e,{...l,ref:a,children:s})});return r.displayName=`${t}.Slot`,r}function zK(t){const e=b.forwardRef((r,n)=>{const{children:a,...s}=r;if(b.isValidElement(a)){const l=HK(a),c=qK(s,a.props);return a.type!==b.Fragment&&(c.ref=n?Va(n,l):l),b.cloneElement(a,c)}return b.Children.count(a)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var M$=Symbol("radix.slottable");function $K(t){const e=({children:r})=>g.jsx(g.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=M$,e}function BK(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===M$}function qK(t,e){const r={...e};for(const n in e){const a=t[n],s=e[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...c)=>{const d=s(...c);return a(...c),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...t,...r}}function HK(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var VK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bt=VK.reduce((t,e)=>{const r=Ss(`Primitive.${e}`),n=b.forwardRef((a,s)=>{const{asChild:l,...c}=a,d=l?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(d,{...c,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function P$(t,e){t&&bc.flushSync(()=>t.dispatchEvent(e))}var Vm="Switch",[GK]=Xa(Vm),[WK,YK]=GK(Vm),j$=b.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:s,required:l,disabled:c,value:d="on",onCheckedChange:f,form:m,...h}=t,[v,y]=b.useState(null),w=Nt(e,C=>y(C)),S=b.useRef(!1),R=v?m||!!v.closest("form"):!0,[x,_]=_i({prop:a,defaultProp:s??!1,onChange:f,caller:Vm});return g.jsxs(WK,{scope:r,checked:x,disabled:c,children:[g.jsx(bt.button,{type:"button",role:"switch","aria-checked":x,"aria-required":l,"data-state":$$(x),"data-disabled":c?"":void 0,disabled:c,value:d,...h,ref:w,onClick:He(t.onClick,C=>{_(N=>!N),R&&(S.current=C.isPropagationStopped(),S.current||C.stopPropagation())})}),R&&g.jsx(z$,{control:v,bubbles:!S.current,name:n,value:d,checked:x,required:l,disabled:c,form:m,style:{transform:"translateX(-100%)"}})]})});j$.displayName=Vm;var U$="SwitchThumb",F$=b.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,a=YK(U$,r);return g.jsx(bt.span,{"data-state":$$(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:e})});F$.displayName=U$;var KK="SwitchBubbleInput",z$=b.forwardRef(({__scopeSwitch:t,control:e,checked:r,bubbles:n=!0,...a},s)=>{const l=b.useRef(null),c=Nt(l,s),d=D$(r),f=L$(e);return b.useEffect(()=>{const m=l.current;if(!m)return;const h=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(h,"checked").set;if(d!==r&&y){const w=new Event("click",{bubbles:n});y.call(m,r),m.dispatchEvent(w)}},[d,r,n]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:c,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});z$.displayName=KK;function $$(t){return t?"checked":"unchecked"}var B$=j$,ZK=F$;function ER({ref:t,className:e,...r}){return g.jsx(B$,{className:De("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:t,children:g.jsx(ZK,{className:De("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})}ER.displayName=B$.displayName;function Wa(t){const e=b.useRef(t);return b.useEffect(()=>{e.current=t}),b.useMemo(()=>(...r)=>e.current?.(...r),[])}function XK(t,e=globalThis?.document){const r=Wa(t);b.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var QK="DismissableLayer",Z_="dismissableLayer.update",JK="dismissableLayer.pointerDownOutside",eZ="dismissableLayer.focusOutside",TO,q$=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sc=b.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=t,f=b.useContext(q$),[m,h]=b.useState(null),v=m?.ownerDocument??globalThis?.document,[,y]=b.useState({}),w=Nt(e,I=>h(I)),S=Array.from(f.layers),[R]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=S.indexOf(R),_=m?S.indexOf(m):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,N=_>=x,k=nZ(I=>{const O=I.target,L=[...f.branches].some(M=>M.contains(O));!N||L||(a?.(I),l?.(I),I.defaultPrevented||c?.())},v),A=aZ(I=>{const O=I.target;[...f.branches].some(M=>M.contains(O))||(s?.(I),l?.(I),I.defaultPrevented||c?.())},v);return XK(I=>{_===f.layers.size-1&&(n?.(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},v),b.useEffect(()=>{if(m)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(TO=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),RO(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=TO)}},[m,v,r,f]),b.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),RO())},[m,f]),b.useEffect(()=>{const I=()=>y({});return document.addEventListener(Z_,I),()=>document.removeEventListener(Z_,I)},[]),g.jsx(bt.div,{...d,ref:w,style:{pointerEvents:C?N?"auto":"none":void 0,...t.style},onFocusCapture:He(t.onFocusCapture,A.onFocusCapture),onBlurCapture:He(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:He(t.onPointerDownCapture,k.onPointerDownCapture)})});Sc.displayName=QK;var tZ="DismissableLayerBranch",rZ=b.forwardRef((t,e)=>{const r=b.useContext(q$),n=b.useRef(null),a=Nt(e,n);return b.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),g.jsx(bt.div,{...t,ref:a})});rZ.displayName=tZ;function nZ(t,e=globalThis?.document){const r=Wa(t),n=b.useRef(!1),a=b.useRef(()=>{});return b.useEffect(()=>{const s=c=>{if(c.target&&!n.current){let d=function(){H$(JK,r,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",a.current),a.current=d,e.addEventListener("click",a.current,{once:!0})):d()}else e.removeEventListener("click",a.current);n.current=!1},l=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),e.removeEventListener("pointerdown",s),e.removeEventListener("click",a.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function aZ(t,e=globalThis?.document){const r=Wa(t),n=b.useRef(!1);return b.useEffect(()=>{const a=s=>{s.target&&!n.current&&H$(eZ,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",a),()=>e.removeEventListener("focusin",a)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function RO(){const t=new CustomEvent(Z_);document.dispatchEvent(t)}function H$(t,e,r,{discrete:n}){const a=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&a.addEventListener(t,e,{once:!0}),n?P$(a,s):a.dispatchEvent(s)}var oZ=Bm[" useId ".trim().toString()]||(()=>{}),iZ=0;function Xr(t){const[e,r]=b.useState(oZ());return nn(()=>{r(n=>n??String(iZ++))},[t]),t||(e?`radix-${e}`:"")}const sZ=["top","right","bottom","left"],Ti=Math.min,Un=Math.max,ym=Math.round,bp=Math.floor,za=t=>({x:t,y:t}),lZ={left:"right",right:"left",bottom:"top",top:"bottom"},cZ={start:"end",end:"start"};function X_(t,e,r){return Un(t,Ti(e,r))}function Io(t,e){return typeof t=="function"?t(e):t}function Oo(t){return t.split("-")[0]}function xc(t){return t.split("-")[1]}function SR(t){return t==="x"?"y":"x"}function xR(t){return t==="y"?"height":"width"}const uZ=new Set(["top","bottom"]);function Pa(t){return uZ.has(Oo(t))?"y":"x"}function wR(t){return SR(Pa(t))}function dZ(t,e,r){r===void 0&&(r=!1);const n=xc(t),a=wR(t),s=xR(a);let l=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=Em(l)),[l,Em(l)]}function fZ(t){const e=Em(t);return[Q_(t),e,Q_(e)]}function Q_(t){return t.replace(/start|end/g,e=>cZ[e])}const CO=["left","right"],AO=["right","left"],pZ=["top","bottom"],mZ=["bottom","top"];function hZ(t,e,r){switch(t){case"top":case"bottom":return r?e?AO:CO:e?CO:AO;case"left":case"right":return e?pZ:mZ;default:return[]}}function gZ(t,e,r,n){const a=xc(t);let s=hZ(Oo(t),r==="start",n);return a&&(s=s.map(l=>l+"-"+a),e&&(s=s.concat(s.map(Q_)))),s}function Em(t){return t.replace(/left|right|bottom|top/g,e=>lZ[e])}function vZ(t){return{top:0,right:0,bottom:0,left:0,...t}}function V$(t){return typeof t!="number"?vZ(t):{top:t,right:t,bottom:t,left:t}}function Sm(t){const{x:e,y:r,width:n,height:a}=t;return{width:n,height:a,top:r,left:e,right:e+n,bottom:r+a,x:e,y:r}}function NO(t,e,r){let{reference:n,floating:a}=t;const s=Pa(e),l=wR(e),c=xR(l),d=Oo(e),f=s==="y",m=n.x+n.width/2-a.width/2,h=n.y+n.height/2-a.height/2,v=n[c]/2-a[c]/2;let y;switch(d){case"top":y={x:m,y:n.y-a.height};break;case"bottom":y={x:m,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:h};break;case"left":y={x:n.x-a.width,y:h};break;default:y={x:n.x,y:n.y}}switch(xc(e)){case"start":y[l]-=v*(r&&f?-1:1);break;case"end":y[l]+=v*(r&&f?-1:1);break}return y}const bZ=async(t,e,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:l}=r,c=s.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:a}),{x:m,y:h}=NO(f,n,d),v=n,y={},w=0;for(let S=0;S<c.length;S++){const{name:R,fn:x}=c[S],{x:_,y:C,data:N,reset:k}=await x({x:m,y:h,initialPlacement:n,placement:v,strategy:a,middlewareData:y,rects:f,platform:l,elements:{reference:t,floating:e}});m=_??m,h=C??h,y={...y,[R]:{...y[R],...N}},k&&w<=50&&(w++,typeof k=="object"&&(k.placement&&(v=k.placement),k.rects&&(f=k.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:a}):k.rects),{x:m,y:h}=NO(f,v,d)),S=-1)}return{x:m,y:h,placement:v,strategy:a,middlewareData:y}};async function ud(t,e){var r;e===void 0&&(e={});const{x:n,y:a,platform:s,rects:l,elements:c,strategy:d}=t,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=Io(e,t),w=V$(y),R=c[v?h==="floating"?"reference":"floating":h],x=Sm(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(R)))==null||r?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:m,strategy:d})),_=h==="floating"?{x:n,y:a,width:l.floating.width,height:l.floating.height}:l.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),N=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},k=Sm(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:_,offsetParent:C,strategy:d}):_);return{top:(x.top-k.top+w.top)/N.y,bottom:(k.bottom-x.bottom+w.bottom)/N.y,left:(x.left-k.left+w.left)/N.x,right:(k.right-x.right+w.right)/N.x}}const yZ=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:a,rects:s,platform:l,elements:c,middlewareData:d}=e,{element:f,padding:m=0}=Io(t,e)||{};if(f==null)return{};const h=V$(m),v={x:r,y:n},y=wR(a),w=xR(y),S=await l.getDimensions(f),R=y==="y",x=R?"top":"left",_=R?"bottom":"right",C=R?"clientHeight":"clientWidth",N=s.reference[w]+s.reference[y]-v[y]-s.floating[w],k=v[y]-s.reference[y],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let I=A?A[C]:0;(!I||!await(l.isElement==null?void 0:l.isElement(A)))&&(I=c.floating[C]||s.floating[w]);const O=N/2-k/2,L=I/2-S[w]/2-1,M=Ti(h[x],L),P=Ti(h[_],L),W=M,X=I-S[w]-P,ee=I/2-S[w]/2+O,J=X_(W,ee,X),j=!d.arrow&&xc(a)!=null&&ee!==J&&s.reference[w]/2-(ee<W?M:P)-S[w]/2<0,G=j?ee<W?ee-W:ee-X:0;return{[y]:v[y]+G,data:{[y]:J,centerOffset:ee-J-G,...j&&{alignmentOffset:G}},reset:j}}}),EZ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:a,middlewareData:s,rects:l,initialPlacement:c,platform:d,elements:f}=e,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...R}=Io(t,e);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const x=Oo(a),_=Pa(c),C=Oo(c)===c,N=await(d.isRTL==null?void 0:d.isRTL(f.floating)),k=v||(C||!S?[Em(c)]:fZ(c)),A=w!=="none";!v&&A&&k.push(...gZ(c,S,w,N));const I=[c,...k],O=await ud(e,R),L=[];let M=((n=s.flip)==null?void 0:n.overflows)||[];if(m&&L.push(O[x]),h){const ee=dZ(a,l,N);L.push(O[ee[0]],O[ee[1]])}if(M=[...M,{placement:a,overflows:L}],!L.every(ee=>ee<=0)){var P,W;const ee=(((P=s.flip)==null?void 0:P.index)||0)+1,J=I[ee];if(J&&(!(h==="alignment"?_!==Pa(J):!1)||M.every(V=>Pa(V.placement)===_?V.overflows[0]>0:!0)))return{data:{index:ee,overflows:M},reset:{placement:J}};let j=(W=M.filter(G=>G.overflows[0]<=0).sort((G,V)=>G.overflows[1]-V.overflows[1])[0])==null?void 0:W.placement;if(!j)switch(y){case"bestFit":{var X;const G=(X=M.filter(V=>{if(A){const te=Pa(V.placement);return te===_||te==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(te=>te>0).reduce((te,re)=>te+re,0)]).sort((V,te)=>V[1]-te[1])[0])==null?void 0:X[0];G&&(j=G);break}case"initialPlacement":j=c;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function kO(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function IO(t){return sZ.some(e=>t[e]>=0)}const SZ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...a}=Io(t,e);switch(n){case"referenceHidden":{const s=await ud(e,{...a,elementContext:"reference"}),l=kO(s,r.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:IO(l)}}}case"escaped":{const s=await ud(e,{...a,altBoundary:!0}),l=kO(s,r.floating);return{data:{escapedOffsets:l,escaped:IO(l)}}}default:return{}}}}},G$=new Set(["left","top"]);async function xZ(t,e){const{placement:r,platform:n,elements:a}=t,s=await(n.isRTL==null?void 0:n.isRTL(a.floating)),l=Oo(r),c=xc(r),d=Pa(r)==="y",f=G$.has(l)?-1:1,m=s&&d?-1:1,h=Io(e,t);let{mainAxis:v,crossAxis:y,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof w=="number"&&(y=c==="end"?w*-1:w),d?{x:y*m,y:v*f}:{x:v*f,y:y*m}}const wZ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:a,y:s,placement:l,middlewareData:c}=e,d=await xZ(e,t);return l===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:a+d.x,y:s+d.y,data:{...d,placement:l}}}}},_Z=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:a}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:R=>{let{x,y:_}=R;return{x,y:_}}},...d}=Io(t,e),f={x:r,y:n},m=await ud(e,d),h=Pa(Oo(a)),v=SR(h);let y=f[v],w=f[h];if(s){const R=v==="y"?"top":"left",x=v==="y"?"bottom":"right",_=y+m[R],C=y-m[x];y=X_(_,y,C)}if(l){const R=h==="y"?"top":"left",x=h==="y"?"bottom":"right",_=w+m[R],C=w-m[x];w=X_(_,w,C)}const S=c.fn({...e,[v]:y,[h]:w});return{...S,data:{x:S.x-r,y:S.y-n,enabled:{[v]:s,[h]:l}}}}}},TZ=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:a,rects:s,middlewareData:l}=e,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=Io(t,e),m={x:r,y:n},h=Pa(a),v=SR(h);let y=m[v],w=m[h];const S=Io(c,e),R=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const C=v==="y"?"height":"width",N=s.reference[v]-s.floating[C]+R.mainAxis,k=s.reference[v]+s.reference[C]-R.mainAxis;y<N?y=N:y>k&&(y=k)}if(f){var x,_;const C=v==="y"?"width":"height",N=G$.has(Oo(a)),k=s.reference[h]-s.floating[C]+(N&&((x=l.offset)==null?void 0:x[h])||0)+(N?0:R.crossAxis),A=s.reference[h]+s.reference[C]+(N?0:((_=l.offset)==null?void 0:_[h])||0)-(N?R.crossAxis:0);w<k?w=k:w>A&&(w=A)}return{[v]:y,[h]:w}}}},RZ=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:a,rects:s,platform:l,elements:c}=e,{apply:d=()=>{},...f}=Io(t,e),m=await ud(e,f),h=Oo(a),v=xc(a),y=Pa(a)==="y",{width:w,height:S}=s.floating;let R,x;h==="top"||h==="bottom"?(R=h,x=v===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(x=h,R=v==="end"?"top":"bottom");const _=S-m.top-m.bottom,C=w-m.left-m.right,N=Ti(S-m[R],_),k=Ti(w-m[x],C),A=!e.middlewareData.shift;let I=N,O=k;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(O=C),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(I=_),A&&!v){const M=Un(m.left,0),P=Un(m.right,0),W=Un(m.top,0),X=Un(m.bottom,0);y?O=w-2*(M!==0||P!==0?M+P:Un(m.left,m.right)):I=S-2*(W!==0||X!==0?W+X:Un(m.top,m.bottom))}await d({...e,availableWidth:O,availableHeight:I});const L=await l.getDimensions(c.floating);return w!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function Gm(){return typeof window<"u"}function wc(t){return W$(t)?(t.nodeName||"").toLowerCase():"#document"}function Fn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Qa(t){var e;return(e=(W$(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function W$(t){return Gm()?t instanceof Node||t instanceof Fn(t).Node:!1}function Sa(t){return Gm()?t instanceof Element||t instanceof Fn(t).Element:!1}function Ya(t){return Gm()?t instanceof HTMLElement||t instanceof Fn(t).HTMLElement:!1}function OO(t){return!Gm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Fn(t).ShadowRoot}const CZ=new Set(["inline","contents"]);function jd(t){const{overflow:e,overflowX:r,overflowY:n,display:a}=xa(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!CZ.has(a)}const AZ=new Set(["table","td","th"]);function NZ(t){return AZ.has(wc(t))}const kZ=[":popover-open",":modal"];function Wm(t){return kZ.some(e=>{try{return t.matches(e)}catch{return!1}})}const IZ=["transform","translate","scale","rotate","perspective"],OZ=["transform","translate","scale","rotate","perspective","filter"],DZ=["paint","layout","strict","content"];function _R(t){const e=TR(),r=Sa(t)?xa(t):t;return IZ.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||OZ.some(n=>(r.willChange||"").includes(n))||DZ.some(n=>(r.contain||"").includes(n))}function LZ(t){let e=Ri(t);for(;Ya(e)&&!ac(e);){if(_R(e))return e;if(Wm(e))return null;e=Ri(e)}return null}function TR(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const MZ=new Set(["html","body","#document"]);function ac(t){return MZ.has(wc(t))}function xa(t){return Fn(t).getComputedStyle(t)}function Ym(t){return Sa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ri(t){if(wc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||OO(t)&&t.host||Qa(t);return OO(e)?e.host:e}function Y$(t){const e=Ri(t);return ac(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ya(e)&&jd(e)?e:Y$(e)}function dd(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const a=Y$(t),s=a===((n=t.ownerDocument)==null?void 0:n.body),l=Fn(a);if(s){const c=J_(l);return e.concat(l,l.visualViewport||[],jd(a)?a:[],c&&r?dd(c):[])}return e.concat(a,dd(a,[],r))}function J_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function K$(t){const e=xa(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const a=Ya(t),s=a?t.offsetWidth:r,l=a?t.offsetHeight:n,c=ym(r)!==s||ym(n)!==l;return c&&(r=s,n=l),{width:r,height:n,$:c}}function RR(t){return Sa(t)?t:t.contextElement}function Fl(t){const e=RR(t);if(!Ya(e))return za(1);const r=e.getBoundingClientRect(),{width:n,height:a,$:s}=K$(e);let l=(s?ym(r.width):r.width)/n,c=(s?ym(r.height):r.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const PZ=za(0);function Z$(t){const e=Fn(t);return!TR()||!e.visualViewport?PZ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jZ(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Fn(t)?!1:e}function xs(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const a=t.getBoundingClientRect(),s=RR(t);let l=za(1);e&&(n?Sa(n)&&(l=Fl(n)):l=Fl(t));const c=jZ(s,r,n)?Z$(s):za(0);let d=(a.left+c.x)/l.x,f=(a.top+c.y)/l.y,m=a.width/l.x,h=a.height/l.y;if(s){const v=Fn(s),y=n&&Sa(n)?Fn(n):n;let w=v,S=J_(w);for(;S&&n&&y!==w;){const R=Fl(S),x=S.getBoundingClientRect(),_=xa(S),C=x.left+(S.clientLeft+parseFloat(_.paddingLeft))*R.x,N=x.top+(S.clientTop+parseFloat(_.paddingTop))*R.y;d*=R.x,f*=R.y,m*=R.x,h*=R.y,d+=C,f+=N,w=Fn(S),S=J_(w)}}return Sm({width:m,height:h,x:d,y:f})}function Km(t,e){const r=Ym(t).scrollLeft;return e?e.left+r:xs(Qa(t)).left+r}function X$(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Km(t,r),a=r.top+e.scrollTop;return{x:n,y:a}}function UZ(t){let{elements:e,rect:r,offsetParent:n,strategy:a}=t;const s=a==="fixed",l=Qa(n),c=e?Wm(e.floating):!1;if(n===l||c&&s)return r;let d={scrollLeft:0,scrollTop:0},f=za(1);const m=za(0),h=Ya(n);if((h||!h&&!s)&&((wc(n)!=="body"||jd(l))&&(d=Ym(n)),Ya(n))){const y=xs(n);f=Fl(n),m.x=y.x+n.clientLeft,m.y=y.y+n.clientTop}const v=l&&!h&&!s?X$(l,d):za(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-d.scrollLeft*f.x+m.x+v.x,y:r.y*f.y-d.scrollTop*f.y+m.y+v.y}}function FZ(t){return Array.from(t.getClientRects())}function zZ(t){const e=Qa(t),r=Ym(t),n=t.ownerDocument.body,a=Un(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Un(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+Km(t);const c=-r.scrollTop;return xa(n).direction==="rtl"&&(l+=Un(e.clientWidth,n.clientWidth)-a),{width:a,height:s,x:l,y:c}}const DO=25;function $Z(t,e){const r=Fn(t),n=Qa(t),a=r.visualViewport;let s=n.clientWidth,l=n.clientHeight,c=0,d=0;if(a){s=a.width,l=a.height;const m=TR();(!m||m&&e==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=Km(n);if(f<=0){const m=n.ownerDocument,h=m.body,v=getComputedStyle(h),y=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(n.clientWidth-h.clientWidth-y);w<=DO&&(s-=w)}else f<=DO&&(s+=f);return{width:s,height:l,x:c,y:d}}const BZ=new Set(["absolute","fixed"]);function qZ(t,e){const r=xs(t,!0,e==="fixed"),n=r.top+t.clientTop,a=r.left+t.clientLeft,s=Ya(t)?Fl(t):za(1),l=t.clientWidth*s.x,c=t.clientHeight*s.y,d=a*s.x,f=n*s.y;return{width:l,height:c,x:d,y:f}}function LO(t,e,r){let n;if(e==="viewport")n=$Z(t,r);else if(e==="document")n=zZ(Qa(t));else if(Sa(e))n=qZ(e,r);else{const a=Z$(t);n={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return Sm(n)}function Q$(t,e){const r=Ri(t);return r===e||!Sa(r)||ac(r)?!1:xa(r).position==="fixed"||Q$(r,e)}function HZ(t,e){const r=e.get(t);if(r)return r;let n=dd(t,[],!1).filter(c=>Sa(c)&&wc(c)!=="body"),a=null;const s=xa(t).position==="fixed";let l=s?Ri(t):t;for(;Sa(l)&&!ac(l);){const c=xa(l),d=_R(l);!d&&c.position==="fixed"&&(a=null),(s?!d&&!a:!d&&c.position==="static"&&!!a&&BZ.has(a.position)||jd(l)&&!d&&Q$(t,l))?n=n.filter(m=>m!==l):a=c,l=Ri(l)}return e.set(t,n),n}function VZ(t){let{element:e,boundary:r,rootBoundary:n,strategy:a}=t;const l=[...r==="clippingAncestors"?Wm(e)?[]:HZ(e,this._c):[].concat(r),n],c=l[0],d=l.reduce((f,m)=>{const h=LO(e,m,a);return f.top=Un(h.top,f.top),f.right=Ti(h.right,f.right),f.bottom=Ti(h.bottom,f.bottom),f.left=Un(h.left,f.left),f},LO(e,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function GZ(t){const{width:e,height:r}=K$(t);return{width:e,height:r}}function WZ(t,e,r){const n=Ya(e),a=Qa(e),s=r==="fixed",l=xs(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const d=za(0);function f(){d.x=Km(a)}if(n||!n&&!s)if((wc(e)!=="body"||jd(a))&&(c=Ym(e)),n){const y=xs(e,!0,s,e);d.x=y.x+e.clientLeft,d.y=y.y+e.clientTop}else a&&f();s&&!n&&a&&f();const m=a&&!n&&!s?X$(a,c):za(0),h=l.left+c.scrollLeft-d.x-m.x,v=l.top+c.scrollTop-d.y-m.y;return{x:h,y:v,width:l.width,height:l.height}}function qb(t){return xa(t).position==="static"}function MO(t,e){if(!Ya(t)||xa(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Qa(t)===r&&(r=r.ownerDocument.body),r}function J$(t,e){const r=Fn(t);if(Wm(t))return r;if(!Ya(t)){let a=Ri(t);for(;a&&!ac(a);){if(Sa(a)&&!qb(a))return a;a=Ri(a)}return r}let n=MO(t,e);for(;n&&NZ(n)&&qb(n);)n=MO(n,e);return n&&ac(n)&&qb(n)&&!_R(n)?r:n||LZ(t)||r}const YZ=async function(t){const e=this.getOffsetParent||J$,r=this.getDimensions,n=await r(t.floating);return{reference:WZ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function KZ(t){return xa(t).direction==="rtl"}const ZZ={convertOffsetParentRelativeRectToViewportRelativeRect:UZ,getDocumentElement:Qa,getClippingRect:VZ,getOffsetParent:J$,getElementRects:YZ,getClientRects:FZ,getDimensions:GZ,getScale:Fl,isElement:Sa,isRTL:KZ};function eB(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function XZ(t,e){let r=null,n;const a=Qa(t);function s(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function l(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),s();const f=t.getBoundingClientRect(),{left:m,top:h,width:v,height:y}=f;if(c||e(),!v||!y)return;const w=bp(h),S=bp(a.clientWidth-(m+v)),R=bp(a.clientHeight-(h+y)),x=bp(m),C={rootMargin:-w+"px "+-S+"px "+-R+"px "+-x+"px",threshold:Un(0,Ti(1,d))||1};let N=!0;function k(A){const I=A[0].intersectionRatio;if(I!==d){if(!N)return l();I?l(!1,I):n=setTimeout(()=>{l(!1,1e-7)},1e3)}I===1&&!eB(f,t.getBoundingClientRect())&&l(),N=!1}try{r=new IntersectionObserver(k,{...C,root:a.ownerDocument})}catch{r=new IntersectionObserver(k,C)}r.observe(t)}return l(!0),s}function QZ(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,f=RR(t),m=a||s?[...f?dd(f):[],...dd(e)]:[];m.forEach(x=>{a&&x.addEventListener("scroll",r,{passive:!0}),s&&x.addEventListener("resize",r)});const h=f&&c?XZ(f,r):null;let v=-1,y=null;l&&(y=new ResizeObserver(x=>{let[_]=x;_&&_.target===f&&y&&(y.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var C;(C=y)==null||C.observe(e)})),r()}),f&&!d&&y.observe(f),y.observe(e));let w,S=d?xs(t):null;d&&R();function R(){const x=xs(t);S&&!eB(S,x)&&r(),S=x,w=requestAnimationFrame(R)}return r(),()=>{var x;m.forEach(_=>{a&&_.removeEventListener("scroll",r),s&&_.removeEventListener("resize",r)}),h?.(),(x=y)==null||x.disconnect(),y=null,d&&cancelAnimationFrame(w)}}const JZ=wZ,eX=_Z,tX=EZ,rX=RZ,nX=SZ,PO=yZ,aX=TZ,oX=(t,e,r)=>{const n=new Map,a={platform:ZZ,...r},s={...a.platform,_c:n};return bZ(t,e,{...a,platform:s})};var iX=typeof document<"u",sX=function(){},$p=iX?b.useLayoutEffect:sX;function xm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!xm(t[n],e[n]))return!1;return!0}if(a=Object.keys(t),r=a.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,a[n]))return!1;for(n=r;n--!==0;){const s=a[n];if(!(s==="_owner"&&t.$$typeof)&&!xm(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function tB(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function jO(t,e){const r=tB(t);return Math.round(e*r)/r}function Hb(t){const e=b.useRef(t);return $p(()=>{e.current=t}),e}function lX(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:d,open:f}=t,[m,h]=b.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[v,y]=b.useState(n);xm(v,n)||y(n);const[w,S]=b.useState(null),[R,x]=b.useState(null),_=b.useCallback(V=>{V!==A.current&&(A.current=V,S(V))},[]),C=b.useCallback(V=>{V!==I.current&&(I.current=V,x(V))},[]),N=s||w,k=l||R,A=b.useRef(null),I=b.useRef(null),O=b.useRef(m),L=d!=null,M=Hb(d),P=Hb(a),W=Hb(f),X=b.useCallback(()=>{if(!A.current||!I.current)return;const V={placement:e,strategy:r,middleware:v};P.current&&(V.platform=P.current),oX(A.current,I.current,V).then(te=>{const re={...te,isPositioned:W.current!==!1};ee.current&&!xm(O.current,re)&&(O.current=re,bc.flushSync(()=>{h(re)}))})},[v,e,r,P,W]);$p(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,h(V=>({...V,isPositioned:!1})))},[f]);const ee=b.useRef(!1);$p(()=>(ee.current=!0,()=>{ee.current=!1}),[]),$p(()=>{if(N&&(A.current=N),k&&(I.current=k),N&&k){if(M.current)return M.current(N,k,X);X()}},[N,k,X,M,L]);const J=b.useMemo(()=>({reference:A,floating:I,setReference:_,setFloating:C}),[_,C]),j=b.useMemo(()=>({reference:N,floating:k}),[N,k]),G=b.useMemo(()=>{const V={position:r,left:0,top:0};if(!j.floating)return V;const te=jO(j.floating,m.x),re=jO(j.floating,m.y);return c?{...V,transform:"translate("+te+"px, "+re+"px)",...tB(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:te,top:re}},[r,c,j.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:X,refs:J,elements:j,floatingStyles:G}),[m,X,J,j,G])}const cX=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:a}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?PO({element:n.current,padding:a}).fn(r):{}:n?PO({element:n,padding:a}).fn(r):{}}}},uX=(t,e)=>({...JZ(t),options:[t,e]}),dX=(t,e)=>({...eX(t),options:[t,e]}),fX=(t,e)=>({...aX(t),options:[t,e]}),pX=(t,e)=>({...tX(t),options:[t,e]}),mX=(t,e)=>({...rX(t),options:[t,e]}),hX=(t,e)=>({...nX(t),options:[t,e]}),gX=(t,e)=>({...cX(t),options:[t,e]});var vX="Arrow",rB=b.forwardRef((t,e)=>{const{children:r,width:n=10,height:a=5,...s}=t;return g.jsx(bt.svg,{...s,ref:e,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});rB.displayName=vX;var bX=rB,CR="Popper",[nB,ki]=Xa(CR),[yX,aB]=nB(CR),oB=t=>{const{__scopePopper:e,children:r}=t,[n,a]=b.useState(null);return g.jsx(yX,{scope:e,anchor:n,onAnchorChange:a,children:r})};oB.displayName=CR;var iB="PopperAnchor",sB=b.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...a}=t,s=aB(iB,r),l=b.useRef(null),c=Nt(e,l),d=b.useRef(null);return b.useEffect(()=>{const f=d.current;d.current=n?.current||l.current,f!==d.current&&s.onAnchorChange(d.current)}),n?null:g.jsx(bt.div,{...a,ref:c})});sB.displayName=iB;var AR="PopperContent",[EX,SX]=nB(AR),lB=b.forwardRef((t,e)=>{const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:w,...S}=t,R=aB(AR,r),[x,_]=b.useState(null),C=Nt(e,z=>_(z)),[N,k]=b.useState(null),A=L$(N),I=A?.width??0,O=A?.height??0,L=n+(s!=="center"?"-"+s:""),M=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},P=Array.isArray(f)?f:[f],W=P.length>0,X={padding:M,boundary:P.filter(wX),altBoundary:W},{refs:ee,floatingStyles:J,placement:j,isPositioned:G,middlewareData:V}=lX({strategy:"fixed",placement:L,whileElementsMounted:(...z)=>QZ(...z,{animationFrame:y==="always"}),elements:{reference:R.anchor},middleware:[uX({mainAxis:a+O,alignmentAxis:l}),d&&dX({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?fX():void 0,...X}),d&&pX({...X}),mX({...X,apply:({elements:z,rects:K,availableWidth:ae,availableHeight:H})=>{const{width:de,height:me}=K.reference,xe=z.floating.style;xe.setProperty("--radix-popper-available-width",`${ae}px`),xe.setProperty("--radix-popper-available-height",`${H}px`),xe.setProperty("--radix-popper-anchor-width",`${de}px`),xe.setProperty("--radix-popper-anchor-height",`${me}px`)}}),N&&gX({element:N,padding:c}),_X({arrowWidth:I,arrowHeight:O}),v&&hX({strategy:"referenceHidden",...X})]}),[te,re]=dB(j),U=Wa(w);nn(()=>{G&&U?.()},[G,U]);const q=V.arrow?.x,$=V.arrow?.y,Y=V.arrow?.centerOffset!==0,[Q,F]=b.useState();return nn(()=>{x&&F(window.getComputedStyle(x).zIndex)},[x]),g.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:G?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g.jsx(EX,{scope:r,placedSide:te,onArrowChange:k,arrowX:q,arrowY:$,shouldHideArrow:Y,children:g.jsx(bt.div,{"data-side":te,"data-align":re,...S,ref:C,style:{...S.style,animation:G?void 0:"none"}})})})});lB.displayName=AR;var cB="PopperArrow",xX={top:"bottom",right:"left",bottom:"top",left:"right"},uB=b.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,s=SX(cB,n),l=xX[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(bX,{...a,ref:r,style:{...a.style,display:"block"}})})});uB.displayName=cB;function wX(t){return t!==null}var _X=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:n,middlewareData:a}=e,l=a.arrow?.centerOffset!==0,c=l?0:t.arrowWidth,d=l?0:t.arrowHeight,[f,m]=dB(r),h={start:"0%",center:"50%",end:"100%"}[m],v=(a.arrow?.x??0)+c/2,y=(a.arrow?.y??0)+d/2;let w="",S="";return f==="bottom"?(w=l?h:`${v}px`,S=`${-d}px`):f==="top"?(w=l?h:`${v}px`,S=`${n.floating.height+d}px`):f==="right"?(w=`${-d}px`,S=l?h:`${y}px`):f==="left"&&(w=`${n.floating.width+d}px`,S=l?h:`${y}px`),{data:{x:w,y:S}}}});function dB(t){const[e,r="center"]=t.split("-");return[e,r]}var Zm=oB,Ud=sB,Xm=lB,Qm=uB,TX="Portal",_c=b.forwardRef((t,e)=>{const{container:r,...n}=t,[a,s]=b.useState(!1);nn(()=>s(!0),[]);const l=r||a&&globalThis?.document?.body;return l?f$.createPortal(g.jsx(bt.div,{...n,ref:e}),l):null});_c.displayName=TX;function RX(t,e){return b.useReducer((r,n)=>e[r][n]??r,t)}var ca=t=>{const{present:e,children:r}=t,n=CX(e),a=typeof r=="function"?r({present:n.isPresent}):b.Children.only(r),s=Nt(n.ref,AX(a));return typeof r=="function"||n.isPresent?b.cloneElement(a,{ref:s}):null};ca.displayName="Presence";function CX(t){const[e,r]=b.useState(),n=b.useRef(null),a=b.useRef(t),s=b.useRef("none"),l=t?"mounted":"unmounted",[c,d]=RX(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const f=yp(n.current);s.current=c==="mounted"?f:"none"},[c]),nn(()=>{const f=n.current,m=a.current;if(m!==t){const v=s.current,y=yp(f);t?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&v!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,d]),nn(()=>{if(e){let f;const m=e.ownerDocument.defaultView??window,h=y=>{const S=yp(n.current).includes(CSS.escape(y.animationName));if(y.target===e&&S&&(d("ANIMATION_END"),!a.current)){const R=e.style.animationFillMode;e.style.animationFillMode="forwards",f=m.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=R)})}},v=y=>{y.target===e&&(s.current=yp(n.current))};return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{m.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:b.useCallback(f=>{n.current=f?getComputedStyle(f):null,r(f)},[])}}function yp(t){return t?.animationName||"none"}function AX(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var fB=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),NX="VisuallyHidden",pB=b.forwardRef((t,e)=>g.jsx(bt.span,{...t,ref:e,style:{...fB,...t.style}}));pB.displayName=NX;var kX=pB,[Jm]=Xa("Tooltip",[ki]),eh=ki(),mB="TooltipProvider",IX=700,eT="tooltip.open",[OX,NR]=Jm(mB),hB=t=>{const{__scopeTooltip:e,delayDuration:r=IX,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:s}=t,l=b.useRef(!0),c=b.useRef(!1),d=b.useRef(0);return b.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),g.jsx(OX,{scope:e,isOpenDelayedRef:l,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:b.useCallback(f=>{c.current=f},[]),disableHoverableContent:a,children:s})};hB.displayName=mB;var fd="Tooltip",[DX,Fd]=Jm(fd),gB=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:a,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,d=NR(fd,t.__scopeTooltip),f=eh(e),[m,h]=b.useState(null),v=Xr(),y=b.useRef(0),w=l??d.disableHoverableContent,S=c??d.delayDuration,R=b.useRef(!1),[x,_]=_i({prop:n,defaultProp:a??!1,onChange:I=>{I?(d.onOpen(),document.dispatchEvent(new CustomEvent(eT))):d.onClose(),s?.(I)},caller:fd}),C=b.useMemo(()=>x?R.current?"delayed-open":"instant-open":"closed",[x]),N=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,R.current=!1,_(!0)},[_]),k=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,_(!1)},[_]),A=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{R.current=!0,_(!0),y.current=0},S)},[S,_]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),g.jsx(Zm,{...f,children:g.jsx(DX,{scope:e,contentId:v,open:x,stateAttribute:C,trigger:m,onTriggerChange:h,onTriggerEnter:b.useCallback(()=>{d.isOpenDelayedRef.current?A():N()},[d.isOpenDelayedRef,A,N]),onTriggerLeave:b.useCallback(()=>{w?k():(window.clearTimeout(y.current),y.current=0)},[k,w]),onOpen:N,onClose:k,disableHoverableContent:w,children:r})})};gB.displayName=fd;var tT="TooltipTrigger",vB=b.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,a=Fd(tT,r),s=NR(tT,r),l=eh(r),c=b.useRef(null),d=Nt(e,c,a.onTriggerChange),f=b.useRef(!1),m=b.useRef(!1),h=b.useCallback(()=>f.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),g.jsx(Ud,{asChild:!0,...l,children:g.jsx(bt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:d,onPointerMove:He(t.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:He(t.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:He(t.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:He(t.onFocus,()=>{f.current||a.onOpen()}),onBlur:He(t.onBlur,a.onClose),onClick:He(t.onClick,a.onClose)})})});vB.displayName=tT;var kR="TooltipPortal",[LX,MX]=Jm(kR,{forceMount:void 0}),bB=t=>{const{__scopeTooltip:e,forceMount:r,children:n,container:a}=t,s=Fd(kR,e);return g.jsx(LX,{scope:e,forceMount:r,children:g.jsx(ca,{present:r||s.open,children:g.jsx(_c,{asChild:!0,container:a,children:n})})})};bB.displayName=kR;var oc="TooltipContent",yB=b.forwardRef((t,e)=>{const r=MX(oc,t.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...s}=t,l=Fd(oc,t.__scopeTooltip);return g.jsx(ca,{present:n||l.open,children:l.disableHoverableContent?g.jsx(EB,{side:a,...s,ref:e}):g.jsx(PX,{side:a,...s,ref:e})})}),PX=b.forwardRef((t,e)=>{const r=Fd(oc,t.__scopeTooltip),n=NR(oc,t.__scopeTooltip),a=b.useRef(null),s=Nt(e,a),[l,c]=b.useState(null),{trigger:d,onClose:f}=r,m=a.current,{onPointerInTransitChange:h}=n,v=b.useCallback(()=>{c(null),h(!1)},[h]),y=b.useCallback((w,S)=>{const R=w.currentTarget,x={x:w.clientX,y:w.clientY},_=zX(x,R.getBoundingClientRect()),C=$X(x,_),N=BX(S.getBoundingClientRect()),k=HX([...C,...N]);c(k),h(!0)},[h]);return b.useEffect(()=>()=>v(),[v]),b.useEffect(()=>{if(d&&m){const w=R=>y(R,m),S=R=>y(R,d);return d.addEventListener("pointerleave",w),m.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",w),m.removeEventListener("pointerleave",S)}}},[d,m,y,v]),b.useEffect(()=>{if(l){const w=S=>{const R=S.target,x={x:S.clientX,y:S.clientY},_=d?.contains(R)||m?.contains(R),C=!qX(x,l);_?v():C&&(v(),f())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,m,l,f,v]),g.jsx(EB,{...t,ref:s})}),[jX,UX]=Jm(fd,{isInside:!1}),FX=$K("TooltipContent"),EB=b.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,d=Fd(oc,r),f=eh(r),{onClose:m}=d;return b.useEffect(()=>(document.addEventListener(eT,m),()=>document.removeEventListener(eT,m)),[m]),b.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,m]),g.jsx(Sc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:g.jsxs(Xm,{"data-state":d.stateAttribute,...f,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(FX,{children:n}),g.jsx(jX,{scope:r,isInside:!0,children:g.jsx(kX,{id:d.contentId,role:"tooltip",children:a||n})})]})})});yB.displayName=oc;var SB="TooltipArrow",xB=b.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,a=eh(r);return UX(SB,r).isInside?null:g.jsx(Qm,{...a,...n,ref:e})});xB.displayName=SB;function zX(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),a=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(r,n,a,s)){case s:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function $X(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function BX(t){const{top:e,right:r,bottom:n,left:a}=t;return[{x:a,y:e},{x:r,y:e},{x:r,y:n},{x:a,y:n}]}function qX(t,e){const{x:r,y:n}=t;let a=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const c=e[s],d=e[l],f=c.x,m=c.y,h=d.x,v=d.y;m>n!=v>n&&r<(h-f)*(n-m)/(v-m)+f&&(a=!a)}return a}function HX(t){const e=t.slice();return e.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),VX(e)}function VX(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n<t.length;n++){const a=t[n];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(a.y-l.y)>=(s.y-l.y)*(a.x-l.x))e.pop();else break}e.push(a)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const a=t[n];for(;r.length>=2;){const s=r[r.length-1],l=r[r.length-2];if((s.x-l.x)*(a.y-l.y)>=(s.y-l.y)*(a.x-l.x))r.pop();else break}r.push(a)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var GX=hB,WX=gB,YX=vB,KX=bB,ZX=yB,XX=xB;function wB({delayDuration:t=0,...e}){return g.jsx(GX,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function jr({...t}){return g.jsx(wB,{children:g.jsx(WX,{"data-slot":"tooltip",...t})})}function Ur({...t}){return g.jsx(YX,{"data-slot":"tooltip-trigger",...t})}function Fr({className:t,sideOffset:e=0,children:r,...n}){return g.jsx(KX,{children:g.jsxs(ZX,{"data-slot":"tooltip-content",sideOffset:e,className:De("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...n,children:[r,g.jsx(XX,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}class QX{name="mcp_inspector_open";properties;constructor(e){this.properties={server_url:e.serverUrl,connection_count:e.connectionCount}}}class UO{name="mcp_tool_execution";properties;constructor(e){this.properties={tool_name:e.toolName,server_id:e.serverId,success:e.success,duration:e.duration,error:e.error}}}class FO{name="mcp_resource_read";properties;constructor(e){this.properties={resource_uri:e.resourceUri,server_id:e.serverId,success:e.success,error:e.error}}}class zO{name="mcp_prompt_call";properties;constructor(e){this.properties={prompt_name:e.promptName,server_id:e.serverId,success:e.success,error:e.error}}}class $O{name="mcp_chat_message";properties;constructor(e){this.properties={server_id:e.serverId,provider:e.provider,model:e.model,message_count:e.messageCount,tool_calls_count:e.toolCallsCount,success:e.success,execution_mode:e.executionMode,duration:e.duration,error:e.error}}}class JX{name="mcp_server_added";properties;constructor(e){this.properties={server_id:e.serverId,server_url:e.serverUrl,connection_type:e.connectionType,via_proxy:e.viaProxy}}}class eQ{name="mcp_server_removed";properties;constructor(e){this.properties={server_id:e.serverId}}}class tQ{name="mcp_command_palette_open";properties;constructor(e){this.properties={trigger:e.trigger}}}class rQ{name="mcp_tool_saved";properties;constructor(e){this.properties={tool_name:e.toolName,server_id:e.serverId}}}function Vb(){try{return"0.5.3-canary.8"}catch{return"0.0.0"}}var nQ={};function Gb(){try{return typeof window<"u"&&typeof document<"u"}catch{return!1}}class BO{endpoint;timeout;constructor(e,r=3e3){this.endpoint=e,this.timeout=r}async logEvent(e){try{const r=new AbortController,n=setTimeout(()=>r.abort(),this.timeout),a=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:r.signal});if(clearTimeout(n),!a.ok)throw new Error(`HTTP error! status: ${a.status}`)}catch{}}}function di(t){return`mcp_inspector_telemetry_${t}`}class zr{static instance=null;POSTHOG_PROXY_URL="/inspector/api/tel/posthog";SCARF_PROXY_URL="/inspector/api/tel/scarf";UNKNOWN_USER_ID="UNKNOWN_USER_ID";_currUserId=null;_posthogClient=null;_scarfClient=null;_source="inspector";constructor(){const e=Gb(),r=this.isTelemetryDisabled();if(this._source=this.getStoredSource()||"inspector",r)this._posthogClient=null,this._scarfClient=null;else if(!e)this._posthogClient=null,this._scarfClient=null;else{try{this._posthogClient=new BO(this.POSTHOG_PROXY_URL,3e3)}catch{this._posthogClient=null}try{this._scarfClient=new BO(this.SCARF_PROXY_URL,3e3)}catch{this._scarfClient=null}}}isTelemetryDisabled(){return typeof localStorage<"u"&&localStorage.getItem(di("disabled"))==="true"||typeof process<"u"&&nQ?.MCP_USE_ANONYMIZED_TELEMETRY==="false"}getStoredSource(){return typeof localStorage<"u"?localStorage.getItem(di("source")):null}static getInstance(){return zr.instance||(zr.instance=new zr),zr.instance}setSource(e){this._source=e,typeof localStorage<"u"&&localStorage.setItem(di("source"),e)}getSource(){return this._source}get userId(){if(this._currUserId)return this._currUserId;if(!Gb())return this._currUserId=this.UNKNOWN_USER_ID,this._currUserId;try{const e=localStorage.getItem(di("user_id"));if(e)this._currUserId=e;else{const r=this.generateUserId();localStorage.setItem(di("user_id"),r),this._currUserId=r}this.trackPackageDownload({triggered_by:"user_id_property"}).catch(()=>{})}catch{this._currUserId=this.UNKNOWN_USER_ID}return this._currUserId}generateUserId(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const r=Math.random()*16|0;return(e==="x"?r:r&3|8).toString(16)})}async capture(e){if(!(!this._posthogClient&&!this._scarfClient)){if(this._posthogClient)try{const r={event:e.name,user_id:this.userId,properties:{...e.properties,mcp_use_version:Vb(),language:"typescript",source:this._source,package:"inspector"}};await this._posthogClient.logEvent(r)}catch{}if(this._scarfClient)try{const r={};r.mcp_use_version=Vb(),r.user_id=this.userId,r.event=e.name,r.language="typescript",r.source=this._source,r.package="inspector",await this._scarfClient.logEvent(r)}catch{}}}async trackPackageDownload(e){if(this._scarfClient&&Gb())try{const r=Vb();let n=!1,a=!1;const s=localStorage.getItem(di("download_version"));if(s?r>s&&(n=!0,a=!1,localStorage.setItem(di("download_version"),r)):(n=!0,a=!0,localStorage.setItem(di("download_version"),r)),n){const l={...e||{}};l.mcp_use_version=r,l.user_id=this.userId,l.event="package_download",l.first_download=a,l.language="typescript",l.source=this._source,l.package="inspector",await this._scarfClient.logEvent(l)}}catch{}}async trackInspectorOpen(e){const r=new QX(e);await this.capture(r)}}const _B=b.createContext(void 0);function aQ({url:t,name:e,proxyConfig:r,transportType:n,onUpdate:a,onRemove:s}){const l=typeof window<"u"?new URL("/inspector/oauth/callback",window.location.origin).toString():"/inspector/oauth/callback";let c=t,d={};if(r?.proxyAddress){const v=new URL(r.proxyAddress),y=new URL(t);c=`${v.origin}${v.pathname}${y.pathname}${y.search}`,d["X-Target-URL"]=t}r?.customHeaders&&(d={...d,...r.customHeaders});const f=fR({url:c,callbackUrl:l,customHeaders:Object.keys(d).length>0?d:void 0,transportType:n||"http"}),m=b.useRef(a),h=b.useRef(null);return b.useEffect(()=>{m.current=a},[a]),b.useEffect(()=>{if(typeof queueMicrotask<"u")queueMicrotask(()=>{f.state==="ready"&&f.serverInfo&&console.log("[McpContext] Server info available:",f.serverInfo);const v={id:t,url:t,name:f.serverInfo?.name||e,state:f.state,tools:f.tools,resources:f.resources,prompts:f.prompts,error:f.error??null,authUrl:f.authUrl??null,customHeaders:d,transportType:n,proxyConfig:r,serverInfo:f.serverInfo,capabilities:f.capabilities,callTool:f.callTool,readResource:f.readResource,listPrompts:f.listPrompts,getPrompt:f.getPrompt,authenticate:f.authenticate,retry:f.retry,clearStorage:f.clearStorage,client:f.client},y=h.current;(!y||y.state!==v.state||y.error!==v.error||y.authUrl!==v.authUrl||y.name!==v.name||y.tools.length!==v.tools.length||y.resources.length!==v.resources.length||y.prompts.length!==v.prompts.length||y.serverInfo!==v.serverInfo||y.capabilities!==v.capabilities||!y.client)&&(h.current=v,m.current(v))});else{const v={id:t,url:t,name:f.serverInfo?.name||e,state:f.state,tools:f.tools,resources:f.resources,prompts:f.prompts,error:f.error??null,authUrl:f.authUrl??null,customHeaders:d,transportType:n,proxyConfig:r,serverInfo:f.serverInfo,capabilities:f.capabilities,callTool:f.callTool,readResource:f.readResource,listPrompts:f.listPrompts,getPrompt:f.getPrompt,authenticate:f.authenticate,retry:f.retry,clearStorage:f.clearStorage,client:f.client},y=h.current;(!y||y.state!==v.state||y.error!==v.error||y.authUrl!==v.authUrl||y.name!==v.name||y.tools.length!==v.tools.length||y.resources.length!==v.resources.length||y.prompts.length!==v.prompts.length||y.serverInfo!==v.serverInfo||y.capabilities!==v.capabilities||!y.client)&&(h.current=v,m.current(v))}},[t,e,n,r,f.state,f.tools,f.resources,f.prompts,f.error,f.authUrl,f.serverInfo,f.capabilities,f.client]),null}function oQ({children:t}){const[e,r]=b.useState([]),[n,a]=b.useState(new Map),[s,l]=b.useState(0),[c,d]=b.useState(!0),[f,m]=b.useState(new Set);b.useEffect(()=>{const k=localStorage.getItem("mcp-inspector-connections");if(k)try{const I=JSON.parse(k),O=Array.isArray(I)?I.filter(M=>M&&typeof M=="object"&&typeof M.id=="string"&&typeof M.url=="string"&&typeof M.name=="string").map(M=>(M.transportType||(M.transportType="http"),M)):[];(O.length!==I.length||O.some(M=>M.transportType==="http"&&!I.find(P=>P.id===M.id&&P.transportType)))&&(console.warn("Updated connections in localStorage with transport type migration"),localStorage.setItem("mcp-inspector-connections",JSON.stringify(O))),r(O)}catch(I){console.error("Failed to parse saved connections:",I),localStorage.removeItem("mcp-inspector-connections")}const A=localStorage.getItem("mcp-inspector-auto-connect");A!==null&&d(A==="true")},[]);const h=b.useCallback(k=>{a(A=>new Map(A).set(k.id,k)),l(A=>A+1),k.serverInfo?.name&&k.state==="ready"&&r(A=>{const I=A.find(O=>O.id===k.id);if(I&&I.name!==k.serverInfo.name){const O=A.map(L=>L.id===k.id?{...L,name:k.serverInfo.name}:L);return localStorage.setItem("mcp-inspector-connections",JSON.stringify(O)),O}return A})},[]),v=b.useCallback((k,A,I,O)=>{const M={id:k,url:k,name:A||k,proxyConfig:I,transportType:O||"http"};r(P=>{if(P.some(X=>X.id===k))return P;const W=[...P,M];return localStorage.setItem("mcp-inspector-connections",JSON.stringify(W)),W})},[]),y=b.useCallback(k=>{zr.getInstance().capture(new eQ({serverId:k})).catch(()=>{}),r(I=>{const O=I.filter(L=>L.id!==k);return localStorage.setItem("mcp-inspector-connections",JSON.stringify(O)),O}),a(I=>{const O=new Map(I),L=O.get(k);if(L){try{L.clearStorage()}catch(M){console.error("Failed to clear storage:",M)}O.delete(k)}return O})},[]),w=b.useCallback(k=>{const A=n.get(k);if(A)return A;const I=e.find(O=>O.id===k);if(I)return{id:I.id,url:I.url,name:I.name,state:"disconnected",tools:[],resources:[],prompts:[],error:null,authUrl:null,transportType:I.transportType,proxyConfig:I.proxyConfig,listPrompts:async O=>{throw new Error("Not connected")},getPrompt:async()=>{throw new Error("Not connected")},callTool:async()=>{throw new Error("Not connected")},readResource:async()=>{throw new Error("Not connected")},authenticate:()=>{},retry:()=>{},clearStorage:()=>{},client:null}},[n,e]),S=b.useCallback(k=>{d(k),localStorage.setItem("mcp-inspector-auto-connect",String(k)),k||m(new Set)},[]),R=b.useCallback(k=>{m(A=>new Set(A).add(k))},[]),x=b.useCallback(k=>{m(A=>{const I=new Set(A);return I.delete(k),I}),a(A=>{const I=new Map(A),O=I.get(k);if(O){try{O.clearStorage()}catch(L){console.error("Failed to clear storage:",L)}I.delete(k)}return I})},[]),_=b.useCallback((k,A)=>{r(I=>{const O=I.map(L=>L.id===k?{...L,name:A.name||L.name,proxyConfig:A.proxyConfig,transportType:A.transportType||L.transportType}:L);return localStorage.setItem("mcp-inspector-connections",JSON.stringify(O)),O})},[]),C=b.useMemo(()=>e.map(A=>{const I=n.get(A.id);return I||{id:A.id,url:A.url,name:A.name,state:"disconnected",tools:[],resources:[],prompts:[],error:null,authUrl:null,transportType:A.transportType,proxyConfig:A.proxyConfig,callTool:async()=>{throw new Error("Not connected")},readResource:async()=>{throw new Error("Not connected")},listPrompts:async O=>{throw new Error("Not connected")},getPrompt:async()=>{throw new Error("Not connected")},authenticate:()=>{},retry:()=>{},clearStorage:()=>{},client:null}}),[n,e,s]),N=b.useMemo(()=>({connections:C,addConnection:v,removeConnection:y,getConnection:w,autoConnect:c,setAutoConnect:S,connectServer:R,disconnectServer:x,updateConnectionConfig:_}),[C,v,y,w,c,S,R,x,_]);return g.jsxs(_B,{value:N,children:[e.filter(k=>c||f.has(k.id)).map(k=>g.jsx(aQ,{url:k.url,name:k.name,proxyConfig:k.proxyConfig,transportType:k.transportType,onUpdate:h,onRemove:()=>y(k.id)},`${k.id}-${k.transportType||"http"}-${k.proxyConfig?.proxyAddress||""}`)),t]})}function IR(){const t=b.use(_B);if(!t)throw new Error("useMcpContext must be used within McpProvider");return t}const iQ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sQ=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),qO=t=>{const e=sQ(t);return e.charAt(0).toUpperCase()+e.slice(1)},TB=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim(),lQ=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var cQ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const uQ=b.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:s,iconNode:l,...c},d)=>b.createElement("svg",{ref:d,...cQ,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:TB("lucide",a),...!s&&!lQ(c)&&{"aria-hidden":"true"},...c},[...l.map(([f,m])=>b.createElement(f,m)),...Array.isArray(s)?s:[s]]));const ct=(t,e)=>{const r=b.forwardRef(({className:n,...a},s)=>b.createElement(uQ,{ref:s,iconNode:e,className:TB(`lucide-${iQ(qO(t))}`,`lucide-${t}`,n),...a}));return r.displayName=qO(t),r};const dQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],fQ=ct("arrow-up",dQ);const pQ=[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]],mQ=ct("brush",pQ);const hQ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Do=ct("check",hQ);const gQ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],RB=ct("chevron-down",gQ);const vQ=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],bQ=ct("chevron-up",vQ);const yQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],EQ=ct("circle-minus",yQ);const SQ=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ic=ct("clock",SQ);const xQ=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],wQ=ct("code",xQ);const _Q=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],TQ=ct("cog",_Q);const RQ=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],CQ=ct("command",RQ);const AQ=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],aa=ct("copy",AQ);const NQ=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],th=ct("database",NQ);const kQ=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],CB=ct("download",kQ);const IQ=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],HO=ct("external-link",IQ);const OQ=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],DQ=ct("eye-off",OQ);const LQ=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],VO=ct("eye",LQ);const MQ=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],PQ=ct("file-code",MQ);const jQ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],UQ=ct("file-image",jQ);const FQ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],OR=ct("file-text",FQ);const zQ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],$Q=ct("file",zQ);const BQ=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],qQ=ct("folder-open",BQ);const HQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],VQ=ct("globe",HQ);const GQ=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],WQ=ct("grip-vertical",GQ);const YQ=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],AB=ct("history",YQ);const KQ=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],NB=ct("key",KQ);const ZQ=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zd=ct("loader-circle",ZQ);const XQ=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],QQ=ct("maximize",XQ);const JQ=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],eJ=ct("message-circle",JQ);const tJ=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],pd=ct("message-square",tJ);const rJ=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],GO=ct("monitor",rJ);const nJ=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],aJ=ct("moon",nJ);const oJ=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],kB=ct("play",oJ);const iJ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],IB=ct("plus",iJ);const sJ=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],lJ=ct("rotate-ccw",sJ);const cJ=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],DR=ct("save",cJ);const uJ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],LR=ct("search",uJ);const dJ=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],fJ=ct("send",dJ);const pJ=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],wm=ct("settings",pJ);const mJ=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],hJ=ct("shield",mJ);const gJ=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 4h.01",key:"1ujb9j"}],["path",{d:"M20 12h.01",key:"1ykeid"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M4 12h.01",key:"158zrr"}],["path",{d:"M17.657 6.343h.01",key:"31pqzk"}],["path",{d:"M17.657 17.657h.01",key:"jehnf4"}],["path",{d:"M6.343 17.657h.01",key:"gdk6ow"}],["path",{d:"M6.343 6.343h.01",key:"1uurf0"}]],vJ=ct("sun-dim",gJ);const bJ=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Wb=ct("terminal",bJ);const yJ=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],rT=ct("trash-2",yJ);const EJ=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],SJ=ct("trash",EJ);const xJ=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],ws=ct("wrench",xJ);const wJ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$d=ct("x",wJ);const _J=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],md=ct("zap",_J);function TJ(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const RJ=t=>{switch(t){case"success":return NJ;case"info":return IJ;case"warning":return kJ;case"error":return OJ;default:return null}},CJ=Array(12).fill(0),AJ=({visible:t,className:e})=>le.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},le.createElement("div",{className:"sonner-spinner"},CJ.map((r,n)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),NJ=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),kJ=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),IJ=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),OJ=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),DJ=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),LJ=()=>{const[t,e]=le.useState(document.hidden);return le.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let nT=1;class MJ{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:n,...a}=e,s=typeof e?.id=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:nT++,l=this.toasts.find(d=>d.id===s),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),l?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:c,title:n}):d):this.addToast({title:n,...a,dismissible:c,id:s}),s},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const a=Promise.resolve(e instanceof Function?e():e);let s=n!==void 0,l;const c=a.then(async f=>{if(l=["resolve",f],le.isValidElement(f))s=!1,this.create({id:n,type:"default",message:f});else if(jJ(f)&&!f.ok){s=!1;const h=typeof r.error=="function"?await r.error(`HTTP error! status: ${f.status}`):r.error,v=typeof r.description=="function"?await r.description(`HTTP error! status: ${f.status}`):r.description,w=typeof h=="object"&&!le.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:v,...w})}else if(f instanceof Error){s=!1;const h=typeof r.error=="function"?await r.error(f):r.error,v=typeof r.description=="function"?await r.description(f):r.description,w=typeof h=="object"&&!le.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:v,...w})}else if(r.success!==void 0){s=!1;const h=typeof r.success=="function"?await r.success(f):r.success,v=typeof r.description=="function"?await r.description(f):r.description,w=typeof h=="object"&&!le.isValidElement(h)?h:{message:h};this.create({id:n,type:"success",description:v,...w})}}).catch(async f=>{if(l=["reject",f],r.error!==void 0){s=!1;const m=typeof r.error=="function"?await r.error(f):r.error,h=typeof r.description=="function"?await r.description(f):r.description,y=typeof m=="object"&&!le.isValidElement(m)?m:{message:m};this.create({id:n,type:"error",description:h,...y})}}).finally(()=>{s&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),d=()=>new Promise((f,m)=>c.then(()=>l[0]==="reject"?m(l[1]):f(l[1])).catch(m));return typeof n!="string"&&typeof n!="number"?{unwrap:d}:Object.assign(n,{unwrap:d})},this.custom=(e,r)=>{const n=r?.id||nT++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Sn=new MJ,PJ=(t,e)=>{const r=e?.id||nT++;return Sn.addToast({title:t,...e,id:r}),r},jJ=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",UJ=PJ,FJ=()=>Sn.toasts,zJ=()=>Sn.getActiveToasts(),cr=Object.assign(UJ,{success:Sn.success,info:Sn.info,warning:Sn.warning,error:Sn.error,custom:Sn.custom,message:Sn.message,promise:Sn.promise,dismiss:Sn.dismiss,loading:Sn.loading},{getHistory:FJ,getToasts:zJ});TJ("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ep(t){return t.label!==void 0}const $J=3,BJ="24px",qJ="16px",WO=4e3,HJ=356,VJ=14,GJ=45,WJ=200;function ka(...t){return t.filter(Boolean).join(" ")}function YJ(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const KJ=t=>{var e,r,n,a,s,l,c,d,f;const{invert:m,toast:h,unstyled:v,interacting:y,setHeights:w,visibleToasts:S,heights:R,index:x,toasts:_,expanded:C,removeToast:N,defaultRichColors:k,closeButton:A,style:I,cancelButtonStyle:O,actionButtonStyle:L,className:M="",descriptionClassName:P="",duration:W,position:X,gap:ee,expandByDefault:J,classNames:j,icons:G,closeButtonAriaLabel:V="Close toast"}=t,[te,re]=le.useState(null),[U,q]=le.useState(null),[$,Y]=le.useState(!1),[Q,F]=le.useState(!1),[z,K]=le.useState(!1),[ae,H]=le.useState(!1),[de,me]=le.useState(!1),[xe,be]=le.useState(0),[_e,Ae]=le.useState(0),Fe=le.useRef(h.duration||W||WO),Pe=le.useRef(null),$e=le.useRef(null),at=x===0,ce=x+1<=S,Ce=h.type,ze=h.dismissible!==!1,we=h.className||"",Ne=h.descriptionClassName||"",Oe=le.useMemo(()=>R.findIndex(Qe=>Qe.toastId===h.id)||0,[R,h.id]),Je=le.useMemo(()=>{var Qe;return(Qe=h.closeButton)!=null?Qe:A},[h.closeButton,A]),ot=le.useMemo(()=>h.duration||W||WO,[h.duration,W]),Rt=le.useRef(0),Ot=le.useRef(0),Cn=le.useRef(0),vr=le.useRef(null),[or,Mt]=X.split("-"),Zt=le.useMemo(()=>R.reduce((Qe,jt,Qt)=>Qt>=Oe?Qe:Qe+jt.height,0),[R,Oe]),fr=LJ(),Sr=h.invert||m,zn=Ce==="loading";Ot.current=le.useMemo(()=>Oe*ee+Zt,[Oe,Zt]),le.useEffect(()=>{Fe.current=ot},[ot]),le.useEffect(()=>{Y(!0)},[]),le.useEffect(()=>{const Qe=$e.current;if(Qe){const jt=Qe.getBoundingClientRect().height;return Ae(jt),w(Qt=>[{toastId:h.id,height:jt,position:h.position},...Qt]),()=>w(Qt=>Qt.filter(Lr=>Lr.toastId!==h.id))}},[w,h.id]),le.useLayoutEffect(()=>{if(!$)return;const Qe=$e.current,jt=Qe.style.height;Qe.style.height="auto";const Qt=Qe.getBoundingClientRect().height;Qe.style.height=jt,Ae(Qt),w(Lr=>Lr.find(Xt=>Xt.toastId===h.id)?Lr.map(Xt=>Xt.toastId===h.id?{...Xt,height:Qt}:Xt):[{toastId:h.id,height:Qt,position:h.position},...Lr])},[$,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const ir=le.useCallback(()=>{F(!0),be(Ot.current),w(Qe=>Qe.filter(jt=>jt.toastId!==h.id)),setTimeout(()=>{N(h)},WJ)},[h,N,w,Ot]);le.useEffect(()=>{if(h.promise&&Ce==="loading"||h.duration===1/0||h.type==="loading")return;let Qe;return C||y||fr?(()=>{if(Cn.current<Rt.current){const Lr=new Date().getTime()-Rt.current;Fe.current=Fe.current-Lr}Cn.current=new Date().getTime()})():(()=>{Fe.current!==1/0&&(Rt.current=new Date().getTime(),Qe=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),ir()},Fe.current))})(),()=>clearTimeout(Qe)},[C,y,h,Ce,fr,ir]),le.useEffect(()=>{h.delete&&(ir(),h.onDismiss==null||h.onDismiss.call(h,h))},[ir,h.delete]);function Gt(){var Qe;if(G?.loading){var jt;return le.createElement("div",{className:ka(j?.loader,h==null||(jt=h.classNames)==null?void 0:jt.loader,"sonner-loader"),"data-visible":Ce==="loading"},G.loading)}return le.createElement(AJ,{className:ka(j?.loader,h==null||(Qe=h.classNames)==null?void 0:Qe.loader),visible:Ce==="loading"})}const pn=h.icon||G?.[Ce]||RJ(Ce);var ua,an;return le.createElement("li",{tabIndex:0,ref:$e,className:ka(M,we,j?.toast,h==null||(e=h.classNames)==null?void 0:e.toast,j?.default,j?.[Ce],h==null||(r=h.classNames)==null?void 0:r[Ce]),"data-sonner-toast":"","data-rich-colors":(ua=h.richColors)!=null?ua:k,"data-styled":!(h.jsx||h.unstyled||v),"data-mounted":$,"data-promise":!!h.promise,"data-swiped":de,"data-removed":Q,"data-visible":ce,"data-y-position":or,"data-x-position":Mt,"data-index":x,"data-front":at,"data-swiping":z,"data-dismissible":ze,"data-type":Ce,"data-invert":Sr,"data-swipe-out":ae,"data-swipe-direction":U,"data-expanded":!!(C||J&&$),"data-testid":h.testId,style:{"--index":x,"--toasts-before":x,"--z-index":_.length-x,"--offset":`${Q?xe:Ot.current}px`,"--initial-height":J?"auto":`${_e}px`,...I,...h.style},onDragEnd:()=>{K(!1),re(null),vr.current=null},onPointerDown:Qe=>{Qe.button!==2&&(zn||!ze||(Pe.current=new Date,be(Ot.current),Qe.target.setPointerCapture(Qe.pointerId),Qe.target.tagName!=="BUTTON"&&(K(!0),vr.current={x:Qe.clientX,y:Qe.clientY})))},onPointerUp:()=>{var Qe,jt,Qt;if(ae||!ze)return;vr.current=null;const Lr=Number(((Qe=$e.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$n=Number(((jt=$e.current)==null?void 0:jt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xt=new Date().getTime()-((Qt=Pe.current)==null?void 0:Qt.getTime()),Jr=te==="x"?Lr:$n,_a=Math.abs(Jr)/Xt;if(Math.abs(Jr)>=GJ||_a>.11){be(Ot.current),h.onDismiss==null||h.onDismiss.call(h,h),q(te==="x"?Lr>0?"right":"left":$n>0?"down":"up"),ir(),H(!0);return}else{var en,Br;(en=$e.current)==null||en.style.setProperty("--swipe-amount-x","0px"),(Br=$e.current)==null||Br.style.setProperty("--swipe-amount-y","0px")}me(!1),K(!1),re(null)},onPointerMove:Qe=>{var jt,Qt,Lr;if(!vr.current||!ze||((jt=window.getSelection())==null?void 0:jt.toString().length)>0)return;const Xt=Qe.clientY-vr.current.y,Jr=Qe.clientX-vr.current.x;var _a;const en=(_a=t.swipeDirections)!=null?_a:YJ(X);!te&&(Math.abs(Jr)>1||Math.abs(Xt)>1)&&re(Math.abs(Jr)>Math.abs(Xt)?"x":"y");let Br={x:0,y:0};const oe=Z=>1/(1.5+Math.abs(Z)/20);if(te==="y"){if(en.includes("top")||en.includes("bottom"))if(en.includes("top")&&Xt<0||en.includes("bottom")&&Xt>0)Br.y=Xt;else{const Z=Xt*oe(Xt);Br.y=Math.abs(Z)<Math.abs(Xt)?Z:Xt}}else if(te==="x"&&(en.includes("left")||en.includes("right")))if(en.includes("left")&&Jr<0||en.includes("right")&&Jr>0)Br.x=Jr;else{const Z=Jr*oe(Jr);Br.x=Math.abs(Z)<Math.abs(Jr)?Z:Jr}(Math.abs(Br.x)>0||Math.abs(Br.y)>0)&&me(!0),(Qt=$e.current)==null||Qt.style.setProperty("--swipe-amount-x",`${Br.x}px`),(Lr=$e.current)==null||Lr.style.setProperty("--swipe-amount-y",`${Br.y}px`)}},Je&&!h.jsx&&Ce!=="loading"?le.createElement("button",{"aria-label":V,"data-disabled":zn,"data-close-button":!0,onClick:zn||!ze?()=>{}:()=>{ir(),h.onDismiss==null||h.onDismiss.call(h,h)},className:ka(j?.closeButton,h==null||(n=h.classNames)==null?void 0:n.closeButton)},(an=G?.close)!=null?an:DJ):null,(Ce||h.icon||h.promise)&&h.icon!==null&&(G?.[Ce]!==null||h.icon)?le.createElement("div",{"data-icon":"",className:ka(j?.icon,h==null||(a=h.classNames)==null?void 0:a.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Gt():null,h.type!=="loading"?pn:null):null,le.createElement("div",{"data-content":"",className:ka(j?.content,h==null||(s=h.classNames)==null?void 0:s.content)},le.createElement("div",{"data-title":"",className:ka(j?.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?le.createElement("div",{"data-description":"",className:ka(P,Ne,j?.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),le.isValidElement(h.cancel)?h.cancel:h.cancel&&Ep(h.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||O,onClick:Qe=>{Ep(h.cancel)&&ze&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Qe),ir())},className:ka(j?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,le.isValidElement(h.action)?h.action:h.action&&Ep(h.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:Qe=>{Ep(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Qe),!Qe.defaultPrevented&&ir())},className:ka(j?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function YO(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function ZJ(t,e){const r={};return[t,e].forEach((n,a)=>{const s=a===1,l=s?"--mobile-offset":"--offset",c=s?qJ:BJ;function d(f){["top","right","bottom","left"].forEach(m=>{r[`${l}-${m}`]=typeof f=="number"?`${f}px`:f})}typeof n=="number"||typeof n=="string"?d(n):typeof n=="object"?["top","right","bottom","left"].forEach(f=>{n[f]===void 0?r[`${l}-${f}`]=c:r[`${l}-${f}`]=typeof n[f]=="number"?`${n[f]}px`:n[f]}):d(c)}),r}const XJ=le.forwardRef(function(e,r){const{id:n,invert:a,position:s="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:m,mobileOffset:h,theme:v="light",richColors:y,duration:w,style:S,visibleToasts:R=$J,toastOptions:x,dir:_=YO(),gap:C=VJ,icons:N,containerAriaLabel:k="Notifications"}=e,[A,I]=le.useState([]),O=le.useMemo(()=>n?A.filter($=>$.toasterId===n):A.filter($=>!$.toasterId),[A,n]),L=le.useMemo(()=>Array.from(new Set([s].concat(O.filter($=>$.position).map($=>$.position)))),[O,s]),[M,P]=le.useState([]),[W,X]=le.useState(!1),[ee,J]=le.useState(!1),[j,G]=le.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=le.useRef(null),te=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),re=le.useRef(null),U=le.useRef(!1),q=le.useCallback($=>{I(Y=>{var Q;return(Q=Y.find(F=>F.id===$.id))!=null&&Q.delete||Sn.dismiss($.id),Y.filter(({id:F})=>F!==$.id)})},[]);return le.useEffect(()=>Sn.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{I(Y=>Y.map(Q=>Q.id===$.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{f$.flushSync(()=>{I(Y=>{const Q=Y.findIndex(F=>F.id===$.id);return Q!==-1?[...Y.slice(0,Q),{...Y[Q],...$},...Y.slice(Q+1)]:[$,...Y]})})})}),[A]),le.useEffect(()=>{if(v!=="system"){G(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:Y})=>{G(Y?"dark":"light")})}catch{$.addListener(({matches:Q})=>{try{G(Q?"dark":"light")}catch(F){console.error(F)}})}},[v]),le.useEffect(()=>{A.length<=1&&X(!1)},[A]),le.useEffect(()=>{const $=Y=>{var Q;if(l.every(K=>Y[K]||Y.code===K)){var z;X(!0),(z=V.current)==null||z.focus()}Y.code==="Escape"&&(document.activeElement===V.current||(Q=V.current)!=null&&Q.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[l]),le.useEffect(()=>{if(V.current)return()=>{re.current&&(re.current.focus({preventScroll:!0}),re.current=null,U.current=!1)}},[V.current]),le.createElement("section",{ref:r,"aria-label":`${k} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map(($,Y)=>{var Q;const[F,z]=$.split("-");return O.length?le.createElement("ol",{key:$,dir:_==="auto"?YO():_,tabIndex:-1,ref:V,className:f,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":F,"data-x-position":z,style:{"--front-toast-height":`${((Q=M[0])==null?void 0:Q.height)||0}px`,"--width":`${HJ}px`,"--gap":`${C}px`,...S,...ZJ(m,h)},onBlur:K=>{U.current&&!K.currentTarget.contains(K.relatedTarget)&&(U.current=!1,re.current&&(re.current.focus({preventScroll:!0}),re.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||U.current||(U.current=!0,re.current=K.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{ee||X(!1)},onDragEnd:()=>X(!1),onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||J(!0)},onPointerUp:()=>J(!1)},O.filter(K=>!K.position&&Y===0||K.position===$).map((K,ae)=>{var H,de;return le.createElement(KJ,{key:K.id,icons:N,index:ae,toast:K,defaultRichColors:y,duration:(H=x?.duration)!=null?H:w,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:a,visibleToasts:R,closeButton:(de=x?.closeButton)!=null?de:d,interacting:ee,position:$,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:q,toasts:O.filter(me=>me.position==K.position),heights:M.filter(me=>me.position==K.position),setHeights:P,expandByDefault:c,gap:C,expanded:W,swipeDirections:e.swipeDirections})})):null}))});var Yb="focusScope.autoFocusOnMount",Kb="focusScope.autoFocusOnUnmount",KO={bubbles:!1,cancelable:!0},QJ="FocusScope",Bd=b.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=t,[c,d]=b.useState(null),f=Wa(a),m=Wa(s),h=b.useRef(null),v=Nt(e,S=>d(S)),y=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let S=function(C){if(y.paused||!c)return;const N=C.target;c.contains(N)?h.current=N:pi(h.current,{select:!0})},R=function(C){if(y.paused||!c)return;const N=C.relatedTarget;N!==null&&(c.contains(N)||pi(h.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const k of C)k.removedNodes.length>0&&pi(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",R);const _=new MutationObserver(x);return c&&_.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",R),_.disconnect()}}},[n,c,y.paused]),b.useEffect(()=>{if(c){XO.add(y);const S=document.activeElement;if(!c.contains(S)){const x=new CustomEvent(Yb,KO);c.addEventListener(Yb,f),c.dispatchEvent(x),x.defaultPrevented||(JJ(aee(OB(c)),{select:!0}),document.activeElement===S&&pi(c))}return()=>{c.removeEventListener(Yb,f),setTimeout(()=>{const x=new CustomEvent(Kb,KO);c.addEventListener(Kb,m),c.dispatchEvent(x),x.defaultPrevented||pi(S??document.body,{select:!0}),c.removeEventListener(Kb,m),XO.remove(y)},0)}}},[c,f,m,y]);const w=b.useCallback(S=>{if(!r&&!n||y.paused)return;const R=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,x=document.activeElement;if(R&&x){const _=S.currentTarget,[C,N]=eee(_);C&&N?!S.shiftKey&&x===N?(S.preventDefault(),r&&pi(C,{select:!0})):S.shiftKey&&x===C&&(S.preventDefault(),r&&pi(N,{select:!0})):x===_&&S.preventDefault()}},[r,n,y.paused]);return g.jsx(bt.div,{tabIndex:-1,...l,ref:v,onKeyDown:w})});Bd.displayName=QJ;function JJ(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(pi(n,{select:e}),document.activeElement!==r)return}function eee(t){const e=OB(t),r=ZO(e,t),n=ZO(e.reverse(),t);return[r,n]}function OB(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function ZO(t,e){for(const r of t)if(!tee(r,{upTo:e}))return r}function tee(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function ree(t){return t instanceof HTMLInputElement&&"select"in t}function pi(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&ree(t)&&e&&t.select()}}var XO=nee();function nee(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=QO(t,e),t.unshift(e)},remove(e){t=QO(t,e),t[0]?.resume()}}}function QO(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function aee(t){return t.filter(e=>e.tagName!=="A")}var Zb=0;function rh(){b.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??JO()),document.body.insertAdjacentElement("beforeend",t[1]??JO()),Zb++,()=>{Zb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Zb--}},[])}function JO(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Ma=function(){return Ma=Object.assign||function(e){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Ma.apply(this,arguments)};function DB(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]]);return r}function oee(t,e,r){if(r||arguments.length===2)for(var n=0,a=e.length,s;n<a;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}var Bp="right-scroll-bar-position",qp="width-before-scroll-bar",iee="with-scroll-bars-hidden",see="--removed-body-scroll-bar-size";function Xb(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function lee(t,e){var r=b.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=e,r.facade}var cee=typeof window<"u"?b.useLayoutEffect:b.useEffect,eD=new WeakMap;function uee(t,e){var r=lee(null,function(n){return t.forEach(function(a){return Xb(a,n)})});return cee(function(){var n=eD.get(r);if(n){var a=new Set(n),s=new Set(t),l=r.current;a.forEach(function(c){s.has(c)||Xb(c,null)}),s.forEach(function(c){a.has(c)||Xb(c,l)})}eD.set(r,t)},[t]),r}function dee(t){return t}function fee(t,e){e===void 0&&(e=dee);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(s){var l=e(s,n);return r.push(l),function(){r=r.filter(function(c){return c!==l})}},assignSyncMedium:function(s){for(n=!0;r.length;){var l=r;r=[],l.forEach(s)}r={push:function(c){return s(c)},filter:function(){return r}}},assignMedium:function(s){n=!0;var l=[];if(r.length){var c=r;r=[],c.forEach(s),l=r}var d=function(){var m=l;l=[],m.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),r={push:function(m){l.push(m),f()},filter:function(m){return l=l.filter(m),r}}}};return a}function pee(t){t===void 0&&(t={});var e=fee(null);return e.options=Ma({async:!0,ssr:!1},t),e}var LB=function(t){var e=t.sideCar,r=DB(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return b.createElement(n,Ma({},r))};LB.isSideCarExport=!0;function mee(t,e){return t.useMedium(e),LB}var MB=pee(),Qb=function(){},nh=b.forwardRef(function(t,e){var r=b.useRef(null),n=b.useState({onScrollCapture:Qb,onWheelCapture:Qb,onTouchMoveCapture:Qb}),a=n[0],s=n[1],l=t.forwardProps,c=t.children,d=t.className,f=t.removeScrollBar,m=t.enabled,h=t.shards,v=t.sideCar,y=t.noRelative,w=t.noIsolation,S=t.inert,R=t.allowPinchZoom,x=t.as,_=x===void 0?"div":x,C=t.gapMode,N=DB(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=v,A=uee([r,e]),I=Ma(Ma({},N),a);return b.createElement(b.Fragment,null,m&&b.createElement(k,{sideCar:MB,removeScrollBar:f,shards:h,noRelative:y,noIsolation:w,inert:S,setCallbacks:s,allowPinchZoom:!!R,lockRef:r,gapMode:C}),l?b.cloneElement(b.Children.only(c),Ma(Ma({},I),{ref:A})):b.createElement(_,Ma({},I,{className:d,ref:A}),c))});nh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nh.classNames={fullWidth:qp,zeroRight:Bp};var hee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gee(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=hee();return e&&t.setAttribute("nonce",e),t}function vee(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function bee(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var yee=function(){var t=0,e=null;return{add:function(r){t==0&&(e=gee())&&(vee(e,r),bee(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Eee=function(){var t=yee();return function(e,r){b.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},PB=function(){var t=Eee(),e=function(r){var n=r.styles,a=r.dynamic;return t(n,a),null};return e},See={left:0,top:0,right:0,gap:0},Jb=function(t){return parseInt(t||"",10)||0},xee=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],a=e[t==="padding"?"paddingRight":"marginRight"];return[Jb(r),Jb(n),Jb(a)]},wee=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return See;var e=xee(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},_ee=PB(),zl="data-scroll-locked",Tee=function(t,e,r,n){var a=t.left,s=t.top,l=t.right,c=t.gap;return r===void 0&&(r="margin"),`
25
+ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let v=Uo(),y;if(e){let _=typeof e=="string"?hc(e):e;dr(m==="/"||_.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${_.pathname}" was given in the \`location\` prop.`),y=_}else y=v;let w=y.pathname||"/",S=w;if(m!=="/"){let _=m.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(_.length).join("/")}let R=Y2(t,{pathname:S});Ha(h||R!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Ha(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=W7(R&&R.map(_=>Object.assign({},_,{params:Object.assign({},d,_.params),pathname:Co([m,s.encodeLocation?s.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?m:Co([m,s.encodeLocation?s.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),l,r,n,a);return e&&x?b.createElement(Ld.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},x):x}function q7(){let t=Q7(),e=P7(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},s={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:s},"ErrorBoundary")," or"," ",b.createElement("code",{style:s},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},e),r?b.createElement("pre",{style:a},r):null,l)}var H7=b.createElement(q7,null),V7=class extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.unstable_onError?this.props.unstable_onError(t,e):console.error("React Router caught the following error during render",t)}render(){return this.state.error!==void 0?b.createElement(jo.Provider,{value:this.props.routeContext},b.createElement(pR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function G7({routeContext:t,match:e,children:r}){let n=b.useContext(gc);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),b.createElement(jo.Provider,{value:t},r)}function W7(t,e=[],r=null,n=null,a=null){if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let s=t,l=r?.errors;if(l!=null){let f=s.findIndex(m=>m.route.id&&l?.[m.route.id]!==void 0);dr(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,f+1))}let c=!1,d=-1;if(r)for(let f=0;f<s.length;f++){let m=s[f];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=f),m.route.id){let{loaderData:h,errors:v}=r,y=m.route.loader&&!h.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||y){c=!0,d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}return s.reduceRight((f,m,h)=>{let v,y=!1,w=null,S=null;r&&(v=l&&m.route.id?l[m.route.id]:void 0,w=m.route.errorElement||H7,c&&(d<0&&h===0?(a$("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,S=null):d===h&&(y=!0,S=m.route.hydrateFallbackElement||null)));let R=e.concat(s.slice(0,h+1)),x=()=>{let _;return v?_=w:y?_=S:m.route.Component?_=b.createElement(m.route.Component,null):m.route.element?_=m.route.element:_=f,b.createElement(G7,{match:m,routeContext:{outlet:f,matches:R,isDataRoute:r!=null},children:_})};return r&&(m.route.ErrorBoundary||m.route.errorElement||h===0)?b.createElement(V7,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:x(),routeContext:{outlet:null,matches:R,isDataRoute:!0},unstable_onError:n}):x()},null)}function mR(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y7(t){let e=b.useContext(gc);return dr(e,mR(t)),e}function K7(t){let e=b.useContext(qm);return dr(e,mR(t)),e}function Z7(t){let e=b.useContext(jo);return dr(e,mR(t)),e}function hR(t){let e=Z7(t),r=e.matches[e.matches.length-1];return dr(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function X7(){return hR("useRouteId")}function Q7(){let t=b.useContext(pR),e=K7("useRouteError"),r=hR("useRouteError");return t!==void 0?t:e.errors?.[r]}function J7(){let{router:t}=Y7("useNavigate"),e=hR("useNavigate"),r=b.useRef(!1);return r$(()=>{r.current=!0}),b.useCallback(async(a,s={})=>{Ha(r.current,t$),r.current&&(typeof a=="number"?t.navigate(a):await t.navigate(a,{fromRouteId:e,...s}))},[t,e])}var hO={};function a$(t,e,r){!e&&!hO[t]&&(hO[t]=!0,Ha(!1,r))}b.memo(eY);function eY({routes:t,future:e,state:r,unstable_onError:n}){return n$(t,void 0,r,n,e)}function o$(t){dr(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function tY({basename:t="/",children:e=null,location:r,navigationType:n="POP",navigator:a,static:s=!1}){dr(!Md(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),c=b.useMemo(()=>({basename:l,navigator:a,static:s,future:{}}),[l,a,s]);typeof r=="string"&&(r=hc(r));let{pathname:d="/",search:f="",hash:m="",state:h=null,key:v="default"}=r,y=b.useMemo(()=>{let w=ko(d,l);return w==null?null:{location:{pathname:w,search:f,hash:m,state:h,key:v},navigationType:n}},[l,d,f,m,h,v,n]);return Ha(y!=null,`<Router basename="${l}"> is not able to match the URL "${d}${f}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:b.createElement(Za.Provider,{value:c},b.createElement(Ld.Provider,{children:e,value:y}))}function rY({children:t,location:e}){return B7(Y_(t),e)}function Y_(t,e=[]){let r=[];return b.Children.forEach(t,(n,a)=>{if(!b.isValidElement(n))return;let s=[...e,a];if(n.type===b.Fragment){r.push.apply(r,Y_(n.props.children,s));return}dr(n.type===o$,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),dr(!n.props.index||!n.props.children,"An index route cannot have child routes.");let l={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(l.children=Y_(n.props.children,s)),r.push(l)}),r}var Fp="get",zp="application/x-www-form-urlencoded";function Hm(t){return t!=null&&typeof t.tagName=="string"}function nY(t){return Hm(t)&&t.tagName.toLowerCase()==="button"}function aY(t){return Hm(t)&&t.tagName.toLowerCase()==="form"}function oY(t){return Hm(t)&&t.tagName.toLowerCase()==="input"}function iY(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function sY(t,e){return t.button===0&&(!e||e==="_self")&&!iY(t)}var hp=null;function lY(){if(hp===null)try{new FormData(document.createElement("form"),0),hp=!1}catch{hp=!0}return hp}var cY=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function zb(t){return t!=null&&!cY.has(t)?(Ha(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${zp}"`),null):t}function uY(t,e){let r,n,a,s,l;if(aY(t)){let c=t.getAttribute("action");n=c?ko(c,e):null,r=t.getAttribute("method")||Fp,a=zb(t.getAttribute("enctype"))||zp,s=new FormData(t)}else if(nY(t)||oY(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||c.getAttribute("action");if(n=d?ko(d,e):null,r=t.getAttribute("formmethod")||c.getAttribute("method")||Fp,a=zb(t.getAttribute("formenctype"))||zb(c.getAttribute("enctype"))||zp,s=new FormData(c,t),!lY()){let{name:f,type:m,value:h}=t;if(m==="image"){let v=f?`${f}.`:"";s.append(`${v}x`,"0"),s.append(`${v}y`,"0")}else f&&s.append(f,h)}}else{if(Hm(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Fp,n=null,a=zp,l=t}return s&&a==="text/plain"&&(l=s,s=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gR(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function dY(t,e,r){let n=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n.pathname==="/"?n.pathname=`_root.${r}`:e&&ko(n.pathname,e)==="/"?n.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function fY(t,e){if(t.id in e)return e[t.id];try{let r=await import(t.module);return e[t.id]=r,r}catch(r){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pY(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function mY(t,e,r){let n=await Promise.all(t.map(async a=>{let s=e.routes[a.route.id];if(s){let l=await fY(s,r);return l.links?l.links():[]}return[]}));return bY(n.flat(1).filter(pY).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function gO(t,e,r,n,a,s){let l=(d,f)=>r[f]?d.route.id!==r[f].route.id:!0,c=(d,f)=>r[f].pathname!==d.pathname||r[f].route.path?.endsWith("*")&&r[f].params["*"]!==d.params["*"];return s==="assets"?e.filter((d,f)=>l(d,f)||c(d,f)):s==="data"?e.filter((d,f)=>{let m=n.routes[d.route.id];if(!m||!m.hasLoader)return!1;if(l(d,f)||c(d,f))return!0;if(d.route.shouldRevalidate){let h=d.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function hY(t,e,{includeHydrateFallback:r}={}){return gY(t.map(n=>{let a=e.routes[n.route.id];if(!a)return[];let s=[a.module];return a.clientActionModule&&(s=s.concat(a.clientActionModule)),a.clientLoaderModule&&(s=s.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(s=s.concat(a.hydrateFallbackModule)),a.imports&&(s=s.concat(a.imports)),s}).flat(1))}function gY(t){return[...new Set(t)]}function vY(t){let e={},r=Object.keys(t).sort();for(let n of r)e[n]=t[n];return e}function bY(t,e){let r=new Set;return new Set(e),t.reduce((n,a)=>{let s=JSON.stringify(vY(a));return r.has(s)||(r.add(s),n.push({key:s,link:a})),n},[])}function i$(){let t=b.useContext(gc);return gR(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function yY(){let t=b.useContext(qm);return gR(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var vR=b.createContext(void 0);vR.displayName="FrameworkContext";function s$(){let t=b.useContext(vR);return gR(t,"You must render this element inside a <HydratedRouter> element"),t}function EY(t,e){let r=b.useContext(vR),[n,a]=b.useState(!1),[s,l]=b.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:f,onMouseLeave:m,onTouchStart:h}=e,v=b.useRef(null);b.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let S=x=>{x.forEach(_=>{l(_.isIntersecting)})},R=new IntersectionObserver(S,{threshold:.5});return v.current&&R.observe(v.current),()=>{R.disconnect()}}},[t]),b.useEffect(()=>{if(n){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[n]);let y=()=>{a(!0)},w=()=>{a(!1),l(!1)};return r?t!=="intent"?[s,v,{}]:[s,v,{onFocus:bu(c,y),onBlur:bu(d,w),onMouseEnter:bu(f,y),onMouseLeave:bu(m,w),onTouchStart:bu(h,y)}]:[!1,v,{}]}function bu(t,e){return r=>{t&&t(r),r.defaultPrevented||e(r)}}function SY({page:t,...e}){let{router:r}=i$(),n=b.useMemo(()=>Y2(r.routes,t,r.basename),[r.routes,t,r.basename]);return n?b.createElement(wY,{page:t,matches:n,...e}):null}function xY(t){let{manifest:e,routeModules:r}=s$(),[n,a]=b.useState([]);return b.useEffect(()=>{let s=!1;return mY(t,e,r).then(l=>{s||a(l)}),()=>{s=!0}},[t,e,r]),n}function wY({page:t,matches:e,...r}){let n=Uo(),{manifest:a,routeModules:s}=s$(),{basename:l}=i$(),{loaderData:c,matches:d}=yY(),f=b.useMemo(()=>gO(t,e,d,a,n,"data"),[t,e,d,a,n]),m=b.useMemo(()=>gO(t,e,d,a,n,"assets"),[t,e,d,a,n]),h=b.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let w=new Set,S=!1;if(e.forEach(x=>{let _=a.routes[x.route.id];!_||!_.hasLoader||(!f.some(C=>C.route.id===x.route.id)&&x.route.id in c&&s[x.route.id]?.shouldRevalidate||_.hasClientLoader?S=!0:w.add(x.route.id))}),w.size===0)return[];let R=dY(t,l,"data");return S&&w.size>0&&R.searchParams.set("_routes",e.filter(x=>w.has(x.route.id)).map(x=>x.route.id).join(",")),[R.pathname+R.search]},[l,c,n,a,f,e,t,s]),v=b.useMemo(()=>hY(m,a),[m,a]),y=xY(m);return b.createElement(b.Fragment,null,h.map(w=>b.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),v.map(w=>b.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),y.map(({key:w,link:S})=>b.createElement("link",{key:w,nonce:r.nonce,...S})))}function _Y(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}var l$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{l$&&(window.__reactRouterVersion="7.9.5")}catch{}function TY({basename:t,children:e,window:r}){let n=b.useRef();n.current==null&&(n.current=p7({window:r,v5Compat:!0}));let a=n.current,[s,l]=b.useState({action:a.action,location:a.location}),c=b.useCallback(d=>{b.startTransition(()=>l(d))},[l]);return b.useLayoutEffect(()=>a.listen(c),[a,c]),b.createElement(tY,{basename:t,children:e,location:s.location,navigationType:s.action,navigator:a})}var c$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,u$=b.forwardRef(function({onClick:e,discover:r="render",prefetch:n="none",relative:a,reloadDocument:s,replace:l,state:c,target:d,to:f,preventScrollReset:m,viewTransition:h,...v},y){let{basename:w}=b.useContext(Za),S=typeof f=="string"&&c$.test(f),R,x=!1;if(typeof f=="string"&&S&&(R=f,l$))try{let L=new URL(window.location.href),M=f.startsWith("//")?new URL(L.protocol+f):new URL(f),P=ko(M.pathname,w);M.origin===L.origin&&P!=null?f=P+M.search+M.hash:x=!0}catch{Ha(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=z7(f,{relative:a}),[C,N,k]=EY(n,v),A=NY(f,{replace:l,state:c,target:d,preventScrollReset:m,relative:a,viewTransition:h});function I(L){e&&e(L),L.defaultPrevented||A(L)}let O=b.createElement("a",{...v,...k,href:R||_,onClick:x||s?e:I,ref:_Y(y,N),target:d,"data-discover":!S&&r==="render"?"true":void 0});return C&&!S?b.createElement(b.Fragment,null,O,b.createElement(SY,{page:_})):O});u$.displayName="Link";var RY=b.forwardRef(function({"aria-current":e="page",caseSensitive:r=!1,className:n="",end:a=!1,style:s,to:l,viewTransition:c,children:d,...f},m){let h=Pd(l,{relative:f.relative}),v=Uo(),y=b.useContext(qm),{navigator:w,basename:S}=b.useContext(Za),R=y!=null&&LY(h)&&c===!0,x=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,_=v.pathname,C=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(_=_.toLowerCase(),C=C?C.toLowerCase():null,x=x.toLowerCase()),C&&S&&(C=ko(C,S)||C);const N=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let k=_===x||!a&&_.startsWith(x)&&_.charAt(N)==="/",A=C!=null&&(C===x||!a&&C.startsWith(x)&&C.charAt(x.length)==="/"),I={isActive:k,isPending:A,isTransitioning:R},O=k?e:void 0,L;typeof n=="function"?L=n(I):L=[n,k?"active":null,A?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let M=typeof s=="function"?s(I):s;return b.createElement(u$,{...f,"aria-current":O,className:L,ref:m,style:M,to:l,viewTransition:c},typeof d=="function"?d(I):d)});RY.displayName="NavLink";var CY=b.forwardRef(({discover:t="render",fetcherKey:e,navigate:r,reloadDocument:n,replace:a,state:s,method:l=Fp,action:c,onSubmit:d,relative:f,preventScrollReset:m,viewTransition:h,...v},y)=>{let w=OY(),S=DY(c,{relative:f}),R=l.toLowerCase()==="get"?"get":"post",x=typeof c=="string"&&c$.test(c),_=C=>{if(d&&d(C),C.defaultPrevented)return;C.preventDefault();let N=C.nativeEvent.submitter,k=N?.getAttribute("formmethod")||l;w(N||C.currentTarget,{fetcherKey:e,method:k,navigate:r,replace:a,state:s,relative:f,preventScrollReset:m,viewTransition:h})};return b.createElement("form",{ref:y,method:R,action:S,onSubmit:n?d:_,...v,"data-discover":!x&&t==="render"?"true":void 0})});CY.displayName="Form";function AY(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function d$(t){let e=b.useContext(gc);return dr(e,AY(t)),e}function NY(t,{target:e,replace:r,state:n,preventScrollReset:a,relative:s,viewTransition:l}={}){let c=vc(),d=Uo(),f=Pd(t,{relative:s});return b.useCallback(m=>{if(sY(m,e)){m.preventDefault();let h=r!==void 0?r:cd(d)===cd(f);c(t,{replace:h,state:n,preventScrollReset:a,relative:s,viewTransition:l})}},[d,c,f,r,n,e,t,a,s,l])}var kY=0,IY=()=>`__${String(++kY)}__`;function OY(){let{router:t}=d$("useSubmit"),{basename:e}=b.useContext(Za),r=X7();return b.useCallback(async(n,a={})=>{let{action:s,method:l,encType:c,formData:d,body:f}=uY(n,e);if(a.navigate===!1){let m=a.fetcherKey||IY();await t.fetch(m,r,a.action||s,{preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||c,flushSync:a.flushSync})}else await t.navigate(a.action||s,{preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[t,e,r])}function DY(t,{relative:e}={}){let{basename:r}=b.useContext(Za),n=b.useContext(jo);dr(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),s={...Pd(t||".",{relative:e})},l=Uo();if(t==null){s.search=l.search;let c=new URLSearchParams(s.search),d=c.getAll("index");if(d.some(m=>m==="")){c.delete("index"),d.filter(h=>h).forEach(h=>c.append("index",h));let m=c.toString();s.search=m?`?${m}`:""}}return(!t||t===".")&&a.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Co([r,s.pathname])),cd(s)}function LY(t,{relative:e}={}){let r=b.useContext(e$);dr(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=d$("useViewTransitionState"),a=Pd(t,{relative:e});if(!r.isTransitioning)return!1;let s=ko(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=ko(r.nextLocation.pathname,n)||r.nextLocation.pathname;return gm(a.pathname,l)!=null||gm(a.pathname,s)!=null}var bc=W2();const f$=fc(bc);function vO(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Va(...t){return e=>{let r=!1;const n=t.map(a=>{const s=vO(a,e);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let a=0;a<n.length;a++){const s=n[a];typeof s=="function"?s():vO(t[a],null)}}}}function Nt(...t){return b.useCallback(Va(...t),t)}var MY=Symbol.for("react.lazy"),vm=Bm[" use ".trim().toString()];function PY(t){return typeof t=="object"&&t!==null&&"then"in t}function p$(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===MY&&"_payload"in t&&PY(t._payload)}function m$(t){const e=jY(t),r=b.forwardRef((n,a)=>{let{children:s,...l}=n;p$(s)&&typeof vm=="function"&&(s=vm(s._payload));const c=b.Children.toArray(s),d=c.find(FY);if(d){const f=d.props.children,m=c.map(h=>h===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:h);return g.jsx(e,{...l,ref:a,children:b.isValidElement(f)?b.cloneElement(f,void 0,m):null})}return g.jsx(e,{...l,ref:a,children:s})});return r.displayName=`${t}.Slot`,r}var h$=m$("Slot");function jY(t){const e=b.forwardRef((r,n)=>{let{children:a,...s}=r;if(p$(a)&&typeof vm=="function"&&(a=vm(a._payload)),b.isValidElement(a)){const l=$Y(a),c=zY(s,a.props);return a.type!==b.Fragment&&(c.ref=n?Va(n,l):l),b.cloneElement(a,c)}return b.Children.count(a)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var UY=Symbol("radix.slottable");function FY(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===UY}function zY(t,e){const r={...e};for(const n in e){const a=t[n],s=e[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...c)=>{const d=s(...c);return a(...c),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...t,...r}}function $Y(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function g$(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=g$(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function v$(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=g$(t))&&(n&&(n+=" "),n+=e);return n}const bO=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,yO=v$,b$=(t,e)=>r=>{var n;if(e?.variants==null)return yO(t,r?.class,r?.className);const{variants:a,defaultVariants:s}=e,l=Object.keys(a).map(f=>{const m=r?.[f],h=s?.[f];if(m===null)return null;const v=bO(m)||bO(h);return a[f][v]}),c=r&&Object.entries(r).reduce((f,m)=>{let[h,v]=m;return v===void 0||(f[h]=v),f},{}),d=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((f,m)=>{let{class:h,className:v,...y}=m;return Object.entries(y).every(w=>{let[S,R]=w;return Array.isArray(R)?R.includes({...s,...c}[S]):{...s,...c}[S]===R})?[...f,h,v]:f},[]);return yO(t,l,d,r?.class,r?.className)},BY=(t,e)=>{const r=new Array(t.length+e.length);for(let n=0;n<t.length;n++)r[n]=t[n];for(let n=0;n<e.length;n++)r[t.length+n]=e[n];return r},qY=(t,e)=>({classGroupId:t,validator:e}),y$=(t=new Map,e=null,r)=>({nextPart:t,validators:e,classGroupId:r}),bm="-",EO=[],HY="arbitrary..",VY=t=>{const e=WY(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return GY(l);const c=l.split(bm),d=c[0]===""&&c.length>1?1:0;return E$(c,d,e)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=n[l],f=r[l];return d?f?BY(f,d):d:f||EO}return r[l]||EO}}},E$=(t,e,r)=>{if(t.length-e===0)return r.classGroupId;const a=t[e],s=r.nextPart.get(a);if(s){const f=E$(t,e+1,s);if(f)return f}const l=r.validators;if(l===null)return;const c=e===0?t.join(bm):t.slice(e).join(bm),d=l.length;for(let f=0;f<d;f++){const m=l[f];if(m.validator(c))return m.classGroupId}},GY=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),r=e.indexOf(":"),n=e.slice(0,r);return n?HY+n:void 0})(),WY=t=>{const{theme:e,classGroups:r}=t;return YY(r,e)},YY=(t,e)=>{const r=y$();for(const n in t){const a=t[n];bR(a,r,n,e)}return r},bR=(t,e,r,n)=>{const a=t.length;for(let s=0;s<a;s++){const l=t[s];KY(l,e,r,n)}},KY=(t,e,r,n)=>{if(typeof t=="string"){ZY(t,e,r);return}if(typeof t=="function"){XY(t,e,r,n);return}QY(t,e,r,n)},ZY=(t,e,r)=>{const n=t===""?e:S$(e,t);n.classGroupId=r},XY=(t,e,r,n)=>{if(JY(t)){bR(t(n),e,r,n);return}e.validators===null&&(e.validators=[]),e.validators.push(qY(r,t))},QY=(t,e,r,n)=>{const a=Object.entries(t),s=a.length;for(let l=0;l<s;l++){const[c,d]=a[l];bR(d,S$(e,c),r,n)}},S$=(t,e)=>{let r=t;const n=e.split(bm),a=n.length;for(let s=0;s<a;s++){const l=n[s];let c=r.nextPart.get(l);c||(c=y$(),r.nextPart.set(l,c)),r=c}return r},JY=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,eK=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=Object.create(null),n=Object.create(null);const a=(s,l)=>{r[s]=l,e++,e>t&&(e=0,n=r,r=Object.create(null))};return{get(s){let l=r[s];if(l!==void 0)return l;if((l=n[s])!==void 0)return a(s,l),l},set(s,l){s in r?r[s]=l:a(s,l)}}},K_="!",SO=":",tK=[],xO=(t,e,r,n,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),rK=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=a=>{const s=[];let l=0,c=0,d=0,f;const m=a.length;for(let S=0;S<m;S++){const R=a[S];if(l===0&&c===0){if(R===SO){s.push(a.slice(d,S)),d=S+1;continue}if(R==="/"){f=S;continue}}R==="["?l++:R==="]"?l--:R==="("?c++:R===")"&&c--}const h=s.length===0?a:a.slice(d);let v=h,y=!1;h.endsWith(K_)?(v=h.slice(0,-1),y=!0):h.startsWith(K_)&&(v=h.slice(1),y=!0);const w=f&&f>d?f-d:void 0;return xO(s,y,v,w)};if(e){const a=e+SO,s=n;n=l=>l.startsWith(a)?s(l.slice(a.length)):xO(tK,!1,l,void 0,!0)}if(r){const a=n;n=s=>r({className:s,parseClassName:a})}return n},nK=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((r,n)=>{e.set(r,1e6+n)}),r=>{const n=[];let a=[];for(let s=0;s<r.length;s++){const l=r[s],c=l[0]==="[",d=e.has(l);c||d?(a.length>0&&(a.sort(),n.push(...a),a=[]),n.push(l)):a.push(l)}return a.length>0&&(a.sort(),n.push(...a)),n}},aK=t=>({cache:eK(t.cacheSize),parseClassName:rK(t),sortModifiers:nK(t),...VY(t)}),oK=/\s+/,iK=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=e,l=[],c=t.trim().split(oK);let d="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{isExternal:h,modifiers:v,hasImportantModifier:y,baseClassName:w,maybePostfixModifierPosition:S}=r(m);if(h){d=m+(d.length>0?" "+d:d);continue}let R=!!S,x=n(R?w.substring(0,S):w);if(!x){if(!R){d=m+(d.length>0?" "+d:d);continue}if(x=n(w),!x){d=m+(d.length>0?" "+d:d);continue}R=!1}const _=v.length===0?"":v.length===1?v[0]:s(v).join(":"),C=y?_+K_:_,N=C+x;if(l.indexOf(N)>-1)continue;l.push(N);const k=a(x,R);for(let A=0;A<k.length;++A){const I=k[A];l.push(C+I)}d=m+(d.length>0?" "+d:d)}return d},sK=(...t)=>{let e=0,r,n,a="";for(;e<t.length;)(r=t[e++])&&(n=x$(r))&&(a&&(a+=" "),a+=n);return a},x$=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=x$(t[n]))&&(r&&(r+=" "),r+=e);return r},lK=(t,...e)=>{let r,n,a,s;const l=d=>{const f=e.reduce((m,h)=>h(m),t());return r=aK(f),n=r.cache.get,a=r.cache.set,s=c,c(d)},c=d=>{const f=n(d);if(f)return f;const m=iK(d,r);return a(d,m),m};return s=l,(...d)=>s(sK(...d))},cK=[],Ir=t=>{const e=r=>r[t]||cK;return e.isThemeGetter=!0,e},w$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,uK=/^\d+\/\d+$/,dK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fK=/\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$/,pK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fl=t=>uK.test(t),vt=t=>!!t&&!Number.isNaN(Number(t)),ui=t=>!!t&&Number.isInteger(Number(t)),$b=t=>t.endsWith("%")&&vt(t.slice(0,-1)),bo=t=>dK.test(t),gK=()=>!0,vK=t=>fK.test(t)&&!pK.test(t),T$=()=>!1,bK=t=>mK.test(t),yK=t=>hK.test(t),EK=t=>!Ge(t)&&!We(t),SK=t=>yc(t,A$,T$),Ge=t=>w$.test(t),ts=t=>yc(t,N$,vK),Bb=t=>yc(t,RK,vt),wO=t=>yc(t,R$,T$),xK=t=>yc(t,C$,yK),gp=t=>yc(t,k$,bK),We=t=>_$.test(t),yu=t=>Ec(t,N$),wK=t=>Ec(t,CK),_O=t=>Ec(t,R$),_K=t=>Ec(t,A$),TK=t=>Ec(t,C$),vp=t=>Ec(t,k$,!0),yc=(t,e,r)=>{const n=w$.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},Ec=(t,e,r=!1)=>{const n=_$.exec(t);return n?n[1]?e(n[1]):r:!1},R$=t=>t==="position"||t==="percentage",C$=t=>t==="image"||t==="url",A$=t=>t==="length"||t==="size"||t==="bg-size",N$=t=>t==="length",RK=t=>t==="number",CK=t=>t==="family-name",k$=t=>t==="shadow",AK=()=>{const t=Ir("color"),e=Ir("font"),r=Ir("text"),n=Ir("font-weight"),a=Ir("tracking"),s=Ir("leading"),l=Ir("breakpoint"),c=Ir("container"),d=Ir("spacing"),f=Ir("radius"),m=Ir("shadow"),h=Ir("inset-shadow"),v=Ir("text-shadow"),y=Ir("drop-shadow"),w=Ir("blur"),S=Ir("perspective"),R=Ir("aspect"),x=Ir("ease"),_=Ir("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...N(),We,Ge],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],O=()=>[We,Ge,d],L=()=>[fl,"full","auto",...O()],M=()=>[ui,"none","subgrid",We,Ge],P=()=>["auto",{span:["full",ui,We,Ge]},ui,We,Ge],W=()=>[ui,"auto",We,Ge],X=()=>["auto","min","max","fr",We,Ge],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...O()],G=()=>[fl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],V=()=>[t,We,Ge],te=()=>[...N(),_O,wO,{position:[We,Ge]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",_K,SK,{size:[We,Ge]}],q=()=>[$b,yu,ts],$=()=>["","none","full",f,We,Ge],Y=()=>["",vt,yu,ts],Q=()=>["solid","dashed","dotted","double"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>[vt,$b,_O,wO],K=()=>["","none",w,We,Ge],ae=()=>["none",vt,We,Ge],H=()=>["none",vt,We,Ge],de=()=>[vt,We,Ge],me=()=>[fl,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bo],breakpoint:[bo],color:[gK],container:[bo],"drop-shadow":[bo],ease:["in","out","in-out"],font:[EK],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bo],shadow:[bo],spacing:["px",vt],text:[bo],"text-shadow":[bo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fl,Ge,We,R]}],container:["container"],columns:[{columns:[vt,Ge,We,c]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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"],sr:["sr-only","not-sr-only"],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:k()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[ui,"auto",We,Ge]}],basis:[{basis:[fl,"full","auto",c,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,fl,"auto","initial","none",Ge]}],grow:[{grow:["",vt,We,Ge]}],shrink:[{shrink:["",vt,We,Ge]}],order:[{order:[ui,"first","last","none",We,Ge]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[c,"screen",...G()]}],"min-w":[{"min-w":[c,"screen","none",...G()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",r,yu,ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,We,Bb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$b,Ge]}],"font-family":[{font:[wK,Ge,e]}],"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:[a,We,Ge]}],"line-clamp":[{"line-clamp":[vt,"none",We,Bb]}],leading:[{leading:[s,...O()]}],"list-image":[{"list-image":["none",We,Ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",We,Ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",We,ts]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[vt,"auto",We,Ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",We,Ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",We,Ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ui,We,Ge],radial:["",We,Ge],conic:[ui,We,Ge]},TK,xK]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,We,Ge]}],"outline-w":[{outline:["",vt,yu,ts]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",m,vp,gp]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",h,vp,gp]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[vt,ts]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",v,vp,gp]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[vt,We,Ge]}],"mix-blend":[{"mix-blend":[...F(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":F()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[We,Ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",We,Ge]}],filter:[{filter:["","none",We,Ge]}],blur:[{blur:K()}],brightness:[{brightness:[vt,We,Ge]}],contrast:[{contrast:[vt,We,Ge]}],"drop-shadow":[{"drop-shadow":["","none",y,vp,gp]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",vt,We,Ge]}],"hue-rotate":[{"hue-rotate":[vt,We,Ge]}],invert:[{invert:["",vt,We,Ge]}],saturate:[{saturate:[vt,We,Ge]}],sepia:[{sepia:["",vt,We,Ge]}],"backdrop-filter":[{"backdrop-filter":["","none",We,Ge]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[vt,We,Ge]}],"backdrop-contrast":[{"backdrop-contrast":[vt,We,Ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,We,Ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,We,Ge]}],"backdrop-invert":[{"backdrop-invert":["",vt,We,Ge]}],"backdrop-opacity":[{"backdrop-opacity":[vt,We,Ge]}],"backdrop-saturate":[{"backdrop-saturate":[vt,We,Ge]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,We,Ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",We,Ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",We,Ge]}],ease:[{ease:["linear","initial",x,We,Ge]}],delay:[{delay:[vt,We,Ge]}],animate:[{animate:["none",_,We,Ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,We,Ge]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[We,Ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",We,Ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",We,Ge]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[vt,yu,ts,Bb]}],stroke:[{stroke:["none",...V()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},NK=lK(AK);function De(...t){return NK(v$(t))}const kK=b$("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Ga({className:t,variant:e,asChild:r=!1,...n}){const a=r?h$:"span";return g.jsx(a,{"data-slot":"badge",className:De(kK({variant:e}),t),...n})}const IK=b$("inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-full gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-full px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function tt({className:t,variant:e,size:r,asChild:n=!1,...a}){const s=n?h$:"button";return g.jsx(s,{"data-slot":"button",className:De(IK({variant:e,size:r,className:t})),...a})}var OK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fo=OK.reduce((t,e)=>{const r=m$(`Primitive.${e}`),n=b.forwardRef((a,s)=>{const{asChild:l,...c}=a,d=l?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(d,{...c,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),DK="Label",I$=b.forwardRef((t,e)=>g.jsx(Fo.label,{...t,ref:e,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));I$.displayName=DK;var LK=I$;function lr({className:t,...e}){return g.jsx(LK,{"data-slot":"label",className:De("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function yR({message:t,className:e="",vertical:r,noBorder:n}){return g.jsx("div",{className:De(`mt-2 rounded-md p-6 ${e}`,!n&&"border"),children:g.jsxs("p",{className:De("text-sm text-muted-foreground flex items-center gap-4",r&&"flex-col"),children:[g.jsx("svg",{width:"40",height:"40",viewBox:"0 0 273 273",version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:g.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:g.jsxs("g",{transform:"translate(5.320900, 5.320900)",fillRule:"nonzero",className:"stroke-black dark:stroke-white",strokeWidth:"4",children:[g.jsx("path",{d:"M49.953025,-2.10854389 C63.26892,-2.21867124 76.6185256,2.70621155 86.9019463,12.6653164 L86.9019463,12.6653164 L87.505627,13.2592944 C97.5154947,23.2654892 102.640454,36.3074513 102.880738,49.4222247 C103.08932,77.4533067 113.877287,105.391753 135.242867,126.757333 C156.613383,148.127849 184.559216,158.914875 212.568138,159.119313 L212.568138,159.119313 L213.212264,159.134159 C225.843948,159.517566 238.363557,164.434972 248.121998,173.886137 L248.121998,173.886137 L248.725621,174.480088 C258.982114,184.732164 264.11035,198.171134 264.11035,211.6101 C264.11035,225.04592 258.984514,238.481745 248.732867,248.732867 C238.592792,258.872942 225.336706,263.997882 212.046872,264.107794 C198.731075,264.21792 185.381569,259.293085 175.098248,249.334078 L175.098248,249.334078 L174.494602,248.740134 C163.75802,238.008189 158.640853,223.784027 159.143413,209.719372 C158.258245,182.640933 147.489786,155.83332 126.828333,135.171867 C106.351297,114.694831 79.8363505,103.934873 53.0237258,102.891841 L53.0237258,102.891841 L52.2811438,102.865674 C38.4791718,103.347421 24.5325234,98.4328111 13.8776628,88.1140866 L13.8776628,88.1140866 L13.2739843,87.5201168 C3.12895117,77.3789607 -1.9984796,64.1195994 -2.10841888,50.8264755 C-2.21854669,37.5105567 2.70635908,24.1609269 12.6655135,13.8774565 L12.6655135,13.8774565 L13.2594878,13.2737797 C23.4005926,3.12880025 36.659927,-1.99860507 49.953025,-2.10854389 Z"}),g.jsx("circle",{cx:"50",cy:"212.0001",r:"52.5"}),g.jsx("circle",{cx:"212.0001",cy:"50",r:"52.5"})]})})}),t]})})}function O$({className:t,color:e,children:r,grayscaled:n=!1}){const a=b.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[1]||"0")}return n?0:.2},[e,n]),s=b.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[0]||"0.5")}return n?.3:.4},[e,n]),l=b.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[2]||"0")}return Math.floor(Math.random()*360)},[e]),c=b.useMemo(()=>e||`oklch(${Math.min(s,1)} ${a} ${l})`,[l,a,s]),d=b.useMemo(()=>`oklch(${Math.min(s*2,1)} ${a} ${l})`,[l,a,s,e]),f=b.useMemo(()=>Math.floor(Math.random()*360),[l]),m=b.useMemo(()=>"1000%",[]);return g.jsx("section",{className:De("relative w-full h-full overflow-hidden",t),style:{background:`${d}`},children:g.jsxs("div",{className:"isolate relative w-full h-full",children:[g.jsx("div",{className:"noise w-full h-full",style:{background:`linear-gradient(${f}deg, ${c}, transparent), url(https://grainy-gradients.vercel.app/noise.svg)`,filter:`contrast(120%) brightness(${m})`}}),r&&g.jsx("div",{className:"relative z-10 w-full h-full",children:r})]})})}function He(t,e,{checkForDefaultPrevented:r=!0}={}){return function(a){if(t?.(a),r===!1||!a.defaultPrevented)return e?.(a)}}function MK(t,e){const r=b.createContext(e),n=s=>{const{children:l,...c}=s,d=b.useMemo(()=>c,Object.values(c));return g.jsx(r.Provider,{value:d,children:l})};n.displayName=t+"Provider";function a(s){const l=b.useContext(r);if(l)return l;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[n,a]}function Xa(t,e=[]){let r=[];function n(s,l){const c=b.createContext(l),d=r.length;r=[...r,l];const f=h=>{const{scope:v,children:y,...w}=h,S=v?.[t]?.[d]||c,R=b.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:R,children:y})};f.displayName=s+"Provider";function m(h,v){const y=v?.[t]?.[d]||c,w=b.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[f,m]}const a=()=>{const s=r.map(l=>b.createContext(l));return function(c){const d=c?.[t]||s;return b.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return a.scopeName=t,[n,PK(a,...e)]}function PK(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const l=n.reduce((c,{useScope:d,scopeName:f})=>{const h=d(s)[`__scope${f}`];return{...c,...h}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return r.scopeName=e.scopeName,r}var nn=globalThis?.document?b.useLayoutEffect:()=>{},jK=Bm[" useInsertionEffect ".trim().toString()]||nn;function _i({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[a,s,l]=UK({defaultProp:e,onChange:r}),c=t!==void 0,d=c?t:a;{const m=b.useRef(t!==void 0);b.useEffect(()=>{const h=m.current;h!==c&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,n])}const f=b.useCallback(m=>{if(c){const h=FK(m)?m(t):m;h!==t&&l.current?.(h)}else s(m)},[c,t,s,l]);return[d,f]}function UK({defaultProp:t,onChange:e}){const[r,n]=b.useState(t),a=b.useRef(r),s=b.useRef(e);return jK(()=>{s.current=e},[e]),b.useEffect(()=>{a.current!==r&&(s.current?.(r),a.current=r)},[r,a]),[r,n,s]}function FK(t){return typeof t=="function"}function D$(t){const e=b.useRef({value:t,previous:t});return b.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function L$(t){const[e,r]=b.useState(void 0);return nn(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let l,c;if("borderBoxSize"in s){const d=s.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,c=f.blockSize}else l=t.offsetWidth,c=t.offsetHeight;r({width:l,height:c})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function Ss(t){const e=zK(t),r=b.forwardRef((n,a)=>{const{children:s,...l}=n,c=b.Children.toArray(s),d=c.find(BK);if(d){const f=d.props.children,m=c.map(h=>h===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:h);return g.jsx(e,{...l,ref:a,children:b.isValidElement(f)?b.cloneElement(f,void 0,m):null})}return g.jsx(e,{...l,ref:a,children:s})});return r.displayName=`${t}.Slot`,r}function zK(t){const e=b.forwardRef((r,n)=>{const{children:a,...s}=r;if(b.isValidElement(a)){const l=HK(a),c=qK(s,a.props);return a.type!==b.Fragment&&(c.ref=n?Va(n,l):l),b.cloneElement(a,c)}return b.Children.count(a)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var M$=Symbol("radix.slottable");function $K(t){const e=({children:r})=>g.jsx(g.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=M$,e}function BK(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===M$}function qK(t,e){const r={...e};for(const n in e){const a=t[n],s=e[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...c)=>{const d=s(...c);return a(...c),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...t,...r}}function HK(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var VK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bt=VK.reduce((t,e)=>{const r=Ss(`Primitive.${e}`),n=b.forwardRef((a,s)=>{const{asChild:l,...c}=a,d=l?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(d,{...c,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function P$(t,e){t&&bc.flushSync(()=>t.dispatchEvent(e))}var Vm="Switch",[GK]=Xa(Vm),[WK,YK]=GK(Vm),j$=b.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:s,required:l,disabled:c,value:d="on",onCheckedChange:f,form:m,...h}=t,[v,y]=b.useState(null),w=Nt(e,C=>y(C)),S=b.useRef(!1),R=v?m||!!v.closest("form"):!0,[x,_]=_i({prop:a,defaultProp:s??!1,onChange:f,caller:Vm});return g.jsxs(WK,{scope:r,checked:x,disabled:c,children:[g.jsx(bt.button,{type:"button",role:"switch","aria-checked":x,"aria-required":l,"data-state":$$(x),"data-disabled":c?"":void 0,disabled:c,value:d,...h,ref:w,onClick:He(t.onClick,C=>{_(N=>!N),R&&(S.current=C.isPropagationStopped(),S.current||C.stopPropagation())})}),R&&g.jsx(z$,{control:v,bubbles:!S.current,name:n,value:d,checked:x,required:l,disabled:c,form:m,style:{transform:"translateX(-100%)"}})]})});j$.displayName=Vm;var U$="SwitchThumb",F$=b.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,a=YK(U$,r);return g.jsx(bt.span,{"data-state":$$(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:e})});F$.displayName=U$;var KK="SwitchBubbleInput",z$=b.forwardRef(({__scopeSwitch:t,control:e,checked:r,bubbles:n=!0,...a},s)=>{const l=b.useRef(null),c=Nt(l,s),d=D$(r),f=L$(e);return b.useEffect(()=>{const m=l.current;if(!m)return;const h=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(h,"checked").set;if(d!==r&&y){const w=new Event("click",{bubbles:n});y.call(m,r),m.dispatchEvent(w)}},[d,r,n]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:c,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});z$.displayName=KK;function $$(t){return t?"checked":"unchecked"}var B$=j$,ZK=F$;function ER({ref:t,className:e,...r}){return g.jsx(B$,{className:De("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:t,children:g.jsx(ZK,{className:De("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})}ER.displayName=B$.displayName;function Wa(t){const e=b.useRef(t);return b.useEffect(()=>{e.current=t}),b.useMemo(()=>(...r)=>e.current?.(...r),[])}function XK(t,e=globalThis?.document){const r=Wa(t);b.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var QK="DismissableLayer",Z_="dismissableLayer.update",JK="dismissableLayer.pointerDownOutside",eZ="dismissableLayer.focusOutside",TO,q$=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sc=b.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=t,f=b.useContext(q$),[m,h]=b.useState(null),v=m?.ownerDocument??globalThis?.document,[,y]=b.useState({}),w=Nt(e,I=>h(I)),S=Array.from(f.layers),[R]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=S.indexOf(R),_=m?S.indexOf(m):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,N=_>=x,k=nZ(I=>{const O=I.target,L=[...f.branches].some(M=>M.contains(O));!N||L||(a?.(I),l?.(I),I.defaultPrevented||c?.())},v),A=aZ(I=>{const O=I.target;[...f.branches].some(M=>M.contains(O))||(s?.(I),l?.(I),I.defaultPrevented||c?.())},v);return XK(I=>{_===f.layers.size-1&&(n?.(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},v),b.useEffect(()=>{if(m)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(TO=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),RO(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=TO)}},[m,v,r,f]),b.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),RO())},[m,f]),b.useEffect(()=>{const I=()=>y({});return document.addEventListener(Z_,I),()=>document.removeEventListener(Z_,I)},[]),g.jsx(bt.div,{...d,ref:w,style:{pointerEvents:C?N?"auto":"none":void 0,...t.style},onFocusCapture:He(t.onFocusCapture,A.onFocusCapture),onBlurCapture:He(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:He(t.onPointerDownCapture,k.onPointerDownCapture)})});Sc.displayName=QK;var tZ="DismissableLayerBranch",rZ=b.forwardRef((t,e)=>{const r=b.useContext(q$),n=b.useRef(null),a=Nt(e,n);return b.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),g.jsx(bt.div,{...t,ref:a})});rZ.displayName=tZ;function nZ(t,e=globalThis?.document){const r=Wa(t),n=b.useRef(!1),a=b.useRef(()=>{});return b.useEffect(()=>{const s=c=>{if(c.target&&!n.current){let d=function(){H$(JK,r,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",a.current),a.current=d,e.addEventListener("click",a.current,{once:!0})):d()}else e.removeEventListener("click",a.current);n.current=!1},l=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),e.removeEventListener("pointerdown",s),e.removeEventListener("click",a.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function aZ(t,e=globalThis?.document){const r=Wa(t),n=b.useRef(!1);return b.useEffect(()=>{const a=s=>{s.target&&!n.current&&H$(eZ,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",a),()=>e.removeEventListener("focusin",a)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function RO(){const t=new CustomEvent(Z_);document.dispatchEvent(t)}function H$(t,e,r,{discrete:n}){const a=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&a.addEventListener(t,e,{once:!0}),n?P$(a,s):a.dispatchEvent(s)}var oZ=Bm[" useId ".trim().toString()]||(()=>{}),iZ=0;function Xr(t){const[e,r]=b.useState(oZ());return nn(()=>{r(n=>n??String(iZ++))},[t]),t||(e?`radix-${e}`:"")}const sZ=["top","right","bottom","left"],Ti=Math.min,Un=Math.max,ym=Math.round,bp=Math.floor,za=t=>({x:t,y:t}),lZ={left:"right",right:"left",bottom:"top",top:"bottom"},cZ={start:"end",end:"start"};function X_(t,e,r){return Un(t,Ti(e,r))}function Io(t,e){return typeof t=="function"?t(e):t}function Oo(t){return t.split("-")[0]}function xc(t){return t.split("-")[1]}function SR(t){return t==="x"?"y":"x"}function xR(t){return t==="y"?"height":"width"}const uZ=new Set(["top","bottom"]);function Pa(t){return uZ.has(Oo(t))?"y":"x"}function wR(t){return SR(Pa(t))}function dZ(t,e,r){r===void 0&&(r=!1);const n=xc(t),a=wR(t),s=xR(a);let l=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=Em(l)),[l,Em(l)]}function fZ(t){const e=Em(t);return[Q_(t),e,Q_(e)]}function Q_(t){return t.replace(/start|end/g,e=>cZ[e])}const CO=["left","right"],AO=["right","left"],pZ=["top","bottom"],mZ=["bottom","top"];function hZ(t,e,r){switch(t){case"top":case"bottom":return r?e?AO:CO:e?CO:AO;case"left":case"right":return e?pZ:mZ;default:return[]}}function gZ(t,e,r,n){const a=xc(t);let s=hZ(Oo(t),r==="start",n);return a&&(s=s.map(l=>l+"-"+a),e&&(s=s.concat(s.map(Q_)))),s}function Em(t){return t.replace(/left|right|bottom|top/g,e=>lZ[e])}function vZ(t){return{top:0,right:0,bottom:0,left:0,...t}}function V$(t){return typeof t!="number"?vZ(t):{top:t,right:t,bottom:t,left:t}}function Sm(t){const{x:e,y:r,width:n,height:a}=t;return{width:n,height:a,top:r,left:e,right:e+n,bottom:r+a,x:e,y:r}}function NO(t,e,r){let{reference:n,floating:a}=t;const s=Pa(e),l=wR(e),c=xR(l),d=Oo(e),f=s==="y",m=n.x+n.width/2-a.width/2,h=n.y+n.height/2-a.height/2,v=n[c]/2-a[c]/2;let y;switch(d){case"top":y={x:m,y:n.y-a.height};break;case"bottom":y={x:m,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:h};break;case"left":y={x:n.x-a.width,y:h};break;default:y={x:n.x,y:n.y}}switch(xc(e)){case"start":y[l]-=v*(r&&f?-1:1);break;case"end":y[l]+=v*(r&&f?-1:1);break}return y}const bZ=async(t,e,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:l}=r,c=s.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:a}),{x:m,y:h}=NO(f,n,d),v=n,y={},w=0;for(let S=0;S<c.length;S++){const{name:R,fn:x}=c[S],{x:_,y:C,data:N,reset:k}=await x({x:m,y:h,initialPlacement:n,placement:v,strategy:a,middlewareData:y,rects:f,platform:l,elements:{reference:t,floating:e}});m=_??m,h=C??h,y={...y,[R]:{...y[R],...N}},k&&w<=50&&(w++,typeof k=="object"&&(k.placement&&(v=k.placement),k.rects&&(f=k.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:a}):k.rects),{x:m,y:h}=NO(f,v,d)),S=-1)}return{x:m,y:h,placement:v,strategy:a,middlewareData:y}};async function ud(t,e){var r;e===void 0&&(e={});const{x:n,y:a,platform:s,rects:l,elements:c,strategy:d}=t,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=Io(e,t),w=V$(y),R=c[v?h==="floating"?"reference":"floating":h],x=Sm(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(R)))==null||r?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:m,strategy:d})),_=h==="floating"?{x:n,y:a,width:l.floating.width,height:l.floating.height}:l.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),N=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},k=Sm(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:_,offsetParent:C,strategy:d}):_);return{top:(x.top-k.top+w.top)/N.y,bottom:(k.bottom-x.bottom+w.bottom)/N.y,left:(x.left-k.left+w.left)/N.x,right:(k.right-x.right+w.right)/N.x}}const yZ=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:a,rects:s,platform:l,elements:c,middlewareData:d}=e,{element:f,padding:m=0}=Io(t,e)||{};if(f==null)return{};const h=V$(m),v={x:r,y:n},y=wR(a),w=xR(y),S=await l.getDimensions(f),R=y==="y",x=R?"top":"left",_=R?"bottom":"right",C=R?"clientHeight":"clientWidth",N=s.reference[w]+s.reference[y]-v[y]-s.floating[w],k=v[y]-s.reference[y],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let I=A?A[C]:0;(!I||!await(l.isElement==null?void 0:l.isElement(A)))&&(I=c.floating[C]||s.floating[w]);const O=N/2-k/2,L=I/2-S[w]/2-1,M=Ti(h[x],L),P=Ti(h[_],L),W=M,X=I-S[w]-P,ee=I/2-S[w]/2+O,J=X_(W,ee,X),j=!d.arrow&&xc(a)!=null&&ee!==J&&s.reference[w]/2-(ee<W?M:P)-S[w]/2<0,G=j?ee<W?ee-W:ee-X:0;return{[y]:v[y]+G,data:{[y]:J,centerOffset:ee-J-G,...j&&{alignmentOffset:G}},reset:j}}}),EZ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:a,middlewareData:s,rects:l,initialPlacement:c,platform:d,elements:f}=e,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...R}=Io(t,e);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const x=Oo(a),_=Pa(c),C=Oo(c)===c,N=await(d.isRTL==null?void 0:d.isRTL(f.floating)),k=v||(C||!S?[Em(c)]:fZ(c)),A=w!=="none";!v&&A&&k.push(...gZ(c,S,w,N));const I=[c,...k],O=await ud(e,R),L=[];let M=((n=s.flip)==null?void 0:n.overflows)||[];if(m&&L.push(O[x]),h){const ee=dZ(a,l,N);L.push(O[ee[0]],O[ee[1]])}if(M=[...M,{placement:a,overflows:L}],!L.every(ee=>ee<=0)){var P,W;const ee=(((P=s.flip)==null?void 0:P.index)||0)+1,J=I[ee];if(J&&(!(h==="alignment"?_!==Pa(J):!1)||M.every(V=>Pa(V.placement)===_?V.overflows[0]>0:!0)))return{data:{index:ee,overflows:M},reset:{placement:J}};let j=(W=M.filter(G=>G.overflows[0]<=0).sort((G,V)=>G.overflows[1]-V.overflows[1])[0])==null?void 0:W.placement;if(!j)switch(y){case"bestFit":{var X;const G=(X=M.filter(V=>{if(A){const te=Pa(V.placement);return te===_||te==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(te=>te>0).reduce((te,re)=>te+re,0)]).sort((V,te)=>V[1]-te[1])[0])==null?void 0:X[0];G&&(j=G);break}case"initialPlacement":j=c;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function kO(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function IO(t){return sZ.some(e=>t[e]>=0)}const SZ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...a}=Io(t,e);switch(n){case"referenceHidden":{const s=await ud(e,{...a,elementContext:"reference"}),l=kO(s,r.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:IO(l)}}}case"escaped":{const s=await ud(e,{...a,altBoundary:!0}),l=kO(s,r.floating);return{data:{escapedOffsets:l,escaped:IO(l)}}}default:return{}}}}},G$=new Set(["left","top"]);async function xZ(t,e){const{placement:r,platform:n,elements:a}=t,s=await(n.isRTL==null?void 0:n.isRTL(a.floating)),l=Oo(r),c=xc(r),d=Pa(r)==="y",f=G$.has(l)?-1:1,m=s&&d?-1:1,h=Io(e,t);let{mainAxis:v,crossAxis:y,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof w=="number"&&(y=c==="end"?w*-1:w),d?{x:y*m,y:v*f}:{x:v*f,y:y*m}}const wZ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:a,y:s,placement:l,middlewareData:c}=e,d=await xZ(e,t);return l===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:a+d.x,y:s+d.y,data:{...d,placement:l}}}}},_Z=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:a}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:R=>{let{x,y:_}=R;return{x,y:_}}},...d}=Io(t,e),f={x:r,y:n},m=await ud(e,d),h=Pa(Oo(a)),v=SR(h);let y=f[v],w=f[h];if(s){const R=v==="y"?"top":"left",x=v==="y"?"bottom":"right",_=y+m[R],C=y-m[x];y=X_(_,y,C)}if(l){const R=h==="y"?"top":"left",x=h==="y"?"bottom":"right",_=w+m[R],C=w-m[x];w=X_(_,w,C)}const S=c.fn({...e,[v]:y,[h]:w});return{...S,data:{x:S.x-r,y:S.y-n,enabled:{[v]:s,[h]:l}}}}}},TZ=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:a,rects:s,middlewareData:l}=e,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=Io(t,e),m={x:r,y:n},h=Pa(a),v=SR(h);let y=m[v],w=m[h];const S=Io(c,e),R=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const C=v==="y"?"height":"width",N=s.reference[v]-s.floating[C]+R.mainAxis,k=s.reference[v]+s.reference[C]-R.mainAxis;y<N?y=N:y>k&&(y=k)}if(f){var x,_;const C=v==="y"?"width":"height",N=G$.has(Oo(a)),k=s.reference[h]-s.floating[C]+(N&&((x=l.offset)==null?void 0:x[h])||0)+(N?0:R.crossAxis),A=s.reference[h]+s.reference[C]+(N?0:((_=l.offset)==null?void 0:_[h])||0)-(N?R.crossAxis:0);w<k?w=k:w>A&&(w=A)}return{[v]:y,[h]:w}}}},RZ=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:a,rects:s,platform:l,elements:c}=e,{apply:d=()=>{},...f}=Io(t,e),m=await ud(e,f),h=Oo(a),v=xc(a),y=Pa(a)==="y",{width:w,height:S}=s.floating;let R,x;h==="top"||h==="bottom"?(R=h,x=v===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(x=h,R=v==="end"?"top":"bottom");const _=S-m.top-m.bottom,C=w-m.left-m.right,N=Ti(S-m[R],_),k=Ti(w-m[x],C),A=!e.middlewareData.shift;let I=N,O=k;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(O=C),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(I=_),A&&!v){const M=Un(m.left,0),P=Un(m.right,0),W=Un(m.top,0),X=Un(m.bottom,0);y?O=w-2*(M!==0||P!==0?M+P:Un(m.left,m.right)):I=S-2*(W!==0||X!==0?W+X:Un(m.top,m.bottom))}await d({...e,availableWidth:O,availableHeight:I});const L=await l.getDimensions(c.floating);return w!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function Gm(){return typeof window<"u"}function wc(t){return W$(t)?(t.nodeName||"").toLowerCase():"#document"}function Fn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Qa(t){var e;return(e=(W$(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function W$(t){return Gm()?t instanceof Node||t instanceof Fn(t).Node:!1}function Sa(t){return Gm()?t instanceof Element||t instanceof Fn(t).Element:!1}function Ya(t){return Gm()?t instanceof HTMLElement||t instanceof Fn(t).HTMLElement:!1}function OO(t){return!Gm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Fn(t).ShadowRoot}const CZ=new Set(["inline","contents"]);function jd(t){const{overflow:e,overflowX:r,overflowY:n,display:a}=xa(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!CZ.has(a)}const AZ=new Set(["table","td","th"]);function NZ(t){return AZ.has(wc(t))}const kZ=[":popover-open",":modal"];function Wm(t){return kZ.some(e=>{try{return t.matches(e)}catch{return!1}})}const IZ=["transform","translate","scale","rotate","perspective"],OZ=["transform","translate","scale","rotate","perspective","filter"],DZ=["paint","layout","strict","content"];function _R(t){const e=TR(),r=Sa(t)?xa(t):t;return IZ.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||OZ.some(n=>(r.willChange||"").includes(n))||DZ.some(n=>(r.contain||"").includes(n))}function LZ(t){let e=Ri(t);for(;Ya(e)&&!ac(e);){if(_R(e))return e;if(Wm(e))return null;e=Ri(e)}return null}function TR(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const MZ=new Set(["html","body","#document"]);function ac(t){return MZ.has(wc(t))}function xa(t){return Fn(t).getComputedStyle(t)}function Ym(t){return Sa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ri(t){if(wc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||OO(t)&&t.host||Qa(t);return OO(e)?e.host:e}function Y$(t){const e=Ri(t);return ac(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ya(e)&&jd(e)?e:Y$(e)}function dd(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const a=Y$(t),s=a===((n=t.ownerDocument)==null?void 0:n.body),l=Fn(a);if(s){const c=J_(l);return e.concat(l,l.visualViewport||[],jd(a)?a:[],c&&r?dd(c):[])}return e.concat(a,dd(a,[],r))}function J_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function K$(t){const e=xa(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const a=Ya(t),s=a?t.offsetWidth:r,l=a?t.offsetHeight:n,c=ym(r)!==s||ym(n)!==l;return c&&(r=s,n=l),{width:r,height:n,$:c}}function RR(t){return Sa(t)?t:t.contextElement}function Fl(t){const e=RR(t);if(!Ya(e))return za(1);const r=e.getBoundingClientRect(),{width:n,height:a,$:s}=K$(e);let l=(s?ym(r.width):r.width)/n,c=(s?ym(r.height):r.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const PZ=za(0);function Z$(t){const e=Fn(t);return!TR()||!e.visualViewport?PZ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jZ(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Fn(t)?!1:e}function xs(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const a=t.getBoundingClientRect(),s=RR(t);let l=za(1);e&&(n?Sa(n)&&(l=Fl(n)):l=Fl(t));const c=jZ(s,r,n)?Z$(s):za(0);let d=(a.left+c.x)/l.x,f=(a.top+c.y)/l.y,m=a.width/l.x,h=a.height/l.y;if(s){const v=Fn(s),y=n&&Sa(n)?Fn(n):n;let w=v,S=J_(w);for(;S&&n&&y!==w;){const R=Fl(S),x=S.getBoundingClientRect(),_=xa(S),C=x.left+(S.clientLeft+parseFloat(_.paddingLeft))*R.x,N=x.top+(S.clientTop+parseFloat(_.paddingTop))*R.y;d*=R.x,f*=R.y,m*=R.x,h*=R.y,d+=C,f+=N,w=Fn(S),S=J_(w)}}return Sm({width:m,height:h,x:d,y:f})}function Km(t,e){const r=Ym(t).scrollLeft;return e?e.left+r:xs(Qa(t)).left+r}function X$(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Km(t,r),a=r.top+e.scrollTop;return{x:n,y:a}}function UZ(t){let{elements:e,rect:r,offsetParent:n,strategy:a}=t;const s=a==="fixed",l=Qa(n),c=e?Wm(e.floating):!1;if(n===l||c&&s)return r;let d={scrollLeft:0,scrollTop:0},f=za(1);const m=za(0),h=Ya(n);if((h||!h&&!s)&&((wc(n)!=="body"||jd(l))&&(d=Ym(n)),Ya(n))){const y=xs(n);f=Fl(n),m.x=y.x+n.clientLeft,m.y=y.y+n.clientTop}const v=l&&!h&&!s?X$(l,d):za(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-d.scrollLeft*f.x+m.x+v.x,y:r.y*f.y-d.scrollTop*f.y+m.y+v.y}}function FZ(t){return Array.from(t.getClientRects())}function zZ(t){const e=Qa(t),r=Ym(t),n=t.ownerDocument.body,a=Un(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Un(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+Km(t);const c=-r.scrollTop;return xa(n).direction==="rtl"&&(l+=Un(e.clientWidth,n.clientWidth)-a),{width:a,height:s,x:l,y:c}}const DO=25;function $Z(t,e){const r=Fn(t),n=Qa(t),a=r.visualViewport;let s=n.clientWidth,l=n.clientHeight,c=0,d=0;if(a){s=a.width,l=a.height;const m=TR();(!m||m&&e==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=Km(n);if(f<=0){const m=n.ownerDocument,h=m.body,v=getComputedStyle(h),y=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(n.clientWidth-h.clientWidth-y);w<=DO&&(s-=w)}else f<=DO&&(s+=f);return{width:s,height:l,x:c,y:d}}const BZ=new Set(["absolute","fixed"]);function qZ(t,e){const r=xs(t,!0,e==="fixed"),n=r.top+t.clientTop,a=r.left+t.clientLeft,s=Ya(t)?Fl(t):za(1),l=t.clientWidth*s.x,c=t.clientHeight*s.y,d=a*s.x,f=n*s.y;return{width:l,height:c,x:d,y:f}}function LO(t,e,r){let n;if(e==="viewport")n=$Z(t,r);else if(e==="document")n=zZ(Qa(t));else if(Sa(e))n=qZ(e,r);else{const a=Z$(t);n={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return Sm(n)}function Q$(t,e){const r=Ri(t);return r===e||!Sa(r)||ac(r)?!1:xa(r).position==="fixed"||Q$(r,e)}function HZ(t,e){const r=e.get(t);if(r)return r;let n=dd(t,[],!1).filter(c=>Sa(c)&&wc(c)!=="body"),a=null;const s=xa(t).position==="fixed";let l=s?Ri(t):t;for(;Sa(l)&&!ac(l);){const c=xa(l),d=_R(l);!d&&c.position==="fixed"&&(a=null),(s?!d&&!a:!d&&c.position==="static"&&!!a&&BZ.has(a.position)||jd(l)&&!d&&Q$(t,l))?n=n.filter(m=>m!==l):a=c,l=Ri(l)}return e.set(t,n),n}function VZ(t){let{element:e,boundary:r,rootBoundary:n,strategy:a}=t;const l=[...r==="clippingAncestors"?Wm(e)?[]:HZ(e,this._c):[].concat(r),n],c=l[0],d=l.reduce((f,m)=>{const h=LO(e,m,a);return f.top=Un(h.top,f.top),f.right=Ti(h.right,f.right),f.bottom=Ti(h.bottom,f.bottom),f.left=Un(h.left,f.left),f},LO(e,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function GZ(t){const{width:e,height:r}=K$(t);return{width:e,height:r}}function WZ(t,e,r){const n=Ya(e),a=Qa(e),s=r==="fixed",l=xs(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const d=za(0);function f(){d.x=Km(a)}if(n||!n&&!s)if((wc(e)!=="body"||jd(a))&&(c=Ym(e)),n){const y=xs(e,!0,s,e);d.x=y.x+e.clientLeft,d.y=y.y+e.clientTop}else a&&f();s&&!n&&a&&f();const m=a&&!n&&!s?X$(a,c):za(0),h=l.left+c.scrollLeft-d.x-m.x,v=l.top+c.scrollTop-d.y-m.y;return{x:h,y:v,width:l.width,height:l.height}}function qb(t){return xa(t).position==="static"}function MO(t,e){if(!Ya(t)||xa(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Qa(t)===r&&(r=r.ownerDocument.body),r}function J$(t,e){const r=Fn(t);if(Wm(t))return r;if(!Ya(t)){let a=Ri(t);for(;a&&!ac(a);){if(Sa(a)&&!qb(a))return a;a=Ri(a)}return r}let n=MO(t,e);for(;n&&NZ(n)&&qb(n);)n=MO(n,e);return n&&ac(n)&&qb(n)&&!_R(n)?r:n||LZ(t)||r}const YZ=async function(t){const e=this.getOffsetParent||J$,r=this.getDimensions,n=await r(t.floating);return{reference:WZ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function KZ(t){return xa(t).direction==="rtl"}const ZZ={convertOffsetParentRelativeRectToViewportRelativeRect:UZ,getDocumentElement:Qa,getClippingRect:VZ,getOffsetParent:J$,getElementRects:YZ,getClientRects:FZ,getDimensions:GZ,getScale:Fl,isElement:Sa,isRTL:KZ};function eB(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function XZ(t,e){let r=null,n;const a=Qa(t);function s(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function l(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),s();const f=t.getBoundingClientRect(),{left:m,top:h,width:v,height:y}=f;if(c||e(),!v||!y)return;const w=bp(h),S=bp(a.clientWidth-(m+v)),R=bp(a.clientHeight-(h+y)),x=bp(m),C={rootMargin:-w+"px "+-S+"px "+-R+"px "+-x+"px",threshold:Un(0,Ti(1,d))||1};let N=!0;function k(A){const I=A[0].intersectionRatio;if(I!==d){if(!N)return l();I?l(!1,I):n=setTimeout(()=>{l(!1,1e-7)},1e3)}I===1&&!eB(f,t.getBoundingClientRect())&&l(),N=!1}try{r=new IntersectionObserver(k,{...C,root:a.ownerDocument})}catch{r=new IntersectionObserver(k,C)}r.observe(t)}return l(!0),s}function QZ(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,f=RR(t),m=a||s?[...f?dd(f):[],...dd(e)]:[];m.forEach(x=>{a&&x.addEventListener("scroll",r,{passive:!0}),s&&x.addEventListener("resize",r)});const h=f&&c?XZ(f,r):null;let v=-1,y=null;l&&(y=new ResizeObserver(x=>{let[_]=x;_&&_.target===f&&y&&(y.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var C;(C=y)==null||C.observe(e)})),r()}),f&&!d&&y.observe(f),y.observe(e));let w,S=d?xs(t):null;d&&R();function R(){const x=xs(t);S&&!eB(S,x)&&r(),S=x,w=requestAnimationFrame(R)}return r(),()=>{var x;m.forEach(_=>{a&&_.removeEventListener("scroll",r),s&&_.removeEventListener("resize",r)}),h?.(),(x=y)==null||x.disconnect(),y=null,d&&cancelAnimationFrame(w)}}const JZ=wZ,eX=_Z,tX=EZ,rX=RZ,nX=SZ,PO=yZ,aX=TZ,oX=(t,e,r)=>{const n=new Map,a={platform:ZZ,...r},s={...a.platform,_c:n};return bZ(t,e,{...a,platform:s})};var iX=typeof document<"u",sX=function(){},$p=iX?b.useLayoutEffect:sX;function xm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!xm(t[n],e[n]))return!1;return!0}if(a=Object.keys(t),r=a.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,a[n]))return!1;for(n=r;n--!==0;){const s=a[n];if(!(s==="_owner"&&t.$$typeof)&&!xm(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function tB(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function jO(t,e){const r=tB(t);return Math.round(e*r)/r}function Hb(t){const e=b.useRef(t);return $p(()=>{e.current=t}),e}function lX(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:d,open:f}=t,[m,h]=b.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[v,y]=b.useState(n);xm(v,n)||y(n);const[w,S]=b.useState(null),[R,x]=b.useState(null),_=b.useCallback(V=>{V!==A.current&&(A.current=V,S(V))},[]),C=b.useCallback(V=>{V!==I.current&&(I.current=V,x(V))},[]),N=s||w,k=l||R,A=b.useRef(null),I=b.useRef(null),O=b.useRef(m),L=d!=null,M=Hb(d),P=Hb(a),W=Hb(f),X=b.useCallback(()=>{if(!A.current||!I.current)return;const V={placement:e,strategy:r,middleware:v};P.current&&(V.platform=P.current),oX(A.current,I.current,V).then(te=>{const re={...te,isPositioned:W.current!==!1};ee.current&&!xm(O.current,re)&&(O.current=re,bc.flushSync(()=>{h(re)}))})},[v,e,r,P,W]);$p(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,h(V=>({...V,isPositioned:!1})))},[f]);const ee=b.useRef(!1);$p(()=>(ee.current=!0,()=>{ee.current=!1}),[]),$p(()=>{if(N&&(A.current=N),k&&(I.current=k),N&&k){if(M.current)return M.current(N,k,X);X()}},[N,k,X,M,L]);const J=b.useMemo(()=>({reference:A,floating:I,setReference:_,setFloating:C}),[_,C]),j=b.useMemo(()=>({reference:N,floating:k}),[N,k]),G=b.useMemo(()=>{const V={position:r,left:0,top:0};if(!j.floating)return V;const te=jO(j.floating,m.x),re=jO(j.floating,m.y);return c?{...V,transform:"translate("+te+"px, "+re+"px)",...tB(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:te,top:re}},[r,c,j.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:X,refs:J,elements:j,floatingStyles:G}),[m,X,J,j,G])}const cX=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:a}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?PO({element:n.current,padding:a}).fn(r):{}:n?PO({element:n,padding:a}).fn(r):{}}}},uX=(t,e)=>({...JZ(t),options:[t,e]}),dX=(t,e)=>({...eX(t),options:[t,e]}),fX=(t,e)=>({...aX(t),options:[t,e]}),pX=(t,e)=>({...tX(t),options:[t,e]}),mX=(t,e)=>({...rX(t),options:[t,e]}),hX=(t,e)=>({...nX(t),options:[t,e]}),gX=(t,e)=>({...cX(t),options:[t,e]});var vX="Arrow",rB=b.forwardRef((t,e)=>{const{children:r,width:n=10,height:a=5,...s}=t;return g.jsx(bt.svg,{...s,ref:e,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});rB.displayName=vX;var bX=rB,CR="Popper",[nB,ki]=Xa(CR),[yX,aB]=nB(CR),oB=t=>{const{__scopePopper:e,children:r}=t,[n,a]=b.useState(null);return g.jsx(yX,{scope:e,anchor:n,onAnchorChange:a,children:r})};oB.displayName=CR;var iB="PopperAnchor",sB=b.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...a}=t,s=aB(iB,r),l=b.useRef(null),c=Nt(e,l),d=b.useRef(null);return b.useEffect(()=>{const f=d.current;d.current=n?.current||l.current,f!==d.current&&s.onAnchorChange(d.current)}),n?null:g.jsx(bt.div,{...a,ref:c})});sB.displayName=iB;var AR="PopperContent",[EX,SX]=nB(AR),lB=b.forwardRef((t,e)=>{const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:w,...S}=t,R=aB(AR,r),[x,_]=b.useState(null),C=Nt(e,z=>_(z)),[N,k]=b.useState(null),A=L$(N),I=A?.width??0,O=A?.height??0,L=n+(s!=="center"?"-"+s:""),M=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},P=Array.isArray(f)?f:[f],W=P.length>0,X={padding:M,boundary:P.filter(wX),altBoundary:W},{refs:ee,floatingStyles:J,placement:j,isPositioned:G,middlewareData:V}=lX({strategy:"fixed",placement:L,whileElementsMounted:(...z)=>QZ(...z,{animationFrame:y==="always"}),elements:{reference:R.anchor},middleware:[uX({mainAxis:a+O,alignmentAxis:l}),d&&dX({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?fX():void 0,...X}),d&&pX({...X}),mX({...X,apply:({elements:z,rects:K,availableWidth:ae,availableHeight:H})=>{const{width:de,height:me}=K.reference,xe=z.floating.style;xe.setProperty("--radix-popper-available-width",`${ae}px`),xe.setProperty("--radix-popper-available-height",`${H}px`),xe.setProperty("--radix-popper-anchor-width",`${de}px`),xe.setProperty("--radix-popper-anchor-height",`${me}px`)}}),N&&gX({element:N,padding:c}),_X({arrowWidth:I,arrowHeight:O}),v&&hX({strategy:"referenceHidden",...X})]}),[te,re]=dB(j),U=Wa(w);nn(()=>{G&&U?.()},[G,U]);const q=V.arrow?.x,$=V.arrow?.y,Y=V.arrow?.centerOffset!==0,[Q,F]=b.useState();return nn(()=>{x&&F(window.getComputedStyle(x).zIndex)},[x]),g.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:G?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g.jsx(EX,{scope:r,placedSide:te,onArrowChange:k,arrowX:q,arrowY:$,shouldHideArrow:Y,children:g.jsx(bt.div,{"data-side":te,"data-align":re,...S,ref:C,style:{...S.style,animation:G?void 0:"none"}})})})});lB.displayName=AR;var cB="PopperArrow",xX={top:"bottom",right:"left",bottom:"top",left:"right"},uB=b.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,s=SX(cB,n),l=xX[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(bX,{...a,ref:r,style:{...a.style,display:"block"}})})});uB.displayName=cB;function wX(t){return t!==null}var _X=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:n,middlewareData:a}=e,l=a.arrow?.centerOffset!==0,c=l?0:t.arrowWidth,d=l?0:t.arrowHeight,[f,m]=dB(r),h={start:"0%",center:"50%",end:"100%"}[m],v=(a.arrow?.x??0)+c/2,y=(a.arrow?.y??0)+d/2;let w="",S="";return f==="bottom"?(w=l?h:`${v}px`,S=`${-d}px`):f==="top"?(w=l?h:`${v}px`,S=`${n.floating.height+d}px`):f==="right"?(w=`${-d}px`,S=l?h:`${y}px`):f==="left"&&(w=`${n.floating.width+d}px`,S=l?h:`${y}px`),{data:{x:w,y:S}}}});function dB(t){const[e,r="center"]=t.split("-");return[e,r]}var Zm=oB,Ud=sB,Xm=lB,Qm=uB,TX="Portal",_c=b.forwardRef((t,e)=>{const{container:r,...n}=t,[a,s]=b.useState(!1);nn(()=>s(!0),[]);const l=r||a&&globalThis?.document?.body;return l?f$.createPortal(g.jsx(bt.div,{...n,ref:e}),l):null});_c.displayName=TX;function RX(t,e){return b.useReducer((r,n)=>e[r][n]??r,t)}var ca=t=>{const{present:e,children:r}=t,n=CX(e),a=typeof r=="function"?r({present:n.isPresent}):b.Children.only(r),s=Nt(n.ref,AX(a));return typeof r=="function"||n.isPresent?b.cloneElement(a,{ref:s}):null};ca.displayName="Presence";function CX(t){const[e,r]=b.useState(),n=b.useRef(null),a=b.useRef(t),s=b.useRef("none"),l=t?"mounted":"unmounted",[c,d]=RX(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const f=yp(n.current);s.current=c==="mounted"?f:"none"},[c]),nn(()=>{const f=n.current,m=a.current;if(m!==t){const v=s.current,y=yp(f);t?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&v!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,d]),nn(()=>{if(e){let f;const m=e.ownerDocument.defaultView??window,h=y=>{const S=yp(n.current).includes(CSS.escape(y.animationName));if(y.target===e&&S&&(d("ANIMATION_END"),!a.current)){const R=e.style.animationFillMode;e.style.animationFillMode="forwards",f=m.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=R)})}},v=y=>{y.target===e&&(s.current=yp(n.current))};return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{m.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:b.useCallback(f=>{n.current=f?getComputedStyle(f):null,r(f)},[])}}function yp(t){return t?.animationName||"none"}function AX(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var fB=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),NX="VisuallyHidden",pB=b.forwardRef((t,e)=>g.jsx(bt.span,{...t,ref:e,style:{...fB,...t.style}}));pB.displayName=NX;var kX=pB,[Jm]=Xa("Tooltip",[ki]),eh=ki(),mB="TooltipProvider",IX=700,eT="tooltip.open",[OX,NR]=Jm(mB),hB=t=>{const{__scopeTooltip:e,delayDuration:r=IX,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:s}=t,l=b.useRef(!0),c=b.useRef(!1),d=b.useRef(0);return b.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),g.jsx(OX,{scope:e,isOpenDelayedRef:l,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:b.useCallback(f=>{c.current=f},[]),disableHoverableContent:a,children:s})};hB.displayName=mB;var fd="Tooltip",[DX,Fd]=Jm(fd),gB=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:a,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,d=NR(fd,t.__scopeTooltip),f=eh(e),[m,h]=b.useState(null),v=Xr(),y=b.useRef(0),w=l??d.disableHoverableContent,S=c??d.delayDuration,R=b.useRef(!1),[x,_]=_i({prop:n,defaultProp:a??!1,onChange:I=>{I?(d.onOpen(),document.dispatchEvent(new CustomEvent(eT))):d.onClose(),s?.(I)},caller:fd}),C=b.useMemo(()=>x?R.current?"delayed-open":"instant-open":"closed",[x]),N=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,R.current=!1,_(!0)},[_]),k=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,_(!1)},[_]),A=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{R.current=!0,_(!0),y.current=0},S)},[S,_]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),g.jsx(Zm,{...f,children:g.jsx(DX,{scope:e,contentId:v,open:x,stateAttribute:C,trigger:m,onTriggerChange:h,onTriggerEnter:b.useCallback(()=>{d.isOpenDelayedRef.current?A():N()},[d.isOpenDelayedRef,A,N]),onTriggerLeave:b.useCallback(()=>{w?k():(window.clearTimeout(y.current),y.current=0)},[k,w]),onOpen:N,onClose:k,disableHoverableContent:w,children:r})})};gB.displayName=fd;var tT="TooltipTrigger",vB=b.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,a=Fd(tT,r),s=NR(tT,r),l=eh(r),c=b.useRef(null),d=Nt(e,c,a.onTriggerChange),f=b.useRef(!1),m=b.useRef(!1),h=b.useCallback(()=>f.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),g.jsx(Ud,{asChild:!0,...l,children:g.jsx(bt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:d,onPointerMove:He(t.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:He(t.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:He(t.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:He(t.onFocus,()=>{f.current||a.onOpen()}),onBlur:He(t.onBlur,a.onClose),onClick:He(t.onClick,a.onClose)})})});vB.displayName=tT;var kR="TooltipPortal",[LX,MX]=Jm(kR,{forceMount:void 0}),bB=t=>{const{__scopeTooltip:e,forceMount:r,children:n,container:a}=t,s=Fd(kR,e);return g.jsx(LX,{scope:e,forceMount:r,children:g.jsx(ca,{present:r||s.open,children:g.jsx(_c,{asChild:!0,container:a,children:n})})})};bB.displayName=kR;var oc="TooltipContent",yB=b.forwardRef((t,e)=>{const r=MX(oc,t.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...s}=t,l=Fd(oc,t.__scopeTooltip);return g.jsx(ca,{present:n||l.open,children:l.disableHoverableContent?g.jsx(EB,{side:a,...s,ref:e}):g.jsx(PX,{side:a,...s,ref:e})})}),PX=b.forwardRef((t,e)=>{const r=Fd(oc,t.__scopeTooltip),n=NR(oc,t.__scopeTooltip),a=b.useRef(null),s=Nt(e,a),[l,c]=b.useState(null),{trigger:d,onClose:f}=r,m=a.current,{onPointerInTransitChange:h}=n,v=b.useCallback(()=>{c(null),h(!1)},[h]),y=b.useCallback((w,S)=>{const R=w.currentTarget,x={x:w.clientX,y:w.clientY},_=zX(x,R.getBoundingClientRect()),C=$X(x,_),N=BX(S.getBoundingClientRect()),k=HX([...C,...N]);c(k),h(!0)},[h]);return b.useEffect(()=>()=>v(),[v]),b.useEffect(()=>{if(d&&m){const w=R=>y(R,m),S=R=>y(R,d);return d.addEventListener("pointerleave",w),m.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",w),m.removeEventListener("pointerleave",S)}}},[d,m,y,v]),b.useEffect(()=>{if(l){const w=S=>{const R=S.target,x={x:S.clientX,y:S.clientY},_=d?.contains(R)||m?.contains(R),C=!qX(x,l);_?v():C&&(v(),f())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,m,l,f,v]),g.jsx(EB,{...t,ref:s})}),[jX,UX]=Jm(fd,{isInside:!1}),FX=$K("TooltipContent"),EB=b.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,d=Fd(oc,r),f=eh(r),{onClose:m}=d;return b.useEffect(()=>(document.addEventListener(eT,m),()=>document.removeEventListener(eT,m)),[m]),b.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,m]),g.jsx(Sc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:g.jsxs(Xm,{"data-state":d.stateAttribute,...f,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(FX,{children:n}),g.jsx(jX,{scope:r,isInside:!0,children:g.jsx(kX,{id:d.contentId,role:"tooltip",children:a||n})})]})})});yB.displayName=oc;var SB="TooltipArrow",xB=b.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,a=eh(r);return UX(SB,r).isInside?null:g.jsx(Qm,{...a,...n,ref:e})});xB.displayName=SB;function zX(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),a=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(r,n,a,s)){case s:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function $X(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function BX(t){const{top:e,right:r,bottom:n,left:a}=t;return[{x:a,y:e},{x:r,y:e},{x:r,y:n},{x:a,y:n}]}function qX(t,e){const{x:r,y:n}=t;let a=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const c=e[s],d=e[l],f=c.x,m=c.y,h=d.x,v=d.y;m>n!=v>n&&r<(h-f)*(n-m)/(v-m)+f&&(a=!a)}return a}function HX(t){const e=t.slice();return e.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),VX(e)}function VX(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n<t.length;n++){const a=t[n];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(a.y-l.y)>=(s.y-l.y)*(a.x-l.x))e.pop();else break}e.push(a)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const a=t[n];for(;r.length>=2;){const s=r[r.length-1],l=r[r.length-2];if((s.x-l.x)*(a.y-l.y)>=(s.y-l.y)*(a.x-l.x))r.pop();else break}r.push(a)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var GX=hB,WX=gB,YX=vB,KX=bB,ZX=yB,XX=xB;function wB({delayDuration:t=0,...e}){return g.jsx(GX,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function jr({...t}){return g.jsx(wB,{children:g.jsx(WX,{"data-slot":"tooltip",...t})})}function Ur({...t}){return g.jsx(YX,{"data-slot":"tooltip-trigger",...t})}function Fr({className:t,sideOffset:e=0,children:r,...n}){return g.jsx(KX,{children:g.jsxs(ZX,{"data-slot":"tooltip-content",sideOffset:e,className:De("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...n,children:[r,g.jsx(XX,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}class QX{name="mcp_inspector_open";properties;constructor(e){this.properties={server_url:e.serverUrl,connection_count:e.connectionCount}}}class UO{name="mcp_tool_execution";properties;constructor(e){this.properties={tool_name:e.toolName,server_id:e.serverId,success:e.success,duration:e.duration,error:e.error}}}class FO{name="mcp_resource_read";properties;constructor(e){this.properties={resource_uri:e.resourceUri,server_id:e.serverId,success:e.success,error:e.error}}}class zO{name="mcp_prompt_call";properties;constructor(e){this.properties={prompt_name:e.promptName,server_id:e.serverId,success:e.success,error:e.error}}}class $O{name="mcp_chat_message";properties;constructor(e){this.properties={server_id:e.serverId,provider:e.provider,model:e.model,message_count:e.messageCount,tool_calls_count:e.toolCallsCount,success:e.success,execution_mode:e.executionMode,duration:e.duration,error:e.error}}}class JX{name="mcp_server_added";properties;constructor(e){this.properties={server_id:e.serverId,server_url:e.serverUrl,connection_type:e.connectionType,via_proxy:e.viaProxy}}}class eQ{name="mcp_server_removed";properties;constructor(e){this.properties={server_id:e.serverId}}}class tQ{name="mcp_command_palette_open";properties;constructor(e){this.properties={trigger:e.trigger}}}class rQ{name="mcp_tool_saved";properties;constructor(e){this.properties={tool_name:e.toolName,server_id:e.serverId}}}function Vb(){try{return"0.5.3"}catch{return"0.0.0"}}var nQ={};function Gb(){try{return typeof window<"u"&&typeof document<"u"}catch{return!1}}class BO{endpoint;timeout;constructor(e,r=3e3){this.endpoint=e,this.timeout=r}async logEvent(e){try{const r=new AbortController,n=setTimeout(()=>r.abort(),this.timeout),a=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:r.signal});if(clearTimeout(n),!a.ok)throw new Error(`HTTP error! status: ${a.status}`)}catch{}}}function di(t){return`mcp_inspector_telemetry_${t}`}class zr{static instance=null;POSTHOG_PROXY_URL="/inspector/api/tel/posthog";SCARF_PROXY_URL="/inspector/api/tel/scarf";UNKNOWN_USER_ID="UNKNOWN_USER_ID";_currUserId=null;_posthogClient=null;_scarfClient=null;_source="inspector";constructor(){const e=Gb(),r=this.isTelemetryDisabled();if(this._source=this.getStoredSource()||"inspector",r)this._posthogClient=null,this._scarfClient=null;else if(!e)this._posthogClient=null,this._scarfClient=null;else{try{this._posthogClient=new BO(this.POSTHOG_PROXY_URL,3e3)}catch{this._posthogClient=null}try{this._scarfClient=new BO(this.SCARF_PROXY_URL,3e3)}catch{this._scarfClient=null}}}isTelemetryDisabled(){return typeof localStorage<"u"&&localStorage.getItem(di("disabled"))==="true"||typeof process<"u"&&nQ?.MCP_USE_ANONYMIZED_TELEMETRY==="false"}getStoredSource(){return typeof localStorage<"u"?localStorage.getItem(di("source")):null}static getInstance(){return zr.instance||(zr.instance=new zr),zr.instance}setSource(e){this._source=e,typeof localStorage<"u"&&localStorage.setItem(di("source"),e)}getSource(){return this._source}get userId(){if(this._currUserId)return this._currUserId;if(!Gb())return this._currUserId=this.UNKNOWN_USER_ID,this._currUserId;try{const e=localStorage.getItem(di("user_id"));if(e)this._currUserId=e;else{const r=this.generateUserId();localStorage.setItem(di("user_id"),r),this._currUserId=r}this.trackPackageDownload({triggered_by:"user_id_property"}).catch(()=>{})}catch{this._currUserId=this.UNKNOWN_USER_ID}return this._currUserId}generateUserId(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const r=Math.random()*16|0;return(e==="x"?r:r&3|8).toString(16)})}async capture(e){if(!(!this._posthogClient&&!this._scarfClient)){if(this._posthogClient)try{const r={event:e.name,user_id:this.userId,properties:{...e.properties,mcp_use_version:Vb(),language:"typescript",source:this._source,package:"inspector"}};await this._posthogClient.logEvent(r)}catch{}if(this._scarfClient)try{const r={};r.mcp_use_version=Vb(),r.user_id=this.userId,r.event=e.name,r.language="typescript",r.source=this._source,r.package="inspector",await this._scarfClient.logEvent(r)}catch{}}}async trackPackageDownload(e){if(this._scarfClient&&Gb())try{const r=Vb();let n=!1,a=!1;const s=localStorage.getItem(di("download_version"));if(s?r>s&&(n=!0,a=!1,localStorage.setItem(di("download_version"),r)):(n=!0,a=!0,localStorage.setItem(di("download_version"),r)),n){const l={...e||{}};l.mcp_use_version=r,l.user_id=this.userId,l.event="package_download",l.first_download=a,l.language="typescript",l.source=this._source,l.package="inspector",await this._scarfClient.logEvent(l)}}catch{}}async trackInspectorOpen(e){const r=new QX(e);await this.capture(r)}}const _B=b.createContext(void 0);function aQ({url:t,name:e,proxyConfig:r,transportType:n,onUpdate:a,onRemove:s}){const l=typeof window<"u"?new URL("/inspector/oauth/callback",window.location.origin).toString():"/inspector/oauth/callback";let c=t,d={};if(r?.proxyAddress){const v=new URL(r.proxyAddress),y=new URL(t);c=`${v.origin}${v.pathname}${y.pathname}${y.search}`,d["X-Target-URL"]=t}r?.customHeaders&&(d={...d,...r.customHeaders});const f=fR({url:c,callbackUrl:l,customHeaders:Object.keys(d).length>0?d:void 0,transportType:n||"http"}),m=b.useRef(a),h=b.useRef(null);return b.useEffect(()=>{m.current=a},[a]),b.useEffect(()=>{if(typeof queueMicrotask<"u")queueMicrotask(()=>{f.state==="ready"&&f.serverInfo&&console.log("[McpContext] Server info available:",f.serverInfo);const v={id:t,url:t,name:f.serverInfo?.name||e,state:f.state,tools:f.tools,resources:f.resources,prompts:f.prompts,error:f.error??null,authUrl:f.authUrl??null,customHeaders:d,transportType:n,proxyConfig:r,serverInfo:f.serverInfo,capabilities:f.capabilities,callTool:f.callTool,readResource:f.readResource,listPrompts:f.listPrompts,getPrompt:f.getPrompt,authenticate:f.authenticate,retry:f.retry,clearStorage:f.clearStorage,client:f.client},y=h.current;(!y||y.state!==v.state||y.error!==v.error||y.authUrl!==v.authUrl||y.name!==v.name||y.tools.length!==v.tools.length||y.resources.length!==v.resources.length||y.prompts.length!==v.prompts.length||y.serverInfo!==v.serverInfo||y.capabilities!==v.capabilities||!y.client)&&(h.current=v,m.current(v))});else{const v={id:t,url:t,name:f.serverInfo?.name||e,state:f.state,tools:f.tools,resources:f.resources,prompts:f.prompts,error:f.error??null,authUrl:f.authUrl??null,customHeaders:d,transportType:n,proxyConfig:r,serverInfo:f.serverInfo,capabilities:f.capabilities,callTool:f.callTool,readResource:f.readResource,listPrompts:f.listPrompts,getPrompt:f.getPrompt,authenticate:f.authenticate,retry:f.retry,clearStorage:f.clearStorage,client:f.client},y=h.current;(!y||y.state!==v.state||y.error!==v.error||y.authUrl!==v.authUrl||y.name!==v.name||y.tools.length!==v.tools.length||y.resources.length!==v.resources.length||y.prompts.length!==v.prompts.length||y.serverInfo!==v.serverInfo||y.capabilities!==v.capabilities||!y.client)&&(h.current=v,m.current(v))}},[t,e,n,r,f.state,f.tools,f.resources,f.prompts,f.error,f.authUrl,f.serverInfo,f.capabilities,f.client]),null}function oQ({children:t}){const[e,r]=b.useState([]),[n,a]=b.useState(new Map),[s,l]=b.useState(0),[c,d]=b.useState(!0),[f,m]=b.useState(new Set);b.useEffect(()=>{const k=localStorage.getItem("mcp-inspector-connections");if(k)try{const I=JSON.parse(k),O=Array.isArray(I)?I.filter(M=>M&&typeof M=="object"&&typeof M.id=="string"&&typeof M.url=="string"&&typeof M.name=="string").map(M=>(M.transportType||(M.transportType="http"),M)):[];(O.length!==I.length||O.some(M=>M.transportType==="http"&&!I.find(P=>P.id===M.id&&P.transportType)))&&(console.warn("Updated connections in localStorage with transport type migration"),localStorage.setItem("mcp-inspector-connections",JSON.stringify(O))),r(O)}catch(I){console.error("Failed to parse saved connections:",I),localStorage.removeItem("mcp-inspector-connections")}const A=localStorage.getItem("mcp-inspector-auto-connect");A!==null&&d(A==="true")},[]);const h=b.useCallback(k=>{a(A=>new Map(A).set(k.id,k)),l(A=>A+1),k.serverInfo?.name&&k.state==="ready"&&r(A=>{const I=A.find(O=>O.id===k.id);if(I&&I.name!==k.serverInfo.name){const O=A.map(L=>L.id===k.id?{...L,name:k.serverInfo.name}:L);return localStorage.setItem("mcp-inspector-connections",JSON.stringify(O)),O}return A})},[]),v=b.useCallback((k,A,I,O)=>{const M={id:k,url:k,name:A||k,proxyConfig:I,transportType:O||"http"};r(P=>{if(P.some(X=>X.id===k))return P;const W=[...P,M];return localStorage.setItem("mcp-inspector-connections",JSON.stringify(W)),W})},[]),y=b.useCallback(k=>{zr.getInstance().capture(new eQ({serverId:k})).catch(()=>{}),r(I=>{const O=I.filter(L=>L.id!==k);return localStorage.setItem("mcp-inspector-connections",JSON.stringify(O)),O}),a(I=>{const O=new Map(I),L=O.get(k);if(L){try{L.clearStorage()}catch(M){console.error("Failed to clear storage:",M)}O.delete(k)}return O})},[]),w=b.useCallback(k=>{const A=n.get(k);if(A)return A;const I=e.find(O=>O.id===k);if(I)return{id:I.id,url:I.url,name:I.name,state:"disconnected",tools:[],resources:[],prompts:[],error:null,authUrl:null,transportType:I.transportType,proxyConfig:I.proxyConfig,listPrompts:async O=>{throw new Error("Not connected")},getPrompt:async()=>{throw new Error("Not connected")},callTool:async()=>{throw new Error("Not connected")},readResource:async()=>{throw new Error("Not connected")},authenticate:()=>{},retry:()=>{},clearStorage:()=>{},client:null}},[n,e]),S=b.useCallback(k=>{d(k),localStorage.setItem("mcp-inspector-auto-connect",String(k)),k||m(new Set)},[]),R=b.useCallback(k=>{m(A=>new Set(A).add(k))},[]),x=b.useCallback(k=>{m(A=>{const I=new Set(A);return I.delete(k),I}),a(A=>{const I=new Map(A),O=I.get(k);if(O){try{O.clearStorage()}catch(L){console.error("Failed to clear storage:",L)}I.delete(k)}return I})},[]),_=b.useCallback((k,A)=>{r(I=>{const O=I.map(L=>L.id===k?{...L,name:A.name||L.name,proxyConfig:A.proxyConfig,transportType:A.transportType||L.transportType}:L);return localStorage.setItem("mcp-inspector-connections",JSON.stringify(O)),O})},[]),C=b.useMemo(()=>e.map(A=>{const I=n.get(A.id);return I||{id:A.id,url:A.url,name:A.name,state:"disconnected",tools:[],resources:[],prompts:[],error:null,authUrl:null,transportType:A.transportType,proxyConfig:A.proxyConfig,callTool:async()=>{throw new Error("Not connected")},readResource:async()=>{throw new Error("Not connected")},listPrompts:async O=>{throw new Error("Not connected")},getPrompt:async()=>{throw new Error("Not connected")},authenticate:()=>{},retry:()=>{},clearStorage:()=>{},client:null}}),[n,e,s]),N=b.useMemo(()=>({connections:C,addConnection:v,removeConnection:y,getConnection:w,autoConnect:c,setAutoConnect:S,connectServer:R,disconnectServer:x,updateConnectionConfig:_}),[C,v,y,w,c,S,R,x,_]);return g.jsxs(_B,{value:N,children:[e.filter(k=>c||f.has(k.id)).map(k=>g.jsx(aQ,{url:k.url,name:k.name,proxyConfig:k.proxyConfig,transportType:k.transportType,onUpdate:h,onRemove:()=>y(k.id)},`${k.id}-${k.transportType||"http"}-${k.proxyConfig?.proxyAddress||""}`)),t]})}function IR(){const t=b.use(_B);if(!t)throw new Error("useMcpContext must be used within McpProvider");return t}const iQ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sQ=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),qO=t=>{const e=sQ(t);return e.charAt(0).toUpperCase()+e.slice(1)},TB=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim(),lQ=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var cQ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const uQ=b.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:s,iconNode:l,...c},d)=>b.createElement("svg",{ref:d,...cQ,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:TB("lucide",a),...!s&&!lQ(c)&&{"aria-hidden":"true"},...c},[...l.map(([f,m])=>b.createElement(f,m)),...Array.isArray(s)?s:[s]]));const ct=(t,e)=>{const r=b.forwardRef(({className:n,...a},s)=>b.createElement(uQ,{ref:s,iconNode:e,className:TB(`lucide-${iQ(qO(t))}`,`lucide-${t}`,n),...a}));return r.displayName=qO(t),r};const dQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],fQ=ct("arrow-up",dQ);const pQ=[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]],mQ=ct("brush",pQ);const hQ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Do=ct("check",hQ);const gQ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],RB=ct("chevron-down",gQ);const vQ=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],bQ=ct("chevron-up",vQ);const yQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],EQ=ct("circle-minus",yQ);const SQ=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ic=ct("clock",SQ);const xQ=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],wQ=ct("code",xQ);const _Q=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],TQ=ct("cog",_Q);const RQ=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],CQ=ct("command",RQ);const AQ=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],aa=ct("copy",AQ);const NQ=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],th=ct("database",NQ);const kQ=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],CB=ct("download",kQ);const IQ=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],HO=ct("external-link",IQ);const OQ=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],DQ=ct("eye-off",OQ);const LQ=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],VO=ct("eye",LQ);const MQ=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],PQ=ct("file-code",MQ);const jQ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],UQ=ct("file-image",jQ);const FQ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],OR=ct("file-text",FQ);const zQ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],$Q=ct("file",zQ);const BQ=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],qQ=ct("folder-open",BQ);const HQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],VQ=ct("globe",HQ);const GQ=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],WQ=ct("grip-vertical",GQ);const YQ=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],AB=ct("history",YQ);const KQ=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],NB=ct("key",KQ);const ZQ=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zd=ct("loader-circle",ZQ);const XQ=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],QQ=ct("maximize",XQ);const JQ=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],eJ=ct("message-circle",JQ);const tJ=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],pd=ct("message-square",tJ);const rJ=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],GO=ct("monitor",rJ);const nJ=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],aJ=ct("moon",nJ);const oJ=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],kB=ct("play",oJ);const iJ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],IB=ct("plus",iJ);const sJ=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],lJ=ct("rotate-ccw",sJ);const cJ=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],DR=ct("save",cJ);const uJ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],LR=ct("search",uJ);const dJ=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],fJ=ct("send",dJ);const pJ=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],wm=ct("settings",pJ);const mJ=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],hJ=ct("shield",mJ);const gJ=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 4h.01",key:"1ujb9j"}],["path",{d:"M20 12h.01",key:"1ykeid"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M4 12h.01",key:"158zrr"}],["path",{d:"M17.657 6.343h.01",key:"31pqzk"}],["path",{d:"M17.657 17.657h.01",key:"jehnf4"}],["path",{d:"M6.343 17.657h.01",key:"gdk6ow"}],["path",{d:"M6.343 6.343h.01",key:"1uurf0"}]],vJ=ct("sun-dim",gJ);const bJ=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Wb=ct("terminal",bJ);const yJ=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],rT=ct("trash-2",yJ);const EJ=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],SJ=ct("trash",EJ);const xJ=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],ws=ct("wrench",xJ);const wJ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$d=ct("x",wJ);const _J=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],md=ct("zap",_J);function TJ(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const RJ=t=>{switch(t){case"success":return NJ;case"info":return IJ;case"warning":return kJ;case"error":return OJ;default:return null}},CJ=Array(12).fill(0),AJ=({visible:t,className:e})=>le.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},le.createElement("div",{className:"sonner-spinner"},CJ.map((r,n)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),NJ=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),kJ=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),IJ=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),OJ=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),DJ=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),LJ=()=>{const[t,e]=le.useState(document.hidden);return le.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let nT=1;class MJ{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:n,...a}=e,s=typeof e?.id=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:nT++,l=this.toasts.find(d=>d.id===s),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),l?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:c,title:n}):d):this.addToast({title:n,...a,dismissible:c,id:s}),s},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const a=Promise.resolve(e instanceof Function?e():e);let s=n!==void 0,l;const c=a.then(async f=>{if(l=["resolve",f],le.isValidElement(f))s=!1,this.create({id:n,type:"default",message:f});else if(jJ(f)&&!f.ok){s=!1;const h=typeof r.error=="function"?await r.error(`HTTP error! status: ${f.status}`):r.error,v=typeof r.description=="function"?await r.description(`HTTP error! status: ${f.status}`):r.description,w=typeof h=="object"&&!le.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:v,...w})}else if(f instanceof Error){s=!1;const h=typeof r.error=="function"?await r.error(f):r.error,v=typeof r.description=="function"?await r.description(f):r.description,w=typeof h=="object"&&!le.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:v,...w})}else if(r.success!==void 0){s=!1;const h=typeof r.success=="function"?await r.success(f):r.success,v=typeof r.description=="function"?await r.description(f):r.description,w=typeof h=="object"&&!le.isValidElement(h)?h:{message:h};this.create({id:n,type:"success",description:v,...w})}}).catch(async f=>{if(l=["reject",f],r.error!==void 0){s=!1;const m=typeof r.error=="function"?await r.error(f):r.error,h=typeof r.description=="function"?await r.description(f):r.description,y=typeof m=="object"&&!le.isValidElement(m)?m:{message:m};this.create({id:n,type:"error",description:h,...y})}}).finally(()=>{s&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),d=()=>new Promise((f,m)=>c.then(()=>l[0]==="reject"?m(l[1]):f(l[1])).catch(m));return typeof n!="string"&&typeof n!="number"?{unwrap:d}:Object.assign(n,{unwrap:d})},this.custom=(e,r)=>{const n=r?.id||nT++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Sn=new MJ,PJ=(t,e)=>{const r=e?.id||nT++;return Sn.addToast({title:t,...e,id:r}),r},jJ=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",UJ=PJ,FJ=()=>Sn.toasts,zJ=()=>Sn.getActiveToasts(),cr=Object.assign(UJ,{success:Sn.success,info:Sn.info,warning:Sn.warning,error:Sn.error,custom:Sn.custom,message:Sn.message,promise:Sn.promise,dismiss:Sn.dismiss,loading:Sn.loading},{getHistory:FJ,getToasts:zJ});TJ("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ep(t){return t.label!==void 0}const $J=3,BJ="24px",qJ="16px",WO=4e3,HJ=356,VJ=14,GJ=45,WJ=200;function ka(...t){return t.filter(Boolean).join(" ")}function YJ(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const KJ=t=>{var e,r,n,a,s,l,c,d,f;const{invert:m,toast:h,unstyled:v,interacting:y,setHeights:w,visibleToasts:S,heights:R,index:x,toasts:_,expanded:C,removeToast:N,defaultRichColors:k,closeButton:A,style:I,cancelButtonStyle:O,actionButtonStyle:L,className:M="",descriptionClassName:P="",duration:W,position:X,gap:ee,expandByDefault:J,classNames:j,icons:G,closeButtonAriaLabel:V="Close toast"}=t,[te,re]=le.useState(null),[U,q]=le.useState(null),[$,Y]=le.useState(!1),[Q,F]=le.useState(!1),[z,K]=le.useState(!1),[ae,H]=le.useState(!1),[de,me]=le.useState(!1),[xe,be]=le.useState(0),[_e,Ae]=le.useState(0),Fe=le.useRef(h.duration||W||WO),Pe=le.useRef(null),$e=le.useRef(null),at=x===0,ce=x+1<=S,Ce=h.type,ze=h.dismissible!==!1,we=h.className||"",Ne=h.descriptionClassName||"",Oe=le.useMemo(()=>R.findIndex(Qe=>Qe.toastId===h.id)||0,[R,h.id]),Je=le.useMemo(()=>{var Qe;return(Qe=h.closeButton)!=null?Qe:A},[h.closeButton,A]),ot=le.useMemo(()=>h.duration||W||WO,[h.duration,W]),Rt=le.useRef(0),Ot=le.useRef(0),Cn=le.useRef(0),vr=le.useRef(null),[or,Mt]=X.split("-"),Zt=le.useMemo(()=>R.reduce((Qe,jt,Qt)=>Qt>=Oe?Qe:Qe+jt.height,0),[R,Oe]),fr=LJ(),Sr=h.invert||m,zn=Ce==="loading";Ot.current=le.useMemo(()=>Oe*ee+Zt,[Oe,Zt]),le.useEffect(()=>{Fe.current=ot},[ot]),le.useEffect(()=>{Y(!0)},[]),le.useEffect(()=>{const Qe=$e.current;if(Qe){const jt=Qe.getBoundingClientRect().height;return Ae(jt),w(Qt=>[{toastId:h.id,height:jt,position:h.position},...Qt]),()=>w(Qt=>Qt.filter(Lr=>Lr.toastId!==h.id))}},[w,h.id]),le.useLayoutEffect(()=>{if(!$)return;const Qe=$e.current,jt=Qe.style.height;Qe.style.height="auto";const Qt=Qe.getBoundingClientRect().height;Qe.style.height=jt,Ae(Qt),w(Lr=>Lr.find(Xt=>Xt.toastId===h.id)?Lr.map(Xt=>Xt.toastId===h.id?{...Xt,height:Qt}:Xt):[{toastId:h.id,height:Qt,position:h.position},...Lr])},[$,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const ir=le.useCallback(()=>{F(!0),be(Ot.current),w(Qe=>Qe.filter(jt=>jt.toastId!==h.id)),setTimeout(()=>{N(h)},WJ)},[h,N,w,Ot]);le.useEffect(()=>{if(h.promise&&Ce==="loading"||h.duration===1/0||h.type==="loading")return;let Qe;return C||y||fr?(()=>{if(Cn.current<Rt.current){const Lr=new Date().getTime()-Rt.current;Fe.current=Fe.current-Lr}Cn.current=new Date().getTime()})():(()=>{Fe.current!==1/0&&(Rt.current=new Date().getTime(),Qe=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),ir()},Fe.current))})(),()=>clearTimeout(Qe)},[C,y,h,Ce,fr,ir]),le.useEffect(()=>{h.delete&&(ir(),h.onDismiss==null||h.onDismiss.call(h,h))},[ir,h.delete]);function Gt(){var Qe;if(G?.loading){var jt;return le.createElement("div",{className:ka(j?.loader,h==null||(jt=h.classNames)==null?void 0:jt.loader,"sonner-loader"),"data-visible":Ce==="loading"},G.loading)}return le.createElement(AJ,{className:ka(j?.loader,h==null||(Qe=h.classNames)==null?void 0:Qe.loader),visible:Ce==="loading"})}const pn=h.icon||G?.[Ce]||RJ(Ce);var ua,an;return le.createElement("li",{tabIndex:0,ref:$e,className:ka(M,we,j?.toast,h==null||(e=h.classNames)==null?void 0:e.toast,j?.default,j?.[Ce],h==null||(r=h.classNames)==null?void 0:r[Ce]),"data-sonner-toast":"","data-rich-colors":(ua=h.richColors)!=null?ua:k,"data-styled":!(h.jsx||h.unstyled||v),"data-mounted":$,"data-promise":!!h.promise,"data-swiped":de,"data-removed":Q,"data-visible":ce,"data-y-position":or,"data-x-position":Mt,"data-index":x,"data-front":at,"data-swiping":z,"data-dismissible":ze,"data-type":Ce,"data-invert":Sr,"data-swipe-out":ae,"data-swipe-direction":U,"data-expanded":!!(C||J&&$),"data-testid":h.testId,style:{"--index":x,"--toasts-before":x,"--z-index":_.length-x,"--offset":`${Q?xe:Ot.current}px`,"--initial-height":J?"auto":`${_e}px`,...I,...h.style},onDragEnd:()=>{K(!1),re(null),vr.current=null},onPointerDown:Qe=>{Qe.button!==2&&(zn||!ze||(Pe.current=new Date,be(Ot.current),Qe.target.setPointerCapture(Qe.pointerId),Qe.target.tagName!=="BUTTON"&&(K(!0),vr.current={x:Qe.clientX,y:Qe.clientY})))},onPointerUp:()=>{var Qe,jt,Qt;if(ae||!ze)return;vr.current=null;const Lr=Number(((Qe=$e.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$n=Number(((jt=$e.current)==null?void 0:jt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xt=new Date().getTime()-((Qt=Pe.current)==null?void 0:Qt.getTime()),Jr=te==="x"?Lr:$n,_a=Math.abs(Jr)/Xt;if(Math.abs(Jr)>=GJ||_a>.11){be(Ot.current),h.onDismiss==null||h.onDismiss.call(h,h),q(te==="x"?Lr>0?"right":"left":$n>0?"down":"up"),ir(),H(!0);return}else{var en,Br;(en=$e.current)==null||en.style.setProperty("--swipe-amount-x","0px"),(Br=$e.current)==null||Br.style.setProperty("--swipe-amount-y","0px")}me(!1),K(!1),re(null)},onPointerMove:Qe=>{var jt,Qt,Lr;if(!vr.current||!ze||((jt=window.getSelection())==null?void 0:jt.toString().length)>0)return;const Xt=Qe.clientY-vr.current.y,Jr=Qe.clientX-vr.current.x;var _a;const en=(_a=t.swipeDirections)!=null?_a:YJ(X);!te&&(Math.abs(Jr)>1||Math.abs(Xt)>1)&&re(Math.abs(Jr)>Math.abs(Xt)?"x":"y");let Br={x:0,y:0};const oe=Z=>1/(1.5+Math.abs(Z)/20);if(te==="y"){if(en.includes("top")||en.includes("bottom"))if(en.includes("top")&&Xt<0||en.includes("bottom")&&Xt>0)Br.y=Xt;else{const Z=Xt*oe(Xt);Br.y=Math.abs(Z)<Math.abs(Xt)?Z:Xt}}else if(te==="x"&&(en.includes("left")||en.includes("right")))if(en.includes("left")&&Jr<0||en.includes("right")&&Jr>0)Br.x=Jr;else{const Z=Jr*oe(Jr);Br.x=Math.abs(Z)<Math.abs(Jr)?Z:Jr}(Math.abs(Br.x)>0||Math.abs(Br.y)>0)&&me(!0),(Qt=$e.current)==null||Qt.style.setProperty("--swipe-amount-x",`${Br.x}px`),(Lr=$e.current)==null||Lr.style.setProperty("--swipe-amount-y",`${Br.y}px`)}},Je&&!h.jsx&&Ce!=="loading"?le.createElement("button",{"aria-label":V,"data-disabled":zn,"data-close-button":!0,onClick:zn||!ze?()=>{}:()=>{ir(),h.onDismiss==null||h.onDismiss.call(h,h)},className:ka(j?.closeButton,h==null||(n=h.classNames)==null?void 0:n.closeButton)},(an=G?.close)!=null?an:DJ):null,(Ce||h.icon||h.promise)&&h.icon!==null&&(G?.[Ce]!==null||h.icon)?le.createElement("div",{"data-icon":"",className:ka(j?.icon,h==null||(a=h.classNames)==null?void 0:a.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Gt():null,h.type!=="loading"?pn:null):null,le.createElement("div",{"data-content":"",className:ka(j?.content,h==null||(s=h.classNames)==null?void 0:s.content)},le.createElement("div",{"data-title":"",className:ka(j?.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?le.createElement("div",{"data-description":"",className:ka(P,Ne,j?.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),le.isValidElement(h.cancel)?h.cancel:h.cancel&&Ep(h.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||O,onClick:Qe=>{Ep(h.cancel)&&ze&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Qe),ir())},className:ka(j?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,le.isValidElement(h.action)?h.action:h.action&&Ep(h.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:Qe=>{Ep(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Qe),!Qe.defaultPrevented&&ir())},className:ka(j?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function YO(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function ZJ(t,e){const r={};return[t,e].forEach((n,a)=>{const s=a===1,l=s?"--mobile-offset":"--offset",c=s?qJ:BJ;function d(f){["top","right","bottom","left"].forEach(m=>{r[`${l}-${m}`]=typeof f=="number"?`${f}px`:f})}typeof n=="number"||typeof n=="string"?d(n):typeof n=="object"?["top","right","bottom","left"].forEach(f=>{n[f]===void 0?r[`${l}-${f}`]=c:r[`${l}-${f}`]=typeof n[f]=="number"?`${n[f]}px`:n[f]}):d(c)}),r}const XJ=le.forwardRef(function(e,r){const{id:n,invert:a,position:s="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:m,mobileOffset:h,theme:v="light",richColors:y,duration:w,style:S,visibleToasts:R=$J,toastOptions:x,dir:_=YO(),gap:C=VJ,icons:N,containerAriaLabel:k="Notifications"}=e,[A,I]=le.useState([]),O=le.useMemo(()=>n?A.filter($=>$.toasterId===n):A.filter($=>!$.toasterId),[A,n]),L=le.useMemo(()=>Array.from(new Set([s].concat(O.filter($=>$.position).map($=>$.position)))),[O,s]),[M,P]=le.useState([]),[W,X]=le.useState(!1),[ee,J]=le.useState(!1),[j,G]=le.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=le.useRef(null),te=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),re=le.useRef(null),U=le.useRef(!1),q=le.useCallback($=>{I(Y=>{var Q;return(Q=Y.find(F=>F.id===$.id))!=null&&Q.delete||Sn.dismiss($.id),Y.filter(({id:F})=>F!==$.id)})},[]);return le.useEffect(()=>Sn.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{I(Y=>Y.map(Q=>Q.id===$.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{f$.flushSync(()=>{I(Y=>{const Q=Y.findIndex(F=>F.id===$.id);return Q!==-1?[...Y.slice(0,Q),{...Y[Q],...$},...Y.slice(Q+1)]:[$,...Y]})})})}),[A]),le.useEffect(()=>{if(v!=="system"){G(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:Y})=>{G(Y?"dark":"light")})}catch{$.addListener(({matches:Q})=>{try{G(Q?"dark":"light")}catch(F){console.error(F)}})}},[v]),le.useEffect(()=>{A.length<=1&&X(!1)},[A]),le.useEffect(()=>{const $=Y=>{var Q;if(l.every(K=>Y[K]||Y.code===K)){var z;X(!0),(z=V.current)==null||z.focus()}Y.code==="Escape"&&(document.activeElement===V.current||(Q=V.current)!=null&&Q.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[l]),le.useEffect(()=>{if(V.current)return()=>{re.current&&(re.current.focus({preventScroll:!0}),re.current=null,U.current=!1)}},[V.current]),le.createElement("section",{ref:r,"aria-label":`${k} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map(($,Y)=>{var Q;const[F,z]=$.split("-");return O.length?le.createElement("ol",{key:$,dir:_==="auto"?YO():_,tabIndex:-1,ref:V,className:f,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":F,"data-x-position":z,style:{"--front-toast-height":`${((Q=M[0])==null?void 0:Q.height)||0}px`,"--width":`${HJ}px`,"--gap":`${C}px`,...S,...ZJ(m,h)},onBlur:K=>{U.current&&!K.currentTarget.contains(K.relatedTarget)&&(U.current=!1,re.current&&(re.current.focus({preventScroll:!0}),re.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||U.current||(U.current=!0,re.current=K.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{ee||X(!1)},onDragEnd:()=>X(!1),onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||J(!0)},onPointerUp:()=>J(!1)},O.filter(K=>!K.position&&Y===0||K.position===$).map((K,ae)=>{var H,de;return le.createElement(KJ,{key:K.id,icons:N,index:ae,toast:K,defaultRichColors:y,duration:(H=x?.duration)!=null?H:w,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:a,visibleToasts:R,closeButton:(de=x?.closeButton)!=null?de:d,interacting:ee,position:$,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:q,toasts:O.filter(me=>me.position==K.position),heights:M.filter(me=>me.position==K.position),setHeights:P,expandByDefault:c,gap:C,expanded:W,swipeDirections:e.swipeDirections})})):null}))});var Yb="focusScope.autoFocusOnMount",Kb="focusScope.autoFocusOnUnmount",KO={bubbles:!1,cancelable:!0},QJ="FocusScope",Bd=b.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=t,[c,d]=b.useState(null),f=Wa(a),m=Wa(s),h=b.useRef(null),v=Nt(e,S=>d(S)),y=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let S=function(C){if(y.paused||!c)return;const N=C.target;c.contains(N)?h.current=N:pi(h.current,{select:!0})},R=function(C){if(y.paused||!c)return;const N=C.relatedTarget;N!==null&&(c.contains(N)||pi(h.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const k of C)k.removedNodes.length>0&&pi(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",R);const _=new MutationObserver(x);return c&&_.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",R),_.disconnect()}}},[n,c,y.paused]),b.useEffect(()=>{if(c){XO.add(y);const S=document.activeElement;if(!c.contains(S)){const x=new CustomEvent(Yb,KO);c.addEventListener(Yb,f),c.dispatchEvent(x),x.defaultPrevented||(JJ(aee(OB(c)),{select:!0}),document.activeElement===S&&pi(c))}return()=>{c.removeEventListener(Yb,f),setTimeout(()=>{const x=new CustomEvent(Kb,KO);c.addEventListener(Kb,m),c.dispatchEvent(x),x.defaultPrevented||pi(S??document.body,{select:!0}),c.removeEventListener(Kb,m),XO.remove(y)},0)}}},[c,f,m,y]);const w=b.useCallback(S=>{if(!r&&!n||y.paused)return;const R=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,x=document.activeElement;if(R&&x){const _=S.currentTarget,[C,N]=eee(_);C&&N?!S.shiftKey&&x===N?(S.preventDefault(),r&&pi(C,{select:!0})):S.shiftKey&&x===C&&(S.preventDefault(),r&&pi(N,{select:!0})):x===_&&S.preventDefault()}},[r,n,y.paused]);return g.jsx(bt.div,{tabIndex:-1,...l,ref:v,onKeyDown:w})});Bd.displayName=QJ;function JJ(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(pi(n,{select:e}),document.activeElement!==r)return}function eee(t){const e=OB(t),r=ZO(e,t),n=ZO(e.reverse(),t);return[r,n]}function OB(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function ZO(t,e){for(const r of t)if(!tee(r,{upTo:e}))return r}function tee(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function ree(t){return t instanceof HTMLInputElement&&"select"in t}function pi(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&ree(t)&&e&&t.select()}}var XO=nee();function nee(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=QO(t,e),t.unshift(e)},remove(e){t=QO(t,e),t[0]?.resume()}}}function QO(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function aee(t){return t.filter(e=>e.tagName!=="A")}var Zb=0;function rh(){b.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??JO()),document.body.insertAdjacentElement("beforeend",t[1]??JO()),Zb++,()=>{Zb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Zb--}},[])}function JO(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Ma=function(){return Ma=Object.assign||function(e){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Ma.apply(this,arguments)};function DB(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]]);return r}function oee(t,e,r){if(r||arguments.length===2)for(var n=0,a=e.length,s;n<a;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}var Bp="right-scroll-bar-position",qp="width-before-scroll-bar",iee="with-scroll-bars-hidden",see="--removed-body-scroll-bar-size";function Xb(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function lee(t,e){var r=b.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=e,r.facade}var cee=typeof window<"u"?b.useLayoutEffect:b.useEffect,eD=new WeakMap;function uee(t,e){var r=lee(null,function(n){return t.forEach(function(a){return Xb(a,n)})});return cee(function(){var n=eD.get(r);if(n){var a=new Set(n),s=new Set(t),l=r.current;a.forEach(function(c){s.has(c)||Xb(c,null)}),s.forEach(function(c){a.has(c)||Xb(c,l)})}eD.set(r,t)},[t]),r}function dee(t){return t}function fee(t,e){e===void 0&&(e=dee);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(s){var l=e(s,n);return r.push(l),function(){r=r.filter(function(c){return c!==l})}},assignSyncMedium:function(s){for(n=!0;r.length;){var l=r;r=[],l.forEach(s)}r={push:function(c){return s(c)},filter:function(){return r}}},assignMedium:function(s){n=!0;var l=[];if(r.length){var c=r;r=[],c.forEach(s),l=r}var d=function(){var m=l;l=[],m.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),r={push:function(m){l.push(m),f()},filter:function(m){return l=l.filter(m),r}}}};return a}function pee(t){t===void 0&&(t={});var e=fee(null);return e.options=Ma({async:!0,ssr:!1},t),e}var LB=function(t){var e=t.sideCar,r=DB(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return b.createElement(n,Ma({},r))};LB.isSideCarExport=!0;function mee(t,e){return t.useMedium(e),LB}var MB=pee(),Qb=function(){},nh=b.forwardRef(function(t,e){var r=b.useRef(null),n=b.useState({onScrollCapture:Qb,onWheelCapture:Qb,onTouchMoveCapture:Qb}),a=n[0],s=n[1],l=t.forwardProps,c=t.children,d=t.className,f=t.removeScrollBar,m=t.enabled,h=t.shards,v=t.sideCar,y=t.noRelative,w=t.noIsolation,S=t.inert,R=t.allowPinchZoom,x=t.as,_=x===void 0?"div":x,C=t.gapMode,N=DB(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=v,A=uee([r,e]),I=Ma(Ma({},N),a);return b.createElement(b.Fragment,null,m&&b.createElement(k,{sideCar:MB,removeScrollBar:f,shards:h,noRelative:y,noIsolation:w,inert:S,setCallbacks:s,allowPinchZoom:!!R,lockRef:r,gapMode:C}),l?b.cloneElement(b.Children.only(c),Ma(Ma({},I),{ref:A})):b.createElement(_,Ma({},I,{className:d,ref:A}),c))});nh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nh.classNames={fullWidth:qp,zeroRight:Bp};var hee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gee(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=hee();return e&&t.setAttribute("nonce",e),t}function vee(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function bee(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var yee=function(){var t=0,e=null;return{add:function(r){t==0&&(e=gee())&&(vee(e,r),bee(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Eee=function(){var t=yee();return function(e,r){b.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},PB=function(){var t=Eee(),e=function(r){var n=r.styles,a=r.dynamic;return t(n,a),null};return e},See={left:0,top:0,right:0,gap:0},Jb=function(t){return parseInt(t||"",10)||0},xee=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],a=e[t==="padding"?"paddingRight":"marginRight"];return[Jb(r),Jb(n),Jb(a)]},wee=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return See;var e=xee(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},_ee=PB(),zl="data-scroll-locked",Tee=function(t,e,r,n){var a=t.left,s=t.top,l=t.right,c=t.gap;return r===void 0&&(r="margin"),`
26
26
  .`.concat(iee,` {
27
27
  overflow: hidden `).concat(n,`;
28
28
  padding-right: `).concat(c,"px ").concat(n,`;
@@ -1542,7 +1542,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1542
1542
  <\/script>
1543
1543
  </body>
1544
1544
  </html>`,h5=1,Mz=2,g5=3,Pz=4,v5=5,jz=Symbol.for("quilt.threads.serialize"),Zge=Symbol.for("quilt.threads.transferable");class Xge extends AbortController{constructor(...e){super();const r=e.find(n=>n.aborted);if(r)this.abort(r.reason);else{const n=s=>this.abort(s.target.reason),a={signal:this.signal};for(const s of e)s.addEventListener("abort",n,a)}}}class Uz extends Error{constructor(){super("You attempted to call a function on a closed thread.")}}let Qge="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function b5(t=21){let e="",r=crypto.getRandomValues(new Uint8Array(t));for(let n=0;n<t;n++)e+=Qge[63&r[n]];return e}var Ou,Tl,Du,Xp,FT,y5;class Jge{constructor(){ya(this,FT),ya(this,Ou,new Map),ya(this,Tl,new Map),ya(this,Du,new Map),ya(this,Xp,new WeakMap)}get(e){return nr(this,Tl).get(e)}release(e){const r=nr(this,Tl).get(e);return r&&(nr(this,Tl).delete(e),nr(this,Ou).delete(r)),!!r}serialize(e){let r=nr(this,Ou).get(e);return r==null&&(r=b5(),nr(this,Ou).set(e,r),nr(this,Tl).set(r,e)),r}deserialize(e,r){var n,a;let s=(n=nr(this,Du).get(e))==null?void 0:n.deref();return s||(s=(...l)=>{if(!nr(this,Du).has(e))throw new Error("You attempted to call a function that was already revoked.");return r.call((c,d,f)=>{r.messages.send([g5,c,e,d],f)},l)},(a=Zr(this,FT,y5).call(this,r))==null||a.register(s,e),nr(this,Du).set(e,new WeakRef(s)),s)}}Ou=new WeakMap,Tl=new WeakMap,Du=new WeakMap,Xp=new WeakMap,FT=new WeakSet,y5=function(t){let e=nr(this,Xp).get(t);if(!(typeof FinalizationRegistry>"u"))return e||(e=new FinalizationRegistry(r=>{t.messages.send([v5,r])}),nr(this,Xp).set(t,e)),e};function eve(t){return t!=null&&(Symbol.asyncIterator in t||Symbol.iterator in t)&&typeof t.next=="function"}function Fz(t){if(t==null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e==null||e===Object.prototype}const c_="_@f",zz="_@i";var rd,nd,ta,Qp,hi;class tve{constructor(e){ya(this,ta),ya(this,rd),ya(this,nd),jT(this,rd,e?.serialize),jT(this,nd,e?.deserialize)}serialize(e,r,n){return Zr(this,ta,Qp).call(this,e,r,n)}deserialize(e,r){return Zr(this,ta,hi).call(this,e,r)}}rd=new WeakMap,nd=new WeakMap,ta=new WeakSet,Qp=function(t,e,r,n=new Map,a=!1){if(t==null)return t;if(n.has(t))return n.get(t);if(n.set(t,void 0),typeof t=="object"){if(nr(this,rd)&&!a){const c=nr(this,rd).call(this,t,d=>Zr(this,ta,Qp).call(this,d,e,r,n,!0),e,r);if(c!==void 0)return n.set(t,c),c}if(t[Zge])return r?.push(t),n.set(t,t),t;const s=c=>Zr(this,ta,Qp).call(this,c,e,r,n);if(typeof t[jz]=="function"){const c=t[jz]({serialize:s});return n.set(t,c),c}if(Array.isArray(t)){const c=t.map(d=>s(d));return n.set(t,c),c}if(t instanceof Map){const c=[...t.entries()].map(([f,m])=>[s(f),s(m)]),d=new Map(c);return n.set(t,d),d}if(t instanceof Set){const c=[...t].map(f=>s(f)),d=new Set(c);return n.set(t,d),d}const l=eve(t);if(Fz(t)||l){const c={};for(const d of Object.keys(t))c[d]=s(t[d]);return l&&(c.next??(c.next=s(t.next.bind(t))),c.return??(c.return=s(t.return.bind(t))),c.throw??(c.throw=s(t.throw.bind(t))),c[zz]=!0),n.set(t,c),c}}if(typeof t=="function"){const s=e.functions.serialize(t,e,r),l={[c_]:s};return n.set(t,l),l}return n.set(t,t),t},hi=function(t,e,r=!1){if(t==null)return t;if(typeof t=="object"){if(nr(this,nd)&&!r){const a=nr(this,nd).call(this,t,s=>Zr(this,ta,hi).call(this,s,e,!0),e);if(a!==void 0)return a}if(t==null)return t;if(Array.isArray(t))return t.map(a=>Zr(this,ta,hi).call(this,a,e));if(t instanceof Map)return new Map([...t].map(([a,s])=>[Zr(this,ta,hi).call(this,a,e),Zr(this,ta,hi).call(this,s,e)]));if(t instanceof Set)return new Set([...t].map(a=>Zr(this,ta,hi).call(this,a,e)));if(c_ in t)return e.functions.deserialize(t[c_],e);if(!Fz(t))return t;const n={};for(const a of Object.keys(t))a===zz?n[Symbol.asyncIterator]=()=>n:n[a]=Zr(this,ta,hi).call(this,t[a],e);return n}return t};var Rl,fs,gi,zT,E5,$T,S5;class rve{constructor(e,{imports:r,exports:n,functions:a=new Jge,serialization:s=new tve,signal:l}={}){ya(this,gi),ya(this,Rl),ya(this,fs,new Map);var c,d,f,m;this.messages=e,jT(this,Rl,l?new Xge(l):new AbortController),this.exports=n??{},this.imports=nve(Zr(this,gi,E5).bind(this),r),this.functions=a,this.serialization=s,(d=(c=this.functions).start)==null||d.call(c,this),(m=(f=this.serialization).start)==null||m.call(f,this),this.signal.addEventListener("abort",()=>{for(const h of nr(this,fs).keys())Zr(this,gi,$T).call(this,h,void 0,new Uz);nr(this,fs).clear()},{once:!0}),e.listen(async h=>{if(!(Array.isArray(h)&&typeof h[0]=="number"))return;const v=h;switch(v[0]){case h5:{const[,y,w,S]=v,R=this.exports[w]??(()=>{throw new Error(`No '${w}' method is exported from this thread`)});await Zr(this,gi,zT).call(this,R,S,(x,_,C)=>{this.messages.send([Mz,y,x,_],C)});break}case g5:{const[,y,w,S]=v,R=this.functions.get(w,this)??ave;await Zr(this,gi,zT).call(this,R,S,(x,_,C)=>{this.messages.send([Pz,y,x,_],C)});break}case Mz:case Pz:{Zr(this,gi,$T).call(this,...v.slice(1));break}case v5:{const y=v[1];this.functions.release(y,this);break}}},{signal:this.signal})}get signal(){return nr(this,Rl).signal}get closed(){return nr(this,Rl).signal.aborted}close(){nr(this,Rl).abort()}call(e,r){if(this.closed)return Promise.reject(new Uz);const n=[],a=this.serialization.serialize(r,this,n),s=b5(),l=Zr(this,gi,S5).call(this,s);return e(s,a,n),l}}Rl=new WeakMap,fs=new WeakMap,gi=new WeakSet,zT=async function(t,e,r){try{const n=this.functions.call?await this.functions.call(t,e,this):await t(...this.serialization.deserialize(e,this)),a=[],s=this.serialization.serialize(n,this,a);r(s,void 0,a)}catch(n){r(void 0,this.serialization.serialize(n,this))}},E5=function(t){return(...e)=>{try{if(typeof t!="string"&&typeof t!="number")throw new Error(`Can’t call a symbol method on a thread: ${t.toString()}`);return this.call((r,n,a)=>{this.messages.send([h5,r,t,n],a)},e)}catch(r){return Promise.reject(r)}}},$T=function(...t){const e=t[0],r=nr(this,fs).get(e);r&&(r(...t),nr(this,fs).delete(e))},S5=function(t){const e=new Promise((r,n)=>{nr(this,fs).set(t,(a,s,l)=>{l==null?r(this.serialization.deserialize(s,this)):n(this.serialization.deserialize(l,this))})});return Object.defineProperty(e,Symbol.asyncIterator,{async*value(){const r=await e;Object.defineProperty(r,Symbol.asyncIterator,{value:()=>r}),yield*r}}),e};function nve(t,e){let r;if(e==null){if(typeof Proxy!="function")throw new Error("You must pass an array of callable methods in environments without Proxies.");const n=new Map;r=new Proxy({},{get(a,s){if(n.has(s))return n.get(s);const l=t(s);return n.set(s,l),l}})}else{r={};for(const n of e)Object.defineProperty(r,n,{value:t(n),writable:!1,configurable:!0,enumerable:!0})}return r}function ave(){throw new Error("You attempted to call a function that is not stored. It may have already been released.")}const ove="quilt.threads.ping",$z="quilt.threads.pong";function ive(t,{targetOrigin:e="*"}={}){let r=!1;const n=function(s,l){t.postMessage(s,e,l)},a=new Promise(s=>{const l=new AbortController;globalThis.window.addEventListener("message",c=>{c.source===t&&c.data===$z&&(r=!0,l.abort(),s())},{signal:l.signal}),l.signal.addEventListener("abort",()=>s(),{once:!0}),n(ove)});return{send(s,l){return r?n(s,l):a.then(()=>{if(r)return n(s,l)})},listen(s,{signal:l}){self.addEventListener("message",c=>{c.source===t&&c.data!==$z&&s(c.data)},{signal:l})}}}class sve extends rve{constructor(e,{targetOrigin:r="*",...n}={}){super(ive(e.contentWindow,{targetOrigin:r}),n),this.iframe=e}}const x5=le.forwardRef(({content:t,children:e,...r},n)=>g.jsx("span",{ref:n,...r,children:t||e}));x5.displayName="UIText";const w5=le.forwardRef(({label:t,onPress:e,onClick:r,children:n,...a},s)=>g.jsx("button",{ref:s,onClick:l=>{e&&e(),r&&r(l)},style:{padding:"8px 16px",backgroundColor:"#007bff",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"},...a,children:t||n}));w5.displayName="UIButton";const _5=le.forwardRef(({direction:t="vertical",spacing:e="8",align:r="stretch",justify:n="flex-start",children:a,...s},l)=>g.jsx("div",{ref:l,style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",gap:`${e}px`,alignItems:r,justifyContent:n},...s,children:a}));_5.displayName="UIStack";const T5=le.forwardRef(({src:t,alt:e,width:r,height:n,children:a,...s},l)=>g.jsx("img",{ref:l,src:t,alt:e,width:r,height:n,style:{maxWidth:"100%",height:"auto",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)"},...s}));T5.displayName="UIImage";const VC={name:"basic",elements:[{tagName:"ui-text",component:x5,propMapping:{content:"content"},eventMapping:{}},{tagName:"ui-button",component:w5,propMapping:{label:"label"},eventMapping:{press:"onPress"}},{tagName:"ui-stack",component:_5,propMapping:{direction:"direction",spacing:"spacing",align:"align",justify:"justify"},eventMapping:{}},{tagName:"ui-image",component:T5,propMapping:{src:"src",alt:"alt",width:"width",height:"height"},eventMapping:{}}]},lve=({receiver:t})=>{const e=b.useRef(null);return b.useEffect(()=>{if(e.current)return t.connect(e.current),()=>{t.disconnect()}},[t]),g.jsx("div",{ref:e,"data-testid":"standard-dom-renderer-container"})},cve=({resource:t,library:e,remoteElements:r=[],onUIAction:n})=>{const a=b.useRef(null),s=b.useRef(null),[l,c]=b.useState(null),d=b.useMemo(()=>(t.mimeType||"").includes("framework=react")?"react":"webcomponents",[t.mimeType]),f=`${e?.name}-${d}`,{receiver:m,components:h}=b.useMemo(()=>{switch(d){case"react":{const y=new zge,w=e||VC,S=new Map;return w&&w.elements.forEach(R=>{const x=Gge(R.component);S.set(R.tagName,x)}),{receiver:y,components:S}}case"webcomponents":default:return{receiver:new $ge,components:null}}},[t,e,r]);b.useEffect(()=>{function y(w){var S;if(a.current&&w.source===a.current.contentWindow){const R=w.data;if(!R)return;(S=n?.(R))==null||S.catch(x=>{console.error("Error handling UI action result in RemoteDOMResourceRenderer:",x)})}}return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[n]),b.useEffect(()=>{const y=s.current;return s.current=null,()=>{y?.close()}},[f]);const v=()=>{const y=a.current;if(!y||s.current)return;const w=new sve(y);s.current=w;const{code:S,error:R}=Ige(t);if(R){c(R);return}if(S&&m!=null&&m.connection){const x={code:S,remoteElements:r,useReactRenderer:d==="react",componentLibrary:e?.name};w.imports.render(x,m.connection).catch(_=>console.error("Error calling remote render:",_))}};return l?g.jsx("p",{className:"text-red-500",children:l}):g.jsxs(g.Fragment,{children:[g.jsx("iframe",{ref:a,srcDoc:Kge,sandbox:"allow-scripts",style:{display:"none"},title:"Remote DOM Sandbox",onLoad:v},f),d==="react"&&h?g.jsx(Yge,{receiver:m,components:h}):g.jsx(lve,{receiver:m})]})};function uve(t){var e;if(t.contentType)return t.contentType;if(t.mimeType==="text/html")return"rawHtml";if(t.mimeType==="text/uri-list")return"externalUrl";if((e=t.mimeType)!=null&&e.startsWith("application/vnd.mcp-ui.remote-dom"))return"remoteDom"}const GC=t=>{const{resource:e,onUIAction:r,supportedContentTypes:n,htmlProps:a,remoteDomProps:s}=t,l=uve(e);if(n&&l&&!n.includes(l))return g.jsxs("p",{className:"text-red-500",children:["Unsupported content type: ",l,"."]});switch(l){case"rawHtml":case"externalUrl":return g.jsx(c5,{resource:e,onUIAction:r,...a});case"remoteDom":return g.jsx(cve,{resource:e,onUIAction:r,library:s?.library||VC,...s});default:return g.jsx("p",{className:"text-red-500",children:"Unsupported resource type."})}};GC.displayName="UIResourceRenderer";const dve={tagName:"ui-button",remoteAttributes:["label"],remoteEvents:["click","press"]},fve={tagName:"ui-text",remoteAttributes:["content"]},pve={tagName:"ui-stack",remoteAttributes:["direction","spacing","align","justify"]},mve={tagName:"ui-image",remoteAttributes:["src","alt","width","height"]},hve=b.memo(({resource:t})=>{const e=async r=>(r.type==="tool"||r.type==="prompt"||(r.type==="link"?r.payload.url&&window.open(r.payload.url,"_blank"):r.type==="intent"||r.type),{status:"Action received"});return t.uri?.startsWith("ui://")?g.jsx("div",{className:"my-4 p-0 border h-[350px] rounded-2xl border-zinc-200 overflow-hidden bg-card",children:g.jsx(GC,{resource:t,onUIAction:e,htmlProps:{style:{maxWidth:"100%",height:"100%",overflow:"auto"},autoResizeIframe:!0,sandboxPermissions:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox"}})}):null});function Bz({toolName:t,toolArgs:e,result:r,serverId:n,readResource:a}){const[s,l]=b.useState(null),c=b.useMemo(()=>{if(typeof r=="string")try{return JSON.parse(r)}catch(h){return console.error("[ToolResultRenderer] Failed to parse result:",h),r}return r},[r]),d=b.useMemo(()=>!!(c?.content&&Array.isArray(c.content)&&c.content.some(h=>h.type==="resource"&&h.resource?.uri?.startsWith("ui://")&&h.resource?.mimeType==="text/html+skybridge")),[c]),f=b.useMemo(()=>d&&c.content.find(v=>v.type==="resource"&&v.resource?.uri?.startsWith("ui://")&&v.resource?.mimeType==="text/html+skybridge")?.resource||null,[d,c]);if(b.useEffect(()=>{(()=>{f&&l(f)})()},[f]),d&&s&&n&&a)return g.jsx(zC,{componentUrl:s.uri,toolName:t,toolArgs:e,toolResult:c,serverId:n,readResource:a,noWrapper:!0,className:"my-4",showConsole:!1});if(d&&!s)return g.jsx("div",{className:"my-4 p-4 bg-blue-50/30 dark:bg-blue-950/20 border border-blue-200/50 dark:border-blue-800/50 rounded-lg",children:g.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-400",children:"Loading component..."})});const m=[];if(c?.content&&Array.isArray(c.content))for(const h of c.content)h.type==="resource"&&h.resource?.uri?.startsWith("ui://")&&h.resource?.mimeType!=="text/html+skybridge"&&m.push(h.resource);return m.length>0?g.jsx(g.Fragment,{children:m.map(h=>g.jsx(hve,{resource:h},`${t}-mcp-ui-${h.uri}`))}):null}function gve({content:t,timestamp:e}){return!t||t.length===0?null:g.jsx("div",{className:"flex items-start gap-3 justify-end group/user-message",children:g.jsxs("div",{className:"flex-1 min-w-0 flex flex-col items-end",children:[g.jsx("div",{className:"bg-zinc-200 dark:bg-zinc-800 text-primary rounded-3xl px-4 py-2 max-w-[80%] break-words",children:g.jsx("p",{className:"text-base leading-7 font-sans text-start break-words",children:t})}),e&&g.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:new Date(e).toLocaleTimeString()})]})})}const vve=b.memo(({messages:t,isLoading:e,serverId:r,readResource:n})=>{const a=b.useRef(null);b.useEffect(()=>{t.length>0&&a.current&&a.current.scrollIntoView({behavior:e?"auto":"smooth",block:"start"})},[t.length,e]);const s=e&&(()=>{if(t.length===0)return!0;const c=t[t.length-1];if(c.role==="user")return!0;if(c.role==="assistant"){const d=typeof c.content=="string"?c.content:Array.isArray(c.content)?c.content.map(m=>typeof m=="string"?m:m.text||JSON.stringify(m)).join(""):JSON.stringify(c.content);return!(d&&d.trim().length>0)}return!1})(),l=c=>{if(!e)return!1;const d=t[t.length-1];return c.id===d.id&&d.role==="assistant"};return g.jsxs("div",{className:"space-y-6 max-w-3xl mx-auto px-2",children:[t.map(c=>{const d=typeof c.content=="string"?c.content:Array.isArray(c.content)?c.content.map(f=>typeof f=="string"?f:f.text||JSON.stringify(f)).join(""):JSON.stringify(c.content);return c.role==="user"?g.jsx(gve,{content:d,timestamp:c.timestamp},c.id):c.role==="assistant"?g.jsx("div",{className:"space-y-4",children:c.parts&&c.parts.length>0?c.parts.map((f,m)=>{const h=f.type==="text"?`${c.id}-text-${m}-${f.text?.slice(0,20)}`:`${c.id}-tool-${f.toolInvocation?.toolName}-${m}`;return f.type==="text"?g.jsx(Rz,{content:f.text||"",timestamp:m===c.parts.length-1?c.timestamp:void 0,_isStreaming:l(c)},h):f.type==="tool-invocation"&&f.toolInvocation?g.jsxs("div",{children:[g.jsx(Cz,{toolName:f.toolInvocation.toolName,args:f.toolInvocation.args,result:f.toolInvocation.result,state:f.toolInvocation.result?"result":"call"}),f.toolInvocation.result&&g.jsx(Bz,{toolName:f.toolInvocation.toolName,toolArgs:f.toolInvocation.args,result:f.toolInvocation.result,serverId:r,readResource:n})]},h):null}):g.jsxs(g.Fragment,{children:[g.jsx(Rz,{content:d,timestamp:c.timestamp,_isStreaming:l(c)}),c.toolCalls&&c.toolCalls.length>0&&g.jsx("div",{className:"space-y-2",children:c.toolCalls.map(f=>{const m=`${c.id}-${f.toolName}-${JSON.stringify(f.args).slice(0,50)}`;return g.jsxs("div",{children:[g.jsx(Cz,{toolName:f.toolName,args:f.args,result:f.result,state:f.result?"result":"call"}),f.result&&g.jsx(Bz,{toolName:f.toolName,toolArgs:f.args,result:f.result,serverId:r,readResource:n})]},m)})})]})},c.id):null}),s&&g.jsx("div",{className:"flex items-start gap-3",children:g.jsx("div",{className:"flex-1",children:g.jsx("div",{className:"rounded-lg p-4 max-w-fit",children:g.jsx("div",{className:"flex items-center gap-2",children:g.jsx("span",{className:"text-sm",children:g.jsx(vse,{duration:2,spread:1,children:"Thinking..."})})})})})}),g.jsx("div",{ref:a})]})});function R5(t){let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);e=(e<<5)-e+n,e=e&e}return Math.abs(e).toString(16)}function bve({mcpServerUrl:t,llmConfig:e,authConfig:r,isConnected:n}){const[a,s]=b.useState([]),[l,c]=b.useState(!1),d=b.useCallback(async m=>{if(!m.trim()||!e||!n)return;const h={id:`user-${Date.now()}`,role:"user",content:m.trim(),timestamp:Date.now()};s(v=>[...v,h]),c(!0);try{let v=r;if(r?.type==="oauth")try{const N="mcp:auth",k=R5(t),A=`${N}_${k}_tokens`,I=localStorage.getItem(A);if(I){const O=JSON.parse(I);v={...r,oauthTokens:O}}else console.warn("No OAuth tokens found in localStorage for key:",A)}catch(N){console.warn("Failed to retrieve OAuth tokens:",N)}const y=await fetch("/inspector/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mcpServerUrl:t,llmConfig:e,authConfig:v,messages:[...a,h].map(N=>({role:N.role,content:N.content}))})});if(!y.ok)throw new Error(`HTTP error! status: ${y.status}`);const w=`assistant-${Date.now()}`;let S="";const R=[];s(N=>[...N,{id:w,role:"assistant",content:"",timestamp:Date.now(),parts:[]}]);const x=y.body?.getReader(),_=new TextDecoder;if(!x)throw new Error("No response body");let C="";for(;;){const{done:N,value:k}=await x.read();if(N)break;C+=_.decode(k,{stream:!0});const A=C.split(`
1545
- `);C=A.pop()||"";for(const I of A)if(I.trim()&&I.startsWith("data: "))try{const O=JSON.parse(I.slice(6));if(console.log("[Client received event]",O.type,O.toolName||O.content?.slice?.(0,30)),O.type==="message")console.log("[Message started]",O.id);else if(O.type==="text"){S+=O.content;const L=R[R.length-1];L&&L.type==="text"?L.text=S:R.push({type:"text",text:S}),console.log("[Parts after text]",R.length,"parts, text length:",S.length),s(M=>M.map(P=>P.id===w?{...P,parts:[...R]}:P))}else if(O.type==="tool-call")S&&(S=""),R.push({type:"tool-invocation",toolInvocation:{toolName:O.toolName,args:O.args,state:"pending"}}),console.log("[Parts after tool-call]",R.length,"parts, tool:",O.toolName),s(L=>L.map(M=>M.id===w?{...M,parts:[...R]}:M));else if(O.type==="tool-result"){const L=R.find(M=>M.type==="tool-invocation"&&M.toolInvocation?.toolName===O.toolName&&!M.toolInvocation?.result);L&&L.toolInvocation?(L.toolInvocation.result=O.result,L.toolInvocation.state="result",console.log("[Parts after tool-result]",R.length,"parts, updated:",O.toolName),s(M=>M.map(P=>P.id===w?{...P,parts:[...R]}:P))):console.warn("[tool-result] Could not find matching tool part for",O.toolName)}else if(O.type==="done")console.log("[Done] Final parts:",R.length),s(L=>L.map(M=>M.id===w?{...M,parts:[...R],content:""}:M));else if(O.type==="error")throw new Error(O.message||"Streaming error")}catch(O){console.error("Failed to parse streaming event:",O,I)}}}catch(v){let y="Unknown error occurred";if(v instanceof Error){y=v.message;const S=v;S.status&&(y=`HTTP ${S.status}: ${y}`),(S.code===401||y.includes("401")||y.includes("Unauthorized"))&&(y="Authentication failed (401). Check your Authorization header in the connection settings.")}const w={id:`error-${Date.now()}`,role:"assistant",content:`Error: ${y}`,timestamp:Date.now()};s(S=>[...S,w])}finally{c(!1)}},[e,n,t,a,r]),f=b.useCallback(()=>{s([])},[]);return{messages:a,isLoading:l,sendMessage:d,clearMessages:f}}function yve({connection:t,llmConfig:e,isConnected:r,readResource:n}){const[a,s]=b.useState([]),[l,c]=b.useState(!1),d=b.useRef(null),f=b.useRef(null),m=b.useRef(null),h=b.useCallback(async y=>{if(!y.trim()||!e||!r)return;const w={id:`user-${Date.now()}`,role:"user",content:y.trim(),timestamp:Date.now()};s(x=>[...x,w]),c(!0),d.current=new AbortController;const S=Date.now();let R=0;try{const x=`assistant-${Date.now()}`;let _="";const C=[];if(s(N=>[...N,{id:x,role:"assistant",content:"",timestamp:Date.now(),parts:[]}]),!m.current||m.current.provider!==e.provider||m.current.model!==e.model||m.current.apiKey!==e.apiKey){let N;if(e.provider==="openai"){const{ChatOpenAI:k}=await cs(async()=>{const{ChatOpenAI:A}=await import("./index-8Ks-K928.js");return{ChatOpenAI:A}},__vite__mapDeps([4,5,6,2,7]));N=new k({model:e.model,apiKey:e.apiKey})}else if(e.provider==="anthropic"){const{ChatAnthropic:k}=await cs(async()=>{const{ChatAnthropic:A}=await import("./index-C0BW8vHr.js");return{ChatAnthropic:A}},__vite__mapDeps([8,5,6,2]));N=new k({model:e.model,apiKey:e.apiKey})}else if(e.provider==="google"){const{ChatGoogleGenerativeAI:k}=await cs(async()=>{const{ChatGoogleGenerativeAI:A}=await import("./index-DueuvgmI.js");return{ChatGoogleGenerativeAI:A}},__vite__mapDeps([9,5,6,2,7]));N=new k({model:e.model,apiKey:e.apiKey})}else throw new Error(`Unsupported LLM provider: ${e.provider}`);m.current={instance:N,provider:e.provider,model:e.model,apiKey:e.apiKey}}if(!f.current||f.current.llm!==m.current.instance){const{MCPAgent:N}=await cs(async()=>{const{MCPAgent:k}=await import("./langfuse-C4HKZ3NL-1laIPiUg.js").then(A=>A.c);return{MCPAgent:k}},__vite__mapDeps([10,6,2,1,3]));f.current=new N({llm:m.current.instance,client:t.client,memoryEnabled:!0,systemPrompt:"You are a helpful assistant with access to MCP tools, prompts, and resources. Help users interact with the MCP server."}),await f.current.initialize()}else console.log("[useChatMessagesClientSide] Reusing existing agent. History length:",f.current.conversationHistory?.length);for await(const N of f.current.streamEvents(y,10,!1,void 0)){if(d.current?.signal.aborted)break;if(N.event==="on_chat_model_stream"&&N.data?.chunk?.text){const k=N.data.chunk.text;if(typeof k=="string"&&k.length>0){_+=k;const A=C[C.length-1];A&&A.type==="text"?A.text=_:C.push({type:"text",text:_}),s(I=>I.map(O=>O.id===x?{...O,parts:[...C]}:O))}}else if(N.event==="on_tool_start"){_&&(_="");let k={};N.data?.input?k=N.data.input:N.data?.tool_input?k=N.data.tool_input:N.data&&(k=N.data),console.log("[useChatMessagesClientSide] on_tool_start:",{toolName:N.name,eventData:N.data,extractedArgs:k}),R++,C.push({type:"tool-invocation",toolInvocation:{toolName:N.name||"unknown",args:k,state:"pending"}}),s(A=>A.map(I=>I.id===x?{...I,parts:[...C]}:I))}else if(N.event==="on_tool_end"){const k=C.find(A=>A.type==="tool-invocation"&&A.toolInvocation?.toolName===N.name&&!A.toolInvocation?.result);if(console.log("[useChatMessagesClientSide] on_tool_end event:",{toolName:N.name,hasToolPart:!!k,output:N.data?.output}),k&&k.toolInvocation){let A=N.data?.output;if(A?.kwargs?.content&&typeof A.kwargs.content=="string")try{A=JSON.parse(A.kwargs.content)}catch(O){console.warn("[useChatMessagesClientSide] Failed to parse kwargs.content:",O),A=A.kwargs.content}else if(A?.content&&typeof A.content=="string")try{A=JSON.parse(A.content)}catch{A=A.content}k.toolInvocation.result=A,k.toolInvocation.state="result";const I=A?._meta?.["openai/outputTemplate"];if(console.log("[useChatMessagesClientSide] Tool result:",{toolName:N.name,hasMeta:!!A?._meta,hasStructuredContent:!!A?.structuredContent,appsSdkUri:I}),I&&typeof I=="string"&&n){console.log("[useChatMessagesClientSide] Detected Apps SDK component, fetching resource:",I);try{const O=await n(I);console.log("[useChatMessagesClientSide] Resource fetched:",O);const L=A?.structuredContent||null;if(O?.contents&&Array.isArray(O.contents)){const M=O.contents.map(W=>({type:"resource",resource:W}));console.log("[useChatMessagesClientSide] Created MCP resources:",M);const P={...A,content:[...A.content||[],...M],structuredContent:L};k.toolInvocation.result=P,console.log("[useChatMessagesClientSide] Updated result with resources")}else console.warn("[useChatMessagesClientSide] No contents in resourceData:",O)}catch(O){console.error("Failed to fetch Apps SDK resource:",O)}}s(O=>O.map(L=>L.id===x?{...L,parts:[...C]}:L))}}}s(N=>N.map(k=>k.id===x?{...k,parts:[...C],content:""}:k)),e&&zr.getInstance().capture(new $O({serverId:t.url,provider:e.provider,model:e.model,messageCount:a.length+1,toolCallsCount:R,success:!0,executionMode:"client-side",duration:Date.now()-S})).catch(()=>{})}catch(x){console.error("Client-side agent error:",x);let _="Unknown error occurred";if(x instanceof Error){_=x.message;const N=x;N.status&&(_=`HTTP ${N.status}: ${_}`),(N.code===401||_.includes("401")||_.includes("Unauthorized"))&&(_="Authentication failed (401). Check your Authorization header in the connection settings.")}e&&zr.getInstance().capture(new $O({serverId:t.url,provider:e.provider,model:e.model,messageCount:a.length+1,toolCallsCount:R,success:!1,executionMode:"client-side",duration:Date.now()-S,error:_})).catch(()=>{});const C={id:`error-${Date.now()}`,role:"assistant",content:`Error: ${_}`,timestamp:Date.now()};s(N=>[...N,C])}finally{c(!1),d.current=null}},[t,e,r,a,n]),v=b.useCallback(()=>{s([]),f.current&&f.current.clearConversationHistory()},[]);return{messages:a,isLoading:l,sendMessage:h,clearMessages:v}}const qz={openai:"gpt-4o",anthropic:"claude-haiku-4-5-20251001",google:"gemini-2.5-flash"};function Eve({mcpServerUrl:t}){const[e,r]=b.useState(null),[n,a]=b.useState(null),[s,l]=b.useState(!1),[c,d]=b.useState("openai"),[f,m]=b.useState(""),[h,v]=b.useState(qz.openai),y=b.useCallback(()=>{const L=localStorage.getItem("mcp-inspector-api-keys");if(L)try{return JSON.parse(L)}catch(M){return console.error("Failed to load API keys:",M),{}}return{}},[]),w=b.useCallback(L=>{localStorage.setItem("mcp-inspector-api-keys",JSON.stringify(L))},[]),[S,R]=b.useState("none"),[x,_]=b.useState(""),[C,N]=b.useState(""),[k,A]=b.useState("");b.useEffect(()=>{const L=localStorage.getItem("mcp-inspector-llm-config"),M=y();if(L)try{const P=JSON.parse(L);r(P),d(P.provider),m(M[P.provider]||P.apiKey||""),v(P.model)}catch(P){console.error("Failed to load LLM config:",P)}},[y]),b.useEffect(()=>{const L=localStorage.getItem("mcp-inspector-auth-config");if(L)try{const M=JSON.parse(L);a(M),R(M.type),M.username&&_(M.username),M.password&&N(M.password),M.token&&A(M.token)}catch(M){console.error("Failed to load auth config:",M)}else try{const M="mcp:auth",P=R5(t),W=`${M}_${P}_tokens`;localStorage.getItem(W)&&(a({type:"oauth"}),R("oauth"))}catch(M){console.error("Failed to check for OAuth tokens:",M)}},[t]),b.useEffect(()=>{v(qz[c]);const L=y();m(L[c]||"")},[c,y]);const I=b.useCallback(()=>{if(!f.trim())return;const L=y();L[c]=f,w(L);const M={provider:c,apiKey:f,model:h},P={type:S,...S==="basic"&&{username:x.trim(),password:C.trim()},...S==="bearer"&&{token:k.trim()}};r(M),a(P),localStorage.setItem("mcp-inspector-llm-config",JSON.stringify(M)),localStorage.setItem("mcp-inspector-auth-config",JSON.stringify(P)),l(!1)},[c,f,h,S,x,C,k,y,w]),O=b.useCallback(()=>{r(null),a(null);const L=y();delete L[c],w(L),m(""),_(""),N(""),A(""),R("none"),localStorage.removeItem("mcp-inspector-llm-config"),localStorage.removeItem("mcp-inspector-auth-config")},[c,y,w]);return{llmConfig:e,authConfig:n,configDialogOpen:s,setConfigDialogOpen:l,tempProvider:c,setTempProvider:d,tempApiKey:f,setTempApiKey:m,tempModel:h,setTempModel:v,tempAuthType:S,saveLLMConfig:I,clearConfig:O}}function Sve({connection:t,isConnected:e,useClientSide:r=!0,readResource:n}){const[a,s]=b.useState(""),l=b.useRef(null),{llmConfig:c,authConfig:d,configDialogOpen:f,setConfigDialogOpen:m,tempProvider:h,setTempProvider:v,tempApiKey:y,setTempApiKey:w,tempModel:S,setTempModel:R,saveLLMConfig:x,clearConfig:_}=Eve({mcpServerUrl:t.url}),C={connection:t,llmConfig:c,isConnected:e,readResource:n},N=bve({mcpServerUrl:t.url,llmConfig:c,authConfig:d,isConnected:e}),k=yve(C),{messages:A,isLoading:I,sendMessage:O,clearMessages:L}=r?k:N;P4({onNewChat:L}),b.useEffect(()=>{c&&A.length===0&&l.current&&l.current.focus()},[c,A.length]),b.useEffect(()=>{!I&&A.length>0&&l.current&&l.current.focus()},[I,A.length]);const M=b.useCallback(()=>{a.trim()&&(O(a),s(""))},[a,O]),P=b.useCallback(X=>{X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),M())},[M]),W=b.useCallback(()=>{_(),L()},[_,L]);return c&&A.length===0?g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsx("div",{className:"absolute top-4 right-4 z-10",children:g.jsx(Cq,{open:f,onOpenChange:m,tempProvider:h,tempModel:S,tempApiKey:y,onProviderChange:v,onModelChange:R,onApiKeyChange:w,onSave:x,onClear:W,showClearButton:!0,buttonLabel:"Change API Key"})}),g.jsx(hse,{mcpServerUrl:t.url,inputValue:a,isConnected:e,isLoading:I,textareaRef:l,llmConfig:c,onInputChange:s,onKeyDown:P,onSubmit:X=>{X.preventDefault(),M()},onConfigDialogOpenChange:m})]}):g.jsxs("div",{className:"flex flex-col h-full relative",children:[g.jsx(fse,{llmConfig:c,hasMessages:A.length>0,configDialogOpen:f,onConfigDialogOpenChange:m,onClearChat:L,tempProvider:h,tempModel:S,tempApiKey:y,onProviderChange:v,onModelChange:R,onApiKeyChange:w,onSaveConfig:x,onClearConfig:W}),g.jsx("div",{className:"flex-1 overflow-y-auto p-4 pt-[100px]",children:c?g.jsx(vve,{messages:A,isLoading:I,serverId:t.url,readResource:n}):g.jsx(gse,{onConfigureClick:()=>m(!0)})}),c&&g.jsx(pse,{inputValue:a,isConnected:e,isLoading:I,textareaRef:l,onInputChange:s,onKeyDown:P,onSendMessage:M})]})}const xh=b.createContext(null);xh.displayName="PanelGroupContext";const gr={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},WC=10,gs=b.useLayoutEffect,Hz=Bm.useId,xve=typeof Hz=="function"?Hz:()=>null;let wve=0;function YC(t=null){const e=xve(),r=b.useRef(t||e||null);return r.current===null&&(r.current=""+wve++),t??r.current}function C5({children:t,className:e="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:s,id:l,maxSize:c,minSize:d,onCollapse:f,onExpand:m,onResize:h,order:v,style:y,tagName:w="div",...S}){const R=b.useContext(xh);if(R===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:_,getPanelSize:C,getPanelStyle:N,groupId:k,isPanelCollapsed:A,reevaluatePanelConstraints:I,registerPanel:O,resizePanel:L,unregisterPanel:M}=R,P=YC(l),W=b.useRef({callbacks:{onCollapse:f,onExpand:m,onResize:h},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:c,minSize:d},id:P,idIsFromProps:l!==void 0,order:v});b.useRef({didLogMissingDefaultSizeWarning:!1}),gs(()=>{const{callbacks:ee,constraints:J}=W.current,j={...J};W.current.id=P,W.current.idIsFromProps=l!==void 0,W.current.order=v,ee.onCollapse=f,ee.onExpand=m,ee.onResize=h,J.collapsedSize=r,J.collapsible=n,J.defaultSize=a,J.maxSize=c,J.minSize=d,(j.collapsedSize!==J.collapsedSize||j.collapsible!==J.collapsible||j.maxSize!==J.maxSize||j.minSize!==J.minSize)&&I(W.current,j)}),gs(()=>{const ee=W.current;return O(ee),()=>{M(ee)}},[v,P,O,M]),b.useImperativeHandle(s,()=>({collapse:()=>{x(W.current)},expand:ee=>{_(W.current,ee)},getId(){return P},getSize(){return C(W.current)},isCollapsed(){return A(W.current)},isExpanded(){return!A(W.current)},resize:ee=>{L(W.current,ee)}}),[x,_,C,A,P,L]);const X=N(W.current,a);return b.createElement(w,{...S,children:t,className:e,id:P,style:{...X,...y},[gr.groupId]:k,[gr.panel]:"",[gr.panelCollapsible]:n||void 0,[gr.panelId]:P,[gr.panelSize]:parseFloat(""+X.flexGrow).toFixed(1)})}const A5=b.forwardRef((t,e)=>b.createElement(C5,{...t,forwardedRef:e}));C5.displayName="Panel";A5.displayName="forwardRef(Panel)";let BT=null,Jp=-1,yi=null;function _ve(t,e,r){const n=(e&D5)!==0,a=(e&L5)!==0,s=(e&M5)!==0,l=(e&P5)!==0;if(e){if(n)return s?"se-resize":l?"ne-resize":"e-resize";if(a)return s?"sw-resize":l?"nw-resize":"w-resize";if(s)return"s-resize";if(l)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Tve(){yi!==null&&(document.head.removeChild(yi),BT=null,yi=null,Jp=-1)}function u_(t,e,r){var n,a;const s=_ve(t,e);if(BT!==s){if(BT=s,yi===null&&(yi=document.createElement("style"),document.head.appendChild(yi)),Jp>=0){var l;(l=yi.sheet)===null||l===void 0||l.removeRule(Jp)}Jp=(n=(a=yi.sheet)===null||a===void 0?void 0:a.insertRule(`*{cursor: ${s} !important;}`))!==null&&n!==void 0?n:-1}}function N5(t){return t.type==="keydown"}function k5(t){return t.type.startsWith("pointer")}function I5(t){return t.type.startsWith("mouse")}function wh(t){if(k5(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(I5(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function Rve(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Cve(t,e,r){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Ave(t,e){if(t===e)throw new Error("Cannot compare node with itself");const r={a:Wz(t),b:Wz(e)};let n;for(;r.a.at(-1)===r.b.at(-1);)t=r.a.pop(),e=r.b.pop(),n=t;gt(n,"Stacking order can only be calculated for elements with a common ancestor");const a={a:Gz(Vz(r.a)),b:Gz(Vz(r.b))};if(a.a===a.b){const s=n.childNodes,l={a:r.a.at(-1),b:r.b.at(-1)};let c=s.length;for(;c--;){const d=s[c];if(d===l.a)return 1;if(d===l.b)return-1}}return Math.sign(a.a-a.b)}const Nve=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function kve(t){var e;const r=getComputedStyle((e=O5(t))!==null&&e!==void 0?e:t).display;return r==="flex"||r==="inline-flex"}function Ive(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||kve(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Nve.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Vz(t){let e=t.length;for(;e--;){const r=t[e];if(gt(r,"Missing node"),Ive(r))return r}return null}function Gz(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Wz(t){const e=[];for(;t;)e.push(t),t=O5(t);return e}function O5(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const D5=1,L5=2,M5=4,P5=8,Ove=Rve()==="coarse";let Ea=[],Bl=!1,Ei=new Map,_h=new Map;const wd=new Set;function Dve(t,e,r,n,a){var s;const{ownerDocument:l}=e,c={direction:r,element:e,hitAreaMargins:n,setResizeHandlerState:a},d=(s=Ei.get(l))!==null&&s!==void 0?s:0;return Ei.set(l,d+1),wd.add(c),Dm(),function(){var m;_h.delete(t),wd.delete(c);const h=(m=Ei.get(l))!==null&&m!==void 0?m:1;if(Ei.set(l,h-1),Dm(),h===1&&Ei.delete(l),Ea.includes(c)){const v=Ea.indexOf(c);v>=0&&Ea.splice(v,1),Th(),a("up",!0,null)}}}function Lve(t){const{target:e}=t,{x:r,y:n}=wh(t);Bl=!0,KC({target:e,x:r,y:n}),Dm(),Ea.length>0&&(Lm("down",t),Th(),t.preventDefault(),j5(e)||t.stopImmediatePropagation())}function d_(t){const{x:e,y:r}=wh(t);if(Bl&&t.type!=="pointerleave"&&t.buttons===0&&(Bl=!1,Lm("up",t)),!Bl){const{target:n}=t;KC({target:n,x:e,y:r})}Lm("move",t),Th(),Ea.length>0&&t.preventDefault()}function f_(t){const{target:e}=t,{x:r,y:n}=wh(t);_h.clear(),Bl=!1,Ea.length>0&&(t.preventDefault(),j5(e)||t.stopImmediatePropagation()),Lm("up",t),KC({target:e,x:r,y:n}),Th(),Dm()}function j5(t){let e=t;for(;e;){if(e.hasAttribute(gr.resizeHandle))return!0;e=e.parentElement}return!1}function KC({target:t,x:e,y:r}){Ea.splice(0);let n=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(n=t),wd.forEach(a=>{const{element:s,hitAreaMargins:l}=a,c=s.getBoundingClientRect(),{bottom:d,left:f,right:m,top:h}=c,v=Ove?l.coarse:l.fine;if(e>=f-v&&e<=m+v&&r>=h-v&&r<=d+v){if(n!==null&&document.contains(n)&&s!==n&&!s.contains(n)&&!n.contains(s)&&Ave(n,s)>0){let w=n,S=!1;for(;w&&!w.contains(s);){if(Cve(w.getBoundingClientRect(),c)){S=!0;break}w=w.parentElement}if(S)return}Ea.push(a)}})}function p_(t,e){_h.set(t,e)}function Th(){let t=!1,e=!1;Ea.forEach(n=>{const{direction:a}=n;a==="horizontal"?t=!0:e=!0});let r=0;_h.forEach(n=>{r|=n}),t&&e?u_("intersection",r):t?u_("horizontal",r):e?u_("vertical",r):Tve()}let m_;function Dm(){var t;(t=m_)===null||t===void 0||t.abort(),m_=new AbortController;const e={capture:!0,signal:m_.signal};wd.size&&(Bl?(Ea.length>0&&Ei.forEach((r,n)=>{const{body:a}=n;r>0&&(a.addEventListener("contextmenu",f_,e),a.addEventListener("pointerleave",d_,e),a.addEventListener("pointermove",d_,e))}),Ei.forEach((r,n)=>{const{body:a}=n;a.addEventListener("pointerup",f_,e),a.addEventListener("pointercancel",f_,e)})):Ei.forEach((r,n)=>{const{body:a}=n;r>0&&(a.addEventListener("pointerdown",Lve,e),a.addEventListener("pointermove",d_,e))}))}function Lm(t,e){wd.forEach(r=>{const{setResizeHandlerState:n}=r,a=Ea.includes(r);n(t,a,e)})}function Mve(){const[t,e]=b.useState(0);return b.useCallback(()=>e(r=>r+1),[])}function gt(t,e){if(!t)throw console.error(e),Error(e)}function As(t,e,r=WC){return t.toFixed(r)===e.toFixed(r)?0:t>e?1:-1}function _o(t,e,r=WC){return As(t,e,r)===0}function jn(t,e,r){return As(t,e,r)===0}function Pve(t,e,r){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){const a=t[n],s=e[n];if(!jn(a,s,r))return!1}return!0}function Pl({panelConstraints:t,panelIndex:e,size:r}){const n=t[e];gt(n!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:a=0,collapsible:s,maxSize:l=100,minSize:c=0}=n;if(As(r,c)<0)if(s){const d=(a+c)/2;As(r,d)<0?r=a:r=c}else r=c;return r=Math.min(l,r),r=parseFloat(r.toFixed(WC)),r}function Lu({delta:t,initialLayout:e,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:s}){if(jn(t,0))return e;const l=[...e],[c,d]=n;gt(c!=null,"Invalid first pivot index"),gt(d!=null,"Invalid second pivot index");let f=0;if(s==="keyboard"){{const h=t<0?d:c,v=r[h];gt(v,`Panel constraints not found for index ${h}`);const{collapsedSize:y=0,collapsible:w,minSize:S=0}=v;if(w){const R=e[h];if(gt(R!=null,`Previous layout not found for panel index ${h}`),jn(R,y)){const x=S-R;As(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}{const h=t<0?c:d,v=r[h];gt(v,`No panel constraints found for index ${h}`);const{collapsedSize:y=0,collapsible:w,minSize:S=0}=v;if(w){const R=e[h];if(gt(R!=null,`Previous layout not found for panel index ${h}`),jn(R,S)){const x=R-y;As(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}}{const h=t<0?1:-1;let v=t<0?d:c,y=0;for(;;){const S=e[v];gt(S!=null,`Previous layout not found for panel index ${v}`);const x=Pl({panelConstraints:r,panelIndex:v,size:100})-S;if(y+=x,v+=h,v<0||v>=r.length)break}const w=Math.min(Math.abs(t),Math.abs(y));t=t<0?0-w:w}{let v=t<0?c:d;for(;v>=0&&v<r.length;){const y=Math.abs(t)-Math.abs(f),w=e[v];gt(w!=null,`Previous layout not found for panel index ${v}`);const S=w-y,R=Pl({panelConstraints:r,panelIndex:v,size:S});if(!jn(w,R)&&(f+=w-R,l[v]=R,f.toFixed(3).localeCompare(Math.abs(t).toFixed(3),void 0,{numeric:!0})>=0))break;t<0?v--:v++}}if(Pve(a,l))return a;{const h=t<0?d:c,v=e[h];gt(v!=null,`Previous layout not found for panel index ${h}`);const y=v+f,w=Pl({panelConstraints:r,panelIndex:h,size:y});if(l[h]=w,!jn(w,y)){let S=y-w,x=t<0?d:c;for(;x>=0&&x<r.length;){const _=l[x];gt(_!=null,`Previous layout not found for panel index ${x}`);const C=_+S,N=Pl({panelConstraints:r,panelIndex:x,size:C});if(jn(_,N)||(S-=N-_,l[x]=N),jn(S,0))break;t>0?x--:x++}}}const m=l.reduce((h,v)=>v+h,0);return jn(m,100)?l:a}function jve({layout:t,panelsArray:e,pivotIndices:r}){let n=0,a=100,s=0,l=0;const c=r[0];gt(c!=null,"No pivot index found"),e.forEach((h,v)=>{const{constraints:y}=h,{maxSize:w=100,minSize:S=0}=y;v===c?(n=S,a=w):(s+=S,l+=w)});const d=Math.min(a,100-s),f=Math.max(n,100-l),m=t[c];return{valueMax:d,valueMin:f,valueNow:m}}function _d(t,e=document){return Array.from(e.querySelectorAll(`[${gr.resizeHandleId}][data-panel-group-id="${t}"]`))}function U5(t,e,r=document){const a=_d(t,r).findIndex(s=>s.getAttribute(gr.resizeHandleId)===e);return a??null}function F5(t,e,r){const n=U5(t,e,r);return n!=null?[n,n+1]:[-1,-1]}function Uve(t){return t instanceof HTMLElement?!0:typeof t=="object"&&t!==null&&"tagName"in t&&"getAttribute"in t}function z5(t,e=document){if(Uve(e)&&e.dataset.panelGroupId==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function Rh(t,e=document){const r=e.querySelector(`[${gr.resizeHandleId}="${t}"]`);return r||null}function Fve(t,e,r,n=document){var a,s,l,c;const d=Rh(e,n),f=_d(t,n),m=d?f.indexOf(d):-1,h=(a=(s=r[m])===null||s===void 0?void 0:s.id)!==null&&a!==void 0?a:null,v=(l=(c=r[m+1])===null||c===void 0?void 0:c.id)!==null&&l!==void 0?l:null;return[h,v]}function zve({committedValuesRef:t,eagerValuesRef:e,groupId:r,layout:n,panelDataArray:a,panelGroupElement:s,setLayout:l}){b.useRef({didWarnAboutMissingResizeHandle:!1}),gs(()=>{if(!s)return;const c=_d(r,s);for(let d=0;d<a.length-1;d++){const{valueMax:f,valueMin:m,valueNow:h}=jve({layout:n,panelsArray:a,pivotIndices:[d,d+1]}),v=c[d];if(v!=null){const y=a[d];gt(y,`No panel data found for index "${d}"`),v.setAttribute("aria-controls",y.id),v.setAttribute("aria-valuemax",""+Math.round(f)),v.setAttribute("aria-valuemin",""+Math.round(m)),v.setAttribute("aria-valuenow",h!=null?""+Math.round(h):"")}}return()=>{c.forEach((d,f)=>{d.removeAttribute("aria-controls"),d.removeAttribute("aria-valuemax"),d.removeAttribute("aria-valuemin"),d.removeAttribute("aria-valuenow")})}},[r,n,a,s]),b.useEffect(()=>{if(!s)return;const c=e.current;gt(c,"Eager values not found");const{panelDataArray:d}=c,f=z5(r,s);gt(f!=null,`No group found for id "${r}"`);const m=_d(r,s);gt(m,`No resize handles found for group id "${r}"`);const h=m.map(v=>{const y=v.getAttribute(gr.resizeHandleId);gt(y,"Resize handle element has no handle id attribute");const[w,S]=Fve(r,y,d,s);if(w==null||S==null)return()=>{};const R=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const _=d.findIndex(C=>C.id===w);if(_>=0){const C=d[_];gt(C,`No panel data found for index ${_}`);const N=n[_],{collapsedSize:k=0,collapsible:A,minSize:I=0}=C.constraints;if(N!=null&&A){const O=Lu({delta:jn(N,k)?I-k:k-N,initialLayout:n,panelConstraints:d.map(L=>L.constraints),pivotIndices:F5(r,y,s),prevLayout:n,trigger:"keyboard"});n!==O&&l(O)}}break}}};return v.addEventListener("keydown",R),()=>{v.removeEventListener("keydown",R)}});return()=>{h.forEach(v=>v())}},[s,t,e,r,n,a,l])}function Yz(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function $5(t,e){const r=t==="horizontal",{x:n,y:a}=wh(e);return r?n:a}function $ve(t,e,r,n,a){const s=r==="horizontal",l=Rh(e,a);gt(l,`No resize handle element found for id "${e}"`);const c=l.getAttribute(gr.groupId);gt(c,"Resize handle element has no group id attribute");let{initialCursorPosition:d}=n;const f=$5(r,t),m=z5(c,a);gt(m,`No group element found for id "${c}"`);const h=m.getBoundingClientRect(),v=s?h.width:h.height;return(f-d)/v*100}function Bve(t,e,r,n,a,s){if(N5(t)){const l=r==="horizontal";let c=0;t.shiftKey?c=100:a!=null?c=a:c=10;let d=0;switch(t.key){case"ArrowDown":d=l?0:c;break;case"ArrowLeft":d=l?-c:0;break;case"ArrowRight":d=l?c:0;break;case"ArrowUp":d=l?0:-c;break;case"End":d=100;break;case"Home":d=-100;break}return d}else return n==null?0:$ve(t,e,r,n,s)}function qve({panelDataArray:t}){const e=Array(t.length),r=t.map(s=>s.constraints);let n=0,a=100;for(let s=0;s<t.length;s++){const l=r[s];gt(l,`Panel constraints not found for index ${s}`);const{defaultSize:c}=l;c!=null&&(n++,e[s]=c,a-=c)}for(let s=0;s<t.length;s++){const l=r[s];gt(l,`Panel constraints not found for index ${s}`);const{defaultSize:c}=l;if(c!=null)continue;const d=t.length-n,f=a/d;n++,e[s]=f,a-=f}return e}function gl(t,e,r){e.forEach((n,a)=>{const s=t[a];gt(s,`Panel data not found for index ${a}`);const{callbacks:l,constraints:c,id:d}=s,{collapsedSize:f=0,collapsible:m}=c,h=r[d];if(h==null||n!==h){r[d]=n;const{onCollapse:v,onExpand:y,onResize:w}=l;w&&w(n,h),m&&(v||y)&&(y&&(h==null||_o(h,f))&&!_o(n,f)&&y(),v&&(h==null||!_o(h,f))&&_o(n,f)&&v())}})}function Lp(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!=e[r])return!1;return!0}function Hve({defaultSize:t,dragState:e,layout:r,panelData:n,panelIndex:a,precision:s=3}){const l=r[a];let c;return l==null?c=t!=null?t.toFixed(s):"1":n.length===1?c="1":c=l.toFixed(s),{flexBasis:0,flexGrow:c,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Vve(t,e=10){let r=null;return(...a)=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{t(...a)},e)}}function Kz(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,r)=>{localStorage.setItem(e,r)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function B5(t){return`react-resizable-panels:${t}`}function q5(t){return t.map(e=>{const{constraints:r,id:n,idIsFromProps:a,order:s}=e;return a?n:s?`${s}:${JSON.stringify(r)}`:JSON.stringify(r)}).sort((e,r)=>e.localeCompare(r)).join(",")}function H5(t,e){try{const r=B5(t),n=e.getItem(r);if(n){const a=JSON.parse(n);if(typeof a=="object"&&a!=null)return a}}catch{}return null}function Gve(t,e,r){var n,a;const s=(n=H5(t,r))!==null&&n!==void 0?n:{},l=q5(e);return(a=s[l])!==null&&a!==void 0?a:null}function Wve(t,e,r,n,a){var s;const l=B5(t),c=q5(e),d=(s=H5(t,a))!==null&&s!==void 0?s:{};d[c]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(l,JSON.stringify(d))}catch(f){console.error(f)}}function Zz({layout:t,panelConstraints:e}){const r=[...t],n=r.reduce((s,l)=>s+l,0);if(r.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${r.map(s=>`${s}%`).join(", ")}`);if(!jn(n,100)&&r.length>0)for(let s=0;s<e.length;s++){const l=r[s];gt(l!=null,`No layout data found for index ${s}`);const c=100/n*l;r[s]=c}let a=0;for(let s=0;s<e.length;s++){const l=r[s];gt(l!=null,`No layout data found for index ${s}`);const c=Pl({panelConstraints:e,panelIndex:s,size:l});l!=c&&(a+=l-c,r[s]=c)}if(!jn(a,0))for(let s=0;s<e.length;s++){const l=r[s];gt(l!=null,`No layout data found for index ${s}`);const c=l+a,d=Pl({panelConstraints:e,panelIndex:s,size:c});if(l!==d&&(a-=d-l,r[s]=d,jn(a,0)))break}return r}const Yve=100,Mu={getItem:t=>(Kz(Mu),Mu.getItem(t)),setItem:(t,e)=>{Kz(Mu),Mu.setItem(t,e)}},Xz={};function V5({autoSaveId:t=null,children:e,className:r="",direction:n,forwardedRef:a,id:s=null,onLayout:l=null,keyboardResizeBy:c=null,storage:d=Mu,style:f,tagName:m="div",...h}){const v=YC(s),y=b.useRef(null),[w,S]=b.useState(null),[R,x]=b.useState([]),_=Mve(),C=b.useRef({}),N=b.useRef(new Map),k=b.useRef(0),A=b.useRef({autoSaveId:t,direction:n,dragState:w,id:v,keyboardResizeBy:c,onLayout:l,storage:d}),I=b.useRef({layout:R,panelDataArray:[],panelDataArrayChanged:!1});b.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),b.useImperativeHandle(a,()=>({getId:()=>A.current.id,getLayout:()=>{const{layout:$}=I.current;return $},setLayout:$=>{const{onLayout:Y}=A.current,{layout:Q,panelDataArray:F}=I.current,z=Zz({layout:$,panelConstraints:F.map(K=>K.constraints)});Yz(Q,z)||(x(z),I.current.layout=z,Y&&Y(z),gl(F,z,C.current))}}),[]),gs(()=>{A.current.autoSaveId=t,A.current.direction=n,A.current.dragState=w,A.current.id=v,A.current.onLayout=l,A.current.storage=d}),zve({committedValuesRef:A,eagerValuesRef:I,groupId:v,layout:R,panelDataArray:I.current.panelDataArray,setLayout:x,panelGroupElement:y.current}),b.useEffect(()=>{const{panelDataArray:$}=I.current;if(t){if(R.length===0||R.length!==$.length)return;let Y=Xz[t];Y==null&&(Y=Vve(Wve,Yve),Xz[t]=Y);const Q=[...$],F=new Map(N.current);Y(t,Q,F,R,d)}},[t,R,d]),b.useEffect(()=>{});const O=b.useCallback($=>{const{onLayout:Y}=A.current,{layout:Q,panelDataArray:F}=I.current;if($.constraints.collapsible){const z=F.map(de=>de.constraints),{collapsedSize:K=0,panelSize:ae,pivotIndices:H}=os(F,$,Q);if(gt(ae!=null,`Panel size not found for panel "${$.id}"`),!_o(ae,K)){N.current.set($.id,ae);const me=Cl(F,$)===F.length-1?ae-K:K-ae,xe=Lu({delta:me,initialLayout:Q,panelConstraints:z,pivotIndices:H,prevLayout:Q,trigger:"imperative-api"});Lp(Q,xe)||(x(xe),I.current.layout=xe,Y&&Y(xe),gl(F,xe,C.current))}}},[]),L=b.useCallback(($,Y)=>{const{onLayout:Q}=A.current,{layout:F,panelDataArray:z}=I.current;if($.constraints.collapsible){const K=z.map(be=>be.constraints),{collapsedSize:ae=0,panelSize:H=0,minSize:de=0,pivotIndices:me}=os(z,$,F),xe=Y??de;if(_o(H,ae)){const be=N.current.get($.id),_e=be!=null&&be>=xe?be:xe,Fe=Cl(z,$)===z.length-1?H-_e:_e-H,Pe=Lu({delta:Fe,initialLayout:F,panelConstraints:K,pivotIndices:me,prevLayout:F,trigger:"imperative-api"});Lp(F,Pe)||(x(Pe),I.current.layout=Pe,Q&&Q(Pe),gl(z,Pe,C.current))}}},[]),M=b.useCallback($=>{const{layout:Y,panelDataArray:Q}=I.current,{panelSize:F}=os(Q,$,Y);return gt(F!=null,`Panel size not found for panel "${$.id}"`),F},[]),P=b.useCallback(($,Y)=>{const{panelDataArray:Q}=I.current,F=Cl(Q,$);return Hve({defaultSize:Y,dragState:w,layout:R,panelData:Q,panelIndex:F})},[w,R]),W=b.useCallback($=>{const{layout:Y,panelDataArray:Q}=I.current,{collapsedSize:F=0,collapsible:z,panelSize:K}=os(Q,$,Y);return gt(K!=null,`Panel size not found for panel "${$.id}"`),z===!0&&_o(K,F)},[]),X=b.useCallback($=>{const{layout:Y,panelDataArray:Q}=I.current,{collapsedSize:F=0,collapsible:z,panelSize:K}=os(Q,$,Y);return gt(K!=null,`Panel size not found for panel "${$.id}"`),!z||As(K,F)>0},[]),ee=b.useCallback($=>{const{panelDataArray:Y}=I.current;Y.push($),Y.sort((Q,F)=>{const z=Q.order,K=F.order;return z==null&&K==null?0:z==null?-1:K==null?1:z-K}),I.current.panelDataArrayChanged=!0,_()},[_]);gs(()=>{if(I.current.panelDataArrayChanged){I.current.panelDataArrayChanged=!1;const{autoSaveId:$,onLayout:Y,storage:Q}=A.current,{layout:F,panelDataArray:z}=I.current;let K=null;if($){const H=Gve($,z,Q);H&&(N.current=new Map(Object.entries(H.expandToSizes)),K=H.layout)}K==null&&(K=qve({panelDataArray:z}));const ae=Zz({layout:K,panelConstraints:z.map(H=>H.constraints)});Yz(F,ae)||(x(ae),I.current.layout=ae,Y&&Y(ae),gl(z,ae,C.current))}}),gs(()=>{const $=I.current;return()=>{$.layout=[]}},[]);const J=b.useCallback($=>{let Y=!1;const Q=y.current;return Q&&window.getComputedStyle(Q,null).getPropertyValue("direction")==="rtl"&&(Y=!0),function(z){z.preventDefault();const K=y.current;if(!K)return()=>null;const{direction:ae,dragState:H,id:de,keyboardResizeBy:me,onLayout:xe}=A.current,{layout:be,panelDataArray:_e}=I.current,{initialLayout:Ae}=H??{},Fe=F5(de,$,K);let Pe=Bve(z,$,ae,H,me,K);const $e=ae==="horizontal";$e&&Y&&(Pe=-Pe);const at=_e.map(ze=>ze.constraints),ce=Lu({delta:Pe,initialLayout:Ae??be,panelConstraints:at,pivotIndices:Fe,prevLayout:be,trigger:N5(z)?"keyboard":"mouse-or-touch"}),Ce=!Lp(be,ce);(k5(z)||I5(z))&&k.current!=Pe&&(k.current=Pe,!Ce&&Pe!==0?$e?p_($,Pe<0?D5:L5):p_($,Pe<0?M5:P5):p_($,0)),Ce&&(x(ce),I.current.layout=ce,xe&&xe(ce),gl(_e,ce,C.current))}},[]),j=b.useCallback(($,Y)=>{const{onLayout:Q}=A.current,{layout:F,panelDataArray:z}=I.current,K=z.map(be=>be.constraints),{panelSize:ae,pivotIndices:H}=os(z,$,F);gt(ae!=null,`Panel size not found for panel "${$.id}"`);const me=Cl(z,$)===z.length-1?ae-Y:Y-ae,xe=Lu({delta:me,initialLayout:F,panelConstraints:K,pivotIndices:H,prevLayout:F,trigger:"imperative-api"});Lp(F,xe)||(x(xe),I.current.layout=xe,Q&&Q(xe),gl(z,xe,C.current))},[]),G=b.useCallback(($,Y)=>{const{layout:Q,panelDataArray:F}=I.current,{collapsedSize:z=0,collapsible:K}=Y,{collapsedSize:ae=0,collapsible:H,maxSize:de=100,minSize:me=0}=$.constraints,{panelSize:xe}=os(F,$,Q);xe!=null&&(K&&H&&_o(xe,z)?_o(z,ae)||j($,ae):xe<me?j($,me):xe>de&&j($,de))},[j]),V=b.useCallback(($,Y)=>{const{direction:Q}=A.current,{layout:F}=I.current;if(!y.current)return;const z=Rh($,y.current);gt(z,`Drag handle element not found for id "${$}"`);const K=$5(Q,Y);S({dragHandleId:$,dragHandleRect:z.getBoundingClientRect(),initialCursorPosition:K,initialLayout:F})},[]),te=b.useCallback(()=>{S(null)},[]),re=b.useCallback($=>{const{panelDataArray:Y}=I.current,Q=Cl(Y,$);Q>=0&&(Y.splice(Q,1),delete C.current[$.id],I.current.panelDataArrayChanged=!0,_())},[_]),U=b.useMemo(()=>({collapsePanel:O,direction:n,dragState:w,expandPanel:L,getPanelSize:M,getPanelStyle:P,groupId:v,isPanelCollapsed:W,isPanelExpanded:X,reevaluatePanelConstraints:G,registerPanel:ee,registerResizeHandle:J,resizePanel:j,startDragging:V,stopDragging:te,unregisterPanel:re,panelGroupElement:y.current}),[O,w,n,L,M,P,v,W,X,G,ee,J,j,V,te,re]),q={display:"flex",flexDirection:n==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return b.createElement(xh.Provider,{value:U},b.createElement(m,{...h,children:e,className:r,id:s,ref:y,style:{...q,...f},[gr.group]:"",[gr.groupDirection]:n,[gr.groupId]:v}))}const G5=b.forwardRef((t,e)=>b.createElement(V5,{...t,forwardedRef:e}));V5.displayName="PanelGroup";G5.displayName="forwardRef(PanelGroup)";function Cl(t,e){return t.findIndex(r=>r===e||r.id===e.id)}function os(t,e,r){const n=Cl(t,e),s=n===t.length-1?[n-1,n]:[n,n+1],l=r[n];return{...e.constraints,panelSize:l,pivotIndices:s}}function Kve({disabled:t,handleId:e,resizeHandler:r,panelGroupElement:n}){b.useEffect(()=>{if(t||r==null||n==null)return;const a=Rh(e,n);if(a==null)return;const s=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),r(l);break}case"F6":{l.preventDefault();const c=a.getAttribute(gr.groupId);gt(c,`No group element found for id "${c}"`);const d=_d(c,n),f=U5(c,e,n);gt(f!==null,`No resize element found for id "${e}"`);const m=l.shiftKey?f>0?f-1:d.length-1:f+1<d.length?f+1:0;d[m].focus();break}}};return a.addEventListener("keydown",s),()=>{a.removeEventListener("keydown",s)}},[n,t,e,r])}function W5({children:t=null,className:e="",disabled:r=!1,hitAreaMargins:n,id:a,onBlur:s,onClick:l,onDragging:c,onFocus:d,onPointerDown:f,onPointerUp:m,style:h={},tabIndex:v=0,tagName:y="div",...w}){var S,R;const x=b.useRef(null),_=b.useRef({onClick:l,onDragging:c,onPointerDown:f,onPointerUp:m});b.useEffect(()=>{_.current.onClick=l,_.current.onDragging=c,_.current.onPointerDown=f,_.current.onPointerUp=m});const C=b.useContext(xh);if(C===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:N,groupId:k,registerResizeHandle:A,startDragging:I,stopDragging:O,panelGroupElement:L}=C,M=YC(a),[P,W]=b.useState("inactive"),[X,ee]=b.useState(!1),[J,j]=b.useState(null),G=b.useRef({state:P});gs(()=>{G.current.state=P}),b.useEffect(()=>{if(r)j(null);else{const U=A(M);j(()=>U)}},[r,M,A]);const V=(S=n?.coarse)!==null&&S!==void 0?S:15,te=(R=n?.fine)!==null&&R!==void 0?R:5;b.useEffect(()=>{if(r||J==null)return;const U=x.current;gt(U,"Element ref not attached");let q=!1;return Dve(M,U,N,{coarse:V,fine:te},(Y,Q,F)=>{if(!Q){W("inactive");return}switch(Y){case"down":{W("drag"),q=!1,gt(F,'Expected event to be defined for "down" action'),I(M,F);const{onDragging:z,onPointerDown:K}=_.current;z?.(!0),K?.();break}case"move":{const{state:z}=G.current;q=!0,z!=="drag"&&W("hover"),gt(F,'Expected event to be defined for "move" action'),J(F);break}case"up":{W("hover"),O();const{onClick:z,onDragging:K,onPointerUp:ae}=_.current;K?.(!1),ae?.(),q||z?.();break}}})},[V,N,r,te,A,M,J,I,O]),Kve({disabled:r,handleId:M,resizeHandler:J,panelGroupElement:L});const re={touchAction:"none",userSelect:"none"};return b.createElement(y,{...w,children:t,className:e,id:a,onBlur:()=>{ee(!1),s?.()},onFocus:()=>{ee(!0),d?.()},ref:x,role:"separator",style:{...re,...h},tabIndex:v,[gr.groupDirection]:N,[gr.groupId]:k,[gr.resizeHandle]:"",[gr.resizeHandleActive]:P==="drag"?"pointer":X?"keyboard":void 0,[gr.resizeHandleEnabled]:!r,[gr.resizeHandleId]:M,[gr.resizeHandleState]:P})}W5.displayName="PanelResizeHandle";function Td({className:t,...e}){return g.jsx(G5,{"data-slot":"resizable-panel-group",className:De("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e})}function Ua({...t}){return g.jsx(A5,{"data-slot":"resizable-panel",...t})}function Rd({withHandle:t,className:e,...r}){return g.jsx(W5,{"data-slot":"resizable-handle",className:De("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...r,children:t&&g.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:g.jsx(WQ,{className:"size-2.5"})})})}function Xd({id:t,isSelected:e,isFocused:r,icon:n,title:a,description:s,metadata:l,onClick:c,className:d}){return g.jsx("button",{id:t,type:"button",onClick:c,className:De("w-full text-left cursor-pointer p-4 border-b dark:border-zinc-700 hover:bg-gray-50 dark:hover:bg-zinc-800/50 transition-colors group",e&&"bg-zinc-50 dark:bg-zinc-800 border-l-4 border-l-zinc-500",r&&"ring-2 ring-zinc-500 dark:ring-zinc-400 ring-inset",d),children:g.jsxs("div",{className:"flex items-start gap-3",children:[g.jsx("div",{className:"flex-shrink-0 mt-1",children:g.jsx("div",{className:De("p-2.5 rounded-full transition-colors",e?"bg-zinc-500 dark:bg-zinc-100/80 text-zinc-100 dark:text-zinc-900":"bg-gray-100 dark:bg-zinc-700 text-gray-600 dark:text-gray-400 group-hover:bg-gray-200 dark:group-hover:bg-zinc-600"),children:n})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"flex items-center gap-2 mb-1",children:g.jsx("h3",{className:De("font-medium truncate font-mono text-sm"),children:a})}),s&&g.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 line-clamp-2",children:s})]})]})})}function Y5({className:t,...e}){return g.jsx("kbd",{"data-slot":"kbd",className:De("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",t),...e})}function K5({activeTab:t,isSearchExpanded:e,searchQuery:r,primaryTabTitle:n,secondaryTabTitle:a,primaryCount:s,secondaryCount:l,secondaryIcon:c,primaryIcon:d,searchPlaceholder:f="Search...",onSearchExpand:m,onSearchChange:h,onSearchBlur:v,onTabSwitch:y,searchInputRef:w,primaryTabName:S}){const R=t===S;return g.jsxs("div",{className:"flex items-center justify-between p-4 py-3 border-r dark:border-zinc-700",children:[g.jsx("div",{className:"flex items-center gap-2 flex-1",children:e?g.jsx(Or,{ref:w,placeholder:f,value:r,onChange:x=>h(x.target.value),onBlur:v,className:"h-8 border-gray-300 dark:border-zinc-600"}):g.jsxs(g.Fragment,{children:[g.jsx("h2",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:R?n:a}),R&&g.jsxs(g.Fragment,{children:[g.jsx(Ga,{className:"bg-zinc-500/20 text-zinc-600 dark:text-zinc-400 border-transparent",variant:"outline",children:s}),g.jsxs(jr,{children:[g.jsx(Ur,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"sm",onClick:m,className:"h-8 w-8 p-0",children:g.jsx(LR,{className:"h-4 w-4"})})}),g.jsxs(Fr,{side:"bottom",className:"flex gap-2",children:["Search",g.jsx(Y5,{children:"F"})]})]})]})]})}),g.jsxs(tt,{variant:"ghost",size:"sm",onClick:y,className:"gap-2",children:[R?g.jsx(c,{}):g.jsx(d,{}),g.jsx("span",{children:R?a:n}),R&&l>0&&g.jsx(Ga,{className:"bg-purple-500/20 text-purple-600 dark:text-purple-400 border-transparent",variant:"outline",children:l})]})]})}function Zve({prompts:t,selectedPrompt:e,onPromptSelect:r,focusedIndex:n}){return t.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx(pd,{className:"h-12 w-12 text-gray-400 dark:text-gray-600 mb-3"}),g.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"No prompts available"})]}):g.jsx("div",{className:"overflow-y-auto flex-1 border-r dark:border-zinc-700 overscroll-contain",children:t.map((a,s)=>g.jsx(Xd,{id:`prompt-${a.name}`,isSelected:e?.name===a.name,isFocused:n===s,icon:g.jsx(pd,{className:"h-4 w-4"}),title:a.name,description:a.description,metadata:a.arguments&&a.arguments.length>0&&g.jsxs(Ga,{variant:"outline",className:"text-xs border-gray-300 dark:border-zinc-600 text-gray-600 dark:text-gray-400",children:[a.arguments.length," args"]}),onClick:()=>r(a)},a.name))})}function Xve({activeTab:t,isSearchExpanded:e,searchQuery:r,filteredPromptsCount:n,savedPromptsCount:a,onSearchExpand:s,onSearchChange:l,onSearchBlur:c,onTabSwitch:d,searchInputRef:f}){return g.jsx(K5,{activeTab:t,isSearchExpanded:e,searchQuery:r,primaryTabName:"prompts",secondaryTabName:"saved",primaryTabTitle:"Prompts",secondaryTabTitle:"History",primaryCount:n,secondaryCount:a,primaryIcon:pd,secondaryIcon:ic,searchPlaceholder:"Search prompts...",onSearchExpand:s,onSearchChange:l,onSearchBlur:c,onTabSwitch:d,searchInputRef:f})}function Qve({savedPrompts:t,selectedPrompt:e,onLoadPrompt:r,onDeletePrompt:n,focusedIndex:a}){return t.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx(ic,{className:"h-12 w-12 text-gray-400 dark:text-gray-600 mb-3"}),g.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"No history"}),g.jsx("p",{className:"text-sm text-gray-400 dark:text-gray-500 mt-1",children:"Prompts you execute will appear here"})]}):g.jsx("div",{className:"overflow-y-auto flex-1 border-r dark:border-zinc-700 overscroll-contain",children:t.map((s,l)=>g.jsx(Xd,{id:`saved-prompt-${s.id}`,isSelected:e?.id===s.id,isFocused:a===l,icon:g.jsx(ic,{className:"h-4 w-4"}),title:s.name,description:`${s.promptName} - ${new Date(s.savedAt).toLocaleString()}`,onClick:()=>r(s)},s.id))})}function Jve({selectedPrompt:t,promptArgs:e,onArgChange:r}){const n=t?.arguments||[];if(!(n.length>0))return g.jsx("div",{className:"flex items-center justify-center h-32 text-gray-500 dark:text-gray-400 text-sm",children:"No arguments required"});const s=l=>{const c=l.name,d=e[c],f=typeof d=="string"?d:JSON.stringify(d);return l.type==="boolean"?g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:c,className:"text-sm font-medium",children:[c,l.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx("input",{id:c,type:"checkbox",checked:!!d,onChange:m=>r(c,m.target.checked),className:"rounded","aria-label":`Toggle ${c}`}),g.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:l.description})]})]},c):l.type==="number"?g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:c,className:"text-sm font-medium",children:[c,l.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsx(Or,{id:c,type:"number",value:Number(d)||0,onChange:m=>r(c,Number(m.target.value)),placeholder:l.description||`Enter ${c}`}),l.description&&g.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l.description})]},c):l.type==="array"||l.type==="object"?g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:c,className:"text-sm font-medium",children:[c,l.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsx(mh,{id:c,value:f,onChange:m=>{try{const h=JSON.parse(m.target.value);r(c,h)}catch{r(c,m.target.value)}},placeholder:l.description||`Enter ${c} as JSON`,className:"font-mono text-sm min-h-[100px]"}),l.description&&g.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l.description})]},c):g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:c,className:"text-sm font-medium",children:[c,l.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsx(Or,{id:c,value:f,onChange:m=>r(c,m.target.value),placeholder:l.description||`Enter ${c}`}),l.description&&g.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l.description})]},c)};return g.jsx("div",{className:"space-y-4",children:n.map(l=>s(l))})}function ebe({selectedPrompt:t,promptArgs:e,isExecuting:r,isConnected:n,onArgChange:a,onExecute:s,onSave:l}){return t?g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsx("div",{className:"flex-shrink-0 p-6 pt-3 pb-4 pr-3",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center justify-between mb-0",children:[g.jsx("h3",{className:"text-lg font-semibold mb-2",children:t.name}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(tt,{onClick:s,disabled:r||!n,children:r?g.jsxs(g.Fragment,{children:[g.jsx(Lo,{className:"mr-2"}),"Executing..."]}):g.jsxs(g.Fragment,{children:[g.jsx(kB,{className:"h-4 w-4 mr-2"}),"Execute"]})}),g.jsxs(tt,{variant:"outline",onClick:l,disabled:r,className:"gap-2",children:[g.jsx(DR,{className:"h-4 w-4"}),"Save"]})]})]}),t.description&&g.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 leading-relaxed",children:t.description})]})}),g.jsx("div",{className:"flex-1 overflow-y-auto px-6 pb-4 pr-3",children:g.jsx(Jve,{selectedPrompt:t,promptArgs:e,onArgChange:a})})]}):g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-2",children:"Select a prompt to get started"}),g.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"Choose a prompt from the list to view its details and execute it"})]})}function tbe({results:t,copiedResult:e,onCopy:r}){return g.jsx("div",{className:"flex flex-col h-full bg-white dark:bg-black border-t dark:border-zinc-700",children:g.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:t.length>0?g.jsx("div",{className:"space-y-4 flex-1 h-full",children:t.map((n,a)=>g.jsxs("div",{className:"space-y-0 flex-1 h-full flex flex-col",children:[g.jsxs("div",{className:"flex items-center gap-2 px-4 pt-2 border-b border-gray-200 dark:border-zinc-600 pb-2",children:[g.jsx("h3",{className:"text-sm font-medium",children:"Response"}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(ic,{className:"h-3 w-3 text-gray-400"}),g.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(n.timestamp).toLocaleTimeString()})]}),n.duration!==void 0&&g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(md,{className:"h-3 w-3 text-gray-400"}),g.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[n.duration,"ms"]})]}),g.jsx("div",{className:"flex gap-2 ml-auto",children:g.jsx(tt,{variant:"ghost",size:"sm",onClick:()=>r(a,n.result),className:"h-6 px-2",children:e===a?g.jsx(Do,{className:"h-4 w-4"}):g.jsx(aa,{className:"h-4 w-4"})})})]}),n.error?g.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 mx-4",children:[g.jsx("p",{className:"text-red-800 dark:text-red-300 font-medium",children:"Error:"}),g.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:n.error})]}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:n.result,filename:`prompt-result-${n.promptName}-${Date.now()}.json`})})]},a))}):g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx("div",{className:"text-center",children:g.jsx(yR,{vertical:!0,noBorder:!0,message:"No Results yet"})})})})})}const Qz="mcp-inspector-saved-prompts";function Z5({ref:t,prompts:e,callPrompt:r,serverId:n,isConnected:a}){const[s,l]=b.useState(null),[c,d]=b.useState(null),{selectedPromptName:f,setSelectedPromptName:m}=Hd(),[h,v]=b.useState({}),[y,w]=b.useState([]),[S,R]=b.useState(!1),[x,_]=b.useState(null),[C,N]=b.useState(""),[k,A]=b.useState("prompts"),[I,O]=b.useState([]),[L,M]=b.useState(!1),[P,W]=b.useState(""),[X,ee]=b.useState(!1),[J,j]=b.useState(-1),G=b.useRef(null);b.useImperativeHandle(t,()=>({focusSearch:()=>{ee(!0),setTimeout(()=>{G.current&&G.current.focus()},0)},blurSearch:()=>{N(""),ee(!1),G.current&&G.current.blur()}})),b.useEffect(()=>{try{const K=localStorage.getItem(Qz);if(K){const ae=JSON.parse(K);O(ae)}}catch(K){console.error("[PromptsTab] Failed to load saved prompts:",K)}},[]);const V=b.useCallback(K=>{try{localStorage.setItem(Qz,JSON.stringify(K))}catch(ae){console.error("[PromptsTab] Failed to save prompts:",ae)}},[]);b.useEffect(()=>{X&&G.current&&G.current.focus()},[X]);const te=b.useCallback(()=>{C.trim()||ee(!1)},[C]),re=b.useMemo(()=>{if(!C.trim())return e;const K=C.toLowerCase();return e.filter(ae=>ae.name.toLowerCase().includes(K)||ae.description?.toLowerCase().includes(K))},[e,C]),U=b.useCallback(K=>{l(K);const ae={};K.arguments&&K.arguments.forEach(H=>{H.default!==void 0?ae[H.name]=H.default:H.type==="string"?ae[H.name]="":H.type==="number"?ae[H.name]=0:H.type==="boolean"?ae[H.name]=!1:H.type==="array"?ae[H.name]=[]:H.type==="object"&&(ae[H.name]={})}),v(ae)},[]),q=b.useCallback(K=>{const ae=e.find(H=>H.name===K.promptName);ae&&(l(ae),v(K.args),d(K))},[e]);b.useEffect(()=>{j(-1)},[C,k]),b.useEffect(()=>{const K=ae=>{const H=ae.target;if(H.tagName==="INPUT"||H.tagName==="TEXTAREA"||H.contentEditable==="true"||ae.metaKey||ae.ctrlKey||ae.altKey)return;const me=k==="prompts"?re:I;if(ae.key==="ArrowDown")ae.preventDefault(),j(xe=>{const be=xe+1;return be>=me.length?0:be});else if(ae.key==="ArrowUp")ae.preventDefault(),j(xe=>{const be=xe-1;return be<0?me.length-1:be});else if(ae.key==="Enter"&&J>=0)if(ae.preventDefault(),k==="prompts"){const xe=re[J];xe&&U(xe)}else{const xe=I[J];xe&&q(xe)}};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[J,re,I,k,U,q]),b.useEffect(()=>{if(J>=0){const K=k==="prompts"?`prompt-${re[J]?.name}`:`saved-prompt-${I[J]?.id}`,ae=document.getElementById(K);ae&&ae.scrollIntoView({behavior:"smooth",block:"nearest"})}},[J,re,I,k]),b.useEffect(()=>{if(console.warn("[PromptsTab] Auto-selection effect triggered:",{selectedPromptName:f,promptsCount:e.length,currentSelectedPrompt:s?.name}),f&&e.length>0){const K=e.find(ae=>ae.name===f);if(console.warn("[PromptsTab] Prompt lookup result:",{selectedPromptName:f,promptFound:!!K,promptName:K?.name,shouldSelect:K&&s?.name!==K.name}),K&&s?.name!==K.name){console.warn("[PromptsTab] Selecting prompt:",K.name),m(null);const ae=setTimeout(()=>{U(K);const H=document.getElementById(`prompt-${K.name}`);H&&(console.warn("[PromptsTab] Scrolling to prompt element"),H.scrollIntoView({behavior:"smooth",block:"nearest"}))},100);return()=>clearTimeout(ae)}}},[f,e,s,U,m]);const $=b.useCallback((K,ae)=>{v(H=>({...H,[K]:ae}))},[]),Y=b.useCallback(async()=>{if(!s||S)return;R(!0);const K=Date.now();try{const ae=await r(s.name,h),H=Date.now()-K;zr.getInstance().capture(new zO({promptName:s.name,serverId:n,success:!0})).catch(()=>{}),w(me=>[{promptName:s.name,args:h,result:ae,timestamp:K,duration:H},...me])}catch(ae){zr.getInstance().capture(new zO({promptName:s.name,serverId:n,success:!1,error:ae instanceof Error?ae.message:"Unknown error"})).catch(()=>{});const de={promptName:s.name,args:h,result:null,error:ae instanceof Error?ae.message:String(ae),timestamp:K,duration:Date.now()-K};w(me=>[de,...me])}finally{R(!1)}},[s,h,S,r,n]),Q=b.useCallback(async(K,ae)=>{try{await navigator.clipboard.writeText(JSON.stringify(ae,null,2)),_(K),setTimeout(()=>_(null),2e3)}catch(H){console.error("[PromptsTab] Failed to copy result:",H)}},[]),F=b.useCallback(()=>{s&&(W(""),M(!0))},[s]),z=b.useCallback(K=>{V(I.filter(ae=>ae.id!==K)),c?.id===K&&d(null)},[I,V,c]);return g.jsxs(Td,{direction:"horizontal",className:"h-full",children:[g.jsxs(Ua,{defaultSize:33,className:"flex flex-col h-full relative",children:[g.jsx(Xve,{activeTab:k,isSearchExpanded:X,searchQuery:C,filteredPromptsCount:re.length,savedPromptsCount:I.length,onSearchExpand:()=>ee(!0),onSearchChange:N,onSearchBlur:te,onTabSwitch:()=>A(k==="prompts"?"saved":"prompts"),searchInputRef:G}),k==="prompts"?g.jsx(Zve,{prompts:re,selectedPrompt:s,onPromptSelect:U,focusedIndex:J}):g.jsx(Qve,{savedPrompts:I,selectedPrompt:c,onLoadPrompt:q,onDeletePrompt:z,focusedIndex:J})]}),g.jsx(Rd,{withHandle:!0}),g.jsx(Ua,{defaultSize:67,children:g.jsxs(Td,{direction:"vertical",children:[g.jsx(Ua,{defaultSize:40,children:g.jsx(ebe,{selectedPrompt:s,promptArgs:h,isExecuting:S,isConnected:a,onArgChange:$,onExecute:Y,onSave:F})}),g.jsx(Rd,{withHandle:!0}),g.jsx(Ua,{defaultSize:60,children:g.jsx("div",{className:"flex flex-col h-full",children:g.jsx(tbe,{results:y,copiedResult:x,onCopy:Q})})})]})})]})}Z5.displayName="PromptsTab";function ql(t){if(!t?.mimeType)return!1;const e=t.mimeType.toLowerCase();return e==="text/html"||e==="text/html+skybridge"||e==="text/uri-list"||e.startsWith("application/vnd.mcp-ui.remote-dom")}function rbe(t){return{uri:t.uri,mimeType:t.mimeType,text:t.text,blob:t.blob}}function X5({resource:t,onUIAction:e,className:r}){const n=async s=>e?.(s),a=rbe(t);return g.jsx("div",{className:r,children:g.jsx(GC,{resource:a,onUIAction:n,htmlProps:{autoResizeIframe:{width:!0,height:!0},style:{width:"100%",minHeight:"200px"},sandboxPermissions:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox"},remoteDomProps:{remoteElements:[fve,dve,pve,mve],library:VC}})})}function nbe({result:t,isLoading:e,previewMode:r,serverId:n,readResource:a,onTogglePreview:s,onCopy:l,onDownload:c,onFullscreen:d,isCopied:f=!1}){let m=[],h;if(t?.resourceAnnotations&&(m=Object.keys(t.resourceAnnotations).filter(S=>S.startsWith("openai/")),h=t.resourceAnnotations["openai/outputTemplate"]),t?.result?.contents?.[0]?._meta){const S=t.result.contents[0]._meta,R=Object.keys(S).filter(x=>x.startsWith("openai/"));R.length>0&&(m=[...m,...R]),!h&&S["openai/outputTemplate"]&&(h=S["openai/outputTemplate"]),!h&&t.uri&&t.uri.startsWith("ui://widget/")&&(h=t.uri)}const v=!!(m.length>0&&h&&typeof h=="string"&&n&&a);if(e)return g.jsx("div",{className:"flex absolute left-0 top-0 items-center justify-center w-full h-full",children:g.jsx(Lo,{className:"size-5"})});if(!t)return g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-2",children:"Select a resource to view its contents"}),g.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"Choose a resource from the list to see its data"})]});if(t.error)return g.jsx("div",{className:"p-4",children:g.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3",children:[g.jsx("p",{className:"text-red-800 dark:text-red-300 font-medium",children:"Error:"}),g.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:t.error})]})});const y=t?.result?.contents&&Array.isArray(t.result.contents)&&t.result.contents.some(S=>S.mimeType&&ql(S)),w=y?t.result.contents.filter(S=>S.mimeType&&ql(S)):[];return g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex-shrink-0 px-4 py-3 border-b border-gray-200 dark:border-zinc-700 flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(ic,{className:"h-3 w-3 text-gray-400"}),g.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(t.timestamp).toLocaleTimeString()})]}),(()=>{const S=t?.duration??t.result?.duration??t.result?.metrics?.durationMs;return S!==void 0?g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(md,{className:"h-3 w-3 text-gray-400"}),g.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[S,"ms"]})]}):null})(),y&&g.jsx(Ga,{variant:"outline",className:"text-xs bg-purple-50 dark:bg-purple-900/20 border-none border-purple-200 dark:border-purple-800/50 text-purple-600 dark:text-purple-400",children:"MCP UI"}),v&&g.jsx(Ga,{variant:"outline",className:"text-xs bg-blue-50 dark:bg-blue-900/20 border-none border-blue-200 dark:border-blue-800/50 text-blue-600 dark:text-blue-400",children:"OpenAI Widget"})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[(y||v)&&g.jsxs(tt,{variant:"ghost",size:"sm",onClick:s,className:r?"":"text-purple-600 dark:text-purple-400",children:[r?g.jsx(wQ,{className:"h-4 w-4 mr-1"}):g.jsx(mQ,{className:"h-4 w-4 mr-1"}),r?"JSON":v?"Component":"Preview"]}),g.jsx(tt,{variant:"ghost",size:"sm",onClick:l,children:f?g.jsx(Do,{className:"h-4 w-4"}):g.jsx(aa,{className:"h-4 w-4"})}),g.jsx(tt,{variant:"ghost",size:"sm",onClick:c,children:g.jsx(CB,{className:"h-4 w-4"})}),g.jsx(tt,{variant:"ghost",size:"sm",onClick:d,children:g.jsx(QQ,{className:"h-4 w-4"})})]})]}),g.jsx("div",{className:"flex-1 overflow-y-auto",children:v&&n&&a&&h?r?g.jsx("div",{className:"flex-1 h-full",children:g.jsx(zC,{componentUrl:h,toolName:t.uri,toolArgs:{},toolResult:t.result,serverId:n,readResource:a,className:"w-full h-full relative flex p-4"})}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:t.result,filename:`resource-${t.uri.replace(/[^a-zA-Z0-9]/g,"-")}-${Date.now()}.json`})}):y?r?g.jsxs("div",{className:"space-y-0 h-full",children:[w.map((S,R)=>g.jsx("div",{className:"mx-0 size-full",children:g.jsx("div",{className:"w-full h-full",children:g.jsx(X5,{resource:S,className:"w-full h-full"})})},`mcp-ui-${S.uri||`resource-${Date.now()}-${Math.random()}`}`)),(()=>{if(t.result.contents&&Array.isArray(t.result.contents)){const S=t.result.contents.filter(R=>!(R.mimeType&&ql(R)));if(S.length>0)return g.jsx("div",{className:"px-4",children:g.jsx(ja,{data:S,filename:`resource-${t.uri.replace(/[^a-zA-Z0-9]/g,"-")}-non-ui-${Date.now()}.json`})})}return null})()]}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:t.result,filename:`resource-${t.uri.replace(/[^a-zA-Z0-9]/g,"-")}-mcp-ui-${Date.now()}.json`})}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:t.result,filename:`resource-${t.uri.replace(/[^a-zA-Z0-9]/g,"-")}-${Date.now()}.json`})})})]})}function abe(t,e){if(!t&&!e)return g.jsx($Q,{className:"h-5 w-5"});const r=(t||e||"").toLowerCase();return r.includes("image")?g.jsx(UQ,{className:"h-5 w-5"}):r.includes("json")||r.includes("javascript")||r.includes("typescript")?g.jsx(PQ,{className:"h-5 w-5"}):r.includes("html")||r.includes("xml")?g.jsx(VQ,{className:"h-5 w-5"}):r.includes("database")||r.includes("sql")?g.jsx(th,{className:"h-5 w-5"}):g.jsx(OR,{className:"h-5 w-5"})}function obe({resources:t,selectedResource:e,onResourceSelect:r,focusedIndex:n}){return t.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx(th,{className:"h-12 w-12 text-gray-400 dark:text-gray-600 mb-3"}),g.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"No resources available"})]}):g.jsx("div",{className:"overflow-y-auto flex-1 border-r dark:border-zinc-700 overscroll-contain",children:t.map((a,s)=>{const l=abe(a.mimeType,a.uri),c=[a.description,a.mimeType&&g.jsx("span",{className:"font-mono",children:a.mimeType},"mime")].filter(Boolean);return g.jsx(Xd,{id:`resource-${a.uri}`,isSelected:e?.uri===a.uri,isFocused:n===s,icon:l,title:a.name,description:c.length>0?g.jsxs("span",{className:"flex flex-col gap-1",children:[a.description&&g.jsx("span",{children:a.description}),a.mimeType&&g.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-500 font-mono",children:a.mimeType})]}):void 0,onClick:()=>r(a)},a.uri)})})}function ibe({isSearchExpanded:t,searchQuery:e,filteredResourcesCount:r,onSearchExpand:n,onSearchChange:a,onSearchBlur:s,searchInputRef:l}){return g.jsx("div",{className:"flex items-center justify-between p-4 py-3 border-r dark:border-zinc-700",children:g.jsx("div",{className:"flex items-center gap-2 flex-1",children:t?g.jsx(Or,{ref:l,placeholder:"Search resources...",value:e,onChange:c=>a(c.target.value),onBlur:s,className:"h-8 border-gray-300 dark:border-zinc-600"}):g.jsxs(g.Fragment,{children:[g.jsx("h2",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:"Resources"}),g.jsx(Ga,{className:"bg-zinc-500/20 text-zinc-600 dark:text-zinc-400 border-transparent",variant:"outline",children:r}),g.jsxs(jr,{children:[g.jsx(Ur,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"sm",onClick:n,className:"h-8 w-8 p-0",children:g.jsx(LR,{className:"h-4 w-4"})})}),g.jsxs(Fr,{side:"bottom",className:"flex gap-2",children:["Search",g.jsx(Y5,{children:"F"})]})]})]})})})}function Q5({ref:t,resources:e,readResource:r,serverId:n,isConnected:a}){const[s,l]=b.useState(null),{selectedResourceUri:c,setSelectedResourceUri:d}=Hd(),[f,m]=b.useState(null),[h,v]=b.useState(!1),[y,w]=b.useState(""),[S]=b.useState("resources"),[R,x]=b.useState(!0),[_,C]=b.useState(!1),[N,k]=b.useState(-1),[A,I]=b.useState(!1),O=b.useRef(null),L=b.useRef(null);b.useImperativeHandle(t,()=>({focusSearch:()=>{C(!0),setTimeout(()=>{O.current&&O.current.focus()},0)},blurSearch:()=>{w(""),C(!1),O.current&&O.current.blur()}})),b.useEffect(()=>{_&&O.current&&O.current.focus()},[_]);const M=b.useCallback(()=>{y.trim()||C(!1)},[y]),P=b.useMemo(()=>{if(!y)return e;const j=y.toLowerCase();return e.filter(G=>G.name.toLowerCase().includes(j)||G.description?.toLowerCase().includes(j)||G.uri.toLowerCase().includes(j))},[e,y]),W=b.useCallback(async j=>{if(l(j),a){v(!0);const G=Date.now();try{const V=await r(j.uri);zr.getInstance().capture(new FO({resourceUri:j.uri,serverId:n,success:!0})).catch(()=>{}),m({uri:j.uri,result:V,timestamp:G,resourceAnnotations:j.annotations})}catch(V){zr.getInstance().capture(new FO({resourceUri:j.uri,serverId:n,success:!1,error:V instanceof Error?V.message:"Unknown error"})).catch(()=>{}),m({uri:j.uri,result:null,error:V instanceof Error?V.message:"Unknown error",timestamp:G,resourceAnnotations:j.annotations})}finally{v(!1)}}},[r,n,a]);b.useEffect(()=>{k(-1)},[y,S]),b.useEffect(()=>{const j=G=>{const V=G.target;if(V.tagName==="INPUT"||V.tagName==="TEXTAREA"||V.contentEditable==="true"||G.metaKey||G.ctrlKey||G.altKey)return;const re=P;if(G.key==="ArrowDown")G.preventDefault(),k(U=>{const q=U+1;return q>=re.length?0:q});else if(G.key==="ArrowUp")G.preventDefault(),k(U=>{const q=U-1;return q<0?re.length-1:q});else if(G.key==="Enter"&&N>=0){G.preventDefault();const U=P[N];U&&W(U)}};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[N,P,W]),b.useEffect(()=>{if(N>=0){const j=`resource-${P[N]?.uri}`,G=document.getElementById(j);G&&G.scrollIntoView({behavior:"smooth",block:"nearest"})}},[N,P]),b.useEffect(()=>{if(c&&e.length>0){const j=e.find(G=>G.uri===c);j&&s?.uri!==j.uri&&(d(null),setTimeout(()=>{W(j);const G=document.getElementById(`resource-${j.uri}`);G&&G.scrollIntoView({behavior:"smooth",block:"nearest"})},100))}},[c,e,s,W,d]);const X=b.useCallback(async()=>{if(f)try{await navigator.clipboard.writeText(JSON.stringify(f.result,null,2)),I(!0),setTimeout(()=>I(!1),2e3)}catch(j){console.error("[ResourcesTab] Failed to copy result:",j)}},[f]),ee=b.useCallback(()=>{if(f)try{const j=new globalThis.Blob([JSON.stringify(f.result,null,2)],{type:"application/json"}),G=URL.createObjectURL(j),V=document.createElement("a");V.href=G,V.download=`resource-${Date.now()}.json`,document.body.appendChild(V),V.click(),document.body.removeChild(V),URL.revokeObjectURL(G)}catch(j){console.error("[ResourcesTab] Failed to download result:",j)}},[f]),J=b.useCallback(async()=>{if(L.current)try{document.fullscreenElement?await document.exitFullscreen():await L.current.requestFullscreen()}catch(j){console.error("[ResourcesTab] Failed to toggle fullscreen:",j)}},[]);return g.jsxs(Td,{direction:"horizontal",className:"h-full",children:[g.jsxs(Ua,{defaultSize:25,children:[g.jsx(ibe,{activeTab:S,isSearchExpanded:_,searchQuery:y,filteredResourcesCount:P.length,onSearchExpand:()=>C(!0),onSearchChange:w,onSearchBlur:M,onTabSwitch:()=>{},searchInputRef:O}),g.jsx("div",{className:"flex flex-col h-full",children:g.jsx(obe,{resources:P,selectedResource:s,onResourceSelect:W,focusedIndex:N})})]}),g.jsx(Rd,{}),g.jsx(Ua,{defaultSize:50,children:g.jsx("div",{ref:L,className:"h-full bg-white dark:bg-zinc-900",children:g.jsx(nbe,{result:f,isLoading:h,previewMode:R,serverId:n,readResource:r,onTogglePreview:()=>x(!R),onCopy:X,onDownload:ee,onFullscreen:J,isCopied:A})})})]})}Q5.displayName="ResourcesTab";function sbe({savedRequests:t,selectedRequest:e,onLoadRequest:r,onDeleteRequest:n,focusedIndex:a}){if(t.length===0)return g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx(th,{className:"h-12 w-12 text-gray-400 dark:text-gray-600 mb-3"}),g.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-2",children:"No saved requests yet"}),g.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"Execute a tool and click Save to store requests"})]});const s=(l,c)=>{l.stopPropagation(),c()};return g.jsx("div",{className:"overflow-y-auto flex-1 border-r dark:border-zinc-700 overscroll-contain",children:t.map((l,c)=>g.jsxs("div",{className:"relative group",children:[g.jsx(Xd,{id:`saved-${l.id}`,isSelected:e?.id===l.id,isFocused:a===c,icon:g.jsx(AB,{className:"h-4 w-4"}),title:l.name,description:l.toolName,metadata:g.jsx("div",{className:"flex flex-col gap-1",children:g.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:new Date(l.savedAt).toLocaleString()})}),onClick:()=>r(l)}),g.jsx("div",{className:"absolute top-1/2 right-2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:g.jsxs(jr,{children:[g.jsx(Ur,{asChild:!0,children:g.jsx(tt,{variant:"secondary",size:"sm",onClick:d=>s(d,()=>n(l.id)),className:"h-8 w-8 p-0",children:g.jsx(rT,{className:"h-4 w-4"})})}),g.jsx(Fr,{children:g.jsx("p",{children:"Delete saved request"})})]})})]},l.id))})}function lbe({isOpen:t,requestName:e,defaultPlaceholder:r,onRequestNameChange:n,onSave:a,onCancel:s}){return t?g.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:s,children:g.jsxs("div",{className:"bg-white dark:bg-zinc-800 rounded-lg p-6 w-[400px] shadow-xl border border-gray-200 dark:border-zinc-700",onClick:l=>l.stopPropagation(),children:[g.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-gray-100",children:"Save Request"}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx(lr,{htmlFor:"request-name",children:"Request Name (optional)"}),g.jsx(Or,{id:"request-name",value:e,onChange:l=>n(l.target.value),placeholder:r,className:"mt-2",onKeyDown:l=>{l.key==="Enter"&&a()},autoFocus:!0})]}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx(tt,{variant:"outline",onClick:s,children:"Cancel"}),g.jsxs(tt,{onClick:a,children:[g.jsx(DR,{className:"h-4 w-4 mr-2"}),"Save"]})]})]})]})}):null}function cbe({selectedTool:t,toolArgs:e,onArgChange:r}){const n=t?.inputSchema?.properties||{},a=t?.inputSchema?.required||[];return Object.keys(n).length>0?g.jsx("div",{className:"space-y-4",children:Object.entries(n).map(([l,c])=>{const d=c;d.required=a.includes(l);const f=e[l];let m="";return f!=null&&(typeof f=="string"?m=f:typeof f=="object"&&f!==null?m=JSON.stringify(f,null,2):m=String(f)),d.type==="object"||d.type==="array"?g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:l,className:"text-sm font-medium",children:[l,d?.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsx(mh,{id:l,value:m,onChange:v=>r(l,v.target.value),placeholder:d?.description||`Enter ${l}`,className:"min-h-[100px]"}),d?.description&&g.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:d.description})]},l):g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:l,className:"text-sm font-medium",children:[l,d?.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsx(Or,{id:l,value:m,onChange:v=>r(l,v.target.value),placeholder:d?.description||`Enter ${l}`}),d?.description&&g.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:d.description})]},l)})}):g.jsx("div",{className:"flex items-center justify-center h-32 text-gray-500 dark:text-gray-400 text-sm",children:"No parameters required"})}function ube({selectedTool:t,toolArgs:e,isExecuting:r,isConnected:n,onArgChange:a,onExecute:s,onSave:l}){return t?g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsx("div",{className:"flex-shrink-0 p-6 pt-3 pb-4 pr-3",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center justify-between mb-0",children:[g.jsx("h3",{className:"text-lg font-semibold mb-2",children:t.name}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(tt,{onClick:s,disabled:r||!n,children:r?g.jsxs(g.Fragment,{children:[g.jsx(Lo,{className:"mr-2"}),"Executing..."]}):g.jsxs(g.Fragment,{children:[g.jsx(kB,{className:"h-4 w-4 mr-2"}),"Execute"]})}),g.jsxs(tt,{variant:"outline",onClick:l,disabled:r,className:"gap-2",children:[g.jsx(DR,{className:"h-4 w-4"}),"Save"]})]})]}),t.description&&g.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 leading-relaxed",children:t.description})]})}),g.jsx("div",{className:"flex-1 overflow-y-auto px-6 pb-4 pr-3",children:g.jsx(cbe,{selectedTool:t,toolArgs:e,onArgChange:a})})]}):g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-2",children:"Select a tool to get started"}),g.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"Choose a tool from the list to view its details and execute it"})]})}function dbe({results:t,copiedResult:e,previewMode:r,serverId:n,readResource:a,onCopy:s,onTogglePreview:l}){return g.jsx("div",{className:"flex flex-col h-full bg-white dark:bg-black border-t dark:border-zinc-700",children:g.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:t.length>0?g.jsx("div",{className:"space-y-4 flex-1 h-full",children:t.map((c,d)=>{const f=c.toolMeta?.["openai/outputTemplate"],m=!!(f&&typeof f=="string"&&c.appsSdkResource),h=f,v=c.result?.content||[],y=v.filter(S=>S.type==="resource"&&ql(S.resource)),w=y.length>0;return g.jsxs("div",{className:"space-y-0 flex-1 h-full flex flex-col",children:[g.jsxs("div",{className:`flex items-center gap-2 px-4 pt-2 ${w||m?"border-b border-gray-200 dark:border-zinc-600 pb-2":""}`,children:[g.jsx("h3",{className:"text-sm font-medium",children:"Response"}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(ic,{className:"h-3 w-3 text-gray-400"}),g.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(c.timestamp).toLocaleTimeString()})]}),c.duration!==void 0&&g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(md,{className:"h-3 w-3 text-gray-400"}),g.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[c.duration,"ms"]})]}),m&&g.jsxs("div",{className:"flex items-center gap-4 ml-4",children:[g.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["URI: ",h||"No URI"]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("button",{onClick:()=>l(),className:`text-xs font-medium ${r?"text-black dark:text-white":"text-zinc-500 dark:text-zinc-400"}`,children:"Component"}),g.jsx("span",{className:"text-xs text-zinc-400",children:"|"}),g.jsx("button",{onClick:()=>l(),className:`text-xs font-medium ${r?"text-zinc-500 dark:text-zinc-400":"text-black dark:text-white"}`,children:"Raw JSON"})]})]}),w&&!m&&g.jsxs("div",{className:"flex items-center gap-4 ml-4",children:[g.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["URI: ",y[0]?.resource?.uri||"No URI"]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("button",{onClick:()=>l(),className:`text-xs font-medium ${r?"text-black dark:text-white":"text-zinc-500 dark:text-zinc-400"}`,children:"Preview"}),g.jsx("span",{className:"text-xs text-zinc-400",children:"|"}),g.jsx("button",{onClick:()=>l(),className:`text-xs font-medium ${r?"text-zinc-500 dark:text-zinc-400":"text-black dark:text-white"}`,children:"JSON"})]})]}),g.jsx(tt,{variant:"ghost",size:"sm",onClick:()=>s(d,c.result),className:"ml-auto",children:e===d?g.jsx(Do,{className:"h-4 w-4"}):g.jsx(aa,{className:"h-4 w-4"})})]}),c.error?g.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 mx-4",children:[g.jsx("p",{className:"text-red-800 dark:text-red-300 font-medium",children:"Error:"}),g.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:c.error})]}):(()=>{if(m){const S=c.appsSdkResource;return S.isLoading?g.jsx(g.Fragment,{}):S.error?g.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 mx-4",children:[g.jsx("p",{className:"text-red-800 dark:text-red-300 font-medium",children:"Resource Error:"}),g.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:S.error})]}):r?g.jsx("div",{className:"flex-1",children:g.jsx(zC,{componentUrl:h,toolName:c.toolName,toolArgs:c.args,toolResult:c.result,resource:S.resourceData,serverId:n,readResource:a,className:"w-full h-full relative p-4"})}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:c.result,filename:`tool-result-${c.toolName}-${Date.now()}.json`})})}return w?r?g.jsxs("div",{className:"space-y-0 h-full",children:[y.map((S,R)=>g.jsx("div",{className:"mx-0 size-full",children:g.jsx(X5,{resource:S.resource,onUIAction:x=>{},className:"w-full h-full relative"})},R)),v.filter(S=>!(S.type==="resource"&&ql(S.resource))).length>0&&g.jsx("div",{className:"px-4",children:g.jsx(ja,{data:v.filter(S=>!(S.type==="resource"&&ql(S.resource))),filename:`tool-result-${c.toolName}-non-ui-${Date.now()}.json`})})]}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:c.result,filename:`tool-result-${c.toolName}-mcp-ui-${Date.now()}.json`})}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:c.result,filename:`tool-result-${c.toolName}-${Date.now()}.json`})})})()]},d)})}):g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx("div",{className:"text-center",children:g.jsx(yR,{vertical:!0,noBorder:!0,message:"No Results yet"})})})})})}function fbe({tools:t,selectedTool:e,onToolSelect:r,focusedIndex:n}){return t.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx(ws,{className:"h-12 w-12 text-gray-400 dark:text-gray-600 mb-3"}),g.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"No tools available"})]}):g.jsx("div",{className:"overflow-y-auto flex-1 border-r dark:border-zinc-700 overscroll-contain",children:t.map((a,s)=>g.jsx(Xd,{id:`tool-${a.name}`,isSelected:e?.name===a.name,isFocused:n===s,icon:g.jsx(ws,{className:"h-4 w-4"}),title:a.name,description:a.description,metadata:a.inputSchema?.properties&&g.jsxs(Ga,{variant:"outline",className:"text-xs border-gray-300 dark:border-zinc-600 text-gray-600 dark:text-gray-400",children:[Object.keys(a.inputSchema.properties).length," params"]}),onClick:()=>r(a)},a.name))})}function pbe({activeTab:t,isSearchExpanded:e,searchQuery:r,filteredToolsCount:n,savedRequestsCount:a,onSearchExpand:s,onSearchChange:l,onSearchBlur:c,onTabSwitch:d,searchInputRef:f}){return g.jsx(K5,{activeTab:t,isSearchExpanded:e,searchQuery:r,primaryTabName:"tools",secondaryTabName:"saved",primaryTabTitle:"Tools",secondaryTabTitle:"Saved",primaryCount:n,secondaryCount:a,primaryIcon:ws,secondaryIcon:th,searchPlaceholder:"Search tools...",onSearchExpand:s,onSearchChange:l,onSearchBlur:c,onTabSwitch:d,searchInputRef:f})}const Jz="mcp-inspector-saved-requests";function J5({ref:t,tools:e,callTool:r,readResource:n,serverId:a,isConnected:s}){const[l,c]=b.useState(null),[d,f]=b.useState(null),{selectedToolName:m,setSelectedToolName:h}=Hd(),[v,y]=b.useState({}),[w,S]=b.useState([]),[R,x]=b.useState(!1),[_,C]=b.useState(null),[N,k]=b.useState(""),[A,I]=b.useState("tools"),[O,L]=b.useState([]),[M,P]=b.useState(!1),[W,X]=b.useState(""),[ee,J]=b.useState(!0),[j,G]=b.useState(!1),[V,te]=b.useState(-1),re=b.useRef(null);b.useImperativeHandle(t,()=>({focusSearch:()=>{G(!0),setTimeout(()=>{re.current&&re.current.focus()},0)},blurSearch:()=>{k(""),G(!1),re.current&&re.current.blur()}})),b.useEffect(()=>{try{const be=localStorage.getItem(Jz);be&&L(JSON.parse(be))}catch(be){console.error("[ToolsTab] Failed to load saved requests:",be)}},[]);const U=b.useCallback(be=>{try{localStorage.setItem(Jz,JSON.stringify(be)),L(be)}catch(_e){console.error("[ToolsTab] Failed to save requests:",_e)}},[]),q=b.useMemo(()=>{if(!N.trim())return e;const be=N.toLowerCase();return e.filter(_e=>_e.name.toLowerCase().includes(be)||_e.description?.toLowerCase().includes(be))},[e,N]),$=b.useCallback(be=>{c(be);const _e={};be.inputSchema?.properties&&Object.entries(be.inputSchema.properties).forEach(([Ae,Fe])=>{const Pe=Fe;Pe.default!==void 0?_e[Ae]=Pe.default:Pe.type==="string"?_e[Ae]="":Pe.type==="number"?_e[Ae]=0:Pe.type==="boolean"?_e[Ae]=!1:Pe.type==="array"?_e[Ae]="[]":Pe.type==="object"&&(_e[Ae]="{}")}),y(_e)},[]),Y=b.useCallback(be=>{const _e=e.find(Ae=>Ae.name===be.toolName);_e&&(c(_e),y(be.args),f(be))},[e]);b.useEffect(()=>{j&&re.current&&re.current.focus()},[j]);const Q=b.useCallback(()=>{N.trim()||G(!1)},[N]);b.useEffect(()=>{A!=="tools"&&G(!1)},[A]),b.useEffect(()=>{te(-1)},[N,A]),b.useEffect(()=>{const be=_e=>{const Ae=_e.target;if(Ae.tagName==="INPUT"||Ae.tagName==="TEXTAREA"||Ae.contentEditable==="true"||_e.metaKey||_e.ctrlKey||_e.altKey)return;const Pe=A==="tools"?q:O;if(_e.key==="ArrowDown")_e.preventDefault(),te($e=>{const at=$e+1;return at>=Pe.length?0:at});else if(_e.key==="ArrowUp")_e.preventDefault(),te($e=>{const at=$e-1;return at<0?Pe.length-1:at});else if(_e.key==="Enter"&&V>=0)if(_e.preventDefault(),A==="tools"){const $e=q[V];$e&&$($e)}else{const $e=O[V];$e&&Y($e)}};return document.addEventListener("keydown",be),()=>document.removeEventListener("keydown",be)},[V,q,O,A,$,Y]),b.useEffect(()=>{if(V>=0){const be=A==="tools"?`tool-${q[V]?.name}`:`saved-${O[V]?.id}`,_e=document.getElementById(be);_e&&_e.scrollIntoView({behavior:"smooth",block:"nearest"})}},[V,q,O,A]),b.useEffect(()=>{if(m&&e.length>0){const be=e.find(_e=>_e.name===m);if(be&&l?.name!==be.name){h(null);const _e=setTimeout(()=>{$(be);const Ae=document.getElementById(`tool-${be.name}`);Ae&&Ae.scrollIntoView({behavior:"smooth",block:"nearest"})},100);return()=>clearTimeout(_e)}}},[m,e,l,$,h]);const F=b.useCallback((be,_e)=>{y(Ae=>{const Fe={...Ae};if(l?.inputSchema?.properties?.[be]){const $e=l.inputSchema.properties[be].type;if($e==="object"||$e==="array")Fe[be]=_e;else if($e==="string")Fe[be]=_e;else try{Fe[be]=JSON.parse(_e)}catch{Fe[be]=_e}}else Fe[be]=_e;return Fe})},[l]),z=b.useCallback(async()=>{if(!l||R)return;x(!0);const be=Date.now();try{const _e={...v};l.inputSchema?.properties&&Object.entries(l.inputSchema.properties).forEach(([Ce,ze])=>{const Ne=ze.type,Oe=_e[Ce];if((Ne==="object"||Ne==="array")&&typeof Oe=="string")try{_e[Ce]=JSON.parse(Oe)}catch{}});const Ae=await r(l.name,_e),Fe=Date.now()-be;zr.getInstance().capture(new UO({toolName:l.name,serverId:a,success:!0,duration:Fe})).catch(()=>{});const $e=l?._meta||l?.metadata,at=$e?.["openai/outputTemplate"];let ce;if(at&&typeof at=="string"){const Ce={toolName:l.name,args:v,result:Ae,timestamp:be,duration:Fe,toolMeta:$e,appsSdkResource:{uri:at,resourceData:null,isLoading:!0}};S([Ce]);try{const ze=await n(at);let we=null;if(Ae?.structuredContent)we=Ae.structuredContent;else if(Array.isArray(Ae)&&Ae[0]){const Ne=Ae[0];Ne.output?.value?.structuredContent?we=Ne.output.value.structuredContent:Ne.structuredContent?we=Ne.structuredContent:Ne.output?.value&&(we=Ne.output.value)}we||(we=Ae),ce={uri:at,resourceData:{...ze,structuredContent:we},isLoading:!1}}catch(ze){ce={uri:at,resourceData:null,isLoading:!1,error:ze instanceof Error?ze.message:String(ze)}}S(ze=>ze.map((we,Ne)=>Ne===0?{...we,appsSdkResource:ce}:we))}else S(Ce=>[{toolName:l.name,args:v,result:Ae,timestamp:be,duration:Fe,toolMeta:$e},...Ce])}catch(_e){const Ae=Date.now()-be;zr.getInstance().capture(new UO({toolName:l.name,serverId:a,success:!1,duration:Ae,error:_e instanceof Error?_e.message:String(_e)})).catch(()=>{});const Pe=l?._meta||l?.metadata,$e={toolName:l.name,args:v,result:null,error:_e instanceof Error?_e.message:String(_e),timestamp:be,duration:Ae,toolMeta:Pe},at=Pe?.["openai/outputTemplate"];S(at?[$e]:ce=>[$e,...ce])}finally{x(!1)}},[l,v,R,r,n,a]),K=b.useCallback(async(be,_e)=>{try{await navigator.clipboard.writeText(JSON.stringify(_e,null,2)),C(be),setTimeout(()=>C(null),2e3)}catch(Ae){console.error("[ToolsTab] Failed to copy result:",Ae)}},[]),ae=b.useCallback(be=>{S(_e=>_e.filter((Ae,Fe)=>Fe!==be))},[]),H=b.useCallback(be=>{const _e=w[be];if(_e){const Ae=window.open("","_blank","width=800,height=600");Ae&&(Ae.document.write(`
1545
+ `);C=A.pop()||"";for(const I of A)if(I.trim()&&I.startsWith("data: "))try{const O=JSON.parse(I.slice(6));if(console.log("[Client received event]",O.type,O.toolName||O.content?.slice?.(0,30)),O.type==="message")console.log("[Message started]",O.id);else if(O.type==="text"){S+=O.content;const L=R[R.length-1];L&&L.type==="text"?L.text=S:R.push({type:"text",text:S}),console.log("[Parts after text]",R.length,"parts, text length:",S.length),s(M=>M.map(P=>P.id===w?{...P,parts:[...R]}:P))}else if(O.type==="tool-call")S&&(S=""),R.push({type:"tool-invocation",toolInvocation:{toolName:O.toolName,args:O.args,state:"pending"}}),console.log("[Parts after tool-call]",R.length,"parts, tool:",O.toolName),s(L=>L.map(M=>M.id===w?{...M,parts:[...R]}:M));else if(O.type==="tool-result"){const L=R.find(M=>M.type==="tool-invocation"&&M.toolInvocation?.toolName===O.toolName&&!M.toolInvocation?.result);L&&L.toolInvocation?(L.toolInvocation.result=O.result,L.toolInvocation.state="result",console.log("[Parts after tool-result]",R.length,"parts, updated:",O.toolName),s(M=>M.map(P=>P.id===w?{...P,parts:[...R]}:P))):console.warn("[tool-result] Could not find matching tool part for",O.toolName)}else if(O.type==="done")console.log("[Done] Final parts:",R.length),s(L=>L.map(M=>M.id===w?{...M,parts:[...R],content:""}:M));else if(O.type==="error")throw new Error(O.message||"Streaming error")}catch(O){console.error("Failed to parse streaming event:",O,I)}}}catch(v){let y="Unknown error occurred";if(v instanceof Error){y=v.message;const S=v;S.status&&(y=`HTTP ${S.status}: ${y}`),(S.code===401||y.includes("401")||y.includes("Unauthorized"))&&(y="Authentication failed (401). Check your Authorization header in the connection settings.")}const w={id:`error-${Date.now()}`,role:"assistant",content:`Error: ${y}`,timestamp:Date.now()};s(S=>[...S,w])}finally{c(!1)}},[e,n,t,a,r]),f=b.useCallback(()=>{s([])},[]);return{messages:a,isLoading:l,sendMessage:d,clearMessages:f}}function yve({connection:t,llmConfig:e,isConnected:r,readResource:n}){const[a,s]=b.useState([]),[l,c]=b.useState(!1),d=b.useRef(null),f=b.useRef(null),m=b.useRef(null),h=b.useCallback(async y=>{if(!y.trim()||!e||!r)return;const w={id:`user-${Date.now()}`,role:"user",content:y.trim(),timestamp:Date.now()};s(x=>[...x,w]),c(!0),d.current=new AbortController;const S=Date.now();let R=0;try{const x=`assistant-${Date.now()}`;let _="";const C=[];if(s(N=>[...N,{id:x,role:"assistant",content:"",timestamp:Date.now(),parts:[]}]),!m.current||m.current.provider!==e.provider||m.current.model!==e.model||m.current.apiKey!==e.apiKey){let N;if(e.provider==="openai"){const{ChatOpenAI:k}=await cs(async()=>{const{ChatOpenAI:A}=await import("./index-BiSYQqGa.js");return{ChatOpenAI:A}},__vite__mapDeps([4,5,6,2,7]));N=new k({model:e.model,apiKey:e.apiKey})}else if(e.provider==="anthropic"){const{ChatAnthropic:k}=await cs(async()=>{const{ChatAnthropic:A}=await import("./index-BDWwgNIO.js");return{ChatAnthropic:A}},__vite__mapDeps([8,5,6,2]));N=new k({model:e.model,apiKey:e.apiKey})}else if(e.provider==="google"){const{ChatGoogleGenerativeAI:k}=await cs(async()=>{const{ChatGoogleGenerativeAI:A}=await import("./index-BbXTQtxh.js");return{ChatGoogleGenerativeAI:A}},__vite__mapDeps([9,5,6,2,7]));N=new k({model:e.model,apiKey:e.apiKey})}else throw new Error(`Unsupported LLM provider: ${e.provider}`);m.current={instance:N,provider:e.provider,model:e.model,apiKey:e.apiKey}}if(!f.current||f.current.llm!==m.current.instance){const{MCPAgent:N}=await cs(async()=>{const{MCPAgent:k}=await import("./langfuse-C4HKZ3NL-CsiDw8Wb.js").then(A=>A.c);return{MCPAgent:k}},__vite__mapDeps([10,6,2,1,3]));f.current=new N({llm:m.current.instance,client:t.client,memoryEnabled:!0,systemPrompt:"You are a helpful assistant with access to MCP tools, prompts, and resources. Help users interact with the MCP server."}),await f.current.initialize()}else console.log("[useChatMessagesClientSide] Reusing existing agent. History length:",f.current.conversationHistory?.length);for await(const N of f.current.streamEvents(y,10,!1,void 0)){if(d.current?.signal.aborted)break;if(N.event==="on_chat_model_stream"&&N.data?.chunk?.text){const k=N.data.chunk.text;if(typeof k=="string"&&k.length>0){_+=k;const A=C[C.length-1];A&&A.type==="text"?A.text=_:C.push({type:"text",text:_}),s(I=>I.map(O=>O.id===x?{...O,parts:[...C]}:O))}}else if(N.event==="on_tool_start"){_&&(_="");let k={};N.data?.input?k=N.data.input:N.data?.tool_input?k=N.data.tool_input:N.data&&(k=N.data),console.log("[useChatMessagesClientSide] on_tool_start:",{toolName:N.name,eventData:N.data,extractedArgs:k}),R++,C.push({type:"tool-invocation",toolInvocation:{toolName:N.name||"unknown",args:k,state:"pending"}}),s(A=>A.map(I=>I.id===x?{...I,parts:[...C]}:I))}else if(N.event==="on_tool_end"){const k=C.find(A=>A.type==="tool-invocation"&&A.toolInvocation?.toolName===N.name&&!A.toolInvocation?.result);if(console.log("[useChatMessagesClientSide] on_tool_end event:",{toolName:N.name,hasToolPart:!!k,output:N.data?.output}),k&&k.toolInvocation){let A=N.data?.output;if(A?.kwargs?.content&&typeof A.kwargs.content=="string")try{A=JSON.parse(A.kwargs.content)}catch(O){console.warn("[useChatMessagesClientSide] Failed to parse kwargs.content:",O),A=A.kwargs.content}else if(A?.content&&typeof A.content=="string")try{A=JSON.parse(A.content)}catch{A=A.content}k.toolInvocation.result=A,k.toolInvocation.state="result";const I=A?._meta?.["openai/outputTemplate"];if(console.log("[useChatMessagesClientSide] Tool result:",{toolName:N.name,hasMeta:!!A?._meta,hasStructuredContent:!!A?.structuredContent,appsSdkUri:I}),I&&typeof I=="string"&&n){console.log("[useChatMessagesClientSide] Detected Apps SDK component, fetching resource:",I);try{const O=await n(I);console.log("[useChatMessagesClientSide] Resource fetched:",O);const L=A?.structuredContent||null;if(O?.contents&&Array.isArray(O.contents)){const M=O.contents.map(W=>({type:"resource",resource:W}));console.log("[useChatMessagesClientSide] Created MCP resources:",M);const P={...A,content:[...A.content||[],...M],structuredContent:L};k.toolInvocation.result=P,console.log("[useChatMessagesClientSide] Updated result with resources")}else console.warn("[useChatMessagesClientSide] No contents in resourceData:",O)}catch(O){console.error("Failed to fetch Apps SDK resource:",O)}}s(O=>O.map(L=>L.id===x?{...L,parts:[...C]}:L))}}}s(N=>N.map(k=>k.id===x?{...k,parts:[...C],content:""}:k)),e&&zr.getInstance().capture(new $O({serverId:t.url,provider:e.provider,model:e.model,messageCount:a.length+1,toolCallsCount:R,success:!0,executionMode:"client-side",duration:Date.now()-S})).catch(()=>{})}catch(x){console.error("Client-side agent error:",x);let _="Unknown error occurred";if(x instanceof Error){_=x.message;const N=x;N.status&&(_=`HTTP ${N.status}: ${_}`),(N.code===401||_.includes("401")||_.includes("Unauthorized"))&&(_="Authentication failed (401). Check your Authorization header in the connection settings.")}e&&zr.getInstance().capture(new $O({serverId:t.url,provider:e.provider,model:e.model,messageCount:a.length+1,toolCallsCount:R,success:!1,executionMode:"client-side",duration:Date.now()-S,error:_})).catch(()=>{});const C={id:`error-${Date.now()}`,role:"assistant",content:`Error: ${_}`,timestamp:Date.now()};s(N=>[...N,C])}finally{c(!1),d.current=null}},[t,e,r,a,n]),v=b.useCallback(()=>{s([]),f.current&&f.current.clearConversationHistory()},[]);return{messages:a,isLoading:l,sendMessage:h,clearMessages:v}}const qz={openai:"gpt-4o",anthropic:"claude-haiku-4-5-20251001",google:"gemini-2.5-flash"};function Eve({mcpServerUrl:t}){const[e,r]=b.useState(null),[n,a]=b.useState(null),[s,l]=b.useState(!1),[c,d]=b.useState("openai"),[f,m]=b.useState(""),[h,v]=b.useState(qz.openai),y=b.useCallback(()=>{const L=localStorage.getItem("mcp-inspector-api-keys");if(L)try{return JSON.parse(L)}catch(M){return console.error("Failed to load API keys:",M),{}}return{}},[]),w=b.useCallback(L=>{localStorage.setItem("mcp-inspector-api-keys",JSON.stringify(L))},[]),[S,R]=b.useState("none"),[x,_]=b.useState(""),[C,N]=b.useState(""),[k,A]=b.useState("");b.useEffect(()=>{const L=localStorage.getItem("mcp-inspector-llm-config"),M=y();if(L)try{const P=JSON.parse(L);r(P),d(P.provider),m(M[P.provider]||P.apiKey||""),v(P.model)}catch(P){console.error("Failed to load LLM config:",P)}},[y]),b.useEffect(()=>{const L=localStorage.getItem("mcp-inspector-auth-config");if(L)try{const M=JSON.parse(L);a(M),R(M.type),M.username&&_(M.username),M.password&&N(M.password),M.token&&A(M.token)}catch(M){console.error("Failed to load auth config:",M)}else try{const M="mcp:auth",P=R5(t),W=`${M}_${P}_tokens`;localStorage.getItem(W)&&(a({type:"oauth"}),R("oauth"))}catch(M){console.error("Failed to check for OAuth tokens:",M)}},[t]),b.useEffect(()=>{v(qz[c]);const L=y();m(L[c]||"")},[c,y]);const I=b.useCallback(()=>{if(!f.trim())return;const L=y();L[c]=f,w(L);const M={provider:c,apiKey:f,model:h},P={type:S,...S==="basic"&&{username:x.trim(),password:C.trim()},...S==="bearer"&&{token:k.trim()}};r(M),a(P),localStorage.setItem("mcp-inspector-llm-config",JSON.stringify(M)),localStorage.setItem("mcp-inspector-auth-config",JSON.stringify(P)),l(!1)},[c,f,h,S,x,C,k,y,w]),O=b.useCallback(()=>{r(null),a(null);const L=y();delete L[c],w(L),m(""),_(""),N(""),A(""),R("none"),localStorage.removeItem("mcp-inspector-llm-config"),localStorage.removeItem("mcp-inspector-auth-config")},[c,y,w]);return{llmConfig:e,authConfig:n,configDialogOpen:s,setConfigDialogOpen:l,tempProvider:c,setTempProvider:d,tempApiKey:f,setTempApiKey:m,tempModel:h,setTempModel:v,tempAuthType:S,saveLLMConfig:I,clearConfig:O}}function Sve({connection:t,isConnected:e,useClientSide:r=!0,readResource:n}){const[a,s]=b.useState(""),l=b.useRef(null),{llmConfig:c,authConfig:d,configDialogOpen:f,setConfigDialogOpen:m,tempProvider:h,setTempProvider:v,tempApiKey:y,setTempApiKey:w,tempModel:S,setTempModel:R,saveLLMConfig:x,clearConfig:_}=Eve({mcpServerUrl:t.url}),C={connection:t,llmConfig:c,isConnected:e,readResource:n},N=bve({mcpServerUrl:t.url,llmConfig:c,authConfig:d,isConnected:e}),k=yve(C),{messages:A,isLoading:I,sendMessage:O,clearMessages:L}=r?k:N;P4({onNewChat:L}),b.useEffect(()=>{c&&A.length===0&&l.current&&l.current.focus()},[c,A.length]),b.useEffect(()=>{!I&&A.length>0&&l.current&&l.current.focus()},[I,A.length]);const M=b.useCallback(()=>{a.trim()&&(O(a),s(""))},[a,O]),P=b.useCallback(X=>{X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),M())},[M]),W=b.useCallback(()=>{_(),L()},[_,L]);return c&&A.length===0?g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsx("div",{className:"absolute top-4 right-4 z-10",children:g.jsx(Cq,{open:f,onOpenChange:m,tempProvider:h,tempModel:S,tempApiKey:y,onProviderChange:v,onModelChange:R,onApiKeyChange:w,onSave:x,onClear:W,showClearButton:!0,buttonLabel:"Change API Key"})}),g.jsx(hse,{mcpServerUrl:t.url,inputValue:a,isConnected:e,isLoading:I,textareaRef:l,llmConfig:c,onInputChange:s,onKeyDown:P,onSubmit:X=>{X.preventDefault(),M()},onConfigDialogOpenChange:m})]}):g.jsxs("div",{className:"flex flex-col h-full relative",children:[g.jsx(fse,{llmConfig:c,hasMessages:A.length>0,configDialogOpen:f,onConfigDialogOpenChange:m,onClearChat:L,tempProvider:h,tempModel:S,tempApiKey:y,onProviderChange:v,onModelChange:R,onApiKeyChange:w,onSaveConfig:x,onClearConfig:W}),g.jsx("div",{className:"flex-1 overflow-y-auto p-4 pt-[100px]",children:c?g.jsx(vve,{messages:A,isLoading:I,serverId:t.url,readResource:n}):g.jsx(gse,{onConfigureClick:()=>m(!0)})}),c&&g.jsx(pse,{inputValue:a,isConnected:e,isLoading:I,textareaRef:l,onInputChange:s,onKeyDown:P,onSendMessage:M})]})}const xh=b.createContext(null);xh.displayName="PanelGroupContext";const gr={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},WC=10,gs=b.useLayoutEffect,Hz=Bm.useId,xve=typeof Hz=="function"?Hz:()=>null;let wve=0;function YC(t=null){const e=xve(),r=b.useRef(t||e||null);return r.current===null&&(r.current=""+wve++),t??r.current}function C5({children:t,className:e="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:s,id:l,maxSize:c,minSize:d,onCollapse:f,onExpand:m,onResize:h,order:v,style:y,tagName:w="div",...S}){const R=b.useContext(xh);if(R===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:_,getPanelSize:C,getPanelStyle:N,groupId:k,isPanelCollapsed:A,reevaluatePanelConstraints:I,registerPanel:O,resizePanel:L,unregisterPanel:M}=R,P=YC(l),W=b.useRef({callbacks:{onCollapse:f,onExpand:m,onResize:h},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:c,minSize:d},id:P,idIsFromProps:l!==void 0,order:v});b.useRef({didLogMissingDefaultSizeWarning:!1}),gs(()=>{const{callbacks:ee,constraints:J}=W.current,j={...J};W.current.id=P,W.current.idIsFromProps=l!==void 0,W.current.order=v,ee.onCollapse=f,ee.onExpand=m,ee.onResize=h,J.collapsedSize=r,J.collapsible=n,J.defaultSize=a,J.maxSize=c,J.minSize=d,(j.collapsedSize!==J.collapsedSize||j.collapsible!==J.collapsible||j.maxSize!==J.maxSize||j.minSize!==J.minSize)&&I(W.current,j)}),gs(()=>{const ee=W.current;return O(ee),()=>{M(ee)}},[v,P,O,M]),b.useImperativeHandle(s,()=>({collapse:()=>{x(W.current)},expand:ee=>{_(W.current,ee)},getId(){return P},getSize(){return C(W.current)},isCollapsed(){return A(W.current)},isExpanded(){return!A(W.current)},resize:ee=>{L(W.current,ee)}}),[x,_,C,A,P,L]);const X=N(W.current,a);return b.createElement(w,{...S,children:t,className:e,id:P,style:{...X,...y},[gr.groupId]:k,[gr.panel]:"",[gr.panelCollapsible]:n||void 0,[gr.panelId]:P,[gr.panelSize]:parseFloat(""+X.flexGrow).toFixed(1)})}const A5=b.forwardRef((t,e)=>b.createElement(C5,{...t,forwardedRef:e}));C5.displayName="Panel";A5.displayName="forwardRef(Panel)";let BT=null,Jp=-1,yi=null;function _ve(t,e,r){const n=(e&D5)!==0,a=(e&L5)!==0,s=(e&M5)!==0,l=(e&P5)!==0;if(e){if(n)return s?"se-resize":l?"ne-resize":"e-resize";if(a)return s?"sw-resize":l?"nw-resize":"w-resize";if(s)return"s-resize";if(l)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Tve(){yi!==null&&(document.head.removeChild(yi),BT=null,yi=null,Jp=-1)}function u_(t,e,r){var n,a;const s=_ve(t,e);if(BT!==s){if(BT=s,yi===null&&(yi=document.createElement("style"),document.head.appendChild(yi)),Jp>=0){var l;(l=yi.sheet)===null||l===void 0||l.removeRule(Jp)}Jp=(n=(a=yi.sheet)===null||a===void 0?void 0:a.insertRule(`*{cursor: ${s} !important;}`))!==null&&n!==void 0?n:-1}}function N5(t){return t.type==="keydown"}function k5(t){return t.type.startsWith("pointer")}function I5(t){return t.type.startsWith("mouse")}function wh(t){if(k5(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(I5(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function Rve(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Cve(t,e,r){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Ave(t,e){if(t===e)throw new Error("Cannot compare node with itself");const r={a:Wz(t),b:Wz(e)};let n;for(;r.a.at(-1)===r.b.at(-1);)t=r.a.pop(),e=r.b.pop(),n=t;gt(n,"Stacking order can only be calculated for elements with a common ancestor");const a={a:Gz(Vz(r.a)),b:Gz(Vz(r.b))};if(a.a===a.b){const s=n.childNodes,l={a:r.a.at(-1),b:r.b.at(-1)};let c=s.length;for(;c--;){const d=s[c];if(d===l.a)return 1;if(d===l.b)return-1}}return Math.sign(a.a-a.b)}const Nve=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function kve(t){var e;const r=getComputedStyle((e=O5(t))!==null&&e!==void 0?e:t).display;return r==="flex"||r==="inline-flex"}function Ive(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||kve(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Nve.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Vz(t){let e=t.length;for(;e--;){const r=t[e];if(gt(r,"Missing node"),Ive(r))return r}return null}function Gz(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Wz(t){const e=[];for(;t;)e.push(t),t=O5(t);return e}function O5(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const D5=1,L5=2,M5=4,P5=8,Ove=Rve()==="coarse";let Ea=[],Bl=!1,Ei=new Map,_h=new Map;const wd=new Set;function Dve(t,e,r,n,a){var s;const{ownerDocument:l}=e,c={direction:r,element:e,hitAreaMargins:n,setResizeHandlerState:a},d=(s=Ei.get(l))!==null&&s!==void 0?s:0;return Ei.set(l,d+1),wd.add(c),Dm(),function(){var m;_h.delete(t),wd.delete(c);const h=(m=Ei.get(l))!==null&&m!==void 0?m:1;if(Ei.set(l,h-1),Dm(),h===1&&Ei.delete(l),Ea.includes(c)){const v=Ea.indexOf(c);v>=0&&Ea.splice(v,1),Th(),a("up",!0,null)}}}function Lve(t){const{target:e}=t,{x:r,y:n}=wh(t);Bl=!0,KC({target:e,x:r,y:n}),Dm(),Ea.length>0&&(Lm("down",t),Th(),t.preventDefault(),j5(e)||t.stopImmediatePropagation())}function d_(t){const{x:e,y:r}=wh(t);if(Bl&&t.type!=="pointerleave"&&t.buttons===0&&(Bl=!1,Lm("up",t)),!Bl){const{target:n}=t;KC({target:n,x:e,y:r})}Lm("move",t),Th(),Ea.length>0&&t.preventDefault()}function f_(t){const{target:e}=t,{x:r,y:n}=wh(t);_h.clear(),Bl=!1,Ea.length>0&&(t.preventDefault(),j5(e)||t.stopImmediatePropagation()),Lm("up",t),KC({target:e,x:r,y:n}),Th(),Dm()}function j5(t){let e=t;for(;e;){if(e.hasAttribute(gr.resizeHandle))return!0;e=e.parentElement}return!1}function KC({target:t,x:e,y:r}){Ea.splice(0);let n=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(n=t),wd.forEach(a=>{const{element:s,hitAreaMargins:l}=a,c=s.getBoundingClientRect(),{bottom:d,left:f,right:m,top:h}=c,v=Ove?l.coarse:l.fine;if(e>=f-v&&e<=m+v&&r>=h-v&&r<=d+v){if(n!==null&&document.contains(n)&&s!==n&&!s.contains(n)&&!n.contains(s)&&Ave(n,s)>0){let w=n,S=!1;for(;w&&!w.contains(s);){if(Cve(w.getBoundingClientRect(),c)){S=!0;break}w=w.parentElement}if(S)return}Ea.push(a)}})}function p_(t,e){_h.set(t,e)}function Th(){let t=!1,e=!1;Ea.forEach(n=>{const{direction:a}=n;a==="horizontal"?t=!0:e=!0});let r=0;_h.forEach(n=>{r|=n}),t&&e?u_("intersection",r):t?u_("horizontal",r):e?u_("vertical",r):Tve()}let m_;function Dm(){var t;(t=m_)===null||t===void 0||t.abort(),m_=new AbortController;const e={capture:!0,signal:m_.signal};wd.size&&(Bl?(Ea.length>0&&Ei.forEach((r,n)=>{const{body:a}=n;r>0&&(a.addEventListener("contextmenu",f_,e),a.addEventListener("pointerleave",d_,e),a.addEventListener("pointermove",d_,e))}),Ei.forEach((r,n)=>{const{body:a}=n;a.addEventListener("pointerup",f_,e),a.addEventListener("pointercancel",f_,e)})):Ei.forEach((r,n)=>{const{body:a}=n;r>0&&(a.addEventListener("pointerdown",Lve,e),a.addEventListener("pointermove",d_,e))}))}function Lm(t,e){wd.forEach(r=>{const{setResizeHandlerState:n}=r,a=Ea.includes(r);n(t,a,e)})}function Mve(){const[t,e]=b.useState(0);return b.useCallback(()=>e(r=>r+1),[])}function gt(t,e){if(!t)throw console.error(e),Error(e)}function As(t,e,r=WC){return t.toFixed(r)===e.toFixed(r)?0:t>e?1:-1}function _o(t,e,r=WC){return As(t,e,r)===0}function jn(t,e,r){return As(t,e,r)===0}function Pve(t,e,r){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){const a=t[n],s=e[n];if(!jn(a,s,r))return!1}return!0}function Pl({panelConstraints:t,panelIndex:e,size:r}){const n=t[e];gt(n!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:a=0,collapsible:s,maxSize:l=100,minSize:c=0}=n;if(As(r,c)<0)if(s){const d=(a+c)/2;As(r,d)<0?r=a:r=c}else r=c;return r=Math.min(l,r),r=parseFloat(r.toFixed(WC)),r}function Lu({delta:t,initialLayout:e,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:s}){if(jn(t,0))return e;const l=[...e],[c,d]=n;gt(c!=null,"Invalid first pivot index"),gt(d!=null,"Invalid second pivot index");let f=0;if(s==="keyboard"){{const h=t<0?d:c,v=r[h];gt(v,`Panel constraints not found for index ${h}`);const{collapsedSize:y=0,collapsible:w,minSize:S=0}=v;if(w){const R=e[h];if(gt(R!=null,`Previous layout not found for panel index ${h}`),jn(R,y)){const x=S-R;As(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}{const h=t<0?c:d,v=r[h];gt(v,`No panel constraints found for index ${h}`);const{collapsedSize:y=0,collapsible:w,minSize:S=0}=v;if(w){const R=e[h];if(gt(R!=null,`Previous layout not found for panel index ${h}`),jn(R,S)){const x=R-y;As(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}}{const h=t<0?1:-1;let v=t<0?d:c,y=0;for(;;){const S=e[v];gt(S!=null,`Previous layout not found for panel index ${v}`);const x=Pl({panelConstraints:r,panelIndex:v,size:100})-S;if(y+=x,v+=h,v<0||v>=r.length)break}const w=Math.min(Math.abs(t),Math.abs(y));t=t<0?0-w:w}{let v=t<0?c:d;for(;v>=0&&v<r.length;){const y=Math.abs(t)-Math.abs(f),w=e[v];gt(w!=null,`Previous layout not found for panel index ${v}`);const S=w-y,R=Pl({panelConstraints:r,panelIndex:v,size:S});if(!jn(w,R)&&(f+=w-R,l[v]=R,f.toFixed(3).localeCompare(Math.abs(t).toFixed(3),void 0,{numeric:!0})>=0))break;t<0?v--:v++}}if(Pve(a,l))return a;{const h=t<0?d:c,v=e[h];gt(v!=null,`Previous layout not found for panel index ${h}`);const y=v+f,w=Pl({panelConstraints:r,panelIndex:h,size:y});if(l[h]=w,!jn(w,y)){let S=y-w,x=t<0?d:c;for(;x>=0&&x<r.length;){const _=l[x];gt(_!=null,`Previous layout not found for panel index ${x}`);const C=_+S,N=Pl({panelConstraints:r,panelIndex:x,size:C});if(jn(_,N)||(S-=N-_,l[x]=N),jn(S,0))break;t>0?x--:x++}}}const m=l.reduce((h,v)=>v+h,0);return jn(m,100)?l:a}function jve({layout:t,panelsArray:e,pivotIndices:r}){let n=0,a=100,s=0,l=0;const c=r[0];gt(c!=null,"No pivot index found"),e.forEach((h,v)=>{const{constraints:y}=h,{maxSize:w=100,minSize:S=0}=y;v===c?(n=S,a=w):(s+=S,l+=w)});const d=Math.min(a,100-s),f=Math.max(n,100-l),m=t[c];return{valueMax:d,valueMin:f,valueNow:m}}function _d(t,e=document){return Array.from(e.querySelectorAll(`[${gr.resizeHandleId}][data-panel-group-id="${t}"]`))}function U5(t,e,r=document){const a=_d(t,r).findIndex(s=>s.getAttribute(gr.resizeHandleId)===e);return a??null}function F5(t,e,r){const n=U5(t,e,r);return n!=null?[n,n+1]:[-1,-1]}function Uve(t){return t instanceof HTMLElement?!0:typeof t=="object"&&t!==null&&"tagName"in t&&"getAttribute"in t}function z5(t,e=document){if(Uve(e)&&e.dataset.panelGroupId==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function Rh(t,e=document){const r=e.querySelector(`[${gr.resizeHandleId}="${t}"]`);return r||null}function Fve(t,e,r,n=document){var a,s,l,c;const d=Rh(e,n),f=_d(t,n),m=d?f.indexOf(d):-1,h=(a=(s=r[m])===null||s===void 0?void 0:s.id)!==null&&a!==void 0?a:null,v=(l=(c=r[m+1])===null||c===void 0?void 0:c.id)!==null&&l!==void 0?l:null;return[h,v]}function zve({committedValuesRef:t,eagerValuesRef:e,groupId:r,layout:n,panelDataArray:a,panelGroupElement:s,setLayout:l}){b.useRef({didWarnAboutMissingResizeHandle:!1}),gs(()=>{if(!s)return;const c=_d(r,s);for(let d=0;d<a.length-1;d++){const{valueMax:f,valueMin:m,valueNow:h}=jve({layout:n,panelsArray:a,pivotIndices:[d,d+1]}),v=c[d];if(v!=null){const y=a[d];gt(y,`No panel data found for index "${d}"`),v.setAttribute("aria-controls",y.id),v.setAttribute("aria-valuemax",""+Math.round(f)),v.setAttribute("aria-valuemin",""+Math.round(m)),v.setAttribute("aria-valuenow",h!=null?""+Math.round(h):"")}}return()=>{c.forEach((d,f)=>{d.removeAttribute("aria-controls"),d.removeAttribute("aria-valuemax"),d.removeAttribute("aria-valuemin"),d.removeAttribute("aria-valuenow")})}},[r,n,a,s]),b.useEffect(()=>{if(!s)return;const c=e.current;gt(c,"Eager values not found");const{panelDataArray:d}=c,f=z5(r,s);gt(f!=null,`No group found for id "${r}"`);const m=_d(r,s);gt(m,`No resize handles found for group id "${r}"`);const h=m.map(v=>{const y=v.getAttribute(gr.resizeHandleId);gt(y,"Resize handle element has no handle id attribute");const[w,S]=Fve(r,y,d,s);if(w==null||S==null)return()=>{};const R=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const _=d.findIndex(C=>C.id===w);if(_>=0){const C=d[_];gt(C,`No panel data found for index ${_}`);const N=n[_],{collapsedSize:k=0,collapsible:A,minSize:I=0}=C.constraints;if(N!=null&&A){const O=Lu({delta:jn(N,k)?I-k:k-N,initialLayout:n,panelConstraints:d.map(L=>L.constraints),pivotIndices:F5(r,y,s),prevLayout:n,trigger:"keyboard"});n!==O&&l(O)}}break}}};return v.addEventListener("keydown",R),()=>{v.removeEventListener("keydown",R)}});return()=>{h.forEach(v=>v())}},[s,t,e,r,n,a,l])}function Yz(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function $5(t,e){const r=t==="horizontal",{x:n,y:a}=wh(e);return r?n:a}function $ve(t,e,r,n,a){const s=r==="horizontal",l=Rh(e,a);gt(l,`No resize handle element found for id "${e}"`);const c=l.getAttribute(gr.groupId);gt(c,"Resize handle element has no group id attribute");let{initialCursorPosition:d}=n;const f=$5(r,t),m=z5(c,a);gt(m,`No group element found for id "${c}"`);const h=m.getBoundingClientRect(),v=s?h.width:h.height;return(f-d)/v*100}function Bve(t,e,r,n,a,s){if(N5(t)){const l=r==="horizontal";let c=0;t.shiftKey?c=100:a!=null?c=a:c=10;let d=0;switch(t.key){case"ArrowDown":d=l?0:c;break;case"ArrowLeft":d=l?-c:0;break;case"ArrowRight":d=l?c:0;break;case"ArrowUp":d=l?0:-c;break;case"End":d=100;break;case"Home":d=-100;break}return d}else return n==null?0:$ve(t,e,r,n,s)}function qve({panelDataArray:t}){const e=Array(t.length),r=t.map(s=>s.constraints);let n=0,a=100;for(let s=0;s<t.length;s++){const l=r[s];gt(l,`Panel constraints not found for index ${s}`);const{defaultSize:c}=l;c!=null&&(n++,e[s]=c,a-=c)}for(let s=0;s<t.length;s++){const l=r[s];gt(l,`Panel constraints not found for index ${s}`);const{defaultSize:c}=l;if(c!=null)continue;const d=t.length-n,f=a/d;n++,e[s]=f,a-=f}return e}function gl(t,e,r){e.forEach((n,a)=>{const s=t[a];gt(s,`Panel data not found for index ${a}`);const{callbacks:l,constraints:c,id:d}=s,{collapsedSize:f=0,collapsible:m}=c,h=r[d];if(h==null||n!==h){r[d]=n;const{onCollapse:v,onExpand:y,onResize:w}=l;w&&w(n,h),m&&(v||y)&&(y&&(h==null||_o(h,f))&&!_o(n,f)&&y(),v&&(h==null||!_o(h,f))&&_o(n,f)&&v())}})}function Lp(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!=e[r])return!1;return!0}function Hve({defaultSize:t,dragState:e,layout:r,panelData:n,panelIndex:a,precision:s=3}){const l=r[a];let c;return l==null?c=t!=null?t.toFixed(s):"1":n.length===1?c="1":c=l.toFixed(s),{flexBasis:0,flexGrow:c,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Vve(t,e=10){let r=null;return(...a)=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{t(...a)},e)}}function Kz(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,r)=>{localStorage.setItem(e,r)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function B5(t){return`react-resizable-panels:${t}`}function q5(t){return t.map(e=>{const{constraints:r,id:n,idIsFromProps:a,order:s}=e;return a?n:s?`${s}:${JSON.stringify(r)}`:JSON.stringify(r)}).sort((e,r)=>e.localeCompare(r)).join(",")}function H5(t,e){try{const r=B5(t),n=e.getItem(r);if(n){const a=JSON.parse(n);if(typeof a=="object"&&a!=null)return a}}catch{}return null}function Gve(t,e,r){var n,a;const s=(n=H5(t,r))!==null&&n!==void 0?n:{},l=q5(e);return(a=s[l])!==null&&a!==void 0?a:null}function Wve(t,e,r,n,a){var s;const l=B5(t),c=q5(e),d=(s=H5(t,a))!==null&&s!==void 0?s:{};d[c]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(l,JSON.stringify(d))}catch(f){console.error(f)}}function Zz({layout:t,panelConstraints:e}){const r=[...t],n=r.reduce((s,l)=>s+l,0);if(r.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${r.map(s=>`${s}%`).join(", ")}`);if(!jn(n,100)&&r.length>0)for(let s=0;s<e.length;s++){const l=r[s];gt(l!=null,`No layout data found for index ${s}`);const c=100/n*l;r[s]=c}let a=0;for(let s=0;s<e.length;s++){const l=r[s];gt(l!=null,`No layout data found for index ${s}`);const c=Pl({panelConstraints:e,panelIndex:s,size:l});l!=c&&(a+=l-c,r[s]=c)}if(!jn(a,0))for(let s=0;s<e.length;s++){const l=r[s];gt(l!=null,`No layout data found for index ${s}`);const c=l+a,d=Pl({panelConstraints:e,panelIndex:s,size:c});if(l!==d&&(a-=d-l,r[s]=d,jn(a,0)))break}return r}const Yve=100,Mu={getItem:t=>(Kz(Mu),Mu.getItem(t)),setItem:(t,e)=>{Kz(Mu),Mu.setItem(t,e)}},Xz={};function V5({autoSaveId:t=null,children:e,className:r="",direction:n,forwardedRef:a,id:s=null,onLayout:l=null,keyboardResizeBy:c=null,storage:d=Mu,style:f,tagName:m="div",...h}){const v=YC(s),y=b.useRef(null),[w,S]=b.useState(null),[R,x]=b.useState([]),_=Mve(),C=b.useRef({}),N=b.useRef(new Map),k=b.useRef(0),A=b.useRef({autoSaveId:t,direction:n,dragState:w,id:v,keyboardResizeBy:c,onLayout:l,storage:d}),I=b.useRef({layout:R,panelDataArray:[],panelDataArrayChanged:!1});b.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),b.useImperativeHandle(a,()=>({getId:()=>A.current.id,getLayout:()=>{const{layout:$}=I.current;return $},setLayout:$=>{const{onLayout:Y}=A.current,{layout:Q,panelDataArray:F}=I.current,z=Zz({layout:$,panelConstraints:F.map(K=>K.constraints)});Yz(Q,z)||(x(z),I.current.layout=z,Y&&Y(z),gl(F,z,C.current))}}),[]),gs(()=>{A.current.autoSaveId=t,A.current.direction=n,A.current.dragState=w,A.current.id=v,A.current.onLayout=l,A.current.storage=d}),zve({committedValuesRef:A,eagerValuesRef:I,groupId:v,layout:R,panelDataArray:I.current.panelDataArray,setLayout:x,panelGroupElement:y.current}),b.useEffect(()=>{const{panelDataArray:$}=I.current;if(t){if(R.length===0||R.length!==$.length)return;let Y=Xz[t];Y==null&&(Y=Vve(Wve,Yve),Xz[t]=Y);const Q=[...$],F=new Map(N.current);Y(t,Q,F,R,d)}},[t,R,d]),b.useEffect(()=>{});const O=b.useCallback($=>{const{onLayout:Y}=A.current,{layout:Q,panelDataArray:F}=I.current;if($.constraints.collapsible){const z=F.map(de=>de.constraints),{collapsedSize:K=0,panelSize:ae,pivotIndices:H}=os(F,$,Q);if(gt(ae!=null,`Panel size not found for panel "${$.id}"`),!_o(ae,K)){N.current.set($.id,ae);const me=Cl(F,$)===F.length-1?ae-K:K-ae,xe=Lu({delta:me,initialLayout:Q,panelConstraints:z,pivotIndices:H,prevLayout:Q,trigger:"imperative-api"});Lp(Q,xe)||(x(xe),I.current.layout=xe,Y&&Y(xe),gl(F,xe,C.current))}}},[]),L=b.useCallback(($,Y)=>{const{onLayout:Q}=A.current,{layout:F,panelDataArray:z}=I.current;if($.constraints.collapsible){const K=z.map(be=>be.constraints),{collapsedSize:ae=0,panelSize:H=0,minSize:de=0,pivotIndices:me}=os(z,$,F),xe=Y??de;if(_o(H,ae)){const be=N.current.get($.id),_e=be!=null&&be>=xe?be:xe,Fe=Cl(z,$)===z.length-1?H-_e:_e-H,Pe=Lu({delta:Fe,initialLayout:F,panelConstraints:K,pivotIndices:me,prevLayout:F,trigger:"imperative-api"});Lp(F,Pe)||(x(Pe),I.current.layout=Pe,Q&&Q(Pe),gl(z,Pe,C.current))}}},[]),M=b.useCallback($=>{const{layout:Y,panelDataArray:Q}=I.current,{panelSize:F}=os(Q,$,Y);return gt(F!=null,`Panel size not found for panel "${$.id}"`),F},[]),P=b.useCallback(($,Y)=>{const{panelDataArray:Q}=I.current,F=Cl(Q,$);return Hve({defaultSize:Y,dragState:w,layout:R,panelData:Q,panelIndex:F})},[w,R]),W=b.useCallback($=>{const{layout:Y,panelDataArray:Q}=I.current,{collapsedSize:F=0,collapsible:z,panelSize:K}=os(Q,$,Y);return gt(K!=null,`Panel size not found for panel "${$.id}"`),z===!0&&_o(K,F)},[]),X=b.useCallback($=>{const{layout:Y,panelDataArray:Q}=I.current,{collapsedSize:F=0,collapsible:z,panelSize:K}=os(Q,$,Y);return gt(K!=null,`Panel size not found for panel "${$.id}"`),!z||As(K,F)>0},[]),ee=b.useCallback($=>{const{panelDataArray:Y}=I.current;Y.push($),Y.sort((Q,F)=>{const z=Q.order,K=F.order;return z==null&&K==null?0:z==null?-1:K==null?1:z-K}),I.current.panelDataArrayChanged=!0,_()},[_]);gs(()=>{if(I.current.panelDataArrayChanged){I.current.panelDataArrayChanged=!1;const{autoSaveId:$,onLayout:Y,storage:Q}=A.current,{layout:F,panelDataArray:z}=I.current;let K=null;if($){const H=Gve($,z,Q);H&&(N.current=new Map(Object.entries(H.expandToSizes)),K=H.layout)}K==null&&(K=qve({panelDataArray:z}));const ae=Zz({layout:K,panelConstraints:z.map(H=>H.constraints)});Yz(F,ae)||(x(ae),I.current.layout=ae,Y&&Y(ae),gl(z,ae,C.current))}}),gs(()=>{const $=I.current;return()=>{$.layout=[]}},[]);const J=b.useCallback($=>{let Y=!1;const Q=y.current;return Q&&window.getComputedStyle(Q,null).getPropertyValue("direction")==="rtl"&&(Y=!0),function(z){z.preventDefault();const K=y.current;if(!K)return()=>null;const{direction:ae,dragState:H,id:de,keyboardResizeBy:me,onLayout:xe}=A.current,{layout:be,panelDataArray:_e}=I.current,{initialLayout:Ae}=H??{},Fe=F5(de,$,K);let Pe=Bve(z,$,ae,H,me,K);const $e=ae==="horizontal";$e&&Y&&(Pe=-Pe);const at=_e.map(ze=>ze.constraints),ce=Lu({delta:Pe,initialLayout:Ae??be,panelConstraints:at,pivotIndices:Fe,prevLayout:be,trigger:N5(z)?"keyboard":"mouse-or-touch"}),Ce=!Lp(be,ce);(k5(z)||I5(z))&&k.current!=Pe&&(k.current=Pe,!Ce&&Pe!==0?$e?p_($,Pe<0?D5:L5):p_($,Pe<0?M5:P5):p_($,0)),Ce&&(x(ce),I.current.layout=ce,xe&&xe(ce),gl(_e,ce,C.current))}},[]),j=b.useCallback(($,Y)=>{const{onLayout:Q}=A.current,{layout:F,panelDataArray:z}=I.current,K=z.map(be=>be.constraints),{panelSize:ae,pivotIndices:H}=os(z,$,F);gt(ae!=null,`Panel size not found for panel "${$.id}"`);const me=Cl(z,$)===z.length-1?ae-Y:Y-ae,xe=Lu({delta:me,initialLayout:F,panelConstraints:K,pivotIndices:H,prevLayout:F,trigger:"imperative-api"});Lp(F,xe)||(x(xe),I.current.layout=xe,Q&&Q(xe),gl(z,xe,C.current))},[]),G=b.useCallback(($,Y)=>{const{layout:Q,panelDataArray:F}=I.current,{collapsedSize:z=0,collapsible:K}=Y,{collapsedSize:ae=0,collapsible:H,maxSize:de=100,minSize:me=0}=$.constraints,{panelSize:xe}=os(F,$,Q);xe!=null&&(K&&H&&_o(xe,z)?_o(z,ae)||j($,ae):xe<me?j($,me):xe>de&&j($,de))},[j]),V=b.useCallback(($,Y)=>{const{direction:Q}=A.current,{layout:F}=I.current;if(!y.current)return;const z=Rh($,y.current);gt(z,`Drag handle element not found for id "${$}"`);const K=$5(Q,Y);S({dragHandleId:$,dragHandleRect:z.getBoundingClientRect(),initialCursorPosition:K,initialLayout:F})},[]),te=b.useCallback(()=>{S(null)},[]),re=b.useCallback($=>{const{panelDataArray:Y}=I.current,Q=Cl(Y,$);Q>=0&&(Y.splice(Q,1),delete C.current[$.id],I.current.panelDataArrayChanged=!0,_())},[_]),U=b.useMemo(()=>({collapsePanel:O,direction:n,dragState:w,expandPanel:L,getPanelSize:M,getPanelStyle:P,groupId:v,isPanelCollapsed:W,isPanelExpanded:X,reevaluatePanelConstraints:G,registerPanel:ee,registerResizeHandle:J,resizePanel:j,startDragging:V,stopDragging:te,unregisterPanel:re,panelGroupElement:y.current}),[O,w,n,L,M,P,v,W,X,G,ee,J,j,V,te,re]),q={display:"flex",flexDirection:n==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return b.createElement(xh.Provider,{value:U},b.createElement(m,{...h,children:e,className:r,id:s,ref:y,style:{...q,...f},[gr.group]:"",[gr.groupDirection]:n,[gr.groupId]:v}))}const G5=b.forwardRef((t,e)=>b.createElement(V5,{...t,forwardedRef:e}));V5.displayName="PanelGroup";G5.displayName="forwardRef(PanelGroup)";function Cl(t,e){return t.findIndex(r=>r===e||r.id===e.id)}function os(t,e,r){const n=Cl(t,e),s=n===t.length-1?[n-1,n]:[n,n+1],l=r[n];return{...e.constraints,panelSize:l,pivotIndices:s}}function Kve({disabled:t,handleId:e,resizeHandler:r,panelGroupElement:n}){b.useEffect(()=>{if(t||r==null||n==null)return;const a=Rh(e,n);if(a==null)return;const s=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),r(l);break}case"F6":{l.preventDefault();const c=a.getAttribute(gr.groupId);gt(c,`No group element found for id "${c}"`);const d=_d(c,n),f=U5(c,e,n);gt(f!==null,`No resize element found for id "${e}"`);const m=l.shiftKey?f>0?f-1:d.length-1:f+1<d.length?f+1:0;d[m].focus();break}}};return a.addEventListener("keydown",s),()=>{a.removeEventListener("keydown",s)}},[n,t,e,r])}function W5({children:t=null,className:e="",disabled:r=!1,hitAreaMargins:n,id:a,onBlur:s,onClick:l,onDragging:c,onFocus:d,onPointerDown:f,onPointerUp:m,style:h={},tabIndex:v=0,tagName:y="div",...w}){var S,R;const x=b.useRef(null),_=b.useRef({onClick:l,onDragging:c,onPointerDown:f,onPointerUp:m});b.useEffect(()=>{_.current.onClick=l,_.current.onDragging=c,_.current.onPointerDown=f,_.current.onPointerUp=m});const C=b.useContext(xh);if(C===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:N,groupId:k,registerResizeHandle:A,startDragging:I,stopDragging:O,panelGroupElement:L}=C,M=YC(a),[P,W]=b.useState("inactive"),[X,ee]=b.useState(!1),[J,j]=b.useState(null),G=b.useRef({state:P});gs(()=>{G.current.state=P}),b.useEffect(()=>{if(r)j(null);else{const U=A(M);j(()=>U)}},[r,M,A]);const V=(S=n?.coarse)!==null&&S!==void 0?S:15,te=(R=n?.fine)!==null&&R!==void 0?R:5;b.useEffect(()=>{if(r||J==null)return;const U=x.current;gt(U,"Element ref not attached");let q=!1;return Dve(M,U,N,{coarse:V,fine:te},(Y,Q,F)=>{if(!Q){W("inactive");return}switch(Y){case"down":{W("drag"),q=!1,gt(F,'Expected event to be defined for "down" action'),I(M,F);const{onDragging:z,onPointerDown:K}=_.current;z?.(!0),K?.();break}case"move":{const{state:z}=G.current;q=!0,z!=="drag"&&W("hover"),gt(F,'Expected event to be defined for "move" action'),J(F);break}case"up":{W("hover"),O();const{onClick:z,onDragging:K,onPointerUp:ae}=_.current;K?.(!1),ae?.(),q||z?.();break}}})},[V,N,r,te,A,M,J,I,O]),Kve({disabled:r,handleId:M,resizeHandler:J,panelGroupElement:L});const re={touchAction:"none",userSelect:"none"};return b.createElement(y,{...w,children:t,className:e,id:a,onBlur:()=>{ee(!1),s?.()},onFocus:()=>{ee(!0),d?.()},ref:x,role:"separator",style:{...re,...h},tabIndex:v,[gr.groupDirection]:N,[gr.groupId]:k,[gr.resizeHandle]:"",[gr.resizeHandleActive]:P==="drag"?"pointer":X?"keyboard":void 0,[gr.resizeHandleEnabled]:!r,[gr.resizeHandleId]:M,[gr.resizeHandleState]:P})}W5.displayName="PanelResizeHandle";function Td({className:t,...e}){return g.jsx(G5,{"data-slot":"resizable-panel-group",className:De("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e})}function Ua({...t}){return g.jsx(A5,{"data-slot":"resizable-panel",...t})}function Rd({withHandle:t,className:e,...r}){return g.jsx(W5,{"data-slot":"resizable-handle",className:De("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...r,children:t&&g.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:g.jsx(WQ,{className:"size-2.5"})})})}function Xd({id:t,isSelected:e,isFocused:r,icon:n,title:a,description:s,metadata:l,onClick:c,className:d}){return g.jsx("button",{id:t,type:"button",onClick:c,className:De("w-full text-left cursor-pointer p-4 border-b dark:border-zinc-700 hover:bg-gray-50 dark:hover:bg-zinc-800/50 transition-colors group",e&&"bg-zinc-50 dark:bg-zinc-800 border-l-4 border-l-zinc-500",r&&"ring-2 ring-zinc-500 dark:ring-zinc-400 ring-inset",d),children:g.jsxs("div",{className:"flex items-start gap-3",children:[g.jsx("div",{className:"flex-shrink-0 mt-1",children:g.jsx("div",{className:De("p-2.5 rounded-full transition-colors",e?"bg-zinc-500 dark:bg-zinc-100/80 text-zinc-100 dark:text-zinc-900":"bg-gray-100 dark:bg-zinc-700 text-gray-600 dark:text-gray-400 group-hover:bg-gray-200 dark:group-hover:bg-zinc-600"),children:n})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"flex items-center gap-2 mb-1",children:g.jsx("h3",{className:De("font-medium truncate font-mono text-sm"),children:a})}),s&&g.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 line-clamp-2",children:s})]})]})})}function Y5({className:t,...e}){return g.jsx("kbd",{"data-slot":"kbd",className:De("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",t),...e})}function K5({activeTab:t,isSearchExpanded:e,searchQuery:r,primaryTabTitle:n,secondaryTabTitle:a,primaryCount:s,secondaryCount:l,secondaryIcon:c,primaryIcon:d,searchPlaceholder:f="Search...",onSearchExpand:m,onSearchChange:h,onSearchBlur:v,onTabSwitch:y,searchInputRef:w,primaryTabName:S}){const R=t===S;return g.jsxs("div",{className:"flex items-center justify-between p-4 py-3 border-r dark:border-zinc-700",children:[g.jsx("div",{className:"flex items-center gap-2 flex-1",children:e?g.jsx(Or,{ref:w,placeholder:f,value:r,onChange:x=>h(x.target.value),onBlur:v,className:"h-8 border-gray-300 dark:border-zinc-600"}):g.jsxs(g.Fragment,{children:[g.jsx("h2",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:R?n:a}),R&&g.jsxs(g.Fragment,{children:[g.jsx(Ga,{className:"bg-zinc-500/20 text-zinc-600 dark:text-zinc-400 border-transparent",variant:"outline",children:s}),g.jsxs(jr,{children:[g.jsx(Ur,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"sm",onClick:m,className:"h-8 w-8 p-0",children:g.jsx(LR,{className:"h-4 w-4"})})}),g.jsxs(Fr,{side:"bottom",className:"flex gap-2",children:["Search",g.jsx(Y5,{children:"F"})]})]})]})]})}),g.jsxs(tt,{variant:"ghost",size:"sm",onClick:y,className:"gap-2",children:[R?g.jsx(c,{}):g.jsx(d,{}),g.jsx("span",{children:R?a:n}),R&&l>0&&g.jsx(Ga,{className:"bg-purple-500/20 text-purple-600 dark:text-purple-400 border-transparent",variant:"outline",children:l})]})]})}function Zve({prompts:t,selectedPrompt:e,onPromptSelect:r,focusedIndex:n}){return t.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx(pd,{className:"h-12 w-12 text-gray-400 dark:text-gray-600 mb-3"}),g.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"No prompts available"})]}):g.jsx("div",{className:"overflow-y-auto flex-1 border-r dark:border-zinc-700 overscroll-contain",children:t.map((a,s)=>g.jsx(Xd,{id:`prompt-${a.name}`,isSelected:e?.name===a.name,isFocused:n===s,icon:g.jsx(pd,{className:"h-4 w-4"}),title:a.name,description:a.description,metadata:a.arguments&&a.arguments.length>0&&g.jsxs(Ga,{variant:"outline",className:"text-xs border-gray-300 dark:border-zinc-600 text-gray-600 dark:text-gray-400",children:[a.arguments.length," args"]}),onClick:()=>r(a)},a.name))})}function Xve({activeTab:t,isSearchExpanded:e,searchQuery:r,filteredPromptsCount:n,savedPromptsCount:a,onSearchExpand:s,onSearchChange:l,onSearchBlur:c,onTabSwitch:d,searchInputRef:f}){return g.jsx(K5,{activeTab:t,isSearchExpanded:e,searchQuery:r,primaryTabName:"prompts",secondaryTabName:"saved",primaryTabTitle:"Prompts",secondaryTabTitle:"History",primaryCount:n,secondaryCount:a,primaryIcon:pd,secondaryIcon:ic,searchPlaceholder:"Search prompts...",onSearchExpand:s,onSearchChange:l,onSearchBlur:c,onTabSwitch:d,searchInputRef:f})}function Qve({savedPrompts:t,selectedPrompt:e,onLoadPrompt:r,onDeletePrompt:n,focusedIndex:a}){return t.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx(ic,{className:"h-12 w-12 text-gray-400 dark:text-gray-600 mb-3"}),g.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"No history"}),g.jsx("p",{className:"text-sm text-gray-400 dark:text-gray-500 mt-1",children:"Prompts you execute will appear here"})]}):g.jsx("div",{className:"overflow-y-auto flex-1 border-r dark:border-zinc-700 overscroll-contain",children:t.map((s,l)=>g.jsx(Xd,{id:`saved-prompt-${s.id}`,isSelected:e?.id===s.id,isFocused:a===l,icon:g.jsx(ic,{className:"h-4 w-4"}),title:s.name,description:`${s.promptName} - ${new Date(s.savedAt).toLocaleString()}`,onClick:()=>r(s)},s.id))})}function Jve({selectedPrompt:t,promptArgs:e,onArgChange:r}){const n=t?.arguments||[];if(!(n.length>0))return g.jsx("div",{className:"flex items-center justify-center h-32 text-gray-500 dark:text-gray-400 text-sm",children:"No arguments required"});const s=l=>{const c=l.name,d=e[c],f=typeof d=="string"?d:JSON.stringify(d);return l.type==="boolean"?g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:c,className:"text-sm font-medium",children:[c,l.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx("input",{id:c,type:"checkbox",checked:!!d,onChange:m=>r(c,m.target.checked),className:"rounded","aria-label":`Toggle ${c}`}),g.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:l.description})]})]},c):l.type==="number"?g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:c,className:"text-sm font-medium",children:[c,l.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsx(Or,{id:c,type:"number",value:Number(d)||0,onChange:m=>r(c,Number(m.target.value)),placeholder:l.description||`Enter ${c}`}),l.description&&g.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l.description})]},c):l.type==="array"||l.type==="object"?g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:c,className:"text-sm font-medium",children:[c,l.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsx(mh,{id:c,value:f,onChange:m=>{try{const h=JSON.parse(m.target.value);r(c,h)}catch{r(c,m.target.value)}},placeholder:l.description||`Enter ${c} as JSON`,className:"font-mono text-sm min-h-[100px]"}),l.description&&g.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l.description})]},c):g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:c,className:"text-sm font-medium",children:[c,l.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsx(Or,{id:c,value:f,onChange:m=>r(c,m.target.value),placeholder:l.description||`Enter ${c}`}),l.description&&g.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l.description})]},c)};return g.jsx("div",{className:"space-y-4",children:n.map(l=>s(l))})}function ebe({selectedPrompt:t,promptArgs:e,isExecuting:r,isConnected:n,onArgChange:a,onExecute:s,onSave:l}){return t?g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsx("div",{className:"flex-shrink-0 p-6 pt-3 pb-4 pr-3",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center justify-between mb-0",children:[g.jsx("h3",{className:"text-lg font-semibold mb-2",children:t.name}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(tt,{onClick:s,disabled:r||!n,children:r?g.jsxs(g.Fragment,{children:[g.jsx(Lo,{className:"mr-2"}),"Executing..."]}):g.jsxs(g.Fragment,{children:[g.jsx(kB,{className:"h-4 w-4 mr-2"}),"Execute"]})}),g.jsxs(tt,{variant:"outline",onClick:l,disabled:r,className:"gap-2",children:[g.jsx(DR,{className:"h-4 w-4"}),"Save"]})]})]}),t.description&&g.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 leading-relaxed",children:t.description})]})}),g.jsx("div",{className:"flex-1 overflow-y-auto px-6 pb-4 pr-3",children:g.jsx(Jve,{selectedPrompt:t,promptArgs:e,onArgChange:a})})]}):g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-2",children:"Select a prompt to get started"}),g.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"Choose a prompt from the list to view its details and execute it"})]})}function tbe({results:t,copiedResult:e,onCopy:r}){return g.jsx("div",{className:"flex flex-col h-full bg-white dark:bg-black border-t dark:border-zinc-700",children:g.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:t.length>0?g.jsx("div",{className:"space-y-4 flex-1 h-full",children:t.map((n,a)=>g.jsxs("div",{className:"space-y-0 flex-1 h-full flex flex-col",children:[g.jsxs("div",{className:"flex items-center gap-2 px-4 pt-2 border-b border-gray-200 dark:border-zinc-600 pb-2",children:[g.jsx("h3",{className:"text-sm font-medium",children:"Response"}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(ic,{className:"h-3 w-3 text-gray-400"}),g.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(n.timestamp).toLocaleTimeString()})]}),n.duration!==void 0&&g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(md,{className:"h-3 w-3 text-gray-400"}),g.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[n.duration,"ms"]})]}),g.jsx("div",{className:"flex gap-2 ml-auto",children:g.jsx(tt,{variant:"ghost",size:"sm",onClick:()=>r(a,n.result),className:"h-6 px-2",children:e===a?g.jsx(Do,{className:"h-4 w-4"}):g.jsx(aa,{className:"h-4 w-4"})})})]}),n.error?g.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 mx-4",children:[g.jsx("p",{className:"text-red-800 dark:text-red-300 font-medium",children:"Error:"}),g.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:n.error})]}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:n.result,filename:`prompt-result-${n.promptName}-${Date.now()}.json`})})]},a))}):g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx("div",{className:"text-center",children:g.jsx(yR,{vertical:!0,noBorder:!0,message:"No Results yet"})})})})})}const Qz="mcp-inspector-saved-prompts";function Z5({ref:t,prompts:e,callPrompt:r,serverId:n,isConnected:a}){const[s,l]=b.useState(null),[c,d]=b.useState(null),{selectedPromptName:f,setSelectedPromptName:m}=Hd(),[h,v]=b.useState({}),[y,w]=b.useState([]),[S,R]=b.useState(!1),[x,_]=b.useState(null),[C,N]=b.useState(""),[k,A]=b.useState("prompts"),[I,O]=b.useState([]),[L,M]=b.useState(!1),[P,W]=b.useState(""),[X,ee]=b.useState(!1),[J,j]=b.useState(-1),G=b.useRef(null);b.useImperativeHandle(t,()=>({focusSearch:()=>{ee(!0),setTimeout(()=>{G.current&&G.current.focus()},0)},blurSearch:()=>{N(""),ee(!1),G.current&&G.current.blur()}})),b.useEffect(()=>{try{const K=localStorage.getItem(Qz);if(K){const ae=JSON.parse(K);O(ae)}}catch(K){console.error("[PromptsTab] Failed to load saved prompts:",K)}},[]);const V=b.useCallback(K=>{try{localStorage.setItem(Qz,JSON.stringify(K))}catch(ae){console.error("[PromptsTab] Failed to save prompts:",ae)}},[]);b.useEffect(()=>{X&&G.current&&G.current.focus()},[X]);const te=b.useCallback(()=>{C.trim()||ee(!1)},[C]),re=b.useMemo(()=>{if(!C.trim())return e;const K=C.toLowerCase();return e.filter(ae=>ae.name.toLowerCase().includes(K)||ae.description?.toLowerCase().includes(K))},[e,C]),U=b.useCallback(K=>{l(K);const ae={};K.arguments&&K.arguments.forEach(H=>{H.default!==void 0?ae[H.name]=H.default:H.type==="string"?ae[H.name]="":H.type==="number"?ae[H.name]=0:H.type==="boolean"?ae[H.name]=!1:H.type==="array"?ae[H.name]=[]:H.type==="object"&&(ae[H.name]={})}),v(ae)},[]),q=b.useCallback(K=>{const ae=e.find(H=>H.name===K.promptName);ae&&(l(ae),v(K.args),d(K))},[e]);b.useEffect(()=>{j(-1)},[C,k]),b.useEffect(()=>{const K=ae=>{const H=ae.target;if(H.tagName==="INPUT"||H.tagName==="TEXTAREA"||H.contentEditable==="true"||ae.metaKey||ae.ctrlKey||ae.altKey)return;const me=k==="prompts"?re:I;if(ae.key==="ArrowDown")ae.preventDefault(),j(xe=>{const be=xe+1;return be>=me.length?0:be});else if(ae.key==="ArrowUp")ae.preventDefault(),j(xe=>{const be=xe-1;return be<0?me.length-1:be});else if(ae.key==="Enter"&&J>=0)if(ae.preventDefault(),k==="prompts"){const xe=re[J];xe&&U(xe)}else{const xe=I[J];xe&&q(xe)}};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[J,re,I,k,U,q]),b.useEffect(()=>{if(J>=0){const K=k==="prompts"?`prompt-${re[J]?.name}`:`saved-prompt-${I[J]?.id}`,ae=document.getElementById(K);ae&&ae.scrollIntoView({behavior:"smooth",block:"nearest"})}},[J,re,I,k]),b.useEffect(()=>{if(console.warn("[PromptsTab] Auto-selection effect triggered:",{selectedPromptName:f,promptsCount:e.length,currentSelectedPrompt:s?.name}),f&&e.length>0){const K=e.find(ae=>ae.name===f);if(console.warn("[PromptsTab] Prompt lookup result:",{selectedPromptName:f,promptFound:!!K,promptName:K?.name,shouldSelect:K&&s?.name!==K.name}),K&&s?.name!==K.name){console.warn("[PromptsTab] Selecting prompt:",K.name),m(null);const ae=setTimeout(()=>{U(K);const H=document.getElementById(`prompt-${K.name}`);H&&(console.warn("[PromptsTab] Scrolling to prompt element"),H.scrollIntoView({behavior:"smooth",block:"nearest"}))},100);return()=>clearTimeout(ae)}}},[f,e,s,U,m]);const $=b.useCallback((K,ae)=>{v(H=>({...H,[K]:ae}))},[]),Y=b.useCallback(async()=>{if(!s||S)return;R(!0);const K=Date.now();try{const ae=await r(s.name,h),H=Date.now()-K;zr.getInstance().capture(new zO({promptName:s.name,serverId:n,success:!0})).catch(()=>{}),w(me=>[{promptName:s.name,args:h,result:ae,timestamp:K,duration:H},...me])}catch(ae){zr.getInstance().capture(new zO({promptName:s.name,serverId:n,success:!1,error:ae instanceof Error?ae.message:"Unknown error"})).catch(()=>{});const de={promptName:s.name,args:h,result:null,error:ae instanceof Error?ae.message:String(ae),timestamp:K,duration:Date.now()-K};w(me=>[de,...me])}finally{R(!1)}},[s,h,S,r,n]),Q=b.useCallback(async(K,ae)=>{try{await navigator.clipboard.writeText(JSON.stringify(ae,null,2)),_(K),setTimeout(()=>_(null),2e3)}catch(H){console.error("[PromptsTab] Failed to copy result:",H)}},[]),F=b.useCallback(()=>{s&&(W(""),M(!0))},[s]),z=b.useCallback(K=>{V(I.filter(ae=>ae.id!==K)),c?.id===K&&d(null)},[I,V,c]);return g.jsxs(Td,{direction:"horizontal",className:"h-full",children:[g.jsxs(Ua,{defaultSize:33,className:"flex flex-col h-full relative",children:[g.jsx(Xve,{activeTab:k,isSearchExpanded:X,searchQuery:C,filteredPromptsCount:re.length,savedPromptsCount:I.length,onSearchExpand:()=>ee(!0),onSearchChange:N,onSearchBlur:te,onTabSwitch:()=>A(k==="prompts"?"saved":"prompts"),searchInputRef:G}),k==="prompts"?g.jsx(Zve,{prompts:re,selectedPrompt:s,onPromptSelect:U,focusedIndex:J}):g.jsx(Qve,{savedPrompts:I,selectedPrompt:c,onLoadPrompt:q,onDeletePrompt:z,focusedIndex:J})]}),g.jsx(Rd,{withHandle:!0}),g.jsx(Ua,{defaultSize:67,children:g.jsxs(Td,{direction:"vertical",children:[g.jsx(Ua,{defaultSize:40,children:g.jsx(ebe,{selectedPrompt:s,promptArgs:h,isExecuting:S,isConnected:a,onArgChange:$,onExecute:Y,onSave:F})}),g.jsx(Rd,{withHandle:!0}),g.jsx(Ua,{defaultSize:60,children:g.jsx("div",{className:"flex flex-col h-full",children:g.jsx(tbe,{results:y,copiedResult:x,onCopy:Q})})})]})})]})}Z5.displayName="PromptsTab";function ql(t){if(!t?.mimeType)return!1;const e=t.mimeType.toLowerCase();return e==="text/html"||e==="text/html+skybridge"||e==="text/uri-list"||e.startsWith("application/vnd.mcp-ui.remote-dom")}function rbe(t){return{uri:t.uri,mimeType:t.mimeType,text:t.text,blob:t.blob}}function X5({resource:t,onUIAction:e,className:r}){const n=async s=>e?.(s),a=rbe(t);return g.jsx("div",{className:r,children:g.jsx(GC,{resource:a,onUIAction:n,htmlProps:{autoResizeIframe:{width:!0,height:!0},style:{width:"100%",minHeight:"200px"},sandboxPermissions:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox"},remoteDomProps:{remoteElements:[fve,dve,pve,mve],library:VC}})})}function nbe({result:t,isLoading:e,previewMode:r,serverId:n,readResource:a,onTogglePreview:s,onCopy:l,onDownload:c,onFullscreen:d,isCopied:f=!1}){let m=[],h;if(t?.resourceAnnotations&&(m=Object.keys(t.resourceAnnotations).filter(S=>S.startsWith("openai/")),h=t.resourceAnnotations["openai/outputTemplate"]),t?.result?.contents?.[0]?._meta){const S=t.result.contents[0]._meta,R=Object.keys(S).filter(x=>x.startsWith("openai/"));R.length>0&&(m=[...m,...R]),!h&&S["openai/outputTemplate"]&&(h=S["openai/outputTemplate"]),!h&&t.uri&&t.uri.startsWith("ui://widget/")&&(h=t.uri)}const v=!!(m.length>0&&h&&typeof h=="string"&&n&&a);if(e)return g.jsx("div",{className:"flex absolute left-0 top-0 items-center justify-center w-full h-full",children:g.jsx(Lo,{className:"size-5"})});if(!t)return g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-2",children:"Select a resource to view its contents"}),g.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"Choose a resource from the list to see its data"})]});if(t.error)return g.jsx("div",{className:"p-4",children:g.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3",children:[g.jsx("p",{className:"text-red-800 dark:text-red-300 font-medium",children:"Error:"}),g.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:t.error})]})});const y=t?.result?.contents&&Array.isArray(t.result.contents)&&t.result.contents.some(S=>S.mimeType&&ql(S)),w=y?t.result.contents.filter(S=>S.mimeType&&ql(S)):[];return g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex-shrink-0 px-4 py-3 border-b border-gray-200 dark:border-zinc-700 flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(ic,{className:"h-3 w-3 text-gray-400"}),g.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(t.timestamp).toLocaleTimeString()})]}),(()=>{const S=t?.duration??t.result?.duration??t.result?.metrics?.durationMs;return S!==void 0?g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(md,{className:"h-3 w-3 text-gray-400"}),g.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[S,"ms"]})]}):null})(),y&&g.jsx(Ga,{variant:"outline",className:"text-xs bg-purple-50 dark:bg-purple-900/20 border-none border-purple-200 dark:border-purple-800/50 text-purple-600 dark:text-purple-400",children:"MCP UI"}),v&&g.jsx(Ga,{variant:"outline",className:"text-xs bg-blue-50 dark:bg-blue-900/20 border-none border-blue-200 dark:border-blue-800/50 text-blue-600 dark:text-blue-400",children:"OpenAI Widget"})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[(y||v)&&g.jsxs(tt,{variant:"ghost",size:"sm",onClick:s,className:r?"":"text-purple-600 dark:text-purple-400",children:[r?g.jsx(wQ,{className:"h-4 w-4 mr-1"}):g.jsx(mQ,{className:"h-4 w-4 mr-1"}),r?"JSON":v?"Component":"Preview"]}),g.jsx(tt,{variant:"ghost",size:"sm",onClick:l,children:f?g.jsx(Do,{className:"h-4 w-4"}):g.jsx(aa,{className:"h-4 w-4"})}),g.jsx(tt,{variant:"ghost",size:"sm",onClick:c,children:g.jsx(CB,{className:"h-4 w-4"})}),g.jsx(tt,{variant:"ghost",size:"sm",onClick:d,children:g.jsx(QQ,{className:"h-4 w-4"})})]})]}),g.jsx("div",{className:"flex-1 overflow-y-auto",children:v&&n&&a&&h?r?g.jsx("div",{className:"flex-1 h-full",children:g.jsx(zC,{componentUrl:h,toolName:t.uri,toolArgs:{},toolResult:t.result,serverId:n,readResource:a,className:"w-full h-full relative flex p-4"})}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:t.result,filename:`resource-${t.uri.replace(/[^a-zA-Z0-9]/g,"-")}-${Date.now()}.json`})}):y?r?g.jsxs("div",{className:"space-y-0 h-full",children:[w.map((S,R)=>g.jsx("div",{className:"mx-0 size-full",children:g.jsx("div",{className:"w-full h-full",children:g.jsx(X5,{resource:S,className:"w-full h-full"})})},`mcp-ui-${S.uri||`resource-${Date.now()}-${Math.random()}`}`)),(()=>{if(t.result.contents&&Array.isArray(t.result.contents)){const S=t.result.contents.filter(R=>!(R.mimeType&&ql(R)));if(S.length>0)return g.jsx("div",{className:"px-4",children:g.jsx(ja,{data:S,filename:`resource-${t.uri.replace(/[^a-zA-Z0-9]/g,"-")}-non-ui-${Date.now()}.json`})})}return null})()]}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:t.result,filename:`resource-${t.uri.replace(/[^a-zA-Z0-9]/g,"-")}-mcp-ui-${Date.now()}.json`})}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:t.result,filename:`resource-${t.uri.replace(/[^a-zA-Z0-9]/g,"-")}-${Date.now()}.json`})})})]})}function abe(t,e){if(!t&&!e)return g.jsx($Q,{className:"h-5 w-5"});const r=(t||e||"").toLowerCase();return r.includes("image")?g.jsx(UQ,{className:"h-5 w-5"}):r.includes("json")||r.includes("javascript")||r.includes("typescript")?g.jsx(PQ,{className:"h-5 w-5"}):r.includes("html")||r.includes("xml")?g.jsx(VQ,{className:"h-5 w-5"}):r.includes("database")||r.includes("sql")?g.jsx(th,{className:"h-5 w-5"}):g.jsx(OR,{className:"h-5 w-5"})}function obe({resources:t,selectedResource:e,onResourceSelect:r,focusedIndex:n}){return t.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx(th,{className:"h-12 w-12 text-gray-400 dark:text-gray-600 mb-3"}),g.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"No resources available"})]}):g.jsx("div",{className:"overflow-y-auto flex-1 border-r dark:border-zinc-700 overscroll-contain",children:t.map((a,s)=>{const l=abe(a.mimeType,a.uri),c=[a.description,a.mimeType&&g.jsx("span",{className:"font-mono",children:a.mimeType},"mime")].filter(Boolean);return g.jsx(Xd,{id:`resource-${a.uri}`,isSelected:e?.uri===a.uri,isFocused:n===s,icon:l,title:a.name,description:c.length>0?g.jsxs("span",{className:"flex flex-col gap-1",children:[a.description&&g.jsx("span",{children:a.description}),a.mimeType&&g.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-500 font-mono",children:a.mimeType})]}):void 0,onClick:()=>r(a)},a.uri)})})}function ibe({isSearchExpanded:t,searchQuery:e,filteredResourcesCount:r,onSearchExpand:n,onSearchChange:a,onSearchBlur:s,searchInputRef:l}){return g.jsx("div",{className:"flex items-center justify-between p-4 py-3 border-r dark:border-zinc-700",children:g.jsx("div",{className:"flex items-center gap-2 flex-1",children:t?g.jsx(Or,{ref:l,placeholder:"Search resources...",value:e,onChange:c=>a(c.target.value),onBlur:s,className:"h-8 border-gray-300 dark:border-zinc-600"}):g.jsxs(g.Fragment,{children:[g.jsx("h2",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:"Resources"}),g.jsx(Ga,{className:"bg-zinc-500/20 text-zinc-600 dark:text-zinc-400 border-transparent",variant:"outline",children:r}),g.jsxs(jr,{children:[g.jsx(Ur,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"sm",onClick:n,className:"h-8 w-8 p-0",children:g.jsx(LR,{className:"h-4 w-4"})})}),g.jsxs(Fr,{side:"bottom",className:"flex gap-2",children:["Search",g.jsx(Y5,{children:"F"})]})]})]})})})}function Q5({ref:t,resources:e,readResource:r,serverId:n,isConnected:a}){const[s,l]=b.useState(null),{selectedResourceUri:c,setSelectedResourceUri:d}=Hd(),[f,m]=b.useState(null),[h,v]=b.useState(!1),[y,w]=b.useState(""),[S]=b.useState("resources"),[R,x]=b.useState(!0),[_,C]=b.useState(!1),[N,k]=b.useState(-1),[A,I]=b.useState(!1),O=b.useRef(null),L=b.useRef(null);b.useImperativeHandle(t,()=>({focusSearch:()=>{C(!0),setTimeout(()=>{O.current&&O.current.focus()},0)},blurSearch:()=>{w(""),C(!1),O.current&&O.current.blur()}})),b.useEffect(()=>{_&&O.current&&O.current.focus()},[_]);const M=b.useCallback(()=>{y.trim()||C(!1)},[y]),P=b.useMemo(()=>{if(!y)return e;const j=y.toLowerCase();return e.filter(G=>G.name.toLowerCase().includes(j)||G.description?.toLowerCase().includes(j)||G.uri.toLowerCase().includes(j))},[e,y]),W=b.useCallback(async j=>{if(l(j),a){v(!0);const G=Date.now();try{const V=await r(j.uri);zr.getInstance().capture(new FO({resourceUri:j.uri,serverId:n,success:!0})).catch(()=>{}),m({uri:j.uri,result:V,timestamp:G,resourceAnnotations:j.annotations})}catch(V){zr.getInstance().capture(new FO({resourceUri:j.uri,serverId:n,success:!1,error:V instanceof Error?V.message:"Unknown error"})).catch(()=>{}),m({uri:j.uri,result:null,error:V instanceof Error?V.message:"Unknown error",timestamp:G,resourceAnnotations:j.annotations})}finally{v(!1)}}},[r,n,a]);b.useEffect(()=>{k(-1)},[y,S]),b.useEffect(()=>{const j=G=>{const V=G.target;if(V.tagName==="INPUT"||V.tagName==="TEXTAREA"||V.contentEditable==="true"||G.metaKey||G.ctrlKey||G.altKey)return;const re=P;if(G.key==="ArrowDown")G.preventDefault(),k(U=>{const q=U+1;return q>=re.length?0:q});else if(G.key==="ArrowUp")G.preventDefault(),k(U=>{const q=U-1;return q<0?re.length-1:q});else if(G.key==="Enter"&&N>=0){G.preventDefault();const U=P[N];U&&W(U)}};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[N,P,W]),b.useEffect(()=>{if(N>=0){const j=`resource-${P[N]?.uri}`,G=document.getElementById(j);G&&G.scrollIntoView({behavior:"smooth",block:"nearest"})}},[N,P]),b.useEffect(()=>{if(c&&e.length>0){const j=e.find(G=>G.uri===c);j&&s?.uri!==j.uri&&(d(null),setTimeout(()=>{W(j);const G=document.getElementById(`resource-${j.uri}`);G&&G.scrollIntoView({behavior:"smooth",block:"nearest"})},100))}},[c,e,s,W,d]);const X=b.useCallback(async()=>{if(f)try{await navigator.clipboard.writeText(JSON.stringify(f.result,null,2)),I(!0),setTimeout(()=>I(!1),2e3)}catch(j){console.error("[ResourcesTab] Failed to copy result:",j)}},[f]),ee=b.useCallback(()=>{if(f)try{const j=new globalThis.Blob([JSON.stringify(f.result,null,2)],{type:"application/json"}),G=URL.createObjectURL(j),V=document.createElement("a");V.href=G,V.download=`resource-${Date.now()}.json`,document.body.appendChild(V),V.click(),document.body.removeChild(V),URL.revokeObjectURL(G)}catch(j){console.error("[ResourcesTab] Failed to download result:",j)}},[f]),J=b.useCallback(async()=>{if(L.current)try{document.fullscreenElement?await document.exitFullscreen():await L.current.requestFullscreen()}catch(j){console.error("[ResourcesTab] Failed to toggle fullscreen:",j)}},[]);return g.jsxs(Td,{direction:"horizontal",className:"h-full",children:[g.jsxs(Ua,{defaultSize:25,children:[g.jsx(ibe,{activeTab:S,isSearchExpanded:_,searchQuery:y,filteredResourcesCount:P.length,onSearchExpand:()=>C(!0),onSearchChange:w,onSearchBlur:M,onTabSwitch:()=>{},searchInputRef:O}),g.jsx("div",{className:"flex flex-col h-full",children:g.jsx(obe,{resources:P,selectedResource:s,onResourceSelect:W,focusedIndex:N})})]}),g.jsx(Rd,{}),g.jsx(Ua,{defaultSize:50,children:g.jsx("div",{ref:L,className:"h-full bg-white dark:bg-zinc-900",children:g.jsx(nbe,{result:f,isLoading:h,previewMode:R,serverId:n,readResource:r,onTogglePreview:()=>x(!R),onCopy:X,onDownload:ee,onFullscreen:J,isCopied:A})})})]})}Q5.displayName="ResourcesTab";function sbe({savedRequests:t,selectedRequest:e,onLoadRequest:r,onDeleteRequest:n,focusedIndex:a}){if(t.length===0)return g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx(th,{className:"h-12 w-12 text-gray-400 dark:text-gray-600 mb-3"}),g.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-2",children:"No saved requests yet"}),g.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"Execute a tool and click Save to store requests"})]});const s=(l,c)=>{l.stopPropagation(),c()};return g.jsx("div",{className:"overflow-y-auto flex-1 border-r dark:border-zinc-700 overscroll-contain",children:t.map((l,c)=>g.jsxs("div",{className:"relative group",children:[g.jsx(Xd,{id:`saved-${l.id}`,isSelected:e?.id===l.id,isFocused:a===c,icon:g.jsx(AB,{className:"h-4 w-4"}),title:l.name,description:l.toolName,metadata:g.jsx("div",{className:"flex flex-col gap-1",children:g.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:new Date(l.savedAt).toLocaleString()})}),onClick:()=>r(l)}),g.jsx("div",{className:"absolute top-1/2 right-2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:g.jsxs(jr,{children:[g.jsx(Ur,{asChild:!0,children:g.jsx(tt,{variant:"secondary",size:"sm",onClick:d=>s(d,()=>n(l.id)),className:"h-8 w-8 p-0",children:g.jsx(rT,{className:"h-4 w-4"})})}),g.jsx(Fr,{children:g.jsx("p",{children:"Delete saved request"})})]})})]},l.id))})}function lbe({isOpen:t,requestName:e,defaultPlaceholder:r,onRequestNameChange:n,onSave:a,onCancel:s}){return t?g.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:s,children:g.jsxs("div",{className:"bg-white dark:bg-zinc-800 rounded-lg p-6 w-[400px] shadow-xl border border-gray-200 dark:border-zinc-700",onClick:l=>l.stopPropagation(),children:[g.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-gray-100",children:"Save Request"}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx(lr,{htmlFor:"request-name",children:"Request Name (optional)"}),g.jsx(Or,{id:"request-name",value:e,onChange:l=>n(l.target.value),placeholder:r,className:"mt-2",onKeyDown:l=>{l.key==="Enter"&&a()},autoFocus:!0})]}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx(tt,{variant:"outline",onClick:s,children:"Cancel"}),g.jsxs(tt,{onClick:a,children:[g.jsx(DR,{className:"h-4 w-4 mr-2"}),"Save"]})]})]})]})}):null}function cbe({selectedTool:t,toolArgs:e,onArgChange:r}){const n=t?.inputSchema?.properties||{},a=t?.inputSchema?.required||[];return Object.keys(n).length>0?g.jsx("div",{className:"space-y-4",children:Object.entries(n).map(([l,c])=>{const d=c;d.required=a.includes(l);const f=e[l];let m="";return f!=null&&(typeof f=="string"?m=f:typeof f=="object"&&f!==null?m=JSON.stringify(f,null,2):m=String(f)),d.type==="object"||d.type==="array"?g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:l,className:"text-sm font-medium",children:[l,d?.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsx(mh,{id:l,value:m,onChange:v=>r(l,v.target.value),placeholder:d?.description||`Enter ${l}`,className:"min-h-[100px]"}),d?.description&&g.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:d.description})]},l):g.jsxs("div",{className:"space-y-2",children:[g.jsxs(lr,{htmlFor:l,className:"text-sm font-medium",children:[l,d?.required&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),g.jsx(Or,{id:l,value:m,onChange:v=>r(l,v.target.value),placeholder:d?.description||`Enter ${l}`}),d?.description&&g.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:d.description})]},l)})}):g.jsx("div",{className:"flex items-center justify-center h-32 text-gray-500 dark:text-gray-400 text-sm",children:"No parameters required"})}function ube({selectedTool:t,toolArgs:e,isExecuting:r,isConnected:n,onArgChange:a,onExecute:s,onSave:l}){return t?g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsx("div",{className:"flex-shrink-0 p-6 pt-3 pb-4 pr-3",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center justify-between mb-0",children:[g.jsx("h3",{className:"text-lg font-semibold mb-2",children:t.name}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(tt,{onClick:s,disabled:r||!n,children:r?g.jsxs(g.Fragment,{children:[g.jsx(Lo,{className:"mr-2"}),"Executing..."]}):g.jsxs(g.Fragment,{children:[g.jsx(kB,{className:"h-4 w-4 mr-2"}),"Execute"]})}),g.jsxs(tt,{variant:"outline",onClick:l,disabled:r,className:"gap-2",children:[g.jsx(DR,{className:"h-4 w-4"}),"Save"]})]})]}),t.description&&g.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 leading-relaxed",children:t.description})]})}),g.jsx("div",{className:"flex-1 overflow-y-auto px-6 pb-4 pr-3",children:g.jsx(cbe,{selectedTool:t,toolArgs:e,onArgChange:a})})]}):g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-2",children:"Select a tool to get started"}),g.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"Choose a tool from the list to view its details and execute it"})]})}function dbe({results:t,copiedResult:e,previewMode:r,serverId:n,readResource:a,onCopy:s,onTogglePreview:l}){return g.jsx("div",{className:"flex flex-col h-full bg-white dark:bg-black border-t dark:border-zinc-700",children:g.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:t.length>0?g.jsx("div",{className:"space-y-4 flex-1 h-full",children:t.map((c,d)=>{const f=c.toolMeta?.["openai/outputTemplate"],m=!!(f&&typeof f=="string"&&c.appsSdkResource),h=f,v=c.result?.content||[],y=v.filter(S=>S.type==="resource"&&ql(S.resource)),w=y.length>0;return g.jsxs("div",{className:"space-y-0 flex-1 h-full flex flex-col",children:[g.jsxs("div",{className:`flex items-center gap-2 px-4 pt-2 ${w||m?"border-b border-gray-200 dark:border-zinc-600 pb-2":""}`,children:[g.jsx("h3",{className:"text-sm font-medium",children:"Response"}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(ic,{className:"h-3 w-3 text-gray-400"}),g.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(c.timestamp).toLocaleTimeString()})]}),c.duration!==void 0&&g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(md,{className:"h-3 w-3 text-gray-400"}),g.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[c.duration,"ms"]})]}),m&&g.jsxs("div",{className:"flex items-center gap-4 ml-4",children:[g.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["URI: ",h||"No URI"]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("button",{onClick:()=>l(),className:`text-xs font-medium ${r?"text-black dark:text-white":"text-zinc-500 dark:text-zinc-400"}`,children:"Component"}),g.jsx("span",{className:"text-xs text-zinc-400",children:"|"}),g.jsx("button",{onClick:()=>l(),className:`text-xs font-medium ${r?"text-zinc-500 dark:text-zinc-400":"text-black dark:text-white"}`,children:"Raw JSON"})]})]}),w&&!m&&g.jsxs("div",{className:"flex items-center gap-4 ml-4",children:[g.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["URI: ",y[0]?.resource?.uri||"No URI"]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("button",{onClick:()=>l(),className:`text-xs font-medium ${r?"text-black dark:text-white":"text-zinc-500 dark:text-zinc-400"}`,children:"Preview"}),g.jsx("span",{className:"text-xs text-zinc-400",children:"|"}),g.jsx("button",{onClick:()=>l(),className:`text-xs font-medium ${r?"text-zinc-500 dark:text-zinc-400":"text-black dark:text-white"}`,children:"JSON"})]})]}),g.jsx(tt,{variant:"ghost",size:"sm",onClick:()=>s(d,c.result),className:"ml-auto",children:e===d?g.jsx(Do,{className:"h-4 w-4"}):g.jsx(aa,{className:"h-4 w-4"})})]}),c.error?g.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 mx-4",children:[g.jsx("p",{className:"text-red-800 dark:text-red-300 font-medium",children:"Error:"}),g.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:c.error})]}):(()=>{if(m){const S=c.appsSdkResource;return S.isLoading?g.jsx(g.Fragment,{}):S.error?g.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 mx-4",children:[g.jsx("p",{className:"text-red-800 dark:text-red-300 font-medium",children:"Resource Error:"}),g.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:S.error})]}):r?g.jsx("div",{className:"flex-1",children:g.jsx(zC,{componentUrl:h,toolName:c.toolName,toolArgs:c.args,toolResult:c.result,resource:S.resourceData,serverId:n,readResource:a,className:"w-full h-full relative p-4"})}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:c.result,filename:`tool-result-${c.toolName}-${Date.now()}.json`})})}return w?r?g.jsxs("div",{className:"space-y-0 h-full",children:[y.map((S,R)=>g.jsx("div",{className:"mx-0 size-full",children:g.jsx(X5,{resource:S.resource,onUIAction:x=>{},className:"w-full h-full relative"})},R)),v.filter(S=>!(S.type==="resource"&&ql(S.resource))).length>0&&g.jsx("div",{className:"px-4",children:g.jsx(ja,{data:v.filter(S=>!(S.type==="resource"&&ql(S.resource))),filename:`tool-result-${c.toolName}-non-ui-${Date.now()}.json`})})]}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:c.result,filename:`tool-result-${c.toolName}-mcp-ui-${Date.now()}.json`})}):g.jsx("div",{className:"px-4 pt-4",children:g.jsx(ja,{data:c.result,filename:`tool-result-${c.toolName}-${Date.now()}.json`})})})()]},d)})}):g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx("div",{className:"text-center",children:g.jsx(yR,{vertical:!0,noBorder:!0,message:"No Results yet"})})})})})}function fbe({tools:t,selectedTool:e,onToolSelect:r,focusedIndex:n}){return t.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 text-center",children:[g.jsx(ws,{className:"h-12 w-12 text-gray-400 dark:text-gray-600 mb-3"}),g.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"No tools available"})]}):g.jsx("div",{className:"overflow-y-auto flex-1 border-r dark:border-zinc-700 overscroll-contain",children:t.map((a,s)=>g.jsx(Xd,{id:`tool-${a.name}`,isSelected:e?.name===a.name,isFocused:n===s,icon:g.jsx(ws,{className:"h-4 w-4"}),title:a.name,description:a.description,metadata:a.inputSchema?.properties&&g.jsxs(Ga,{variant:"outline",className:"text-xs border-gray-300 dark:border-zinc-600 text-gray-600 dark:text-gray-400",children:[Object.keys(a.inputSchema.properties).length," params"]}),onClick:()=>r(a)},a.name))})}function pbe({activeTab:t,isSearchExpanded:e,searchQuery:r,filteredToolsCount:n,savedRequestsCount:a,onSearchExpand:s,onSearchChange:l,onSearchBlur:c,onTabSwitch:d,searchInputRef:f}){return g.jsx(K5,{activeTab:t,isSearchExpanded:e,searchQuery:r,primaryTabName:"tools",secondaryTabName:"saved",primaryTabTitle:"Tools",secondaryTabTitle:"Saved",primaryCount:n,secondaryCount:a,primaryIcon:ws,secondaryIcon:th,searchPlaceholder:"Search tools...",onSearchExpand:s,onSearchChange:l,onSearchBlur:c,onTabSwitch:d,searchInputRef:f})}const Jz="mcp-inspector-saved-requests";function J5({ref:t,tools:e,callTool:r,readResource:n,serverId:a,isConnected:s}){const[l,c]=b.useState(null),[d,f]=b.useState(null),{selectedToolName:m,setSelectedToolName:h}=Hd(),[v,y]=b.useState({}),[w,S]=b.useState([]),[R,x]=b.useState(!1),[_,C]=b.useState(null),[N,k]=b.useState(""),[A,I]=b.useState("tools"),[O,L]=b.useState([]),[M,P]=b.useState(!1),[W,X]=b.useState(""),[ee,J]=b.useState(!0),[j,G]=b.useState(!1),[V,te]=b.useState(-1),re=b.useRef(null);b.useImperativeHandle(t,()=>({focusSearch:()=>{G(!0),setTimeout(()=>{re.current&&re.current.focus()},0)},blurSearch:()=>{k(""),G(!1),re.current&&re.current.blur()}})),b.useEffect(()=>{try{const be=localStorage.getItem(Jz);be&&L(JSON.parse(be))}catch(be){console.error("[ToolsTab] Failed to load saved requests:",be)}},[]);const U=b.useCallback(be=>{try{localStorage.setItem(Jz,JSON.stringify(be)),L(be)}catch(_e){console.error("[ToolsTab] Failed to save requests:",_e)}},[]),q=b.useMemo(()=>{if(!N.trim())return e;const be=N.toLowerCase();return e.filter(_e=>_e.name.toLowerCase().includes(be)||_e.description?.toLowerCase().includes(be))},[e,N]),$=b.useCallback(be=>{c(be);const _e={};be.inputSchema?.properties&&Object.entries(be.inputSchema.properties).forEach(([Ae,Fe])=>{const Pe=Fe;Pe.default!==void 0?_e[Ae]=Pe.default:Pe.type==="string"?_e[Ae]="":Pe.type==="number"?_e[Ae]=0:Pe.type==="boolean"?_e[Ae]=!1:Pe.type==="array"?_e[Ae]="[]":Pe.type==="object"&&(_e[Ae]="{}")}),y(_e)},[]),Y=b.useCallback(be=>{const _e=e.find(Ae=>Ae.name===be.toolName);_e&&(c(_e),y(be.args),f(be))},[e]);b.useEffect(()=>{j&&re.current&&re.current.focus()},[j]);const Q=b.useCallback(()=>{N.trim()||G(!1)},[N]);b.useEffect(()=>{A!=="tools"&&G(!1)},[A]),b.useEffect(()=>{te(-1)},[N,A]),b.useEffect(()=>{const be=_e=>{const Ae=_e.target;if(Ae.tagName==="INPUT"||Ae.tagName==="TEXTAREA"||Ae.contentEditable==="true"||_e.metaKey||_e.ctrlKey||_e.altKey)return;const Pe=A==="tools"?q:O;if(_e.key==="ArrowDown")_e.preventDefault(),te($e=>{const at=$e+1;return at>=Pe.length?0:at});else if(_e.key==="ArrowUp")_e.preventDefault(),te($e=>{const at=$e-1;return at<0?Pe.length-1:at});else if(_e.key==="Enter"&&V>=0)if(_e.preventDefault(),A==="tools"){const $e=q[V];$e&&$($e)}else{const $e=O[V];$e&&Y($e)}};return document.addEventListener("keydown",be),()=>document.removeEventListener("keydown",be)},[V,q,O,A,$,Y]),b.useEffect(()=>{if(V>=0){const be=A==="tools"?`tool-${q[V]?.name}`:`saved-${O[V]?.id}`,_e=document.getElementById(be);_e&&_e.scrollIntoView({behavior:"smooth",block:"nearest"})}},[V,q,O,A]),b.useEffect(()=>{if(m&&e.length>0){const be=e.find(_e=>_e.name===m);if(be&&l?.name!==be.name){h(null);const _e=setTimeout(()=>{$(be);const Ae=document.getElementById(`tool-${be.name}`);Ae&&Ae.scrollIntoView({behavior:"smooth",block:"nearest"})},100);return()=>clearTimeout(_e)}}},[m,e,l,$,h]);const F=b.useCallback((be,_e)=>{y(Ae=>{const Fe={...Ae};if(l?.inputSchema?.properties?.[be]){const $e=l.inputSchema.properties[be].type;if($e==="object"||$e==="array")Fe[be]=_e;else if($e==="string")Fe[be]=_e;else try{Fe[be]=JSON.parse(_e)}catch{Fe[be]=_e}}else Fe[be]=_e;return Fe})},[l]),z=b.useCallback(async()=>{if(!l||R)return;x(!0);const be=Date.now();try{const _e={...v};l.inputSchema?.properties&&Object.entries(l.inputSchema.properties).forEach(([Ce,ze])=>{const Ne=ze.type,Oe=_e[Ce];if((Ne==="object"||Ne==="array")&&typeof Oe=="string")try{_e[Ce]=JSON.parse(Oe)}catch{}});const Ae=await r(l.name,_e),Fe=Date.now()-be;zr.getInstance().capture(new UO({toolName:l.name,serverId:a,success:!0,duration:Fe})).catch(()=>{});const $e=l?._meta||l?.metadata,at=$e?.["openai/outputTemplate"];let ce;if(at&&typeof at=="string"){const Ce={toolName:l.name,args:v,result:Ae,timestamp:be,duration:Fe,toolMeta:$e,appsSdkResource:{uri:at,resourceData:null,isLoading:!0}};S([Ce]);try{const ze=await n(at);let we=null;if(Ae?.structuredContent)we=Ae.structuredContent;else if(Array.isArray(Ae)&&Ae[0]){const Ne=Ae[0];Ne.output?.value?.structuredContent?we=Ne.output.value.structuredContent:Ne.structuredContent?we=Ne.structuredContent:Ne.output?.value&&(we=Ne.output.value)}we||(we=Ae),ce={uri:at,resourceData:{...ze,structuredContent:we},isLoading:!1}}catch(ze){ce={uri:at,resourceData:null,isLoading:!1,error:ze instanceof Error?ze.message:String(ze)}}S(ze=>ze.map((we,Ne)=>Ne===0?{...we,appsSdkResource:ce}:we))}else S(Ce=>[{toolName:l.name,args:v,result:Ae,timestamp:be,duration:Fe,toolMeta:$e},...Ce])}catch(_e){const Ae=Date.now()-be;zr.getInstance().capture(new UO({toolName:l.name,serverId:a,success:!1,duration:Ae,error:_e instanceof Error?_e.message:String(_e)})).catch(()=>{});const Pe=l?._meta||l?.metadata,$e={toolName:l.name,args:v,result:null,error:_e instanceof Error?_e.message:String(_e),timestamp:be,duration:Ae,toolMeta:Pe},at=Pe?.["openai/outputTemplate"];S(at?[$e]:ce=>[$e,...ce])}finally{x(!1)}},[l,v,R,r,n,a]),K=b.useCallback(async(be,_e)=>{try{await navigator.clipboard.writeText(JSON.stringify(_e,null,2)),C(be),setTimeout(()=>C(null),2e3)}catch(Ae){console.error("[ToolsTab] Failed to copy result:",Ae)}},[]),ae=b.useCallback(be=>{S(_e=>_e.filter((Ae,Fe)=>Fe!==be))},[]),H=b.useCallback(be=>{const _e=w[be];if(_e){const Ae=window.open("","_blank","width=800,height=600");Ae&&(Ae.document.write(`
1546
1546
  <html>
1547
1547
  <head>
1548
1548
  <title>${_e.toolName} Result</title>