@dipusevilla/componentes-iu 1.0.39 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +10 -10
- package/dist/index.es.js +1500 -1508
- package/dist/index.umd.js +11 -11
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),gs=require("react-dom");function Mn(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const H=Mn(v);function Vn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var gt={exports:{}},nt={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Fr;function $n(){if(Fr)return nt;Fr=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(s,n,a){var o=null;if(a!==void 0&&(o=""+a),n.key!==void 0&&(o=""+n.key),"key"in n){a={};for(var l in n)l!=="key"&&(a[l]=n[l])}else a=n;return n=a.ref,{$$typeof:r,type:s,key:o,ref:n!==void 0?n:null,props:a}}return nt.Fragment=e,nt.jsx=t,nt.jsxs=t,nt}var at={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,26 +14,26 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Tr;function Dn(){return Tr||(Tr=1,process.env.NODE_ENV!=="production"&&function(){function r(E){if(E==null)return null;if(typeof E=="function")return E.$$typeof===Q?null:E.displayName||E.name||null;if(typeof E=="string")return E;switch(E){case k:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case F:return"Suspense";case B:return"SuspenseList";case R:return"Activity"}if(typeof E=="object")switch(typeof E.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),E.$$typeof){case x:return"Portal";case T:return(E.displayName||"Context")+".Provider";case g:return(E._context.displayName||"Context")+".Consumer";case D:var j=E.render;return E=E.displayName,E||(E=j.displayName||j.name||"",E=E!==""?"ForwardRef("+E+")":"ForwardRef"),E;case W:return j=E.displayName||null,j!==null?j:r(E.type)||"Memo";case _:j=E._payload,E=E._init;try{return r(E(j))}catch{}}return null}function e(E){return""+E}function t(E){try{e(E);var j=!1}catch{j=!0}if(j){j=console;var O=j.error,I=typeof Symbol=="function"&&Symbol.toStringTag&&E[Symbol.toStringTag]||E.constructor.name||"Object";return O.call(j,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",I),e(E)}}function s(E){if(E===k)return"<>";if(typeof E=="object"&&E!==null&&E.$$typeof===_)return"<...>";try{var j=r(E);return j?"<"+j+">":"<...>"}catch{return"<...>"}}function n(){var E=Z.A;return E===null?null:E.getOwner()}function a(){return Error("react-stack-top-frame")}function o(E){if($.call(E,"key")){var j=Object.getOwnPropertyDescriptor(E,"key").get;if(j&&j.isReactWarning)return!1}return E.key!==void 0}function l(E,j){function O(){G||(G=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",j))}O.isReactWarning=!0,Object.defineProperty(E,"key",{get:O,configurable:!0})}function c(){var E=r(this.type);return Y[E]||(Y[E]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),E=this.props.ref,E!==void 0?E:null}function u(E,j,O,I,ee,se,ue,ne){return O=se.ref,E={$$typeof:y,type:E,key:j,props:se,_owner:ee},(O!==void 0?O:null)!==null?Object.defineProperty(E,"ref",{enumerable:!1,get:c}):Object.defineProperty(E,"ref",{enumerable:!1,value:null}),E._store={},Object.defineProperty(E._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(E,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(E,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.defineProperty(E,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.freeze&&(Object.freeze(E.props),Object.freeze(E)),E}function d(E,j,O,I,ee,se,ue,ne){var ae=j.children;if(ae!==void 0)if(I)if(X(ae)){for(I=0;I<ae.length;I++)p(ae[I]);Object.freeze&&Object.freeze(ae)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(ae);if($.call(j,"key")){ae=r(E);var me=Object.keys(j).filter(function(te){return te!=="key"});I=0<me.length?"{key: someKey, "+me.join(": ..., ")+": ...}":"{key: someKey}",q[ae+I]||(me=0<me.length?"{"+me.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,I,ae,he,ae),q[ae+I]=!0)}if(ae=null,O!==void 0&&(t(O),ae=""+O),o(j)&&(t(j.key),ae=""+j.key),"key"in j){O={};for(var ge in j)ge!=="key"&&(O[ge]=j[ge])}else O=j;return ae&&l(O,typeof E=="function"?E.displayName||E.name||"Unknown":E),u(E,ae,se,ee,n(),O,ce,ne)}function p(E){typeof E=="object"&&E!==null&&E.$$typeof===y&&E._store&&(E._store.validated=1)}var h=v,y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),T=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),Z=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,H=Array.isArray,J=console.createTask?console.createTask:function(){return null};h={"react-stack-bottom-frame":function(E){return E()}};var G,X={},C=h["react-stack-bottom-frame"].bind(h,a)(),m=J(s(a)),q={};lt.Fragment=k,lt.jsx=function(E,j,O,I,ee){var se=1e4>Z.recentlyCreatedOwnerStacks++;return d(E,j,O,!1,I,ee,se?Error("react-stack-top-frame"):C,se?J(s(E)):m)},lt.jsxs=function(E,j,O,I,ee){var se=1e4>Z.recentlyCreatedOwnerStacks++;return d(E,j,O,!0,I,ee,se?Error("react-stack-top-frame"):C,se?J(s(E)):m)}}()),lt}var Rr;function Pn(){return Rr||(Rr=1,process.env.NODE_ENV==="production"?vt.exports=In():vt.exports=Ln()),vt.exports}var i=Pn();function ws(r){var e,t,s="";if(typeof r=="string"||typeof r=="number")s+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(t=ws(r[e]))&&(s&&(s+=" "),s+=t)}else for(t in r)r[t]&&(s&&(s+=" "),s+=t);return s}function L(){for(var r,e,t=0,s="",n=arguments.length;t<n;t++)(r=arguments[t])&&(e=ws(r))&&(s&&(s+=" "),s+=e);return s}const zn={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-10 h-10",full:"w-full h-full"};function Me({component:r,size:e="sm",className:t,...s}){return i.jsx(r,{className:L(zn[e],t),"aria-hidden":s["aria-label"]?void 0:!0,...s})}const Bn="inline-flex items-center justify-center box-border font-[var(--font-primary)] font-medium rounded-lg transition focus:outline-none",Un={primary:"bg-[var(--color-ds-button-primary-bg)] text-[var(--color-ds-button-primary-text)] hover:animate-pulse",outline:"bg-transparent text-[var(--color-ds-text-primary)] ring-1 ring-inset ring-[var(--color-ds-border-default)] hover:bg-[var(--color-ds-background-accent)] hover:text-[var(--color-ds-text-on-accent)]",ghost:"bg-transparent text-[var(--color-ds-text-primary)] hover:animate-pulse"},Zn={sm:"text-ds-sm h-6 px-2",md:"text-ds-md h-10 px-2.5",lg:"text-ds-lg h-12 px-3"},Wn={sm:"h-6 w-6 p-0",md:"h-10 w-10 p-0",lg:"h-12 w-12 p-0"},qn="disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-[var(--color-ds-background-disabled)] disabled:text-[var(--color-ds-text-on-accent)] disabled:ring-1 disabled:ring-inset disabled:ring-[var(--color-ds-border-muted)]";function Pe({type:r="button",variant:e="primary",size:t="sm",width:s,disabled:n=!1,icon:a,iconPosition:o="left",ariaLabel:l,children:c,onClick:u,className:d}){const p=!!a,h=p&&!c,y=h?Wn[t]:Zn[t];return i.jsxs("button",{type:r,onClick:u,disabled:n,"aria-label":h?l:void 0,style:s?{width:s}:void 0,className:L(Bn,Un[e],y,qn,d,p&&c&&"gap-2"),children:[a&&o==="left"&&i.jsx(Me,{component:a,size:t}),c,a&&o==="right"&&i.jsx(Me,{component:a,size:t})]})}function Gn({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const Yn=Y.forwardRef(Gn);function Hn({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const pr=Y.forwardRef(Hn);function Xn({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const Kn=Y.forwardRef(Xn);function Jn({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const Qn=Y.forwardRef(Jn);function ea({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const ta=Y.forwardRef(ea);function ra({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const Mr=Y.forwardRef(ra);function sa({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const na=Y.forwardRef(sa);function aa({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const ks=Y.forwardRef(aa);function oa({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"}))}const ia=Y.forwardRef(oa);function la({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const ca=Y.forwardRef(la);function ua({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))}const da=Y.forwardRef(ua);function fa({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"}))}const ma=Y.forwardRef(fa);function ha({title:r,titleId:e,...t},s){return Y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?Y.createElement("title",{id:e},r):null,Y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const xr=Y.forwardRef(ha),pa={default:{wrapper:"box-border w-full rounded-lg bg-[var(--color-ds-background-surface)] overflow-hidden",padX:"px-6",padY:"py-4"},plain:{wrapper:"box-border w-full overflow-hidden",padX:"px-0",padY:"py-2"},soft:{wrapper:"box-border w-full rounded-lg bg-[color-mix(in srgb,var(--color-ds-background-surface) 60%, transparent 40%)] overflow-hidden",padX:"px-4",padY:"py-3"},ghost:{wrapper:"box-border w-full overflow-hidden",padX:"px-6",padY:"py-3"}};function rr({title:r,children:e,defaultOpen:t=!0,className:s,type:n="default",contentClassName:a,headerClassName:o}){const[l,c]=v.useState(t),u=v.useRef(null),[d,p]=v.useState(0),h=()=>{u.current&&p(u.current.scrollHeight)};v.useLayoutEffect(()=>{h()},[l]),v.useEffect(()=>{const x=u.current;if(!x)return;const k=new ResizeObserver(()=>h());return k.observe(x),()=>k.disconnect()},[]);const y=pa[n];return i.jsxs("div",{className:L("flex flex-col w-full gap-3",s),children:[i.jsxs("button",{type:"button",onClick:()=>c(x=>!x),"aria-expanded":l,className:L("flex items-center justify-between w-full transition-colors","hover:bg-[var(--color-ds-surface-hover)]",o),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"block w-1 h-5 bg-[var(--color-ds-background-accent)] rounded-sm"}),i.jsx("span",{className:"font-semibold text-[var(--color-ds-text-primary)]",children:r})]}),l?i.jsx(Qn,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"}):i.jsx(pr,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"})]}),i.jsx("div",{className:y.wrapper,children:i.jsx("div",{className:y.padX,children:i.jsx("div",{className:L("overflow-hidden transition-all duration-300 ease-in-out",l?"opacity-100":"opacity-0"),style:{maxHeight:l?`${d}px`:"0px"},children:i.jsx("div",{ref:u,className:L(y.padY,a),children:e})})})})]})}const gr="-",xa=r=>{const e=ba(r),{conflictingClassGroups:t,conflictingClassGroupModifiers:s}=r;return{getClassGroupId:o=>{const l=o.split(gr);return l[0]===""&&l.length!==1&&l.shift(),js(l,e)||ga(o)},getConflictingClassGroupIds:(o,l)=>{const c=t[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},js=(r,e)=>{var o;if(r.length===0)return e.classGroupId;const t=r[0],s=e.nextPart.get(t),n=s?js(r.slice(1),s):void 0;if(n)return n;if(e.validators.length===0)return;const a=r.join(gr);return(o=e.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},Vr=/^\[(.+)\]$/,ga=r=>{if(Vr.test(r)){const e=Vr.exec(r)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},ba=r=>{const{theme:e,classGroups:t}=r,s={nextPart:new Map,validators:[]};for(const n in t)sr(t[n],s,n,e);return s},sr=(r,e,t,s)=>{r.forEach(n=>{if(typeof n=="string"){const a=n===""?e:$r(e,n);a.classGroupId=t;return}if(typeof n=="function"){if(ya(n)){sr(n(s),e,t,s);return}e.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(([a,o])=>{sr(o,$r(e,a),t,s)})})},$r=(r,e)=>{let t=r;return e.split(gr).forEach(s=>{t.nextPart.has(s)||t.nextPart.set(s,{nextPart:new Map,validators:[]}),t=t.nextPart.get(s)}),t},ya=r=>r.isThemeGetter,va=r=>{if(r<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,s=new Map;const n=(a,o)=>{t.set(a,o),e++,e>r&&(e=0,s=t,t=new Map)};return{get(a){let o=t.get(a);if(o!==void 0)return o;if((o=s.get(a))!==void 0)return n(a,o),o},set(a,o){t.has(a)?t.set(a,o):n(a,o)}}},nr="!",ar=":",wa=ar.length,ka=r=>{const{prefix:e,experimentalParseClassName:t}=r;let s=n=>{const a=[];let o=0,l=0,c=0,u;for(let x=0;x<n.length;x++){let k=n[x];if(o===0&&l===0){if(k===ar){a.push(n.slice(c,x)),c=x+wa;continue}if(k==="/"){u=x;continue}}k==="["?o++:k==="]"?o--:k==="("?l++:k===")"&&l--}const d=a.length===0?n:n.substring(c),p=ja(d),h=p!==d,y=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:y}};if(e){const n=e+ar,a=s;s=o=>o.startsWith(n)?a(o.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(t){const n=s;s=a=>t({className:a,parseClassName:n})}return s},ja=r=>r.endsWith(nr)?r.substring(0,r.length-1):r.startsWith(nr)?r.substring(1):r,Ea=r=>{const e=Object.fromEntries(r.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const n=[];let a=[];return s.forEach(o=>{o[0]==="["||e[o]?(n.push(...a.sort(),o),a=[]):a.push(o)}),n.push(...a.sort()),n}},Na=r=>({cache:va(r.cacheSize),parseClassName:ka(r),sortModifiers:Ea(r),...xa(r)}),Sa=/\s+/,_a=(r,e)=>{const{parseClassName:t,getClassGroupId:s,getConflictingClassGroupIds:n,sortModifiers:a}=e,o=[],l=r.trim().split(Sa);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:p,modifiers:h,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:k}=t(d);if(p){c=d+(c.length>0?" "+c:c);continue}let S=!!k,w=s(S?x.substring(0,k):x);if(!w){if(!S){c=d+(c.length>0?" "+c:c);continue}if(w=s(x),!w){c=d+(c.length>0?" "+c:c);continue}S=!1}const g=a(h).join(":"),T=y?g+nr:g,$=T+w;if(o.includes($))continue;o.push($);const F=n(w,S);for(let U=0;U<F.length;++U){const W=F[U];o.push(T+W)}c=d+(c.length>0?" "+c:c)}return c};function Fa(){let r=0,e,t,s="";for(;r<arguments.length;)(e=arguments[r++])&&(t=Es(e))&&(s&&(s+=" "),s+=t);return s}const Es=r=>{if(typeof r=="string")return r;let e,t="";for(let s=0;s<r.length;s++)r[s]&&(e=Es(r[s]))&&(t&&(t+=" "),t+=e);return t};function Ta(r,...e){let t,s,n,a=o;function o(c){const u=e.reduce((d,p)=>p(d),r());return t=Na(u),s=t.cache.get,n=t.cache.set,a=l,l(c)}function l(c){const u=s(c);if(u)return u;const d=_a(c,t);return n(c,d),d}return function(){return a(Fa.apply(null,arguments))}}const pe=r=>{const e=t=>t[r]||[];return e.isThemeGetter=!0,e},Ns=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ss=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Aa=/^\d+\/\d+$/,Ca=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oa=/\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$/,Ra=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ma=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Va=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Je=r=>Aa.test(r),te=r=>!!r&&!Number.isNaN(Number(r)),Ue=r=>!!r&&Number.isInteger(Number(r)),Yt=r=>r.endsWith("%")&&te(r.slice(0,-1)),$e=r=>Ca.test(r),$a=()=>!0,Da=r=>Oa.test(r)&&!Ra.test(r),_s=()=>!1,Ia=r=>Ma.test(r),La=r=>Va.test(r),Pa=r=>!z(r)&&!B(r),za=r=>st(r,As,_s),z=r=>Ns.test(r),qe=r=>st(r,Cs,Da),Ht=r=>st(r,qa,te),Dr=r=>st(r,Fs,_s),Ba=r=>st(r,Ts,La),wt=r=>st(r,Os,Ia),B=r=>Ss.test(r),ct=r=>nt(r,Cs),Ua=r=>nt(r,Ga),Ir=r=>nt(r,Fs),Za=r=>nt(r,As),Wa=r=>nt(r,Ts),kt=r=>nt(r,Os,!0),st=(r,e,t)=>{const s=Ns.exec(r);return s?s[1]?e(s[1]):t(s[2]):!1},nt=(r,e,t=!1)=>{const s=Ss.exec(r);return s?s[1]?e(s[1]):t:!1},Fs=r=>r==="position"||r==="percentage",Ts=r=>r==="image"||r==="url",As=r=>r==="length"||r==="size"||r==="bg-size",Cs=r=>r==="length",qa=r=>r==="number",Ga=r=>r==="family-name",Os=r=>r==="shadow",Ya=()=>{const r=pe("color"),e=pe("font"),t=pe("text"),s=pe("font-weight"),n=pe("tracking"),a=pe("leading"),o=pe("breakpoint"),l=pe("container"),c=pe("spacing"),u=pe("radius"),d=pe("shadow"),p=pe("inset-shadow"),h=pe("text-shadow"),y=pe("drop-shadow"),x=pe("blur"),k=pe("perspective"),S=pe("aspect"),w=pe("ease"),g=pe("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...$(),B,z],U=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],_=()=>[B,z,c],R=()=>[Je,"full","auto",..._()],Q=()=>[Ue,"none","subgrid",B,z],Z=()=>["auto",{span:["full",Ue,B,z]},Ue,B,z],D=()=>[Ue,"auto",B,z],H=()=>["auto","min","max","fr",B,z],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",..._()],C=()=>[Je,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],m=()=>[r,B,z],q=()=>[...$(),Ir,Dr,{position:[B,z]}],E=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",Za,za,{size:[B,z]}],O=()=>[Yt,ct,qe],I=()=>["","none","full",u,B,z],ee=()=>["",te,ct,qe],se=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[te,Yt,Ir,Dr],ae=()=>["","none",x,B,z],he=()=>["none",te,B,z],ge=()=>["none",te,B,z],re=()=>[te,B,z],ue=()=>[Je,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$e],breakpoint:[$e],color:[$a],container:[$e],"drop-shadow":[$e],ease:["in","out","in-out"],font:[Pa],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$e],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$e],shadow:[$e],spacing:["px",te],text:[$e],"text-shadow":[$e],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Je,z,B,S]}],container:["container"],columns:[{columns:[te,z,B,l]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:F()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[Ue,"auto",B,z]}],basis:[{basis:[Je,"full","auto",l,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[te,Je,"auto","initial","none",z]}],grow:[{grow:["",te,B,z]}],shrink:[{shrink:["",te,B,z]}],order:[{order:[Ue,"first","last","none",B,z]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:C()}],w:[{w:[l,"screen",...C()]}],"min-w":[{"min-w":[l,"screen","none",...C()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...C()]}],h:[{h:["screen","lh",...C()]}],"min-h":[{"min-h":["screen","lh","none",...C()]}],"max-h":[{"max-h":["screen","lh",...C()]}],"font-size":[{text:["base",t,ct,qe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,B,Ht]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Yt,z]}],"font-family":[{font:[Ua,z,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:[n,B,z]}],"line-clamp":[{"line-clamp":[te,"none",B,Ht]}],leading:[{leading:[a,..._()]}],"list-image":[{"list-image":["none",B,z]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",B,z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:m()}],"text-color":[{text:m()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[te,"from-font","auto",B,qe]}],"text-decoration-color":[{decoration:m()}],"underline-offset":[{"underline-offset":[te,"auto",B,z]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",B,z]}],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",B,z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:E()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ue,B,z],radial:["",B,z],conic:[Ue,B,z]},Wa,Ba]}],"bg-color":[{bg:m()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:m()}],"gradient-via":[{via:m()}],"gradient-to":[{to:m()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:m()}],"border-color-x":[{"border-x":m()}],"border-color-y":[{"border-y":m()}],"border-color-s":[{"border-s":m()}],"border-color-e":[{"border-e":m()}],"border-color-t":[{"border-t":m()}],"border-color-r":[{"border-r":m()}],"border-color-b":[{"border-b":m()}],"border-color-l":[{"border-l":m()}],"divide-color":[{divide:m()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[te,B,z]}],"outline-w":[{outline:["",te,ct,qe]}],"outline-color":[{outline:m()}],shadow:[{shadow:["","none",d,kt,wt]}],"shadow-color":[{shadow:m()}],"inset-shadow":[{"inset-shadow":["none",p,kt,wt]}],"inset-shadow-color":[{"inset-shadow":m()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:m()}],"ring-offset-w":[{"ring-offset":[te,qe]}],"ring-offset-color":[{"ring-offset":m()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":m()}],"text-shadow":[{"text-shadow":["none",h,kt,wt]}],"text-shadow-color":[{"text-shadow":m()}],opacity:[{opacity:[te,B,z]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":[te]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":m()}],"mask-image-linear-to-color":[{"mask-linear-to":m()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":m()}],"mask-image-t-to-color":[{"mask-t-to":m()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":m()}],"mask-image-r-to-color":[{"mask-r-to":m()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":m()}],"mask-image-b-to-color":[{"mask-b-to":m()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":m()}],"mask-image-l-to-color":[{"mask-l-to":m()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":m()}],"mask-image-x-to-color":[{"mask-x-to":m()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":m()}],"mask-image-y-to-color":[{"mask-y-to":m()}],"mask-image-radial":[{"mask-radial":[B,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":m()}],"mask-image-radial-to-color":[{"mask-radial-to":m()}],"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":$()}],"mask-image-conic-pos":[{"mask-conic":[te]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":m()}],"mask-image-conic-to-color":[{"mask-conic-to":m()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:E()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",B,z]}],filter:[{filter:["","none",B,z]}],blur:[{blur:ae()}],brightness:[{brightness:[te,B,z]}],contrast:[{contrast:[te,B,z]}],"drop-shadow":[{"drop-shadow":["","none",y,kt,wt]}],"drop-shadow-color":[{"drop-shadow":m()}],grayscale:[{grayscale:["",te,B,z]}],"hue-rotate":[{"hue-rotate":[te,B,z]}],invert:[{invert:["",te,B,z]}],saturate:[{saturate:[te,B,z]}],sepia:[{sepia:["",te,B,z]}],"backdrop-filter":[{"backdrop-filter":["","none",B,z]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[te,B,z]}],"backdrop-contrast":[{"backdrop-contrast":[te,B,z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",te,B,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[te,B,z]}],"backdrop-invert":[{"backdrop-invert":["",te,B,z]}],"backdrop-opacity":[{"backdrop-opacity":[te,B,z]}],"backdrop-saturate":[{"backdrop-saturate":[te,B,z]}],"backdrop-sepia":[{"backdrop-sepia":["",te,B,z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",B,z]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[te,"initial",B,z]}],ease:[{ease:["linear","initial",w,B,z]}],delay:[{delay:[te,B,z]}],animate:[{animate:["none",g,B,z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,B,z]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[B,z,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],accent:[{accent:m()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:m()}],"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",B,z]}],"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":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",B,z]}],fill:[{fill:["none",...m()]}],"stroke-w":[{stroke:[te,ct,qe,Ht]}],stroke:[{stroke:["none",...m()]}],"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"]}},Ha=Ta(Ya);var xt=r=>r.type==="checkbox",Ge=r=>r instanceof Date,we=r=>r==null;const Rs=r=>typeof r=="object";var me=r=>!we(r)&&!Array.isArray(r)&&Rs(r)&&!Ge(r),Ms=r=>me(r)&&r.target?xt(r.target)?r.target.checked:r.target.value:r,Xa=r=>r.substring(0,r.search(/\.\d+(\.|$)/))||r,Vs=(r,e)=>r.has(Xa(e)),Ka=r=>{const e=r.constructor&&r.constructor.prototype;return me(e)&&e.hasOwnProperty("isPrototypeOf")},br=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ye(r){let e;const t=Array.isArray(r),s=typeof FileList<"u"?r instanceof FileList:!1;if(r instanceof Date)e=new Date(r);else if(r instanceof Set)e=new Set(r);else if(!(br&&(r instanceof Blob||s))&&(t||me(r)))if(e=t?[]:{},!t&&!Ka(r))e=r;else for(const n in r)r.hasOwnProperty(n)&&(e[n]=ye(r[n]));else return r;return e}var zt=r=>Array.isArray(r)?r.filter(Boolean):[],fe=r=>r===void 0,V=(r,e,t)=>{if(!e||!me(r))return t;const s=zt(e.split(/[,[\].]+?/)).reduce((n,a)=>we(n)?n:n[a],r);return fe(s)||s===r?fe(r[e])?t:r[e]:s},Ne=r=>typeof r=="boolean",yr=r=>/^\w*$/.test(r),$s=r=>zt(r.replace(/["|']|\]/g,"").split(/\.|\[/)),oe=(r,e,t)=>{let s=-1;const n=yr(e)?[e]:$s(e),a=n.length,o=a-1;for(;++s<a;){const l=n[s];let c=t;if(s!==o){const u=r[l];c=me(u)||Array.isArray(u)?u:isNaN(+n[s+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;r[l]=c,r=r[l]}};const Mt={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Fe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},De={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ds=v.createContext(null),gt=()=>v.useContext(Ds),Ja=r=>{const{children:e,...t}=r;return v.createElement(Ds.Provider,{value:t},e)};var Is=(r,e,t,s=!0)=>{const n={defaultValues:e._defaultValues};for(const a in r)Object.defineProperty(n,a,{get:()=>{const o=a;return e._proxyFormState[o]!==Fe.all&&(e._proxyFormState[o]=!s||Fe.all),t&&(t[o]=!0),r[o]}});return n};const vr=typeof window<"u"?Y.useLayoutEffect:Y.useEffect;function Qa(r){const e=gt(),{control:t=e.control,disabled:s,name:n,exact:a}=r||{},[o,l]=v.useState(t._formState),c=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return vr(()=>t._subscribe({name:n,formState:c.current,exact:a,callback:u=>{!s&&l({...t._formState,...u})}}),[n,s,a]),v.useEffect(()=>{c.current.isValid&&t._setValid(!0)},[t]),v.useMemo(()=>Is(o,t,c.current,!1),[o,t])}var Ve=r=>typeof r=="string",Ls=(r,e,t,s,n)=>Ve(r)?(s&&e.watch.add(r),V(t,r,n)):Array.isArray(r)?r.map(a=>(s&&e.watch.add(a),V(t,a))):(s&&(e.watchAll=!0),t);function wr(r){const e=gt(),{control:t=e.control,name:s,defaultValue:n,disabled:a,exact:o}=r||{},l=v.useRef(n),[c,u]=v.useState(t._getWatch(s,l.current));return vr(()=>t._subscribe({name:s,formState:{values:!0},exact:o,callback:d=>!a&&u(Ls(s,t._names,d.values||t._formValues,!1,l.current))}),[s,t,a,o]),v.useEffect(()=>t._removeUnmounted()),c}function Ps(r){const e=gt(),{name:t,disabled:s,control:n=e.control,shouldUnregister:a}=r,o=Vs(n._names.array,t),l=wr({control:n,name:t,defaultValue:V(n._formValues,t,V(n._defaultValues,t,r.defaultValue)),exact:!0}),c=Qa({control:n,name:t,exact:!0}),u=v.useRef(r),d=v.useRef(n.register(t,{...r.rules,value:l,...Ne(r.disabled)?{disabled:r.disabled}:{}})),p=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!V(c.errors,t)},isDirty:{enumerable:!0,get:()=>!!V(c.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!V(c.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!V(c.validatingFields,t)},error:{enumerable:!0,get:()=>V(c.errors,t)}}),[c,t]),h=v.useCallback(S=>d.current.onChange({target:{value:Ms(S),name:t},type:Mt.CHANGE}),[t]),y=v.useCallback(()=>d.current.onBlur({target:{value:V(n._formValues,t),name:t},type:Mt.BLUR}),[t,n._formValues]),x=v.useCallback(S=>{const w=V(n._fields,t);w&&S&&(w._f.ref={focus:()=>S.focus(),select:()=>S.select(),setCustomValidity:g=>S.setCustomValidity(g),reportValidity:()=>S.reportValidity()})},[n._fields,t]),k=v.useMemo(()=>({name:t,value:l,...Ne(s)||c.disabled?{disabled:c.disabled||s}:{},onChange:h,onBlur:y,ref:x}),[t,s,c.disabled,h,y,x,l]);return v.useEffect(()=>{const S=n._options.shouldUnregister||a;n.register(t,{...u.current.rules,...Ne(u.current.disabled)?{disabled:u.current.disabled}:{}});const w=(g,T)=>{const $=V(n._fields,g);$&&$._f&&($._f.mount=T)};if(w(t,!0),S){const g=ye(V(n._options.defaultValues,t));oe(n._defaultValues,t,g),fe(V(n._formValues,t))&&oe(n._formValues,t,g)}return!o&&n.register(t),()=>{(o?S&&!n._state.action:S)?n.unregister(t):w(t,!1)}},[t,n,o,a]),v.useEffect(()=>{n._setDisabledField({disabled:s,name:t})},[s,t,n]),v.useMemo(()=>({field:k,formState:c,fieldState:p}),[k,c,p])}const _e=r=>r.render(Ps(r));var zs=(r,e,t,s,n)=>e?{...t[r],types:{...t[r]&&t[r].types?t[r].types:{},[s]:n||!0}}:{},mt=r=>Array.isArray(r)?r:[r],Lr=()=>{let r=[];return{get observers(){return r},next:n=>{for(const a of r)a.next&&a.next(n)},subscribe:n=>(r.push(n),{unsubscribe:()=>{r=r.filter(a=>a!==n)}}),unsubscribe:()=>{r=[]}}},or=r=>we(r)||!Rs(r);function We(r,e){if(or(r)||or(e))return r===e;if(Ge(r)&&Ge(e))return r.getTime()===e.getTime();const t=Object.keys(r),s=Object.keys(e);if(t.length!==s.length)return!1;for(const n of t){const a=r[n];if(!s.includes(n))return!1;if(n!=="ref"){const o=e[n];if(Ge(a)&&Ge(o)||me(a)&&me(o)||Array.isArray(a)&&Array.isArray(o)?!We(a,o):a!==o)return!1}}return!0}var ve=r=>me(r)&&!Object.keys(r).length,kr=r=>r.type==="file",Te=r=>typeof r=="function",Vt=r=>{if(!br)return!1;const e=r?r.ownerDocument:0;return r instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},Bs=r=>r.type==="select-multiple",jr=r=>r.type==="radio",eo=r=>jr(r)||xt(r),Xt=r=>Vt(r)&&r.isConnected;function to(r,e){const t=e.slice(0,-1).length;let s=0;for(;s<t;)r=fe(r)?s++:r[e[s++]];return r}function ro(r){for(const e in r)if(r.hasOwnProperty(e)&&!fe(r[e]))return!1;return!0}function xe(r,e){const t=Array.isArray(e)?e:yr(e)?[e]:$s(e),s=t.length===1?r:to(r,t),n=t.length-1,a=t[n];return s&&delete s[a],n!==0&&(me(s)&&ve(s)||Array.isArray(s)&&ro(s))&&xe(r,t.slice(0,-1)),r}var Us=r=>{for(const e in r)if(Te(r[e]))return!0;return!1};function $t(r,e={}){const t=Array.isArray(r);if(me(r)||t)for(const s in r)Array.isArray(r[s])||me(r[s])&&!Us(r[s])?(e[s]=Array.isArray(r[s])?[]:{},$t(r[s],e[s])):we(r[s])||(e[s]=!0);return e}function Zs(r,e,t){const s=Array.isArray(r);if(me(r)||s)for(const n in r)Array.isArray(r[n])||me(r[n])&&!Us(r[n])?fe(e)||or(t[n])?t[n]=Array.isArray(r[n])?$t(r[n],[]):{...$t(r[n])}:Zs(r[n],we(e)?{}:e[n],t[n]):t[n]=!We(r[n],e[n]);return t}var ut=(r,e)=>Zs(r,e,$t(e));const Pr={value:!1,isValid:!1},zr={value:!0,isValid:!0};var Ws=r=>{if(Array.isArray(r)){if(r.length>1){const e=r.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:e,isValid:!!e.length}}return r[0].checked&&!r[0].disabled?r[0].attributes&&!fe(r[0].attributes.value)?fe(r[0].value)||r[0].value===""?zr:{value:r[0].value,isValid:!0}:zr:Pr}return Pr},qs=(r,{valueAsNumber:e,valueAsDate:t,setValueAs:s})=>fe(r)?r:e?r===""?NaN:r&&+r:t&&Ve(r)?new Date(r):s?s(r):r;const Br={isValid:!1,value:null};var Gs=r=>Array.isArray(r)?r.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Br):Br;function Ur(r){const e=r.ref;return kr(e)?e.files:jr(e)?Gs(r.refs).value:Bs(e)?[...e.selectedOptions].map(({value:t})=>t):xt(e)?Ws(r.refs).value:qs(fe(e.value)?r.ref.value:e.value,r)}var so=(r,e,t,s)=>{const n={};for(const a of r){const o=V(e,a);o&&oe(n,a,o._f)}return{criteriaMode:t,names:[...r],fields:n,shouldUseNativeValidation:s}},Dt=r=>r instanceof RegExp,dt=r=>fe(r)?r:Dt(r)?r.source:me(r)?Dt(r.value)?r.value.source:r.value:r,Zr=r=>({isOnSubmit:!r||r===Fe.onSubmit,isOnBlur:r===Fe.onBlur,isOnChange:r===Fe.onChange,isOnAll:r===Fe.all,isOnTouch:r===Fe.onTouched});const Wr="AsyncFunction";var no=r=>!!r&&!!r.validate&&!!(Te(r.validate)&&r.validate.constructor.name===Wr||me(r.validate)&&Object.values(r.validate).find(e=>e.constructor.name===Wr)),ao=r=>r.mount&&(r.required||r.min||r.max||r.maxLength||r.minLength||r.pattern||r.validate),qr=(r,e,t)=>!t&&(e.watchAll||e.watch.has(r)||[...e.watch].some(s=>r.startsWith(s)&&/^\.\w+/.test(r.slice(s.length))));const ht=(r,e,t,s)=>{for(const n of t||Object.keys(r)){const a=V(r,n);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],n)&&!s)return!0;if(o.ref&&e(o.ref,o.name)&&!s)return!0;if(ht(l,e))break}else if(me(l)&&ht(l,e))break}}};function Gr(r,e,t){const s=V(r,t);if(s||yr(t))return{error:s,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),o=V(e,a),l=V(r,a);if(o&&!Array.isArray(o)&&t!==a)return{name:t};if(l&&l.type)return{name:a,error:l};n.pop()}return{name:t}}var oo=(r,e,t,s)=>{t(r);const{name:n,...a}=r;return ve(a)||Object.keys(a).length>=Object.keys(e).length||Object.keys(a).find(o=>e[o]===(!s||Fe.all))},io=(r,e,t)=>!r||!e||r===e||mt(r).some(s=>s&&(t?s===e:s.startsWith(e)||e.startsWith(s))),lo=(r,e,t,s,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(e||r):(t?s.isOnBlur:n.isOnBlur)?!r:(t?s.isOnChange:n.isOnChange)?r:!0,co=(r,e)=>!zt(V(r,e)).length&&xe(r,e),uo=(r,e,t)=>{const s=mt(V(r,t));return oe(s,"root",e[t]),oe(r,t,s),r},At=r=>Ve(r);function Yr(r,e,t="validate"){if(At(r)||Array.isArray(r)&&r.every(At)||Ne(r)&&!r)return{type:t,message:At(r)?r:"",ref:e}}var Qe=r=>me(r)&&!Dt(r)?r:{value:r,message:""},Hr=async(r,e,t,s,n,a)=>{const{ref:o,refs:l,required:c,maxLength:u,minLength:d,min:p,max:h,pattern:y,validate:x,name:k,valueAsNumber:S,mount:w}=r._f,g=V(t,k);if(!w||e.has(k))return{};const T=l?l[0]:o,$=D=>{n&&T.reportValidity&&(T.setCustomValidity(Ne(D)?"":D||""),T.reportValidity())},F={},U=jr(o),W=xt(o),_=U||W,R=(S||kr(o))&&fe(o.value)&&fe(g)||Vt(o)&&o.value===""||g===""||Array.isArray(g)&&!g.length,Q=zs.bind(null,k,s,F),Z=(D,H,J,G=De.maxLength,X=De.minLength)=>{const C=D?H:J;F[k]={type:D?G:X,message:C,ref:o,...Q(D?G:X,C)}};if(a?!Array.isArray(g)||!g.length:c&&(!_&&(R||we(g))||Ne(g)&&!g||W&&!Ws(l).isValid||U&&!Gs(l).isValid)){const{value:D,message:H}=At(c)?{value:!!c,message:c}:Qe(c);if(D&&(F[k]={type:De.required,message:H,ref:T,...Q(De.required,H)},!s))return $(H),F}if(!R&&(!we(p)||!we(h))){let D,H;const J=Qe(h),G=Qe(p);if(!we(g)&&!isNaN(g)){const X=o.valueAsNumber||g&&+g;we(J.value)||(D=X>J.value),we(G.value)||(H=X<G.value)}else{const X=o.valueAsDate||new Date(g),C=E=>new Date(new Date().toDateString()+" "+E),m=o.type=="time",q=o.type=="week";Ve(J.value)&&g&&(D=m?C(g)>C(J.value):q?g>J.value:X>new Date(J.value)),Ve(G.value)&&g&&(H=m?C(g)<C(G.value):q?g<G.value:X<new Date(G.value))}if((D||H)&&(Z(!!D,J.message,G.message,De.max,De.min),!s))return $(F[k].message),F}if((u||d)&&!R&&(Ve(g)||a&&Array.isArray(g))){const D=Qe(u),H=Qe(d),J=!we(D.value)&&g.length>+D.value,G=!we(H.value)&&g.length<+H.value;if((J||G)&&(Z(J,D.message,H.message),!s))return $(F[k].message),F}if(y&&!R&&Ve(g)){const{value:D,message:H}=Qe(y);if(Dt(D)&&!g.match(D)&&(F[k]={type:De.pattern,message:H,ref:o,...Q(De.pattern,H)},!s))return $(H),F}if(x){if(Te(x)){const D=await x(g,t),H=Yr(D,T);if(H&&(F[k]={...H,...Q(De.validate,H.message)},!s))return $(H.message),F}else if(me(x)){let D={};for(const H in x){if(!ve(D)&&!s)break;const J=Yr(await x[H](g,t),T,H);J&&(D={...J,...Q(H,J.message)},$(J.message),s&&(F[k]=D))}if(!ve(D)&&(F[k]={ref:T,...D},!s))return F}}return $(!0),F};const fo={mode:Fe.onSubmit,reValidateMode:Fe.onChange,shouldFocusError:!0};function mo(r={}){let e={...fo,...r},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:Te(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1};const s={};let n=me(e.defaultValues)||me(e.values)?ye(e.defaultValues||e.values)||{}:{},a=e.shouldUnregister?{}:ye(n),o={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...d};const h={array:Lr(),state:Lr()},y=e.criteriaMode===Fe.all,x=f=>b=>{clearTimeout(u),u=setTimeout(f,b)},k=async f=>{if(!e.disabled&&(d.isValid||p.isValid||f)){const b=e.resolver?ve((await W()).errors):await R(s,!0);b!==t.isValid&&h.state.next({isValid:b})}},S=(f,b)=>{!e.disabled&&(d.isValidating||d.validatingFields||p.isValidating||p.validatingFields)&&((f||Array.from(l.mount)).forEach(N=>{N&&(b?oe(t.validatingFields,N,b):xe(t.validatingFields,N))}),h.state.next({validatingFields:t.validatingFields,isValidating:!ve(t.validatingFields)}))},w=(f,b=[],N,P,M=!0,A=!0)=>{if(P&&N&&!e.disabled){if(o.action=!0,A&&Array.isArray(V(s,f))){const K=N(V(s,f),P.argA,P.argB);M&&oe(s,f,K)}if(A&&Array.isArray(V(t.errors,f))){const K=N(V(t.errors,f),P.argA,P.argB);M&&oe(t.errors,f,K),co(t.errors,f)}if((d.touchedFields||p.touchedFields)&&A&&Array.isArray(V(t.touchedFields,f))){const K=N(V(t.touchedFields,f),P.argA,P.argB);M&&oe(t.touchedFields,f,K)}(d.dirtyFields||p.dirtyFields)&&(t.dirtyFields=ut(n,a)),h.state.next({name:f,isDirty:Z(f,b),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else oe(a,f,b)},g=(f,b)=>{oe(t.errors,f,b),h.state.next({errors:t.errors})},T=f=>{t.errors=f,h.state.next({errors:t.errors,isValid:!1})},$=(f,b,N,P)=>{const M=V(s,f);if(M){const A=V(a,f,fe(N)?V(n,f):N);fe(A)||P&&P.defaultChecked||b?oe(a,f,b?A:Ur(M._f)):J(f,A),o.mount&&k()}},F=(f,b,N,P,M)=>{let A=!1,K=!1;const ie={name:f};if(!e.disabled){if(!N||P){(d.isDirty||p.isDirty)&&(K=t.isDirty,t.isDirty=ie.isDirty=Z(),A=K!==ie.isDirty);const le=We(V(n,f),b);K=!!V(t.dirtyFields,f),le?xe(t.dirtyFields,f):oe(t.dirtyFields,f,!0),ie.dirtyFields=t.dirtyFields,A=A||(d.dirtyFields||p.dirtyFields)&&K!==!le}if(N){const le=V(t.touchedFields,f);le||(oe(t.touchedFields,f,N),ie.touchedFields=t.touchedFields,A=A||(d.touchedFields||p.touchedFields)&&le!==N)}A&&M&&h.state.next(ie)}return A?ie:{}},U=(f,b,N,P)=>{const M=V(t.errors,f),A=(d.isValid||p.isValid)&&Ne(b)&&t.isValid!==b;if(e.delayError&&N?(c=x(()=>g(f,N)),c(e.delayError)):(clearTimeout(u),c=null,N?oe(t.errors,f,N):xe(t.errors,f)),(N?!We(M,N):M)||!ve(P)||A){const K={...P,...A&&Ne(b)?{isValid:b}:{},errors:t.errors,name:f};t={...t,...K},h.state.next(K)}},W=async f=>{S(f,!0);const b=await e.resolver(a,e.context,so(f||l.mount,s,e.criteriaMode,e.shouldUseNativeValidation));return S(f),b},_=async f=>{const{errors:b}=await W(f);if(f)for(const N of f){const P=V(b,N);P?oe(t.errors,N,P):xe(t.errors,N)}else t.errors=b;return b},R=async(f,b,N={valid:!0})=>{for(const P in f){const M=f[P];if(M){const{_f:A,...K}=M;if(A){const ie=l.array.has(A.name),le=M._f&&no(M._f);le&&d.validatingFields&&S([P],!0);const Se=await Hr(M,l.disabled,a,y,e.shouldUseNativeValidation&&!b,ie);if(le&&d.validatingFields&&S([P]),Se[A.name]&&(N.valid=!1,b))break;!b&&(V(Se,A.name)?ie?uo(t.errors,Se,A.name):oe(t.errors,A.name,Se[A.name]):xe(t.errors,A.name))}!ve(K)&&await R(K,b,N)}}return N.valid},Q=()=>{for(const f of l.unMount){const b=V(s,f);b&&(b._f.refs?b._f.refs.every(N=>!Xt(N)):!Xt(b._f.ref))&&ne(f)}l.unMount=new Set},Z=(f,b)=>!e.disabled&&(f&&b&&oe(a,f,b),!We(E(),n)),D=(f,b,N)=>Ls(f,l,{...o.mount?a:fe(b)?n:Ve(f)?{[f]:b}:b},N,b),H=f=>zt(V(o.mount?a:n,f,e.shouldUnregister?V(n,f,[]):[])),J=(f,b,N={})=>{const P=V(s,f);let M=b;if(P){const A=P._f;A&&(!A.disabled&&oe(a,f,qs(b,A)),M=Vt(A.ref)&&we(b)?"":b,Bs(A.ref)?[...A.ref.options].forEach(K=>K.selected=M.includes(K.value)):A.refs?xt(A.ref)?A.refs.forEach(K=>{(!K.defaultChecked||!K.disabled)&&(Array.isArray(M)?K.checked=!!M.find(ie=>ie===K.value):K.checked=M===K.value||!!M)}):A.refs.forEach(K=>K.checked=K.value===M):kr(A.ref)?A.ref.value="":(A.ref.value=M,A.ref.type||h.state.next({name:f,values:ye(a)})))}(N.shouldDirty||N.shouldTouch)&&F(f,M,N.shouldTouch,N.shouldDirty,!0),N.shouldValidate&&q(f)},G=(f,b,N)=>{for(const P in b){if(!b.hasOwnProperty(P))return;const M=b[P],A=`${f}.${P}`,K=V(s,A);(l.array.has(f)||me(M)||K&&!K._f)&&!Ge(M)?G(A,M,N):J(A,M,N)}},X=(f,b,N={})=>{const P=V(s,f),M=l.array.has(f),A=ye(b);oe(a,f,A),M?(h.array.next({name:f,values:ye(a)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&N.shouldDirty&&h.state.next({name:f,dirtyFields:ut(n,a),isDirty:Z(f,A)})):P&&!P._f&&!we(A)?G(f,A,N):J(f,A,N),qr(f,l)&&h.state.next({...t}),h.state.next({name:o.mount?f:void 0,values:ye(a)})},C=async f=>{o.mount=!0;const b=f.target;let N=b.name,P=!0;const M=V(s,N),A=le=>{P=Number.isNaN(le)||Ge(le)&&isNaN(le.getTime())||We(le,V(a,N,le))},K=Zr(e.mode),ie=Zr(e.reValidateMode);if(M){let le,Se;const yt=b.type?Ur(M._f):Ms(f),Be=f.type===Mt.BLUR||f.type===Mt.FOCUS_OUT,Rn=!ao(M._f)&&!e.resolver&&!V(t.errors,N)&&!M._f.deps||lo(Be,V(t.touchedFields,N),t.isSubmitted,ie,K),qt=qr(N,l,Be);oe(a,N,yt),Be?(M._f.onBlur&&M._f.onBlur(f),c&&c(0)):M._f.onChange&&M._f.onChange(f);const Gt=F(N,yt,Be),Mn=!ve(Gt)||qt;if(!Be&&h.state.next({name:N,type:f.type,values:ye(a)}),Rn)return(d.isValid||p.isValid)&&(e.mode==="onBlur"?Be&&k():Be||k()),Mn&&h.state.next({name:N,...qt?{}:Gt});if(!Be&&qt&&h.state.next({...t}),e.resolver){const{errors:Tr}=await W([N]);if(A(yt),P){const Vn=Gr(t.errors,s,N),Ar=Gr(Tr,s,Vn.name||N);le=Ar.error,N=Ar.name,Se=ve(Tr)}}else S([N],!0),le=(await Hr(M,l.disabled,a,y,e.shouldUseNativeValidation))[N],S([N]),A(yt),P&&(le?Se=!1:(d.isValid||p.isValid)&&(Se=await R(s,!0)));P&&(M._f.deps&&q(M._f.deps),U(N,Se,le,Gt))}},m=(f,b)=>{if(V(t.errors,b)&&f.focus)return f.focus(),1},q=async(f,b={})=>{let N,P;const M=mt(f);if(e.resolver){const A=await _(fe(f)?f:M);N=ve(A),P=f?!M.some(K=>V(A,K)):N}else f?(P=(await Promise.all(M.map(async A=>{const K=V(s,A);return await R(K&&K._f?{[A]:K}:K)}))).every(Boolean),!(!P&&!t.isValid)&&k()):P=N=await R(s);return h.state.next({...!Ve(f)||(d.isValid||p.isValid)&&N!==t.isValid?{}:{name:f},...e.resolver||!f?{isValid:N}:{},errors:t.errors}),b.shouldFocus&&!P&&ht(s,m,f?M:l.mount),P},E=f=>{const b={...o.mount?a:n};return fe(f)?b:Ve(f)?V(b,f):f.map(N=>V(b,N))},j=(f,b)=>({invalid:!!V((b||t).errors,f),isDirty:!!V((b||t).dirtyFields,f),error:V((b||t).errors,f),isValidating:!!V(t.validatingFields,f),isTouched:!!V((b||t).touchedFields,f)}),O=f=>{f&&mt(f).forEach(b=>xe(t.errors,b)),h.state.next({errors:f?t.errors:{}})},I=(f,b,N)=>{const P=(V(s,f,{_f:{}})._f||{}).ref,M=V(t.errors,f)||{},{ref:A,message:K,type:ie,...le}=M;oe(t.errors,f,{...le,...b,ref:P}),h.state.next({name:f,errors:t.errors,isValid:!1}),N&&N.shouldFocus&&P&&P.focus&&P.focus()},ee=(f,b)=>Te(f)?h.state.subscribe({next:N=>f(D(void 0,b),N)}):D(f,b,!0),se=f=>h.state.subscribe({next:b=>{io(f.name,b.name,f.exact)&&oo(b,f.formState||d,Zt,f.reRenderRoot)&&f.callback({values:{...a},...t,...b})}}).unsubscribe,ce=f=>(o.mount=!0,p={...p,...f.formState},se({...f,formState:p})),ne=(f,b={})=>{for(const N of f?mt(f):l.mount)l.mount.delete(N),l.array.delete(N),b.keepValue||(xe(s,N),xe(a,N)),!b.keepError&&xe(t.errors,N),!b.keepDirty&&xe(t.dirtyFields,N),!b.keepTouched&&xe(t.touchedFields,N),!b.keepIsValidating&&xe(t.validatingFields,N),!e.shouldUnregister&&!b.keepDefaultValue&&xe(n,N);h.state.next({values:ye(a)}),h.state.next({...t,...b.keepDirty?{isDirty:Z()}:{}}),!b.keepIsValid&&k()},ae=({disabled:f,name:b})=>{(Ne(f)&&o.mount||f||l.disabled.has(b))&&(f?l.disabled.add(b):l.disabled.delete(b))},he=(f,b={})=>{let N=V(s,f);const P=Ne(b.disabled)||Ne(e.disabled);return oe(s,f,{...N||{},_f:{...N&&N._f?N._f:{ref:{name:f}},name:f,mount:!0,...b}}),l.mount.add(f),N?ae({disabled:Ne(b.disabled)?b.disabled:e.disabled,name:f}):$(f,!0,b.value),{...P?{disabled:b.disabled||e.disabled}:{},...e.progressive?{required:!!b.required,min:dt(b.min),max:dt(b.max),minLength:dt(b.minLength),maxLength:dt(b.maxLength),pattern:dt(b.pattern)}:{},name:f,onChange:C,onBlur:C,ref:M=>{if(M){he(f,b),N=V(s,f);const A=fe(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,K=eo(A),ie=N._f.refs||[];if(K?ie.find(le=>le===A):A===N._f.ref)return;oe(s,f,{_f:{...N._f,...K?{refs:[...ie.filter(Xt),A,...Array.isArray(V(n,f))?[{}]:[]],ref:{type:A.type,name:f}}:{ref:A}}}),$(f,!1,void 0,A)}else N=V(s,f,{}),N._f&&(N._f.mount=!1),(e.shouldUnregister||b.shouldUnregister)&&!(Vs(l.array,f)&&o.action)&&l.unMount.add(f)}}},ge=()=>e.shouldFocusError&&ht(s,m,l.mount),re=f=>{Ne(f)&&(h.state.next({disabled:f}),ht(s,(b,N)=>{const P=V(s,N);P&&(b.disabled=P._f.disabled||f,Array.isArray(P._f.refs)&&P._f.refs.forEach(M=>{M.disabled=P._f.disabled||f}))},0,!1))},ue=(f,b)=>async N=>{let P;N&&(N.preventDefault&&N.preventDefault(),N.persist&&N.persist());let M=ye(a);if(h.state.next({isSubmitting:!0}),e.resolver){const{errors:A,values:K}=await W();t.errors=A,M=K}else await R(s);if(l.disabled.size)for(const A of l.disabled)oe(M,A,void 0);if(xe(t.errors,"root"),ve(t.errors)){h.state.next({errors:{}});try{await f(M,N)}catch(A){P=A}}else b&&await b({...t.errors},N),ge(),setTimeout(ge);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ve(t.errors)&&!P,submitCount:t.submitCount+1,errors:t.errors}),P)throw P},Ce=(f,b={})=>{V(s,f)&&(fe(b.defaultValue)?X(f,ye(V(n,f))):(X(f,b.defaultValue),oe(n,f,ye(b.defaultValue))),b.keepTouched||xe(t.touchedFields,f),b.keepDirty||(xe(t.dirtyFields,f),t.isDirty=b.defaultValue?Z(f,ye(V(n,f))):Z()),b.keepError||(xe(t.errors,f),d.isValid&&k()),h.state.next({...t}))},de=(f,b={})=>{const N=f?ye(f):n,P=ye(N),M=ve(f),A=M?n:P;if(b.keepDefaultValues||(n=N),!b.keepValues){if(b.keepDirtyValues){const K=new Set([...l.mount,...Object.keys(ut(n,a))]);for(const ie of Array.from(K))V(t.dirtyFields,ie)?oe(A,ie,V(a,ie)):X(ie,V(A,ie))}else{if(br&&fe(f))for(const K of l.mount){const ie=V(s,K);if(ie&&ie._f){const le=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(Vt(le)){const Se=le.closest("form");if(Se){Se.reset();break}}}}for(const K of l.mount)X(K,V(A,K))}a=ye(A),h.array.next({values:{...A}}),h.state.next({values:{...A}})}l={mount:b.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!b.keepIsValid||!!b.keepDirtyValues,o.watch=!!e.shouldUnregister,h.state.next({submitCount:b.keepSubmitCount?t.submitCount:0,isDirty:M?!1:b.keepDirty?t.isDirty:!!(b.keepDefaultValues&&!We(f,n)),isSubmitted:b.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:M?{}:b.keepDirtyValues?b.keepDefaultValues&&a?ut(n,a):t.dirtyFields:b.keepDefaultValues&&f?ut(n,f):b.keepDirty?t.dirtyFields:{},touchedFields:b.keepTouched?t.touchedFields:{},errors:b.keepErrors?t.errors:{},isSubmitSuccessful:b.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},Oe=(f,b)=>de(Te(f)?f(a):f,b),at=(f,b={})=>{const N=V(s,f),P=N&&N._f;if(P){const M=P.refs?P.refs[0]:P.ref;M.focus&&(M.focus(),b.shouldSelect&&Te(M.select)&&M.select())}},Zt=f=>{t={...t,...f}},ot={control:{register:he,unregister:ne,getFieldState:j,handleSubmit:ue,setError:I,_subscribe:se,_runSchema:W,_getWatch:D,_getDirty:Z,_setValid:k,_setFieldArray:w,_setDisabledField:ae,_setErrors:T,_getFieldArray:H,_reset:de,_resetDefaultValues:()=>Te(e.defaultValues)&&e.defaultValues().then(f=>{Oe(f,e.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:Q,_disableForm:re,_subjects:h,_proxyFormState:d,get _fields(){return s},get _formValues(){return a},get _state(){return o},set _state(f){o=f},get _defaultValues(){return n},get _names(){return l},set _names(f){l=f},get _formState(){return t},get _options(){return e},set _options(f){e={...e,...f}}},subscribe:ce,trigger:q,register:he,handleSubmit:ue,watch:ee,setValue:X,getValues:E,reset:Oe,resetField:Ce,clearErrors:O,unregister:ne,setError:I,setFocus:at,getFieldState:j};return{...ot,formControl:ot}}function ho(r={}){const e=v.useRef(void 0),t=v.useRef(void 0),[s,n]=v.useState({isDirty:!1,isValidating:!1,isLoading:Te(r.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1,isReady:!1,defaultValues:Te(r.defaultValues)?void 0:r.defaultValues});e.current||(e.current={...r.formControl?r.formControl:mo(r),formState:s},r.formControl&&r.defaultValues&&!Te(r.defaultValues)&&r.formControl.reset(r.defaultValues,r.resetOptions));const a=e.current.control;return a._options=r,vr(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>n({...a._formState}),reRenderRoot:!0});return n(l=>({...l,isReady:!0})),a._formState.isReady=!0,o},[a]),v.useEffect(()=>a._disableForm(r.disabled),[a,r.disabled]),v.useEffect(()=>{r.mode&&(a._options.mode=r.mode),r.reValidateMode&&(a._options.reValidateMode=r.reValidateMode),r.errors&&!ve(r.errors)&&a._setErrors(r.errors)},[a,r.errors,r.mode,r.reValidateMode]),v.useEffect(()=>{r.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,r.shouldUnregister]),v.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==s.isDirty&&a._subjects.state.next({isDirty:o})}},[a,s.isDirty]),v.useEffect(()=>{r.values&&!We(r.values,t.current)?(a._reset(r.values,a._options.resetOptions),t.current=r.values,n(o=>({...o}))):a._resetDefaultValues()},[a,r.values]),v.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),e.current.formState=Is(s,a),e.current}const Ys={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},po={sm:"h-6",md:"h-10",lg:"h-12"},xo={sm:"px-2",md:"px-2.5",lg:"px-3"};function Xr(r,e,t,s,n,a,o){const l=e?"datetime-local":"date",c=L("box-border w-full rounded-lg border outline-none transition font-[var(--font-primary)]",Ys[t],po[t],xo[t],a?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]"),p=Ha(c,n?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-disabled)] cursor-not-allowed opacity-60":"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",o);return i.jsxs(i.Fragment,{children:[i.jsx("input",{id:r,type:l,disabled:n,"aria-disabled":n,"data-disabled":n?"true":"false",...s,className:p}),i.jsx("div",{children:a!=null&&a.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:a.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function Hs(r){const{control:e,name:t,rules:s,defaultValue:n,showTime:a=!1,size:o="sm",width:l="100%",label:c,labelHidden:u=!1,hasError:d=!1,errorMessage:p="",disabled:h=!1,className:y,onChange:x}=r,k=v.useId(),S=t||k;return i.jsxs("div",{className:L("flex flex-col",y),style:{width:l,maxWidth:"100%"},children:[c&&i.jsx("label",{htmlFor:S,className:L("pb-2 text-[var(--color-ds-text-primary)]",Ys[o],u&&"sr-only"),children:c}),e&&t?i.jsx(_e,{name:t,control:e,rules:s,defaultValue:n,render:({field:w,fieldState:g})=>Xr(S,a,o,{value:w.value,onChange:w.onChange,onBlur:w.onBlur},h,g.error,y)}):Xr(S,a,o,{defaultValue:n,onChange:x},h,d?{message:p}:void 0,y)]})}const go=({trigger:r,items:e,align:t="left",className:s})=>{const[n,a]=v.useState(!1),o=v.useRef(null),l=v.useRef([]);v.useEffect(()=>{const u=d=>{o.current&&!o.current.contains(d.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const c=u=>{var p,h;const d=l.current.findIndex(y=>y===document.activeElement);if(u.key==="Escape")a(!1);else if(u.key==="ArrowDown"){u.preventDefault();const y=(d+1)%e.length;(p=l.current[y])==null||p.focus()}else if(u.key==="ArrowUp"){u.preventDefault();const y=(d-1+e.length)%e.length;(h=l.current[y])==null||h.focus()}};return i.jsxs("div",{className:L("relative inline-block",s),ref:o,children:[i.jsx("button",{type:"button",onClick:()=>a(u=>!u),className:"inline-flex items-center focus:outline-none","aria-haspopup":"menu","aria-expanded":n,children:r}),n&&i.jsx("div",{role:"menu","aria-orientation":"vertical",className:L("absolute mt-2 min-w-[160px] bg-[var(--color-ds-background-page)]","border border-[var(--color-ds-border-muted)] rounded shadow-lg z-10",t==="right"?"right-0":"left-0"),onKeyDown:c,children:e.map((u,d)=>{const{label:p,onSelect:h,disabled:y,icon:x}=u;return i.jsxs("button",{role:"menuitem",type:"button",disabled:y,ref:k=>{l.current[d]=k},className:L("w-full flex items-center px-4 py-2 text-[var(--color-ds-text-primary)] text-ds-md transition-colors",y?"opacity-50 cursor-not-allowed":"hover:bg-[var(--color-ds-background-surface)]"),onClick:()=>{y||(h(),a(!1))},children:[x&&i.jsx(x,{className:"w-5 h-5 mr-2 text-[var(--color-ds-text-secondary)]"}),p]},d)})})]})},bo=(r,e,t,s)=>{var a,o,l,c;const n=[t,{code:e,...s||{}}];if((o=(a=r==null?void 0:r.services)==null?void 0:a.logger)!=null&&o.forward)return r.services.logger.forward(n,"warn","react-i18next::",!0);Ye(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),(c=(l=r==null?void 0:r.services)==null?void 0:l.logger)!=null&&c.warn?r.services.logger.warn(...n):console!=null&&console.warn&&console.warn(...n)},Kr={},ir=(r,e,t,s)=>{Ye(t)&&Kr[t]||(Ye(t)&&(Kr[t]=new Date),bo(r,e,t,s))},Xs=(r,e)=>()=>{if(r.isInitialized)e();else{const t=()=>{setTimeout(()=>{r.off("initialized",t)},0),e()};r.on("initialized",t)}},lr=(r,e,t)=>{r.loadNamespaces(e,Xs(r,t))},Jr=(r,e,t,s)=>{if(Ye(t)&&(t=[t]),r.options.preload&&r.options.preload.indexOf(e)>-1)return lr(r,t,s);t.forEach(n=>{r.options.ns.indexOf(n)<0&&r.options.ns.push(n)}),r.loadLanguages(e,Xs(r,s))},yo=(r,e,t={})=>!e.languages||!e.languages.length?(ir(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(r,{lng:t.lng,precheck:(s,n)=>{var a;if(((a=t.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,r))return!1}}),Ye=r=>typeof r=="string",vo=r=>typeof r=="object"&&r!==null,wo=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ko={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},jo=r=>ko[r],Eo=r=>r.replace(wo,jo);let No={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Eo};const So=()=>No;let _o;const Fo=()=>_o,To=v.createContext();class Ao{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Co=(r,e)=>{const t=v.useRef();return v.useEffect(()=>{t.current=r},[r,e]),t.current},Ks=(r,e,t,s)=>r.getFixedT(e,t,s),Oo=(r,e,t,s)=>v.useCallback(Ks(r,e,t,s),[r,e,t,s]),Er=(r,e={})=>{var $,F,U,W;const{i18n:t}=e,{i18n:s,defaultNS:n}=v.useContext(To)||{},a=t||s||Fo();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Ao),!a){ir(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const _=(Q,Z)=>Ye(Z)?Z:vo(Z)&&Ye(Z.defaultValue)?Z.defaultValue:Array.isArray(Q)?Q[Q.length-1]:Q,R=[_,{},!1];return R.t=_,R.i18n={},R.ready=!1,R}($=a.options.react)!=null&&$.wait&&ir(a,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...So(),...a.options.react,...e},{useSuspense:l,keyPrefix:c}=o;let u=n||((F=a.options)==null?void 0:F.defaultNS);u=Ye(u)?[u]:u||["translation"],(W=(U=a.reportNamespaces).addUsedNamespaces)==null||W.call(U,u);const d=(a.isInitialized||a.initializedStoreOnce)&&u.every(_=>yo(_,a,o)),p=Oo(a,e.lng||null,o.nsMode==="fallback"?u:u[0],c),h=()=>p,y=()=>Ks(a,e.lng||null,o.nsMode==="fallback"?u:u[0],c),[x,k]=v.useState(h);let S=u.join();e.lng&&(S=`${e.lng}${S}`);const w=Co(S),g=v.useRef(!0);v.useEffect(()=>{const{bindI18n:_,bindI18nStore:R}=o;g.current=!0,!d&&!l&&(e.lng?Jr(a,e.lng,u,()=>{g.current&&k(y)}):lr(a,u,()=>{g.current&&k(y)})),d&&w&&w!==S&&g.current&&k(y);const Q=()=>{g.current&&k(y)};return _&&(a==null||a.on(_,Q)),R&&(a==null||a.store.on(R,Q)),()=>{g.current=!1,a&&(_==null||_.split(" ").forEach(Z=>a.off(Z,Q))),R&&a&&R.split(" ").forEach(Z=>a.store.off(Z,Q))}},[a,S]),v.useEffect(()=>{g.current&&d&&k(h)},[a,c,d]);const T=[x,a,d];if(T.t=x,T.i18n=a,T.ready=d,d||!d&&!l)return T;throw new Promise(_=>{e.lng?Jr(a,e.lng,u,()=>_()):lr(a,u,()=>_())})},cr={sm:"text-sm",md:"text-base",lg:"text-lg"};function Qr(r,e,t,s,n,a,o,l,c){const{t:u}=Er(),d=v.useRef(null),p=typeof s=="number"&&e.length>=s,h=()=>{var g;!o&&!p&&((g=d.current)==null||g.click())},y=g=>{const T=g.target.files;if(!T)return;const $=Array.from(T);let F=e.concat($);s&&(F=F.slice(0,s)),t(F),g.target.value=""},x=g=>{if(g.preventDefault(),o||p)return;const T=Array.from(g.dataTransfer.files);let $=e.concat(T);s&&($=$.slice(0,s)),t($)},k=g=>{g.preventDefault()},S=g=>{const T=URL.createObjectURL(g);window.open(T)},w=g=>{const T=e.filter(($,F)=>F!==g);t(T)};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"self-start mb-4 w-auto",children:i.jsx(Pe,{type:"button",variant:"outline",size:a,icon:Mr,onClick:h,disabled:o||p,children:u("ds.fileUploader.browse","Browse files")})}),!p&&i.jsxs("div",{className:L("relative flex bg-[var(--color-ds-background-page)] flex-col items-center justify-center border-2 border-dashed border-[var(--color-ds-border-muted)] rounded-lg p-4",o?"opacity-50 cursor-not-allowed":"hover:border-[var(--color-ds-border-default)]",cr[a],c),onDrop:x,onDragOver:k,children:[i.jsx("input",{id:r,type:"file",ref:d,className:"hidden",multiple:s!==1,accept:n,onChange:y,disabled:o}),i.jsx(Me,{component:ta,size:"md",className:"w-8 h-8 text-[var(--color-ds-text-secondary)]"}),i.jsx("p",{className:"mt-3 text-[var(--color-ds-text-secondary)] text-center",children:u("ds.fileUploader.dragDrop","Drag & drop your files here or click to browse")})]}),e.length>0&&i.jsx("ul",{className:"mt-4 space-y-1",children:e.map((g,T)=>i.jsxs("li",{className:"flex items-center justify-between text-[var(--color-ds-text-secondary)] text-sm",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(Mr,{className:"w-4 h-4 mr-2","aria-hidden":"true"}),i.jsx("span",{className:"truncate pr-2",children:g.name})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Pe,{variant:"ghost",size:"sm",icon:ks,ariaLabel:u("ds.fileUploader.view","View"),onClick:()=>S(g)}),i.jsx(Pe,{variant:"ghost",size:"sm",icon:xr,ariaLabel:u("ds.fileUploader.remove","Remove"),onClick:()=>w(T)})]})]},T))}),i.jsx("div",{className:"pt-[5px] min-h-[18px] w-full",children:l!=null&&l.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:l.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function Js(r){const{control:e,name:t,rules:s,defaultValue:n,maxFiles:a,accept:o,size:l="sm",width:c="100%",label:u,labelHidden:d=!1,disabled:p=!1,hasError:h=!1,errorMessage:y="",className:x}=r,k=v.useId(),S=t||k;if(e&&t)return i.jsxs("div",{className:L("flex flex-col",x),style:{width:c},children:[u&&i.jsx("label",{htmlFor:S,className:L("pb-[10px] text-[var(--color-ds-text-primary)]",cr[l],d&&"sr-only"),children:u}),i.jsx(_e,{name:t,control:e,rules:s,defaultValue:n instanceof FileList?Array.from(n):n||[],render:({field:T,fieldState:$})=>Qr(S,T.value,F=>T.onChange(F),a,o,l,p,$.error,x)})]});const[w,g]=v.useState(n instanceof FileList?Array.from(n):n||[]);return i.jsxs("div",{className:L("flex flex-col",x),style:{width:c},children:[u&&i.jsx("label",{htmlFor:S,className:L("pb-[10px] text-[var(--color-ds-text-primary)]",cr[l],d&&"sr-only"),children:u}),Qr(S,w,g,a,o,l,p,h?{message:y}:void 0,x)]})}const Xe=({count:r=1,width:e,height:t="1em",variant:s="rect",className:n})=>{const a=Array.from({length:r});return i.jsx(i.Fragment,{children:a.map((o,l)=>i.jsx("span",{role:"status","aria-label":"Cargando...",className:L("bg-[var(--color-ds-border-muted)] animate-pulse inline-block",s==="circle"?"rounded-full":"rounded",n),style:{width:e??"auto",height:t}},l))})},jt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},Ro={sm:"h-6",md:"h-10",lg:"h-12"},Mo={sm:"px-2",md:"px-2.5",lg:"px-3"},es={sm:"pl-2",md:"pl-2.5",lg:"pl-3"},Vo={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function Bt({id:r,type:e="text",size:t="sm",width:s="100%",label:n,labelHidden:a=!1,hasError:o=!1,errorMessage:l="",prefixIcon:c,suffixIcon:u,separator:d,suffixButton:p,disabled:h=!1,control:y,name:x,rules:k,defaultValue:S,reserveErrorSpace:w,disableErrorPlaceholder:g,loading:T=!1,className:$,...F}){const U=v.useId(),[W,_]=v.useState(!1),R=r||U,Q=e==="password",D=c??(e==="number"?ia:void 0),H=Q?W?na:ks:u,J=typeof w=="boolean"?w:typeof g=="boolean"?!g:!!y,G=L("box-border w-full rounded-lg border placeholder-[var(--color-ds-text-secondary)] outline-none transition font-[var(--font-primary)] appearance-none",jt[t],Ro[t],Mo[t],o?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]","bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]","disabled:bg-[var(--color-ds-background-disabled)]","disabled:border-[var(--color-ds-border-muted)]","disabled:text-[var(--color-ds-text-disabled)]","disabled:cursor-not-allowed");return T?i.jsxs("div",{className:"flex flex-col",style:{width:s,maxWidth:"100%"},children:[!a&&n&&i.jsx("label",{htmlFor:R,className:L("pb-2",jt[t]),children:n}),i.jsx(Xe,{width:"100%",height:Vo[t],variant:"rect",className:"rounded-lg"}),i.jsx("div",{className:"min-h-[18px] w-full",children:i.jsx("span",{"aria-hidden":"true",children:" "})})]}):y&&x?i.jsx(_e,{name:x,control:y,rules:k,defaultValue:S,render:({field:X,fieldState:C})=>i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:R,className:L("pb-2 text-[var(--color-ds-text-primary)]",jt[t]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[D&&i.jsx("div",{className:L("absolute left-0 flex items-center h-full",es[t]),children:i.jsx(Me,{component:D,size:t,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...X,id:R,type:Q?W?"text":"password":e,disabled:h,"aria-invalid":!!C.error,className:L(G,D&&"pl-9",H&&"pr-9",$),onInvalid:m=>m.preventDefault(),style:Q&&!W?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),d&&i.jsx("div",{className:"flex items-center h-full",children:d}),p&&i.jsx("div",{className:"flex items-center h-full pr-2",children:p}),H&&i.jsx("button",{type:"button",onClick:()=>_(m=>!m),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Me,{component:H,size:t,className:"text-[var(--color-ds-text-secondary)]"})})]}),J?i.jsx("div",{className:"min-h-[18px]",children:C.error?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:C.error.message}):i.jsx("span",{"aria-hidden":"true",children:" "})}):C.error?i.jsx("div",{className:"pt-1",children:i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:C.error.message})}):null]})}):i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:R,className:L("pb-2 text-[var(--color-ds-text-primary)]",jt[t]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[D&&i.jsx("div",{className:L("absolute left-0 flex items-center h-full",es[t]),children:i.jsx(Me,{component:D,size:t,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...F,id:R,type:Q?W?"text":"password":e,disabled:h,"aria-invalid":o,className:L(G,D&&"pl-9",H&&"pr-9",$),onInvalid:X=>X.preventDefault(),style:Q&&!W?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),d&&i.jsx("div",{className:"flex items-center h-full",children:d}),p&&i.jsx("div",{className:"flex items-center h-full",children:p}),H&&i.jsx("button",{type:"button",onClick:()=>_(X=>!X),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Me,{component:H,size:t,className:"text-[var(--color-ds-text-secondary)]"})})]}),J?i.jsx("div",{className:"min-h-[18px]",children:o&&l?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:l}):i.jsx("span",{"aria-hidden":"true",children:" "})}):o&&l?i.jsx("div",{className:"pt-1",children:i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:l})}):null]})}const $o={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},Kt=400,Et=8,Qs=({children:r,size:e="sm",position:t="top",className:s})=>{const[n,a]=v.useState(!1),[o,l]=v.useState({x:0,y:0}),c=v.useRef(null),u=v.useId();v.useEffect(()=>{if(n&&c.current){const h=c.current.getBoundingClientRect();let y=0,x=0;switch(t){case"top":y=h.left+h.width/2-Kt/2,x=h.top-Et;break;case"bottom":y=h.left+h.width/2-Kt/2,x=h.bottom+Et;break;case"left":y=h.left-Kt-Et,x=h.top+h.height/2;break;case"right":y=h.right+Et,x=h.top+h.height/2;break}l({x:y,y:x})}},[n,t]);const d=()=>typeof r=="string"?i.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):i.jsx(i.Fragment,{children:r}),p=n?i.jsx("div",{id:u,role:"tooltip",className:L("fixed z-50 w-[250px] bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)] text-ds-sm rounded p-2 shadow-lg","pointer-events-none"),style:{top:`${o.y}px`,left:`${o.x}px`,transform:t==="left"||t==="right"?"translateY(-50%)":t==="top"?"translateY(-100%)":void 0},children:d()}):null;return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button","aria-describedby":u,ref:c,className:L("inline-flex items-center justify-center focus:outline-none",$o[e],"text-[var(--color-ds-text-secondary)] hover:text-[var(--color-ds-text-primary)]",s),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:i.jsx(ca,{className:"w-full h-full"})}),vs.createPortal(p,document.body)]})};function Do({name:r,label:e,type:t="text",size:s="sm",width:n,placeholder:a,validation:o,loadingDefaults:l,disabled:c,info:u}){var S;const{control:d,formState:{errors:p}}=gt(),h=!!p[r],y=((S=p[r])==null?void 0:S.message)||"",x="relative",k=n??"w-full";return i.jsxs("div",{className:x,children:[i.jsx(_e,{name:r,control:d,rules:o,render:({field:w})=>i.jsx(Bt,{label:e,size:s,width:k,placeholder:a,hasError:h,errorMessage:y,loading:l,type:t,...w,disabled:c,reserveErrorSpace:!0})}),u&&i.jsx(Qs,{size:s,position:"left",className:"absolute top-1/2 right-2 -translate-y-1/2",children:u})]})}const Nr=v.memo(Do);Nr.displayName="FormFieldInput";function Io({title:r,headerButtons:e,children:t,className:s}){return i.jsxs("div",{className:L("flex flex-col h-full",s),children:[i.jsxs("div",{className:"flex items-center justify-between py-4",children:[i.jsx("div",{className:`bg-[var(--color-ds-background-accent)] \r
|
|
22
|
+
<%s key={someKey} {...props} />`,I,ae,me,ae),q[ae+I]=!0)}if(ae=null,O!==void 0&&(t(O),ae=""+O),o(j)&&(t(j.key),ae=""+j.key),"key"in j){O={};for(var ge in j)ge!=="key"&&(O[ge]=j[ge])}else O=j;return ae&&l(O,typeof E=="function"?E.displayName||E.name||"Unknown":E),u(E,ae,se,ee,n(),O,ue,ne)}function p(E){typeof E=="object"&&E!==null&&E.$$typeof===y&&E._store&&(E._store.validated=1)}var h=v,y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),T=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),Z=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,X=Array.isArray,J=console.createTask?console.createTask:function(){return null};h={"react-stack-bottom-frame":function(E){return E()}};var G,Y={},C=h["react-stack-bottom-frame"].bind(h,a)(),m=J(s(a)),q={};at.Fragment=k,at.jsx=function(E,j,O,I,ee){var se=1e4>Z.recentlyCreatedOwnerStacks++;return d(E,j,O,!1,I,ee,se?Error("react-stack-top-frame"):C,se?J(s(E)):m)},at.jsxs=function(E,j,O,I,ee){var se=1e4>Z.recentlyCreatedOwnerStacks++;return d(E,j,O,!0,I,ee,se?Error("react-stack-top-frame"):C,se?J(s(E)):m)}}()),at}var Ar;function In(){return Ar||(Ar=1,process.env.NODE_ENV==="production"?gt.exports=$n():gt.exports=Dn()),gt.exports}var i=In();function bs(r){var e,t,s="";if(typeof r=="string"||typeof r=="number")s+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(t=bs(r[e]))&&(s&&(s+=" "),s+=t)}else for(t in r)r[t]&&(s&&(s+=" "),s+=t);return s}function L(){for(var r,e,t=0,s="",n=arguments.length;t<n;t++)(r=arguments[t])&&(e=bs(r))&&(s&&(s+=" "),s+=e);return s}const Ln={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-10 h-10",full:"w-full h-full"};function Oe({component:r,size:e="sm",className:t,...s}){return i.jsx(r,{className:L(Ln[e],t),"aria-hidden":s["aria-label"]?void 0:!0,...s})}const Pn="inline-flex items-center justify-center box-border font-[var(--font-primary)] font-medium rounded-lg transition focus:outline-none",zn={primary:"bg-[var(--color-ds-button-primary-bg)] text-[var(--color-ds-button-primary-text)] hover:animate-pulse",outline:"bg-transparent text-[var(--color-ds-text-primary)] ring-1 ring-inset ring-[var(--color-ds-border-default)] hover:bg-[var(--color-ds-background-accent)] hover:text-[var(--color-ds-text-on-accent)]",ghost:"bg-transparent text-[var(--color-ds-text-primary)] hover:animate-pulse"},Un={sm:"text-ds-sm h-6 px-2",md:"text-ds-md h-10 px-2.5",lg:"text-ds-lg h-12 px-3"},Bn={sm:"h-6 w-6 p-0",md:"h-10 w-10 p-0",lg:"h-12 w-12 p-0"},Zn="disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-[var(--color-ds-background-disabled)] disabled:text-[var(--color-ds-text-on-accent)] disabled:ring-1 disabled:ring-inset disabled:ring-[var(--color-ds-border-muted)]";function Le({type:r="button",variant:e="primary",size:t="sm",width:s,disabled:n=!1,icon:a,iconPosition:o="left",ariaLabel:l,children:c,onClick:u,className:d}){const p=!!a,h=p&&!c,y=h?Bn[t]:Un[t];return i.jsxs("button",{type:r,onClick:u,disabled:n,"aria-label":h?l:void 0,style:s?{width:s}:void 0,className:L(Pn,zn[e],y,Zn,d,p&&c&&"gap-2"),children:[a&&o==="left"&&i.jsx(Oe,{component:a,size:t}),c,a&&o==="right"&&i.jsx(Oe,{component:a,size:t})]})}function Wn({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const qn=H.forwardRef(Wn);function Gn({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const ur=H.forwardRef(Gn);function Yn({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const Hn=H.forwardRef(Yn);function Xn({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const Kn=H.forwardRef(Xn);function Jn({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const Qn=H.forwardRef(Jn);function ea({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const Cr=H.forwardRef(ea);function ta({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const ra=H.forwardRef(ta);function sa({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const ys=H.forwardRef(sa);function na({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"}))}const aa=H.forwardRef(na);function oa({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const ia=H.forwardRef(oa);function la({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))}const ca=H.forwardRef(la);function ua({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"}))}const da=H.forwardRef(ua);function fa({title:r,titleId:e,...t},s){return H.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":e},t),r?H.createElement("title",{id:e},r):null,H.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const dr=H.forwardRef(fa),ma={default:{wrapper:"box-border w-full rounded-lg bg-[var(--color-ds-background-surface)] overflow-hidden",padX:"px-6",padY:"py-4"},plain:{wrapper:"box-border w-full overflow-hidden",padX:"px-0",padY:"py-2"},soft:{wrapper:"box-border w-full rounded-lg bg-[color-mix(in srgb,var(--color-ds-background-surface) 60%, transparent 40%)] overflow-hidden",padX:"px-4",padY:"py-3"},ghost:{wrapper:"box-border w-full overflow-hidden",padX:"px-6",padY:"py-3"}};function Kt({title:r,children:e,defaultOpen:t=!0,className:s,type:n="default",contentClassName:a,headerClassName:o}){const[l,c]=v.useState(t),u=v.useRef(null),[d,p]=v.useState(0),h=()=>{u.current&&p(u.current.scrollHeight)};v.useLayoutEffect(()=>{h()},[l]),v.useEffect(()=>{const x=u.current;if(!x)return;const k=new ResizeObserver(()=>h());return k.observe(x),()=>k.disconnect()},[]);const y=ma[n];return i.jsxs("div",{className:L("flex flex-col w-full gap-3",s),children:[i.jsxs("button",{type:"button",onClick:()=>c(x=>!x),"aria-expanded":l,className:L("flex items-center justify-between w-full transition-colors","hover:bg-[var(--color-ds-surface-hover)]",o),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"block w-1 h-5 bg-[var(--color-ds-background-accent)] rounded-sm"}),i.jsx("span",{className:"font-semibold text-[var(--color-ds-text-primary)]",children:r})]}),l?i.jsx(Kn,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"}):i.jsx(ur,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"})]}),i.jsx("div",{className:y.wrapper,children:i.jsx("div",{className:y.padX,children:i.jsx("div",{className:L("overflow-hidden transition-all duration-300 ease-in-out",l?"opacity-100":"opacity-0"),style:{maxHeight:l?`${d}px`:"0px"},children:i.jsx("div",{ref:u,className:L(y.padY,a),children:e})})})})]})}const fr="-",ha=r=>{const e=xa(r),{conflictingClassGroups:t,conflictingClassGroupModifiers:s}=r;return{getClassGroupId:o=>{const l=o.split(fr);return l[0]===""&&l.length!==1&&l.shift(),vs(l,e)||pa(o)},getConflictingClassGroupIds:(o,l)=>{const c=t[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},vs=(r,e)=>{var o;if(r.length===0)return e.classGroupId;const t=r[0],s=e.nextPart.get(t),n=s?vs(r.slice(1),s):void 0;if(n)return n;if(e.validators.length===0)return;const a=r.join(fr);return(o=e.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},Or=/^\[(.+)\]$/,pa=r=>{if(Or.test(r)){const e=Or.exec(r)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},xa=r=>{const{theme:e,classGroups:t}=r,s={nextPart:new Map,validators:[]};for(const n in t)Jt(t[n],s,n,e);return s},Jt=(r,e,t,s)=>{r.forEach(n=>{if(typeof n=="string"){const a=n===""?e:Rr(e,n);a.classGroupId=t;return}if(typeof n=="function"){if(ga(n)){Jt(n(s),e,t,s);return}e.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(([a,o])=>{Jt(o,Rr(e,a),t,s)})})},Rr=(r,e)=>{let t=r;return e.split(fr).forEach(s=>{t.nextPart.has(s)||t.nextPart.set(s,{nextPart:new Map,validators:[]}),t=t.nextPart.get(s)}),t},ga=r=>r.isThemeGetter,ba=r=>{if(r<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,s=new Map;const n=(a,o)=>{t.set(a,o),e++,e>r&&(e=0,s=t,t=new Map)};return{get(a){let o=t.get(a);if(o!==void 0)return o;if((o=s.get(a))!==void 0)return n(a,o),o},set(a,o){t.has(a)?t.set(a,o):n(a,o)}}},Qt="!",er=":",ya=er.length,va=r=>{const{prefix:e,experimentalParseClassName:t}=r;let s=n=>{const a=[];let o=0,l=0,c=0,u;for(let x=0;x<n.length;x++){let k=n[x];if(o===0&&l===0){if(k===er){a.push(n.slice(c,x)),c=x+ya;continue}if(k==="/"){u=x;continue}}k==="["?o++:k==="]"?o--:k==="("?l++:k===")"&&l--}const d=a.length===0?n:n.substring(c),p=wa(d),h=p!==d,y=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:y}};if(e){const n=e+er,a=s;s=o=>o.startsWith(n)?a(o.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(t){const n=s;s=a=>t({className:a,parseClassName:n})}return s},wa=r=>r.endsWith(Qt)?r.substring(0,r.length-1):r.startsWith(Qt)?r.substring(1):r,ka=r=>{const e=Object.fromEntries(r.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const n=[];let a=[];return s.forEach(o=>{o[0]==="["||e[o]?(n.push(...a.sort(),o),a=[]):a.push(o)}),n.push(...a.sort()),n}},ja=r=>({cache:ba(r.cacheSize),parseClassName:va(r),sortModifiers:ka(r),...ha(r)}),Ea=/\s+/,Na=(r,e)=>{const{parseClassName:t,getClassGroupId:s,getConflictingClassGroupIds:n,sortModifiers:a}=e,o=[],l=r.trim().split(Ea);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:p,modifiers:h,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:k}=t(d);if(p){c=d+(c.length>0?" "+c:c);continue}let S=!!k,w=s(S?x.substring(0,k):x);if(!w){if(!S){c=d+(c.length>0?" "+c:c);continue}if(w=s(x),!w){c=d+(c.length>0?" "+c:c);continue}S=!1}const g=a(h).join(":"),T=y?g+Qt:g,D=T+w;if(o.includes(D))continue;o.push(D);const F=n(w,S);for(let B=0;B<F.length;++B){const W=F[B];o.push(T+W)}c=d+(c.length>0?" "+c:c)}return c};function Sa(){let r=0,e,t,s="";for(;r<arguments.length;)(e=arguments[r++])&&(t=ws(e))&&(s&&(s+=" "),s+=t);return s}const ws=r=>{if(typeof r=="string")return r;let e,t="";for(let s=0;s<r.length;s++)r[s]&&(e=ws(r[s]))&&(t&&(t+=" "),t+=e);return t};function _a(r,...e){let t,s,n,a=o;function o(c){const u=e.reduce((d,p)=>p(d),r());return t=ja(u),s=t.cache.get,n=t.cache.set,a=l,l(c)}function l(c){const u=s(c);if(u)return u;const d=Na(c,t);return n(c,d),d}return function(){return a(Sa.apply(null,arguments))}}const he=r=>{const e=t=>t[r]||[];return e.isThemeGetter=!0,e},ks=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,js=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Fa=/^\d+\/\d+$/,Ta=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Aa=/\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$/,Ca=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Oa=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ra=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ke=r=>Fa.test(r),re=r=>!!r&&!Number.isNaN(Number(r)),Ue=r=>!!r&&Number.isInteger(Number(r)),Bt=r=>r.endsWith("%")&&re(r.slice(0,-1)),Ve=r=>Ta.test(r),Ma=()=>!0,Va=r=>Aa.test(r)&&!Ca.test(r),Es=()=>!1,$a=r=>Oa.test(r),Da=r=>Ra.test(r),Ia=r=>!z(r)&&!U(r),La=r=>rt(r,_s,Es),z=r=>ks.test(r),We=r=>rt(r,Fs,Va),Zt=r=>rt(r,Za,re),Mr=r=>rt(r,Ns,Es),Pa=r=>rt(r,Ss,Da),bt=r=>rt(r,Ts,$a),U=r=>js.test(r),ot=r=>st(r,Fs),za=r=>st(r,Wa),Vr=r=>st(r,Ns),Ua=r=>st(r,_s),Ba=r=>st(r,Ss),yt=r=>st(r,Ts,!0),rt=(r,e,t)=>{const s=ks.exec(r);return s?s[1]?e(s[1]):t(s[2]):!1},st=(r,e,t=!1)=>{const s=js.exec(r);return s?s[1]?e(s[1]):t:!1},Ns=r=>r==="position"||r==="percentage",Ss=r=>r==="image"||r==="url",_s=r=>r==="length"||r==="size"||r==="bg-size",Fs=r=>r==="length",Za=r=>r==="number",Wa=r=>r==="family-name",Ts=r=>r==="shadow",qa=()=>{const r=he("color"),e=he("font"),t=he("text"),s=he("font-weight"),n=he("tracking"),a=he("leading"),o=he("breakpoint"),l=he("container"),c=he("spacing"),u=he("radius"),d=he("shadow"),p=he("inset-shadow"),h=he("text-shadow"),y=he("drop-shadow"),x=he("blur"),k=he("perspective"),S=he("aspect"),w=he("ease"),g=he("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...D(),U,z],B=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],_=()=>[U,z,c],R=()=>[Ke,"full","auto",..._()],Q=()=>[Ue,"none","subgrid",U,z],Z=()=>["auto",{span:["full",Ue,U,z]},Ue,U,z],$=()=>[Ue,"auto",U,z],X=()=>["auto","min","max","fr",U,z],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",..._()],C=()=>[Ke,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],m=()=>[r,U,z],q=()=>[...D(),Vr,Mr,{position:[U,z]}],E=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",Ua,La,{size:[U,z]}],O=()=>[Bt,ot,We],I=()=>["","none","full",u,U,z],ee=()=>["",re,ot,We],se=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[re,Bt,Vr,Mr],ae=()=>["","none",x,U,z],me=()=>["none",re,U,z],ge=()=>["none",re,U,z],te=()=>[re,U,z],le=()=>[Ke,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ve],breakpoint:[Ve],color:[Ma],container:[Ve],"drop-shadow":[Ve],ease:["in","out","in-out"],font:[Ia],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ve],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ve],shadow:[Ve],spacing:["px",re],text:[Ve],"text-shadow":[Ve],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ke,z,U,S]}],container:["container"],columns:[{columns:[re,z,U,l]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:F()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[Ue,"auto",U,z]}],basis:[{basis:[Ke,"full","auto",l,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[re,Ke,"auto","initial","none",z]}],grow:[{grow:["",re,U,z]}],shrink:[{shrink:["",re,U,z]}],order:[{order:[Ue,"first","last","none",U,z]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:C()}],w:[{w:[l,"screen",...C()]}],"min-w":[{"min-w":[l,"screen","none",...C()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...C()]}],h:[{h:["screen","lh",...C()]}],"min-h":[{"min-h":["screen","lh","none",...C()]}],"max-h":[{"max-h":["screen","lh",...C()]}],"font-size":[{text:["base",t,ot,We]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,U,Zt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Bt,z]}],"font-family":[{font:[za,z,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:[n,U,z]}],"line-clamp":[{"line-clamp":[re,"none",U,Zt]}],leading:[{leading:[a,..._()]}],"list-image":[{"list-image":["none",U,z]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",U,z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:m()}],"text-color":[{text:m()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[re,"from-font","auto",U,We]}],"text-decoration-color":[{decoration:m()}],"underline-offset":[{"underline-offset":[re,"auto",U,z]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",U,z]}],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",U,z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:E()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ue,U,z],radial:["",U,z],conic:[Ue,U,z]},Ba,Pa]}],"bg-color":[{bg:m()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:m()}],"gradient-via":[{via:m()}],"gradient-to":[{to:m()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:m()}],"border-color-x":[{"border-x":m()}],"border-color-y":[{"border-y":m()}],"border-color-s":[{"border-s":m()}],"border-color-e":[{"border-e":m()}],"border-color-t":[{"border-t":m()}],"border-color-r":[{"border-r":m()}],"border-color-b":[{"border-b":m()}],"border-color-l":[{"border-l":m()}],"divide-color":[{divide:m()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[re,U,z]}],"outline-w":[{outline:["",re,ot,We]}],"outline-color":[{outline:m()}],shadow:[{shadow:["","none",d,yt,bt]}],"shadow-color":[{shadow:m()}],"inset-shadow":[{"inset-shadow":["none",p,yt,bt]}],"inset-shadow-color":[{"inset-shadow":m()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:m()}],"ring-offset-w":[{"ring-offset":[re,We]}],"ring-offset-color":[{"ring-offset":m()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":m()}],"text-shadow":[{"text-shadow":["none",h,yt,bt]}],"text-shadow-color":[{"text-shadow":m()}],opacity:[{opacity:[re,U,z]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[re]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":m()}],"mask-image-linear-to-color":[{"mask-linear-to":m()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":m()}],"mask-image-t-to-color":[{"mask-t-to":m()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":m()}],"mask-image-r-to-color":[{"mask-r-to":m()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":m()}],"mask-image-b-to-color":[{"mask-b-to":m()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":m()}],"mask-image-l-to-color":[{"mask-l-to":m()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":m()}],"mask-image-x-to-color":[{"mask-x-to":m()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":m()}],"mask-image-y-to-color":[{"mask-y-to":m()}],"mask-image-radial":[{"mask-radial":[U,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":m()}],"mask-image-radial-to-color":[{"mask-radial-to":m()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[re]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":m()}],"mask-image-conic-to-color":[{"mask-conic-to":m()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:E()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",U,z]}],filter:[{filter:["","none",U,z]}],blur:[{blur:ae()}],brightness:[{brightness:[re,U,z]}],contrast:[{contrast:[re,U,z]}],"drop-shadow":[{"drop-shadow":["","none",y,yt,bt]}],"drop-shadow-color":[{"drop-shadow":m()}],grayscale:[{grayscale:["",re,U,z]}],"hue-rotate":[{"hue-rotate":[re,U,z]}],invert:[{invert:["",re,U,z]}],saturate:[{saturate:[re,U,z]}],sepia:[{sepia:["",re,U,z]}],"backdrop-filter":[{"backdrop-filter":["","none",U,z]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[re,U,z]}],"backdrop-contrast":[{"backdrop-contrast":[re,U,z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",re,U,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[re,U,z]}],"backdrop-invert":[{"backdrop-invert":["",re,U,z]}],"backdrop-opacity":[{"backdrop-opacity":[re,U,z]}],"backdrop-saturate":[{"backdrop-saturate":[re,U,z]}],"backdrop-sepia":[{"backdrop-sepia":["",re,U,z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",U,z]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[re,"initial",U,z]}],ease:[{ease:["linear","initial",w,U,z]}],delay:[{delay:[re,U,z]}],animate:[{animate:["none",g,U,z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,U,z]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[U,z,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:m()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:m()}],"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",U,z]}],"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":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",U,z]}],fill:[{fill:["none",...m()]}],"stroke-w":[{stroke:[re,ot,We,Zt]}],stroke:[{stroke:["none",...m()]}],"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"]}},Ga=_a(qa);var mt=r=>r.type==="checkbox",qe=r=>r instanceof Date,we=r=>r==null;const As=r=>typeof r=="object";var fe=r=>!we(r)&&!Array.isArray(r)&&As(r)&&!qe(r),Cs=r=>fe(r)&&r.target?mt(r.target)?r.target.checked:r.target.value:r,Ya=r=>r.substring(0,r.search(/\.\d+(\.|$)/))||r,Os=(r,e)=>r.has(Ya(e)),Ha=r=>{const e=r.constructor&&r.constructor.prototype;return fe(e)&&e.hasOwnProperty("isPrototypeOf")},mr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ye(r){let e;const t=Array.isArray(r),s=typeof FileList<"u"?r instanceof FileList:!1;if(r instanceof Date)e=new Date(r);else if(r instanceof Set)e=new Set(r);else if(!(mr&&(r instanceof Blob||s))&&(t||fe(r)))if(e=t?[]:{},!t&&!Ha(r))e=r;else for(const n in r)r.hasOwnProperty(n)&&(e[n]=ye(r[n]));else return r;return e}var It=r=>Array.isArray(r)?r.filter(Boolean):[],de=r=>r===void 0,V=(r,e,t)=>{if(!e||!fe(r))return t;const s=It(e.split(/[,[\].]+?/)).reduce((n,a)=>we(n)?n:n[a],r);return de(s)||s===r?de(r[e])?t:r[e]:s},Ne=r=>typeof r=="boolean",hr=r=>/^\w*$/.test(r),Rs=r=>It(r.replace(/["|']|\]/g,"").split(/\.|\[/)),oe=(r,e,t)=>{let s=-1;const n=hr(e)?[e]:Rs(e),a=n.length,o=a-1;for(;++s<a;){const l=n[s];let c=t;if(s!==o){const u=r[l];c=fe(u)||Array.isArray(u)?u:isNaN(+n[s+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;r[l]=c,r=r[l]}};const Ct={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Fe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},$e={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ms=v.createContext(null),ht=()=>v.useContext(Ms),Xa=r=>{const{children:e,...t}=r;return v.createElement(Ms.Provider,{value:t},e)};var Vs=(r,e,t,s=!0)=>{const n={defaultValues:e._defaultValues};for(const a in r)Object.defineProperty(n,a,{get:()=>{const o=a;return e._proxyFormState[o]!==Fe.all&&(e._proxyFormState[o]=!s||Fe.all),t&&(t[o]=!0),r[o]}});return n};const pr=typeof window<"u"?H.useLayoutEffect:H.useEffect;function Ka(r){const e=ht(),{control:t=e.control,disabled:s,name:n,exact:a}=r||{},[o,l]=v.useState(t._formState),c=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return pr(()=>t._subscribe({name:n,formState:c.current,exact:a,callback:u=>{!s&&l({...t._formState,...u})}}),[n,s,a]),v.useEffect(()=>{c.current.isValid&&t._setValid(!0)},[t]),v.useMemo(()=>Vs(o,t,c.current,!1),[o,t])}var Re=r=>typeof r=="string",$s=(r,e,t,s,n)=>Re(r)?(s&&e.watch.add(r),V(t,r,n)):Array.isArray(r)?r.map(a=>(s&&e.watch.add(a),V(t,a))):(s&&(e.watchAll=!0),t);function xr(r){const e=ht(),{control:t=e.control,name:s,defaultValue:n,disabled:a,exact:o}=r||{},l=v.useRef(n),[c,u]=v.useState(t._getWatch(s,l.current));return pr(()=>t._subscribe({name:s,formState:{values:!0},exact:o,callback:d=>!a&&u($s(s,t._names,d.values||t._formValues,!1,l.current))}),[s,t,a,o]),v.useEffect(()=>t._removeUnmounted()),c}function Ds(r){const e=ht(),{name:t,disabled:s,control:n=e.control,shouldUnregister:a}=r,o=Os(n._names.array,t),l=xr({control:n,name:t,defaultValue:V(n._formValues,t,V(n._defaultValues,t,r.defaultValue)),exact:!0}),c=Ka({control:n,name:t,exact:!0}),u=v.useRef(r),d=v.useRef(n.register(t,{...r.rules,value:l,...Ne(r.disabled)?{disabled:r.disabled}:{}})),p=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!V(c.errors,t)},isDirty:{enumerable:!0,get:()=>!!V(c.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!V(c.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!V(c.validatingFields,t)},error:{enumerable:!0,get:()=>V(c.errors,t)}}),[c,t]),h=v.useCallback(S=>d.current.onChange({target:{value:Cs(S),name:t},type:Ct.CHANGE}),[t]),y=v.useCallback(()=>d.current.onBlur({target:{value:V(n._formValues,t),name:t},type:Ct.BLUR}),[t,n._formValues]),x=v.useCallback(S=>{const w=V(n._fields,t);w&&S&&(w._f.ref={focus:()=>S.focus(),select:()=>S.select(),setCustomValidity:g=>S.setCustomValidity(g),reportValidity:()=>S.reportValidity()})},[n._fields,t]),k=v.useMemo(()=>({name:t,value:l,...Ne(s)||c.disabled?{disabled:c.disabled||s}:{},onChange:h,onBlur:y,ref:x}),[t,s,c.disabled,h,y,x,l]);return v.useEffect(()=>{const S=n._options.shouldUnregister||a;n.register(t,{...u.current.rules,...Ne(u.current.disabled)?{disabled:u.current.disabled}:{}});const w=(g,T)=>{const D=V(n._fields,g);D&&D._f&&(D._f.mount=T)};if(w(t,!0),S){const g=ye(V(n._options.defaultValues,t));oe(n._defaultValues,t,g),de(V(n._formValues,t))&&oe(n._formValues,t,g)}return!o&&n.register(t),()=>{(o?S&&!n._state.action:S)?n.unregister(t):w(t,!1)}},[t,n,o,a]),v.useEffect(()=>{n._setDisabledField({disabled:s,name:t})},[s,t,n]),v.useMemo(()=>({field:k,formState:c,fieldState:p}),[k,c,p])}const _e=r=>r.render(Ds(r));var Is=(r,e,t,s,n)=>e?{...t[r],types:{...t[r]&&t[r].types?t[r].types:{},[s]:n||!0}}:{},ut=r=>Array.isArray(r)?r:[r],$r=()=>{let r=[];return{get observers(){return r},next:n=>{for(const a of r)a.next&&a.next(n)},subscribe:n=>(r.push(n),{unsubscribe:()=>{r=r.filter(a=>a!==n)}}),unsubscribe:()=>{r=[]}}},tr=r=>we(r)||!As(r);function Ze(r,e){if(tr(r)||tr(e))return r===e;if(qe(r)&&qe(e))return r.getTime()===e.getTime();const t=Object.keys(r),s=Object.keys(e);if(t.length!==s.length)return!1;for(const n of t){const a=r[n];if(!s.includes(n))return!1;if(n!=="ref"){const o=e[n];if(qe(a)&&qe(o)||fe(a)&&fe(o)||Array.isArray(a)&&Array.isArray(o)?!Ze(a,o):a!==o)return!1}}return!0}var ve=r=>fe(r)&&!Object.keys(r).length,gr=r=>r.type==="file",Te=r=>typeof r=="function",Ot=r=>{if(!mr)return!1;const e=r?r.ownerDocument:0;return r instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},Ls=r=>r.type==="select-multiple",br=r=>r.type==="radio",Ja=r=>br(r)||mt(r),Wt=r=>Ot(r)&&r.isConnected;function Qa(r,e){const t=e.slice(0,-1).length;let s=0;for(;s<t;)r=de(r)?s++:r[e[s++]];return r}function eo(r){for(const e in r)if(r.hasOwnProperty(e)&&!de(r[e]))return!1;return!0}function pe(r,e){const t=Array.isArray(e)?e:hr(e)?[e]:Rs(e),s=t.length===1?r:Qa(r,t),n=t.length-1,a=t[n];return s&&delete s[a],n!==0&&(fe(s)&&ve(s)||Array.isArray(s)&&eo(s))&&pe(r,t.slice(0,-1)),r}var Ps=r=>{for(const e in r)if(Te(r[e]))return!0;return!1};function Rt(r,e={}){const t=Array.isArray(r);if(fe(r)||t)for(const s in r)Array.isArray(r[s])||fe(r[s])&&!Ps(r[s])?(e[s]=Array.isArray(r[s])?[]:{},Rt(r[s],e[s])):we(r[s])||(e[s]=!0);return e}function zs(r,e,t){const s=Array.isArray(r);if(fe(r)||s)for(const n in r)Array.isArray(r[n])||fe(r[n])&&!Ps(r[n])?de(e)||tr(t[n])?t[n]=Array.isArray(r[n])?Rt(r[n],[]):{...Rt(r[n])}:zs(r[n],we(e)?{}:e[n],t[n]):t[n]=!Ze(r[n],e[n]);return t}var it=(r,e)=>zs(r,e,Rt(e));const Dr={value:!1,isValid:!1},Ir={value:!0,isValid:!0};var Us=r=>{if(Array.isArray(r)){if(r.length>1){const e=r.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:e,isValid:!!e.length}}return r[0].checked&&!r[0].disabled?r[0].attributes&&!de(r[0].attributes.value)?de(r[0].value)||r[0].value===""?Ir:{value:r[0].value,isValid:!0}:Ir:Dr}return Dr},Bs=(r,{valueAsNumber:e,valueAsDate:t,setValueAs:s})=>de(r)?r:e?r===""?NaN:r&&+r:t&&Re(r)?new Date(r):s?s(r):r;const Lr={isValid:!1,value:null};var Zs=r=>Array.isArray(r)?r.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Lr):Lr;function Pr(r){const e=r.ref;return gr(e)?e.files:br(e)?Zs(r.refs).value:Ls(e)?[...e.selectedOptions].map(({value:t})=>t):mt(e)?Us(r.refs).value:Bs(de(e.value)?r.ref.value:e.value,r)}var to=(r,e,t,s)=>{const n={};for(const a of r){const o=V(e,a);o&&oe(n,a,o._f)}return{criteriaMode:t,names:[...r],fields:n,shouldUseNativeValidation:s}},Mt=r=>r instanceof RegExp,lt=r=>de(r)?r:Mt(r)?r.source:fe(r)?Mt(r.value)?r.value.source:r.value:r,zr=r=>({isOnSubmit:!r||r===Fe.onSubmit,isOnBlur:r===Fe.onBlur,isOnChange:r===Fe.onChange,isOnAll:r===Fe.all,isOnTouch:r===Fe.onTouched});const Ur="AsyncFunction";var ro=r=>!!r&&!!r.validate&&!!(Te(r.validate)&&r.validate.constructor.name===Ur||fe(r.validate)&&Object.values(r.validate).find(e=>e.constructor.name===Ur)),so=r=>r.mount&&(r.required||r.min||r.max||r.maxLength||r.minLength||r.pattern||r.validate),Br=(r,e,t)=>!t&&(e.watchAll||e.watch.has(r)||[...e.watch].some(s=>r.startsWith(s)&&/^\.\w+/.test(r.slice(s.length))));const dt=(r,e,t,s)=>{for(const n of t||Object.keys(r)){const a=V(r,n);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],n)&&!s)return!0;if(o.ref&&e(o.ref,o.name)&&!s)return!0;if(dt(l,e))break}else if(fe(l)&&dt(l,e))break}}};function Zr(r,e,t){const s=V(r,t);if(s||hr(t))return{error:s,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),o=V(e,a),l=V(r,a);if(o&&!Array.isArray(o)&&t!==a)return{name:t};if(l&&l.type)return{name:a,error:l};n.pop()}return{name:t}}var no=(r,e,t,s)=>{t(r);const{name:n,...a}=r;return ve(a)||Object.keys(a).length>=Object.keys(e).length||Object.keys(a).find(o=>e[o]===(!s||Fe.all))},ao=(r,e,t)=>!r||!e||r===e||ut(r).some(s=>s&&(t?s===e:s.startsWith(e)||e.startsWith(s))),oo=(r,e,t,s,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(e||r):(t?s.isOnBlur:n.isOnBlur)?!r:(t?s.isOnChange:n.isOnChange)?r:!0,io=(r,e)=>!It(V(r,e)).length&&pe(r,e),lo=(r,e,t)=>{const s=ut(V(r,t));return oe(s,"root",e[t]),oe(r,t,s),r},_t=r=>Re(r);function Wr(r,e,t="validate"){if(_t(r)||Array.isArray(r)&&r.every(_t)||Ne(r)&&!r)return{type:t,message:_t(r)?r:"",ref:e}}var Je=r=>fe(r)&&!Mt(r)?r:{value:r,message:""},qr=async(r,e,t,s,n,a)=>{const{ref:o,refs:l,required:c,maxLength:u,minLength:d,min:p,max:h,pattern:y,validate:x,name:k,valueAsNumber:S,mount:w}=r._f,g=V(t,k);if(!w||e.has(k))return{};const T=l?l[0]:o,D=$=>{n&&T.reportValidity&&(T.setCustomValidity(Ne($)?"":$||""),T.reportValidity())},F={},B=br(o),W=mt(o),_=B||W,R=(S||gr(o))&&de(o.value)&&de(g)||Ot(o)&&o.value===""||g===""||Array.isArray(g)&&!g.length,Q=Is.bind(null,k,s,F),Z=($,X,J,G=$e.maxLength,Y=$e.minLength)=>{const C=$?X:J;F[k]={type:$?G:Y,message:C,ref:o,...Q($?G:Y,C)}};if(a?!Array.isArray(g)||!g.length:c&&(!_&&(R||we(g))||Ne(g)&&!g||W&&!Us(l).isValid||B&&!Zs(l).isValid)){const{value:$,message:X}=_t(c)?{value:!!c,message:c}:Je(c);if($&&(F[k]={type:$e.required,message:X,ref:T,...Q($e.required,X)},!s))return D(X),F}if(!R&&(!we(p)||!we(h))){let $,X;const J=Je(h),G=Je(p);if(!we(g)&&!isNaN(g)){const Y=o.valueAsNumber||g&&+g;we(J.value)||($=Y>J.value),we(G.value)||(X=Y<G.value)}else{const Y=o.valueAsDate||new Date(g),C=E=>new Date(new Date().toDateString()+" "+E),m=o.type=="time",q=o.type=="week";Re(J.value)&&g&&($=m?C(g)>C(J.value):q?g>J.value:Y>new Date(J.value)),Re(G.value)&&g&&(X=m?C(g)<C(G.value):q?g<G.value:Y<new Date(G.value))}if(($||X)&&(Z(!!$,J.message,G.message,$e.max,$e.min),!s))return D(F[k].message),F}if((u||d)&&!R&&(Re(g)||a&&Array.isArray(g))){const $=Je(u),X=Je(d),J=!we($.value)&&g.length>+$.value,G=!we(X.value)&&g.length<+X.value;if((J||G)&&(Z(J,$.message,X.message),!s))return D(F[k].message),F}if(y&&!R&&Re(g)){const{value:$,message:X}=Je(y);if(Mt($)&&!g.match($)&&(F[k]={type:$e.pattern,message:X,ref:o,...Q($e.pattern,X)},!s))return D(X),F}if(x){if(Te(x)){const $=await x(g,t),X=Wr($,T);if(X&&(F[k]={...X,...Q($e.validate,X.message)},!s))return D(X.message),F}else if(fe(x)){let $={};for(const X in x){if(!ve($)&&!s)break;const J=Wr(await x[X](g,t),T,X);J&&($={...J,...Q(X,J.message)},D(J.message),s&&(F[k]=$))}if(!ve($)&&(F[k]={ref:T,...$},!s))return F}}return D(!0),F};const co={mode:Fe.onSubmit,reValidateMode:Fe.onChange,shouldFocusError:!0};function uo(r={}){let e={...co,...r},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:Te(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1};const s={};let n=fe(e.defaultValues)||fe(e.values)?ye(e.defaultValues||e.values)||{}:{},a=e.shouldUnregister?{}:ye(n),o={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...d};const h={array:$r(),state:$r()},y=e.criteriaMode===Fe.all,x=f=>b=>{clearTimeout(u),u=setTimeout(f,b)},k=async f=>{if(!e.disabled&&(d.isValid||p.isValid||f)){const b=e.resolver?ve((await W()).errors):await R(s,!0);b!==t.isValid&&h.state.next({isValid:b})}},S=(f,b)=>{!e.disabled&&(d.isValidating||d.validatingFields||p.isValidating||p.validatingFields)&&((f||Array.from(l.mount)).forEach(N=>{N&&(b?oe(t.validatingFields,N,b):pe(t.validatingFields,N))}),h.state.next({validatingFields:t.validatingFields,isValidating:!ve(t.validatingFields)}))},w=(f,b=[],N,P,M=!0,A=!0)=>{if(P&&N&&!e.disabled){if(o.action=!0,A&&Array.isArray(V(s,f))){const K=N(V(s,f),P.argA,P.argB);M&&oe(s,f,K)}if(A&&Array.isArray(V(t.errors,f))){const K=N(V(t.errors,f),P.argA,P.argB);M&&oe(t.errors,f,K),io(t.errors,f)}if((d.touchedFields||p.touchedFields)&&A&&Array.isArray(V(t.touchedFields,f))){const K=N(V(t.touchedFields,f),P.argA,P.argB);M&&oe(t.touchedFields,f,K)}(d.dirtyFields||p.dirtyFields)&&(t.dirtyFields=it(n,a)),h.state.next({name:f,isDirty:Z(f,b),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else oe(a,f,b)},g=(f,b)=>{oe(t.errors,f,b),h.state.next({errors:t.errors})},T=f=>{t.errors=f,h.state.next({errors:t.errors,isValid:!1})},D=(f,b,N,P)=>{const M=V(s,f);if(M){const A=V(a,f,de(N)?V(n,f):N);de(A)||P&&P.defaultChecked||b?oe(a,f,b?A:Pr(M._f)):J(f,A),o.mount&&k()}},F=(f,b,N,P,M)=>{let A=!1,K=!1;const ie={name:f};if(!e.disabled){if(!N||P){(d.isDirty||p.isDirty)&&(K=t.isDirty,t.isDirty=ie.isDirty=Z(),A=K!==ie.isDirty);const ce=Ze(V(n,f),b);K=!!V(t.dirtyFields,f),ce?pe(t.dirtyFields,f):oe(t.dirtyFields,f,!0),ie.dirtyFields=t.dirtyFields,A=A||(d.dirtyFields||p.dirtyFields)&&K!==!ce}if(N){const ce=V(t.touchedFields,f);ce||(oe(t.touchedFields,f,N),ie.touchedFields=t.touchedFields,A=A||(d.touchedFields||p.touchedFields)&&ce!==N)}A&&M&&h.state.next(ie)}return A?ie:{}},B=(f,b,N,P)=>{const M=V(t.errors,f),A=(d.isValid||p.isValid)&&Ne(b)&&t.isValid!==b;if(e.delayError&&N?(c=x(()=>g(f,N)),c(e.delayError)):(clearTimeout(u),c=null,N?oe(t.errors,f,N):pe(t.errors,f)),(N?!Ze(M,N):M)||!ve(P)||A){const K={...P,...A&&Ne(b)?{isValid:b}:{},errors:t.errors,name:f};t={...t,...K},h.state.next(K)}},W=async f=>{S(f,!0);const b=await e.resolver(a,e.context,to(f||l.mount,s,e.criteriaMode,e.shouldUseNativeValidation));return S(f),b},_=async f=>{const{errors:b}=await W(f);if(f)for(const N of f){const P=V(b,N);P?oe(t.errors,N,P):pe(t.errors,N)}else t.errors=b;return b},R=async(f,b,N={valid:!0})=>{for(const P in f){const M=f[P];if(M){const{_f:A,...K}=M;if(A){const ie=l.array.has(A.name),ce=M._f&&ro(M._f);ce&&d.validatingFields&&S([P],!0);const Se=await qr(M,l.disabled,a,y,e.shouldUseNativeValidation&&!b,ie);if(ce&&d.validatingFields&&S([P]),Se[A.name]&&(N.valid=!1,b))break;!b&&(V(Se,A.name)?ie?lo(t.errors,Se,A.name):oe(t.errors,A.name,Se[A.name]):pe(t.errors,A.name))}!ve(K)&&await R(K,b,N)}}return N.valid},Q=()=>{for(const f of l.unMount){const b=V(s,f);b&&(b._f.refs?b._f.refs.every(N=>!Wt(N)):!Wt(b._f.ref))&&ne(f)}l.unMount=new Set},Z=(f,b)=>!e.disabled&&(f&&b&&oe(a,f,b),!Ze(E(),n)),$=(f,b,N)=>$s(f,l,{...o.mount?a:de(b)?n:Re(f)?{[f]:b}:b},N,b),X=f=>It(V(o.mount?a:n,f,e.shouldUnregister?V(n,f,[]):[])),J=(f,b,N={})=>{const P=V(s,f);let M=b;if(P){const A=P._f;A&&(!A.disabled&&oe(a,f,Bs(b,A)),M=Ot(A.ref)&&we(b)?"":b,Ls(A.ref)?[...A.ref.options].forEach(K=>K.selected=M.includes(K.value)):A.refs?mt(A.ref)?A.refs.forEach(K=>{(!K.defaultChecked||!K.disabled)&&(Array.isArray(M)?K.checked=!!M.find(ie=>ie===K.value):K.checked=M===K.value||!!M)}):A.refs.forEach(K=>K.checked=K.value===M):gr(A.ref)?A.ref.value="":(A.ref.value=M,A.ref.type||h.state.next({name:f,values:ye(a)})))}(N.shouldDirty||N.shouldTouch)&&F(f,M,N.shouldTouch,N.shouldDirty,!0),N.shouldValidate&&q(f)},G=(f,b,N)=>{for(const P in b){if(!b.hasOwnProperty(P))return;const M=b[P],A=`${f}.${P}`,K=V(s,A);(l.array.has(f)||fe(M)||K&&!K._f)&&!qe(M)?G(A,M,N):J(A,M,N)}},Y=(f,b,N={})=>{const P=V(s,f),M=l.array.has(f),A=ye(b);oe(a,f,A),M?(h.array.next({name:f,values:ye(a)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&N.shouldDirty&&h.state.next({name:f,dirtyFields:it(n,a),isDirty:Z(f,A)})):P&&!P._f&&!we(A)?G(f,A,N):J(f,A,N),Br(f,l)&&h.state.next({...t}),h.state.next({name:o.mount?f:void 0,values:ye(a)})},C=async f=>{o.mount=!0;const b=f.target;let N=b.name,P=!0;const M=V(s,N),A=ce=>{P=Number.isNaN(ce)||qe(ce)&&isNaN(ce.getTime())||Ze(ce,V(a,N,ce))},K=zr(e.mode),ie=zr(e.reValidateMode);if(M){let ce,Se;const xt=b.type?Pr(M._f):Cs(f),ze=f.type===Ct.BLUR||f.type===Ct.FOCUS_OUT,Cn=!so(M._f)&&!e.resolver&&!V(t.errors,N)&&!M._f.deps||oo(ze,V(t.touchedFields,N),t.isSubmitted,ie,K),zt=Br(N,l,ze);oe(a,N,xt),ze?(M._f.onBlur&&M._f.onBlur(f),c&&c(0)):M._f.onChange&&M._f.onChange(f);const Ut=F(N,xt,ze),On=!ve(Ut)||zt;if(!ze&&h.state.next({name:N,type:f.type,values:ye(a)}),Cn)return(d.isValid||p.isValid)&&(e.mode==="onBlur"?ze&&k():ze||k()),On&&h.state.next({name:N,...zt?{}:Ut});if(!ze&&zt&&h.state.next({...t}),e.resolver){const{errors:Sr}=await W([N]);if(A(xt),P){const Rn=Zr(t.errors,s,N),_r=Zr(Sr,s,Rn.name||N);ce=_r.error,N=_r.name,Se=ve(Sr)}}else S([N],!0),ce=(await qr(M,l.disabled,a,y,e.shouldUseNativeValidation))[N],S([N]),A(xt),P&&(ce?Se=!1:(d.isValid||p.isValid)&&(Se=await R(s,!0)));P&&(M._f.deps&&q(M._f.deps),B(N,Se,ce,Ut))}},m=(f,b)=>{if(V(t.errors,b)&&f.focus)return f.focus(),1},q=async(f,b={})=>{let N,P;const M=ut(f);if(e.resolver){const A=await _(de(f)?f:M);N=ve(A),P=f?!M.some(K=>V(A,K)):N}else f?(P=(await Promise.all(M.map(async A=>{const K=V(s,A);return await R(K&&K._f?{[A]:K}:K)}))).every(Boolean),!(!P&&!t.isValid)&&k()):P=N=await R(s);return h.state.next({...!Re(f)||(d.isValid||p.isValid)&&N!==t.isValid?{}:{name:f},...e.resolver||!f?{isValid:N}:{},errors:t.errors}),b.shouldFocus&&!P&&dt(s,m,f?M:l.mount),P},E=f=>{const b={...o.mount?a:n};return de(f)?b:Re(f)?V(b,f):f.map(N=>V(b,N))},j=(f,b)=>({invalid:!!V((b||t).errors,f),isDirty:!!V((b||t).dirtyFields,f),error:V((b||t).errors,f),isValidating:!!V(t.validatingFields,f),isTouched:!!V((b||t).touchedFields,f)}),O=f=>{f&&ut(f).forEach(b=>pe(t.errors,b)),h.state.next({errors:f?t.errors:{}})},I=(f,b,N)=>{const P=(V(s,f,{_f:{}})._f||{}).ref,M=V(t.errors,f)||{},{ref:A,message:K,type:ie,...ce}=M;oe(t.errors,f,{...ce,...b,ref:P}),h.state.next({name:f,errors:t.errors,isValid:!1}),N&&N.shouldFocus&&P&&P.focus&&P.focus()},ee=(f,b)=>Te(f)?h.state.subscribe({next:N=>f($(void 0,b),N)}):$(f,b,!0),se=f=>h.state.subscribe({next:b=>{ao(f.name,b.name,f.exact)&&no(b,f.formState||d,An,f.reRenderRoot)&&f.callback({values:{...a},...t,...b})}}).unsubscribe,ue=f=>(o.mount=!0,p={...p,...f.formState},se({...f,formState:p})),ne=(f,b={})=>{for(const N of f?ut(f):l.mount)l.mount.delete(N),l.array.delete(N),b.keepValue||(pe(s,N),pe(a,N)),!b.keepError&&pe(t.errors,N),!b.keepDirty&&pe(t.dirtyFields,N),!b.keepTouched&&pe(t.touchedFields,N),!b.keepIsValidating&&pe(t.validatingFields,N),!e.shouldUnregister&&!b.keepDefaultValue&&pe(n,N);h.state.next({values:ye(a)}),h.state.next({...t,...b.keepDirty?{isDirty:Z()}:{}}),!b.keepIsValid&&k()},ae=({disabled:f,name:b})=>{(Ne(f)&&o.mount||f||l.disabled.has(b))&&(f?l.disabled.add(b):l.disabled.delete(b))},me=(f,b={})=>{let N=V(s,f);const P=Ne(b.disabled)||Ne(e.disabled);return oe(s,f,{...N||{},_f:{...N&&N._f?N._f:{ref:{name:f}},name:f,mount:!0,...b}}),l.mount.add(f),N?ae({disabled:Ne(b.disabled)?b.disabled:e.disabled,name:f}):D(f,!0,b.value),{...P?{disabled:b.disabled||e.disabled}:{},...e.progressive?{required:!!b.required,min:lt(b.min),max:lt(b.max),minLength:lt(b.minLength),maxLength:lt(b.maxLength),pattern:lt(b.pattern)}:{},name:f,onChange:C,onBlur:C,ref:M=>{if(M){me(f,b),N=V(s,f);const A=de(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,K=Ja(A),ie=N._f.refs||[];if(K?ie.find(ce=>ce===A):A===N._f.ref)return;oe(s,f,{_f:{...N._f,...K?{refs:[...ie.filter(Wt),A,...Array.isArray(V(n,f))?[{}]:[]],ref:{type:A.type,name:f}}:{ref:A}}}),D(f,!1,void 0,A)}else N=V(s,f,{}),N._f&&(N._f.mount=!1),(e.shouldUnregister||b.shouldUnregister)&&!(Os(l.array,f)&&o.action)&&l.unMount.add(f)}}},ge=()=>e.shouldFocusError&&dt(s,m,l.mount),te=f=>{Ne(f)&&(h.state.next({disabled:f}),dt(s,(b,N)=>{const P=V(s,N);P&&(b.disabled=P._f.disabled||f,Array.isArray(P._f.refs)&&P._f.refs.forEach(M=>{M.disabled=P._f.disabled||f}))},0,!1))},le=(f,b)=>async N=>{let P;N&&(N.preventDefault&&N.preventDefault(),N.persist&&N.persist());let M=ye(a);if(h.state.next({isSubmitting:!0}),e.resolver){const{errors:A,values:K}=await W();t.errors=A,M=K}else await R(s);if(l.disabled.size)for(const A of l.disabled)oe(M,A,void 0);if(pe(t.errors,"root"),ve(t.errors)){h.state.next({errors:{}});try{await f(M,N)}catch(A){P=A}}else b&&await b({...t.errors},N),ge(),setTimeout(ge);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ve(t.errors)&&!P,submitCount:t.submitCount+1,errors:t.errors}),P)throw P},xe=(f,b={})=>{V(s,f)&&(de(b.defaultValue)?Y(f,ye(V(n,f))):(Y(f,b.defaultValue),oe(n,f,ye(b.defaultValue))),b.keepTouched||pe(t.touchedFields,f),b.keepDirty||(pe(t.dirtyFields,f),t.isDirty=b.defaultValue?Z(f,ye(V(n,f))):Z()),b.keepError||(pe(t.errors,f),d.isValid&&k()),h.state.next({...t}))},Me=(f,b={})=>{const N=f?ye(f):n,P=ye(N),M=ve(f),A=M?n:P;if(b.keepDefaultValues||(n=N),!b.keepValues){if(b.keepDirtyValues){const K=new Set([...l.mount,...Object.keys(it(n,a))]);for(const ie of Array.from(K))V(t.dirtyFields,ie)?oe(A,ie,V(a,ie)):Y(ie,V(A,ie))}else{if(mr&&de(f))for(const K of l.mount){const ie=V(s,K);if(ie&&ie._f){const ce=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(Ot(ce)){const Se=ce.closest("form");if(Se){Se.reset();break}}}}for(const K of l.mount)Y(K,V(A,K))}a=ye(A),h.array.next({values:{...A}}),h.state.next({values:{...A}})}l={mount:b.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!b.keepIsValid||!!b.keepDirtyValues,o.watch=!!e.shouldUnregister,h.state.next({submitCount:b.keepSubmitCount?t.submitCount:0,isDirty:M?!1:b.keepDirty?t.isDirty:!!(b.keepDefaultValues&&!Ze(f,n)),isSubmitted:b.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:M?{}:b.keepDirtyValues?b.keepDefaultValues&&a?it(n,a):t.dirtyFields:b.keepDefaultValues&&f?it(n,f):b.keepDirty?t.dirtyFields:{},touchedFields:b.keepTouched?t.touchedFields:{},errors:b.keepErrors?t.errors:{},isSubmitSuccessful:b.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},Er=(f,b)=>Me(Te(f)?f(a):f,b),Tn=(f,b={})=>{const N=V(s,f),P=N&&N._f;if(P){const M=P.refs?P.refs[0]:P.ref;M.focus&&(M.focus(),b.shouldSelect&&Te(M.select)&&M.select())}},An=f=>{t={...t,...f}},Nr={control:{register:me,unregister:ne,getFieldState:j,handleSubmit:le,setError:I,_subscribe:se,_runSchema:W,_getWatch:$,_getDirty:Z,_setValid:k,_setFieldArray:w,_setDisabledField:ae,_setErrors:T,_getFieldArray:X,_reset:Me,_resetDefaultValues:()=>Te(e.defaultValues)&&e.defaultValues().then(f=>{Er(f,e.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:Q,_disableForm:te,_subjects:h,_proxyFormState:d,get _fields(){return s},get _formValues(){return a},get _state(){return o},set _state(f){o=f},get _defaultValues(){return n},get _names(){return l},set _names(f){l=f},get _formState(){return t},get _options(){return e},set _options(f){e={...e,...f}}},subscribe:ue,trigger:q,register:me,handleSubmit:le,watch:ee,setValue:Y,getValues:E,reset:Er,resetField:xe,clearErrors:O,unregister:ne,setError:I,setFocus:Tn,getFieldState:j};return{...Nr,formControl:Nr}}function fo(r={}){const e=v.useRef(void 0),t=v.useRef(void 0),[s,n]=v.useState({isDirty:!1,isValidating:!1,isLoading:Te(r.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1,isReady:!1,defaultValues:Te(r.defaultValues)?void 0:r.defaultValues});e.current||(e.current={...r.formControl?r.formControl:uo(r),formState:s},r.formControl&&r.defaultValues&&!Te(r.defaultValues)&&r.formControl.reset(r.defaultValues,r.resetOptions));const a=e.current.control;return a._options=r,pr(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>n({...a._formState}),reRenderRoot:!0});return n(l=>({...l,isReady:!0})),a._formState.isReady=!0,o},[a]),v.useEffect(()=>a._disableForm(r.disabled),[a,r.disabled]),v.useEffect(()=>{r.mode&&(a._options.mode=r.mode),r.reValidateMode&&(a._options.reValidateMode=r.reValidateMode),r.errors&&!ve(r.errors)&&a._setErrors(r.errors)},[a,r.errors,r.mode,r.reValidateMode]),v.useEffect(()=>{r.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,r.shouldUnregister]),v.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==s.isDirty&&a._subjects.state.next({isDirty:o})}},[a,s.isDirty]),v.useEffect(()=>{r.values&&!Ze(r.values,t.current)?(a._reset(r.values,a._options.resetOptions),t.current=r.values,n(o=>({...o}))):a._resetDefaultValues()},[a,r.values]),v.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),e.current.formState=Vs(s,a),e.current}const Ws={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},mo={sm:"h-6",md:"h-10",lg:"h-12"},ho={sm:"px-2",md:"px-2.5",lg:"px-3"};function Gr(r,e,t,s,n,a,o){const l=e?"datetime-local":"date",c=L("box-border w-full rounded-lg border outline-none transition font-[var(--font-primary)]",Ws[t],mo[t],ho[t],a?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]"),p=Ga(c,n?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-disabled)] cursor-not-allowed opacity-60":"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",o);return i.jsxs(i.Fragment,{children:[i.jsx("input",{id:r,type:l,disabled:n,"aria-disabled":n,"data-disabled":n?"true":"false",...s,className:p}),i.jsx("div",{children:a!=null&&a.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:a.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function qs(r){const{control:e,name:t,rules:s,defaultValue:n,showTime:a=!1,size:o="sm",width:l="100%",label:c,labelHidden:u=!1,hasError:d=!1,errorMessage:p="",disabled:h=!1,className:y,onChange:x}=r,k=v.useId(),S=t||k;return i.jsxs("div",{className:L("flex flex-col",y),style:{width:l,maxWidth:"100%"},children:[c&&i.jsx("label",{htmlFor:S,className:L("pb-2 text-[var(--color-ds-text-primary)]",Ws[o],u&&"sr-only"),children:c}),e&&t?i.jsx(_e,{name:t,control:e,rules:s,defaultValue:n,render:({field:w,fieldState:g})=>Gr(S,a,o,{value:w.value,onChange:w.onChange,onBlur:w.onBlur},h,g.error,y)}):Gr(S,a,o,{defaultValue:n,onChange:x},h,d?{message:p}:void 0,y)]})}const po=({trigger:r,items:e,align:t="left",className:s})=>{const[n,a]=v.useState(!1),o=v.useRef(null),l=v.useRef([]);v.useEffect(()=>{const u=d=>{o.current&&!o.current.contains(d.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const c=u=>{var p,h;const d=l.current.findIndex(y=>y===document.activeElement);if(u.key==="Escape")a(!1);else if(u.key==="ArrowDown"){u.preventDefault();const y=(d+1)%e.length;(p=l.current[y])==null||p.focus()}else if(u.key==="ArrowUp"){u.preventDefault();const y=(d-1+e.length)%e.length;(h=l.current[y])==null||h.focus()}};return i.jsxs("div",{className:L("relative inline-block",s),ref:o,children:[i.jsx("button",{type:"button",onClick:()=>a(u=>!u),className:"inline-flex items-center focus:outline-none","aria-haspopup":"menu","aria-expanded":n,children:r}),n&&i.jsx("div",{role:"menu","aria-orientation":"vertical",className:L("absolute mt-2 min-w-[160px] bg-[var(--color-ds-background-page)]","border border-[var(--color-ds-border-muted)] rounded shadow-lg z-10",t==="right"?"right-0":"left-0"),onKeyDown:c,children:e.map((u,d)=>{const{label:p,onSelect:h,disabled:y,icon:x}=u;return i.jsxs("button",{role:"menuitem",type:"button",disabled:y,ref:k=>{l.current[d]=k},className:L("w-full flex items-center px-4 py-2 text-[var(--color-ds-text-primary)] text-ds-md transition-colors",y?"opacity-50 cursor-not-allowed":"hover:bg-[var(--color-ds-background-surface)]"),onClick:()=>{y||(h(),a(!1))},children:[x&&i.jsx(x,{className:"w-5 h-5 mr-2 text-[var(--color-ds-text-secondary)]"}),p]},d)})})]})},xo=(r,e,t,s)=>{var a,o,l,c;const n=[t,{code:e,...s||{}}];if((o=(a=r==null?void 0:r.services)==null?void 0:a.logger)!=null&&o.forward)return r.services.logger.forward(n,"warn","react-i18next::",!0);Ge(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),(c=(l=r==null?void 0:r.services)==null?void 0:l.logger)!=null&&c.warn?r.services.logger.warn(...n):console!=null&&console.warn&&console.warn(...n)},Yr={},rr=(r,e,t,s)=>{Ge(t)&&Yr[t]||(Ge(t)&&(Yr[t]=new Date),xo(r,e,t,s))},Gs=(r,e)=>()=>{if(r.isInitialized)e();else{const t=()=>{setTimeout(()=>{r.off("initialized",t)},0),e()};r.on("initialized",t)}},sr=(r,e,t)=>{r.loadNamespaces(e,Gs(r,t))},Hr=(r,e,t,s)=>{if(Ge(t)&&(t=[t]),r.options.preload&&r.options.preload.indexOf(e)>-1)return sr(r,t,s);t.forEach(n=>{r.options.ns.indexOf(n)<0&&r.options.ns.push(n)}),r.loadLanguages(e,Gs(r,s))},go=(r,e,t={})=>!e.languages||!e.languages.length?(rr(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(r,{lng:t.lng,precheck:(s,n)=>{var a;if(((a=t.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,r))return!1}}),Ge=r=>typeof r=="string",bo=r=>typeof r=="object"&&r!==null,yo=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,vo={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},wo=r=>vo[r],ko=r=>r.replace(yo,wo);let jo={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:ko};const Eo=()=>jo;let No;const So=()=>No,_o=v.createContext();class Fo{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const To=(r,e)=>{const t=v.useRef();return v.useEffect(()=>{t.current=r},[r,e]),t.current},Ys=(r,e,t,s)=>r.getFixedT(e,t,s),Ao=(r,e,t,s)=>v.useCallback(Ys(r,e,t,s),[r,e,t,s]),yr=(r,e={})=>{var D,F,B,W;const{i18n:t}=e,{i18n:s,defaultNS:n}=v.useContext(_o)||{},a=t||s||So();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Fo),!a){rr(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const _=(Q,Z)=>Ge(Z)?Z:bo(Z)&&Ge(Z.defaultValue)?Z.defaultValue:Array.isArray(Q)?Q[Q.length-1]:Q,R=[_,{},!1];return R.t=_,R.i18n={},R.ready=!1,R}(D=a.options.react)!=null&&D.wait&&rr(a,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...Eo(),...a.options.react,...e},{useSuspense:l,keyPrefix:c}=o;let u=n||((F=a.options)==null?void 0:F.defaultNS);u=Ge(u)?[u]:u||["translation"],(W=(B=a.reportNamespaces).addUsedNamespaces)==null||W.call(B,u);const d=(a.isInitialized||a.initializedStoreOnce)&&u.every(_=>go(_,a,o)),p=Ao(a,e.lng||null,o.nsMode==="fallback"?u:u[0],c),h=()=>p,y=()=>Ys(a,e.lng||null,o.nsMode==="fallback"?u:u[0],c),[x,k]=v.useState(h);let S=u.join();e.lng&&(S=`${e.lng}${S}`);const w=To(S),g=v.useRef(!0);v.useEffect(()=>{const{bindI18n:_,bindI18nStore:R}=o;g.current=!0,!d&&!l&&(e.lng?Hr(a,e.lng,u,()=>{g.current&&k(y)}):sr(a,u,()=>{g.current&&k(y)})),d&&w&&w!==S&&g.current&&k(y);const Q=()=>{g.current&&k(y)};return _&&(a==null||a.on(_,Q)),R&&(a==null||a.store.on(R,Q)),()=>{g.current=!1,a&&(_==null||_.split(" ").forEach(Z=>a.off(Z,Q))),R&&a&&R.split(" ").forEach(Z=>a.store.off(Z,Q))}},[a,S]),v.useEffect(()=>{g.current&&d&&k(h)},[a,c,d]);const T=[x,a,d];if(T.t=x,T.i18n=a,T.ready=d,d||!d&&!l)return T;throw new Promise(_=>{e.lng?Hr(a,e.lng,u,()=>_()):sr(a,u,()=>_())})},nr={sm:"text-sm",md:"text-base",lg:"text-lg"};function Xr(r,e,t,s,n,a,o,l,c){const{t:u}=yr(),d=v.useRef(null),p=typeof s=="number"&&e.length>=s,h=()=>{var g;!o&&!p&&((g=d.current)==null||g.click())},y=g=>{const T=g.target.files;if(!T)return;const D=Array.from(T);let F=e.concat(D);s&&(F=F.slice(0,s)),t(F),g.target.value=""},x=g=>{if(g.preventDefault(),o||p)return;const T=Array.from(g.dataTransfer.files);let D=e.concat(T);s&&(D=D.slice(0,s)),t(D)},k=g=>{g.preventDefault()},S=g=>{const T=URL.createObjectURL(g);window.open(T)},w=g=>{const T=e.filter((D,F)=>F!==g);t(T)};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"self-start mb-4 w-auto",children:i.jsx(Le,{type:"button",variant:"outline",size:a,icon:Cr,onClick:h,disabled:o||p,children:u("ds.fileUploader.browse","Browse files")})}),!p&&i.jsxs("div",{className:L("relative flex bg-[var(--color-ds-background-page)] flex-col items-center justify-center border-2 border-dashed border-[var(--color-ds-border-muted)] rounded-lg p-4",o?"opacity-50 cursor-not-allowed":"hover:border-[var(--color-ds-border-default)]",nr[a],c),onDrop:x,onDragOver:k,children:[i.jsx("input",{id:r,type:"file",ref:d,className:"hidden",multiple:s!==1,accept:n,onChange:y,disabled:o}),i.jsx(Oe,{component:Qn,size:"md",className:"w-8 h-8 text-[var(--color-ds-text-secondary)]"}),i.jsx("p",{className:"mt-3 text-[var(--color-ds-text-secondary)] text-center",children:u("ds.fileUploader.dragDrop","Drag & drop your files here or click to browse")})]}),e.length>0&&i.jsx("ul",{className:"mt-4 space-y-1",children:e.map((g,T)=>i.jsxs("li",{className:"flex items-center justify-between text-[var(--color-ds-text-secondary)] text-sm",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(Cr,{className:"w-4 h-4 mr-2","aria-hidden":"true"}),i.jsx("span",{className:"truncate pr-2",children:g.name})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Le,{variant:"ghost",size:"sm",icon:ys,ariaLabel:u("ds.fileUploader.view","View"),onClick:()=>S(g)}),i.jsx(Le,{variant:"ghost",size:"sm",icon:dr,ariaLabel:u("ds.fileUploader.remove","Remove"),onClick:()=>w(T)})]})]},T))}),i.jsx("div",{className:"pt-[5px] min-h-[18px] w-full",children:l!=null&&l.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:l.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function Hs(r){const{control:e,name:t,rules:s,defaultValue:n,maxFiles:a,accept:o,size:l="sm",width:c="100%",label:u,labelHidden:d=!1,disabled:p=!1,hasError:h=!1,errorMessage:y="",className:x}=r,k=v.useId(),S=t||k;if(e&&t)return i.jsxs("div",{className:L("flex flex-col",x),style:{width:c},children:[u&&i.jsx("label",{htmlFor:S,className:L("pb-[10px] text-[var(--color-ds-text-primary)]",nr[l],d&&"sr-only"),children:u}),i.jsx(_e,{name:t,control:e,rules:s,defaultValue:n instanceof FileList?Array.from(n):n||[],render:({field:T,fieldState:D})=>Xr(S,T.value,F=>T.onChange(F),a,o,l,p,D.error,x)})]});const[w,g]=v.useState(n instanceof FileList?Array.from(n):n||[]);return i.jsxs("div",{className:L("flex flex-col",x),style:{width:c},children:[u&&i.jsx("label",{htmlFor:S,className:L("pb-[10px] text-[var(--color-ds-text-primary)]",nr[l],d&&"sr-only"),children:u}),Xr(S,w,g,a,o,l,p,h?{message:y}:void 0,x)]})}const He=({count:r=1,width:e,height:t="1em",variant:s="rect",className:n})=>{const a=Array.from({length:r});return i.jsx(i.Fragment,{children:a.map((o,l)=>i.jsx("span",{role:"status","aria-label":"Cargando...",className:L("bg-[var(--color-ds-border-muted)] animate-pulse inline-block",s==="circle"?"rounded-full":"rounded",n),style:{width:e??"auto",height:t}},l))})},vt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},Co={sm:"h-6",md:"h-10",lg:"h-12"},Oo={sm:"px-2",md:"px-2.5",lg:"px-3"},Kr={sm:"pl-2",md:"pl-2.5",lg:"pl-3"},Ro={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function Lt({id:r,type:e="text",size:t="sm",width:s="100%",label:n,labelHidden:a=!1,hasError:o=!1,errorMessage:l="",prefixIcon:c,suffixIcon:u,separator:d,suffixButton:p,disabled:h=!1,control:y,name:x,rules:k,defaultValue:S,reserveErrorSpace:w,disableErrorPlaceholder:g,loading:T=!1,className:D,...F}){const B=v.useId(),[W,_]=v.useState(!1),R=r||B,Q=e==="password",$=c??(e==="number"?aa:void 0),X=Q?W?ra:ys:u,J=typeof w=="boolean"?w:typeof g=="boolean"?!g:!!y,G=L("box-border w-full rounded-lg border placeholder-[var(--color-ds-text-secondary)] outline-none transition font-[var(--font-primary)] appearance-none",vt[t],Co[t],Oo[t],o?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]","bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]","disabled:bg-[var(--color-ds-background-disabled)]","disabled:border-[var(--color-ds-border-muted)]","disabled:text-[var(--color-ds-text-disabled)]","disabled:cursor-not-allowed");return T?i.jsxs("div",{className:"flex flex-col",style:{width:s,maxWidth:"100%"},children:[!a&&n&&i.jsx("label",{htmlFor:R,className:L("pb-2",vt[t]),children:n}),i.jsx(He,{width:"100%",height:Ro[t],variant:"rect",className:"rounded-lg"}),i.jsx("div",{className:"min-h-[18px] w-full",children:i.jsx("span",{"aria-hidden":"true",children:" "})})]}):y&&x?i.jsx(_e,{name:x,control:y,rules:k,defaultValue:S,render:({field:Y,fieldState:C})=>i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:R,className:L("pb-2 text-[var(--color-ds-text-primary)]",vt[t]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[$&&i.jsx("div",{className:L("absolute left-0 flex items-center h-full",Kr[t]),children:i.jsx(Oe,{component:$,size:t,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...Y,id:R,type:Q?W?"text":"password":e,disabled:h,"aria-invalid":!!C.error,className:L(G,$&&"pl-9",X&&"pr-9",D),onInvalid:m=>m.preventDefault(),style:Q&&!W?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),d&&i.jsx("div",{className:"flex items-center h-full",children:d}),p&&i.jsx("div",{className:"flex items-center h-full pr-2",children:p}),X&&i.jsx("button",{type:"button",onClick:()=>_(m=>!m),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Oe,{component:X,size:t,className:"text-[var(--color-ds-text-secondary)]"})})]}),J?i.jsx("div",{className:"min-h-[18px]",children:C.error?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:C.error.message}):i.jsx("span",{"aria-hidden":"true",children:" "})}):C.error?i.jsx("div",{className:"pt-1",children:i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:C.error.message})}):null]})}):i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:R,className:L("pb-2 text-[var(--color-ds-text-primary)]",vt[t]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[$&&i.jsx("div",{className:L("absolute left-0 flex items-center h-full",Kr[t]),children:i.jsx(Oe,{component:$,size:t,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...F,id:R,type:Q?W?"text":"password":e,disabled:h,"aria-invalid":o,className:L(G,$&&"pl-9",X&&"pr-9",D),onInvalid:Y=>Y.preventDefault(),style:Q&&!W?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),d&&i.jsx("div",{className:"flex items-center h-full",children:d}),p&&i.jsx("div",{className:"flex items-center h-full",children:p}),X&&i.jsx("button",{type:"button",onClick:()=>_(Y=>!Y),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Oe,{component:X,size:t,className:"text-[var(--color-ds-text-secondary)]"})})]}),J?i.jsx("div",{className:"min-h-[18px]",children:o&&l?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:l}):i.jsx("span",{"aria-hidden":"true",children:" "})}):o&&l?i.jsx("div",{className:"pt-1",children:i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:l})}):null]})}const Mo={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},qt=400,wt=8,Xs=({children:r,size:e="sm",position:t="top",className:s})=>{const[n,a]=v.useState(!1),[o,l]=v.useState({x:0,y:0}),c=v.useRef(null),u=v.useId();v.useEffect(()=>{if(n&&c.current){const h=c.current.getBoundingClientRect();let y=0,x=0;switch(t){case"top":y=h.left+h.width/2-qt/2,x=h.top-wt;break;case"bottom":y=h.left+h.width/2-qt/2,x=h.bottom+wt;break;case"left":y=h.left-qt-wt,x=h.top+h.height/2;break;case"right":y=h.right+wt,x=h.top+h.height/2;break}l({x:y,y:x})}},[n,t]);const d=()=>typeof r=="string"?i.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):i.jsx(i.Fragment,{children:r}),p=n?i.jsx("div",{id:u,role:"tooltip",className:L("fixed z-50 w-[250px] bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)] text-ds-sm rounded p-2 shadow-lg","pointer-events-none"),style:{top:`${o.y}px`,left:`${o.x}px`,transform:t==="left"||t==="right"?"translateY(-50%)":t==="top"?"translateY(-100%)":void 0},children:d()}):null;return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button","aria-describedby":u,ref:c,className:L("inline-flex items-center justify-center focus:outline-none",Mo[e],"text-[var(--color-ds-text-secondary)] hover:text-[var(--color-ds-text-primary)]",s),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:i.jsx(ia,{className:"w-full h-full"})}),gs.createPortal(p,document.body)]})};function Vo({name:r,label:e,type:t="text",size:s="sm",width:n,placeholder:a,validation:o,loadingDefaults:l,disabled:c,info:u}){var S;const{control:d,formState:{errors:p}}=ht(),h=!!p[r],y=((S=p[r])==null?void 0:S.message)||"",x="relative",k=n??"w-full";return i.jsxs("div",{className:x,children:[i.jsx(_e,{name:r,control:d,rules:o,render:({field:w})=>i.jsx(Lt,{label:e,size:s,width:k,placeholder:a,hasError:h,errorMessage:y,loading:l,type:t,...w,disabled:c,reserveErrorSpace:!0})}),u&&i.jsx(Xs,{size:s,position:"left",className:"absolute top-1/2 right-2 -translate-y-1/2",children:u})]})}const vr=v.memo(Vo);vr.displayName="FormFieldInput";function $o({title:r,headerButtons:e,children:t,className:s}){return i.jsxs("div",{className:L("flex flex-col h-full",s),children:[i.jsxs("div",{className:"flex items-center justify-between py-4",children:[i.jsx("div",{className:`bg-[var(--color-ds-background-accent)] \r
|
|
23
23
|
text-[var(--color-ds-text-on-accent)] \r
|
|
24
24
|
rounded-tr-[20px] \r
|
|
25
25
|
pl-4 pr-10\r
|
|
26
|
-
text-ds-lg`,children:r}),e&&i.jsx("div",{className:"flex items-center space-x-2",children:e})]}),i.jsx("main",{className:"flex-1 overflow-auto",children:t})]})}const ts=(r,e,t)=>{if(r&&"reportValidity"in r){const s=V(t,e);r.setCustomValidity(s&&s.message||""),r.reportValidity()}},en=(r,e)=>{for(const t in e.fields){const s=e.fields[t];s&&s.ref&&"reportValidity"in s.ref?ts(s.ref,t,r):s&&s.refs&&s.refs.forEach(n=>ts(n,t,r))}},Lo=(r,e)=>{e.shouldUseNativeValidation&&en(r,e);const t={};for(const s in r){const n=V(e.fields,s),a=Object.assign(r[s]||{},{ref:n&&n.ref});if(Po(e.names||Object.keys(r),s)){const o=Object.assign({},V(t,s));oe(o,"root",a),oe(t,s,o)}else oe(t,s,a)}return t},Po=(r,e)=>{const t=rs(e);return r.some(s=>rs(s).match(`^${t}\\.\\d+`))};function rs(r){return r.replace(/\]|\[/g,"")}function zo(r,e,t){return t===void 0&&(t={}),function(s,n,a){try{return Promise.resolve(function(o,l){try{var c=(e!=null&&e.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(r[t.mode==="sync"?"validateSync":"validate"](s,Object.assign({abortEarly:!1},e,{context:n}))).then(function(u){return a.shouldUseNativeValidation&&en({},a),{values:t.raw?Object.assign({},s):u,errors:{}}}))}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(!o.inner)throw o;return{values:{},errors:Lo((l=o,c=!a.shouldUseNativeValidation&&a.criteriaMode==="all",(l.inner||[]).reduce(function(u,d){if(u[d.path]||(u[d.path]={message:d.message,type:d.type}),c){var p=u[d.path].types,h=p&&p[d.type];u[d.path]=zs(d.path,c,u,d.type,h?[].concat(h,d.message):d.message)}return u},{})),a)};var l,c}))}catch(o){return Promise.reject(o)}}}var Jt,ss;function Bo(){if(ss)return Jt;ss=1;function r(w){this._maxSize=w,this.clear()}r.prototype.clear=function(){this._size=0,this._values=Object.create(null)},r.prototype.get=function(w){return this._values[w]},r.prototype.set=function(w,g){return this._size>=this._maxSize&&this.clear(),w in this._values||this._size++,this._values[w]=g};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,t=/^\d+$/,s=/^\d/,n=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,o=512,l=new r(o),c=new r(o),u=new r(o);Jt={Cache:r,split:p,normalizePath:d,setter:function(w){var g=d(w);return c.get(w)||c.set(w,function($,F){for(var U=0,W=g.length,_=$;U<W-1;){var R=g[U];if(R==="__proto__"||R==="constructor"||R==="prototype")return $;_=_[g[U++]]}_[g[U]]=F})},getter:function(w,g){var T=d(w);return u.get(w)||u.set(w,function(F){for(var U=0,W=T.length;U<W;)if(F!=null||!g)F=F[T[U++]];else return;return F})},join:function(w){return w.reduce(function(g,T){return g+(y(T)||t.test(T)?"["+T+"]":(g?".":"")+T)},"")},forEach:function(w,g,T){h(Array.isArray(w)?w:p(w),g,T)}};function d(w){return l.get(w)||l.set(w,p(w).map(function(g){return g.replace(a,"$2")}))}function p(w){return w.match(e)||[""]}function h(w,g,T){var $=w.length,F,U,W,_;for(U=0;U<$;U++)F=w[U],F&&(S(F)&&(F='"'+F+'"'),_=y(F),W=!_&&/^\d+$/.test(F),g.call(T,F,_,W,U,w))}function y(w){return typeof w=="string"&&w&&["'",'"'].indexOf(w.charAt(0))!==-1}function x(w){return w.match(s)&&!w.match(t)}function k(w){return n.test(w)}function S(w){return!y(w)&&(x(w)||k(w))}return Jt}var He=Bo(),Qt,ns;function Uo(){if(ns)return Qt;ns=1;const r=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=d=>d.match(r)||[],t=d=>d[0].toUpperCase()+d.slice(1),s=(d,p)=>e(d).join(p).toLowerCase(),n=d=>e(d).reduce((p,h)=>`${p}${p?h[0].toUpperCase()+h.slice(1).toLowerCase():h.toLowerCase()}`,"");return Qt={words:e,upperFirst:t,camelCase:n,pascalCase:d=>t(n(d)),snakeCase:d=>s(d,"_"),kebabCase:d=>s(d,"-"),sentenceCase:d=>t(s(d," ")),titleCase:d=>e(d).map(t).join(" ")},Qt}var er=Uo(),Nt={exports:{}},as;function Zo(){if(as)return Nt.exports;as=1,Nt.exports=function(n){return r(e(n),n)},Nt.exports.array=r;function r(n,a){var o=n.length,l=new Array(o),c={},u=o,d=t(a),p=s(n);for(a.forEach(function(y){if(!p.has(y[0])||!p.has(y[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)c[u]||h(n[u],u,new Set);return l;function h(y,x,k){if(k.has(y)){var S;try{S=", node was:"+JSON.stringify(y)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!p.has(y))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(y));if(!c[x]){c[x]=!0;var w=d.get(y)||new Set;if(w=Array.from(w),x=w.length){k.add(y);do{var g=w[--x];h(g,p.get(g),k)}while(x);k.delete(y)}l[--o]=y}}}function e(n){for(var a=new Set,o=0,l=n.length;o<l;o++){var c=n[o];a.add(c[0]),a.add(c[1])}return Array.from(a)}function t(n){for(var a=new Map,o=0,l=n.length;o<l;o++){var c=n[o];a.has(c[0])||a.set(c[0],new Set),a.has(c[1])||a.set(c[1],new Set),a.get(c[0]).add(c[1])}return a}function s(n){for(var a=new Map,o=0,l=n.length;o<l;o++)a.set(n[o],o);return a}return Nt.exports}var Wo=Zo();const qo=Dn(Wo),Go=Object.prototype.toString,Yo=Error.prototype.toString,Ho=RegExp.prototype.toString,Xo=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Ko=/^Symbol\((.*)\)(.*)$/;function Jo(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function os(r,e=!1){if(r==null||r===!0||r===!1)return""+r;const t=typeof r;if(t==="number")return Jo(r);if(t==="string")return e?`"${r}"`:r;if(t==="function")return"[Function "+(r.name||"anonymous")+"]";if(t==="symbol")return Xo.call(r).replace(Ko,"Symbol($1)");const s=Go.call(r).slice(8,-1);return s==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):s==="Error"||r instanceof Error?"["+Yo.call(r)+"]":s==="RegExp"?Ho.call(r):null}function ze(r,e){let t=os(r,e);return t!==null?t:JSON.stringify(r,function(s,n){let a=os(this[s],e);return a!==null?a:n},2)}function tn(r){return r==null?[]:[].concat(r)}let rn,sn,nn,Qo=/\$\{\s*(\w+)\s*\}/g;rn=Symbol.toStringTag;class is{constructor(e,t,s,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[rn]="Error",this.name="ValidationError",this.value=t,this.path=s,this.type=n,this.errors=[],this.inner=[],tn(e).forEach(a=>{if(je.isError(a)){this.errors.push(...a.errors);const o=a.inner.length?a.inner:[a];this.inner.push(...o)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}sn=Symbol.hasInstance;nn=Symbol.toStringTag;class je extends Error{static formatError(e,t){const s=t.label||t.path||"this";return t=Object.assign({},t,{path:s,originalPath:t.path}),typeof e=="string"?e.replace(Qo,(n,a)=>ze(t[a])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,s,n,a){const o=new is(e,t,s,n);if(a)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[nn]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,je)}static[sn](e){return is[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Re={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:e,value:t,originalValue:s})=>{const n=s!=null&&s!==t?` (cast from the value \`${ze(s,!0)}\`).`:".";return e!=="mixed"?`${r} must be a \`${e}\` type, but the final value was: \`${ze(t,!0)}\``+n:`${r} must match the configured type. The validated value was: \`${ze(t,!0)}\``+n}},ke={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ze={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},ur={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},dr={isValue:"${path} field must be ${value}"},Ct={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Ot={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},ei={notType:r=>{const{path:e,value:t,spec:s}=r,n=s.types.length;if(Array.isArray(t)){if(t.length<n)return`${e} tuple value has too few items, expected a length of ${n} but got ${t.length} for value: \`${ze(t,!0)}\``;if(t.length>n)return`${e} tuple value has too many items, expected a length of ${n} but got ${t.length} for value: \`${ze(t,!0)}\``}return je.formatError(Re.notType,r)}};Object.assign(Object.create(null),{mixed:Re,string:ke,number:Ze,date:ur,object:Ct,array:Ot,boolean:dr,tuple:ei});const Ut=r=>r&&r.__isYupSchema__;class It{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:n,otherwise:a}=t,o=typeof s=="function"?s:(...l)=>l.every(c=>c===s);return new It(e,(l,c)=>{var u;let d=o(...l)?n:a;return(u=d==null?void 0:d(c))!=null?u:c})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let s=this.refs.map(a=>a.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),n=this.fn(s,e,t);if(n===void 0||n===e)return e;if(!Ut(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}}const St={context:"$",value:"."};class Ke{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===St.context,this.isValue=this.key[0]===St.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?St.context:this.isValue?St.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&He.getter(this.path,!0),this.map=t.map}getValue(e,t,s){let n=this.isContext?s:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Ke.prototype.__isYupRef=!0;const Ae=r=>r==null;function et(r){function e({value:t,path:s="",options:n,originalValue:a,schema:o},l,c){const{name:u,test:d,params:p,message:h,skipAbsent:y}=r;let{parent:x,context:k,abortEarly:S=o.spec.abortEarly,disableStackTrace:w=o.spec.disableStackTrace}=n;function g(Z){return Ke.isRef(Z)?Z.getValue(t,x,k):Z}function T(Z={}){const D=Object.assign({value:t,originalValue:a,label:o.spec.label,path:Z.path||s,spec:o.spec,disableStackTrace:Z.disableStackTrace||w},p,Z.params);for(const J of Object.keys(D))D[J]=g(D[J]);const H=new je(je.formatError(Z.message||h,D),t,D.path,Z.type||u,D.disableStackTrace);return H.params=D,H}const $=S?l:c;let F={path:s,parent:x,type:u,from:n.from,createError:T,resolve:g,options:n,originalValue:a,schema:o};const U=Z=>{je.isError(Z)?$(Z):Z?c(null):$(T())},W=Z=>{je.isError(Z)?$(Z):l(Z)};if(y&&Ae(t))return U(!0);let R;try{var Q;if(R=d.call(F,t,F),typeof((Q=R)==null?void 0:Q.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${F.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(R).then(U,W)}}catch(Z){W(Z);return}U(R)}return e.OPTIONS=r,e}function ti(r,e,t,s=t){let n,a,o;return e?(He.forEach(e,(l,c,u)=>{let d=c?l.slice(1,l.length-1):l;r=r.resolve({context:s,parent:n,value:t});let p=r.type==="tuple",h=u?parseInt(d,10):0;if(r.innerType||p){if(p&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(t&&h>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);n=t,t=t&&t[h],r=p?r.spec.types[h]:r.innerType}if(!u){if(!r.fields||!r.fields[d])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${r.type}")`);n=t,t=t&&t[d],r=r.fields[d]}a=d,o=c?"["+l+"]":"."+l}),{schema:r,parent:n,parentPath:a}):{parent:n,parentPath:e,schema:r}}class Lt extends Set{describe(){const e=[];for(const t of this.values())e.push(Ke.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const s of this.values())t.push(e(s));return t}clone(){return new Lt(this.values())}merge(e,t){const s=this.clone();return e.forEach(n=>s.add(n)),t.forEach(n=>s.delete(n)),s}}function rt(r,e=new Map){if(Ut(r)||!r||typeof r!="object")return r;if(e.has(r))return e.get(r);let t;if(r instanceof Date)t=new Date(r.getTime()),e.set(r,t);else if(r instanceof RegExp)t=new RegExp(r),e.set(r,t);else if(Array.isArray(r)){t=new Array(r.length),e.set(r,t);for(let s=0;s<r.length;s++)t[s]=rt(r[s],e)}else if(r instanceof Map){t=new Map,e.set(r,t);for(const[s,n]of r.entries())t.set(s,rt(n,e))}else if(r instanceof Set){t=new Set,e.set(r,t);for(const s of r)t.add(rt(s,e))}else if(r instanceof Object){t={},e.set(r,t);for(const[s,n]of Object.entries(r))t[s]=rt(n,e)}else throw Error(`Unable to clone ${r}`);return t}class Ee{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Lt,this._blacklist=new Lt,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Re.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=rt(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let s=e(this);return this._mutate=t,s}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,s=e.clone();const n=Object.assign({},t.spec,s.spec);return s.spec=n,s.internalTests=Object.assign({},t.internalTests,s.internalTests),s._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),s._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),s.tests=t.tests,s.exclusiveTests=t.exclusiveTests,s.withMutation(a=>{e.tests.forEach(o=>{a.test(o.OPTIONS)})}),s.transforms=[...t.transforms,...s.transforms],s}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let s=t.conditions;t=t.clone(),t.conditions=[],t=s.reduce((n,a)=>a.resolve(n,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,s,n,a;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(s=e.abortEarly)!=null?s:this.spec.abortEarly,recursive:(n=e.recursive)!=null?n:this.spec.recursive,disableStackTrace:(a=e.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(e,t={}){let s=this.resolve(Object.assign({value:e},t)),n=t.assert==="ignore-optionality",a=s._cast(e,t);if(t.assert!==!1&&!s.isType(a)){if(n&&Ae(a))return a;let o=ze(e),l=ze(a);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
|
|
26
|
+
text-ds-lg`,children:r}),e&&i.jsx("div",{className:"flex items-center space-x-2",children:e})]}),i.jsx("main",{className:"flex-1 overflow-auto",children:t})]})}const Jr=(r,e,t)=>{if(r&&"reportValidity"in r){const s=V(t,e);r.setCustomValidity(s&&s.message||""),r.reportValidity()}},Ks=(r,e)=>{for(const t in e.fields){const s=e.fields[t];s&&s.ref&&"reportValidity"in s.ref?Jr(s.ref,t,r):s&&s.refs&&s.refs.forEach(n=>Jr(n,t,r))}},Do=(r,e)=>{e.shouldUseNativeValidation&&Ks(r,e);const t={};for(const s in r){const n=V(e.fields,s),a=Object.assign(r[s]||{},{ref:n&&n.ref});if(Io(e.names||Object.keys(r),s)){const o=Object.assign({},V(t,s));oe(o,"root",a),oe(t,s,o)}else oe(t,s,a)}return t},Io=(r,e)=>{const t=Qr(e);return r.some(s=>Qr(s).match(`^${t}\\.\\d+`))};function Qr(r){return r.replace(/\]|\[/g,"")}function Lo(r,e,t){return t===void 0&&(t={}),function(s,n,a){try{return Promise.resolve(function(o,l){try{var c=(e!=null&&e.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(r[t.mode==="sync"?"validateSync":"validate"](s,Object.assign({abortEarly:!1},e,{context:n}))).then(function(u){return a.shouldUseNativeValidation&&Ks({},a),{values:t.raw?Object.assign({},s):u,errors:{}}}))}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(!o.inner)throw o;return{values:{},errors:Do((l=o,c=!a.shouldUseNativeValidation&&a.criteriaMode==="all",(l.inner||[]).reduce(function(u,d){if(u[d.path]||(u[d.path]={message:d.message,type:d.type}),c){var p=u[d.path].types,h=p&&p[d.type];u[d.path]=Is(d.path,c,u,d.type,h?[].concat(h,d.message):d.message)}return u},{})),a)};var l,c}))}catch(o){return Promise.reject(o)}}}var Gt,es;function Po(){if(es)return Gt;es=1;function r(w){this._maxSize=w,this.clear()}r.prototype.clear=function(){this._size=0,this._values=Object.create(null)},r.prototype.get=function(w){return this._values[w]},r.prototype.set=function(w,g){return this._size>=this._maxSize&&this.clear(),w in this._values||this._size++,this._values[w]=g};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,t=/^\d+$/,s=/^\d/,n=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,o=512,l=new r(o),c=new r(o),u=new r(o);Gt={Cache:r,split:p,normalizePath:d,setter:function(w){var g=d(w);return c.get(w)||c.set(w,function(D,F){for(var B=0,W=g.length,_=D;B<W-1;){var R=g[B];if(R==="__proto__"||R==="constructor"||R==="prototype")return D;_=_[g[B++]]}_[g[B]]=F})},getter:function(w,g){var T=d(w);return u.get(w)||u.set(w,function(F){for(var B=0,W=T.length;B<W;)if(F!=null||!g)F=F[T[B++]];else return;return F})},join:function(w){return w.reduce(function(g,T){return g+(y(T)||t.test(T)?"["+T+"]":(g?".":"")+T)},"")},forEach:function(w,g,T){h(Array.isArray(w)?w:p(w),g,T)}};function d(w){return l.get(w)||l.set(w,p(w).map(function(g){return g.replace(a,"$2")}))}function p(w){return w.match(e)||[""]}function h(w,g,T){var D=w.length,F,B,W,_;for(B=0;B<D;B++)F=w[B],F&&(S(F)&&(F='"'+F+'"'),_=y(F),W=!_&&/^\d+$/.test(F),g.call(T,F,_,W,B,w))}function y(w){return typeof w=="string"&&w&&["'",'"'].indexOf(w.charAt(0))!==-1}function x(w){return w.match(s)&&!w.match(t)}function k(w){return n.test(w)}function S(w){return!y(w)&&(x(w)||k(w))}return Gt}var Ye=Po(),Yt,ts;function zo(){if(ts)return Yt;ts=1;const r=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=d=>d.match(r)||[],t=d=>d[0].toUpperCase()+d.slice(1),s=(d,p)=>e(d).join(p).toLowerCase(),n=d=>e(d).reduce((p,h)=>`${p}${p?h[0].toUpperCase()+h.slice(1).toLowerCase():h.toLowerCase()}`,"");return Yt={words:e,upperFirst:t,camelCase:n,pascalCase:d=>t(n(d)),snakeCase:d=>s(d,"_"),kebabCase:d=>s(d,"-"),sentenceCase:d=>t(s(d," ")),titleCase:d=>e(d).map(t).join(" ")},Yt}var Ht=zo(),kt={exports:{}},rs;function Uo(){if(rs)return kt.exports;rs=1,kt.exports=function(n){return r(e(n),n)},kt.exports.array=r;function r(n,a){var o=n.length,l=new Array(o),c={},u=o,d=t(a),p=s(n);for(a.forEach(function(y){if(!p.has(y[0])||!p.has(y[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)c[u]||h(n[u],u,new Set);return l;function h(y,x,k){if(k.has(y)){var S;try{S=", node was:"+JSON.stringify(y)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!p.has(y))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(y));if(!c[x]){c[x]=!0;var w=d.get(y)||new Set;if(w=Array.from(w),x=w.length){k.add(y);do{var g=w[--x];h(g,p.get(g),k)}while(x);k.delete(y)}l[--o]=y}}}function e(n){for(var a=new Set,o=0,l=n.length;o<l;o++){var c=n[o];a.add(c[0]),a.add(c[1])}return Array.from(a)}function t(n){for(var a=new Map,o=0,l=n.length;o<l;o++){var c=n[o];a.has(c[0])||a.set(c[0],new Set),a.has(c[1])||a.set(c[1],new Set),a.get(c[0]).add(c[1])}return a}function s(n){for(var a=new Map,o=0,l=n.length;o<l;o++)a.set(n[o],o);return a}return kt.exports}var Bo=Uo();const Zo=Vn(Bo),Wo=Object.prototype.toString,qo=Error.prototype.toString,Go=RegExp.prototype.toString,Yo=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Ho=/^Symbol\((.*)\)(.*)$/;function Xo(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function ss(r,e=!1){if(r==null||r===!0||r===!1)return""+r;const t=typeof r;if(t==="number")return Xo(r);if(t==="string")return e?`"${r}"`:r;if(t==="function")return"[Function "+(r.name||"anonymous")+"]";if(t==="symbol")return Yo.call(r).replace(Ho,"Symbol($1)");const s=Wo.call(r).slice(8,-1);return s==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):s==="Error"||r instanceof Error?"["+qo.call(r)+"]":s==="RegExp"?Go.call(r):null}function Pe(r,e){let t=ss(r,e);return t!==null?t:JSON.stringify(r,function(s,n){let a=ss(this[s],e);return a!==null?a:n},2)}function Js(r){return r==null?[]:[].concat(r)}let Qs,en,tn,Ko=/\$\{\s*(\w+)\s*\}/g;Qs=Symbol.toStringTag;class ns{constructor(e,t,s,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Qs]="Error",this.name="ValidationError",this.value=t,this.path=s,this.type=n,this.errors=[],this.inner=[],Js(e).forEach(a=>{if(je.isError(a)){this.errors.push(...a.errors);const o=a.inner.length?a.inner:[a];this.inner.push(...o)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}en=Symbol.hasInstance;tn=Symbol.toStringTag;class je extends Error{static formatError(e,t){const s=t.label||t.path||"this";return t=Object.assign({},t,{path:s,originalPath:t.path}),typeof e=="string"?e.replace(Ko,(n,a)=>Pe(t[a])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,s,n,a){const o=new ns(e,t,s,n);if(a)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[tn]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,je)}static[en](e){return ns[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Ce={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:e,value:t,originalValue:s})=>{const n=s!=null&&s!==t?` (cast from the value \`${Pe(s,!0)}\`).`:".";return e!=="mixed"?`${r} must be a \`${e}\` type, but the final value was: \`${Pe(t,!0)}\``+n:`${r} must match the configured type. The validated value was: \`${Pe(t,!0)}\``+n}},ke={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Be={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},ar={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},or={isValue:"${path} field must be ${value}"},Ft={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Tt={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Jo={notType:r=>{const{path:e,value:t,spec:s}=r,n=s.types.length;if(Array.isArray(t)){if(t.length<n)return`${e} tuple value has too few items, expected a length of ${n} but got ${t.length} for value: \`${Pe(t,!0)}\``;if(t.length>n)return`${e} tuple value has too many items, expected a length of ${n} but got ${t.length} for value: \`${Pe(t,!0)}\``}return je.formatError(Ce.notType,r)}};Object.assign(Object.create(null),{mixed:Ce,string:ke,number:Be,date:ar,object:Ft,array:Tt,boolean:or,tuple:Jo});const Pt=r=>r&&r.__isYupSchema__;class Vt{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:n,otherwise:a}=t,o=typeof s=="function"?s:(...l)=>l.every(c=>c===s);return new Vt(e,(l,c)=>{var u;let d=o(...l)?n:a;return(u=d==null?void 0:d(c))!=null?u:c})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let s=this.refs.map(a=>a.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),n=this.fn(s,e,t);if(n===void 0||n===e)return e;if(!Pt(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}}const jt={context:"$",value:"."};class Xe{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===jt.context,this.isValue=this.key[0]===jt.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?jt.context:this.isValue?jt.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&Ye.getter(this.path,!0),this.map=t.map}getValue(e,t,s){let n=this.isContext?s:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Xe.prototype.__isYupRef=!0;const Ae=r=>r==null;function Qe(r){function e({value:t,path:s="",options:n,originalValue:a,schema:o},l,c){const{name:u,test:d,params:p,message:h,skipAbsent:y}=r;let{parent:x,context:k,abortEarly:S=o.spec.abortEarly,disableStackTrace:w=o.spec.disableStackTrace}=n;function g(Z){return Xe.isRef(Z)?Z.getValue(t,x,k):Z}function T(Z={}){const $=Object.assign({value:t,originalValue:a,label:o.spec.label,path:Z.path||s,spec:o.spec,disableStackTrace:Z.disableStackTrace||w},p,Z.params);for(const J of Object.keys($))$[J]=g($[J]);const X=new je(je.formatError(Z.message||h,$),t,$.path,Z.type||u,$.disableStackTrace);return X.params=$,X}const D=S?l:c;let F={path:s,parent:x,type:u,from:n.from,createError:T,resolve:g,options:n,originalValue:a,schema:o};const B=Z=>{je.isError(Z)?D(Z):Z?c(null):D(T())},W=Z=>{je.isError(Z)?D(Z):l(Z)};if(y&&Ae(t))return B(!0);let R;try{var Q;if(R=d.call(F,t,F),typeof((Q=R)==null?void 0:Q.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${F.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(R).then(B,W)}}catch(Z){W(Z);return}B(R)}return e.OPTIONS=r,e}function Qo(r,e,t,s=t){let n,a,o;return e?(Ye.forEach(e,(l,c,u)=>{let d=c?l.slice(1,l.length-1):l;r=r.resolve({context:s,parent:n,value:t});let p=r.type==="tuple",h=u?parseInt(d,10):0;if(r.innerType||p){if(p&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(t&&h>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);n=t,t=t&&t[h],r=p?r.spec.types[h]:r.innerType}if(!u){if(!r.fields||!r.fields[d])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${r.type}")`);n=t,t=t&&t[d],r=r.fields[d]}a=d,o=c?"["+l+"]":"."+l}),{schema:r,parent:n,parentPath:a}):{parent:n,parentPath:e,schema:r}}class $t extends Set{describe(){const e=[];for(const t of this.values())e.push(Xe.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const s of this.values())t.push(e(s));return t}clone(){return new $t(this.values())}merge(e,t){const s=this.clone();return e.forEach(n=>s.add(n)),t.forEach(n=>s.delete(n)),s}}function tt(r,e=new Map){if(Pt(r)||!r||typeof r!="object")return r;if(e.has(r))return e.get(r);let t;if(r instanceof Date)t=new Date(r.getTime()),e.set(r,t);else if(r instanceof RegExp)t=new RegExp(r),e.set(r,t);else if(Array.isArray(r)){t=new Array(r.length),e.set(r,t);for(let s=0;s<r.length;s++)t[s]=tt(r[s],e)}else if(r instanceof Map){t=new Map,e.set(r,t);for(const[s,n]of r.entries())t.set(s,tt(n,e))}else if(r instanceof Set){t=new Set,e.set(r,t);for(const s of r)t.add(tt(s,e))}else if(r instanceof Object){t={},e.set(r,t);for(const[s,n]of Object.entries(r))t[s]=tt(n,e)}else throw Error(`Unable to clone ${r}`);return t}class Ee{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new $t,this._blacklist=new $t,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Ce.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=tt(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let s=e(this);return this._mutate=t,s}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,s=e.clone();const n=Object.assign({},t.spec,s.spec);return s.spec=n,s.internalTests=Object.assign({},t.internalTests,s.internalTests),s._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),s._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),s.tests=t.tests,s.exclusiveTests=t.exclusiveTests,s.withMutation(a=>{e.tests.forEach(o=>{a.test(o.OPTIONS)})}),s.transforms=[...t.transforms,...s.transforms],s}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let s=t.conditions;t=t.clone(),t.conditions=[],t=s.reduce((n,a)=>a.resolve(n,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,s,n,a;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(s=e.abortEarly)!=null?s:this.spec.abortEarly,recursive:(n=e.recursive)!=null?n:this.spec.recursive,disableStackTrace:(a=e.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(e,t={}){let s=this.resolve(Object.assign({value:e},t)),n=t.assert==="ignore-optionality",a=s._cast(e,t);if(t.assert!==!1&&!s.isType(a)){if(n&&Ae(a))return a;let o=Pe(e),l=Pe(a);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
|
|
27
27
|
|
|
28
28
|
attempted value: ${o}
|
|
29
|
-
`+(l!==o?`result of cast: ${l}`:""))}return a}_cast(e,t){let s=e===void 0?e:this.transforms.reduce((n,a)=>a.call(this,n,e,this),e);return s===void 0&&(s=this.getDefault(t)),s}_validate(e,t={},s,n){let{path:a,originalValue:o=e,strict:l=this.spec.strict}=t,c=e;l||(c=this._cast(c,Object.assign({assert:!1},t)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:a,value:c,originalValue:o,options:t,tests:u},s,d=>{if(d.length)return n(d,c);this.runTests({path:a,value:c,originalValue:o,options:t,tests:this.tests},s,n)})}runTests(e,t,s){let n=!1,{tests:a,value:o,originalValue:l,path:c,options:u}=e,d=k=>{n||(n=!0,t(k,o))},p=k=>{n||(n=!0,s(k,o))},h=a.length,y=[];if(!h)return p([]);let x={value:o,originalValue:l,path:c,options:u,schema:this};for(let k=0;k<a.length;k++){const S=a[k];S(x,d,function(g){g&&(Array.isArray(g)?y.push(...g):y.push(g)),--h<=0&&p(y)})}}asNestedTest({key:e,index:t,parent:s,parentPath:n,originalParent:a,options:o}){const l=e??t;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let u=s[l];const d=Object.assign({},o,{strict:!0,parent:s,value:u,originalValue:a[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${n||""}[${c?l:`"${l}"`}]`:(n?`${n}.`:"")+e});return(p,h,y)=>this.resolve(d)._validate(u,d,h,y)}validate(e,t){var s;let n=this.resolve(Object.assign({},t,{value:e})),a=(s=t==null?void 0:t.disableStackTrace)!=null?s:n.spec.disableStackTrace;return new Promise((o,l)=>n._validate(e,t,(c,u)=>{je.isError(c)&&(c.value=u),l(c)},(c,u)=>{c.length?l(new je(c,u,void 0,void 0,a)):o(u)}))}validateSync(e,t){var s;let n=this.resolve(Object.assign({},t,{value:e})),a,o=(s=t==null?void 0:t.disableStackTrace)!=null?s:n.spec.disableStackTrace;return n._validate(e,Object.assign({},t,{sync:!0}),(l,c)=>{throw je.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new je(l,e,void 0,void 0,o);a=c}),a}isValid(e,t){return this.validate(e,t).then(()=>!0,s=>{if(je.isError(s))return!1;throw s})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(s){if(je.isError(s))return!1;throw s}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):rt(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const s=this.clone({nullable:e});return s.internalTests.nullable=et({message:t,name:"nullable",test(n){return n===null?this.schema.spec.nullable:!0}}),s}optionality(e,t){const s=this.clone({optional:e});return s.internalTests.optionality=et({message:t,name:"optionality",test(n){return n===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(e=Re.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Re.notNull){return this.nullability(!1,e)}required(e=Re.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=Re.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),n=et(t),a=t.exclusive||t.name&&s.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(s.exclusiveTests[t.name]=!!t.exclusive),s.tests=s.tests.filter(o=>!(o.OPTIONS.name===t.name&&(a||o.OPTIONS.test===n.OPTIONS.test))),s.tests.push(n),s}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let s=this.clone(),n=tn(e).map(a=>new Ke(a));return n.forEach(a=>{a.isSibling&&s.deps.push(a.key)}),s.conditions.push(typeof t=="function"?new It(n,t):It.fromOptions(n,t)),s}typeError(e){let t=this.clone();return t.internalTests.typeError=et({message:e,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=Re.oneOf){let s=this.clone();return e.forEach(n=>{s._whitelist.add(n),s._blacklist.delete(n)}),s.internalTests.whiteList=et({message:t,name:"oneOf",skipAbsent:!0,test(n){let a=this.schema._whitelist,o=a.resolveAll(this.resolve);return o.includes(n)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:o}})}}),s}notOneOf(e,t=Re.notOneOf){let s=this.clone();return e.forEach(n=>{s._blacklist.add(n),s._whitelist.delete(n)}),s.internalTests.blacklist=et({message:t,name:"notOneOf",test(n){let a=this.schema._blacklist,o=a.resolveAll(this.resolve);return o.includes(n)?this.createError({params:{values:Array.from(a).join(", "),resolved:o}}):!0}}),s}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:s,meta:n,optional:a,nullable:o}=t.spec;return{meta:n,label:s,optional:a,nullable:o,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,u,d)=>d.findIndex(p=>p.name===c.name)===u)}}}Ee.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])Ee.prototype[`${r}At`]=function(e,t,s={}){const{parent:n,parentPath:a,schema:o}=ti(this,e,t,s.context);return o[r](n&&n[a],Object.assign({},s,{parent:n,path:e}))};for(const r of["equals","is"])Ee.prototype[r]=Ee.prototype.oneOf;for(const r of["not","nope"])Ee.prototype[r]=Ee.prototype.notOneOf;const ri=()=>!0;function fr(r){return new an(r)}class an extends Ee{constructor(e){super(typeof e=="function"?{type:"mixed",check:e}:Object.assign({type:"mixed",check:ri},e))}}fr.prototype=an.prototype;function on(){return new ln}class ln extends Ee{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,t,s)=>{if(s.spec.coerce&&!s.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=dr.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(t){return Ae(t)||t===!0}})}isFalse(e=dr.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(t){return Ae(t)||t===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}}on.prototype=ln.prototype;const si=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function ni(r){const e=mr(r);if(!e)return Date.parse?Date.parse(r):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(t=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(t=0-t)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+t,e.second,e.millisecond)}function mr(r){var e,t;const s=si.exec(r);return s?{year:Ie(s[1]),month:Ie(s[2],1)-1,day:Ie(s[3],1),hour:Ie(s[4]),minute:Ie(s[5]),second:Ie(s[6]),millisecond:s[7]?Ie(s[7].substring(0,3)):0,precision:(e=(t=s[7])==null?void 0:t.length)!=null?e:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:Ie(s[10]),minuteOffset:Ie(s[11])}:null}function Ie(r,e=0){return Number(r)||e}let ai=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,oi=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,ii=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,li="^\\d{4}-\\d{2}-\\d{2}",ci="\\d{2}:\\d{2}:\\d{2}",ui="(([+-]\\d{2}(:?\\d{2})?)|Z)",di=new RegExp(`${li}T${ci}(\\.\\d+)?${ui}$`),fi=r=>Ae(r)||r===r.trim(),mi={}.toString();function tt(){return new cn}class cn extends Ee{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t,s)=>{if(!s.spec.coerce||s.isType(e)||Array.isArray(e))return e;const n=e!=null&&e.toString?e.toString():e;return n===mi?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||Re.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=ke.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(s){return s.length===this.resolve(e)}})}min(e,t=ke.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s.length>=this.resolve(e)}})}max(e,t=ke.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(s){return s.length<=this.resolve(e)}})}matches(e,t){let s=!1,n,a;return t&&(typeof t=="object"?{excludeEmptyString:s=!1,message:n,name:a}=t:n=t),this.test({name:a||"matches",message:n||ke.matches,params:{regex:e},skipAbsent:!0,test:o=>o===""&&s||o.search(e)!==-1})}email(e=ke.email){return this.matches(ai,{name:"email",message:e,excludeEmptyString:!0})}url(e=ke.url){return this.matches(oi,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=ke.uuid){return this.matches(ii,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",s,n;return e&&(typeof e=="object"?{message:t="",allowOffset:s=!1,precision:n=void 0}=e:t=e),this.matches(di,{name:"datetime",message:t||ke.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||ke.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:a=>{if(!a||s)return!0;const o=mr(a);return o?!!o.z:!1}}).test({name:"datetime_precision",message:t||ke.datetime_precision,params:{precision:n},skipAbsent:!0,test:a=>{if(!a||n==null)return!0;const o=mr(a);return o?o.precision===n:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=ke.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:fi})}lowercase(e=ke.lowercase){return this.transform(t=>Ae(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>Ae(t)||t===t.toLowerCase()})}uppercase(e=ke.uppercase){return this.transform(t=>Ae(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>Ae(t)||t===t.toUpperCase()})}}tt.prototype=cn.prototype;let hi=r=>r!=+r;function un(){return new dn}class dn extends Ee{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!hi(e)}}),this.withMutation(()=>{this.transform((e,t,s)=>{if(!s.spec.coerce)return e;let n=e;if(typeof n=="string"){if(n=n.replace(/\s/g,""),n==="")return NaN;n=+n}return s.isType(n)||n===null?n:parseFloat(n)})})}min(e,t=Ze.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(e)}})}max(e,t=Ze.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(e)}})}lessThan(e,t=Ze.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(s){return s<this.resolve(e)}})}moreThan(e,t=Ze.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(s){return s>this.resolve(e)}})}positive(e=Ze.positive){return this.moreThan(0,e)}negative(e=Ze.negative){return this.lessThan(0,e)}integer(e=Ze.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:t=>Number.isInteger(t)})}truncate(){return this.transform(e=>Ae(e)?e:e|0)}round(e){var t;let s=["ceil","floor","round","trunc"];if(e=((t=e)==null?void 0:t.toLowerCase())||"round",e==="trunc")return this.truncate();if(s.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+s.join(", "));return this.transform(n=>Ae(n)?n:Math[e](n))}}un.prototype=dn.prototype;let fn=new Date(""),pi=r=>Object.prototype.toString.call(r)==="[object Date]";function Sr(){return new bt}class bt extends Ee{constructor(){super({type:"date",check(e){return pi(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t,s)=>!s.spec.coerce||s.isType(e)||e===null?e:(e=ni(e),isNaN(e)?bt.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let s;if(Ke.isRef(e))s=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);s=n}return s}min(e,t=ur.min){let s=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n>=this.resolve(s)}})}max(e,t=ur.max){let s=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n<=this.resolve(s)}})}}bt.INVALID_DATE=fn;Sr.prototype=bt.prototype;Sr.INVALID_DATE=fn;function xi(r,e=[]){let t=[],s=new Set,n=new Set(e.map(([o,l])=>`${o}-${l}`));function a(o,l){let c=He.split(o)[0];s.add(c),n.has(`${l}-${c}`)||t.push([l,c])}for(const o of Object.keys(r)){let l=r[o];s.add(o),Ke.isRef(l)&&l.isSibling?a(l.path,o):Ut(l)&&"deps"in l&&l.deps.forEach(c=>a(c,o))}return qo.array(Array.from(s),t).reverse()}function ls(r,e){let t=1/0;return r.some((s,n)=>{var a;if((a=e.path)!=null&&a.includes(s))return t=n,!0}),t}function mn(r){return(e,t)=>ls(r,e)-ls(r,t)}const hn=(r,e,t)=>{if(typeof r!="string")return r;let s=r;try{s=JSON.parse(r)}catch{}return t.isType(s)?s:r};function Rt(r){if("fields"in r){const e={};for(const[t,s]of Object.entries(r.fields))e[t]=Rt(s);return r.setFields(e)}if(r.type==="array"){const e=r.optional();return e.innerType&&(e.innerType=Rt(e.innerType)),e}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(Rt)}):"optional"in r?r.optional():r}const gi=(r,e)=>{const t=[...He.normalizePath(e)];if(t.length===1)return t[0]in r;let s=t.pop(),n=He.getter(He.join(t),!0)(r);return!!(n&&s in n)};let cs=r=>Object.prototype.toString.call(r)==="[object Object]";function us(r,e){let t=Object.keys(r.fields);return Object.keys(e).filter(s=>t.indexOf(s)===-1)}const bi=mn([]);function pn(r){return new xn(r)}class xn extends Ee{constructor(e){super({type:"object",check(t){return cs(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=bi,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var s;let n=super._cast(e,t);if(n===void 0)return this.getDefault(t);if(!this._typeCheck(n))return n;let a=this.fields,o=(s=t.stripUnknown)!=null?s:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(n).filter(p=>!this._nodes.includes(p))),c={},u=Object.assign({},t,{parent:c,__validating:t.__validating||!1}),d=!1;for(const p of l){let h=a[p],y=p in n;if(h){let x,k=n[p];u.path=(t.path?`${t.path}.`:"")+p,h=h.resolve({value:k,context:t.context,parent:c});let S=h instanceof Ee?h.spec:void 0,w=S==null?void 0:S.strict;if(S!=null&&S.strip){d=d||p in n;continue}x=!t.__validating||!w?h.cast(n[p],u):n[p],x!==void 0&&(c[p]=x)}else y&&!o&&(c[p]=n[p]);(y!==p in c||c[p]!==n[p])&&(d=!0)}return d?c:n}_validate(e,t={},s,n){let{from:a=[],originalValue:o=e,recursive:l=this.spec.recursive}=t;t.from=[{schema:this,value:o},...a],t.__validating=!0,t.originalValue=o,super._validate(e,t,s,(c,u)=>{if(!l||!cs(u)){n(c,u);return}o=o||u;let d=[];for(let p of this._nodes){let h=this.fields[p];!h||Ke.isRef(h)||d.push(h.asNestedTest({options:t,key:p,parent:u,parentPath:t.path,originalParent:o}))}this.runTests({tests:d,value:u,originalValue:o,options:t},s,p=>{n(p.sort(this._sortErrors).concat(c),u)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),s=t.fields;for(let[n,a]of Object.entries(this.fields)){const o=s[n];s[n]=o===void 0?a:o}return t.withMutation(n=>n.setFields(s,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(s=>{var n;const a=this.fields[s];let o=e;(n=o)!=null&&n.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[s]})),t[s]=a&&"getDefault"in a?a.getDefault(o):void 0}),t}setFields(e,t){let s=this.clone();return s.fields=e,s._nodes=xi(e,t),s._sortErrors=mn(Object.keys(e)),t&&(s._excludedEdges=t),s}shape(e,t=[]){return this.clone().withMutation(s=>{let n=s._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),n=[...s._excludedEdges,...t]),s.setFields(Object.assign(s.fields,e),n)})}partial(){const e={};for(const[t,s]of Object.entries(this.fields))e[t]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(e)}deepPartial(){return Rt(this)}pick(e){const t={};for(const s of e)this.fields[s]&&(t[s]=this.fields[s]);return this.setFields(t,this._excludedEdges.filter(([s,n])=>e.includes(s)&&e.includes(n)))}omit(e){const t=[];for(const s of Object.keys(this.fields))e.includes(s)||t.push(s);return this.pick(t)}from(e,t,s){let n=He.getter(e,!0);return this.transform(a=>{if(!a)return a;let o=a;return gi(a,e)&&(o=Object.assign({},a),s||delete o[e],o[t]=n(a)),o})}json(){return this.transform(hn)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Ct.exact,test(t){if(t==null)return!0;const s=us(this.schema,t);return s.length===0||this.createError({params:{properties:s.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Ct.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:t,test(n){if(n==null)return!0;const a=us(this.schema,n);return!e||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return s.spec.noUnknown=e,s}unknown(e=!0,t=Ct.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const s={};for(const n of Object.keys(t))s[e(n)]=t[n];return s})}camelCase(){return this.transformKeys(er.camelCase)}snakeCase(){return this.transformKeys(er.snakeCase)}constantCase(){return this.transformKeys(e=>er.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),s=super.describe(e);s.fields={};for(const[a,o]of Object.entries(t.fields)){var n;let l=e;(n=l)!=null&&n.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[a]})),s.fields[a]=o.describe(l)}return s}}pn.prototype=xn.prototype;function hr(r){return new gn(r)}class gn extends Ee{constructor(e){super({type:"array",spec:{types:e},check(t){return Array.isArray(t)}}),this.innerType=void 0,this.innerType=e}_cast(e,t){const s=super._cast(e,t);if(!this._typeCheck(s)||!this.innerType)return s;let n=!1;const a=s.map((o,l)=>{const c=this.innerType.cast(o,Object.assign({},t,{path:`${t.path||""}[${l}]`}));return c!==o&&(n=!0),c});return n?a:s}_validate(e,t={},s,n){var a;let o=this.innerType,l=(a=t.recursive)!=null?a:this.spec.recursive;t.originalValue!=null&&t.originalValue,super._validate(e,t,s,(c,u)=>{var d;if(!l||!o||!this._typeCheck(u)){n(c,u);return}let p=new Array(u.length);for(let y=0;y<u.length;y++){var h;p[y]=o.asNestedTest({options:t,index:y,parent:u,parentPath:t.path,originalParent:(h=t.originalValue)!=null?h:e})}this.runTests({value:u,tests:p,originalValue:(d=t.originalValue)!=null?d:e,options:t},s,y=>n(y.concat(c),u))})}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(hn)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!Ut(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+ze(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=Ot.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(s){return s.length===this.resolve(e)}})}min(e,t){return t=t||Ot.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s.length>=this.resolve(e)}})}max(e,t){return t=t||Ot.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:t==null?[]:[].concat(t))}compact(e){let t=e?(s,n,a)=>!e(s,n,a):s=>!!s;return this.transform(s=>s!=null?s.filter(t):s)}describe(e){const t=(e?this.resolve(e):this).clone(),s=super.describe(e);if(t.innerType){var n;let a=e;(n=a)!=null&&n.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[0]})),s.innerType=t.innerType.describe(a)}return s}}hr.prototype=gn.prototype;function yi(r){return r.validation??{}}function vi(r){return!!r.multiple}function tr(r){const e=r.maxFiles;return typeof e=="number"?e:void 0}function Le(r,e){return e.required?r.required(e.requiredMessage||"Requerido"):r}function _t(r,e){var s,n,a;let t=r;return((s=e.minLength)==null?void 0:s.value)!=null&&(t=t.min(e.minLength.value,e.minLength.message||`Mín. ${e.minLength.value} caracteres`)),((n=e.maxLength)==null?void 0:n.value)!=null&&(t=t.max(e.maxLength.value,e.maxLength.message||`Máx. ${e.maxLength.value} caracteres`)),((a=e.pattern)==null?void 0:a.value)instanceof RegExp&&(t=t.matches(e.pattern.value,e.pattern.message||"Formato inválido")),t}function wi(r){var t;const e=yi(r);switch(r.type){case"text":case"password":{let s=tt().trim();return s=_t(s,e),Le(s,e)}case"email":{let s=tt().trim().email(e.emailMessage||"Email inválido");return s=_t(s,e),Le(s,e)}case"number":{let s=un().transform((n,a)=>a===""||a===null?void 0:n).typeError(e.typeError||"Debe ser un número");return((t=e.pattern)==null?void 0:t.value)instanceof RegExp&&(s=s.test("pattern-number",e.pattern.message||"Formato inválido",n=>n==null||e.pattern.value.test(String(n)))),Le(s,e)}case"select":{if(vi(r)){const n=hr().of(tt());return Le(n,e)}let s=tt().trim();return s=_t(s,e),Le(s,e)}case"checkbox":{let s=on();return e.required&&(s=s.oneOf([!0],e.requiredMessage||"Debes marcar esta casilla")),s}case"textarea":{let s=tt().trim();return s=_t(s,e),Le(s,e)}case"date":{const s=Sr().typeError(e.typeError||"Fecha inválida").transform((n,a)=>a?new Date(a):void 0);return Le(s,e)}case"file":{const s=hr().of(fr()).test("max-files",tr(r)?`Máx. ${tr(r)} fichero(s)`:"Número de ficheros inválido",n=>{const a=tr(r);return!Array.isArray(n)||!a||n.length<=a});return Le(s,e)}default:{const s=fr();return Le(s,e)}}}function ki(r){const e={};for(const t of r.fields){const s=t;s.name&&(e[s.name]=wi(s))}return pn(e)}function bn({options:r,value:e,onChange:t,children:s}){const n=v.useRef(null),[a,o]=v.useState({left:0,width:0});return v.useLayoutEffect(()=>{const l=n.current;if(!l)return;const c=()=>{const u=r.findIndex(S=>S.value===e);if(u<0)return;const d=l.children[u],p=d.querySelector("span"),h=(p==null?void 0:p.offsetWidth)??d.offsetWidth,y=d.offsetWidth,k=d.offsetLeft+(y-h)/2;o({left:k,width:h})};return c(),window.addEventListener("resize",c),l.addEventListener("scroll",c),()=>{window.removeEventListener("resize",c),l.removeEventListener("scroll",c)}},[e,r]),i.jsxs("div",{children:[i.jsxs("div",{className:"relative",children:[i.jsx("ul",{ref:n,role:"tablist",className:"flex justify-center overflow-x-auto border-b border-[var(--color-ds-border-default-50)]",children:r.map(l=>{const c=l.value===e;return i.jsx("li",{role:"tab","aria-selected":c,onClick:()=>t(l.value),className:L("cursor-pointer whitespace-nowrap px-4 py-2 transition-colors duration-150 ease-in-out",c?"text-[var(--color-ds-background-accent)]":"text-[var(--color-ds-text-primary)]"),children:i.jsx("span",{className:"inline-block",children:l.label})},l.value)})}),i.jsx("span",{className:"absolute bottom-0 h-1 bg-[var(--color-ds-background-accent)] transition-all duration-200 ease-in-out rounded-t-full",style:{left:a.left,width:a.width}})]}),i.jsx("div",{className:"mt-4 pb-4 border-b border-[var(--color-ds-border-default-50)]",children:s[e]})]})}const Ft={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},ds={sm:"h-6",md:"h-10",lg:"h-12"},fs={sm:"px-2",md:"px-2.5",lg:"px-3"},ms={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function hs({id:r,size:e,disabled:t,error:s,reserveErrorSpace:n,className:a,suffixButton:o,children:l}){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative flex items-center w-full",children:[i.jsx("div",{className:"relative w-full",children:l}),o&&i.jsx("div",{className:"flex items-center h-full pr-2",children:o})]}),n?i.jsx("div",{className:"min-h-[18px] w-full",children:s!=null&&s.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:s.message}):i.jsx("span",{"aria-hidden":"true",children:" "})}):s!=null&&s.message?i.jsx("div",{className:"pt-1",children:i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:s.message})}):null]})}function pt(r){const{control:e,name:t,rules:s,defaultValue:n,options:a=[],loadOptions:o,reloadDeps:l=[],value:c,onChange:u,size:d="sm",width:p="100%",label:h,labelHidden:y=!1,hasError:x=!1,errorMessage:k="",reserveErrorSpace:S,disableErrorPlaceholder:w,disabled:g=!1,className:T,suffixButton:$,loading:F=!1,coerceFirstValid:U=!0}=r,W=v.useId(),_=t||W,[R,Q]=v.useState(a),[Z,D]=v.useState(!!o);v.useEffect(()=>{o&&(D(!0),o().then(G=>Q(G)).finally(()=>D(!1)))},[o,...l]);const H=G=>G.find(X=>X.value!==""&&X.value!==void 0)??G[0],J=typeof S=="boolean"?S:!!e;if(e&&t){const{field:G,fieldState:X}=Ps({name:t,control:e,rules:s,defaultValue:n});return v.useEffect(()=>{if(!Z&&R.length>0&&U){const C=G.value,m=R.some(q=>String(q.value)===String(C));(C===void 0||!m)&&G.onChange(H(R).value)}},[R,Z,G,U]),i.jsxs("div",{className:L("flex flex-col",T),style:{width:p,maxWidth:"100%"},children:[h&&i.jsx("label",{htmlFor:_,className:L("pb-2 text-[var(--color-ds-text-primary)]",Ft[d],y&&"sr-only"),children:h}),F||Z?i.jsx(Xe,{width:"100%",height:ms[d],variant:"rect",className:"rounded-lg"}):i.jsx(hs,{id:_,size:d,disabled:g,error:X.error,reserveErrorSpace:typeof w=="boolean"?!w:J,className:T,suffixButton:$,children:i.jsx("select",{id:_,value:G.value,onChange:C=>G.onChange(C.target.value),disabled:g,className:L("box-border w-full rounded-lg border bg-[var(--color-ds-background-page)] outline-none transition font-[var(--font-primary)]",Ft[d],ds[d],fs[d],X.error?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",g?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-primary)] cursor-not-allowed":"text-[var(--color-ds-text-primary)]"),children:R.map(C=>i.jsx("option",{value:C.value,className:"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",children:C.label},C.value))})})]})}return v.useEffect(()=>{if(!e&&R.length>0&&U){const G=R.some(C=>String(C.value)===String(c));(c===void 0||c===""||!G)&&u&&u(H(R).value)}},[R,c,u,e,U]),i.jsxs("div",{className:L("flex flex-col",T),style:{width:p,maxWidth:"100%"},children:[h&&i.jsx("label",{htmlFor:_,className:L("pb-2 text-[var(--color-ds-text-primary)]",Ft[d],y&&"sr-only"),children:h}),F||Z?i.jsx(Xe,{width:"100%",height:ms[d],variant:"rect",className:"rounded-lg"}):i.jsx(hs,{id:_,size:d,disabled:g,error:x?{message:k}:void 0,reserveErrorSpace:typeof w=="boolean"?!w:!!(S??!1),className:T,suffixButton:$,children:i.jsx("select",{id:_,value:c,onChange:G=>u==null?void 0:u(G.target.value),disabled:g,className:L("box-border w-full rounded-lg border bg-[var(--color-ds-background-page)] outline-none transition font-[var(--font-primary)]",Ft[d],ds[d],fs[d],x?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",g?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-primary)] cursor-not-allowed":"text-[var(--color-ds-text-primary)]"),children:R.map(G=>i.jsx("option",{value:G.value,className:"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",children:G.label},G.value))})})]})}const ps={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"};function ji(r){return"options"in r||"loadOptions"in r}function yn({groupLabel:r,inputs:e=[],separator:t=i.jsx("span",{className:"px-1 select-none",children:"/"}),useSeparator:s=!0,className:n,showVisibleLabel:a=!1,size:o="sm",width:l}){const c=e.length;return i.jsxs("div",{className:L("flex flex-col",n),style:l?{width:l}:void 0,children:[i.jsx("label",{className:L("sr-only pb-2",ps[o]),children:r}),a&&i.jsx("label",{className:L("pb-2",ps[o]),children:r}),i.jsx("div",{className:"flex items-center flex-nowrap",children:e.map((u,d)=>{const{width:p,className:h,control:y,name:x,...k}=u,S=ji(u);let w="rounded-lg";!s&&c>1&&(d===0?w="rounded-l-lg rounded-r-none":d===c-1?w="rounded-r-lg rounded-l-none":w="rounded-none");const g=typeof p=="string"&&p.split(/\s+/).some(W=>W.startsWith("w-")||W.includes(":w-")),T=L("inline-flex items-center flex-shrink-0",typeof p=="string"?p:"w-40"),$=typeof p=="string"&&!g?{width:p}:void 0,F=L(h,w,p?void 0:"w-full"),U=W=>y&&x?i.jsx(_e,{name:x,control:y,render:({field:_})=>{const R=_.value;return W({...k,name:x,value:S?R===null?void 0:R??void 0:R??"",onChange:_.onChange,className:F,size:o})}}):W({...k,name:x,className:F,size:o});return i.jsxs("div",{className:T,style:$,children:[U(S?W=>i.jsx(pt,{...W,options:u.options,loadOptions:u.loadOptions}):W=>i.jsx(Bt,{...W})),s&&d<c-1&&t]},d)})})]})}const xs={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},Ei={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function vn({groupLabel:r,options:e,control:t,name:s,rules:n,defaultValue:a,multiple:o=!0,size:l="sm",vertical:c=!0,className:u,showVisibleLabel:d=!0}){return i.jsx(_e,{name:s,control:t,rules:n,defaultValue:a,render:({field:p,fieldState:h})=>{const{value:y,onChange:x}=p;h.error;const k=w=>o?Array.isArray(y)&&y.includes(w):y===w,S=w=>{if(o){const g=Array.isArray(y)?[...y]:[],T=g.indexOf(w);T>=0?g.splice(T,1):g.push(w),x(g)}else x(w)};return i.jsxs("div",{className:L("w-full",u),children:[i.jsx("label",{className:L("sr-only pb-2 text-[var(--color-ds-text-primary)]",xs[l]),children:r}),d&&i.jsx("label",{className:L("block pb-2 text-[var(--color-ds-text-primary)]",xs[l]),children:r}),i.jsx("div",{className:L(c?"flex flex-col gap-2":"flex flex-wrap gap-4"),children:e.map(w=>i.jsxs("label",{className:"inline-flex items-center space-x-2 cursor-pointer select-none",children:[i.jsx("input",{type:o?"checkbox":"radio",name:s,value:w.value,checked:k(w.value),onChange:()=>S(w.value),className:L(Ei[l],"text-[var(--color-ds-button-primary-bg)]","border-[var(--color-ds-border-default)]")}),i.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-md",children:w.label})]},w.value))})]})}})}function Ni(r){function e(o){var l,c;for(const u of Object.keys(o)){if((l=o[u])!=null&&l.types||(c=o[u])!=null&&c.message)return u;if(typeof o[u]=="object"){const d=e(o[u]);if(d)return`${u}.${d}`}}return null}const t=e(r);if(!t)return;const s=`[name="${t}"]`,n=`[name^="${t}["], [name^="${t}."]`,a=document.querySelector(s)??document.querySelector(n);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),a.focus({preventScroll:!0}))}const Si={success:"bg-green-100 border-green-500 text-green-800",error:"bg-red-100 border-red-500 text-red-800",info:"bg-blue-100 border-blue-500 text-blue-800",warning:"bg-yellow-100 border-yellow-500 text-yellow-800"},wn=({id:r,message:e,variant:t="info",duration:s=5e3,onClose:n})=>(v.useEffect(()=>{const a=setTimeout(()=>n(r),s);return()=>clearTimeout(a)},[r,s,n]),i.jsxs("div",{className:L("w-80 max-w-full border-l-4 rounded shadow-md p-4 mb-2 flex justify-between items-start",Si[t]),role:"alert","aria-live":"assertive",children:[i.jsx("span",{className:"flex-1",children:e}),i.jsx("button",{onClick:()=>n(r),className:"ml-4 text-xl font-bold leading-none focus:outline-none",children:"×"})]}));let Tt;const _i=new Uint8Array(16);function Fi(){if(!Tt&&(Tt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Tt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tt(_i)}const be=[];for(let r=0;r<256;++r)be.push((r+256).toString(16).slice(1));function Ti(r,e=0){return be[r[e+0]]+be[r[e+1]]+be[r[e+2]]+be[r[e+3]]+"-"+be[r[e+4]]+be[r[e+5]]+"-"+be[r[e+6]]+be[r[e+7]]+"-"+be[r[e+8]]+be[r[e+9]]+"-"+be[r[e+10]]+be[r[e+11]]+be[r[e+12]]+be[r[e+13]]+be[r[e+14]]+be[r[e+15]]}const Ai=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gs={randomUUID:Ai};function Ci(r,e,t){if(gs.randomUUID&&!r)return gs.randomUUID();r=r||{};const s=r.random||(r.rng||Fi)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Ti(s)}const kn=v.createContext(null),jn=()=>{const r=v.useContext(kn);if(!r)throw new Error("useToast debe usarse dentro de <ToastProvider>");return r},Oi=({children:r})=>{const[e,t]=v.useState([]),s=(a,o="info",l=5e3)=>{const c=Ci();t(u=>[...u,{id:c,message:a,variant:o,duration:l}])},n=a=>{t(o=>o.filter(l=>l.id!==a))};return i.jsxs(kn.Provider,{value:{show:s},children:[r,i.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col items-end",children:e.map(a=>i.jsx(wn,{id:a.id,message:a.message,variant:a.variant,duration:a.duration,onClose:n},a.id))})]})},Ri=r=>r.type==="inputGroup",Mi=r=>r.type==="button",Vi=r=>!Ri(r)&&!Mi(r);function $i(r){const e=Array.isArray(r)?r:[];return v.useMemo(()=>{const t={};for(const s of e)Vi(s)&&s.name&&(t[s.name]=s);return t},[e])}function Di(r=[],e=[]){if(r===e)return!0;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++){const s=r[t],n=e[t];if(s.value!==n.value||s.label!==n.label)return!1}return!0}function Ii(r){const[e,t]=v.useState({}),[s,n]=v.useState(0),a=v.useMemo(()=>r.filter(c=>(c==null?void 0:c.type)==="select"&&(c==null?void 0:c.name)&&!Array.isArray(c==null?void 0:c.options)&&typeof(c==null?void 0:c.loadOptions)=="function").map(c=>({name:c.name,load:c.loadOptions})),[r]),o=v.useMemo(()=>a.map(c=>c.name).sort().join("|"),[a]),l=v.useRef("");return v.useEffect(()=>{if(o===l.current)return;l.current=o;let c=!1;return(async()=>{a.length&&(n(d=>d+a.length),await Promise.all(a.map(async({name:d,load:p})=>{try{const h=await p();if(c)return;t(y=>{const x=y[d]??[];return Di(x,h)?y:{...y,[d]:h}})}catch{}finally{c||n(h=>Math.max(0,h-1))}})))})(),()=>{c=!0}},[o,a]),{optionsMap:e,loadingCount:s}}const Li=r=>r.type==="inputGroup",Pi=r=>r.type==="button",zi=r=>!Li(r)&&!Pi(r);function Bi(r){return typeof r=="object"&&r!==null}const Ui=r=>{const e=r.disabledWhen;if(!Bi(e))return!1;const t="watchField"in e,s="rule"in e;return t&&!s};function Zi(r,e){const t=Array.isArray(r)?r:[],s=v.useMemo(()=>t.filter(zi).filter(Ui),[t]),n=v.useMemo(()=>s.map(c=>c.disabledWhen.watchField),[s]),a=wr({control:e,...n.length>0?{name:n}:{}}),o=Array.isArray(a)?a:[],l={};return s.forEach((c,u)=>{const d=o[u];l[c.name??`__unnamed_${u}`]=d===c.disabledWhen.watchValue}),l}const bs={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},Wi={sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"};function _r({control:r,name:e,rules:t,defaultValue:s,size:n="sm",width:a="100%",label:o,labelHidden:l=!1,hasError:c=!1,errorMessage:u="",maxLength:d,showCounter:p=!1,className:h,suffixButton:y,...x}){const k=v.useId(),S=e||k,[w,g]=v.useState(s||"");if(r&&e)return i.jsx(_e,{name:e,control:r,rules:t,defaultValue:s||"",render:({field:$,fieldState:F})=>{var U;return i.jsx(_r,{...x,size:n,width:a,label:o,labelHidden:l,hasError:!!F.error,errorMessage:((U=F.error)==null?void 0:U.message)||"",maxLength:d,showCounter:p,className:h,suffixButton:y,value:$.value,onChange:$.onChange})}});v.useEffect(()=>{g(s||"")},[s]);const T=$=>{var F;d!==void 0&&$.target.value.length>d||(g($.target.value),(F=x.onChange)==null||F.call(x,$))};return i.jsxs("div",{className:L("flex flex-col",h),style:{width:a},children:[o&&i.jsx("label",{htmlFor:S,className:L("pb-2 text-[var(--color-ds-text-primary)]",bs[n],l&&"sr-only"),children:o}),i.jsxs("div",{className:"flex items-stretch gap-2",children:[i.jsx("textarea",{id:S,className:L("box-border bg-[var(--color-ds-background-page)] w-full resize vertical rounded-lg border outline-none transition font-[var(--font-primary)]",bs[n],Wi[n],c?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",x.disabled?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-secondary)] cursor-not-allowed":"text-[var(--color-ds-text-primary)]"),value:w,onChange:T,maxLength:d,...x}),y?i.jsx("div",{className:"shrink-0",children:y}):null]}),i.jsxs("div",{className:"flex justify-between pt-1 min-h-[18px]",children:[c&&u?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:u}):i.jsx("span",{"aria-hidden":"true",children:" "}),p&&d!==void 0&&i.jsxs("span",{className:"text-xs text-[var(--color-ds-text-secondary)]",children:[w.length,"/",d]})]})]})}const qi={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function En({control:r=null,name:e,rules:t,defaultValue:s=!1,label:n,labelHidden:a=!1,disabled:o=!1,size:l="sm",className:c,hasError:u=!1,errorMessage:d="",checked:p,onChange:h}){const y=L(qi[l],"text-[var(--color-ds-button-primary-bg)]","border-[var(--color-ds-border-default)]",o&&"opacity-50 cursor-not-allowed"),x=L("text-[var(--color-ds-text-primary)] text-ds-md",o&&"text-[var(--color-ds-text-secondary)]",a&&"sr-only");return r?i.jsx("div",{className:L("flex flex-col",c),children:i.jsx(_e,{name:e||"",control:r,rules:t,defaultValue:s,render:({field:k,fieldState:S})=>{const w=S.error;return i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"flex items-center space-x-2",children:[i.jsx("input",{id:e,type:"checkbox",className:y,checked:!!k.value,onChange:g=>k.onChange(g.target.checked),disabled:o}),n&&i.jsx("span",{className:x,children:n})]}),(u||w)&&((w==null?void 0:w.message)||d)&&i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:(w==null?void 0:w.message)||d})]})}})}):i.jsxs("div",{className:L("flex flex-col",c),children:[i.jsxs("label",{className:"flex items-center space-x-2",children:[i.jsx("input",{id:e,type:"checkbox",className:y,checked:!!p,onChange:k=>h==null?void 0:h(k.target.checked),disabled:o}),n&&i.jsx("span",{className:x,children:n})]}),u&&!!d&&i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:d})]})}function Nn({name:r,control:e,searchFn:t,resolveByValue:s,label:n,size:a="sm",width:o="100%",disabled:l=!1,searchMode:c="button",minChars:u=3,debounceMs:d=600}){const p=gt(),{watch:h,getValues:y,setValue:x}=p,k=wr({control:e,name:r}),[S,w]=v.useState([]),[g,T]=v.useState(!1),[$,F]=v.useState(!1),[U,W]=v.useState(""),_=v.useRef(null),R=v.useRef(null),Q=v.useRef(!1),Z=v.useRef(!1),D=v.useRef(!0),H=v.useMemo(()=>{const m=new Map;for(const q of S)m.set(String(q.value).trim(),q.label??"");return m},[S]),J=async m=>{const q=(m??"").trim();if(!q){w([]),F(!1);return}T(!0);try{const E=await t(q,{watch:h,getValues:y});w(E??[]),F(!0)}finally{T(!1)}};v.useEffect(()=>{function m(q){_.current&&!_.current.contains(q.target)&&F(!1)}if($)return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[$]),v.useEffect(()=>{if(Q.current)return;const q=(k?String(k):"").trim();if(!q){W(""),F(!1);return}const E=H.get(q);if(E){W(E),F(!1),D.current=!0;return}let j=!1;return(async()=>{if(s)try{const O=await s(q,{watch:h,getValues:y});j||(W((O==null?void 0:O.label)??q),F(!1),D.current=!0)}catch{j||(W(q),F(!1),D.current=!0)}else W(q),F(!1),D.current=!0})(),()=>{j=!0}},[k,H,s,h,y]),v.useEffect(()=>{if(c!=="debounced"||l)return;if(D.current){D.current=!1;return}if(!Z.current)return;R.current&&(window.clearTimeout(R.current),R.current=null);const m=(U||"").trim();return m.length>=u?R.current=window.setTimeout(()=>{J(m)},d):(w([]),F(!1)),()=>{R.current&&(window.clearTimeout(R.current),R.current=null)}},[U,c,u,d,l]);const G=a==="sm"?"text-ds-sm":a==="md"?"text-ds-md":"text-ds-lg",X=a==="sm"?"h-6":a==="md"?"h-10":"h-12",C=m=>{if(l)return;const q=(U||"").trim();m.key==="Enter"&&(m.preventDefault(),c==="debounced"?q.length>=u&&J(q):J(q)),m.key==="Escape"&&F(!1)};return i.jsx(_e,{name:r,control:e,render:({field:m,fieldState:q})=>{var E;return i.jsxs("div",{ref:_,className:"relative flex flex-col",style:{width:o},children:[n&&i.jsx("label",{className:`pb-2 text-[var(--color-ds-text-primary)] ${G}`,children:n}),i.jsx(Bt,{className:c==="button"?"rounded-r-none":void 0,type:"text",size:a,width:"100%",value:U,onChange:j=>{const O=j.target.value;Q.current=!0,Z.current=!0,W(O),(k?String(k):"").trim()&&x(r,"",{shouldDirty:!0})},onKeyDown:C,onBlur:()=>{Q.current=!1},disabled:l,hasError:q.invalid,errorMessage:(E=q.error)==null?void 0:E.message,onFocus:()=>{if(Q.current=!0,c==="button"&&Z.current){const j=(U||"").trim();j&&J(j)}},suffixButton:c==="button"?i.jsx(Pe,{type:"button",className:"!rounded-l-none",size:a,variant:"primary",onClick:()=>J((U||"").trim()),disabled:l,children:"Buscar"}):void 0}),g&&i.jsx("div",{className:"absolute top-14 left-0 right-0 z-10",children:i.jsx(Xe,{width:"100%",height:a==="sm"?"1.5rem":a==="md"?"2.5rem":"3rem",variant:"rect",className:"rounded-lg"})}),$&&!g&&S.length>0&&i.jsx("ul",{className:`
|
|
29
|
+
`+(l!==o?`result of cast: ${l}`:""))}return a}_cast(e,t){let s=e===void 0?e:this.transforms.reduce((n,a)=>a.call(this,n,e,this),e);return s===void 0&&(s=this.getDefault(t)),s}_validate(e,t={},s,n){let{path:a,originalValue:o=e,strict:l=this.spec.strict}=t,c=e;l||(c=this._cast(c,Object.assign({assert:!1},t)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:a,value:c,originalValue:o,options:t,tests:u},s,d=>{if(d.length)return n(d,c);this.runTests({path:a,value:c,originalValue:o,options:t,tests:this.tests},s,n)})}runTests(e,t,s){let n=!1,{tests:a,value:o,originalValue:l,path:c,options:u}=e,d=k=>{n||(n=!0,t(k,o))},p=k=>{n||(n=!0,s(k,o))},h=a.length,y=[];if(!h)return p([]);let x={value:o,originalValue:l,path:c,options:u,schema:this};for(let k=0;k<a.length;k++){const S=a[k];S(x,d,function(g){g&&(Array.isArray(g)?y.push(...g):y.push(g)),--h<=0&&p(y)})}}asNestedTest({key:e,index:t,parent:s,parentPath:n,originalParent:a,options:o}){const l=e??t;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let u=s[l];const d=Object.assign({},o,{strict:!0,parent:s,value:u,originalValue:a[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${n||""}[${c?l:`"${l}"`}]`:(n?`${n}.`:"")+e});return(p,h,y)=>this.resolve(d)._validate(u,d,h,y)}validate(e,t){var s;let n=this.resolve(Object.assign({},t,{value:e})),a=(s=t==null?void 0:t.disableStackTrace)!=null?s:n.spec.disableStackTrace;return new Promise((o,l)=>n._validate(e,t,(c,u)=>{je.isError(c)&&(c.value=u),l(c)},(c,u)=>{c.length?l(new je(c,u,void 0,void 0,a)):o(u)}))}validateSync(e,t){var s;let n=this.resolve(Object.assign({},t,{value:e})),a,o=(s=t==null?void 0:t.disableStackTrace)!=null?s:n.spec.disableStackTrace;return n._validate(e,Object.assign({},t,{sync:!0}),(l,c)=>{throw je.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new je(l,e,void 0,void 0,o);a=c}),a}isValid(e,t){return this.validate(e,t).then(()=>!0,s=>{if(je.isError(s))return!1;throw s})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(s){if(je.isError(s))return!1;throw s}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):tt(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const s=this.clone({nullable:e});return s.internalTests.nullable=Qe({message:t,name:"nullable",test(n){return n===null?this.schema.spec.nullable:!0}}),s}optionality(e,t){const s=this.clone({optional:e});return s.internalTests.optionality=Qe({message:t,name:"optionality",test(n){return n===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(e=Ce.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Ce.notNull){return this.nullability(!1,e)}required(e=Ce.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=Ce.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),n=Qe(t),a=t.exclusive||t.name&&s.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(s.exclusiveTests[t.name]=!!t.exclusive),s.tests=s.tests.filter(o=>!(o.OPTIONS.name===t.name&&(a||o.OPTIONS.test===n.OPTIONS.test))),s.tests.push(n),s}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let s=this.clone(),n=Js(e).map(a=>new Xe(a));return n.forEach(a=>{a.isSibling&&s.deps.push(a.key)}),s.conditions.push(typeof t=="function"?new Vt(n,t):Vt.fromOptions(n,t)),s}typeError(e){let t=this.clone();return t.internalTests.typeError=Qe({message:e,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=Ce.oneOf){let s=this.clone();return e.forEach(n=>{s._whitelist.add(n),s._blacklist.delete(n)}),s.internalTests.whiteList=Qe({message:t,name:"oneOf",skipAbsent:!0,test(n){let a=this.schema._whitelist,o=a.resolveAll(this.resolve);return o.includes(n)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:o}})}}),s}notOneOf(e,t=Ce.notOneOf){let s=this.clone();return e.forEach(n=>{s._blacklist.add(n),s._whitelist.delete(n)}),s.internalTests.blacklist=Qe({message:t,name:"notOneOf",test(n){let a=this.schema._blacklist,o=a.resolveAll(this.resolve);return o.includes(n)?this.createError({params:{values:Array.from(a).join(", "),resolved:o}}):!0}}),s}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:s,meta:n,optional:a,nullable:o}=t.spec;return{meta:n,label:s,optional:a,nullable:o,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,u,d)=>d.findIndex(p=>p.name===c.name)===u)}}}Ee.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])Ee.prototype[`${r}At`]=function(e,t,s={}){const{parent:n,parentPath:a,schema:o}=Qo(this,e,t,s.context);return o[r](n&&n[a],Object.assign({},s,{parent:n,path:e}))};for(const r of["equals","is"])Ee.prototype[r]=Ee.prototype.oneOf;for(const r of["not","nope"])Ee.prototype[r]=Ee.prototype.notOneOf;const ei=()=>!0;function ir(r){return new rn(r)}class rn extends Ee{constructor(e){super(typeof e=="function"?{type:"mixed",check:e}:Object.assign({type:"mixed",check:ei},e))}}ir.prototype=rn.prototype;function sn(){return new nn}class nn extends Ee{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,t,s)=>{if(s.spec.coerce&&!s.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=or.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(t){return Ae(t)||t===!0}})}isFalse(e=or.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(t){return Ae(t)||t===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}}sn.prototype=nn.prototype;const ti=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function ri(r){const e=lr(r);if(!e)return Date.parse?Date.parse(r):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(t=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(t=0-t)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+t,e.second,e.millisecond)}function lr(r){var e,t;const s=ti.exec(r);return s?{year:De(s[1]),month:De(s[2],1)-1,day:De(s[3],1),hour:De(s[4]),minute:De(s[5]),second:De(s[6]),millisecond:s[7]?De(s[7].substring(0,3)):0,precision:(e=(t=s[7])==null?void 0:t.length)!=null?e:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:De(s[10]),minuteOffset:De(s[11])}:null}function De(r,e=0){return Number(r)||e}let si=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ni=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,ai=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,oi="^\\d{4}-\\d{2}-\\d{2}",ii="\\d{2}:\\d{2}:\\d{2}",li="(([+-]\\d{2}(:?\\d{2})?)|Z)",ci=new RegExp(`${oi}T${ii}(\\.\\d+)?${li}$`),ui=r=>Ae(r)||r===r.trim(),di={}.toString();function et(){return new an}class an extends Ee{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t,s)=>{if(!s.spec.coerce||s.isType(e)||Array.isArray(e))return e;const n=e!=null&&e.toString?e.toString():e;return n===di?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||Ce.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=ke.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(s){return s.length===this.resolve(e)}})}min(e,t=ke.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s.length>=this.resolve(e)}})}max(e,t=ke.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(s){return s.length<=this.resolve(e)}})}matches(e,t){let s=!1,n,a;return t&&(typeof t=="object"?{excludeEmptyString:s=!1,message:n,name:a}=t:n=t),this.test({name:a||"matches",message:n||ke.matches,params:{regex:e},skipAbsent:!0,test:o=>o===""&&s||o.search(e)!==-1})}email(e=ke.email){return this.matches(si,{name:"email",message:e,excludeEmptyString:!0})}url(e=ke.url){return this.matches(ni,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=ke.uuid){return this.matches(ai,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",s,n;return e&&(typeof e=="object"?{message:t="",allowOffset:s=!1,precision:n=void 0}=e:t=e),this.matches(ci,{name:"datetime",message:t||ke.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||ke.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:a=>{if(!a||s)return!0;const o=lr(a);return o?!!o.z:!1}}).test({name:"datetime_precision",message:t||ke.datetime_precision,params:{precision:n},skipAbsent:!0,test:a=>{if(!a||n==null)return!0;const o=lr(a);return o?o.precision===n:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=ke.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:ui})}lowercase(e=ke.lowercase){return this.transform(t=>Ae(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>Ae(t)||t===t.toLowerCase()})}uppercase(e=ke.uppercase){return this.transform(t=>Ae(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>Ae(t)||t===t.toUpperCase()})}}et.prototype=an.prototype;let fi=r=>r!=+r;function on(){return new ln}class ln extends Ee{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!fi(e)}}),this.withMutation(()=>{this.transform((e,t,s)=>{if(!s.spec.coerce)return e;let n=e;if(typeof n=="string"){if(n=n.replace(/\s/g,""),n==="")return NaN;n=+n}return s.isType(n)||n===null?n:parseFloat(n)})})}min(e,t=Be.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(e)}})}max(e,t=Be.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(e)}})}lessThan(e,t=Be.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(s){return s<this.resolve(e)}})}moreThan(e,t=Be.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(s){return s>this.resolve(e)}})}positive(e=Be.positive){return this.moreThan(0,e)}negative(e=Be.negative){return this.lessThan(0,e)}integer(e=Be.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:t=>Number.isInteger(t)})}truncate(){return this.transform(e=>Ae(e)?e:e|0)}round(e){var t;let s=["ceil","floor","round","trunc"];if(e=((t=e)==null?void 0:t.toLowerCase())||"round",e==="trunc")return this.truncate();if(s.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+s.join(", "));return this.transform(n=>Ae(n)?n:Math[e](n))}}on.prototype=ln.prototype;let cn=new Date(""),mi=r=>Object.prototype.toString.call(r)==="[object Date]";function wr(){return new pt}class pt extends Ee{constructor(){super({type:"date",check(e){return mi(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t,s)=>!s.spec.coerce||s.isType(e)||e===null?e:(e=ri(e),isNaN(e)?pt.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let s;if(Xe.isRef(e))s=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);s=n}return s}min(e,t=ar.min){let s=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n>=this.resolve(s)}})}max(e,t=ar.max){let s=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n<=this.resolve(s)}})}}pt.INVALID_DATE=cn;wr.prototype=pt.prototype;wr.INVALID_DATE=cn;function hi(r,e=[]){let t=[],s=new Set,n=new Set(e.map(([o,l])=>`${o}-${l}`));function a(o,l){let c=Ye.split(o)[0];s.add(c),n.has(`${l}-${c}`)||t.push([l,c])}for(const o of Object.keys(r)){let l=r[o];s.add(o),Xe.isRef(l)&&l.isSibling?a(l.path,o):Pt(l)&&"deps"in l&&l.deps.forEach(c=>a(c,o))}return Zo.array(Array.from(s),t).reverse()}function as(r,e){let t=1/0;return r.some((s,n)=>{var a;if((a=e.path)!=null&&a.includes(s))return t=n,!0}),t}function un(r){return(e,t)=>as(r,e)-as(r,t)}const dn=(r,e,t)=>{if(typeof r!="string")return r;let s=r;try{s=JSON.parse(r)}catch{}return t.isType(s)?s:r};function At(r){if("fields"in r){const e={};for(const[t,s]of Object.entries(r.fields))e[t]=At(s);return r.setFields(e)}if(r.type==="array"){const e=r.optional();return e.innerType&&(e.innerType=At(e.innerType)),e}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(At)}):"optional"in r?r.optional():r}const pi=(r,e)=>{const t=[...Ye.normalizePath(e)];if(t.length===1)return t[0]in r;let s=t.pop(),n=Ye.getter(Ye.join(t),!0)(r);return!!(n&&s in n)};let os=r=>Object.prototype.toString.call(r)==="[object Object]";function is(r,e){let t=Object.keys(r.fields);return Object.keys(e).filter(s=>t.indexOf(s)===-1)}const xi=un([]);function fn(r){return new mn(r)}class mn extends Ee{constructor(e){super({type:"object",check(t){return os(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=xi,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var s;let n=super._cast(e,t);if(n===void 0)return this.getDefault(t);if(!this._typeCheck(n))return n;let a=this.fields,o=(s=t.stripUnknown)!=null?s:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(n).filter(p=>!this._nodes.includes(p))),c={},u=Object.assign({},t,{parent:c,__validating:t.__validating||!1}),d=!1;for(const p of l){let h=a[p],y=p in n;if(h){let x,k=n[p];u.path=(t.path?`${t.path}.`:"")+p,h=h.resolve({value:k,context:t.context,parent:c});let S=h instanceof Ee?h.spec:void 0,w=S==null?void 0:S.strict;if(S!=null&&S.strip){d=d||p in n;continue}x=!t.__validating||!w?h.cast(n[p],u):n[p],x!==void 0&&(c[p]=x)}else y&&!o&&(c[p]=n[p]);(y!==p in c||c[p]!==n[p])&&(d=!0)}return d?c:n}_validate(e,t={},s,n){let{from:a=[],originalValue:o=e,recursive:l=this.spec.recursive}=t;t.from=[{schema:this,value:o},...a],t.__validating=!0,t.originalValue=o,super._validate(e,t,s,(c,u)=>{if(!l||!os(u)){n(c,u);return}o=o||u;let d=[];for(let p of this._nodes){let h=this.fields[p];!h||Xe.isRef(h)||d.push(h.asNestedTest({options:t,key:p,parent:u,parentPath:t.path,originalParent:o}))}this.runTests({tests:d,value:u,originalValue:o,options:t},s,p=>{n(p.sort(this._sortErrors).concat(c),u)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),s=t.fields;for(let[n,a]of Object.entries(this.fields)){const o=s[n];s[n]=o===void 0?a:o}return t.withMutation(n=>n.setFields(s,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(s=>{var n;const a=this.fields[s];let o=e;(n=o)!=null&&n.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[s]})),t[s]=a&&"getDefault"in a?a.getDefault(o):void 0}),t}setFields(e,t){let s=this.clone();return s.fields=e,s._nodes=hi(e,t),s._sortErrors=un(Object.keys(e)),t&&(s._excludedEdges=t),s}shape(e,t=[]){return this.clone().withMutation(s=>{let n=s._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),n=[...s._excludedEdges,...t]),s.setFields(Object.assign(s.fields,e),n)})}partial(){const e={};for(const[t,s]of Object.entries(this.fields))e[t]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(e)}deepPartial(){return At(this)}pick(e){const t={};for(const s of e)this.fields[s]&&(t[s]=this.fields[s]);return this.setFields(t,this._excludedEdges.filter(([s,n])=>e.includes(s)&&e.includes(n)))}omit(e){const t=[];for(const s of Object.keys(this.fields))e.includes(s)||t.push(s);return this.pick(t)}from(e,t,s){let n=Ye.getter(e,!0);return this.transform(a=>{if(!a)return a;let o=a;return pi(a,e)&&(o=Object.assign({},a),s||delete o[e],o[t]=n(a)),o})}json(){return this.transform(dn)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Ft.exact,test(t){if(t==null)return!0;const s=is(this.schema,t);return s.length===0||this.createError({params:{properties:s.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Ft.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:t,test(n){if(n==null)return!0;const a=is(this.schema,n);return!e||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return s.spec.noUnknown=e,s}unknown(e=!0,t=Ft.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const s={};for(const n of Object.keys(t))s[e(n)]=t[n];return s})}camelCase(){return this.transformKeys(Ht.camelCase)}snakeCase(){return this.transformKeys(Ht.snakeCase)}constantCase(){return this.transformKeys(e=>Ht.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),s=super.describe(e);s.fields={};for(const[a,o]of Object.entries(t.fields)){var n;let l=e;(n=l)!=null&&n.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[a]})),s.fields[a]=o.describe(l)}return s}}fn.prototype=mn.prototype;function cr(r){return new hn(r)}class hn extends Ee{constructor(e){super({type:"array",spec:{types:e},check(t){return Array.isArray(t)}}),this.innerType=void 0,this.innerType=e}_cast(e,t){const s=super._cast(e,t);if(!this._typeCheck(s)||!this.innerType)return s;let n=!1;const a=s.map((o,l)=>{const c=this.innerType.cast(o,Object.assign({},t,{path:`${t.path||""}[${l}]`}));return c!==o&&(n=!0),c});return n?a:s}_validate(e,t={},s,n){var a;let o=this.innerType,l=(a=t.recursive)!=null?a:this.spec.recursive;t.originalValue!=null&&t.originalValue,super._validate(e,t,s,(c,u)=>{var d;if(!l||!o||!this._typeCheck(u)){n(c,u);return}let p=new Array(u.length);for(let y=0;y<u.length;y++){var h;p[y]=o.asNestedTest({options:t,index:y,parent:u,parentPath:t.path,originalParent:(h=t.originalValue)!=null?h:e})}this.runTests({value:u,tests:p,originalValue:(d=t.originalValue)!=null?d:e,options:t},s,y=>n(y.concat(c),u))})}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(dn)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!Pt(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Pe(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=Tt.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(s){return s.length===this.resolve(e)}})}min(e,t){return t=t||Tt.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s.length>=this.resolve(e)}})}max(e,t){return t=t||Tt.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:t==null?[]:[].concat(t))}compact(e){let t=e?(s,n,a)=>!e(s,n,a):s=>!!s;return this.transform(s=>s!=null?s.filter(t):s)}describe(e){const t=(e?this.resolve(e):this).clone(),s=super.describe(e);if(t.innerType){var n;let a=e;(n=a)!=null&&n.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[0]})),s.innerType=t.innerType.describe(a)}return s}}cr.prototype=hn.prototype;function gi(r){return r.validation??{}}function bi(r){return!!r.multiple}function Xt(r){const e=r.maxFiles;return typeof e=="number"?e:void 0}function Ie(r,e){return e.required?r.required(e.requiredMessage||"Requerido"):r}function Et(r,e){var s,n,a;let t=r;return((s=e.minLength)==null?void 0:s.value)!=null&&(t=t.min(e.minLength.value,e.minLength.message||`Mín. ${e.minLength.value} caracteres`)),((n=e.maxLength)==null?void 0:n.value)!=null&&(t=t.max(e.maxLength.value,e.maxLength.message||`Máx. ${e.maxLength.value} caracteres`)),((a=e.pattern)==null?void 0:a.value)instanceof RegExp&&(t=t.matches(e.pattern.value,e.pattern.message||"Formato inválido")),t}function yi(r){var t;const e=gi(r);switch(r.type){case"text":case"password":{let s=et().trim();return s=Et(s,e),Ie(s,e)}case"email":{let s=et().trim().email(e.emailMessage||"Email inválido");return s=Et(s,e),Ie(s,e)}case"number":{let s=on().transform((n,a)=>a===""||a===null?void 0:n).typeError(e.typeError||"Debe ser un número");return((t=e.pattern)==null?void 0:t.value)instanceof RegExp&&(s=s.test("pattern-number",e.pattern.message||"Formato inválido",n=>n==null||e.pattern.value.test(String(n)))),Ie(s,e)}case"select":{if(bi(r)){const n=cr().of(et());return Ie(n,e)}let s=et().trim();return s=Et(s,e),Ie(s,e)}case"checkbox":{let s=sn();return e.required&&(s=s.oneOf([!0],e.requiredMessage||"Debes marcar esta casilla")),s}case"textarea":{let s=et().trim();return s=Et(s,e),Ie(s,e)}case"date":{const s=wr().typeError(e.typeError||"Fecha inválida").transform((n,a)=>a?new Date(a):void 0);return Ie(s,e)}case"file":{const s=cr().of(ir()).test("max-files",Xt(r)?`Máx. ${Xt(r)} fichero(s)`:"Número de ficheros inválido",n=>{const a=Xt(r);return!Array.isArray(n)||!a||n.length<=a});return Ie(s,e)}default:{const s=ir();return Ie(s,e)}}}function vi(r){const e={};for(const t of r.fields){const s=t;s.name&&(e[s.name]=yi(s))}return fn(e)}function pn({options:r,value:e,onChange:t,children:s}){const n=v.useRef(null),[a,o]=v.useState({left:0,width:0});return v.useLayoutEffect(()=>{const l=n.current;if(!l)return;const c=()=>{const u=r.findIndex(S=>S.value===e);if(u<0)return;const d=l.children[u],p=d.querySelector("span"),h=(p==null?void 0:p.offsetWidth)??d.offsetWidth,y=d.offsetWidth,k=d.offsetLeft+(y-h)/2;o({left:k,width:h})};return c(),window.addEventListener("resize",c),l.addEventListener("scroll",c),()=>{window.removeEventListener("resize",c),l.removeEventListener("scroll",c)}},[e,r]),i.jsxs("div",{children:[i.jsxs("div",{className:"relative",children:[i.jsx("ul",{ref:n,role:"tablist",className:"flex justify-center overflow-x-auto border-b border-[var(--color-ds-border-default-50)]",children:r.map(l=>{const c=l.value===e;return i.jsx("li",{role:"tab","aria-selected":c,onClick:()=>t(l.value),className:L("cursor-pointer whitespace-nowrap px-4 py-2 transition-colors duration-150 ease-in-out",c?"text-[var(--color-ds-background-accent)]":"text-[var(--color-ds-text-primary)]"),children:i.jsx("span",{className:"inline-block",children:l.label})},l.value)})}),i.jsx("span",{className:"absolute bottom-0 h-1 bg-[var(--color-ds-background-accent)] transition-all duration-200 ease-in-out rounded-t-full",style:{left:a.left,width:a.width}})]}),i.jsx("div",{className:"mt-4 pb-4 border-b border-[var(--color-ds-border-default-50)]",children:s[e]})]})}const Nt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},ls={sm:"h-6",md:"h-10",lg:"h-12"},cs={sm:"px-2",md:"px-2.5",lg:"px-3"},us={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function ds({id:r,size:e,disabled:t,error:s,reserveErrorSpace:n,className:a,suffixButton:o,children:l}){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative flex items-center w-full",children:[i.jsx("div",{className:"relative w-full",children:l}),o&&i.jsx("div",{className:"flex items-center h-full pr-2",children:o})]}),n?i.jsx("div",{className:"min-h-[18px] w-full",children:s!=null&&s.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:s.message}):i.jsx("span",{"aria-hidden":"true",children:" "})}):s!=null&&s.message?i.jsx("div",{className:"pt-1",children:i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:s.message})}):null]})}function ft(r){const{control:e,name:t,rules:s,defaultValue:n,options:a=[],loadOptions:o,reloadDeps:l=[],value:c,onChange:u,size:d="sm",width:p="100%",label:h,labelHidden:y=!1,hasError:x=!1,errorMessage:k="",reserveErrorSpace:S,disableErrorPlaceholder:w,disabled:g=!1,className:T,suffixButton:D,loading:F=!1,coerceFirstValid:B=!0}=r,W=v.useId(),_=t||W,[R,Q]=v.useState(a),[Z,$]=v.useState(!!o);v.useEffect(()=>{o&&($(!0),o().then(G=>Q(G)).finally(()=>$(!1)))},[o,...l]);const X=G=>G.find(Y=>Y.value!==""&&Y.value!==void 0)??G[0],J=typeof S=="boolean"?S:!!e;if(e&&t){const{field:G,fieldState:Y}=Ds({name:t,control:e,rules:s,defaultValue:n});return v.useEffect(()=>{if(!Z&&R.length>0&&B){const C=G.value,m=R.some(q=>String(q.value)===String(C));(C===void 0||!m)&&G.onChange(X(R).value)}},[R,Z,G,B]),i.jsxs("div",{className:L("flex flex-col",T),style:{width:p,maxWidth:"100%"},children:[h&&i.jsx("label",{htmlFor:_,className:L("pb-2 text-[var(--color-ds-text-primary)]",Nt[d],y&&"sr-only"),children:h}),F||Z?i.jsx(He,{width:"100%",height:us[d],variant:"rect",className:"rounded-lg"}):i.jsx(ds,{id:_,size:d,disabled:g,error:Y.error,reserveErrorSpace:typeof w=="boolean"?!w:J,className:T,suffixButton:D,children:i.jsx("select",{id:_,value:G.value,onChange:C=>G.onChange(C.target.value),disabled:g,className:L("box-border w-full rounded-lg border bg-[var(--color-ds-background-page)] outline-none transition font-[var(--font-primary)]",Nt[d],ls[d],cs[d],Y.error?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",g?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-primary)] cursor-not-allowed":"text-[var(--color-ds-text-primary)]"),children:R.map(C=>i.jsx("option",{value:C.value,className:"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",children:C.label},C.value))})})]})}return v.useEffect(()=>{if(!e&&R.length>0&&B){const G=R.some(C=>String(C.value)===String(c));(c===void 0||c===""||!G)&&u&&u(X(R).value)}},[R,c,u,e,B]),i.jsxs("div",{className:L("flex flex-col",T),style:{width:p,maxWidth:"100%"},children:[h&&i.jsx("label",{htmlFor:_,className:L("pb-2 text-[var(--color-ds-text-primary)]",Nt[d],y&&"sr-only"),children:h}),F||Z?i.jsx(He,{width:"100%",height:us[d],variant:"rect",className:"rounded-lg"}):i.jsx(ds,{id:_,size:d,disabled:g,error:x?{message:k}:void 0,reserveErrorSpace:typeof w=="boolean"?!w:!!(S??!1),className:T,suffixButton:D,children:i.jsx("select",{id:_,value:c,onChange:G=>u==null?void 0:u(G.target.value),disabled:g,className:L("box-border w-full rounded-lg border bg-[var(--color-ds-background-page)] outline-none transition font-[var(--font-primary)]",Nt[d],ls[d],cs[d],x?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",g?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-primary)] cursor-not-allowed":"text-[var(--color-ds-text-primary)]"),children:R.map(G=>i.jsx("option",{value:G.value,className:"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",children:G.label},G.value))})})]})}const fs={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},wi={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function xn({groupLabel:r,options:e,control:t,name:s,rules:n,defaultValue:a,multiple:o=!0,size:l="sm",vertical:c=!0,className:u,showVisibleLabel:d=!0}){return i.jsx(_e,{name:s,control:t,rules:n,defaultValue:a,render:({field:p,fieldState:h})=>{const{value:y,onChange:x}=p;h.error;const k=w=>o?Array.isArray(y)&&y.includes(w):y===w,S=w=>{if(o){const g=Array.isArray(y)?[...y]:[],T=g.indexOf(w);T>=0?g.splice(T,1):g.push(w),x(g)}else x(w)};return i.jsxs("div",{className:L("w-full",u),children:[i.jsx("label",{className:L("sr-only pb-2 text-[var(--color-ds-text-primary)]",fs[l]),children:r}),d&&i.jsx("label",{className:L("block pb-2 text-[var(--color-ds-text-primary)]",fs[l]),children:r}),i.jsx("div",{className:L(c?"flex flex-col gap-2":"flex flex-wrap gap-4"),children:e.map(w=>i.jsxs("label",{className:"inline-flex items-center space-x-2 cursor-pointer select-none",children:[i.jsx("input",{type:o?"checkbox":"radio",name:s,value:w.value,checked:k(w.value),onChange:()=>S(w.value),className:L(wi[l],"text-[var(--color-ds-button-primary-bg)]","border-[var(--color-ds-border-default)]")}),i.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-md",children:w.label})]},w.value))})]})}})}function ki(r){function e(o){var l,c;for(const u of Object.keys(o)){if((l=o[u])!=null&&l.types||(c=o[u])!=null&&c.message)return u;if(typeof o[u]=="object"){const d=e(o[u]);if(d)return`${u}.${d}`}}return null}const t=e(r);if(!t)return;const s=`[name="${t}"]`,n=`[name^="${t}["], [name^="${t}."]`,a=document.querySelector(s)??document.querySelector(n);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),a.focus({preventScroll:!0}))}const ji={success:"bg-green-100 border-green-500 text-green-800",error:"bg-red-100 border-red-500 text-red-800",info:"bg-blue-100 border-blue-500 text-blue-800",warning:"bg-yellow-100 border-yellow-500 text-yellow-800"},gn=({id:r,message:e,variant:t="info",duration:s=5e3,onClose:n})=>(v.useEffect(()=>{const a=setTimeout(()=>n(r),s);return()=>clearTimeout(a)},[r,s,n]),i.jsxs("div",{className:L("w-80 max-w-full border-l-4 rounded shadow-md p-4 mb-2 flex justify-between items-start",ji[t]),role:"alert","aria-live":"assertive",children:[i.jsx("span",{className:"flex-1",children:e}),i.jsx("button",{onClick:()=>n(r),className:"ml-4 text-xl font-bold leading-none focus:outline-none",children:"×"})]}));let St;const Ei=new Uint8Array(16);function Ni(){if(!St&&(St=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!St))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return St(Ei)}const be=[];for(let r=0;r<256;++r)be.push((r+256).toString(16).slice(1));function Si(r,e=0){return be[r[e+0]]+be[r[e+1]]+be[r[e+2]]+be[r[e+3]]+"-"+be[r[e+4]]+be[r[e+5]]+"-"+be[r[e+6]]+be[r[e+7]]+"-"+be[r[e+8]]+be[r[e+9]]+"-"+be[r[e+10]]+be[r[e+11]]+be[r[e+12]]+be[r[e+13]]+be[r[e+14]]+be[r[e+15]]}const _i=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ms={randomUUID:_i};function Fi(r,e,t){if(ms.randomUUID&&!r)return ms.randomUUID();r=r||{};const s=r.random||(r.rng||Ni)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Si(s)}const bn=v.createContext(null),yn=()=>{const r=v.useContext(bn);if(!r)throw new Error("useToast debe usarse dentro de <ToastProvider>");return r},Ti=({children:r})=>{const[e,t]=v.useState([]),s=(a,o="info",l=5e3)=>{const c=Fi();t(u=>[...u,{id:c,message:a,variant:o,duration:l}])},n=a=>{t(o=>o.filter(l=>l.id!==a))};return i.jsxs(bn.Provider,{value:{show:s},children:[r,i.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col items-end",children:e.map(a=>i.jsx(gn,{id:a.id,message:a.message,variant:a.variant,duration:a.duration,onClose:n},a.id))})]})},Ai=r=>r.type==="inputGroup",Ci=r=>r.type==="button",Oi=r=>!Ai(r)&&!Ci(r);function Ri(r){const e=Array.isArray(r)?r:[];return v.useMemo(()=>{const t={};for(const s of e)Oi(s)&&s.name&&(t[s.name]=s);return t},[e])}function Mi(r=[],e=[]){if(r===e)return!0;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++){const s=r[t],n=e[t];if(s.value!==n.value||s.label!==n.label)return!1}return!0}function Vi(r){const[e,t]=v.useState({}),[s,n]=v.useState(0),a=v.useMemo(()=>r.filter(c=>(c==null?void 0:c.type)==="select"&&(c==null?void 0:c.name)&&!Array.isArray(c==null?void 0:c.options)&&typeof(c==null?void 0:c.loadOptions)=="function").map(c=>({name:c.name,load:c.loadOptions})),[r]),o=v.useMemo(()=>a.map(c=>c.name).sort().join("|"),[a]),l=v.useRef("");return v.useEffect(()=>{if(o===l.current)return;l.current=o;let c=!1;return(async()=>{a.length&&(n(d=>d+a.length),await Promise.all(a.map(async({name:d,load:p})=>{try{const h=await p();if(c)return;t(y=>{const x=y[d]??[];return Mi(x,h)?y:{...y,[d]:h}})}catch{}finally{c||n(h=>Math.max(0,h-1))}})))})(),()=>{c=!0}},[o,a]),{optionsMap:e,loadingCount:s}}const $i=r=>r.type==="inputGroup",Di=r=>r.type==="button",Ii=r=>!$i(r)&&!Di(r);function Li(r){return typeof r=="object"&&r!==null}const Pi=r=>{const e=r.disabledWhen;if(!Li(e))return!1;const t="watchField"in e,s="rule"in e;return t&&!s};function zi(r,e){const t=Array.isArray(r)?r:[],s=v.useMemo(()=>t.filter(Ii).filter(Pi),[t]),n=v.useMemo(()=>s.map(c=>c.disabledWhen.watchField),[s]),a=xr({control:e,...n.length>0?{name:n}:{}}),o=Array.isArray(a)?a:[],l={};return s.forEach((c,u)=>{const d=o[u];l[c.name??`__unnamed_${u}`]=d===c.disabledWhen.watchValue}),l}const hs={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},Ui={sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"};function kr({control:r,name:e,rules:t,defaultValue:s,size:n="sm",width:a="100%",label:o,labelHidden:l=!1,hasError:c=!1,errorMessage:u="",maxLength:d,showCounter:p=!1,className:h,suffixButton:y,...x}){const k=v.useId(),S=e||k,[w,g]=v.useState(s||"");if(r&&e)return i.jsx(_e,{name:e,control:r,rules:t,defaultValue:s||"",render:({field:D,fieldState:F})=>{var B;return i.jsx(kr,{...x,size:n,width:a,label:o,labelHidden:l,hasError:!!F.error,errorMessage:((B=F.error)==null?void 0:B.message)||"",maxLength:d,showCounter:p,className:h,suffixButton:y,value:D.value,onChange:D.onChange})}});v.useEffect(()=>{g(s||"")},[s]);const T=D=>{var F;d!==void 0&&D.target.value.length>d||(g(D.target.value),(F=x.onChange)==null||F.call(x,D))};return i.jsxs("div",{className:L("flex flex-col",h),style:{width:a},children:[o&&i.jsx("label",{htmlFor:S,className:L("pb-2 text-[var(--color-ds-text-primary)]",hs[n],l&&"sr-only"),children:o}),i.jsxs("div",{className:"flex items-stretch gap-2",children:[i.jsx("textarea",{id:S,className:L("box-border bg-[var(--color-ds-background-page)] w-full resize vertical rounded-lg border outline-none transition font-[var(--font-primary)]",hs[n],Ui[n],c?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",x.disabled?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-secondary)] cursor-not-allowed":"text-[var(--color-ds-text-primary)]"),value:w,onChange:T,maxLength:d,...x}),y?i.jsx("div",{className:"shrink-0",children:y}):null]}),i.jsxs("div",{className:"flex justify-between pt-1 min-h-[18px]",children:[c&&u?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:u}):i.jsx("span",{"aria-hidden":"true",children:" "}),p&&d!==void 0&&i.jsxs("span",{className:"text-xs text-[var(--color-ds-text-secondary)]",children:[w.length,"/",d]})]})]})}const Bi={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function vn({control:r=null,name:e,rules:t,defaultValue:s=!1,label:n,labelHidden:a=!1,disabled:o=!1,size:l="sm",className:c,hasError:u=!1,errorMessage:d="",checked:p,onChange:h}){const y=L(Bi[l],"text-[var(--color-ds-button-primary-bg)]","border-[var(--color-ds-border-default)]",o&&"opacity-50 cursor-not-allowed"),x=L("text-[var(--color-ds-text-primary)] text-ds-md",o&&"text-[var(--color-ds-text-secondary)]",a&&"sr-only");return r?i.jsx("div",{className:L("flex flex-col",c),children:i.jsx(_e,{name:e||"",control:r,rules:t,defaultValue:s,render:({field:k,fieldState:S})=>{const w=S.error;return i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"flex items-center space-x-2",children:[i.jsx("input",{id:e,type:"checkbox",className:y,checked:!!k.value,onChange:g=>k.onChange(g.target.checked),disabled:o}),n&&i.jsx("span",{className:x,children:n})]}),(u||w)&&((w==null?void 0:w.message)||d)&&i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:(w==null?void 0:w.message)||d})]})}})}):i.jsxs("div",{className:L("flex flex-col",c),children:[i.jsxs("label",{className:"flex items-center space-x-2",children:[i.jsx("input",{id:e,type:"checkbox",className:y,checked:!!p,onChange:k=>h==null?void 0:h(k.target.checked),disabled:o}),n&&i.jsx("span",{className:x,children:n})]}),u&&!!d&&i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:d})]})}function wn({name:r,control:e,searchFn:t,resolveByValue:s,label:n,size:a="sm",width:o="100%",disabled:l=!1,searchMode:c="button",minChars:u=3,debounceMs:d=600}){const p=ht(),{watch:h,getValues:y,setValue:x}=p,k=xr({control:e,name:r}),[S,w]=v.useState([]),[g,T]=v.useState(!1),[D,F]=v.useState(!1),[B,W]=v.useState(""),_=v.useRef(null),R=v.useRef(null),Q=v.useRef(!1),Z=v.useRef(!1),$=v.useRef(!0),X=v.useMemo(()=>{const m=new Map;for(const q of S)m.set(String(q.value).trim(),q.label??"");return m},[S]),J=async m=>{const q=(m??"").trim();if(!q){w([]),F(!1);return}T(!0);try{const E=await t(q,{watch:h,getValues:y});w(E??[]),F(!0)}finally{T(!1)}};v.useEffect(()=>{function m(q){_.current&&!_.current.contains(q.target)&&F(!1)}if(D)return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[D]),v.useEffect(()=>{if(Q.current)return;const q=(k?String(k):"").trim();if(!q){W(""),F(!1);return}const E=X.get(q);if(E){W(E),F(!1),$.current=!0;return}let j=!1;return(async()=>{if(s)try{const O=await s(q,{watch:h,getValues:y});j||(W((O==null?void 0:O.label)??q),F(!1),$.current=!0)}catch{j||(W(q),F(!1),$.current=!0)}else W(q),F(!1),$.current=!0})(),()=>{j=!0}},[k,X,s,h,y]),v.useEffect(()=>{if(c!=="debounced"||l)return;if($.current){$.current=!1;return}if(!Z.current)return;R.current&&(window.clearTimeout(R.current),R.current=null);const m=(B||"").trim();return m.length>=u?R.current=window.setTimeout(()=>{J(m)},d):(w([]),F(!1)),()=>{R.current&&(window.clearTimeout(R.current),R.current=null)}},[B,c,u,d,l]);const G=a==="sm"?"text-ds-sm":a==="md"?"text-ds-md":"text-ds-lg",Y=a==="sm"?"h-6":a==="md"?"h-10":"h-12",C=m=>{if(l)return;const q=(B||"").trim();m.key==="Enter"&&(m.preventDefault(),c==="debounced"?q.length>=u&&J(q):J(q)),m.key==="Escape"&&F(!1)};return i.jsx(_e,{name:r,control:e,render:({field:m,fieldState:q})=>{var E;return i.jsxs("div",{ref:_,className:"relative flex flex-col",style:{width:o},children:[n&&i.jsx("label",{className:`pb-2 text-[var(--color-ds-text-primary)] ${G}`,children:n}),i.jsx(Lt,{className:c==="button"?"rounded-r-none":void 0,type:"text",size:a,width:"100%",value:B,onChange:j=>{const O=j.target.value;Q.current=!0,Z.current=!0,W(O),(k?String(k):"").trim()&&x(r,"",{shouldDirty:!0})},onKeyDown:C,onBlur:()=>{Q.current=!1},disabled:l,hasError:q.invalid,errorMessage:(E=q.error)==null?void 0:E.message,onFocus:()=>{if(Q.current=!0,c==="button"&&Z.current){const j=(B||"").trim();j&&J(j)}},suffixButton:c==="button"?i.jsx(Le,{type:"button",className:"!rounded-l-none",size:a,variant:"primary",onClick:()=>J((B||"").trim()),disabled:l,children:"Buscar"}):void 0}),g&&i.jsx("div",{className:"absolute top-14 left-0 right-0 z-10",children:i.jsx(He,{width:"100%",height:a==="sm"?"1.5rem":a==="md"?"2.5rem":"3rem",variant:"rect",className:"rounded-lg"})}),D&&!g&&S.length>0&&i.jsx("ul",{className:`
|
|
30
30
|
absolute top-14 left-0 right-0
|
|
31
31
|
border-[var(--color-ds-border-default)]
|
|
32
32
|
rounded-lg bg-[var(--color-ds-background-page)]
|
|
33
33
|
shadow-lg ${G} max-h-48 overflow-auto z-10
|
|
34
|
-
`,children:S.map(j=>i.jsx("li",{className:`px-2 ${
|
|
34
|
+
`,children:S.map(j=>i.jsx("li",{className:`px-2 ${Y} flex items-center cursor-pointer
|
|
35
35
|
text-[var(--color-ds-text-primary)]
|
|
36
|
-
hover:bg-[var(--color-ds-background-surface)]`,onClick:()=>{const O=String(j.value).trim();x(r,O,{shouldDirty:!0,shouldValidate:!0}),W(j.label??O),Q.current=!1,Z.current=!1,F(!1)},children:j.label},String(j.value)))})]})}})}const ft=(r,e)=>r[e],ys=r=>r instanceof Date?r.getTime():r;function Gi(r,e,t){const s=ys(r),n=ys(e);return typeof s=="number"&&typeof n=="number"||typeof s=="string"&&typeof n=="string"?t==="gt"?s>n:t==="gte"?s>=n:t==="lt"?s<n:s<=n:!1}function Pt(r,e){if(!r)return!1;switch(r.op){case"eq":return ft(e,r.field)===r.value;case"neq":return ft(e,r.field)!==r.value;case"in":return r.values.includes(ft(e,r.field));case"notIn":return!r.values.includes(ft(e,r.field));case"gt":case"gte":case"lt":case"lte":return Gi(ft(e,r.field),r.value,r.op);case"and":return r.rules.every(t=>Pt(t,e));case"or":return r.rules.some(t=>Pt(t,e));default:return!1}}const Yi=r=>r.type!=="inputGroup"&&r.type!=="button";function Hi({schema:r,resolver:e}){const{layout:t,fields:s,onSubmit:n,successMessage:a,errorMessage:o,footerButtons:l,defaultValues:c,loadDefaultValues:u,validationSchema:d}=r,{show:p}=jn(),{t:h}=Er(),y=v.useMemo(()=>{if(e)return e;try{const C=d??ki(r);return zo(C)}catch{return}},[e,r,d]),x=ho({resolver:y,mode:"onBlur",reValidateMode:"onChange",defaultValues:c??{}}),{control:k,reset:S,handleSubmit:w,formState:{errors:g,isSubmitting:T}}=x,[$,F]=v.useState(!1);v.useEffect(()=>{u&&(F(!0),u().then(C=>S(C)).finally(()=>F(!1)))},[u,S]);const U=v.useMemo(()=>(s??[]).filter(Yi),[s]),{loadingCount:W,optionsMap:_}=Ii(U),R=$i(s),Q=Zi(s,k),Z=v.useMemo(()=>{const C={};return t.forEach((m,q)=>{m.type==="tabs"&&(C[q]=m.tabs[0].key)}),C},[t]),[D,H]=v.useState(Z),J=v.useCallback((C,m)=>{if(!(C!=null&&C.enabled)||!C.rule)return m;try{return!!Pt(C.rule,x.getValues())}catch{return m}},[x]),G=v.useMemo(()=>s.map(C=>C).filter(C=>{var m;return((m=C.clearWhen)==null?void 0:m.enabled)&&C.clearWhen.rule}).map(C=>({name:C.name,rule:C.clearWhen.rule,clearTo:C.clearWhen.clearTo})),[s]);v.useEffect(()=>{if(!G.length)return;const C=q=>{G.forEach(({name:E,rule:j,clearTo:O})=>{try{if(!!Pt(j,q)){const ee=O??"";q[E]!==ee&&x.setValue(E,ee,{shouldDirty:!0,shouldValidate:!0})}}catch{}})};C(x.getValues());const m=x.watch(()=>C(x.getValues()));return()=>{var q;return(q=m==null?void 0:m.unsubscribe)==null?void 0:q.call(m)}},[x,G]);const X=v.useCallback(C=>{var ne,ae,he,ge;let m;if(typeof C=="string"){if(m=R[C],!m)return null}else m=C;const q=m.visibleWhen;if(!J(q,!0))return null;let j=!!m.disabled;const O=m.disabledWhen,I=J(O,!1);if(O!=null&&O.enabled&&(j=I),!(O!=null&&O.enabled)&&"name"in m&&m.name&&Q[m.name]&&(j=!0),m.type==="search"){const re=Ce=>m.searchFn(Ce,{getValues:x.getValues,watch:x.watch}),ue={};return m.searchMode&&(ue.searchMode=m.searchMode),m.minChars&&(ue.minChars=m.minChars),m.debounceMs&&(ue.debounceMs=m.debounceMs),m.resolveByValue&&(ue.resolveByValue=m.resolveByValue),i.jsx(Nn,{name:m.name,control:k,searchFn:re,label:m.label,size:m.size,width:m.width,disabled:j||T,...ue},m.name)}if(m.type==="inputGroup"){const re=m,ue=re.inputs.map(Ce=>{var ot;const de=typeof Ce=="string"?R[Ce]:Ce;if(!de)return null;const Oe=de.disabledWhen;let at=!!de.disabled;const Zt=J(Oe,!1);Oe!=null&&Oe.enabled&&(at=Zt),!(Oe!=null&&Oe.enabled)&&Q[de.name]&&(at=!0);const Wt={name:de.name,control:k,label:de.label,size:de.size,width:de.width,placeholder:de.placeholder,hasError:!!g[de.name],errorMessage:((ot=g[de.name])==null?void 0:ot.message)||"",loading:$,disabled:at,suffixButton:de.suffixButton,reserveErrorSpace:!0};return de.type==="select"?{...Wt,options:de.options??_[de.name]??[],loadOptions:de.options?void 0:de.loadOptions}:{...Wt,type:de.type}}).filter(Boolean);return i.jsx(yn,{groupLabel:re.groupLabel,inputs:ue,separator:re.separator,useSeparator:re.useSeparator,className:re.className,showVisibleLabel:re.showVisibleLabel,size:re.size},`inputGroup_${re.groupLabel}`)}if(m.type==="button"){const re=m;return i.jsx("div",{className:"self-center",children:i.jsx(Pe,{type:"button",variant:re.variant,size:re.size,width:re.width,icon:re.icon,iconPosition:re.iconPosition,ariaLabel:re.ariaLabel,onClick:re.onClick,disabled:j||T,children:re.label})},re.name)}const ee=m.suffixButton,se=typeof ee=="string"?X(ee):ee,ce={name:m.name,control:k,disabled:j||T,label:m.label,size:m.size,width:m.width,placeholder:m.placeholder,info:m.info,suffixButton:se};switch(m.type){case"select":return i.jsx(_e,{name:m.name,control:k,render:({field:re})=>{var ue;return i.jsx(pt,{...ce,value:re.value,onChange:re.onChange,options:m.options??_[m.name]??[],loadOptions:m.options?void 0:m.loadOptions,hasError:!!g[m.name],errorMessage:(ue=g[m.name])==null?void 0:ue.message,suffixButton:se})}},m.name);case"textarea":return i.jsx(_e,{name:m.name,control:k,render:({field:re,fieldState:ue})=>{var Ce;return i.jsx(_r,{...ce,value:re.value,onChange:re.onChange,maxLength:m.maxLength,showCounter:!!m.showCounter,hasError:!!ue.error,errorMessage:((Ce=ue.error)==null?void 0:Ce.message)||""})}},m.name);case"file":return i.jsx(Js,{...ce,defaultValue:[],maxFiles:m.maxFiles,accept:m.accept,hasError:!!g[m.name],errorMessage:(ne=g[m.name])==null?void 0:ne.message},m.name);case"checkbox":return i.jsx(En,{...ce,defaultValue:!1,hasError:!!g[m.name],errorMessage:(ae=g[m.name])==null?void 0:ae.message,name:m.name},m.name);case"date":return i.jsx(Hs,{...ce,defaultValue:"",showTime:!!m.showTime,hasError:!!g[m.name],errorMessage:(he=g[m.name])==null?void 0:he.message},m.name);case"optionGroup":return i.jsx(vn,{...ce,options:m.options||[],multiple:m.multiple,vertical:m.vertical,groupLabel:m.groupLabel,defaultValue:m.defaultValue,className:m.width?void 0:"w-full",name:m.name},m.name);default:return i.jsx(Nr,{...ce,type:m.type,loadingDefaults:$,hasError:!!g[m.name],errorMessage:(ge=g[m.name])==null?void 0:ge.message,suffixButton:se,name:m.name},m.name)}},[R,k,g,T,$,_,J,Q,x.getValues,x.watch]);return i.jsx(Ja,{...x,children:i.jsxs("form",{noValidate:!0,onSubmit:w(async C=>{await n(C),p(a??h("ds.form.saveSuccess"),"success")},C=>{console.log("❌ errores de validación:",C),Ni(C),p(o??h("ds.form.saveError"),"error")}),className:"space-y-6",children:[t.map((C,m)=>C.type==="rows"?i.jsx(v.Fragment,{children:C.sections.map((q,E)=>i.jsx("div",{className:"mb-6",children:i.jsx(rr,{title:q.sectionTitle,defaultOpen:q.defaultOpen,children:q.rows.map((j,O)=>i.jsxs("div",{children:[j.title&&i.jsx("h2",{className:"mb-2 text-lg text-[var(--color-ds-text-primary)]",children:j.title}),i.jsx("div",{className:"flex flex-wrap -mx-2",children:j.columns.map((I,ee)=>{var se;return i.jsx("div",{className:`${I.width} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:I.fields?I.fields.map(ce=>X(ce)):(se=I.rows)==null?void 0:se.map((ce,ne)=>i.jsx("div",{className:"mb-1",children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:ce.columns.map((ae,he)=>{var ge;return i.jsx("div",{className:`${ae.width} px-2`,children:(ge=ae.fields)==null?void 0:ge.map(re=>X(re))},he)})})},ne))})},ee)})})]},O))})},E))},m):i.jsx(bn,{options:C.tabs.map(q=>({label:q.label,value:q.key})),value:D[m],onChange:q=>H(E=>({...E,[m]:q})),children:Object.fromEntries(C.tabs.map(q=>[q.key,i.jsx("div",{className:"space-y-6",children:q.sections.map((E,j)=>i.jsx("div",{className:"mb-6",children:i.jsx(rr,{title:E.sectionTitle,defaultOpen:E.defaultOpen,children:E.rows.map((O,I)=>i.jsx("div",{children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:O.columns.map((ee,se)=>{var ce;return i.jsx("div",{className:`${ee.width??"flex-1"} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:(ce=ee.fields)==null?void 0:ce.map((ne,ae)=>i.jsx(v.Fragment,{children:X(ne)},ae))})},se)})})},I))})},j))},q.key)]))},m)),i.jsx("footer",{className:"py-4 w-full flex justify-center space-x-4",children:l??i.jsx(Pe,{type:"submit",variant:"primary",icon:Yn,size:"sm",disabled:T||$||W>0,children:h(T?"ds.form.sending":"ds.form.submit")})})]})})}const Xi={sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"};function Sn({icon:r,size:e="md",ariaLabel:t,disabled:s=!1,onClick:n,...a}){return i.jsx("button",{type:"button","aria-label":t,disabled:s,onClick:n,className:L("inline-flex items-center justify-center","rounded-full","bg-transparent","text-[var(--color-ds-text-primary)]","transition-transform","focus:outline-none",Xi[e],s?"opacity-50 cursor-not-allowed":["hover:scale-110","hover:animate-pulse"]),...a,children:i.jsx(r,{className:L(e==="sm"?"h-4 w-4":e==="md"?"h-5 w-5":"h-6 w-6")})})}function _n({dark:r,onToggle:e}){return i.jsx("button",{type:"button","aria-pressed":r,"aria-label":r?"Cambiar a modo claro":"Cambiar a modo oscuro",onClick:e,className:L("relative inline-flex items-center transition-colors focus:outline-none duration-200 ease-in-out","bg-[var(--color-ds-background-accent)]","h-6 w-12 rounded-full"),children:i.jsxs("div",{className:L("absolute bg-[var(--color-ds-background-page)] flex items-center justify-center rounded-full transition-transform duration-200 ease-in-out","h-5 w-5",r?"translate-x-6":"translate-x-1"),children:[i.jsx(Me,{component:ma,size:"sm",className:L("absolute transition-opacity duration-200 ease-in-out",r?"opacity-0":"opacity-100 text-[var(--color-ds-background-accent)]")}),i.jsx(Me,{component:da,size:"sm",className:L("absolute transition-opacity duration-200 ease-in-out",r?"opacity-100 text-[var(--color-ds-background-accent)]":"opacity-0")})]})})}const Fn=v.createContext({theme:"light",toggle:()=>{}});function Ki({children:r}){const[e,t]=v.useState(!1),[s,n]=v.useState("light");v.useEffect(()=>{if(typeof window>"u")return;const o=localStorage.getItem("ds-theme");o==="light"||o==="dark"?n(o):window.matchMedia("(prefers-color-scheme: dark)").matches&&n("dark"),t(!0)},[]),v.useEffect(()=>{e&&(document.documentElement.classList.toggle("dark",s==="dark"),s==="dark"?localStorage.setItem("ds-theme","dark"):localStorage.removeItem("ds-theme"))},[s,e]);const a=()=>n(o=>o==="light"?"dark":"light");return e?i.jsx(Fn.Provider,{value:{theme:s,toggle:a},children:r}):null}const Tn=()=>v.useContext(Fn),An=({pinnedPages:r,onRemovePinned:e,onBack:t,dark:s,locale:n,languageOptions:a,onChangeLocale:o,profile:l,profileOptions:c,onChangeProfile:u})=>{const d=r.slice(0,3),{toggle:p}=Tn(),{t:h,i18n:y}=Er(),x=k=>{o(k)};return i.jsxs("header",{className:"flex items-center bg-[var(--color-ds-background-page)] py-2",children:[i.jsx("div",{className:"flex items-center space-x-2",children:d.map(k=>i.jsxs("div",{className:"flex items-center",children:[i.jsx("a",{href:k.href,className:L("inline-flex items-center rounded-lg","py-1 px-1 my-1 text-ds-sm","bg-transparent text-[var(--color-ds-text-primary)]","transition-colors duration-200 ease-in-out","hover:bg-[var(--color-ds-border-muted)] hover:animate-pulse"),children:k.label}),i.jsx(Sn,{icon:xr,size:"sm",ariaLabel:`${h("remove")} ${k.label}`,onClick:()=>e(k.id)})]},k.id))}),i.jsx("div",{className:"flex-grow"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(pt,{size:"sm",width:"auto",options:a,value:n,onChange:x,disableErrorPlaceholder:!0}),i.jsx(pt,{size:"sm",width:"auto",options:c,value:l,onChange:u,disableErrorPlaceholder:!0}),i.jsx(_n,{dark:s,onToggle:p})]})]})},Ji=({loading:r=!1,ariaLabel:e="Cargando..."})=>r?i.jsxs("div",{className:`\r
|
|
36
|
+
hover:bg-[var(--color-ds-background-surface)]`,onClick:()=>{const O=String(j.value).trim();x(r,O,{shouldDirty:!0,shouldValidate:!0}),W(j.label??O),Q.current=!1,Z.current=!1,F(!1)},children:j.label},String(j.value)))})]})}})}const ct=(r,e)=>r[e],ps=r=>r instanceof Date?r.getTime():r;function Zi(r,e,t){const s=ps(r),n=ps(e);return typeof s=="number"&&typeof n=="number"||typeof s=="string"&&typeof n=="string"?t==="gt"?s>n:t==="gte"?s>=n:t==="lt"?s<n:s<=n:!1}function Dt(r,e){if(!r)return!1;switch(r.op){case"eq":return ct(e,r.field)===r.value;case"neq":return ct(e,r.field)!==r.value;case"in":return r.values.includes(ct(e,r.field));case"notIn":return!r.values.includes(ct(e,r.field));case"gt":case"gte":case"lt":case"lte":return Zi(ct(e,r.field),r.value,r.op);case"and":return r.rules.every(t=>Dt(t,e));case"or":return r.rules.some(t=>Dt(t,e));default:return!1}}const Wi=r=>r.type!=="inputGroup"&&r.type!=="button";function qi({schema:r,resolver:e}){const{layout:t,fields:s,onSubmit:n,successMessage:a,errorMessage:o,footerButtons:l,defaultValues:c,loadDefaultValues:u,validationSchema:d}=r,{show:p}=yn(),{t:h}=yr(),y=v.useMemo(()=>{if(e)return e;try{const C=d??vi(r);return Lo(C)}catch{return}},[e,r,d]),x=fo({resolver:y,mode:"onBlur",reValidateMode:"onChange",defaultValues:c??{}}),{control:k,reset:S,handleSubmit:w,formState:{errors:g,isSubmitting:T}}=x,[D,F]=v.useState(!1);v.useEffect(()=>{u&&(F(!0),u().then(C=>S(C)).finally(()=>F(!1)))},[u,S]);const B=v.useMemo(()=>(s??[]).filter(Wi),[s]),{loadingCount:W,optionsMap:_}=Vi(B),R=Ri(s),Q=zi(s,k),Z=v.useMemo(()=>{const C={};return t.forEach((m,q)=>{m.type==="tabs"&&(C[q]=m.tabs[0].key)}),C},[t]),[$,X]=v.useState(Z),J=v.useCallback((C,m)=>{if(!(C!=null&&C.enabled)||!C.rule)return m;try{return!!Dt(C.rule,x.getValues())}catch{return m}},[x]),G=v.useMemo(()=>(s??[]).map(C=>C).filter(C=>{var m;return((m=C.clearWhen)==null?void 0:m.enabled)&&C.clearWhen.rule}).map(C=>({name:C.name,rule:C.clearWhen.rule,clearTo:C.clearWhen.clearTo})),[s]);v.useEffect(()=>{if(!G.length)return;const C=q=>{G.forEach(({name:E,rule:j,clearTo:O})=>{try{if(!!Dt(j,q)){const ee=O??"";q[E]!==ee&&x.setValue(E,ee,{shouldDirty:!0,shouldValidate:!0})}}catch{}})};C(x.getValues());const m=x.watch(()=>C(x.getValues()));return()=>{var q;return(q=m==null?void 0:m.unsubscribe)==null?void 0:q.call(m)}},[x,G]);const Y=v.useCallback(C=>{var ne,ae,me,ge;let m;if(typeof C=="string"){if(m=R[C],!m){const te=(s??[]).find(le=>(le==null?void 0:le.name)===C);if(te)m=te;else return null}}else m=C;const q=m.visibleWhen;if(!J(q,!0))return null;let j=!!m.disabled;const O=m.disabledWhen,I=J(O,!1);if(O!=null&&O.enabled&&(j=I),!(O!=null&&O.enabled)&&"name"in m&&m.name&&Q[m.name]&&(j=!0),m.type==="search"){const te=xe=>m.searchFn(xe,{getValues:x.getValues,watch:x.watch}),le={};return m.searchMode&&(le.searchMode=m.searchMode),m.minChars&&(le.minChars=m.minChars),m.debounceMs&&(le.debounceMs=m.debounceMs),m.resolveByValue&&(le.resolveByValue=m.resolveByValue),i.jsx(wn,{name:m.name,control:k,searchFn:te,label:m.label,size:m.size,width:m.width,disabled:j||T,...le},m.name)}if(m.type==="inputGroup"){const te=m,le=(te.inputs??[]).map(xe=>typeof xe=="string"?R[xe]??(s??[]).find(Me=>(Me==null?void 0:Me.name)===xe):xe).filter(Boolean);return i.jsxs("div",{className:["flex flex-col",te.className].filter(Boolean).join(" "),style:te.width?{width:te.width}:void 0,children:[i.jsx("label",{className:"sr-only pb-2",children:te.groupLabel}),te.showVisibleLabel&&i.jsx("label",{className:"pb-2",children:te.groupLabel}),i.jsx("div",{className:"flex items-center flex-wrap gap-2",children:le.map((xe,Me)=>i.jsxs("div",{className:[xe.width?xe.width:"flex-1 min-w-0","flex items-center"].join(" "),children:[Y(xe),!!te.useSeparator&&Me<le.length-1&&(te.separator??i.jsx("span",{className:"px-1 select-none",children:"/"}))]},xe.name??Me))})]},`inputGroup_${te.name??te.groupLabel??le.map(xe=>xe.name).join("_")}`)}if(m.type==="button"){const te=m;return i.jsx("div",{className:"self-center",children:i.jsx(Le,{type:"button",variant:te.variant,size:te.size,width:te.width,icon:te.icon,iconPosition:te.iconPosition,ariaLabel:te.ariaLabel,onClick:te.onClick,disabled:j||T,children:te.label})},te.name)}const ee=m.suffixButton,se=typeof ee=="string"?Y(ee):ee,ue={name:m.name,control:k,disabled:j||T,label:m.label,size:m.size,width:m.width,placeholder:m.placeholder,info:m.info,suffixButton:se};switch(m.type){case"select":return i.jsx(_e,{name:m.name,control:k,render:({field:te})=>{var le;return i.jsx(ft,{...ue,value:te.value,onChange:te.onChange,options:m.options??_[m.name]??[],loadOptions:m.options?void 0:m.loadOptions,hasError:!!g[m.name],errorMessage:(le=g[m.name])==null?void 0:le.message,suffixButton:se})}},m.name);case"textarea":return i.jsx(_e,{name:m.name,control:k,render:({field:te,fieldState:le})=>{var xe;return i.jsx(kr,{...ue,value:te.value,onChange:te.onChange,maxLength:m.maxLength,showCounter:!!m.showCounter,hasError:!!le.error,errorMessage:((xe=le.error)==null?void 0:xe.message)||""})}},m.name);case"file":return i.jsx(Hs,{...ue,defaultValue:[],maxFiles:m.maxFiles,accept:m.accept,hasError:!!g[m.name],errorMessage:(ne=g[m.name])==null?void 0:ne.message},m.name);case"checkbox":return i.jsx(vn,{...ue,defaultValue:!1,hasError:!!g[m.name],errorMessage:(ae=g[m.name])==null?void 0:ae.message,name:m.name},m.name);case"date":return i.jsx(qs,{...ue,defaultValue:"",showTime:!!m.showTime,hasError:!!g[m.name],errorMessage:(me=g[m.name])==null?void 0:me.message},m.name);case"optionGroup":return i.jsx(xn,{...ue,options:m.options||[],multiple:m.multiple,vertical:m.vertical,groupLabel:m.groupLabel,defaultValue:m.defaultValue,className:m.width?void 0:"w-full",name:m.name},m.name);default:return i.jsx(vr,{...ue,type:m.type,loadingDefaults:D,hasError:!!g[m.name],errorMessage:(ge=g[m.name])==null?void 0:ge.message,suffixButton:se,name:m.name},m.name)}},[s,R,k,g,T,D,_,J,Q,x.getValues,x.watch]);return i.jsx(Xa,{...x,children:i.jsxs("form",{noValidate:!0,onSubmit:w(async C=>{await n(C),p(a??h("ds.form.saveSuccess"),"success")},C=>{console.log("❌ errores de validación:",C),ki(C),p(o??h("ds.form.saveError"),"error")}),className:"space-y-6",children:[t.map((C,m)=>C.type==="rows"?i.jsx(v.Fragment,{children:C.sections.map((q,E)=>i.jsx("div",{className:"mb-6",children:i.jsx(Kt,{title:q.sectionTitle,defaultOpen:q.defaultOpen,children:q.rows.map((j,O)=>i.jsxs("div",{children:[j.title&&i.jsx("h2",{className:"mb-2 text-lg text-[var(--color-ds-text-primary)]",children:j.title}),i.jsx("div",{className:"flex flex-wrap -mx-2",children:j.columns.map((I,ee)=>{var se;return i.jsx("div",{className:`${I.width} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:I.fields?I.fields.map(ue=>Y(ue)):(se=I.rows)==null?void 0:se.map((ue,ne)=>i.jsx("div",{className:"mb-1",children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:ue.columns.map((ae,me)=>{var ge;return i.jsx("div",{className:`${ae.width} px-2`,children:(ge=ae.fields)==null?void 0:ge.map(te=>Y(te))},me)})})},ne))})},ee)})})]},O))})},E))},m):i.jsx(pn,{options:C.tabs.map(q=>({label:q.label,value:q.key})),value:$[m],onChange:q=>X(E=>({...E,[m]:q})),children:Object.fromEntries(C.tabs.map(q=>[q.key,i.jsx("div",{className:"space-y-6",children:q.sections.map((E,j)=>i.jsx("div",{className:"mb-6",children:i.jsx(Kt,{title:E.sectionTitle,defaultOpen:E.defaultOpen,children:E.rows.map((O,I)=>i.jsx("div",{children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:O.columns.map((ee,se)=>{var ue;return i.jsx("div",{className:`${ee.width??"flex-1"} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:(ue=ee.fields)==null?void 0:ue.map((ne,ae)=>i.jsx(v.Fragment,{children:Y(ne)},ae))})},se)})})},I))})},j))},q.key)]))},m)),i.jsx("footer",{className:"py-4 w-full flex justify-center space-x-4",children:l??i.jsx(Le,{type:"submit",variant:"primary",icon:qn,size:"sm",disabled:T||D||W>0,children:h(T?"ds.form.sending":"ds.form.submit")})})]})})}const Gi={sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"};function kn({icon:r,size:e="md",ariaLabel:t,disabled:s=!1,onClick:n,...a}){return i.jsx("button",{type:"button","aria-label":t,disabled:s,onClick:n,className:L("inline-flex items-center justify-center","rounded-full","bg-transparent","text-[var(--color-ds-text-primary)]","transition-transform","focus:outline-none",Gi[e],s?"opacity-50 cursor-not-allowed":["hover:scale-110","hover:animate-pulse"]),...a,children:i.jsx(r,{className:L(e==="sm"?"h-4 w-4":e==="md"?"h-5 w-5":"h-6 w-6")})})}function jn({dark:r,onToggle:e}){return i.jsx("button",{type:"button","aria-pressed":r,"aria-label":r?"Cambiar a modo claro":"Cambiar a modo oscuro",onClick:e,className:L("relative inline-flex items-center transition-colors focus:outline-none duration-200 ease-in-out","bg-[var(--color-ds-background-accent)]","h-6 w-12 rounded-full"),children:i.jsxs("div",{className:L("absolute bg-[var(--color-ds-background-page)] flex items-center justify-center rounded-full transition-transform duration-200 ease-in-out","h-5 w-5",r?"translate-x-6":"translate-x-1"),children:[i.jsx(Oe,{component:da,size:"sm",className:L("absolute transition-opacity duration-200 ease-in-out",r?"opacity-0":"opacity-100 text-[var(--color-ds-background-accent)]")}),i.jsx(Oe,{component:ca,size:"sm",className:L("absolute transition-opacity duration-200 ease-in-out",r?"opacity-100 text-[var(--color-ds-background-accent)]":"opacity-0")})]})})}const En=v.createContext({theme:"light",toggle:()=>{}});function Yi({children:r}){const[e,t]=v.useState(!1),[s,n]=v.useState("light");v.useEffect(()=>{if(typeof window>"u")return;const o=localStorage.getItem("ds-theme");o==="light"||o==="dark"?n(o):window.matchMedia("(prefers-color-scheme: dark)").matches&&n("dark"),t(!0)},[]),v.useEffect(()=>{e&&(document.documentElement.classList.toggle("dark",s==="dark"),s==="dark"?localStorage.setItem("ds-theme","dark"):localStorage.removeItem("ds-theme"))},[s,e]);const a=()=>n(o=>o==="light"?"dark":"light");return e?i.jsx(En.Provider,{value:{theme:s,toggle:a},children:r}):null}const Nn=()=>v.useContext(En),Sn=({pinnedPages:r,onRemovePinned:e,onBack:t,dark:s,locale:n,languageOptions:a,onChangeLocale:o,profile:l,profileOptions:c,onChangeProfile:u})=>{const d=r.slice(0,3),{toggle:p}=Nn(),{t:h,i18n:y}=yr(),x=k=>{o(k)};return i.jsxs("header",{className:"flex items-center bg-[var(--color-ds-background-page)] py-2",children:[i.jsx("div",{className:"flex items-center space-x-2",children:d.map(k=>i.jsxs("div",{className:"flex items-center",children:[i.jsx("a",{href:k.href,className:L("inline-flex items-center rounded-lg","py-1 px-1 my-1 text-ds-sm","bg-transparent text-[var(--color-ds-text-primary)]","transition-colors duration-200 ease-in-out","hover:bg-[var(--color-ds-border-muted)] hover:animate-pulse"),children:k.label}),i.jsx(kn,{icon:dr,size:"sm",ariaLabel:`${h("remove")} ${k.label}`,onClick:()=>e(k.id)})]},k.id))}),i.jsx("div",{className:"flex-grow"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ft,{size:"sm",width:"auto",options:a,value:n,onChange:x,disableErrorPlaceholder:!0}),i.jsx(ft,{size:"sm",width:"auto",options:c,value:l,onChange:u,disableErrorPlaceholder:!0}),i.jsx(jn,{dark:s,onToggle:p})]})]})},xs={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"};function Hi(r){return"options"in r||"loadOptions"in r}function Xi({groupLabel:r,inputs:e=[],separator:t=i.jsx("span",{className:"px-1 select-none",children:"/"}),useSeparator:s=!0,className:n,showVisibleLabel:a=!1,size:o="sm",width:l}){const c=e.length;return i.jsxs("div",{className:L("flex flex-col",n),style:l?{width:l}:void 0,children:[i.jsx("label",{className:L("sr-only pb-2",xs[o]),children:r}),a&&i.jsx("label",{className:L("pb-2",xs[o]),children:r}),i.jsx("div",{className:"flex items-center flex-nowrap",children:e.map((u,d)=>{const{width:p,className:h,control:y,name:x,...k}=u,S=Hi(u);let w="rounded-lg";!s&&c>1&&(d===0?w="rounded-l-lg rounded-r-none":d===c-1?w="rounded-r-lg rounded-l-none":w="rounded-none");const g=typeof p=="string"&&p.split(/\s+/).some(W=>W.startsWith("w-")||W.includes(":w-")),T=L("inline-flex items-center flex-shrink-0",typeof p=="string"?p:"w-40"),D=typeof p=="string"&&!g?{width:p}:void 0,F=L(h,w,p?void 0:"w-full"),B=W=>y&&x?i.jsx(_e,{name:x,control:y,render:({field:_})=>{const R=_.value;return W({...k,name:x,value:S?R===null?void 0:R??void 0:R??"",onChange:_.onChange,className:F,size:o})}}):W({...k,name:x,className:F,size:o});return i.jsxs("div",{className:T,style:D,children:[B(S?W=>i.jsx(ft,{...W,options:u.options,loadOptions:u.loadOptions}):W=>i.jsx(Lt,{...W})),s&&d<c-1&&t]},d)})})]})}const Ki=({loading:r=!1,ariaLabel:e="Cargando..."})=>r?i.jsxs("div",{className:`\r
|
|
37
37
|
fixed inset-0\r
|
|
38
38
|
flex items-center justify-center\r
|
|
39
39
|
bg-[var(--color-ds-background-surface)]/90\r
|
|
@@ -44,7 +44,7 @@ attempted value: ${o}
|
|
|
44
44
|
border-gray-200\r
|
|
45
45
|
border-t-[var(--color-ds-button-primary-bg)]\r
|
|
46
46
|
animate-spin\r
|
|
47
|
-
`}),i.jsx("span",{className:"sr-only",children:e})]}):null,
|
|
47
|
+
`}),i.jsx("span",{className:"sr-only",children:e})]}):null,Ji=({isOpen:r,onClose:e,title:t,children:s,footer:n})=>(v.useEffect(()=>{const a=o=>o.key==="Escape"&&e();return r&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[r,e]),r?gs.createPortal(i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 bg-[var(--color-ds-text-primary)]/50 z-40",onClick:e}),i.jsx("div",{className:"fixed inset-0 flex items-center justify-center px-4 z-50",children:i.jsxs("div",{className:`\r
|
|
48
48
|
relative\r
|
|
49
49
|
bg-[var(--color-ds-background-page)]\r
|
|
50
50
|
dark:bg-[var(--color-ds-background-surface)]\r
|
|
@@ -58,4 +58,4 @@ attempted value: ${o}
|
|
|
58
58
|
dark:bg-[var(--color-ds-background-surface)]\r
|
|
59
59
|
hover:bg-[var(--color-ds-background-accent)]/10\r
|
|
60
60
|
focus:outline-none\r
|
|
61
|
-
`,children:[i.jsx(xr,{className:"w-5 h-5 text-[var(--color-ds-text-secondary)] hover:text-[var(--color-ds-text-primary)]"}),i.jsx("span",{className:"sr-only",children:"Cerrar modal"})]})]}),i.jsx("div",{className:"px-6 py-6 text-[var(--color-ds-text-primary)]",children:s}),n&&i.jsx("div",{className:"px-6 py-4 border-t border-[var(--color-ds-border-muted)] bg-[var(--color-ds-background-surface)]",children:n})]})})]}),document.body):null),Fr=({items:r,selected:e,onSelect:t,level:s=0})=>{const[n,a]=v.useState(new Set),o=l=>{const c=new Set(n);s===0?(c.clear(),n.has(l)||c.add(l)):c.has(l)?c.delete(l):c.add(l),a(c)};return i.jsx("ul",{className:L(s>0?"mt-1":"mt-0"),children:r.map(l=>{var x;const c=l.value===e,u=n.has(l.value),d=["pl-2","pl-2","pl-2"][s]||"pl-4",p=s===0?u||c?"bg-[var(--color-ds-background-accent)] text-[var(--color-ds-text-on-accent)] rounded-r-lg":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]":c?"bg-[var(--color-ds-background-surface)] text-[var(--color-ds-text-primary)]":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]",h=s===0&&(u||c)?"text-[var(--color-ds-text-on-accent)]":"text-[var(--color-ds-text-secondary)]",y=!!((x=l.children)!=null&&x.length);return i.jsxs("li",{children:[i.jsxs("button",{type:"button",onClick:()=>y?o(l.value):t(l.value),"aria-expanded":y?u:void 0,className:L("w-full flex items-center justify-between h-8 transition-colors",d,p),children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[s===0&&l.icon&&i.jsx(l.icon,{className:"w-5 h-5 ml-2"}),i.jsx("span",{className:"text-ds-sm",children:l.label})]}),y&&(u?i.jsx(pr,{className:L("w-4 h-4",h)}):i.jsx(Kn,{className:L("w-4 h-4",h)}))]}),y&&i.jsx("div",{className:L("overflow-hidden transition-[max-height] duration-300 ease-in-out","border-l-1 border-[var(--color-ds-background-accent)] ml-6",u?"max-h-screen":"max-h-0"),children:i.jsx(Fr,{items:l.children,selected:e,onSelect:t,level:s+1})})]},l.value)})})},el="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23FFFFFF;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",tl="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23005751;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",Cn=({appName:r,orgName:e,username:t,footerText:s,navItems:n,selectedNav:a,onSelectNav:o,width:l="200px"})=>{const{theme:c}=Tn(),u=c==="dark"?el:tl;return i.jsxs("aside",{className:"flex flex-col h-screen bg-[var(--color-ds-background-page)]",style:{width:l},children:[i.jsxs("div",{className:"flex gap-1 flex-col items-center py-4 space-y-1",children:[i.jsx("img",{src:u,alt:"Logo Diputación",className:"w-20 h-20"}),i.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-lg ",children:r}),i.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:e}),i.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:t}),i.jsx("div",{className:"w-1/5 h-0.5 rounded-full bg-[var(--color-ds-background-accent)] mt-2"})]}),i.jsx("nav",{className:"flex-1 overflow-auto pt-3",children:i.jsx(Fr,{items:n,selected:a,onSelect:o})}),i.jsx("div",{className:"px-4 w-full py-3",children:i.jsx("span",{className:"text-ds-sm w-full text-center text-[var(--color-ds-text-secondary)]",children:s})})]})};function rl({hideSidebar:r=!1,sidebar:e,header:t,children:s}){return i.jsxs("div",{className:"flex h-screen overflow-hidden bg-[var(--color-ds-background-page)]",children:[!r&&i.jsx(Cn,{...e}),i.jsxs("div",{className:`flex-1 flex flex-col overflow-auto [scrollbar-gutter:stable_both-edges] ${r?"px-0":"px-10"}`,children:[i.jsx(An,{...t}),i.jsx("main",{className:"flex-1",children:s})]})]})}function sl({columns:r,data:e,loadData:t,loading:s,idAccessor:n,multiSelect:a=!1,onSelectionChange:o,pageSize:l=10,initialSort:c,onSort:u,className:d,onRowDoubleClick:p}){const h=e!==void 0,[y,x]=v.useState([]),[k,S]=v.useState(!1),w=v.useRef(null);v.useEffect(()=>{var O;if(!t||h)return;(O=w.current)==null||O.abort();const j=new AbortController;return w.current=j,S(!0),t().then(I=>{j.signal.aborted||x(I)}).finally(()=>{j.signal.aborted||S(!1)}),()=>j.abort()},[t,h]);const g=v.useMemo(()=>h?e:y,[e,y,h]),T=s??(t?k:!1),[$,F]=v.useState(new Set),[U,W]=v.useState(1),[_,R]=v.useState(c==null?void 0:c.sortBy),[Q,Z]=v.useState((c==null?void 0:c.sortDir)??"asc"),D=j=>typeof n=="function"?n(j):j[n],H=v.useRef(null);v.useEffect(()=>{H.current!==g&&(F(new Set),W(1),H.current=g)},[g]);const J=v.useMemo(()=>{if(!_)return g;const j=Q==="asc"?1:-1;return[...g].sort((O,I)=>{const ee=O[_],se=I[_];return ee==null?-j:se==null||ee>se?j:ee<se?-j:0})},[g,_,Q]),G=Math.max(1,Math.ceil(J.length/l)),X=v.useMemo(()=>{const j=(U-1)*l;return J.slice(j,j+l)},[J,U,l]),C=j=>{const O=new Set($);O.has(j)?O.delete(j):O.add(j),F(O),o==null||o(g.filter(I=>O.has(D(I))))},m=()=>{const j=X.every(I=>$.has(D(I))),O=new Set($);X.forEach(I=>{j?O.delete(D(I)):O.add(D(I))}),F(O),o==null||o(g.filter(I=>O.has(D(I))))},q=j=>{if(!j.sortable)return;const O=typeof j.accessor=="string"?j.accessor:j.sortKey;if(_===O){const I=Q==="asc"?"desc":"asc";Z(I),u==null||u(O,I)}else R(O),Z("asc"),u==null||u(O,"asc");W(1)},E=()=>T?i.jsx("tbody",{children:Array.from({length:l}).map((j,O)=>i.jsxs("tr",{children:[a&&i.jsx("td",{children:i.jsx(Xe,{width:"1rem",height:"1rem",variant:"circle"})}),r.map((I,ee)=>i.jsx("td",{children:i.jsx(Xe,{width:"100%",height:"1em",variant:"rect"})},ee))]},O))}):X.length?i.jsx("tbody",{children:X.map(j=>{const O=D(j);return i.jsxs("tr",{className:L("hover:bg-gray-50",p&&"cursor-pointer select-none"),onDoubleClick:p?()=>p(j):void 0,title:p?"Doble clic para abrir":void 0,children:[a&&i.jsx("td",{children:i.jsx("input",{type:"checkbox",checked:$.has(O),onChange:()=>C(O),onDoubleClick:I=>I.stopPropagation()})}),r.map((I,ee)=>{const se=I.render?I.render(j):typeof I.accessor=="function"?I.accessor(j):j[I.accessor];return i.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm",children:se},ee)})]},O)})}):i.jsx("tbody",{children:i.jsx("tr",{children:i.jsx("td",{colSpan:r.length+(a?1:0),children:"No hay datos"})})});return i.jsxs("div",{className:L("w-full overflow-auto",d),children:[i.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[i.jsx("thead",{className:"bg-gray-50",children:i.jsxs("tr",{children:[a&&i.jsx("th",{children:i.jsx("input",{type:"checkbox",checked:X.length>0&&X.every(j=>$.has(D(j))),onChange:m,onDoubleClick:j=>j.stopPropagation()})}),r.map(j=>{const O=typeof j.accessor=="string"?j.accessor:j.header,I=_===(typeof j.accessor=="string"?j.accessor:j.sortKey);return i.jsx("th",{className:L("px-4 py-2 text-left text-sm font-medium text-gray-700",j.width),onClick:()=>q(j),children:i.jsxs("div",{className:"inline-flex items-center space-x-1 cursor-pointer",children:[i.jsx("span",{children:j.header}),j.sortable&&i.jsx("span",{className:"text-xs",children:I?Q==="asc"?"▲":"▼":"⇵"})]})},O)})]})}),E()]}),i.jsxs("div",{className:"flex items-center justify-between py-2 px-4",children:[i.jsx("span",{className:"text-sm text-gray-700",children:T?"Cargando...":`Página ${U} de ${G}`}),i.jsxs("div",{className:"space-x-2",children:[i.jsx(Pe,{size:"sm",variant:"outline",disabled:T||U<=1,onClick:()=>W(j=>Math.max(1,j-1)),children:"Prev"}),i.jsx(Pe,{size:"sm",variant:"outline",disabled:T||U>=G,onClick:()=>W(j=>Math.min(G,j+1)),children:"Next"})]})]})]})}function On({control:r,name:e,rules:t,defaultValue:s=!1,checked:n,onChange:a,disabled:o=!1,label:l,labelPosition:c="right",errorMessage:u="",className:d}){const p=v.useId();if(r&&e)return i.jsx(_e,{name:e,control:r,rules:t,defaultValue:s,render:({field:y,fieldState:x})=>{var k;return i.jsx(On,{checked:y.value,onChange:y.onChange,disabled:o,label:l,labelPosition:c,errorMessage:((k=x.error)==null?void 0:k.message)||"",className:d})}});const h=!!n;return i.jsxs("div",{className:L("flex flex-col",d),children:[i.jsxs("label",{className:L("inline-flex items-center space-x-3 select-none",o&&"opacity-50 cursor-not-allowed"),htmlFor:p,children:[l&&c==="left"&&i.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l}),i.jsx("button",{id:p,type:"button",role:"switch","aria-checked":h,disabled:o,onClick:()=>!o&&(a==null?void 0:a(!h)),className:L("relative inline-flex items-center h-8 w-16","bg-[var(--color-ds-background-accent)] rounded-full transition-colors duration-200","focus:outline-none "),children:i.jsx("div",{className:L("absolute h-6 w-6 bg-[var(--color-ds-background-page)] rounded-full shadow transform transition-transform duration-200",h?"translate-x-9":"translate-x-1")})}),l&&c==="right"&&i.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l})]}),i.jsx("div",{className:"pt-1 min-h-[18px] w-full",children:u?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:u}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function nl({items:r,value:e,onValueChange:t,multiple:s=!0,dense:n=!1,className:a}){const o=v.useMemo(()=>r.filter(x=>x.defaultOpen&&!x.disabled).map(x=>x.id),[r]),[l,c]=v.useState(o),u=e??l,d=x=>{t?t(x):c(x)},p=(x,k)=>{k&&d(s?u.includes(x)?u.filter(S=>S!==x):[...u,x]:u.includes(x)?[]:[x])},h=(x,k,S)=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),p(k,S))},y=n?"py-1":"py-2";return i.jsx("div",{className:["divide-y","divide-[var(--color-ds-border-default-50)]",a].filter(Boolean).join(" "),children:r.map(x=>{const k=u.includes(x.id),S=!x.disabled;return i.jsxs("section",{"aria-disabled":x.disabled||void 0,children:[i.jsxs("button",{type:"button",onClick:()=>p(x.id,S),onKeyDown:w=>h(w,x.id,S),"aria-expanded":k,className:["w-full flex items-center justify-between gap-2 text-left select-none",y,"text-[var(--color-ds-text-primary)]",x.disabled?"opacity-60 cursor-not-allowed":"hover:bg-[color-mix(in_srgb,var(--color-ds-background-surface)_80%,transparent)]"].join(" "),children:[i.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[x.leftAdornment&&i.jsx("span",{className:"shrink-0",children:x.leftAdornment}),i.jsx("span",{className:"font-medium truncate",children:x.title})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[x.actions,i.jsx(pr,{className:["h-4 w-4 transition-transform",k?"rotate-180":"",x.disabled?"opacity-40":""].join(" ")})]})]}),k&&i.jsx("div",{className:[n?"py-1":"py-2"].join(" "),children:x.content})]},x.id)})})}exports.Button=Pe;exports.Checkbox=En;exports.CollapsibleSection=rr;exports.CompactAccordion=nl;exports.DateInput=Hs;exports.DropdownMenu=go;exports.FileUploader=Js;exports.FormFieldInput=Nr;exports.FormPageLayout=Io;exports.FormRenderer=Hi;exports.Header=An;exports.Icon=Me;exports.IconButton=Sn;exports.InfoButton=Qs;exports.Input=Bt;exports.InputGroup=yn;exports.LoadingScreen=Ji;exports.Modal=Qi;exports.OptionGroup=vn;exports.PageLayout=rl;exports.SearchField=Nn;exports.Select=pt;exports.Sidebar=Cn;exports.SidebarNav=Fr;exports.SkeletonLoader=Xe;exports.Table=sl;exports.Tabs=bn;exports.TextArea=_r;exports.ThemeProvider=Ki;exports.ThemeToggle=_n;exports.Toast=wn;exports.ToastProvider=Oi;exports.ToggleSwitch=On;exports.useToast=jn;
|
|
61
|
+
`,children:[i.jsx(dr,{className:"w-5 h-5 text-[var(--color-ds-text-secondary)] hover:text-[var(--color-ds-text-primary)]"}),i.jsx("span",{className:"sr-only",children:"Cerrar modal"})]})]}),i.jsx("div",{className:"px-6 py-6 text-[var(--color-ds-text-primary)]",children:s}),n&&i.jsx("div",{className:"px-6 py-4 border-t border-[var(--color-ds-border-muted)] bg-[var(--color-ds-background-surface)]",children:n})]})})]}),document.body):null),jr=({items:r,selected:e,onSelect:t,level:s=0})=>{const[n,a]=v.useState(new Set),o=l=>{const c=new Set(n);s===0?(c.clear(),n.has(l)||c.add(l)):c.has(l)?c.delete(l):c.add(l),a(c)};return i.jsx("ul",{className:L(s>0?"mt-1":"mt-0"),children:r.map(l=>{var x;const c=l.value===e,u=n.has(l.value),d=["pl-2","pl-2","pl-2"][s]||"pl-4",p=s===0?u||c?"bg-[var(--color-ds-background-accent)] text-[var(--color-ds-text-on-accent)] rounded-r-lg":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]":c?"bg-[var(--color-ds-background-surface)] text-[var(--color-ds-text-primary)]":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]",h=s===0&&(u||c)?"text-[var(--color-ds-text-on-accent)]":"text-[var(--color-ds-text-secondary)]",y=!!((x=l.children)!=null&&x.length);return i.jsxs("li",{children:[i.jsxs("button",{type:"button",onClick:()=>y?o(l.value):t(l.value),"aria-expanded":y?u:void 0,className:L("w-full flex items-center justify-between h-8 transition-colors",d,p),children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[s===0&&l.icon&&i.jsx(l.icon,{className:"w-5 h-5 ml-2"}),i.jsx("span",{className:"text-ds-sm",children:l.label})]}),y&&(u?i.jsx(ur,{className:L("w-4 h-4",h)}):i.jsx(Hn,{className:L("w-4 h-4",h)}))]}),y&&i.jsx("div",{className:L("overflow-hidden transition-[max-height] duration-300 ease-in-out","border-l-1 border-[var(--color-ds-background-accent)] ml-6",u?"max-h-screen":"max-h-0"),children:i.jsx(jr,{items:l.children,selected:e,onSelect:t,level:s+1})})]},l.value)})})},Qi="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23FFFFFF;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",el="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23005751;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",_n=({appName:r,orgName:e,username:t,footerText:s,navItems:n,selectedNav:a,onSelectNav:o,width:l="200px"})=>{const{theme:c}=Nn(),u=c==="dark"?Qi:el;return i.jsxs("aside",{className:"flex flex-col h-screen bg-[var(--color-ds-background-page)]",style:{width:l},children:[i.jsxs("div",{className:"flex gap-1 flex-col items-center py-4 space-y-1",children:[i.jsx("img",{src:u,alt:"Logo Diputación",className:"w-20 h-20"}),i.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-lg ",children:r}),i.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:e}),i.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:t}),i.jsx("div",{className:"w-1/5 h-0.5 rounded-full bg-[var(--color-ds-background-accent)] mt-2"})]}),i.jsx("nav",{className:"flex-1 overflow-auto pt-3",children:i.jsx(jr,{items:n,selected:a,onSelect:o})}),i.jsx("div",{className:"px-4 w-full py-3",children:i.jsx("span",{className:"text-ds-sm w-full text-center text-[var(--color-ds-text-secondary)]",children:s})})]})};function tl({hideSidebar:r=!1,sidebar:e,header:t,children:s}){return i.jsxs("div",{className:"flex h-screen overflow-hidden bg-[var(--color-ds-background-page)]",children:[!r&&i.jsx(_n,{...e}),i.jsxs("div",{className:`flex-1 flex flex-col overflow-auto [scrollbar-gutter:stable_both-edges] ${r?"px-0":"px-10"}`,children:[i.jsx(Sn,{...t}),i.jsx("main",{className:"flex-1",children:s})]})]})}function rl({columns:r,data:e,loadData:t,loading:s,idAccessor:n,multiSelect:a=!1,onSelectionChange:o,pageSize:l=10,initialSort:c,onSort:u,className:d,onRowDoubleClick:p}){const h=e!==void 0,[y,x]=v.useState([]),[k,S]=v.useState(!1),w=v.useRef(null);v.useEffect(()=>{var O;if(!t||h)return;(O=w.current)==null||O.abort();const j=new AbortController;return w.current=j,S(!0),t().then(I=>{j.signal.aborted||x(I)}).finally(()=>{j.signal.aborted||S(!1)}),()=>j.abort()},[t,h]);const g=v.useMemo(()=>h?e:y,[e,y,h]),T=s??(t?k:!1),[D,F]=v.useState(new Set),[B,W]=v.useState(1),[_,R]=v.useState(c==null?void 0:c.sortBy),[Q,Z]=v.useState((c==null?void 0:c.sortDir)??"asc"),$=j=>typeof n=="function"?n(j):j[n],X=v.useRef(null);v.useEffect(()=>{X.current!==g&&(F(new Set),W(1),X.current=g)},[g]);const J=v.useMemo(()=>{if(!_)return g;const j=Q==="asc"?1:-1;return[...g].sort((O,I)=>{const ee=O[_],se=I[_];return ee==null?-j:se==null||ee>se?j:ee<se?-j:0})},[g,_,Q]),G=Math.max(1,Math.ceil(J.length/l)),Y=v.useMemo(()=>{const j=(B-1)*l;return J.slice(j,j+l)},[J,B,l]),C=j=>{const O=new Set(D);O.has(j)?O.delete(j):O.add(j),F(O),o==null||o(g.filter(I=>O.has($(I))))},m=()=>{const j=Y.every(I=>D.has($(I))),O=new Set(D);Y.forEach(I=>{j?O.delete($(I)):O.add($(I))}),F(O),o==null||o(g.filter(I=>O.has($(I))))},q=j=>{if(!j.sortable)return;const O=typeof j.accessor=="string"?j.accessor:j.sortKey;if(_===O){const I=Q==="asc"?"desc":"asc";Z(I),u==null||u(O,I)}else R(O),Z("asc"),u==null||u(O,"asc");W(1)},E=()=>T?i.jsx("tbody",{children:Array.from({length:l}).map((j,O)=>i.jsxs("tr",{children:[a&&i.jsx("td",{children:i.jsx(He,{width:"1rem",height:"1rem",variant:"circle"})}),r.map((I,ee)=>i.jsx("td",{children:i.jsx(He,{width:"100%",height:"1em",variant:"rect"})},ee))]},O))}):Y.length?i.jsx("tbody",{children:Y.map(j=>{const O=$(j);return i.jsxs("tr",{className:L("hover:bg-gray-50",p&&"cursor-pointer select-none"),onDoubleClick:p?()=>p(j):void 0,title:p?"Doble clic para abrir":void 0,children:[a&&i.jsx("td",{children:i.jsx("input",{type:"checkbox",checked:D.has(O),onChange:()=>C(O),onDoubleClick:I=>I.stopPropagation()})}),r.map((I,ee)=>{const se=I.render?I.render(j):typeof I.accessor=="function"?I.accessor(j):j[I.accessor];return i.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm",children:se},ee)})]},O)})}):i.jsx("tbody",{children:i.jsx("tr",{children:i.jsx("td",{colSpan:r.length+(a?1:0),children:"No hay datos"})})});return i.jsxs("div",{className:L("w-full overflow-auto",d),children:[i.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[i.jsx("thead",{className:"bg-gray-50",children:i.jsxs("tr",{children:[a&&i.jsx("th",{children:i.jsx("input",{type:"checkbox",checked:Y.length>0&&Y.every(j=>D.has($(j))),onChange:m,onDoubleClick:j=>j.stopPropagation()})}),r.map(j=>{const O=typeof j.accessor=="string"?j.accessor:j.header,I=_===(typeof j.accessor=="string"?j.accessor:j.sortKey);return i.jsx("th",{className:L("px-4 py-2 text-left text-sm font-medium text-gray-700",j.width),onClick:()=>q(j),children:i.jsxs("div",{className:"inline-flex items-center space-x-1 cursor-pointer",children:[i.jsx("span",{children:j.header}),j.sortable&&i.jsx("span",{className:"text-xs",children:I?Q==="asc"?"▲":"▼":"⇵"})]})},O)})]})}),E()]}),i.jsxs("div",{className:"flex items-center justify-between py-2 px-4",children:[i.jsx("span",{className:"text-sm text-gray-700",children:T?"Cargando...":`Página ${B} de ${G}`}),i.jsxs("div",{className:"space-x-2",children:[i.jsx(Le,{size:"sm",variant:"outline",disabled:T||B<=1,onClick:()=>W(j=>Math.max(1,j-1)),children:"Prev"}),i.jsx(Le,{size:"sm",variant:"outline",disabled:T||B>=G,onClick:()=>W(j=>Math.min(G,j+1)),children:"Next"})]})]})]})}function Fn({control:r,name:e,rules:t,defaultValue:s=!1,checked:n,onChange:a,disabled:o=!1,label:l,labelPosition:c="right",errorMessage:u="",className:d}){const p=v.useId();if(r&&e)return i.jsx(_e,{name:e,control:r,rules:t,defaultValue:s,render:({field:y,fieldState:x})=>{var k;return i.jsx(Fn,{checked:y.value,onChange:y.onChange,disabled:o,label:l,labelPosition:c,errorMessage:((k=x.error)==null?void 0:k.message)||"",className:d})}});const h=!!n;return i.jsxs("div",{className:L("flex flex-col",d),children:[i.jsxs("label",{className:L("inline-flex items-center space-x-3 select-none",o&&"opacity-50 cursor-not-allowed"),htmlFor:p,children:[l&&c==="left"&&i.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l}),i.jsx("button",{id:p,type:"button",role:"switch","aria-checked":h,disabled:o,onClick:()=>!o&&(a==null?void 0:a(!h)),className:L("relative inline-flex items-center h-8 w-16","bg-[var(--color-ds-background-accent)] rounded-full transition-colors duration-200","focus:outline-none "),children:i.jsx("div",{className:L("absolute h-6 w-6 bg-[var(--color-ds-background-page)] rounded-full shadow transform transition-transform duration-200",h?"translate-x-9":"translate-x-1")})}),l&&c==="right"&&i.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l})]}),i.jsx("div",{className:"pt-1 min-h-[18px] w-full",children:u?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:u}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function sl({items:r,value:e,onValueChange:t,multiple:s=!0,dense:n=!1,className:a}){const o=v.useMemo(()=>r.filter(x=>x.defaultOpen&&!x.disabled).map(x=>x.id),[r]),[l,c]=v.useState(o),u=e??l,d=x=>{t?t(x):c(x)},p=(x,k)=>{k&&d(s?u.includes(x)?u.filter(S=>S!==x):[...u,x]:u.includes(x)?[]:[x])},h=(x,k,S)=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),p(k,S))},y=n?"py-1":"py-2";return i.jsx("div",{className:["divide-y","divide-[var(--color-ds-border-default-50)]",a].filter(Boolean).join(" "),children:r.map(x=>{const k=u.includes(x.id),S=!x.disabled;return i.jsxs("section",{"aria-disabled":x.disabled||void 0,children:[i.jsxs("button",{type:"button",onClick:()=>p(x.id,S),onKeyDown:w=>h(w,x.id,S),"aria-expanded":k,className:["w-full flex items-center justify-between gap-2 text-left select-none",y,"text-[var(--color-ds-text-primary)]",x.disabled?"opacity-60 cursor-not-allowed":"hover:bg-[color-mix(in_srgb,var(--color-ds-background-surface)_80%,transparent)]"].join(" "),children:[i.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[x.leftAdornment&&i.jsx("span",{className:"shrink-0",children:x.leftAdornment}),i.jsx("span",{className:"font-medium truncate",children:x.title})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[x.actions,i.jsx(ur,{className:["h-4 w-4 transition-transform",k?"rotate-180":"",x.disabled?"opacity-40":""].join(" ")})]})]}),k&&i.jsx("div",{className:[n?"py-1":"py-2"].join(" "),children:x.content})]},x.id)})})}exports.Button=Le;exports.Checkbox=vn;exports.CollapsibleSection=Kt;exports.CompactAccordion=sl;exports.DateInput=qs;exports.DropdownMenu=po;exports.FileUploader=Hs;exports.FormFieldInput=vr;exports.FormPageLayout=$o;exports.FormRenderer=qi;exports.Header=Sn;exports.Icon=Oe;exports.IconButton=kn;exports.InfoButton=Xs;exports.Input=Lt;exports.InputGroup=Xi;exports.LoadingScreen=Ki;exports.Modal=Ji;exports.OptionGroup=xn;exports.PageLayout=tl;exports.SearchField=wn;exports.Select=ft;exports.Sidebar=_n;exports.SidebarNav=jr;exports.SkeletonLoader=He;exports.Table=rl;exports.Tabs=pn;exports.TextArea=kr;exports.ThemeProvider=Yi;exports.ThemeToggle=jn;exports.Toast=gn;exports.ToastProvider=Ti;exports.ToggleSwitch=Fn;exports.useToast=yn;
|