"use strict";exports.id=3557,exports.ids=[3557],exports.modules={27162:(e,r,t)=>{t.d(r,{Z:()=>f});var s=t(71159);/**
 * @license lucide-react v0.556.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let i=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,t)=>t?t.toUpperCase():r.toLowerCase()),l=e=>{let r=a(e);return r.charAt(0).toUpperCase()+r.slice(1)},n=(...e)=>e.filter((e,r,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim(),u=e=>{for(let r in e)if(r.startsWith("aria-")||"role"===r||"title"===r)return!0};/**
 * @license lucide-react v0.556.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var o={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"};/**
 * @license lucide-react v0.556.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let d=(0,s.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:a="",children:l,iconNode:d,...f},c)=>(0,s.createElement)("svg",{ref:c,...o,width:r,height:r,stroke:e,strokeWidth:i?24*Number(t)/Number(r):t,className:n("lucide",a),...!l&&!u(f)&&{"aria-hidden":"true"},...f},[...d.map(([e,r])=>(0,s.createElement)(e,r)),...Array.isArray(l)?l:[l]])),f=(e,r)=>{let t=(0,s.forwardRef)(({className:t,...a},u)=>(0,s.createElement)(d,{ref:u,iconNode:r,className:n(`lucide-${i(l(e))}`,`lucide-${e}`,t),...a}));return t.displayName=l(e),t}},94126:(e,r,t)=>{t.d(r,{Z:()=>s});let s=(0,t(27162).Z)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},74064:(e,r,t)=>{t.d(r,{F:()=>o});var s=t(74723);let i=(e,r,t)=>{if(e&&"reportValidity"in e){let i=(0,s.U2)(t,r);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},a=(e,r)=>{for(let t in r.fields){let s=r.fields[t];s&&s.ref&&"reportValidity"in s.ref?i(s.ref,t,e):s.refs&&s.refs.forEach(r=>i(r,t,e))}},l=(e,r)=>{r.shouldUseNativeValidation&&a(e,r);let t={};for(let i in e){let a=(0,s.U2)(r.fields,i),l=Object.assign(e[i]||{},{ref:a&&a.ref});if(n(r.names||Object.keys(e),i)){let e=Object.assign({},(0,s.U2)(t,i));(0,s.t8)(e,"root",l),(0,s.t8)(t,i,e)}else(0,s.t8)(t,i,l)}return t},n=(e,r)=>e.some(e=>e.startsWith(r+"."));var u=function(e,r){for(var t={};e.length;){var i=e[0],a=i.code,l=i.message,n=i.path.join(".");if(!t[n]){if("unionErrors"in i){var u=i.unionErrors[0].errors[0];t[n]={message:u.message,type:u.code}}else t[n]={message:l,type:a}}if("unionErrors"in i&&i.unionErrors.forEach(function(r){return r.errors.forEach(function(r){return e.push(r)})}),r){var o=t[n].types,d=o&&o[i.code];t[n]=(0,s.KN)(n,r,t,a,d?[].concat(d,i.message):i.message)}e.shift()}return t},o=function(e,r,t){return void 0===t&&(t={}),function(s,i,n){try{return Promise.resolve(function(i,l){try{var u=Promise.resolve(e["sync"===t.mode?"parse":"parseAsync"](s,r)).then(function(e){return n.shouldUseNativeValidation&&a({},n),{errors:{},values:t.raw?s:e}})}catch(e){return l(e)}return u&&u.then?u.then(void 0,l):u}(0,function(e){if(Array.isArray(null==e?void 0:e.errors))return{values:{},errors:l(u(e.errors,!n.shouldUseNativeValidation&&"all"===n.criteriaMode),n)};throw e}))}catch(e){return Promise.reject(e)}}}},74723:(e,r,t)=>{t.d(r,{KN:()=>C,U2:()=>p,cI:()=>eh,t8:()=>V});var s=t(17577),i=e=>"checkbox"===e.type,a=e=>e instanceof Date,l=e=>null==e;let n=e=>"object"==typeof e;var u=e=>!l(e)&&!Array.isArray(e)&&n(e)&&!a(e),o=e=>u(e)&&e.target?i(e.target)?e.target.checked:e.target.value:e,d=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,f=(e,r)=>e.has(d(r)),c=e=>{let r=e.constructor&&e.constructor.prototype;return u(r)&&r.hasOwnProperty("isPrototypeOf")},y="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function m(e){let r;let t=Array.isArray(e);if(e instanceof Date)r=new Date(e);else if(e instanceof Set)r=new Set(e);else if(!(!(y&&(e instanceof Blob||e instanceof FileList))&&(t||u(e))))return e;else if(r=t?[]:{},t||c(e))for(let t in e)e.hasOwnProperty(t)&&(r[t]=m(e[t]));else r=e;return r}var h=e=>Array.isArray(e)?e.filter(Boolean):[],v=e=>void 0===e,p=(e,r,t)=>{if(!r||!u(e))return t;let s=h(r.split(/[,[\].]+?/)).reduce((e,r)=>l(e)?e:e[r],e);return v(s)||s===e?v(e[r])?t:e[r]:s},g=e=>"boolean"==typeof e,b=e=>/^\w*$/.test(e),_=e=>h(e.replace(/["|']|\]/g,"").split(/\.|\[/)),V=(e,r,t)=>{let s=-1,i=b(r)?[r]:_(r),a=i.length,l=a-1;for(;++s<a;){let r=i[s],a=t;if(s!==l){let t=e[r];a=u(t)||Array.isArray(t)?t:isNaN(+i[s+1])?{}:[]}if("__proto__"===r)return;e[r]=a,e=e[r]}return e};let A={BLUR:"blur",FOCUS_OUT:"focusout"},w={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},F={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};s.createContext(null);var x=(e,r,t,s=!0)=>{let i={defaultValues:r._defaultValues};for(let a in e)Object.defineProperty(i,a,{get:()=>(r._proxyFormState[a]!==w.all&&(r._proxyFormState[a]=!s||w.all),t&&(t[a]=!0),e[a])});return i},k=e=>u(e)&&!Object.keys(e).length,S=(e,r,t,s)=>{t(e);let{name:i,...a}=e;return k(a)||Object.keys(a).length>=Object.keys(r).length||Object.keys(a).find(e=>r[e]===(!s||w.all))},D=e=>Array.isArray(e)?e:[e],E=e=>"string"==typeof e,O=(e,r,t,s,i)=>E(e)?(s&&r.watch.add(e),p(t,e,i)):Array.isArray(e)?e.map(e=>(s&&r.watch.add(e),p(t,e))):(s&&(r.watchAll=!0),t),C=(e,r,t,s,i)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[s]:i||!0}}:{},U=e=>({isOnSubmit:!e||e===w.onSubmit,isOnBlur:e===w.onBlur,isOnChange:e===w.onChange,isOnAll:e===w.all,isOnTouch:e===w.onTouched}),L=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));let j=(e,r,t,s)=>{for(let i of t||Object.keys(e)){let t=p(e,i);if(t){let{_f:e,...a}=t;if(e){if(e.refs&&e.refs[0]&&r(e.refs[0],i)&&!s||e.ref&&r(e.ref,e.name)&&!s)break;j(a,r)}else u(a)&&j(a,r)}}};var N=(e,r,t)=>{let s=D(p(e,t));return V(s,"root",r[t]),V(e,t,s),e},T=e=>"file"===e.type,B=e=>"function"==typeof e,M=e=>{if(!y)return!1;let r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},q=e=>E(e),P=e=>"radio"===e.type,R=e=>e instanceof RegExp;let $={value:!1,isValid:!1},I={value:!0,isValid:!0};var W=e=>{if(Array.isArray(e)){if(e.length>1){let r=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!v(e[0].attributes.value)?v(e[0].value)||""===e[0].value?I:{value:e[0].value,isValid:!0}:I:$}return $};let Z={isValid:!1,value:null};var H=e=>Array.isArray(e)?e.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,Z):Z;function K(e,r,t="validate"){if(q(e)||Array.isArray(e)&&e.every(q)||g(e)&&!e)return{type:t,message:q(e)?e:"",ref:r}}var z=e=>u(e)&&!R(e)?e:{value:e,message:""},G=async(e,r,t,s,a)=>{let{ref:n,refs:o,required:d,maxLength:f,minLength:c,min:y,max:m,pattern:h,validate:b,name:_,valueAsNumber:V,mount:A,disabled:w}=e._f,x=p(r,_);if(!A||w)return{};let S=o?o[0]:n,D=e=>{s&&S.reportValidity&&(S.setCustomValidity(g(e)?"":e||""),S.reportValidity())},O={},U=P(n),L=i(n),j=(V||T(n))&&v(n.value)&&v(x)||M(n)&&""===n.value||""===x||Array.isArray(x)&&!x.length,N=C.bind(null,_,t,O),$=(e,r,t,s=F.maxLength,i=F.minLength)=>{let a=e?r:t;O[_]={type:e?s:i,message:a,ref:n,...N(e?s:i,a)}};if(a?!Array.isArray(x)||!x.length:d&&(!(U||L)&&(j||l(x))||g(x)&&!x||L&&!W(o).isValid||U&&!H(o).isValid)){let{value:e,message:r}=q(d)?{value:!!d,message:d}:z(d);if(e&&(O[_]={type:F.required,message:r,ref:S,...N(F.required,r)},!t))return D(r),O}if(!j&&(!l(y)||!l(m))){let e,r;let s=z(m),i=z(y);if(l(x)||isNaN(x)){let t=n.valueAsDate||new Date(x),a=e=>new Date(new Date().toDateString()+" "+e),l="time"==n.type,u="week"==n.type;E(s.value)&&x&&(e=l?a(x)>a(s.value):u?x>s.value:t>new Date(s.value)),E(i.value)&&x&&(r=l?a(x)<a(i.value):u?x<i.value:t<new Date(i.value))}else{let t=n.valueAsNumber||(x?+x:x);l(s.value)||(e=t>s.value),l(i.value)||(r=t<i.value)}if((e||r)&&($(!!e,s.message,i.message,F.max,F.min),!t))return D(O[_].message),O}if((f||c)&&!j&&(E(x)||a&&Array.isArray(x))){let e=z(f),r=z(c),s=!l(e.value)&&x.length>+e.value,i=!l(r.value)&&x.length<+r.value;if((s||i)&&($(s,e.message,r.message),!t))return D(O[_].message),O}if(h&&!j&&E(x)){let{value:e,message:r}=z(h);if(R(e)&&!x.match(e)&&(O[_]={type:F.pattern,message:r,ref:n,...N(F.pattern,r)},!t))return D(r),O}if(b){if(B(b)){let e=K(await b(x,r),S);if(e&&(O[_]={...e,...N(F.validate,e.message)},!t))return D(e.message),O}else if(u(b)){let e={};for(let s in b){if(!k(e)&&!t)break;let i=K(await b[s](x,r),S,s);i&&(e={...i,...N(s,i.message)},D(i.message),t&&(O[_]=e))}if(!k(e)&&(O[_]={ref:S,...e},!t))return O}}return D(!0),O};function J(e,r){let t=Array.isArray(r)?r:b(r)?[r]:_(r),s=1===t.length?e:function(e,r){let t=r.slice(0,-1).length,s=0;for(;s<t;)e=v(e)?s++:e[r[s++]];return e}(e,t),i=t.length-1,a=t[i];return s&&delete s[a],0!==i&&(u(s)&&k(s)||Array.isArray(s)&&function(e){for(let r in e)if(e.hasOwnProperty(r)&&!v(e[r]))return!1;return!0}(s))&&J(e,t.slice(0,-1)),e}var Q=()=>{let e=[];return{get observers(){return e},next:r=>{for(let t of e)t.next&&t.next(r)},subscribe:r=>(e.push(r),{unsubscribe:()=>{e=e.filter(e=>e!==r)}}),unsubscribe:()=>{e=[]}}},X=e=>l(e)||!n(e);function Y(e,r){if(X(e)||X(r))return e===r;if(a(e)&&a(r))return e.getTime()===r.getTime();let t=Object.keys(e),s=Object.keys(r);if(t.length!==s.length)return!1;for(let i of t){let t=e[i];if(!s.includes(i))return!1;if("ref"!==i){let e=r[i];if(a(t)&&a(e)||u(t)&&u(e)||Array.isArray(t)&&Array.isArray(e)?!Y(t,e):t!==e)return!1}}return!0}var ee=e=>"select-multiple"===e.type,er=e=>P(e)||i(e),et=e=>M(e)&&e.isConnected,es=e=>{for(let r in e)if(B(e[r]))return!0;return!1};function ei(e,r={}){let t=Array.isArray(e);if(u(e)||t)for(let t in e)Array.isArray(e[t])||u(e[t])&&!es(e[t])?(r[t]=Array.isArray(e[t])?[]:{},ei(e[t],r[t])):l(e[t])||(r[t]=!0);return r}var ea=(e,r)=>(function e(r,t,s){let i=Array.isArray(r);if(u(r)||i)for(let i in r)Array.isArray(r[i])||u(r[i])&&!es(r[i])?v(t)||X(s[i])?s[i]=Array.isArray(r[i])?ei(r[i],[]):{...ei(r[i])}:e(r[i],l(t)?{}:t[i],s[i]):s[i]=!Y(r[i],t[i]);return s})(e,r,ei(r)),el=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:s})=>v(e)?e:r?""===e?NaN:e?+e:e:t&&E(e)?new Date(e):s?s(e):e;function en(e){let r=e.ref;return(e.refs?e.refs.every(e=>e.disabled):r.disabled)?void 0:T(r)?r.files:P(r)?H(e.refs).value:ee(r)?[...r.selectedOptions].map(({value:e})=>e):i(r)?W(e.refs).value:el(v(r.value)?e.ref.value:r.value,e)}var eu=(e,r,t,s)=>{let i={};for(let t of e){let e=p(r,t);e&&V(i,t,e._f)}return{criteriaMode:t,names:[...e],fields:i,shouldUseNativeValidation:s}},eo=e=>v(e)?e:R(e)?e.source:u(e)?R(e.value)?e.value.source:e.value:e,ed=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function ef(e,r,t){let s=p(e,t);if(s||b(t))return{error:s,name:t};let i=t.split(".");for(;i.length;){let s=i.join("."),a=p(r,s),l=p(e,s);if(a&&!Array.isArray(a)&&t!==s)break;if(l&&l.type)return{name:s,error:l};i.pop()}return{name:t}}var ec=(e,r,t,s,i)=>!i.isOnAll&&(!t&&i.isOnTouch?!(r||e):(t?s.isOnBlur:i.isOnBlur)?!e:(t?!s.isOnChange:!i.isOnChange)||e),ey=(e,r)=>!h(p(e,r)).length&&J(e,r);let em={mode:w.onSubmit,reValidateMode:w.onChange,shouldFocusError:!0};function eh(e={}){let r=s.useRef(),t=s.useRef(),[n,d]=s.useState({isDirty:!1,isValidating:!1,isLoading:B(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:B(e.defaultValues)?void 0:e.defaultValues});r.current||(r.current={...function(e={}){let r,t={...em,...e},s={submitCount:0,isDirty:!1,isLoading:B(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},d=(u(t.defaultValues)||u(t.values))&&m(t.defaultValues||t.values)||{},c=t.shouldUnregister?{}:m(d),b={action:!1,mount:!1,watch:!1},_={mount:new Set,unMount:new Set,array:new Set,watch:new Set},F=0,x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},S={values:Q(),array:Q(),state:Q()},C=U(t.mode),q=U(t.reValidateMode),P=t.criteriaMode===w.all,R=e=>r=>{clearTimeout(F),F=setTimeout(e,r)},$=async e=>{if(x.isValid||e){let e=t.resolver?k((await z()).errors):await ei(n,!0);e!==s.isValid&&S.state.next({isValid:e})}},I=(e,r)=>{(x.isValidating||x.validatingFields)&&((e||Array.from(_.mount)).forEach(e=>{e&&(r?V(s.validatingFields,e,r):J(s.validatingFields,e))}),S.state.next({validatingFields:s.validatingFields,isValidating:!k(s.validatingFields)}))},W=(e,r)=>{V(s.errors,e,r),S.state.next({errors:s.errors})},Z=(e,r,t,s)=>{let i=p(n,e);if(i){let a=p(c,e,v(t)?p(d,e):t);v(a)||s&&s.defaultChecked||r?V(c,e,r?a:en(i._f)):ep(e,a),b.mount&&$()}},H=(e,r,t,i,a)=>{let l=!1,u=!1,o={name:e},f=!!(p(n,e)&&p(n,e)._f&&p(n,e)._f.disabled);if(!t||i){x.isDirty&&(u=s.isDirty,s.isDirty=o.isDirty=eh(),l=u!==o.isDirty);let t=f||Y(p(d,e),r);u=!!(!f&&p(s.dirtyFields,e)),t||f?J(s.dirtyFields,e):V(s.dirtyFields,e,!0),o.dirtyFields=s.dirtyFields,l=l||x.dirtyFields&&!t!==u}if(t){let r=p(s.touchedFields,e);r||(V(s.touchedFields,e,t),o.touchedFields=s.touchedFields,l=l||x.touchedFields&&r!==t)}return l&&a&&S.state.next(o),l?o:{}},K=(t,i,a,l)=>{let n=p(s.errors,t),u=x.isValid&&g(i)&&s.isValid!==i;if(e.delayError&&a?(r=R(()=>W(t,a)))(e.delayError):(clearTimeout(F),r=null,a?V(s.errors,t,a):J(s.errors,t)),(a?!Y(n,a):n)||!k(l)||u){let e={...l,...u&&g(i)?{isValid:i}:{},errors:s.errors,name:t};s={...s,...e},S.state.next(e)}},z=async e=>{I(e,!0);let r=await t.resolver(c,t.context,eu(e||_.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return I(e),r},es=async e=>{let{errors:r}=await z(e);if(e)for(let t of e){let e=p(r,t);e?V(s.errors,t,e):J(s.errors,t)}else s.errors=r;return r},ei=async(e,r,i={valid:!0})=>{for(let a in e){let l=e[a];if(l){let{_f:e,...n}=l;if(e){let n=_.array.has(e.name);I([a],!0);let u=await G(l,c,P,t.shouldUseNativeValidation&&!r,n);if(I([a]),u[e.name]&&(i.valid=!1,r))break;r||(p(u,e.name)?n?N(s.errors,u,e.name):V(s.errors,e.name,u[e.name]):J(s.errors,e.name))}k(n)||await ei(n,r,i)}}return i.valid},eh=(e,r)=>(e&&r&&V(c,e,r),!Y(ew(),d)),ev=(e,r,t)=>O(e,_,{...b.mount?c:v(r)?d:E(e)?{[e]:r}:r},t,r),ep=(e,r,t={})=>{let s=p(n,e),a=r;if(s){let t=s._f;t&&(t.disabled||V(c,e,el(r,t)),a=M(t.ref)&&l(r)?"":r,ee(t.ref)?[...t.ref.options].forEach(e=>e.selected=a.includes(e.value)):t.refs?i(t.ref)?t.refs.length>1?t.refs.forEach(e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(a)?!!a.find(r=>r===e.value):a===e.value)):t.refs[0]&&(t.refs[0].checked=!!a):t.refs.forEach(e=>e.checked=e.value===a):T(t.ref)?t.ref.value="":(t.ref.value=a,t.ref.type||S.values.next({name:e,values:{...c}})))}(t.shouldDirty||t.shouldTouch)&&H(e,a,t.shouldTouch,t.shouldDirty,!0),t.shouldValidate&&eA(e)},eg=(e,r,t)=>{for(let s in r){let i=r[s],l=`${e}.${s}`,u=p(n,l);!_.array.has(e)&&X(i)&&(!u||u._f)||a(i)?ep(l,i,t):eg(l,i,t)}},eb=(e,r,t={})=>{let i=p(n,e),a=_.array.has(e),u=m(r);V(c,e,u),a?(S.array.next({name:e,values:{...c}}),(x.isDirty||x.dirtyFields)&&t.shouldDirty&&S.state.next({name:e,dirtyFields:ea(d,c),isDirty:eh(e,u)})):!i||i._f||l(u)?ep(e,u,t):eg(e,u,t),L(e,_)&&S.state.next({...s}),S.values.next({name:b.mount?e:void 0,values:{...c}})},e_=async e=>{b.mount=!0;let i=e.target,a=i.name,l=!0,u=p(n,a),d=e=>{l=Number.isNaN(e)||e===p(c,a,e)};if(u){let f,y;let m=i.type?en(u._f):o(e),h=e.type===A.BLUR||e.type===A.FOCUS_OUT,v=!ed(u._f)&&!t.resolver&&!p(s.errors,a)&&!u._f.deps||ec(h,p(s.touchedFields,a),s.isSubmitted,q,C),g=L(a,_,h);V(c,a,m),h?(u._f.onBlur&&u._f.onBlur(e),r&&r(0)):u._f.onChange&&u._f.onChange(e);let b=H(a,m,h,!1),w=!k(b)||g;if(h||S.values.next({name:a,type:e.type,values:{...c}}),v)return x.isValid&&$(),w&&S.state.next({name:a,...g?{}:b});if(!h&&g&&S.state.next({...s}),t.resolver){let{errors:e}=await z([a]);if(d(m),l){let r=ef(s.errors,n,a),t=ef(e,n,r.name||a);f=t.error,a=t.name,y=k(e)}}else I([a],!0),f=(await G(u,c,P,t.shouldUseNativeValidation))[a],I([a]),d(m),l&&(f?y=!1:x.isValid&&(y=await ei(n,!0)));l&&(u._f.deps&&eA(u._f.deps),K(a,y,f,b))}},eV=(e,r)=>{if(p(s.errors,r)&&e.focus)return e.focus(),1},eA=async(e,r={})=>{let i,a;let l=D(e);if(t.resolver){let r=await es(v(e)?e:l);i=k(r),a=e?!l.some(e=>p(r,e)):i}else e?((a=(await Promise.all(l.map(async e=>{let r=p(n,e);return await ei(r&&r._f?{[e]:r}:r)}))).every(Boolean))||s.isValid)&&$():a=i=await ei(n);return S.state.next({...!E(e)||x.isValid&&i!==s.isValid?{}:{name:e},...t.resolver||!e?{isValid:i}:{},errors:s.errors}),r.shouldFocus&&!a&&j(n,eV,e?l:_.mount),a},ew=e=>{let r={...b.mount?c:d};return v(e)?r:E(e)?p(r,e):e.map(e=>p(r,e))},eF=(e,r)=>({invalid:!!p((r||s).errors,e),isDirty:!!p((r||s).dirtyFields,e),error:p((r||s).errors,e),isValidating:!!p(s.validatingFields,e),isTouched:!!p((r||s).touchedFields,e)}),ex=(e,r,t)=>{let i=(p(n,e,{_f:{}})._f||{}).ref,{ref:a,message:l,type:u,...o}=p(s.errors,e)||{};V(s.errors,e,{...o,...r,ref:i}),S.state.next({name:e,errors:s.errors,isValid:!1}),t&&t.shouldFocus&&i&&i.focus&&i.focus()},ek=(e,r={})=>{for(let i of e?D(e):_.mount)_.mount.delete(i),_.array.delete(i),r.keepValue||(J(n,i),J(c,i)),r.keepError||J(s.errors,i),r.keepDirty||J(s.dirtyFields,i),r.keepTouched||J(s.touchedFields,i),r.keepIsValidating||J(s.validatingFields,i),t.shouldUnregister||r.keepDefaultValue||J(d,i);S.values.next({values:{...c}}),S.state.next({...s,...r.keepDirty?{isDirty:eh()}:{}}),r.keepIsValid||$()},eS=({disabled:e,name:r,field:t,fields:s,value:i})=>{if(g(e)&&b.mount||e){let a=e?void 0:v(i)?en(t?t._f:p(s,r)._f):i;V(c,r,a),H(r,a,!1,!1,!0)}},eD=(e,r={})=>{let s=p(n,e),i=g(r.disabled);return V(n,e,{...s||{},_f:{...s&&s._f?s._f:{ref:{name:e}},name:e,mount:!0,...r}}),_.mount.add(e),s?eS({field:s,disabled:r.disabled,name:e,value:r.value}):Z(e,!0,r.value),{...i?{disabled:r.disabled}:{},...t.progressive?{required:!!r.required,min:eo(r.min),max:eo(r.max),minLength:eo(r.minLength),maxLength:eo(r.maxLength),pattern:eo(r.pattern)}:{},name:e,onChange:e_,onBlur:e_,ref:i=>{if(i){eD(e,r),s=p(n,e);let t=v(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,a=er(t),l=s._f.refs||[];(a?l.find(e=>e===t):t===s._f.ref)||(V(n,e,{_f:{...s._f,...a?{refs:[...l.filter(et),t,...Array.isArray(p(d,e))?[{}]:[]],ref:{type:t.type,name:e}}:{ref:t}}}),Z(e,!1,void 0,t))}else(s=p(n,e,{}))._f&&(s._f.mount=!1),(t.shouldUnregister||r.shouldUnregister)&&!(f(_.array,e)&&b.action)&&_.unMount.add(e)}}},eE=()=>t.shouldFocusError&&j(n,eV,_.mount),eO=(e,r)=>async i=>{let a;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let l=m(c);if(S.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:r}=await z();s.errors=e,l=r}else await ei(n);if(J(s.errors,"root"),k(s.errors)){S.state.next({errors:{}});try{await e(l,i)}catch(e){a=e}}else r&&await r({...s.errors},i),eE(),setTimeout(eE);if(S.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:k(s.errors)&&!a,submitCount:s.submitCount+1,errors:s.errors}),a)throw a},eC=(r,t={})=>{let i=r?m(r):d,a=m(i),l=k(r),u=l?d:a;if(t.keepDefaultValues||(d=i),!t.keepValues){if(t.keepDirtyValues)for(let e of _.mount)p(s.dirtyFields,e)?V(u,e,p(c,e)):eb(e,p(u,e));else{if(y&&v(r))for(let e of _.mount){let r=p(n,e);if(r&&r._f){let e=Array.isArray(r._f.refs)?r._f.refs[0]:r._f.ref;if(M(e)){let r=e.closest("form");if(r){r.reset();break}}}}n={}}c=e.shouldUnregister?t.keepDefaultValues?m(d):{}:m(u),S.array.next({values:{...u}}),S.values.next({values:{...u}})}_={mount:t.keepDirtyValues?_.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},b.mount=!x.isValid||!!t.keepIsValid||!!t.keepDirtyValues,b.watch=!!e.shouldUnregister,S.state.next({submitCount:t.keepSubmitCount?s.submitCount:0,isDirty:!l&&(t.keepDirty?s.isDirty:!!(t.keepDefaultValues&&!Y(r,d))),isSubmitted:!!t.keepIsSubmitted&&s.isSubmitted,dirtyFields:l?{}:t.keepDirtyValues?t.keepDefaultValues&&c?ea(d,c):s.dirtyFields:t.keepDefaultValues&&r?ea(d,r):t.keepDirty?s.dirtyFields:{},touchedFields:t.keepTouched?s.touchedFields:{},errors:t.keepErrors?s.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&s.isSubmitSuccessful,isSubmitting:!1})},eU=(e,r)=>eC(B(e)?e(c):e,r);return{control:{register:eD,unregister:ek,getFieldState:eF,handleSubmit:eO,setError:ex,_executeSchema:z,_getWatch:ev,_getDirty:eh,_updateValid:$,_removeUnmounted:()=>{for(let e of _.unMount){let r=p(n,e);r&&(r._f.refs?r._f.refs.every(e=>!et(e)):!et(r._f.ref))&&ek(e)}_.unMount=new Set},_updateFieldArray:(e,r=[],t,i,a=!0,l=!0)=>{if(i&&t){if(b.action=!0,l&&Array.isArray(p(n,e))){let r=t(p(n,e),i.argA,i.argB);a&&V(n,e,r)}if(l&&Array.isArray(p(s.errors,e))){let r=t(p(s.errors,e),i.argA,i.argB);a&&V(s.errors,e,r),ey(s.errors,e)}if(x.touchedFields&&l&&Array.isArray(p(s.touchedFields,e))){let r=t(p(s.touchedFields,e),i.argA,i.argB);a&&V(s.touchedFields,e,r)}x.dirtyFields&&(s.dirtyFields=ea(d,c)),S.state.next({name:e,isDirty:eh(e,r),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else V(c,e,r)},_updateDisabledField:eS,_getFieldArray:r=>h(p(b.mount?c:d,r,e.shouldUnregister?p(d,r,[]):[])),_reset:eC,_resetDefaultValues:()=>B(t.defaultValues)&&t.defaultValues().then(e=>{eU(e,t.resetOptions),S.state.next({isLoading:!1})}),_updateFormState:e=>{s={...s,...e}},_disableForm:e=>{g(e)&&(S.state.next({disabled:e}),j(n,(r,t)=>{let s=p(n,t);s&&(r.disabled=s._f.disabled||e,Array.isArray(s._f.refs)&&s._f.refs.forEach(r=>{r.disabled=s._f.disabled||e}))},0,!1))},_subjects:S,_proxyFormState:x,_setErrors:e=>{s.errors=e,S.state.next({errors:s.errors,isValid:!1})},get _fields(){return n},get _formValues(){return c},get _state(){return b},set _state(value){b=value},get _defaultValues(){return d},get _names(){return _},set _names(value){_=value},get _formState(){return s},set _formState(value){s=value},get _options(){return t},set _options(value){t={...t,...value}}},trigger:eA,register:eD,handleSubmit:eO,watch:(e,r)=>B(e)?S.values.subscribe({next:t=>e(ev(void 0,r),t)}):ev(e,r,!0),setValue:eb,getValues:ew,reset:eU,resetField:(e,r={})=>{p(n,e)&&(v(r.defaultValue)?eb(e,m(p(d,e))):(eb(e,r.defaultValue),V(d,e,m(r.defaultValue))),r.keepTouched||J(s.touchedFields,e),r.keepDirty||(J(s.dirtyFields,e),s.isDirty=r.defaultValue?eh(e,m(p(d,e))):eh()),!r.keepError&&(J(s.errors,e),x.isValid&&$()),S.state.next({...s}))},clearErrors:e=>{e&&D(e).forEach(e=>J(s.errors,e)),S.state.next({errors:e?s.errors:{}})},unregister:ek,setError:ex,setFocus:(e,r={})=>{let t=p(n,e),s=t&&t._f;if(s){let e=s.refs?s.refs[0]:s.ref;e.focus&&(e.focus(),r.shouldSelect&&e.select())}},getFieldState:eF}}(e),formState:n});let c=r.current.control;return c._options=e,function(e){let r=s.useRef(e);r.current=e,s.useEffect(()=>{let t=!e.disabled&&r.current.subject&&r.current.subject.subscribe({next:r.current.next});return()=>{t&&t.unsubscribe()}},[e.disabled])}({subject:c._subjects.state,next:e=>{S(e,c._proxyFormState,c._updateFormState,!0)&&d({...c._formState})}}),s.useEffect(()=>c._disableForm(e.disabled),[c,e.disabled]),s.useEffect(()=>{if(c._proxyFormState.isDirty){let e=c._getDirty();e!==n.isDirty&&c._subjects.state.next({isDirty:e})}},[c,n.isDirty]),s.useEffect(()=>{e.values&&!Y(e.values,t.current)?(c._reset(e.values,c._options.resetOptions),t.current=e.values,d(e=>({...e}))):c._resetDefaultValues()},[e.values,c]),s.useEffect(()=>{e.errors&&c._setErrors(e.errors)},[e.errors,c]),s.useEffect(()=>{c._state.mount||(c._updateValid(),c._state.mount=!0),c._state.watch&&(c._state.watch=!1,c._subjects.state.next({...c._formState})),c._removeUnmounted()}),s.useEffect(()=>{e.shouldUnregister&&c._subjects.values.next({values:c._getWatch()})},[e.shouldUnregister,c]),r.current.formState=x(n,c),r.current}}};