@dipusevilla/componentes-iu 1.0.26 → 1.0.28
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 +1592 -1564
- package/dist/index.umd.js +11 -11
- package/dist/types/components/SearchField.d.ts +4 -1
- 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"),as=require("react-dom");function wn(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),as=require("react-dom");function wn(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const q=wn(v);function kn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var pt={exports:{}},rt={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -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 yr;function En(){return yr||(yr=1,process.env.NODE_ENV!=="production"&&function(){function r(
|
|
17
|
+
*/var yr;function En(){return yr||(yr=1,process.env.NODE_ENV!=="production"&&function(){function r(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===G?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case j:return"Fragment";case w:return"Profiler";case T:return"StrictMode";case _:return"Suspense";case D:return"SuspenseList";case W:return"Activity"}if(typeof m=="object")switch(typeof m.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),m.$$typeof){case E:return"Portal";case N:return(m.displayName||"Context")+".Provider";case y:return(m._context.displayName||"Context")+".Consumer";case O:var F=m.render;return m=m.displayName,m||(m=F.displayName||F.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case Q:return F=m.displayName||null,F!==null?F:r(m.type)||"Memo";case S:F=m._payload,m=m._init;try{return r(m(F))}catch{}}return null}function t(m){return""+m}function e(m){try{t(m);var F=!1}catch{F=!0}if(F){F=console;var L=F.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return L.call(F,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),t(m)}}function s(m){if(m===j)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===S)return"<...>";try{var F=r(m);return F?"<"+F+">":"<...>"}catch{return"<...>"}}function n(){var m=R.A;return m===null?null:m.getOwner()}function a(){return Error("react-stack-top-frame")}function o(m){if(P.call(m,"key")){var F=Object.getOwnPropertyDescriptor(m,"key").get;if(F&&F.isReactWarning)return!1}return m.key!==void 0}function l(m,F){function L(){I||(I=!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)",F))}L.isReactWarning=!0,Object.defineProperty(m,"key",{get:L,configurable:!0})}function c(){var m=r(this.type);return J[m]||(J[m]=!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.")),m=this.props.ref,m!==void 0?m:null}function u(m,F,L,B,re,le,pe,se){return L=le.ref,m={$$typeof:b,type:m,key:F,props:le,_owner:re},(L!==void 0?L:null)!==null?Object.defineProperty(m,"ref",{enumerable:!1,get:c}):Object.defineProperty(m,"ref",{enumerable:!1,value:null}),m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(m,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(m,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:pe}),Object.defineProperty(m,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:se}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m}function f(m,F,L,B,re,le,pe,se){var H=F.children;if(H!==void 0)if(B)if(X(H)){for(B=0;B<H.length;B++)p(H[B]);Object.freeze&&Object.freeze(H)}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(H);if(P.call(F,"key")){H=r(m);var ne=Object.keys(F).filter(function(ae){return ae!=="key"});B=0<ne.length?"{key: someKey, "+ne.join(": ..., ")+": ...}":"{key: someKey}",K[H+B]||(ne=0<ne.length?"{"+ne.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} />`,B,q,ie,q),X[q+B]=!0)}if(q=null,L!==void 0&&(e(L),q=""+L),o(_)&&(e(_.key),q=""+_.key),"key"in _){L={};for(var de in _)de!=="key"&&(L[de]=_[de])}else L=_;return q&&l(L,typeof h=="function"?h.displayName||h.name||"Unknown":h),u(h,q,le,te,n(),L,pe,se)}function m(h){typeof h=="object"&&h!==null&&h.$$typeof===b&&h._store&&(h._store.validated=1)}var p=v,b=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),E=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),R=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,H=Array.isArray,K=console.createTask?console.createTask:function(){return null};p={"react-stack-bottom-frame":function(h){return h()}};var Q,re={},Y=p["react-stack-bottom-frame"].bind(p,a)(),x=K(s(a)),X={};st.Fragment=j,st.jsx=function(h,_,L,B,te){var le=1e4>R.recentlyCreatedOwnerStacks++;return f(h,_,L,!1,B,te,le?Error("react-stack-top-frame"):Y,le?K(s(h)):x)},st.jsxs=function(h,_,L,B,te){var le=1e4>R.recentlyCreatedOwnerStacks++;return f(h,_,L,!0,B,te,le?Error("react-stack-top-frame"):Y,le?K(s(h)):x)}}()),st}var vr;function Nn(){return vr||(vr=1,process.env.NODE_ENV==="production"?pt.exports=jn():pt.exports=En()),pt.exports}var i=Nn();function os(r){var t,e,s="";if(typeof r=="string"||typeof r=="number")s+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(t=0;t<n;t++)r[t]&&(e=os(r[t]))&&(s&&(s+=" "),s+=e)}else for(e in r)r[e]&&(s&&(s+=" "),s+=e);return s}function I(){for(var r,t,e=0,s="",n=arguments.length;e<n;e++)(r=arguments[e])&&(t=os(r))&&(s&&(s+=" "),s+=t);return s}const _n={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 Ce({component:r,size:t="sm",className:e,...s}){return i.jsx(r,{className:I(_n[t],e),"aria-hidden":s["aria-label"]?void 0:!0,...s})}const Sn="inline-flex items-center justify-center box-border font-[var(--font-primary)] font-medium rounded-lg transition focus:outline-none",Fn={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"},Tn={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"},Cn={sm:"h-6 w-6 p-0",md:"h-10 w-10 p-0",lg:"h-12 w-12 p-0"},On="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 $e({type:r="button",variant:t="primary",size:e="sm",width:s,disabled:n=!1,icon:a,iconPosition:o="left",ariaLabel:l,children:c,onClick:u,className:f}){const m=!!a,p=m&&!c,b=p?Cn[e]:Tn[e];return i.jsxs("button",{type:r,onClick:u,disabled:n,"aria-label":p?l:void 0,style:s?{width:s}:void 0,className:I(Sn,Fn[t],b,On,f,m&&c&&"gap-2"),children:[a&&o==="left"&&i.jsx(Ce,{component:a,size:e}),c,a&&o==="right"&&i.jsx(Ce,{component:a,size:e})]})}function An({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const Mn=Z.forwardRef(An);function Rn({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const is=Z.forwardRef(Rn);function Vn({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const $n=Z.forwardRef(Vn);function Dn({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const In=Z.forwardRef(Dn);function Ln({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.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 Pn=Z.forwardRef(Ln);function zn({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.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 wr=Z.forwardRef(zn);function Un({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.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 Bn=Z.forwardRef(Un);function Wn({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.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"}),Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const ls=Z.forwardRef(Wn);function Zn({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.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 qn=Z.forwardRef(Zn);function Gn({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.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 Hn=Z.forwardRef(Gn);function Yn({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.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 Xn=Z.forwardRef(Yn);function Jn({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.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 Kn=Z.forwardRef(Jn);function Qn({title:r,titleId:t,...e},s){return Z.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":t},e),r?Z.createElement("title",{id:t},r):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const tr=Z.forwardRef(Qn);function Bt({title:r,children:t,defaultOpen:e=!0,className:s}){const[n,a]=v.useState(e),o=v.useRef(null),l=v.useRef(null),[c,u]=v.useState(0),f=()=>{if(l.current){const m=l.current.scrollHeight;u(m)}};return v.useLayoutEffect(()=>{f()},[n]),v.useEffect(()=>{const m=l.current;if(!m)return;const p=new ResizeObserver(()=>{f()});return p.observe(m),()=>{p.disconnect()}},[]),i.jsxs("div",{className:I("flex flex-col w-full gap-3",s),children:[i.jsxs("button",{type:"button",onClick:()=>a(m=>!m),className:"flex items-center justify-between w-full hover:bg-[var(--color-ds-surface-hover)] transition-colors",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})]}),n?i.jsx(In,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"}):i.jsx(is,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"})]}),i.jsx("div",{className:"box-border w-full rounded-lg bg-[var(--color-ds-background-surface)] overflow-hidden",children:i.jsx("div",{className:"px-6",children:i.jsx("div",{ref:o,className:I("overflow-hidden transition-all duration-300 ease-in-out",n?"opacity-100":"opacity-0"),style:{maxHeight:n?`${c}px`:"0px"},children:i.jsx("div",{ref:l,className:"py-4",children:t})})})})]})}const rr="-",ea=r=>{const t=ra(r),{conflictingClassGroups:e,conflictingClassGroupModifiers:s}=r;return{getClassGroupId:o=>{const l=o.split(rr);return l[0]===""&&l.length!==1&&l.shift(),cs(l,t)||ta(o)},getConflictingClassGroupIds:(o,l)=>{const c=e[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},cs=(r,t)=>{var o;if(r.length===0)return t.classGroupId;const e=r[0],s=t.nextPart.get(e),n=s?cs(r.slice(1),s):void 0;if(n)return n;if(t.validators.length===0)return;const a=r.join(rr);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},kr=/^\[(.+)\]$/,ta=r=>{if(kr.test(r)){const t=kr.exec(r)[1],e=t==null?void 0:t.substring(0,t.indexOf(":"));if(e)return"arbitrary.."+e}},ra=r=>{const{theme:t,classGroups:e}=r,s={nextPart:new Map,validators:[]};for(const n in e)Wt(e[n],s,n,t);return s},Wt=(r,t,e,s)=>{r.forEach(n=>{if(typeof n=="string"){const a=n===""?t:jr(t,n);a.classGroupId=e;return}if(typeof n=="function"){if(sa(n)){Wt(n(s),t,e,s);return}t.validators.push({validator:n,classGroupId:e});return}Object.entries(n).forEach(([a,o])=>{Wt(o,jr(t,a),e,s)})})},jr=(r,t)=>{let e=r;return t.split(rr).forEach(s=>{e.nextPart.has(s)||e.nextPart.set(s,{nextPart:new Map,validators:[]}),e=e.nextPart.get(s)}),e},sa=r=>r.isThemeGetter,na=r=>{if(r<1)return{get:()=>{},set:()=>{}};let t=0,e=new Map,s=new Map;const n=(a,o)=>{e.set(a,o),t++,t>r&&(t=0,s=e,e=new Map)};return{get(a){let o=e.get(a);if(o!==void 0)return o;if((o=s.get(a))!==void 0)return n(a,o),o},set(a,o){e.has(a)?e.set(a,o):n(a,o)}}},Zt="!",qt=":",aa=qt.length,oa=r=>{const{prefix:t,experimentalParseClassName:e}=r;let s=n=>{const a=[];let o=0,l=0,c=0,u;for(let N=0;N<n.length;N++){let j=n[N];if(o===0&&l===0){if(j===qt){a.push(n.slice(c,N)),c=N+aa;continue}if(j==="/"){u=N;continue}}j==="["?o++:j==="]"?o--:j==="("?l++:j===")"&&l--}const f=a.length===0?n:n.substring(c),m=ia(f),p=m!==f,b=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:b}};if(t){const n=t+qt,a=s;s=o=>o.startsWith(n)?a(o.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(e){const n=s;s=a=>e({className:a,parseClassName:n})}return s},ia=r=>r.endsWith(Zt)?r.substring(0,r.length-1):r.startsWith(Zt)?r.substring(1):r,la=r=>{const t=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]==="["||t[o]?(n.push(...a.sort(),o),a=[]):a.push(o)}),n.push(...a.sort()),n}},ca=r=>({cache:na(r.cacheSize),parseClassName:oa(r),sortModifiers:la(r),...ea(r)}),da=/\s+/,ua=(r,t)=>{const{parseClassName:e,getClassGroupId:s,getConflictingClassGroupIds:n,sortModifiers:a}=t,o=[],l=r.trim().split(da);let c="";for(let u=l.length-1;u>=0;u-=1){const f=l[u],{isExternal:m,modifiers:p,hasImportantModifier:b,baseClassName:N,maybePostfixModifierPosition:j}=e(f);if(m){c=f+(c.length>0?" "+c:c);continue}let T=!!j,w=s(T?N.substring(0,j):N);if(!w){if(!T){c=f+(c.length>0?" "+c:c);continue}if(w=s(N),!w){c=f+(c.length>0?" "+c:c);continue}T=!1}const y=a(p).join(":"),E=b?y+Zt:y,M=E+w;if(o.includes(M))continue;o.push(M);const F=n(w,T);for(let W=0;W<F.length;++W){const J=F[W];o.push(E+J)}c=f+(c.length>0?" "+c:c)}return c};function fa(){let r=0,t,e,s="";for(;r<arguments.length;)(t=arguments[r++])&&(e=ds(t))&&(s&&(s+=" "),s+=e);return s}const ds=r=>{if(typeof r=="string")return r;let t,e="";for(let s=0;s<r.length;s++)r[s]&&(t=ds(r[s]))&&(e&&(e+=" "),e+=t);return e};function ha(r,...t){let e,s,n,a=o;function o(c){const u=t.reduce((f,m)=>m(f),r());return e=ca(u),s=e.cache.get,n=e.cache.set,a=l,l(c)}function l(c){const u=s(c);if(u)return u;const f=ua(c,e);return n(c,f),f}return function(){return a(fa.apply(null,arguments))}}const he=r=>{const t=e=>e[r]||[];return t.isThemeGetter=!0,t},us=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ma=/^\d+\/\d+$/,pa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xa=/\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$/,ga=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ba=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ya=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,He=r=>ma.test(r),ee=r=>!!r&&!Number.isNaN(Number(r)),Ie=r=>!!r&&Number.isInteger(Number(r)),$t=r=>r.endsWith("%")&&ee(r.slice(0,-1)),Ae=r=>pa.test(r),va=()=>!0,wa=r=>xa.test(r)&&!ga.test(r),hs=()=>!1,ka=r=>ba.test(r),ja=r=>ya.test(r),Ea=r=>!z(r)&&!U(r),Na=r=>Ke(r,xs,hs),z=r=>us.test(r),Ue=r=>Ke(r,gs,wa),Dt=r=>Ke(r,Ca,ee),Er=r=>Ke(r,ms,hs),_a=r=>Ke(r,ps,ja),xt=r=>Ke(r,bs,ka),U=r=>fs.test(r),nt=r=>Qe(r,gs),Sa=r=>Qe(r,Oa),Nr=r=>Qe(r,ms),Fa=r=>Qe(r,xs),Ta=r=>Qe(r,ps),gt=r=>Qe(r,bs,!0),Ke=(r,t,e)=>{const s=us.exec(r);return s?s[1]?t(s[1]):e(s[2]):!1},Qe=(r,t,e=!1)=>{const s=fs.exec(r);return s?s[1]?t(s[1]):e:!1},ms=r=>r==="position"||r==="percentage",ps=r=>r==="image"||r==="url",xs=r=>r==="length"||r==="size"||r==="bg-size",gs=r=>r==="length",Ca=r=>r==="number",Oa=r=>r==="family-name",bs=r=>r==="shadow",Aa=()=>{const r=he("color"),t=he("font"),e=he("text"),s=he("font-weight"),n=he("tracking"),a=he("leading"),o=he("breakpoint"),l=he("container"),c=he("spacing"),u=he("radius"),f=he("shadow"),m=he("inset-shadow"),p=he("text-shadow"),b=he("drop-shadow"),N=he("blur"),j=he("perspective"),T=he("aspect"),w=he("ease"),y=he("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...M(),U,z],W=()=>["auto","hidden","clip","visible","scroll"],J=()=>["auto","contain","none"],S=()=>[U,z,c],$=()=>[He,"full","auto",...S()],P=()=>[Ie,"none","subgrid",U,z],R=()=>["auto",{span:["full",Ie,U,z]},Ie,U,z],V=()=>[Ie,"auto",U,z],H=()=>["auto","min","max","fr",U,z],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],re=()=>["auto",...S()],Y=()=>[He,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],x=()=>[r,U,z],X=()=>[...M(),Nr,Er,{position:[U,z]}],h=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",Fa,Na,{size:[U,z]}],L=()=>[$t,nt,Ue],B=()=>["","none","full",u,U,z],te=()=>["",ee,nt,Ue],le=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[ee,$t,Nr,Er],q=()=>["","none",N,U,z],ie=()=>["none",ee,U,z],de=()=>["none",ee,U,z],ne=()=>[ee,U,z],je=()=>[He,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ae],breakpoint:[Ae],color:[va],container:[Ae],"drop-shadow":[Ae],ease:["in","out","in-out"],font:[Ea],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ae],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ae],shadow:[Ae],spacing:["px",ee],text:[Ae],"text-shadow":[Ae],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",He,z,U,T]}],container:["container"],columns:[{columns:[ee,z,U,l]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:J()}],"overscroll-x":[{"overscroll-x":J()}],"overscroll-y":[{"overscroll-y":J()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Ie,"auto",U,z]}],basis:[{basis:[He,"full","auto",l,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ee,He,"auto","initial","none",z]}],grow:[{grow:["",ee,U,z]}],shrink:[{shrink:["",ee,U,z]}],order:[{order:[Ie,"first","last","none",U,z]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[l,"screen",...Y()]}],"min-w":[{"min-w":[l,"screen","none",...Y()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",e,nt,Ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,U,Dt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$t,z]}],"font-family":[{font:[Sa,z,t]}],"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":[ee,"none",U,Dt]}],leading:[{leading:[a,...S()]}],"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:x()}],"text-color":[{text:x()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[ee,"from-font","auto",U,Ue]}],"text-decoration-color":[{decoration:x()}],"underline-offset":[{"underline-offset":[ee,"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:S()}],"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:X()}],"bg-repeat":[{bg:h()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ie,U,z],radial:["",U,z],conic:[Ie,U,z]},Ta,_a]}],"bg-color":[{bg:x()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:x()}],"gradient-via":[{via:x()}],"gradient-to":[{to:x()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:x()}],"border-color-x":[{"border-x":x()}],"border-color-y":[{"border-y":x()}],"border-color-s":[{"border-s":x()}],"border-color-e":[{"border-e":x()}],"border-color-t":[{"border-t":x()}],"border-color-r":[{"border-r":x()}],"border-color-b":[{"border-b":x()}],"border-color-l":[{"border-l":x()}],"divide-color":[{divide:x()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ee,U,z]}],"outline-w":[{outline:["",ee,nt,Ue]}],"outline-color":[{outline:x()}],shadow:[{shadow:["","none",f,gt,xt]}],"shadow-color":[{shadow:x()}],"inset-shadow":[{"inset-shadow":["none",m,gt,xt]}],"inset-shadow-color":[{"inset-shadow":x()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:x()}],"ring-offset-w":[{"ring-offset":[ee,Ue]}],"ring-offset-color":[{"ring-offset":x()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":x()}],"text-shadow":[{"text-shadow":["none",p,gt,xt]}],"text-shadow-color":[{"text-shadow":x()}],opacity:[{opacity:[ee,U,z]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"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":[ee]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":x()}],"mask-image-linear-to-color":[{"mask-linear-to":x()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":x()}],"mask-image-t-to-color":[{"mask-t-to":x()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":x()}],"mask-image-r-to-color":[{"mask-r-to":x()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":x()}],"mask-image-b-to-color":[{"mask-b-to":x()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":x()}],"mask-image-l-to-color":[{"mask-l-to":x()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":x()}],"mask-image-x-to-color":[{"mask-x-to":x()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":x()}],"mask-image-y-to-color":[{"mask-y-to":x()}],"mask-image-radial":[{"mask-radial":[U,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":x()}],"mask-image-radial-to-color":[{"mask-radial-to":x()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[ee]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":x()}],"mask-image-conic-to-color":[{"mask-conic-to":x()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:h()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",U,z]}],filter:[{filter:["","none",U,z]}],blur:[{blur:q()}],brightness:[{brightness:[ee,U,z]}],contrast:[{contrast:[ee,U,z]}],"drop-shadow":[{"drop-shadow":["","none",b,gt,xt]}],"drop-shadow-color":[{"drop-shadow":x()}],grayscale:[{grayscale:["",ee,U,z]}],"hue-rotate":[{"hue-rotate":[ee,U,z]}],invert:[{invert:["",ee,U,z]}],saturate:[{saturate:[ee,U,z]}],sepia:[{sepia:["",ee,U,z]}],"backdrop-filter":[{"backdrop-filter":["","none",U,z]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[ee,U,z]}],"backdrop-contrast":[{"backdrop-contrast":[ee,U,z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ee,U,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ee,U,z]}],"backdrop-invert":[{"backdrop-invert":["",ee,U,z]}],"backdrop-opacity":[{"backdrop-opacity":[ee,U,z]}],"backdrop-saturate":[{"backdrop-saturate":[ee,U,z]}],"backdrop-sepia":[{"backdrop-sepia":["",ee,U,z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"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:[ee,"initial",U,z]}],ease:[{ease:["linear","initial",w,U,z]}],delay:[{delay:[ee,U,z]}],animate:[{animate:["none",y,U,z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,U,z]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[U,z,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:x()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:x()}],"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":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",...x()]}],"stroke-w":[{stroke:[ee,nt,Ue,Dt]}],stroke:[{stroke:["none",...x()]}],"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"]}},Ma=ha(Aa);var dt=r=>r.type==="checkbox",Be=r=>r instanceof Date,ye=r=>r==null;const ys=r=>typeof r=="object";var fe=r=>!ye(r)&&!Array.isArray(r)&&ys(r)&&!Be(r),vs=r=>fe(r)&&r.target?dt(r.target)?r.target.checked:r.target.value:r,Ra=r=>r.substring(0,r.search(/\.\d+(\.|$)/))||r,ws=(r,t)=>r.has(Ra(t)),Va=r=>{const t=r.constructor&&r.constructor.prototype;return fe(t)&&t.hasOwnProperty("isPrototypeOf")},sr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ge(r){let t;const e=Array.isArray(r),s=typeof FileList<"u"?r instanceof FileList:!1;if(r instanceof Date)t=new Date(r);else if(r instanceof Set)t=new Set(r);else if(!(sr&&(r instanceof Blob||s))&&(e||fe(r)))if(t=e?[]:{},!e&&!Va(r))t=r;else for(const n in r)r.hasOwnProperty(n)&&(t[n]=ge(r[n]));else return r;return t}var At=r=>Array.isArray(r)?r.filter(Boolean):[],ue=r=>r===void 0,A=(r,t,e)=>{if(!t||!fe(r))return e;const s=At(t.split(/[,[\].]+?/)).reduce((n,a)=>ye(n)?n:n[a],r);return ue(s)||s===r?ue(r[t])?e:r[t]:s},ke=r=>typeof r=="boolean",nr=r=>/^\w*$/.test(r),ks=r=>At(r.replace(/["|']|\]/g,"").split(/\.|\[/)),ae=(r,t,e)=>{let s=-1;const n=nr(t)?[t]:ks(t),a=n.length,o=a-1;for(;++s<a;){const l=n[s];let c=e;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 _t={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},_e={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Me={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},js=v.createContext(null),ut=()=>v.useContext(js),$a=r=>{const{children:t,...e}=r;return v.createElement(js.Provider,{value:e},t)};var Es=(r,t,e,s=!0)=>{const n={defaultValues:t._defaultValues};for(const a in r)Object.defineProperty(n,a,{get:()=>{const o=a;return t._proxyFormState[o]!==_e.all&&(t._proxyFormState[o]=!s||_e.all),e&&(e[o]=!0),r[o]}});return n};const ar=typeof window<"u"?Z.useLayoutEffect:Z.useEffect;function Da(r){const t=ut(),{control:e=t.control,disabled:s,name:n,exact:a}=r||{},[o,l]=v.useState(e._formState),c=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ar(()=>e._subscribe({name:n,formState:c.current,exact:a,callback:u=>{!s&&l({...e._formState,...u})}}),[n,s,a]),v.useEffect(()=>{c.current.isValid&&e._setValid(!0)},[e]),v.useMemo(()=>Es(o,e,c.current,!1),[o,e])}var Oe=r=>typeof r=="string",Ns=(r,t,e,s,n)=>Oe(r)?(s&&t.watch.add(r),A(e,r,n)):Array.isArray(r)?r.map(a=>(s&&t.watch.add(a),A(e,a))):(s&&(t.watchAll=!0),e);function or(r){const t=ut(),{control:e=t.control,name:s,defaultValue:n,disabled:a,exact:o}=r||{},l=v.useRef(n),[c,u]=v.useState(e._getWatch(s,l.current));return ar(()=>e._subscribe({name:s,formState:{values:!0},exact:o,callback:f=>!a&&u(Ns(s,e._names,f.values||e._formValues,!1,l.current))}),[s,e,a,o]),v.useEffect(()=>e._removeUnmounted()),c}function _s(r){const t=ut(),{name:e,disabled:s,control:n=t.control,shouldUnregister:a}=r,o=ws(n._names.array,e),l=or({control:n,name:e,defaultValue:A(n._formValues,e,A(n._defaultValues,e,r.defaultValue)),exact:!0}),c=Da({control:n,name:e,exact:!0}),u=v.useRef(r),f=v.useRef(n.register(e,{...r.rules,value:l,...ke(r.disabled)?{disabled:r.disabled}:{}})),m=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!A(c.errors,e)},isDirty:{enumerable:!0,get:()=>!!A(c.dirtyFields,e)},isTouched:{enumerable:!0,get:()=>!!A(c.touchedFields,e)},isValidating:{enumerable:!0,get:()=>!!A(c.validatingFields,e)},error:{enumerable:!0,get:()=>A(c.errors,e)}}),[c,e]),p=v.useCallback(T=>f.current.onChange({target:{value:vs(T),name:e},type:_t.CHANGE}),[e]),b=v.useCallback(()=>f.current.onBlur({target:{value:A(n._formValues,e),name:e},type:_t.BLUR}),[e,n._formValues]),N=v.useCallback(T=>{const w=A(n._fields,e);w&&T&&(w._f.ref={focus:()=>T.focus(),select:()=>T.select(),setCustomValidity:y=>T.setCustomValidity(y),reportValidity:()=>T.reportValidity()})},[n._fields,e]),j=v.useMemo(()=>({name:e,value:l,...ke(s)||c.disabled?{disabled:c.disabled||s}:{},onChange:p,onBlur:b,ref:N}),[e,s,c.disabled,p,b,N,l]);return v.useEffect(()=>{const T=n._options.shouldUnregister||a;n.register(e,{...u.current.rules,...ke(u.current.disabled)?{disabled:u.current.disabled}:{}});const w=(y,E)=>{const M=A(n._fields,y);M&&M._f&&(M._f.mount=E)};if(w(e,!0),T){const y=ge(A(n._options.defaultValues,e));ae(n._defaultValues,e,y),ue(A(n._formValues,e))&&ae(n._formValues,e,y)}return!o&&n.register(e),()=>{(o?T&&!n._state.action:T)?n.unregister(e):w(e,!1)}},[e,n,o,a]),v.useEffect(()=>{n._setDisabledField({disabled:s,name:e})},[s,e,n]),v.useMemo(()=>({field:j,formState:c,fieldState:m}),[j,c,m])}const Fe=r=>r.render(_s(r));var Ss=(r,t,e,s,n)=>t?{...e[r],types:{...e[r]&&e[r].types?e[r].types:{},[s]:n||!0}}:{},it=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=[]}}},Gt=r=>ye(r)||!ys(r);function Pe(r,t){if(Gt(r)||Gt(t))return r===t;if(Be(r)&&Be(t))return r.getTime()===t.getTime();const e=Object.keys(r),s=Object.keys(t);if(e.length!==s.length)return!1;for(const n of e){const a=r[n];if(!s.includes(n))return!1;if(n!=="ref"){const o=t[n];if(Be(a)&&Be(o)||fe(a)&&fe(o)||Array.isArray(a)&&Array.isArray(o)?!Pe(a,o):a!==o)return!1}}return!0}var be=r=>fe(r)&&!Object.keys(r).length,ir=r=>r.type==="file",Se=r=>typeof r=="function",St=r=>{if(!sr)return!1;const t=r?r.ownerDocument:0;return r instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Fs=r=>r.type==="select-multiple",lr=r=>r.type==="radio",Ia=r=>lr(r)||dt(r),It=r=>St(r)&&r.isConnected;function La(r,t){const e=t.slice(0,-1).length;let s=0;for(;s<e;)r=ue(r)?s++:r[t[s++]];return r}function Pa(r){for(const t in r)if(r.hasOwnProperty(t)&&!ue(r[t]))return!1;return!0}function me(r,t){const e=Array.isArray(t)?t:nr(t)?[t]:ks(t),s=e.length===1?r:La(r,e),n=e.length-1,a=e[n];return s&&delete s[a],n!==0&&(fe(s)&&be(s)||Array.isArray(s)&&Pa(s))&&me(r,e.slice(0,-1)),r}var Ts=r=>{for(const t in r)if(Se(r[t]))return!0;return!1};function Ft(r,t={}){const e=Array.isArray(r);if(fe(r)||e)for(const s in r)Array.isArray(r[s])||fe(r[s])&&!Ts(r[s])?(t[s]=Array.isArray(r[s])?[]:{},Ft(r[s],t[s])):ye(r[s])||(t[s]=!0);return t}function Cs(r,t,e){const s=Array.isArray(r);if(fe(r)||s)for(const n in r)Array.isArray(r[n])||fe(r[n])&&!Ts(r[n])?ue(t)||Gt(e[n])?e[n]=Array.isArray(r[n])?Ft(r[n],[]):{...Ft(r[n])}:Cs(r[n],ye(t)?{}:t[n],e[n]):e[n]=!Pe(r[n],t[n]);return e}var at=(r,t)=>Cs(r,t,Ft(t));const Sr={value:!1,isValid:!1},Fr={value:!0,isValid:!0};var Os=r=>{if(Array.isArray(r)){if(r.length>1){const t=r.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return r[0].checked&&!r[0].disabled?r[0].attributes&&!ue(r[0].attributes.value)?ue(r[0].value)||r[0].value===""?Fr:{value:r[0].value,isValid:!0}:Fr:Sr}return Sr},As=(r,{valueAsNumber:t,valueAsDate:e,setValueAs:s})=>ue(r)?r:t?r===""?NaN:r&&+r:e&&Oe(r)?new Date(r):s?s(r):r;const Tr={isValid:!1,value:null};var Ms=r=>Array.isArray(r)?r.reduce((t,e)=>e&&e.checked&&!e.disabled?{isValid:!0,value:e.value}:t,Tr):Tr;function Cr(r){const t=r.ref;return ir(t)?t.files:lr(t)?Ms(r.refs).value:Fs(t)?[...t.selectedOptions].map(({value:e})=>e):dt(t)?Os(r.refs).value:As(ue(t.value)?r.ref.value:t.value,r)}var za=(r,t,e,s)=>{const n={};for(const a of r){const o=A(t,a);o&&ae(n,a,o._f)}return{criteriaMode:e,names:[...r],fields:n,shouldUseNativeValidation:s}},Tt=r=>r instanceof RegExp,ot=r=>ue(r)?r:Tt(r)?r.source:fe(r)?Tt(r.value)?r.value.source:r.value:r,Or=r=>({isOnSubmit:!r||r===_e.onSubmit,isOnBlur:r===_e.onBlur,isOnChange:r===_e.onChange,isOnAll:r===_e.all,isOnTouch:r===_e.onTouched});const Ar="AsyncFunction";var Ua=r=>!!r&&!!r.validate&&!!(Se(r.validate)&&r.validate.constructor.name===Ar||fe(r.validate)&&Object.values(r.validate).find(t=>t.constructor.name===Ar)),Ba=r=>r.mount&&(r.required||r.min||r.max||r.maxLength||r.minLength||r.pattern||r.validate),Mr=(r,t,e)=>!e&&(t.watchAll||t.watch.has(r)||[...t.watch].some(s=>r.startsWith(s)&&/^\.\w+/.test(r.slice(s.length))));const lt=(r,t,e,s)=>{for(const n of e||Object.keys(r)){const a=A(r,n);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],n)&&!s)return!0;if(o.ref&&t(o.ref,o.name)&&!s)return!0;if(lt(l,t))break}else if(fe(l)&<(l,t))break}}};function Rr(r,t,e){const s=A(r,e);if(s||nr(e))return{error:s,name:e};const n=e.split(".");for(;n.length;){const a=n.join("."),o=A(t,a),l=A(r,a);if(o&&!Array.isArray(o)&&e!==a)return{name:e};if(l&&l.type)return{name:a,error:l};n.pop()}return{name:e}}var Wa=(r,t,e,s)=>{e(r);const{name:n,...a}=r;return be(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!s||_e.all))},Za=(r,t,e)=>!r||!t||r===t||it(r).some(s=>s&&(e?s===t:s.startsWith(t)||t.startsWith(s))),qa=(r,t,e,s,n)=>n.isOnAll?!1:!e&&n.isOnTouch?!(t||r):(e?s.isOnBlur:n.isOnBlur)?!r:(e?s.isOnChange:n.isOnChange)?r:!0,Ga=(r,t)=>!At(A(r,t)).length&&me(r,t),Ha=(r,t,e)=>{const s=it(A(r,e));return ae(s,"root",t[e]),ae(r,e,s),r},jt=r=>Oe(r);function Vr(r,t,e="validate"){if(jt(r)||Array.isArray(r)&&r.every(jt)||ke(r)&&!r)return{type:e,message:jt(r)?r:"",ref:t}}var Ye=r=>fe(r)&&!Tt(r)?r:{value:r,message:""},$r=async(r,t,e,s,n,a)=>{const{ref:o,refs:l,required:c,maxLength:u,minLength:f,min:m,max:p,pattern:b,validate:N,name:j,valueAsNumber:T,mount:w}=r._f,y=A(e,j);if(!w||t.has(j))return{};const E=l?l[0]:o,M=V=>{n&&E.reportValidity&&(E.setCustomValidity(ke(V)?"":V||""),E.reportValidity())},F={},W=lr(o),J=dt(o),S=W||J,$=(T||ir(o))&&ue(o.value)&&ue(y)||St(o)&&o.value===""||y===""||Array.isArray(y)&&!y.length,P=Ss.bind(null,j,s,F),R=(V,H,K,Q=Me.maxLength,re=Me.minLength)=>{const Y=V?H:K;F[j]={type:V?Q:re,message:Y,ref:o,...P(V?Q:re,Y)}};if(a?!Array.isArray(y)||!y.length:c&&(!S&&($||ye(y))||ke(y)&&!y||J&&!Os(l).isValid||W&&!Ms(l).isValid)){const{value:V,message:H}=jt(c)?{value:!!c,message:c}:Ye(c);if(V&&(F[j]={type:Me.required,message:H,ref:E,...P(Me.required,H)},!s))return M(H),F}if(!$&&(!ye(m)||!ye(p))){let V,H;const K=Ye(p),Q=Ye(m);if(!ye(y)&&!isNaN(y)){const re=o.valueAsNumber||y&&+y;ye(K.value)||(V=re>K.value),ye(Q.value)||(H=re<Q.value)}else{const re=o.valueAsDate||new Date(y),Y=h=>new Date(new Date().toDateString()+" "+h),x=o.type=="time",X=o.type=="week";Oe(K.value)&&y&&(V=x?Y(y)>Y(K.value):X?y>K.value:re>new Date(K.value)),Oe(Q.value)&&y&&(H=x?Y(y)<Y(Q.value):X?y<Q.value:re<new Date(Q.value))}if((V||H)&&(R(!!V,K.message,Q.message,Me.max,Me.min),!s))return M(F[j].message),F}if((u||f)&&!$&&(Oe(y)||a&&Array.isArray(y))){const V=Ye(u),H=Ye(f),K=!ye(V.value)&&y.length>+V.value,Q=!ye(H.value)&&y.length<+H.value;if((K||Q)&&(R(K,V.message,H.message),!s))return M(F[j].message),F}if(b&&!$&&Oe(y)){const{value:V,message:H}=Ye(b);if(Tt(V)&&!y.match(V)&&(F[j]={type:Me.pattern,message:H,ref:o,...P(Me.pattern,H)},!s))return M(H),F}if(N){if(Se(N)){const V=await N(y,e),H=Vr(V,E);if(H&&(F[j]={...H,...P(Me.validate,H.message)},!s))return M(H.message),F}else if(fe(N)){let V={};for(const H in N){if(!be(V)&&!s)break;const K=Vr(await N[H](y,e),E,H);K&&(V={...K,...P(H,K.message)},M(K.message),s&&(F[j]=V))}if(!be(V)&&(F[j]={ref:E,...V},!s))return F}}return M(!0),F};const Ya={mode:_e.onSubmit,reValidateMode:_e.onChange,shouldFocusError:!0};function Xa(r={}){let t={...Ya,...r},e={submitCount:0,isDirty:!1,isReady:!1,isLoading:Se(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const s={};let n=fe(t.defaultValues)||fe(t.values)?ge(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ge(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 f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let m={...f};const p={array:_r(),state:_r()},b=t.criteriaMode===_e.all,N=d=>g=>{clearTimeout(u),u=setTimeout(d,g)},j=async d=>{if(!t.disabled&&(f.isValid||m.isValid||d)){const g=t.resolver?be((await J()).errors):await $(s,!0);g!==e.isValid&&p.state.next({isValid:g})}},T=(d,g)=>{!t.disabled&&(f.isValidating||f.validatingFields||m.isValidating||m.validatingFields)&&((d||Array.from(l.mount)).forEach(k=>{k&&(g?ae(e.validatingFields,k,g):me(e.validatingFields,k))}),p.state.next({validatingFields:e.validatingFields,isValidating:!be(e.validatingFields)}))},w=(d,g=[],k,D,O=!0,C=!0)=>{if(D&&k&&!t.disabled){if(o.action=!0,C&&Array.isArray(A(s,d))){const G=k(A(s,d),D.argA,D.argB);O&&ae(s,d,G)}if(C&&Array.isArray(A(e.errors,d))){const G=k(A(e.errors,d),D.argA,D.argB);O&&ae(e.errors,d,G),Ga(e.errors,d)}if((f.touchedFields||m.touchedFields)&&C&&Array.isArray(A(e.touchedFields,d))){const G=k(A(e.touchedFields,d),D.argA,D.argB);O&&ae(e.touchedFields,d,G)}(f.dirtyFields||m.dirtyFields)&&(e.dirtyFields=at(n,a)),p.state.next({name:d,isDirty:R(d,g),dirtyFields:e.dirtyFields,errors:e.errors,isValid:e.isValid})}else ae(a,d,g)},y=(d,g)=>{ae(e.errors,d,g),p.state.next({errors:e.errors})},E=d=>{e.errors=d,p.state.next({errors:e.errors,isValid:!1})},M=(d,g,k,D)=>{const O=A(s,d);if(O){const C=A(a,d,ue(k)?A(n,d):k);ue(C)||D&&D.defaultChecked||g?ae(a,d,g?C:Cr(O._f)):K(d,C),o.mount&&j()}},F=(d,g,k,D,O)=>{let C=!1,G=!1;const oe={name:d};if(!t.disabled){if(!k||D){(f.isDirty||m.isDirty)&&(G=e.isDirty,e.isDirty=oe.isDirty=R(),C=G!==oe.isDirty);const ce=Pe(A(n,d),g);G=!!A(e.dirtyFields,d),ce?me(e.dirtyFields,d):ae(e.dirtyFields,d,!0),oe.dirtyFields=e.dirtyFields,C=C||(f.dirtyFields||m.dirtyFields)&&G!==!ce}if(k){const ce=A(e.touchedFields,d);ce||(ae(e.touchedFields,d,k),oe.touchedFields=e.touchedFields,C=C||(f.touchedFields||m.touchedFields)&&ce!==k)}C&&O&&p.state.next(oe)}return C?oe:{}},W=(d,g,k,D)=>{const O=A(e.errors,d),C=(f.isValid||m.isValid)&&ke(g)&&e.isValid!==g;if(t.delayError&&k?(c=N(()=>y(d,k)),c(t.delayError)):(clearTimeout(u),c=null,k?ae(e.errors,d,k):me(e.errors,d)),(k?!Pe(O,k):O)||!be(D)||C){const G={...D,...C&&ke(g)?{isValid:g}:{},errors:e.errors,name:d};e={...e,...G},p.state.next(G)}},J=async d=>{T(d,!0);const g=await t.resolver(a,t.context,za(d||l.mount,s,t.criteriaMode,t.shouldUseNativeValidation));return T(d),g},S=async d=>{const{errors:g}=await J(d);if(d)for(const k of d){const D=A(g,k);D?ae(e.errors,k,D):me(e.errors,k)}else e.errors=g;return g},$=async(d,g,k={valid:!0})=>{for(const D in d){const O=d[D];if(O){const{_f:C,...G}=O;if(C){const oe=l.array.has(C.name),ce=O._f&&Ua(O._f);ce&&f.validatingFields&&T([D],!0);const Ee=await $r(O,l.disabled,a,b,t.shouldUseNativeValidation&&!g,oe);if(ce&&f.validatingFields&&T([D]),Ee[C.name]&&(k.valid=!1,g))break;!g&&(A(Ee,C.name)?oe?Ha(e.errors,Ee,C.name):ae(e.errors,C.name,Ee[C.name]):me(e.errors,C.name))}!be(G)&&await $(G,g,k)}}return k.valid},P=()=>{for(const d of l.unMount){const g=A(s,d);g&&(g._f.refs?g._f.refs.every(k=>!It(k)):!It(g._f.ref))&&se(d)}l.unMount=new Set},R=(d,g)=>!t.disabled&&(d&&g&&ae(a,d,g),!Pe(h(),n)),V=(d,g,k)=>Ns(d,l,{...o.mount?a:ue(g)?n:Oe(d)?{[d]:g}:g},k,g),H=d=>At(A(o.mount?a:n,d,t.shouldUnregister?A(n,d,[]):[])),K=(d,g,k={})=>{const D=A(s,d);let O=g;if(D){const C=D._f;C&&(!C.disabled&&ae(a,d,As(g,C)),O=St(C.ref)&&ye(g)?"":g,Fs(C.ref)?[...C.ref.options].forEach(G=>G.selected=O.includes(G.value)):C.refs?dt(C.ref)?C.refs.forEach(G=>{(!G.defaultChecked||!G.disabled)&&(Array.isArray(O)?G.checked=!!O.find(oe=>oe===G.value):G.checked=O===G.value||!!O)}):C.refs.forEach(G=>G.checked=G.value===O):ir(C.ref)?C.ref.value="":(C.ref.value=O,C.ref.type||p.state.next({name:d,values:ge(a)})))}(k.shouldDirty||k.shouldTouch)&&F(d,O,k.shouldTouch,k.shouldDirty,!0),k.shouldValidate&&X(d)},Q=(d,g,k)=>{for(const D in g){if(!g.hasOwnProperty(D))return;const O=g[D],C=`${d}.${D}`,G=A(s,C);(l.array.has(d)||fe(O)||G&&!G._f)&&!Be(O)?Q(C,O,k):K(C,O,k)}},re=(d,g,k={})=>{const D=A(s,d),O=l.array.has(d),C=ge(g);ae(a,d,C),O?(p.array.next({name:d,values:ge(a)}),(f.isDirty||f.dirtyFields||m.isDirty||m.dirtyFields)&&k.shouldDirty&&p.state.next({name:d,dirtyFields:at(n,a),isDirty:R(d,C)})):D&&!D._f&&!ye(C)?Q(d,C,k):K(d,C,k),Mr(d,l)&&p.state.next({...e}),p.state.next({name:o.mount?d:void 0,values:ge(a)})},Y=async d=>{o.mount=!0;const g=d.target;let k=g.name,D=!0;const O=A(s,k),C=ce=>{D=Number.isNaN(ce)||Be(ce)&&isNaN(ce.getTime())||Pe(ce,A(a,k,ce))},G=Or(t.mode),oe=Or(t.reValidateMode);if(O){let ce,Ee;const mt=g.type?Cr(O._f):vs(d),De=d.type===_t.BLUR||d.type===_t.FOCUS_OUT,bn=!Ba(O._f)&&!t.resolver&&!A(e.errors,k)&&!O._f.deps||qa(De,A(e.touchedFields,k),e.isSubmitted,oe,G),Rt=Mr(k,l,De);ae(a,k,mt),De?(O._f.onBlur&&O._f.onBlur(d),c&&c(0)):O._f.onChange&&O._f.onChange(d);const Vt=F(k,mt,De),yn=!be(Vt)||Rt;if(!De&&p.state.next({name:k,type:d.type,values:ge(a)}),bn)return(f.isValid||m.isValid)&&(t.mode==="onBlur"?De&&j():De||j()),yn&&p.state.next({name:k,...Rt?{}:Vt});if(!De&&Rt&&p.state.next({...e}),t.resolver){const{errors:xr}=await J([k]);if(C(mt),D){const vn=Rr(e.errors,s,k),gr=Rr(xr,s,vn.name||k);ce=gr.error,k=gr.name,Ee=be(xr)}}else T([k],!0),ce=(await $r(O,l.disabled,a,b,t.shouldUseNativeValidation))[k],T([k]),C(mt),D&&(ce?Ee=!1:(f.isValid||m.isValid)&&(Ee=await $(s,!0)));D&&(O._f.deps&&X(O._f.deps),W(k,Ee,ce,Vt))}},x=(d,g)=>{if(A(e.errors,g)&&d.focus)return d.focus(),1},X=async(d,g={})=>{let k,D;const O=it(d);if(t.resolver){const C=await S(ue(d)?d:O);k=be(C),D=d?!O.some(G=>A(C,G)):k}else d?(D=(await Promise.all(O.map(async C=>{const G=A(s,C);return await $(G&&G._f?{[C]:G}:G)}))).every(Boolean),!(!D&&!e.isValid)&&j()):D=k=await $(s);return p.state.next({...!Oe(d)||(f.isValid||m.isValid)&&k!==e.isValid?{}:{name:d},...t.resolver||!d?{isValid:k}:{},errors:e.errors}),g.shouldFocus&&!D&<(s,x,d?O:l.mount),D},h=d=>{const g={...o.mount?a:n};return ue(d)?g:Oe(d)?A(g,d):d.map(k=>A(g,k))},_=(d,g)=>({invalid:!!A((g||e).errors,d),isDirty:!!A((g||e).dirtyFields,d),error:A((g||e).errors,d),isValidating:!!A(e.validatingFields,d),isTouched:!!A((g||e).touchedFields,d)}),L=d=>{d&&it(d).forEach(g=>me(e.errors,g)),p.state.next({errors:d?e.errors:{}})},B=(d,g,k)=>{const D=(A(s,d,{_f:{}})._f||{}).ref,O=A(e.errors,d)||{},{ref:C,message:G,type:oe,...ce}=O;ae(e.errors,d,{...ce,...g,ref:D}),p.state.next({name:d,errors:e.errors,isValid:!1}),k&&k.shouldFocus&&D&&D.focus&&D.focus()},te=(d,g)=>Se(d)?p.state.subscribe({next:k=>d(V(void 0,g),k)}):V(d,g,!0),le=d=>p.state.subscribe({next:g=>{Za(d.name,g.name,d.exact)&&Wa(g,d.formState||f,gn,d.reRenderRoot)&&d.callback({values:{...a},...e,...g})}}).unsubscribe,pe=d=>(o.mount=!0,m={...m,...d.formState},le({...d,formState:m})),se=(d,g={})=>{for(const k of d?it(d):l.mount)l.mount.delete(k),l.array.delete(k),g.keepValue||(me(s,k),me(a,k)),!g.keepError&&me(e.errors,k),!g.keepDirty&&me(e.dirtyFields,k),!g.keepTouched&&me(e.touchedFields,k),!g.keepIsValidating&&me(e.validatingFields,k),!t.shouldUnregister&&!g.keepDefaultValue&&me(n,k);p.state.next({values:ge(a)}),p.state.next({...e,...g.keepDirty?{isDirty:R()}:{}}),!g.keepIsValid&&j()},q=({disabled:d,name:g})=>{(ke(d)&&o.mount||d||l.disabled.has(g))&&(d?l.disabled.add(g):l.disabled.delete(g))},ie=(d,g={})=>{let k=A(s,d);const D=ke(g.disabled)||ke(t.disabled);return ae(s,d,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:d}},name:d,mount:!0,...g}}),l.mount.add(d),k?q({disabled:ke(g.disabled)?g.disabled:t.disabled,name:d}):M(d,!0,g.value),{...D?{disabled:g.disabled||t.disabled}:{},...t.progressive?{required:!!g.required,min:ot(g.min),max:ot(g.max),minLength:ot(g.minLength),maxLength:ot(g.maxLength),pattern:ot(g.pattern)}:{},name:d,onChange:Y,onBlur:Y,ref:O=>{if(O){ie(d,g),k=A(s,d);const C=ue(O.value)&&O.querySelectorAll&&O.querySelectorAll("input,select,textarea")[0]||O,G=Ia(C),oe=k._f.refs||[];if(G?oe.find(ce=>ce===C):C===k._f.ref)return;ae(s,d,{_f:{...k._f,...G?{refs:[...oe.filter(It),C,...Array.isArray(A(n,d))?[{}]:[]],ref:{type:C.type,name:d}}:{ref:C}}}),M(d,!1,void 0,C)}else k=A(s,d,{}),k._f&&(k._f.mount=!1),(t.shouldUnregister||g.shouldUnregister)&&!(ws(l.array,d)&&o.action)&&l.unMount.add(d)}}},de=()=>t.shouldFocusError&<(s,x,l.mount),ne=d=>{ke(d)&&(p.state.next({disabled:d}),lt(s,(g,k)=>{const D=A(s,k);D&&(g.disabled=D._f.disabled||d,Array.isArray(D._f.refs)&&D._f.refs.forEach(O=>{O.disabled=D._f.disabled||d}))},0,!1))},je=(d,g)=>async k=>{let D;k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let O=ge(a);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:C,values:G}=await J();e.errors=C,O=G}else await $(s);if(l.disabled.size)for(const C of l.disabled)ae(O,C,void 0);if(me(e.errors,"root"),be(e.errors)){p.state.next({errors:{}});try{await d(O,k)}catch(C){D=C}}else g&&await g({...e.errors},k),de(),setTimeout(de);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:be(e.errors)&&!D,submitCount:e.submitCount+1,errors:e.errors}),D)throw D},ht=(d,g={})=>{A(s,d)&&(ue(g.defaultValue)?re(d,ge(A(n,d))):(re(d,g.defaultValue),ae(n,d,ge(g.defaultValue))),g.keepTouched||me(e.touchedFields,d),g.keepDirty||(me(e.dirtyFields,d),e.isDirty=g.defaultValue?R(d,ge(A(n,d))):R()),g.keepError||(me(e.errors,d),f.isValid&&j()),p.state.next({...e}))},et=(d,g={})=>{const k=d?ge(d):n,D=ge(k),O=be(d),C=O?n:D;if(g.keepDefaultValues||(n=k),!g.keepValues){if(g.keepDirtyValues){const G=new Set([...l.mount,...Object.keys(at(n,a))]);for(const oe of Array.from(G))A(e.dirtyFields,oe)?ae(C,oe,A(a,oe)):re(oe,A(C,oe))}else{if(sr&&ue(d))for(const G of l.mount){const oe=A(s,G);if(oe&&oe._f){const ce=Array.isArray(oe._f.refs)?oe._f.refs[0]:oe._f.ref;if(St(ce)){const Ee=ce.closest("form");if(Ee){Ee.reset();break}}}}for(const G of l.mount)re(G,A(C,G))}a=ge(C),p.array.next({values:{...C}}),p.state.next({values:{...C}})}l={mount:g.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!g.keepIsValid||!!g.keepDirtyValues,o.watch=!!t.shouldUnregister,p.state.next({submitCount:g.keepSubmitCount?e.submitCount:0,isDirty:O?!1:g.keepDirty?e.isDirty:!!(g.keepDefaultValues&&!Pe(d,n)),isSubmitted:g.keepIsSubmitted?e.isSubmitted:!1,dirtyFields:O?{}:g.keepDirtyValues?g.keepDefaultValues&&a?at(n,a):e.dirtyFields:g.keepDefaultValues&&d?at(n,d):g.keepDirty?e.dirtyFields:{},touchedFields:g.keepTouched?e.touchedFields:{},errors:g.keepErrors?e.errors:{},isSubmitSuccessful:g.keepIsSubmitSuccessful?e.isSubmitSuccessful:!1,isSubmitting:!1})},tt=(d,g)=>et(Se(d)?d(a):d,g),xn=(d,g={})=>{const k=A(s,d),D=k&&k._f;if(D){const O=D.refs?D.refs[0]:D.ref;O.focus&&(O.focus(),g.shouldSelect&&Se(O.select)&&O.select())}},gn=d=>{e={...e,...d}},pr={control:{register:ie,unregister:se,getFieldState:_,handleSubmit:je,setError:B,_subscribe:le,_runSchema:J,_getWatch:V,_getDirty:R,_setValid:j,_setFieldArray:w,_setDisabledField:q,_setErrors:E,_getFieldArray:H,_reset:et,_resetDefaultValues:()=>Se(t.defaultValues)&&t.defaultValues().then(d=>{tt(d,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:ne,_subjects:p,_proxyFormState:f,get _fields(){return s},get _formValues(){return a},get _state(){return o},set _state(d){o=d},get _defaultValues(){return n},get _names(){return l},set _names(d){l=d},get _formState(){return e},get _options(){return t},set _options(d){t={...t,...d}}},subscribe:pe,trigger:X,register:ie,handleSubmit:je,watch:te,setValue:re,getValues:h,reset:tt,resetField:ht,clearErrors:L,unregister:se,setError:B,setFocus:xn,getFieldState:_};return{...pr,formControl:pr}}function Ja(r={}){const t=v.useRef(void 0),e=v.useRef(void 0),[s,n]=v.useState({isDirty:!1,isValidating:!1,isLoading:Se(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:Se(r.defaultValues)?void 0:r.defaultValues});t.current||(t.current={...r.formControl?r.formControl:Xa(r),formState:s},r.formControl&&r.defaultValues&&!Se(r.defaultValues)&&r.formControl.reset(r.defaultValues,r.resetOptions));const a=t.current.control;return a._options=r,ar(()=>{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&&!be(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&&!Pe(r.values,e.current)?(a._reset(r.values,a._options.resetOptions),e.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()}),t.current.formState=Es(s,a),t.current}const Rs={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},Ka={sm:"h-6",md:"h-10",lg:"h-12"},Qa={sm:"px-2",md:"px-2.5",lg:"px-3"};function Dr(r,t,e,s,n,a,o){const l=t?"datetime-local":"date",c=I("box-border w-full rounded-lg border outline-none transition font-[var(--font-primary)]",Rs[e],Ka[e],Qa[e],a?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]"),m=Ma(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:m}),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 Vs(r){const{control:t,name:e,rules:s,defaultValue:n,showTime:a=!1,size:o="sm",width:l="100%",label:c,labelHidden:u=!1,hasError:f=!1,errorMessage:m="",disabled:p=!1,className:b,onChange:N}=r,j=v.useId(),T=e||j;return i.jsxs("div",{className:I("flex flex-col",b),style:{width:l,maxWidth:"100%"},children:[c&&i.jsx("label",{htmlFor:T,className:I("pb-2 text-[var(--color-ds-text-primary)]",Rs[o],u&&"sr-only"),children:c}),t&&e?i.jsx(Fe,{name:e,control:t,rules:s,defaultValue:n,render:({field:w,fieldState:y})=>Dr(T,a,o,{value:w.value,onChange:w.onChange,onBlur:w.onBlur},p,y.error,b)}):Dr(T,a,o,{defaultValue:n,onChange:N},p,f?{message:m}:void 0,b)]})}const eo=({trigger:r,items:t,align:e="left",className:s})=>{const[n,a]=v.useState(!1),o=v.useRef(null),l=v.useRef([]);v.useEffect(()=>{const u=f=>{o.current&&!o.current.contains(f.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const c=u=>{var m,p;const f=l.current.findIndex(b=>b===document.activeElement);if(u.key==="Escape")a(!1);else if(u.key==="ArrowDown"){u.preventDefault();const b=(f+1)%t.length;(m=l.current[b])==null||m.focus()}else if(u.key==="ArrowUp"){u.preventDefault();const b=(f-1+t.length)%t.length;(p=l.current[b])==null||p.focus()}};return i.jsxs("div",{className:I("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:I("absolute mt-2 min-w-[160px] bg-[var(--color-ds-background-page)]","border border-[var(--color-ds-border-muted)] rounded shadow-lg z-10",e==="right"?"right-0":"left-0"),onKeyDown:c,children:t.map((u,f)=>{const{label:m,onSelect:p,disabled:b,icon:N}=u;return i.jsxs("button",{role:"menuitem",type:"button",disabled:b,ref:j=>{l.current[f]=j},className:I("w-full flex items-center px-4 py-2 text-[var(--color-ds-text-primary)] text-ds-md transition-colors",b?"opacity-50 cursor-not-allowed":"hover:bg-[var(--color-ds-background-surface)]"),onClick:()=>{b||(p(),a(!1))},children:[N&&i.jsx(N,{className:"w-5 h-5 mr-2 text-[var(--color-ds-text-secondary)]"}),m]},f)})})]})},to=(r,t,e,s)=>{var a,o,l,c;const n=[e,{code:t,...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);We(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)},Ir={},Ht=(r,t,e,s)=>{We(e)&&Ir[e]||(We(e)&&(Ir[e]=new Date),to(r,t,e,s))},$s=(r,t)=>()=>{if(r.isInitialized)t();else{const e=()=>{setTimeout(()=>{r.off("initialized",e)},0),t()};r.on("initialized",e)}},Yt=(r,t,e)=>{r.loadNamespaces(t,$s(r,e))},Lr=(r,t,e,s)=>{if(We(e)&&(e=[e]),r.options.preload&&r.options.preload.indexOf(t)>-1)return Yt(r,e,s);e.forEach(n=>{r.options.ns.indexOf(n)<0&&r.options.ns.push(n)}),r.loadLanguages(t,$s(r,s))},ro=(r,t,e={})=>!t.languages||!t.languages.length?(Ht(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(r,{lng:e.lng,precheck:(s,n)=>{var a;if(((a=e.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,r))return!1}}),We=r=>typeof r=="string",so=r=>typeof r=="object"&&r!==null,no=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ao={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},oo=r=>ao[r],io=r=>r.replace(no,oo);let lo={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:io};const co=()=>lo;let uo;const fo=()=>uo,ho=v.createContext();class mo{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const po=(r,t)=>{const e=v.useRef();return v.useEffect(()=>{e.current=r},[r,t]),e.current},Ds=(r,t,e,s)=>r.getFixedT(t,e,s),xo=(r,t,e,s)=>v.useCallback(Ds(r,t,e,s),[r,t,e,s]),cr=(r,t={})=>{var M,F,W,J;const{i18n:e}=t,{i18n:s,defaultNS:n}=v.useContext(ho)||{},a=e||s||fo();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new mo),!a){Ht(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const S=(P,R)=>We(R)?R:so(R)&&We(R.defaultValue)?R.defaultValue:Array.isArray(P)?P[P.length-1]:P,$=[S,{},!1];return $.t=S,$.i18n={},$.ready=!1,$}(M=a.options.react)!=null&&M.wait&&Ht(a,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...co(),...a.options.react,...t},{useSuspense:l,keyPrefix:c}=o;let u=n||((F=a.options)==null?void 0:F.defaultNS);u=We(u)?[u]:u||["translation"],(J=(W=a.reportNamespaces).addUsedNamespaces)==null||J.call(W,u);const f=(a.isInitialized||a.initializedStoreOnce)&&u.every(S=>ro(S,a,o)),m=xo(a,t.lng||null,o.nsMode==="fallback"?u:u[0],c),p=()=>m,b=()=>Ds(a,t.lng||null,o.nsMode==="fallback"?u:u[0],c),[N,j]=v.useState(p);let T=u.join();t.lng&&(T=`${t.lng}${T}`);const w=po(T),y=v.useRef(!0);v.useEffect(()=>{const{bindI18n:S,bindI18nStore:$}=o;y.current=!0,!f&&!l&&(t.lng?Lr(a,t.lng,u,()=>{y.current&&j(b)}):Yt(a,u,()=>{y.current&&j(b)})),f&&w&&w!==T&&y.current&&j(b);const P=()=>{y.current&&j(b)};return S&&(a==null||a.on(S,P)),$&&(a==null||a.store.on($,P)),()=>{y.current=!1,a&&(S==null||S.split(" ").forEach(R=>a.off(R,P))),$&&a&&$.split(" ").forEach(R=>a.store.off(R,P))}},[a,T]),v.useEffect(()=>{y.current&&f&&j(p)},[a,c,f]);const E=[N,a,f];if(E.t=N,E.i18n=a,E.ready=f,f||!f&&!l)return E;throw new Promise(S=>{t.lng?Lr(a,t.lng,u,()=>S()):Yt(a,u,()=>S())})},Xt={sm:"text-sm",md:"text-base",lg:"text-lg"};function Pr(r,t,e,s,n,a,o,l,c){const{t:u}=cr(),f=v.useRef(null),m=typeof s=="number"&&t.length>=s,p=()=>{var y;!o&&!m&&((y=f.current)==null||y.click())},b=y=>{const E=y.target.files;if(!E)return;const M=Array.from(E);let F=t.concat(M);s&&(F=F.slice(0,s)),e(F),y.target.value=""},N=y=>{if(y.preventDefault(),o||m)return;const E=Array.from(y.dataTransfer.files);let M=t.concat(E);s&&(M=M.slice(0,s)),e(M)},j=y=>{y.preventDefault()},T=y=>{const E=URL.createObjectURL(y);window.open(E)},w=y=>{const E=t.filter((M,F)=>F!==y);e(E)};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"self-start mb-4 w-auto",children:i.jsx($e,{type:"button",variant:"outline",size:a,icon:wr,onClick:p,disabled:o||m,children:u("ds.fileUploader.browse","Browse files")})}),!m&&i.jsxs("div",{className:I("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)]",Xt[a],c),onDrop:N,onDragOver:j,children:[i.jsx("input",{id:r,type:"file",ref:f,className:"hidden",multiple:s!==1,accept:n,onChange:b,disabled:o}),i.jsx(Ce,{component:Pn,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")})]}),t.length>0&&i.jsx("ul",{className:"mt-4 space-y-1",children:t.map((y,E)=>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(wr,{className:"w-4 h-4 mr-2","aria-hidden":"true"}),i.jsx("span",{className:"truncate pr-2",children:y.name})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx($e,{variant:"ghost",size:"sm",icon:ls,ariaLabel:u("ds.fileUploader.view","View"),onClick:()=>T(y)}),i.jsx($e,{variant:"ghost",size:"sm",icon:tr,ariaLabel:u("ds.fileUploader.remove","Remove"),onClick:()=>w(E)})]})]},E))}),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 Is(r){const{control:t,name:e,rules:s,defaultValue:n,maxFiles:a,accept:o,size:l="sm",width:c="100%",label:u,labelHidden:f=!1,disabled:m=!1,hasError:p=!1,errorMessage:b="",className:N}=r,j=v.useId(),T=e||j;if(t&&e)return i.jsxs("div",{className:I("flex flex-col",N),style:{width:c},children:[u&&i.jsx("label",{htmlFor:T,className:I("pb-[10px] text-[var(--color-ds-text-primary)]",Xt[l],f&&"sr-only"),children:u}),i.jsx(Fe,{name:e,control:t,rules:s,defaultValue:n instanceof FileList?Array.from(n):n||[],render:({field:E,fieldState:M})=>Pr(T,E.value,F=>E.onChange(F),a,o,l,m,M.error,N)})]});const[w,y]=v.useState(n instanceof FileList?Array.from(n):n||[]);return i.jsxs("div",{className:I("flex flex-col",N),style:{width:c},children:[u&&i.jsx("label",{htmlFor:T,className:I("pb-[10px] text-[var(--color-ds-text-primary)]",Xt[l],f&&"sr-only"),children:u}),Pr(T,w,y,a,o,l,m,p?{message:b}:void 0,N)]})}const qe=({count:r=1,width:t,height:e="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:I("bg-[var(--color-ds-border-muted)] animate-pulse inline-block",s==="circle"?"rounded-full":"rounded",n),style:{width:t??"auto",height:e}},l))})},bt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},go={sm:"h-6",md:"h-10",lg:"h-12"},bo={sm:"px-2",md:"px-2.5",lg:"px-3"},zr={sm:"pl-2",md:"pl-2.5",lg:"pl-3"},yo={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function Mt({id:r,type:t="text",size:e="sm",width:s="100%",label:n,labelHidden:a=!1,hasError:o=!1,errorMessage:l="",prefixIcon:c,suffixIcon:u,separator:f,suffixButton:m,disabled:p=!1,control:b,name:N,rules:j,defaultValue:T,loading:w=!1,className:y,...E}){const M=v.useId(),[F,W]=v.useState(!1),J=r||M,S=t==="password",P=c??(t==="number"?qn:void 0),R=S?F?Bn:ls:u,V=I("box-border w-full rounded-lg border placeholder-[var(--color-ds-text-secondary)] outline-none transition font-[var(--font-primary)] appearance-none",bt[e],go[e],bo[e],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 w?i.jsxs("div",{className:"flex flex-col",style:{width:s,maxWidth:"100%"},children:[!a&&n&&i.jsx("label",{htmlFor:J,className:I("pb-2",bt[e]),children:n}),i.jsx(qe,{width:"100%",height:yo[e],variant:"rect",className:"rounded-lg"}),i.jsx("div",{className:"min-h-[18px] w-full",children:i.jsx("span",{"aria-hidden":"true",children:" "})})]}):b&&N?i.jsx(Fe,{name:N,control:b,rules:j,defaultValue:T,render:({field:H,fieldState:K})=>i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:J,className:I("pb-2 text-[var(--color-ds-text-primary)]",bt[e]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[P&&i.jsx("div",{className:I("absolute left-0 flex items-center h-full",zr[e]),children:i.jsx(Ce,{component:P,size:e,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...H,id:J,type:S?F?"text":"password":t,disabled:p,"aria-invalid":!!K.error,className:I(V,P&&"pl-9",R&&"pr-9",y),onInvalid:Q=>Q.preventDefault(),style:S&&!F?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),f&&i.jsx("div",{className:"flex items-center h-full",children:f}),m&&i.jsx("div",{className:"flex items-center h-full pr-2",children:m}),R&&i.jsx("button",{type:"button",onClick:()=>W(Q=>!Q),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Ce,{component:R,size:e,className:"text-[var(--color-ds-text-secondary)]"})})]}),i.jsx("div",{className:"min-h-[18px]",children:K.error?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:K.error.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}):i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:J,className:I("pb-2 text-[var(--color-ds-text-primary)]",bt[e]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[P&&i.jsx("div",{className:I("absolute left-0 flex items-center h-full",zr[e]),children:i.jsx(Ce,{component:P,size:e,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...E,id:J,type:S?F?"text":"password":t,disabled:p,"aria-invalid":o,className:I(V,P&&"pl-9",R&&"pr-9",y),onInvalid:H=>H.preventDefault(),style:S&&!F?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),f&&i.jsx("div",{className:"flex items-center h-full",children:f}),m&&i.jsx("div",{className:"flex items-center h-full",children:m}),R&&i.jsx("button",{type:"button",onClick:()=>W(H=>!H),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Ce,{component:R,size:e,className:"text-[var(--color-ds-text-secondary)]"})})]}),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:" "})})]})}const vo={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},Lt=400,yt=8,Ls=({children:r,size:t="sm",position:e="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 p=c.current.getBoundingClientRect();let b=0,N=0;switch(e){case"top":b=p.left+p.width/2-Lt/2,N=p.top-yt;break;case"bottom":b=p.left+p.width/2-Lt/2,N=p.bottom+yt;break;case"left":b=p.left-Lt-yt,N=p.top+p.height/2;break;case"right":b=p.right+yt,N=p.top+p.height/2;break}l({x:b,y:N})}},[n,e]);const f=()=>typeof r=="string"?i.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):i.jsx(i.Fragment,{children:r}),m=n?i.jsx("div",{id:u,role:"tooltip",className:I("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:e==="left"||e==="right"?"translateY(-50%)":e==="top"?"translateY(-100%)":void 0},children:f()}):null;return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button","aria-describedby":u,ref:c,className:I("inline-flex items-center justify-center focus:outline-none",vo[t],"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(Hn,{className:"w-full h-full"})}),as.createPortal(m,document.body)]})};function wo({name:r,label:t,type:e="text",size:s="sm",width:n,placeholder:a,validation:o,loadingDefaults:l,disabled:c,info:u}){var T;const{control:f,formState:{errors:m}}=ut(),p=!!m[r],b=((T=m[r])==null?void 0:T.message)||"",N="relative",j=n??"w-full";return i.jsxs("div",{className:N,children:[i.jsx(Fe,{name:r,control:f,rules:o,render:({field:w})=>i.jsx(Mt,{label:t,size:s,width:j,placeholder:a,hasError:p,errorMessage:b,loading:l,type:e,...w,disabled:c})}),u&&i.jsx(Ls,{size:s,position:"left",className:"absolute top-1/2 right-2 -translate-y-1/2",children:u})]})}const dr=v.memo(wo);dr.displayName="FormFieldInput";function ko({title:r,headerButtons:t,children:e,className:s}){return i.jsxs("div",{className:I("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} />`,B,H,ne,H),K[H+B]=!0)}if(H=null,L!==void 0&&(e(L),H=""+L),o(F)&&(e(F.key),H=""+F.key),"key"in F){L={};for(var de in F)de!=="key"&&(L[de]=F[de])}else L=F;return H&&l(L,typeof m=="function"?m.displayName||m.name||"Unknown":m),u(m,H,le,re,n(),L,pe,se)}function p(m){typeof m=="object"&&m!==null&&m.$$typeof===b&&m._store&&(m._store.validated=1)}var x=v,b=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),N=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),G=Symbol.for("react.client.reference"),R=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,X=Array.isArray,ee=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function(m){return m()}};var I,J={},Z=x["react-stack-bottom-frame"].bind(x,a)(),h=ee(s(a)),K={};st.Fragment=j,st.jsx=function(m,F,L,B,re){var le=1e4>R.recentlyCreatedOwnerStacks++;return f(m,F,L,!1,B,re,le?Error("react-stack-top-frame"):Z,le?ee(s(m)):h)},st.jsxs=function(m,F,L,B,re){var le=1e4>R.recentlyCreatedOwnerStacks++;return f(m,F,L,!0,B,re,le?Error("react-stack-top-frame"):Z,le?ee(s(m)):h)}}()),st}var vr;function Nn(){return vr||(vr=1,process.env.NODE_ENV==="production"?pt.exports=jn():pt.exports=En()),pt.exports}var i=Nn();function os(r){var t,e,s="";if(typeof r=="string"||typeof r=="number")s+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(t=0;t<n;t++)r[t]&&(e=os(r[t]))&&(s&&(s+=" "),s+=e)}else for(e in r)r[e]&&(s&&(s+=" "),s+=e);return s}function $(){for(var r,t,e=0,s="",n=arguments.length;e<n;e++)(r=arguments[e])&&(t=os(r))&&(s&&(s+=" "),s+=t);return s}const Sn={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 Ce({component:r,size:t="sm",className:e,...s}){return i.jsx(r,{className:$(Sn[t],e),"aria-hidden":s["aria-label"]?void 0:!0,...s})}const _n="inline-flex items-center justify-center box-border font-[var(--font-primary)] font-medium rounded-lg transition focus:outline-none",Fn={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"},Tn={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"},Cn={sm:"h-6 w-6 p-0",md:"h-10 w-10 p-0",lg:"h-12 w-12 p-0"},On="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 $e({type:r="button",variant:t="primary",size:e="sm",width:s,disabled:n=!1,icon:a,iconPosition:o="left",ariaLabel:l,children:c,onClick:u,className:f}){const p=!!a,x=p&&!c,b=x?Cn[e]:Tn[e];return i.jsxs("button",{type:r,onClick:u,disabled:n,"aria-label":x?l:void 0,style:s?{width:s}:void 0,className:$(_n,Fn[t],b,On,f,p&&c&&"gap-2"),children:[a&&o==="left"&&i.jsx(Ce,{component:a,size:e}),c,a&&o==="right"&&i.jsx(Ce,{component:a,size:e})]})}function An({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const Mn=q.forwardRef(An);function Rn({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const is=q.forwardRef(Rn);function Vn({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const $n=q.forwardRef(Vn);function Dn({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const In=q.forwardRef(Dn);function Ln({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.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 Pn=q.forwardRef(Ln);function zn({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.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 wr=q.forwardRef(zn);function Un({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.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 Bn=q.forwardRef(Un);function Wn({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.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"}),q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const ls=q.forwardRef(Wn);function Zn({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.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 qn=q.forwardRef(Zn);function Gn({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.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 Hn=q.forwardRef(Gn);function Yn({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.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 Xn=q.forwardRef(Yn);function Kn({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.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 Jn=q.forwardRef(Kn);function Qn({title:r,titleId:t,...e},s){return q.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":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const tr=q.forwardRef(Qn);function Bt({title:r,children:t,defaultOpen:e=!0,className:s}){const[n,a]=v.useState(e),o=v.useRef(null),l=v.useRef(null),[c,u]=v.useState(0),f=()=>{if(l.current){const p=l.current.scrollHeight;u(p)}};return v.useLayoutEffect(()=>{f()},[n]),v.useEffect(()=>{const p=l.current;if(!p)return;const x=new ResizeObserver(()=>{f()});return x.observe(p),()=>{x.disconnect()}},[]),i.jsxs("div",{className:$("flex flex-col w-full gap-3",s),children:[i.jsxs("button",{type:"button",onClick:()=>a(p=>!p),className:"flex items-center justify-between w-full hover:bg-[var(--color-ds-surface-hover)] transition-colors",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})]}),n?i.jsx(In,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"}):i.jsx(is,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"})]}),i.jsx("div",{className:"box-border w-full rounded-lg bg-[var(--color-ds-background-surface)] overflow-hidden",children:i.jsx("div",{className:"px-6",children:i.jsx("div",{ref:o,className:$("overflow-hidden transition-all duration-300 ease-in-out",n?"opacity-100":"opacity-0"),style:{maxHeight:n?`${c}px`:"0px"},children:i.jsx("div",{ref:l,className:"py-4",children:t})})})})]})}const rr="-",ea=r=>{const t=ra(r),{conflictingClassGroups:e,conflictingClassGroupModifiers:s}=r;return{getClassGroupId:o=>{const l=o.split(rr);return l[0]===""&&l.length!==1&&l.shift(),cs(l,t)||ta(o)},getConflictingClassGroupIds:(o,l)=>{const c=e[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},cs=(r,t)=>{var o;if(r.length===0)return t.classGroupId;const e=r[0],s=t.nextPart.get(e),n=s?cs(r.slice(1),s):void 0;if(n)return n;if(t.validators.length===0)return;const a=r.join(rr);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},kr=/^\[(.+)\]$/,ta=r=>{if(kr.test(r)){const t=kr.exec(r)[1],e=t==null?void 0:t.substring(0,t.indexOf(":"));if(e)return"arbitrary.."+e}},ra=r=>{const{theme:t,classGroups:e}=r,s={nextPart:new Map,validators:[]};for(const n in e)Wt(e[n],s,n,t);return s},Wt=(r,t,e,s)=>{r.forEach(n=>{if(typeof n=="string"){const a=n===""?t:jr(t,n);a.classGroupId=e;return}if(typeof n=="function"){if(sa(n)){Wt(n(s),t,e,s);return}t.validators.push({validator:n,classGroupId:e});return}Object.entries(n).forEach(([a,o])=>{Wt(o,jr(t,a),e,s)})})},jr=(r,t)=>{let e=r;return t.split(rr).forEach(s=>{e.nextPart.has(s)||e.nextPart.set(s,{nextPart:new Map,validators:[]}),e=e.nextPart.get(s)}),e},sa=r=>r.isThemeGetter,na=r=>{if(r<1)return{get:()=>{},set:()=>{}};let t=0,e=new Map,s=new Map;const n=(a,o)=>{e.set(a,o),t++,t>r&&(t=0,s=e,e=new Map)};return{get(a){let o=e.get(a);if(o!==void 0)return o;if((o=s.get(a))!==void 0)return n(a,o),o},set(a,o){e.has(a)?e.set(a,o):n(a,o)}}},Zt="!",qt=":",aa=qt.length,oa=r=>{const{prefix:t,experimentalParseClassName:e}=r;let s=n=>{const a=[];let o=0,l=0,c=0,u;for(let E=0;E<n.length;E++){let j=n[E];if(o===0&&l===0){if(j===qt){a.push(n.slice(c,E)),c=E+aa;continue}if(j==="/"){u=E;continue}}j==="["?o++:j==="]"?o--:j==="("?l++:j===")"&&l--}const f=a.length===0?n:n.substring(c),p=ia(f),x=p!==f,b=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:x,baseClassName:p,maybePostfixModifierPosition:b}};if(t){const n=t+qt,a=s;s=o=>o.startsWith(n)?a(o.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(e){const n=s;s=a=>e({className:a,parseClassName:n})}return s},ia=r=>r.endsWith(Zt)?r.substring(0,r.length-1):r.startsWith(Zt)?r.substring(1):r,la=r=>{const t=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]==="["||t[o]?(n.push(...a.sort(),o),a=[]):a.push(o)}),n.push(...a.sort()),n}},ca=r=>({cache:na(r.cacheSize),parseClassName:oa(r),sortModifiers:la(r),...ea(r)}),da=/\s+/,ua=(r,t)=>{const{parseClassName:e,getClassGroupId:s,getConflictingClassGroupIds:n,sortModifiers:a}=t,o=[],l=r.trim().split(da);let c="";for(let u=l.length-1;u>=0;u-=1){const f=l[u],{isExternal:p,modifiers:x,hasImportantModifier:b,baseClassName:E,maybePostfixModifierPosition:j}=e(f);if(p){c=f+(c.length>0?" "+c:c);continue}let T=!!j,w=s(T?E.substring(0,j):E);if(!w){if(!T){c=f+(c.length>0?" "+c:c);continue}if(w=s(E),!w){c=f+(c.length>0?" "+c:c);continue}T=!1}const y=a(x).join(":"),N=b?y+Zt:y,O=N+w;if(o.includes(O))continue;o.push(O);const _=n(w,T);for(let D=0;D<_.length;++D){const Q=_[D];o.push(N+Q)}c=f+(c.length>0?" "+c:c)}return c};function fa(){let r=0,t,e,s="";for(;r<arguments.length;)(t=arguments[r++])&&(e=ds(t))&&(s&&(s+=" "),s+=e);return s}const ds=r=>{if(typeof r=="string")return r;let t,e="";for(let s=0;s<r.length;s++)r[s]&&(t=ds(r[s]))&&(e&&(e+=" "),e+=t);return e};function ha(r,...t){let e,s,n,a=o;function o(c){const u=t.reduce((f,p)=>p(f),r());return e=ca(u),s=e.cache.get,n=e.cache.set,a=l,l(c)}function l(c){const u=s(c);if(u)return u;const f=ua(c,e);return n(c,f),f}return function(){return a(fa.apply(null,arguments))}}const he=r=>{const t=e=>e[r]||[];return t.isThemeGetter=!0,t},us=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ma=/^\d+\/\d+$/,pa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xa=/\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$/,ga=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ba=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ya=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,He=r=>ma.test(r),te=r=>!!r&&!Number.isNaN(Number(r)),Ie=r=>!!r&&Number.isInteger(Number(r)),$t=r=>r.endsWith("%")&&te(r.slice(0,-1)),Ae=r=>pa.test(r),va=()=>!0,wa=r=>xa.test(r)&&!ga.test(r),hs=()=>!1,ka=r=>ba.test(r),ja=r=>ya.test(r),Ea=r=>!z(r)&&!U(r),Na=r=>Je(r,xs,hs),z=r=>us.test(r),Ue=r=>Je(r,gs,wa),Dt=r=>Je(r,Ca,te),Er=r=>Je(r,ms,hs),Sa=r=>Je(r,ps,ja),xt=r=>Je(r,bs,ka),U=r=>fs.test(r),nt=r=>Qe(r,gs),_a=r=>Qe(r,Oa),Nr=r=>Qe(r,ms),Fa=r=>Qe(r,xs),Ta=r=>Qe(r,ps),gt=r=>Qe(r,bs,!0),Je=(r,t,e)=>{const s=us.exec(r);return s?s[1]?t(s[1]):e(s[2]):!1},Qe=(r,t,e=!1)=>{const s=fs.exec(r);return s?s[1]?t(s[1]):e:!1},ms=r=>r==="position"||r==="percentage",ps=r=>r==="image"||r==="url",xs=r=>r==="length"||r==="size"||r==="bg-size",gs=r=>r==="length",Ca=r=>r==="number",Oa=r=>r==="family-name",bs=r=>r==="shadow",Aa=()=>{const r=he("color"),t=he("font"),e=he("text"),s=he("font-weight"),n=he("tracking"),a=he("leading"),o=he("breakpoint"),l=he("container"),c=he("spacing"),u=he("radius"),f=he("shadow"),p=he("inset-shadow"),x=he("text-shadow"),b=he("drop-shadow"),E=he("blur"),j=he("perspective"),T=he("aspect"),w=he("ease"),y=he("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...O(),U,z],D=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],S=()=>[U,z,c],W=()=>[He,"full","auto",...S()],G=()=>[Ie,"none","subgrid",U,z],R=()=>["auto",{span:["full",Ie,U,z]},Ie,U,z],P=()=>[Ie,"auto",U,z],X=()=>["auto","min","max","fr",U,z],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],I=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...S()],Z=()=>[He,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],h=()=>[r,U,z],K=()=>[...O(),Nr,Er,{position:[U,z]}],m=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",Fa,Na,{size:[U,z]}],L=()=>[$t,nt,Ue],B=()=>["","none","full",u,U,z],re=()=>["",te,nt,Ue],le=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[te,$t,Nr,Er],H=()=>["","none",E,U,z],ne=()=>["none",te,U,z],de=()=>["none",te,U,z],ae=()=>[te,U,z],je=()=>[He,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ae],breakpoint:[Ae],color:[va],container:[Ae],"drop-shadow":[Ae],ease:["in","out","in-out"],font:[Ea],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ae],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ae],shadow:[Ae],spacing:["px",te],text:[Ae],"text-shadow":[Ae],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",He,z,U,T]}],container:["container"],columns:[{columns:[te,z,U,l]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:_()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:W()}],"inset-x":[{"inset-x":W()}],"inset-y":[{"inset-y":W()}],start:[{start:W()}],end:[{end:W()}],top:[{top:W()}],right:[{right:W()}],bottom:[{bottom:W()}],left:[{left:W()}],visibility:["visible","invisible","collapse"],z:[{z:[Ie,"auto",U,z]}],basis:[{basis:[He,"full","auto",l,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[te,He,"auto","initial","none",z]}],grow:[{grow:["",te,U,z]}],shrink:[{shrink:["",te,U,z]}],order:[{order:[Ie,"first","last","none",U,z]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...I(),"normal"]}],"justify-self":[{"justify-self":["auto",...I()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...I(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...I(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...I(),"baseline"]}],"place-self":[{"place-self":["auto",...I()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],w:[{w:[l,"screen",...Z()]}],"min-w":[{"min-w":[l,"screen","none",...Z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",e,nt,Ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,U,Dt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$t,z]}],"font-family":[{font:[_a,z,t]}],"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":[te,"none",U,Dt]}],leading:[{leading:[a,...S()]}],"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:h()}],"text-color":[{text:h()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[te,"from-font","auto",U,Ue]}],"text-decoration-color":[{decoration:h()}],"underline-offset":[{"underline-offset":[te,"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:S()}],"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:K()}],"bg-repeat":[{bg:m()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ie,U,z],radial:["",U,z],conic:[Ie,U,z]},Ta,Sa]}],"bg-color":[{bg:h()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:h()}],"gradient-via":[{via:h()}],"gradient-to":[{to:h()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:h()}],"border-color-x":[{"border-x":h()}],"border-color-y":[{"border-y":h()}],"border-color-s":[{"border-s":h()}],"border-color-e":[{"border-e":h()}],"border-color-t":[{"border-t":h()}],"border-color-r":[{"border-r":h()}],"border-color-b":[{"border-b":h()}],"border-color-l":[{"border-l":h()}],"divide-color":[{divide:h()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[te,U,z]}],"outline-w":[{outline:["",te,nt,Ue]}],"outline-color":[{outline:h()}],shadow:[{shadow:["","none",f,gt,xt]}],"shadow-color":[{shadow:h()}],"inset-shadow":[{"inset-shadow":["none",p,gt,xt]}],"inset-shadow-color":[{"inset-shadow":h()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:h()}],"ring-offset-w":[{"ring-offset":[te,Ue]}],"ring-offset-color":[{"ring-offset":h()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":h()}],"text-shadow":[{"text-shadow":["none",x,gt,xt]}],"text-shadow-color":[{"text-shadow":h()}],opacity:[{opacity:[te,U,z]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"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":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":h()}],"mask-image-linear-to-color":[{"mask-linear-to":h()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":h()}],"mask-image-t-to-color":[{"mask-t-to":h()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":h()}],"mask-image-r-to-color":[{"mask-r-to":h()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":h()}],"mask-image-b-to-color":[{"mask-b-to":h()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":h()}],"mask-image-l-to-color":[{"mask-l-to":h()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":h()}],"mask-image-x-to-color":[{"mask-x-to":h()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":h()}],"mask-image-y-to-color":[{"mask-y-to":h()}],"mask-image-radial":[{"mask-radial":[U,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":h()}],"mask-image-radial-to-color":[{"mask-radial-to":h()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[te]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":h()}],"mask-image-conic-to-color":[{"mask-conic-to":h()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:m()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",U,z]}],filter:[{filter:["","none",U,z]}],blur:[{blur:H()}],brightness:[{brightness:[te,U,z]}],contrast:[{contrast:[te,U,z]}],"drop-shadow":[{"drop-shadow":["","none",b,gt,xt]}],"drop-shadow-color":[{"drop-shadow":h()}],grayscale:[{grayscale:["",te,U,z]}],"hue-rotate":[{"hue-rotate":[te,U,z]}],invert:[{invert:["",te,U,z]}],saturate:[{saturate:[te,U,z]}],sepia:[{sepia:["",te,U,z]}],"backdrop-filter":[{"backdrop-filter":["","none",U,z]}],"backdrop-blur":[{"backdrop-blur":H()}],"backdrop-brightness":[{"backdrop-brightness":[te,U,z]}],"backdrop-contrast":[{"backdrop-contrast":[te,U,z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",te,U,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[te,U,z]}],"backdrop-invert":[{"backdrop-invert":["",te,U,z]}],"backdrop-opacity":[{"backdrop-opacity":[te,U,z]}],"backdrop-saturate":[{"backdrop-saturate":[te,U,z]}],"backdrop-sepia":[{"backdrop-sepia":["",te,U,z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"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:[te,"initial",U,z]}],ease:[{ease:["linear","initial",w,U,z]}],delay:[{delay:[te,U,z]}],animate:[{animate:["none",y,U,z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,U,z]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[U,z,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:h()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:h()}],"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":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",...h()]}],"stroke-w":[{stroke:[te,nt,Ue,Dt]}],stroke:[{stroke:["none",...h()]}],"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"]}},Ma=ha(Aa);var dt=r=>r.type==="checkbox",Be=r=>r instanceof Date,ye=r=>r==null;const ys=r=>typeof r=="object";var fe=r=>!ye(r)&&!Array.isArray(r)&&ys(r)&&!Be(r),vs=r=>fe(r)&&r.target?dt(r.target)?r.target.checked:r.target.value:r,Ra=r=>r.substring(0,r.search(/\.\d+(\.|$)/))||r,ws=(r,t)=>r.has(Ra(t)),Va=r=>{const t=r.constructor&&r.constructor.prototype;return fe(t)&&t.hasOwnProperty("isPrototypeOf")},sr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ge(r){let t;const e=Array.isArray(r),s=typeof FileList<"u"?r instanceof FileList:!1;if(r instanceof Date)t=new Date(r);else if(r instanceof Set)t=new Set(r);else if(!(sr&&(r instanceof Blob||s))&&(e||fe(r)))if(t=e?[]:{},!e&&!Va(r))t=r;else for(const n in r)r.hasOwnProperty(n)&&(t[n]=ge(r[n]));else return r;return t}var At=r=>Array.isArray(r)?r.filter(Boolean):[],ue=r=>r===void 0,M=(r,t,e)=>{if(!t||!fe(r))return e;const s=At(t.split(/[,[\].]+?/)).reduce((n,a)=>ye(n)?n:n[a],r);return ue(s)||s===r?ue(r[t])?e:r[t]:s},ke=r=>typeof r=="boolean",nr=r=>/^\w*$/.test(r),ks=r=>At(r.replace(/["|']|\]/g,"").split(/\.|\[/)),oe=(r,t,e)=>{let s=-1;const n=nr(t)?[t]:ks(t),a=n.length,o=a-1;for(;++s<a;){const l=n[s];let c=e;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 St={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Se={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Me={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},js=v.createContext(null),ut=()=>v.useContext(js),$a=r=>{const{children:t,...e}=r;return v.createElement(js.Provider,{value:e},t)};var Es=(r,t,e,s=!0)=>{const n={defaultValues:t._defaultValues};for(const a in r)Object.defineProperty(n,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Se.all&&(t._proxyFormState[o]=!s||Se.all),e&&(e[o]=!0),r[o]}});return n};const ar=typeof window<"u"?q.useLayoutEffect:q.useEffect;function Da(r){const t=ut(),{control:e=t.control,disabled:s,name:n,exact:a}=r||{},[o,l]=v.useState(e._formState),c=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ar(()=>e._subscribe({name:n,formState:c.current,exact:a,callback:u=>{!s&&l({...e._formState,...u})}}),[n,s,a]),v.useEffect(()=>{c.current.isValid&&e._setValid(!0)},[e]),v.useMemo(()=>Es(o,e,c.current,!1),[o,e])}var Oe=r=>typeof r=="string",Ns=(r,t,e,s,n)=>Oe(r)?(s&&t.watch.add(r),M(e,r,n)):Array.isArray(r)?r.map(a=>(s&&t.watch.add(a),M(e,a))):(s&&(t.watchAll=!0),e);function or(r){const t=ut(),{control:e=t.control,name:s,defaultValue:n,disabled:a,exact:o}=r||{},l=v.useRef(n),[c,u]=v.useState(e._getWatch(s,l.current));return ar(()=>e._subscribe({name:s,formState:{values:!0},exact:o,callback:f=>!a&&u(Ns(s,e._names,f.values||e._formValues,!1,l.current))}),[s,e,a,o]),v.useEffect(()=>e._removeUnmounted()),c}function Ss(r){const t=ut(),{name:e,disabled:s,control:n=t.control,shouldUnregister:a}=r,o=ws(n._names.array,e),l=or({control:n,name:e,defaultValue:M(n._formValues,e,M(n._defaultValues,e,r.defaultValue)),exact:!0}),c=Da({control:n,name:e,exact:!0}),u=v.useRef(r),f=v.useRef(n.register(e,{...r.rules,value:l,...ke(r.disabled)?{disabled:r.disabled}:{}})),p=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!M(c.errors,e)},isDirty:{enumerable:!0,get:()=>!!M(c.dirtyFields,e)},isTouched:{enumerable:!0,get:()=>!!M(c.touchedFields,e)},isValidating:{enumerable:!0,get:()=>!!M(c.validatingFields,e)},error:{enumerable:!0,get:()=>M(c.errors,e)}}),[c,e]),x=v.useCallback(T=>f.current.onChange({target:{value:vs(T),name:e},type:St.CHANGE}),[e]),b=v.useCallback(()=>f.current.onBlur({target:{value:M(n._formValues,e),name:e},type:St.BLUR}),[e,n._formValues]),E=v.useCallback(T=>{const w=M(n._fields,e);w&&T&&(w._f.ref={focus:()=>T.focus(),select:()=>T.select(),setCustomValidity:y=>T.setCustomValidity(y),reportValidity:()=>T.reportValidity()})},[n._fields,e]),j=v.useMemo(()=>({name:e,value:l,...ke(s)||c.disabled?{disabled:c.disabled||s}:{},onChange:x,onBlur:b,ref:E}),[e,s,c.disabled,x,b,E,l]);return v.useEffect(()=>{const T=n._options.shouldUnregister||a;n.register(e,{...u.current.rules,...ke(u.current.disabled)?{disabled:u.current.disabled}:{}});const w=(y,N)=>{const O=M(n._fields,y);O&&O._f&&(O._f.mount=N)};if(w(e,!0),T){const y=ge(M(n._options.defaultValues,e));oe(n._defaultValues,e,y),ue(M(n._formValues,e))&&oe(n._formValues,e,y)}return!o&&n.register(e),()=>{(o?T&&!n._state.action:T)?n.unregister(e):w(e,!1)}},[e,n,o,a]),v.useEffect(()=>{n._setDisabledField({disabled:s,name:e})},[s,e,n]),v.useMemo(()=>({field:j,formState:c,fieldState:p}),[j,c,p])}const Fe=r=>r.render(Ss(r));var _s=(r,t,e,s,n)=>t?{...e[r],types:{...e[r]&&e[r].types?e[r].types:{},[s]:n||!0}}:{},it=r=>Array.isArray(r)?r:[r],Sr=()=>{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=[]}}},Gt=r=>ye(r)||!ys(r);function Pe(r,t){if(Gt(r)||Gt(t))return r===t;if(Be(r)&&Be(t))return r.getTime()===t.getTime();const e=Object.keys(r),s=Object.keys(t);if(e.length!==s.length)return!1;for(const n of e){const a=r[n];if(!s.includes(n))return!1;if(n!=="ref"){const o=t[n];if(Be(a)&&Be(o)||fe(a)&&fe(o)||Array.isArray(a)&&Array.isArray(o)?!Pe(a,o):a!==o)return!1}}return!0}var be=r=>fe(r)&&!Object.keys(r).length,ir=r=>r.type==="file",_e=r=>typeof r=="function",_t=r=>{if(!sr)return!1;const t=r?r.ownerDocument:0;return r instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Fs=r=>r.type==="select-multiple",lr=r=>r.type==="radio",Ia=r=>lr(r)||dt(r),It=r=>_t(r)&&r.isConnected;function La(r,t){const e=t.slice(0,-1).length;let s=0;for(;s<e;)r=ue(r)?s++:r[t[s++]];return r}function Pa(r){for(const t in r)if(r.hasOwnProperty(t)&&!ue(r[t]))return!1;return!0}function me(r,t){const e=Array.isArray(t)?t:nr(t)?[t]:ks(t),s=e.length===1?r:La(r,e),n=e.length-1,a=e[n];return s&&delete s[a],n!==0&&(fe(s)&&be(s)||Array.isArray(s)&&Pa(s))&&me(r,e.slice(0,-1)),r}var Ts=r=>{for(const t in r)if(_e(r[t]))return!0;return!1};function Ft(r,t={}){const e=Array.isArray(r);if(fe(r)||e)for(const s in r)Array.isArray(r[s])||fe(r[s])&&!Ts(r[s])?(t[s]=Array.isArray(r[s])?[]:{},Ft(r[s],t[s])):ye(r[s])||(t[s]=!0);return t}function Cs(r,t,e){const s=Array.isArray(r);if(fe(r)||s)for(const n in r)Array.isArray(r[n])||fe(r[n])&&!Ts(r[n])?ue(t)||Gt(e[n])?e[n]=Array.isArray(r[n])?Ft(r[n],[]):{...Ft(r[n])}:Cs(r[n],ye(t)?{}:t[n],e[n]):e[n]=!Pe(r[n],t[n]);return e}var at=(r,t)=>Cs(r,t,Ft(t));const _r={value:!1,isValid:!1},Fr={value:!0,isValid:!0};var Os=r=>{if(Array.isArray(r)){if(r.length>1){const t=r.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return r[0].checked&&!r[0].disabled?r[0].attributes&&!ue(r[0].attributes.value)?ue(r[0].value)||r[0].value===""?Fr:{value:r[0].value,isValid:!0}:Fr:_r}return _r},As=(r,{valueAsNumber:t,valueAsDate:e,setValueAs:s})=>ue(r)?r:t?r===""?NaN:r&&+r:e&&Oe(r)?new Date(r):s?s(r):r;const Tr={isValid:!1,value:null};var Ms=r=>Array.isArray(r)?r.reduce((t,e)=>e&&e.checked&&!e.disabled?{isValid:!0,value:e.value}:t,Tr):Tr;function Cr(r){const t=r.ref;return ir(t)?t.files:lr(t)?Ms(r.refs).value:Fs(t)?[...t.selectedOptions].map(({value:e})=>e):dt(t)?Os(r.refs).value:As(ue(t.value)?r.ref.value:t.value,r)}var za=(r,t,e,s)=>{const n={};for(const a of r){const o=M(t,a);o&&oe(n,a,o._f)}return{criteriaMode:e,names:[...r],fields:n,shouldUseNativeValidation:s}},Tt=r=>r instanceof RegExp,ot=r=>ue(r)?r:Tt(r)?r.source:fe(r)?Tt(r.value)?r.value.source:r.value:r,Or=r=>({isOnSubmit:!r||r===Se.onSubmit,isOnBlur:r===Se.onBlur,isOnChange:r===Se.onChange,isOnAll:r===Se.all,isOnTouch:r===Se.onTouched});const Ar="AsyncFunction";var Ua=r=>!!r&&!!r.validate&&!!(_e(r.validate)&&r.validate.constructor.name===Ar||fe(r.validate)&&Object.values(r.validate).find(t=>t.constructor.name===Ar)),Ba=r=>r.mount&&(r.required||r.min||r.max||r.maxLength||r.minLength||r.pattern||r.validate),Mr=(r,t,e)=>!e&&(t.watchAll||t.watch.has(r)||[...t.watch].some(s=>r.startsWith(s)&&/^\.\w+/.test(r.slice(s.length))));const lt=(r,t,e,s)=>{for(const n of e||Object.keys(r)){const a=M(r,n);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],n)&&!s)return!0;if(o.ref&&t(o.ref,o.name)&&!s)return!0;if(lt(l,t))break}else if(fe(l)&<(l,t))break}}};function Rr(r,t,e){const s=M(r,e);if(s||nr(e))return{error:s,name:e};const n=e.split(".");for(;n.length;){const a=n.join("."),o=M(t,a),l=M(r,a);if(o&&!Array.isArray(o)&&e!==a)return{name:e};if(l&&l.type)return{name:a,error:l};n.pop()}return{name:e}}var Wa=(r,t,e,s)=>{e(r);const{name:n,...a}=r;return be(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!s||Se.all))},Za=(r,t,e)=>!r||!t||r===t||it(r).some(s=>s&&(e?s===t:s.startsWith(t)||t.startsWith(s))),qa=(r,t,e,s,n)=>n.isOnAll?!1:!e&&n.isOnTouch?!(t||r):(e?s.isOnBlur:n.isOnBlur)?!r:(e?s.isOnChange:n.isOnChange)?r:!0,Ga=(r,t)=>!At(M(r,t)).length&&me(r,t),Ha=(r,t,e)=>{const s=it(M(r,e));return oe(s,"root",t[e]),oe(r,e,s),r},jt=r=>Oe(r);function Vr(r,t,e="validate"){if(jt(r)||Array.isArray(r)&&r.every(jt)||ke(r)&&!r)return{type:e,message:jt(r)?r:"",ref:t}}var Ye=r=>fe(r)&&!Tt(r)?r:{value:r,message:""},$r=async(r,t,e,s,n,a)=>{const{ref:o,refs:l,required:c,maxLength:u,minLength:f,min:p,max:x,pattern:b,validate:E,name:j,valueAsNumber:T,mount:w}=r._f,y=M(e,j);if(!w||t.has(j))return{};const N=l?l[0]:o,O=P=>{n&&N.reportValidity&&(N.setCustomValidity(ke(P)?"":P||""),N.reportValidity())},_={},D=lr(o),Q=dt(o),S=D||Q,W=(T||ir(o))&&ue(o.value)&&ue(y)||_t(o)&&o.value===""||y===""||Array.isArray(y)&&!y.length,G=_s.bind(null,j,s,_),R=(P,X,ee,I=Me.maxLength,J=Me.minLength)=>{const Z=P?X:ee;_[j]={type:P?I:J,message:Z,ref:o,...G(P?I:J,Z)}};if(a?!Array.isArray(y)||!y.length:c&&(!S&&(W||ye(y))||ke(y)&&!y||Q&&!Os(l).isValid||D&&!Ms(l).isValid)){const{value:P,message:X}=jt(c)?{value:!!c,message:c}:Ye(c);if(P&&(_[j]={type:Me.required,message:X,ref:N,...G(Me.required,X)},!s))return O(X),_}if(!W&&(!ye(p)||!ye(x))){let P,X;const ee=Ye(x),I=Ye(p);if(!ye(y)&&!isNaN(y)){const J=o.valueAsNumber||y&&+y;ye(ee.value)||(P=J>ee.value),ye(I.value)||(X=J<I.value)}else{const J=o.valueAsDate||new Date(y),Z=m=>new Date(new Date().toDateString()+" "+m),h=o.type=="time",K=o.type=="week";Oe(ee.value)&&y&&(P=h?Z(y)>Z(ee.value):K?y>ee.value:J>new Date(ee.value)),Oe(I.value)&&y&&(X=h?Z(y)<Z(I.value):K?y<I.value:J<new Date(I.value))}if((P||X)&&(R(!!P,ee.message,I.message,Me.max,Me.min),!s))return O(_[j].message),_}if((u||f)&&!W&&(Oe(y)||a&&Array.isArray(y))){const P=Ye(u),X=Ye(f),ee=!ye(P.value)&&y.length>+P.value,I=!ye(X.value)&&y.length<+X.value;if((ee||I)&&(R(ee,P.message,X.message),!s))return O(_[j].message),_}if(b&&!W&&Oe(y)){const{value:P,message:X}=Ye(b);if(Tt(P)&&!y.match(P)&&(_[j]={type:Me.pattern,message:X,ref:o,...G(Me.pattern,X)},!s))return O(X),_}if(E){if(_e(E)){const P=await E(y,e),X=Vr(P,N);if(X&&(_[j]={...X,...G(Me.validate,X.message)},!s))return O(X.message),_}else if(fe(E)){let P={};for(const X in E){if(!be(P)&&!s)break;const ee=Vr(await E[X](y,e),N,X);ee&&(P={...ee,...G(X,ee.message)},O(ee.message),s&&(_[j]=P))}if(!be(P)&&(_[j]={ref:N,...P},!s))return _}}return O(!0),_};const Ya={mode:Se.onSubmit,reValidateMode:Se.onChange,shouldFocusError:!0};function Xa(r={}){let t={...Ya,...r},e={submitCount:0,isDirty:!1,isReady:!1,isLoading:_e(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const s={};let n=fe(t.defaultValues)||fe(t.values)?ge(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ge(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 f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...f};const x={array:Sr(),state:Sr()},b=t.criteriaMode===Se.all,E=d=>g=>{clearTimeout(u),u=setTimeout(d,g)},j=async d=>{if(!t.disabled&&(f.isValid||p.isValid||d)){const g=t.resolver?be((await Q()).errors):await W(s,!0);g!==e.isValid&&x.state.next({isValid:g})}},T=(d,g)=>{!t.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((d||Array.from(l.mount)).forEach(k=>{k&&(g?oe(e.validatingFields,k,g):me(e.validatingFields,k))}),x.state.next({validatingFields:e.validatingFields,isValidating:!be(e.validatingFields)}))},w=(d,g=[],k,V,A=!0,C=!0)=>{if(V&&k&&!t.disabled){if(o.action=!0,C&&Array.isArray(M(s,d))){const Y=k(M(s,d),V.argA,V.argB);A&&oe(s,d,Y)}if(C&&Array.isArray(M(e.errors,d))){const Y=k(M(e.errors,d),V.argA,V.argB);A&&oe(e.errors,d,Y),Ga(e.errors,d)}if((f.touchedFields||p.touchedFields)&&C&&Array.isArray(M(e.touchedFields,d))){const Y=k(M(e.touchedFields,d),V.argA,V.argB);A&&oe(e.touchedFields,d,Y)}(f.dirtyFields||p.dirtyFields)&&(e.dirtyFields=at(n,a)),x.state.next({name:d,isDirty:R(d,g),dirtyFields:e.dirtyFields,errors:e.errors,isValid:e.isValid})}else oe(a,d,g)},y=(d,g)=>{oe(e.errors,d,g),x.state.next({errors:e.errors})},N=d=>{e.errors=d,x.state.next({errors:e.errors,isValid:!1})},O=(d,g,k,V)=>{const A=M(s,d);if(A){const C=M(a,d,ue(k)?M(n,d):k);ue(C)||V&&V.defaultChecked||g?oe(a,d,g?C:Cr(A._f)):ee(d,C),o.mount&&j()}},_=(d,g,k,V,A)=>{let C=!1,Y=!1;const ie={name:d};if(!t.disabled){if(!k||V){(f.isDirty||p.isDirty)&&(Y=e.isDirty,e.isDirty=ie.isDirty=R(),C=Y!==ie.isDirty);const ce=Pe(M(n,d),g);Y=!!M(e.dirtyFields,d),ce?me(e.dirtyFields,d):oe(e.dirtyFields,d,!0),ie.dirtyFields=e.dirtyFields,C=C||(f.dirtyFields||p.dirtyFields)&&Y!==!ce}if(k){const ce=M(e.touchedFields,d);ce||(oe(e.touchedFields,d,k),ie.touchedFields=e.touchedFields,C=C||(f.touchedFields||p.touchedFields)&&ce!==k)}C&&A&&x.state.next(ie)}return C?ie:{}},D=(d,g,k,V)=>{const A=M(e.errors,d),C=(f.isValid||p.isValid)&&ke(g)&&e.isValid!==g;if(t.delayError&&k?(c=E(()=>y(d,k)),c(t.delayError)):(clearTimeout(u),c=null,k?oe(e.errors,d,k):me(e.errors,d)),(k?!Pe(A,k):A)||!be(V)||C){const Y={...V,...C&&ke(g)?{isValid:g}:{},errors:e.errors,name:d};e={...e,...Y},x.state.next(Y)}},Q=async d=>{T(d,!0);const g=await t.resolver(a,t.context,za(d||l.mount,s,t.criteriaMode,t.shouldUseNativeValidation));return T(d),g},S=async d=>{const{errors:g}=await Q(d);if(d)for(const k of d){const V=M(g,k);V?oe(e.errors,k,V):me(e.errors,k)}else e.errors=g;return g},W=async(d,g,k={valid:!0})=>{for(const V in d){const A=d[V];if(A){const{_f:C,...Y}=A;if(C){const ie=l.array.has(C.name),ce=A._f&&Ua(A._f);ce&&f.validatingFields&&T([V],!0);const Ee=await $r(A,l.disabled,a,b,t.shouldUseNativeValidation&&!g,ie);if(ce&&f.validatingFields&&T([V]),Ee[C.name]&&(k.valid=!1,g))break;!g&&(M(Ee,C.name)?ie?Ha(e.errors,Ee,C.name):oe(e.errors,C.name,Ee[C.name]):me(e.errors,C.name))}!be(Y)&&await W(Y,g,k)}}return k.valid},G=()=>{for(const d of l.unMount){const g=M(s,d);g&&(g._f.refs?g._f.refs.every(k=>!It(k)):!It(g._f.ref))&&se(d)}l.unMount=new Set},R=(d,g)=>!t.disabled&&(d&&g&&oe(a,d,g),!Pe(m(),n)),P=(d,g,k)=>Ns(d,l,{...o.mount?a:ue(g)?n:Oe(d)?{[d]:g}:g},k,g),X=d=>At(M(o.mount?a:n,d,t.shouldUnregister?M(n,d,[]):[])),ee=(d,g,k={})=>{const V=M(s,d);let A=g;if(V){const C=V._f;C&&(!C.disabled&&oe(a,d,As(g,C)),A=_t(C.ref)&&ye(g)?"":g,Fs(C.ref)?[...C.ref.options].forEach(Y=>Y.selected=A.includes(Y.value)):C.refs?dt(C.ref)?C.refs.forEach(Y=>{(!Y.defaultChecked||!Y.disabled)&&(Array.isArray(A)?Y.checked=!!A.find(ie=>ie===Y.value):Y.checked=A===Y.value||!!A)}):C.refs.forEach(Y=>Y.checked=Y.value===A):ir(C.ref)?C.ref.value="":(C.ref.value=A,C.ref.type||x.state.next({name:d,values:ge(a)})))}(k.shouldDirty||k.shouldTouch)&&_(d,A,k.shouldTouch,k.shouldDirty,!0),k.shouldValidate&&K(d)},I=(d,g,k)=>{for(const V in g){if(!g.hasOwnProperty(V))return;const A=g[V],C=`${d}.${V}`,Y=M(s,C);(l.array.has(d)||fe(A)||Y&&!Y._f)&&!Be(A)?I(C,A,k):ee(C,A,k)}},J=(d,g,k={})=>{const V=M(s,d),A=l.array.has(d),C=ge(g);oe(a,d,C),A?(x.array.next({name:d,values:ge(a)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&k.shouldDirty&&x.state.next({name:d,dirtyFields:at(n,a),isDirty:R(d,C)})):V&&!V._f&&!ye(C)?I(d,C,k):ee(d,C,k),Mr(d,l)&&x.state.next({...e}),x.state.next({name:o.mount?d:void 0,values:ge(a)})},Z=async d=>{o.mount=!0;const g=d.target;let k=g.name,V=!0;const A=M(s,k),C=ce=>{V=Number.isNaN(ce)||Be(ce)&&isNaN(ce.getTime())||Pe(ce,M(a,k,ce))},Y=Or(t.mode),ie=Or(t.reValidateMode);if(A){let ce,Ee;const mt=g.type?Cr(A._f):vs(d),De=d.type===St.BLUR||d.type===St.FOCUS_OUT,bn=!Ba(A._f)&&!t.resolver&&!M(e.errors,k)&&!A._f.deps||qa(De,M(e.touchedFields,k),e.isSubmitted,ie,Y),Rt=Mr(k,l,De);oe(a,k,mt),De?(A._f.onBlur&&A._f.onBlur(d),c&&c(0)):A._f.onChange&&A._f.onChange(d);const Vt=_(k,mt,De),yn=!be(Vt)||Rt;if(!De&&x.state.next({name:k,type:d.type,values:ge(a)}),bn)return(f.isValid||p.isValid)&&(t.mode==="onBlur"?De&&j():De||j()),yn&&x.state.next({name:k,...Rt?{}:Vt});if(!De&&Rt&&x.state.next({...e}),t.resolver){const{errors:xr}=await Q([k]);if(C(mt),V){const vn=Rr(e.errors,s,k),gr=Rr(xr,s,vn.name||k);ce=gr.error,k=gr.name,Ee=be(xr)}}else T([k],!0),ce=(await $r(A,l.disabled,a,b,t.shouldUseNativeValidation))[k],T([k]),C(mt),V&&(ce?Ee=!1:(f.isValid||p.isValid)&&(Ee=await W(s,!0)));V&&(A._f.deps&&K(A._f.deps),D(k,Ee,ce,Vt))}},h=(d,g)=>{if(M(e.errors,g)&&d.focus)return d.focus(),1},K=async(d,g={})=>{let k,V;const A=it(d);if(t.resolver){const C=await S(ue(d)?d:A);k=be(C),V=d?!A.some(Y=>M(C,Y)):k}else d?(V=(await Promise.all(A.map(async C=>{const Y=M(s,C);return await W(Y&&Y._f?{[C]:Y}:Y)}))).every(Boolean),!(!V&&!e.isValid)&&j()):V=k=await W(s);return x.state.next({...!Oe(d)||(f.isValid||p.isValid)&&k!==e.isValid?{}:{name:d},...t.resolver||!d?{isValid:k}:{},errors:e.errors}),g.shouldFocus&&!V&<(s,h,d?A:l.mount),V},m=d=>{const g={...o.mount?a:n};return ue(d)?g:Oe(d)?M(g,d):d.map(k=>M(g,k))},F=(d,g)=>({invalid:!!M((g||e).errors,d),isDirty:!!M((g||e).dirtyFields,d),error:M((g||e).errors,d),isValidating:!!M(e.validatingFields,d),isTouched:!!M((g||e).touchedFields,d)}),L=d=>{d&&it(d).forEach(g=>me(e.errors,g)),x.state.next({errors:d?e.errors:{}})},B=(d,g,k)=>{const V=(M(s,d,{_f:{}})._f||{}).ref,A=M(e.errors,d)||{},{ref:C,message:Y,type:ie,...ce}=A;oe(e.errors,d,{...ce,...g,ref:V}),x.state.next({name:d,errors:e.errors,isValid:!1}),k&&k.shouldFocus&&V&&V.focus&&V.focus()},re=(d,g)=>_e(d)?x.state.subscribe({next:k=>d(P(void 0,g),k)}):P(d,g,!0),le=d=>x.state.subscribe({next:g=>{Za(d.name,g.name,d.exact)&&Wa(g,d.formState||f,gn,d.reRenderRoot)&&d.callback({values:{...a},...e,...g})}}).unsubscribe,pe=d=>(o.mount=!0,p={...p,...d.formState},le({...d,formState:p})),se=(d,g={})=>{for(const k of d?it(d):l.mount)l.mount.delete(k),l.array.delete(k),g.keepValue||(me(s,k),me(a,k)),!g.keepError&&me(e.errors,k),!g.keepDirty&&me(e.dirtyFields,k),!g.keepTouched&&me(e.touchedFields,k),!g.keepIsValidating&&me(e.validatingFields,k),!t.shouldUnregister&&!g.keepDefaultValue&&me(n,k);x.state.next({values:ge(a)}),x.state.next({...e,...g.keepDirty?{isDirty:R()}:{}}),!g.keepIsValid&&j()},H=({disabled:d,name:g})=>{(ke(d)&&o.mount||d||l.disabled.has(g))&&(d?l.disabled.add(g):l.disabled.delete(g))},ne=(d,g={})=>{let k=M(s,d);const V=ke(g.disabled)||ke(t.disabled);return oe(s,d,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:d}},name:d,mount:!0,...g}}),l.mount.add(d),k?H({disabled:ke(g.disabled)?g.disabled:t.disabled,name:d}):O(d,!0,g.value),{...V?{disabled:g.disabled||t.disabled}:{},...t.progressive?{required:!!g.required,min:ot(g.min),max:ot(g.max),minLength:ot(g.minLength),maxLength:ot(g.maxLength),pattern:ot(g.pattern)}:{},name:d,onChange:Z,onBlur:Z,ref:A=>{if(A){ne(d,g),k=M(s,d);const C=ue(A.value)&&A.querySelectorAll&&A.querySelectorAll("input,select,textarea")[0]||A,Y=Ia(C),ie=k._f.refs||[];if(Y?ie.find(ce=>ce===C):C===k._f.ref)return;oe(s,d,{_f:{...k._f,...Y?{refs:[...ie.filter(It),C,...Array.isArray(M(n,d))?[{}]:[]],ref:{type:C.type,name:d}}:{ref:C}}}),O(d,!1,void 0,C)}else k=M(s,d,{}),k._f&&(k._f.mount=!1),(t.shouldUnregister||g.shouldUnregister)&&!(ws(l.array,d)&&o.action)&&l.unMount.add(d)}}},de=()=>t.shouldFocusError&<(s,h,l.mount),ae=d=>{ke(d)&&(x.state.next({disabled:d}),lt(s,(g,k)=>{const V=M(s,k);V&&(g.disabled=V._f.disabled||d,Array.isArray(V._f.refs)&&V._f.refs.forEach(A=>{A.disabled=V._f.disabled||d}))},0,!1))},je=(d,g)=>async k=>{let V;k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let A=ge(a);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:C,values:Y}=await Q();e.errors=C,A=Y}else await W(s);if(l.disabled.size)for(const C of l.disabled)oe(A,C,void 0);if(me(e.errors,"root"),be(e.errors)){x.state.next({errors:{}});try{await d(A,k)}catch(C){V=C}}else g&&await g({...e.errors},k),de(),setTimeout(de);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:be(e.errors)&&!V,submitCount:e.submitCount+1,errors:e.errors}),V)throw V},ht=(d,g={})=>{M(s,d)&&(ue(g.defaultValue)?J(d,ge(M(n,d))):(J(d,g.defaultValue),oe(n,d,ge(g.defaultValue))),g.keepTouched||me(e.touchedFields,d),g.keepDirty||(me(e.dirtyFields,d),e.isDirty=g.defaultValue?R(d,ge(M(n,d))):R()),g.keepError||(me(e.errors,d),f.isValid&&j()),x.state.next({...e}))},et=(d,g={})=>{const k=d?ge(d):n,V=ge(k),A=be(d),C=A?n:V;if(g.keepDefaultValues||(n=k),!g.keepValues){if(g.keepDirtyValues){const Y=new Set([...l.mount,...Object.keys(at(n,a))]);for(const ie of Array.from(Y))M(e.dirtyFields,ie)?oe(C,ie,M(a,ie)):J(ie,M(C,ie))}else{if(sr&&ue(d))for(const Y of l.mount){const ie=M(s,Y);if(ie&&ie._f){const ce=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(_t(ce)){const Ee=ce.closest("form");if(Ee){Ee.reset();break}}}}for(const Y of l.mount)J(Y,M(C,Y))}a=ge(C),x.array.next({values:{...C}}),x.state.next({values:{...C}})}l={mount:g.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!g.keepIsValid||!!g.keepDirtyValues,o.watch=!!t.shouldUnregister,x.state.next({submitCount:g.keepSubmitCount?e.submitCount:0,isDirty:A?!1:g.keepDirty?e.isDirty:!!(g.keepDefaultValues&&!Pe(d,n)),isSubmitted:g.keepIsSubmitted?e.isSubmitted:!1,dirtyFields:A?{}:g.keepDirtyValues?g.keepDefaultValues&&a?at(n,a):e.dirtyFields:g.keepDefaultValues&&d?at(n,d):g.keepDirty?e.dirtyFields:{},touchedFields:g.keepTouched?e.touchedFields:{},errors:g.keepErrors?e.errors:{},isSubmitSuccessful:g.keepIsSubmitSuccessful?e.isSubmitSuccessful:!1,isSubmitting:!1})},tt=(d,g)=>et(_e(d)?d(a):d,g),xn=(d,g={})=>{const k=M(s,d),V=k&&k._f;if(V){const A=V.refs?V.refs[0]:V.ref;A.focus&&(A.focus(),g.shouldSelect&&_e(A.select)&&A.select())}},gn=d=>{e={...e,...d}},pr={control:{register:ne,unregister:se,getFieldState:F,handleSubmit:je,setError:B,_subscribe:le,_runSchema:Q,_getWatch:P,_getDirty:R,_setValid:j,_setFieldArray:w,_setDisabledField:H,_setErrors:N,_getFieldArray:X,_reset:et,_resetDefaultValues:()=>_e(t.defaultValues)&&t.defaultValues().then(d=>{tt(d,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:ae,_subjects:x,_proxyFormState:f,get _fields(){return s},get _formValues(){return a},get _state(){return o},set _state(d){o=d},get _defaultValues(){return n},get _names(){return l},set _names(d){l=d},get _formState(){return e},get _options(){return t},set _options(d){t={...t,...d}}},subscribe:pe,trigger:K,register:ne,handleSubmit:je,watch:re,setValue:J,getValues:m,reset:tt,resetField:ht,clearErrors:L,unregister:se,setError:B,setFocus:xn,getFieldState:F};return{...pr,formControl:pr}}function Ka(r={}){const t=v.useRef(void 0),e=v.useRef(void 0),[s,n]=v.useState({isDirty:!1,isValidating:!1,isLoading:_e(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:_e(r.defaultValues)?void 0:r.defaultValues});t.current||(t.current={...r.formControl?r.formControl:Xa(r),formState:s},r.formControl&&r.defaultValues&&!_e(r.defaultValues)&&r.formControl.reset(r.defaultValues,r.resetOptions));const a=t.current.control;return a._options=r,ar(()=>{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&&!be(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&&!Pe(r.values,e.current)?(a._reset(r.values,a._options.resetOptions),e.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()}),t.current.formState=Es(s,a),t.current}const Rs={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},Ja={sm:"h-6",md:"h-10",lg:"h-12"},Qa={sm:"px-2",md:"px-2.5",lg:"px-3"};function Dr(r,t,e,s,n,a,o){const l=t?"datetime-local":"date",c=$("box-border w-full rounded-lg border outline-none transition font-[var(--font-primary)]",Rs[e],Ja[e],Qa[e],a?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]"),p=Ma(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 Vs(r){const{control:t,name:e,rules:s,defaultValue:n,showTime:a=!1,size:o="sm",width:l="100%",label:c,labelHidden:u=!1,hasError:f=!1,errorMessage:p="",disabled:x=!1,className:b,onChange:E}=r,j=v.useId(),T=e||j;return i.jsxs("div",{className:$("flex flex-col",b),style:{width:l,maxWidth:"100%"},children:[c&&i.jsx("label",{htmlFor:T,className:$("pb-2 text-[var(--color-ds-text-primary)]",Rs[o],u&&"sr-only"),children:c}),t&&e?i.jsx(Fe,{name:e,control:t,rules:s,defaultValue:n,render:({field:w,fieldState:y})=>Dr(T,a,o,{value:w.value,onChange:w.onChange,onBlur:w.onBlur},x,y.error,b)}):Dr(T,a,o,{defaultValue:n,onChange:E},x,f?{message:p}:void 0,b)]})}const eo=({trigger:r,items:t,align:e="left",className:s})=>{const[n,a]=v.useState(!1),o=v.useRef(null),l=v.useRef([]);v.useEffect(()=>{const u=f=>{o.current&&!o.current.contains(f.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const c=u=>{var p,x;const f=l.current.findIndex(b=>b===document.activeElement);if(u.key==="Escape")a(!1);else if(u.key==="ArrowDown"){u.preventDefault();const b=(f+1)%t.length;(p=l.current[b])==null||p.focus()}else if(u.key==="ArrowUp"){u.preventDefault();const b=(f-1+t.length)%t.length;(x=l.current[b])==null||x.focus()}};return i.jsxs("div",{className:$("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:$("absolute mt-2 min-w-[160px] bg-[var(--color-ds-background-page)]","border border-[var(--color-ds-border-muted)] rounded shadow-lg z-10",e==="right"?"right-0":"left-0"),onKeyDown:c,children:t.map((u,f)=>{const{label:p,onSelect:x,disabled:b,icon:E}=u;return i.jsxs("button",{role:"menuitem",type:"button",disabled:b,ref:j=>{l.current[f]=j},className:$("w-full flex items-center px-4 py-2 text-[var(--color-ds-text-primary)] text-ds-md transition-colors",b?"opacity-50 cursor-not-allowed":"hover:bg-[var(--color-ds-background-surface)]"),onClick:()=>{b||(x(),a(!1))},children:[E&&i.jsx(E,{className:"w-5 h-5 mr-2 text-[var(--color-ds-text-secondary)]"}),p]},f)})})]})},to=(r,t,e,s)=>{var a,o,l,c;const n=[e,{code:t,...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);We(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)},Ir={},Ht=(r,t,e,s)=>{We(e)&&Ir[e]||(We(e)&&(Ir[e]=new Date),to(r,t,e,s))},$s=(r,t)=>()=>{if(r.isInitialized)t();else{const e=()=>{setTimeout(()=>{r.off("initialized",e)},0),t()};r.on("initialized",e)}},Yt=(r,t,e)=>{r.loadNamespaces(t,$s(r,e))},Lr=(r,t,e,s)=>{if(We(e)&&(e=[e]),r.options.preload&&r.options.preload.indexOf(t)>-1)return Yt(r,e,s);e.forEach(n=>{r.options.ns.indexOf(n)<0&&r.options.ns.push(n)}),r.loadLanguages(t,$s(r,s))},ro=(r,t,e={})=>!t.languages||!t.languages.length?(Ht(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(r,{lng:e.lng,precheck:(s,n)=>{var a;if(((a=e.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,r))return!1}}),We=r=>typeof r=="string",so=r=>typeof r=="object"&&r!==null,no=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ao={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},oo=r=>ao[r],io=r=>r.replace(no,oo);let lo={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:io};const co=()=>lo;let uo;const fo=()=>uo,ho=v.createContext();class mo{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const po=(r,t)=>{const e=v.useRef();return v.useEffect(()=>{e.current=r},[r,t]),e.current},Ds=(r,t,e,s)=>r.getFixedT(t,e,s),xo=(r,t,e,s)=>v.useCallback(Ds(r,t,e,s),[r,t,e,s]),cr=(r,t={})=>{var O,_,D,Q;const{i18n:e}=t,{i18n:s,defaultNS:n}=v.useContext(ho)||{},a=e||s||fo();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new mo),!a){Ht(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const S=(G,R)=>We(R)?R:so(R)&&We(R.defaultValue)?R.defaultValue:Array.isArray(G)?G[G.length-1]:G,W=[S,{},!1];return W.t=S,W.i18n={},W.ready=!1,W}(O=a.options.react)!=null&&O.wait&&Ht(a,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...co(),...a.options.react,...t},{useSuspense:l,keyPrefix:c}=o;let u=n||((_=a.options)==null?void 0:_.defaultNS);u=We(u)?[u]:u||["translation"],(Q=(D=a.reportNamespaces).addUsedNamespaces)==null||Q.call(D,u);const f=(a.isInitialized||a.initializedStoreOnce)&&u.every(S=>ro(S,a,o)),p=xo(a,t.lng||null,o.nsMode==="fallback"?u:u[0],c),x=()=>p,b=()=>Ds(a,t.lng||null,o.nsMode==="fallback"?u:u[0],c),[E,j]=v.useState(x);let T=u.join();t.lng&&(T=`${t.lng}${T}`);const w=po(T),y=v.useRef(!0);v.useEffect(()=>{const{bindI18n:S,bindI18nStore:W}=o;y.current=!0,!f&&!l&&(t.lng?Lr(a,t.lng,u,()=>{y.current&&j(b)}):Yt(a,u,()=>{y.current&&j(b)})),f&&w&&w!==T&&y.current&&j(b);const G=()=>{y.current&&j(b)};return S&&(a==null||a.on(S,G)),W&&(a==null||a.store.on(W,G)),()=>{y.current=!1,a&&(S==null||S.split(" ").forEach(R=>a.off(R,G))),W&&a&&W.split(" ").forEach(R=>a.store.off(R,G))}},[a,T]),v.useEffect(()=>{y.current&&f&&j(x)},[a,c,f]);const N=[E,a,f];if(N.t=E,N.i18n=a,N.ready=f,f||!f&&!l)return N;throw new Promise(S=>{t.lng?Lr(a,t.lng,u,()=>S()):Yt(a,u,()=>S())})},Xt={sm:"text-sm",md:"text-base",lg:"text-lg"};function Pr(r,t,e,s,n,a,o,l,c){const{t:u}=cr(),f=v.useRef(null),p=typeof s=="number"&&t.length>=s,x=()=>{var y;!o&&!p&&((y=f.current)==null||y.click())},b=y=>{const N=y.target.files;if(!N)return;const O=Array.from(N);let _=t.concat(O);s&&(_=_.slice(0,s)),e(_),y.target.value=""},E=y=>{if(y.preventDefault(),o||p)return;const N=Array.from(y.dataTransfer.files);let O=t.concat(N);s&&(O=O.slice(0,s)),e(O)},j=y=>{y.preventDefault()},T=y=>{const N=URL.createObjectURL(y);window.open(N)},w=y=>{const N=t.filter((O,_)=>_!==y);e(N)};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"self-start mb-4 w-auto",children:i.jsx($e,{type:"button",variant:"outline",size:a,icon:wr,onClick:x,disabled:o||p,children:u("ds.fileUploader.browse","Browse files")})}),!p&&i.jsxs("div",{className:$("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)]",Xt[a],c),onDrop:E,onDragOver:j,children:[i.jsx("input",{id:r,type:"file",ref:f,className:"hidden",multiple:s!==1,accept:n,onChange:b,disabled:o}),i.jsx(Ce,{component:Pn,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")})]}),t.length>0&&i.jsx("ul",{className:"mt-4 space-y-1",children:t.map((y,N)=>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(wr,{className:"w-4 h-4 mr-2","aria-hidden":"true"}),i.jsx("span",{className:"truncate pr-2",children:y.name})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx($e,{variant:"ghost",size:"sm",icon:ls,ariaLabel:u("ds.fileUploader.view","View"),onClick:()=>T(y)}),i.jsx($e,{variant:"ghost",size:"sm",icon:tr,ariaLabel:u("ds.fileUploader.remove","Remove"),onClick:()=>w(N)})]})]},N))}),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 Is(r){const{control:t,name:e,rules:s,defaultValue:n,maxFiles:a,accept:o,size:l="sm",width:c="100%",label:u,labelHidden:f=!1,disabled:p=!1,hasError:x=!1,errorMessage:b="",className:E}=r,j=v.useId(),T=e||j;if(t&&e)return i.jsxs("div",{className:$("flex flex-col",E),style:{width:c},children:[u&&i.jsx("label",{htmlFor:T,className:$("pb-[10px] text-[var(--color-ds-text-primary)]",Xt[l],f&&"sr-only"),children:u}),i.jsx(Fe,{name:e,control:t,rules:s,defaultValue:n instanceof FileList?Array.from(n):n||[],render:({field:N,fieldState:O})=>Pr(T,N.value,_=>N.onChange(_),a,o,l,p,O.error,E)})]});const[w,y]=v.useState(n instanceof FileList?Array.from(n):n||[]);return i.jsxs("div",{className:$("flex flex-col",E),style:{width:c},children:[u&&i.jsx("label",{htmlFor:T,className:$("pb-[10px] text-[var(--color-ds-text-primary)]",Xt[l],f&&"sr-only"),children:u}),Pr(T,w,y,a,o,l,p,x?{message:b}:void 0,E)]})}const qe=({count:r=1,width:t,height:e="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:$("bg-[var(--color-ds-border-muted)] animate-pulse inline-block",s==="circle"?"rounded-full":"rounded",n),style:{width:t??"auto",height:e}},l))})},bt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},go={sm:"h-6",md:"h-10",lg:"h-12"},bo={sm:"px-2",md:"px-2.5",lg:"px-3"},zr={sm:"pl-2",md:"pl-2.5",lg:"pl-3"},yo={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function Mt({id:r,type:t="text",size:e="sm",width:s="100%",label:n,labelHidden:a=!1,hasError:o=!1,errorMessage:l="",prefixIcon:c,suffixIcon:u,separator:f,suffixButton:p,disabled:x=!1,control:b,name:E,rules:j,defaultValue:T,loading:w=!1,className:y,...N}){const O=v.useId(),[_,D]=v.useState(!1),Q=r||O,S=t==="password",G=c??(t==="number"?qn:void 0),R=S?_?Bn:ls:u,P=$("box-border w-full rounded-lg border placeholder-[var(--color-ds-text-secondary)] outline-none transition font-[var(--font-primary)] appearance-none",bt[e],go[e],bo[e],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 w?i.jsxs("div",{className:"flex flex-col",style:{width:s,maxWidth:"100%"},children:[!a&&n&&i.jsx("label",{htmlFor:Q,className:$("pb-2",bt[e]),children:n}),i.jsx(qe,{width:"100%",height:yo[e],variant:"rect",className:"rounded-lg"}),i.jsx("div",{className:"min-h-[18px] w-full",children:i.jsx("span",{"aria-hidden":"true",children:" "})})]}):b&&E?i.jsx(Fe,{name:E,control:b,rules:j,defaultValue:T,render:({field:X,fieldState:ee})=>i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:Q,className:$("pb-2 text-[var(--color-ds-text-primary)]",bt[e]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[G&&i.jsx("div",{className:$("absolute left-0 flex items-center h-full",zr[e]),children:i.jsx(Ce,{component:G,size:e,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...X,id:Q,type:S?_?"text":"password":t,disabled:x,"aria-invalid":!!ee.error,className:$(P,G&&"pl-9",R&&"pr-9",y),onInvalid:I=>I.preventDefault(),style:S&&!_?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),f&&i.jsx("div",{className:"flex items-center h-full",children:f}),p&&i.jsx("div",{className:"flex items-center h-full pr-2",children:p}),R&&i.jsx("button",{type:"button",onClick:()=>D(I=>!I),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Ce,{component:R,size:e,className:"text-[var(--color-ds-text-secondary)]"})})]}),i.jsx("div",{className:"min-h-[18px]",children:ee.error?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:ee.error.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}):i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:Q,className:$("pb-2 text-[var(--color-ds-text-primary)]",bt[e]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[G&&i.jsx("div",{className:$("absolute left-0 flex items-center h-full",zr[e]),children:i.jsx(Ce,{component:G,size:e,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...N,id:Q,type:S?_?"text":"password":t,disabled:x,"aria-invalid":o,className:$(P,G&&"pl-9",R&&"pr-9",y),onInvalid:X=>X.preventDefault(),style:S&&!_?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),f&&i.jsx("div",{className:"flex items-center h-full",children:f}),p&&i.jsx("div",{className:"flex items-center h-full",children:p}),R&&i.jsx("button",{type:"button",onClick:()=>D(X=>!X),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Ce,{component:R,size:e,className:"text-[var(--color-ds-text-secondary)]"})})]}),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:" "})})]})}const vo={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},Lt=400,yt=8,Ls=({children:r,size:t="sm",position:e="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 x=c.current.getBoundingClientRect();let b=0,E=0;switch(e){case"top":b=x.left+x.width/2-Lt/2,E=x.top-yt;break;case"bottom":b=x.left+x.width/2-Lt/2,E=x.bottom+yt;break;case"left":b=x.left-Lt-yt,E=x.top+x.height/2;break;case"right":b=x.right+yt,E=x.top+x.height/2;break}l({x:b,y:E})}},[n,e]);const f=()=>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:$("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:e==="left"||e==="right"?"translateY(-50%)":e==="top"?"translateY(-100%)":void 0},children:f()}):null;return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button","aria-describedby":u,ref:c,className:$("inline-flex items-center justify-center focus:outline-none",vo[t],"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(Hn,{className:"w-full h-full"})}),as.createPortal(p,document.body)]})};function wo({name:r,label:t,type:e="text",size:s="sm",width:n,placeholder:a,validation:o,loadingDefaults:l,disabled:c,info:u}){var T;const{control:f,formState:{errors:p}}=ut(),x=!!p[r],b=((T=p[r])==null?void 0:T.message)||"",E="relative",j=n??"w-full";return i.jsxs("div",{className:E,children:[i.jsx(Fe,{name:r,control:f,rules:o,render:({field:w})=>i.jsx(Mt,{label:t,size:s,width:j,placeholder:a,hasError:x,errorMessage:b,loading:l,type:e,...w,disabled:c})}),u&&i.jsx(Ls,{size:s,position:"left",className:"absolute top-1/2 right-2 -translate-y-1/2",children:u})]})}const dr=v.memo(wo);dr.displayName="FormFieldInput";function ko({title:r,headerButtons:t,children:e,className:s}){return i.jsxs("div",{className:$("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}),t&&i.jsx("div",{className:"flex items-center space-x-2",children:t})]}),i.jsx("main",{className:"flex-1 overflow-auto",children:e})]})}function Ps({options:r,value:t,onChange:e,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(T=>T.value===t);if(u<0)return;const f=l.children[u],m=f.querySelector("span"),p=(m==null?void 0:m.offsetWidth)??f.offsetWidth,b=f.offsetWidth,j=f.offsetLeft+(b-p)/2;o({left:j,width:p})};return c(),window.addEventListener("resize",c),l.addEventListener("scroll",c),()=>{window.removeEventListener("resize",c),l.removeEventListener("scroll",c)}},[t,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===t;return i.jsx("li",{role:"tab","aria-selected":c,onClick:()=>e(l.value),className:I("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[t]})]})}const Jt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},jo={sm:"h-6",md:"h-10",lg:"h-12"},Eo={sm:"px-2",md:"px-2.5",lg:"px-3"},Ur={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function Br(r,t,e,s,n,a,o,l,c){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative flex items-center w-full",children:[i.jsx("select",{id:r,...s,disabled:n,className:I("box-border w-full rounded-lg border bg-[var(--color-ds-background-page)] outline-none transition font-[var(--font-primary)]",Jt[e],jo[e],Eo[e],a?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",n?"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)]",l),children:t.map(u=>i.jsx("option",{value:u.value,className:"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",children:u.label},u.value))}),c&&i.jsx("div",{className:"flex items-center h-full pr-2",children:c})]}),!o&&i.jsx("div",{className:"min-h-[18px] w-full",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 ct(r){const{control:t,name:e,rules:s,defaultValue:n,options:a=[],loadOptions:o,reloadDeps:l=[],value:c,onChange:u,size:f="sm",width:m="100%",label:p,labelHidden:b=!1,hasError:N=!1,errorMessage:j="",disableErrorPlaceholder:T=!1,disabled:w=!1,className:y,suffixButton:E}=r,M=v.useId(),F=e||M,[W,J]=v.useState(a),[S,$]=v.useState(!!o);if(v.useEffect(()=>{o&&($(!0),o().then(P=>J(P)).finally(()=>$(!1)))},[o,...l]),v.useEffect(()=>{!t&&W.length>0&&(c===void 0||c===""||!W.some(P=>P.value===c))&&(u==null||u(W[0].value))},[W,c,u,t]),t&&e){const{field:P,fieldState:R}=_s({name:e,control:t,rules:s,defaultValue:n});return v.useEffect(()=>{if(!S&&W.length>0){const V=P.value;(V===void 0||!W.some(H=>H.value===V))&&P.onChange(W[0].value)}},[W,S,P]),i.jsxs("div",{className:I("flex flex-col",y),style:{width:m,maxWidth:"100%"},children:[p&&i.jsx("label",{htmlFor:F,className:I("pb-2 text-[var(--color-ds-text-primary)]",Jt[f],b&&"sr-only"),children:p}),S?i.jsx(qe,{width:"100%",height:Ur[f],variant:"rect",className:"rounded-lg"}):Br(F,W,f,{value:P.value,onChange:V=>P.onChange(V.target.value)},w,R.error,T,y,E)]})}return i.jsxs("div",{className:I("flex flex-col",y),style:{width:m,maxWidth:"100%"},children:[p&&i.jsx("label",{htmlFor:F,className:I("pb-2 text-[var(--color-ds-text-primary)]",Jt[f],b&&"sr-only"),children:p}),S?i.jsx(qe,{width:"100%",height:Ur[f],variant:"rect",className:"rounded-lg"}):Br(F,W,f,{value:c,onChange:P=>u==null?void 0:u(P.target.value)},w,N?{message:j}:void 0,T,y,E)]})}const Wr={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"};function zs({groupLabel:r,inputs:t=[],separator:e=i.jsx("span",{className:"px-1 select-none",children:"/"}),useSeparator:s=!0,className:n,showVisibleLabel:a=!1,size:o="sm",width:l}){const c=t.length;return i.jsxs("div",{className:I("flex flex-col",n),style:l?{width:l}:void 0,children:[i.jsx("label",{className:I("sr-only pb-2",Wr[o]),children:r}),a&&i.jsx("label",{className:I("pb-2",Wr[o]),children:r}),i.jsx("div",{className:"flex items-center flex-nowrap",children:t.map((u,f)=>{const{width:m,className:p,options:b,loadOptions:N,...j}=u,T=Array.isArray(b)||typeof N=="function";let w="rounded-lg";!s&&c>1&&(f===0?w="rounded-l-lg rounded-r-none":f===c-1?w="rounded-r-lg rounded-l-none":w="rounded-none");const y=I("inline-flex items-center flex-shrink-0 overflow-hidden",typeof m=="string"&&m.startsWith("w-")?m:void 0),E=typeof m=="string"&&!m.startsWith("w-")?{width:m}:void 0,M=I(p,w);return i.jsxs("div",{className:y,style:E,children:[T?i.jsx(ct,{...j,size:o,className:M,options:b,loadOptions:N}):i.jsx(Mt,{...j,size:o,className:M}),s&&f<c-1&&e]},f)})})]})}const Zr={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},No={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function Us({groupLabel:r,options:t,control:e,name:s,rules:n,defaultValue:a,multiple:o=!0,size:l="sm",vertical:c=!0,className:u,showVisibleLabel:f=!0}){return i.jsx(Fe,{name:s,control:e,rules:n,defaultValue:a,render:({field:m,fieldState:p})=>{const{value:b,onChange:N}=m;p.error;const j=w=>o?Array.isArray(b)&&b.includes(w):b===w,T=w=>{if(o){const y=Array.isArray(b)?[...b]:[],E=y.indexOf(w);E>=0?y.splice(E,1):y.push(w),N(y)}else N(w)};return i.jsxs("div",{className:I("w-full",u),children:[i.jsx("label",{className:I("sr-only pb-2 text-[var(--color-ds-text-primary)]",Zr[l]),children:r}),f&&i.jsx("label",{className:I("block pb-2 text-[var(--color-ds-text-primary)]",Zr[l]),children:r}),i.jsx("div",{className:I(c?"flex flex-col gap-2":"flex flex-wrap gap-4"),children:t.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:j(w.value),onChange:()=>T(w.value),className:I(No[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 _o(r){function t(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 f=t(o[u]);if(f)return`${u}.${f}`}}return null}const e=t(r);if(!e)return;const s=`[name="${e}"]`,n=`[name^="${e}["], [name^="${e}."]`,a=document.querySelector(s)??document.querySelector(n);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),a.focus({preventScroll:!0}))}const So={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"},Bs=({id:r,message:t,variant:e="info",duration:s=5e3,onClose:n})=>(v.useEffect(()=>{const a=setTimeout(()=>n(r),s);return()=>clearTimeout(a)},[r,s,n]),i.jsxs("div",{className:I("w-80 max-w-full border-l-4 rounded shadow-md p-4 mb-2 flex justify-between items-start",So[e]),role:"alert","aria-live":"assertive",children:[i.jsx("span",{className:"flex-1",children:t}),i.jsx("button",{onClick:()=>n(r),className:"ml-4 text-xl font-bold leading-none focus:outline-none",children:"×"})]}));let vt;const Fo=new Uint8Array(16);function To(){if(!vt&&(vt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vt(Fo)}const xe=[];for(let r=0;r<256;++r)xe.push((r+256).toString(16).slice(1));function Co(r,t=0){return xe[r[t+0]]+xe[r[t+1]]+xe[r[t+2]]+xe[r[t+3]]+"-"+xe[r[t+4]]+xe[r[t+5]]+"-"+xe[r[t+6]]+xe[r[t+7]]+"-"+xe[r[t+8]]+xe[r[t+9]]+"-"+xe[r[t+10]]+xe[r[t+11]]+xe[r[t+12]]+xe[r[t+13]]+xe[r[t+14]]+xe[r[t+15]]}const Oo=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qr={randomUUID:Oo};function Ao(r,t,e){if(qr.randomUUID&&!r)return qr.randomUUID();r=r||{};const s=r.random||(r.rng||To)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Co(s)}const Ws=v.createContext(null),Zs=()=>{const r=v.useContext(Ws);if(!r)throw new Error("useToast debe usarse dentro de <ToastProvider>");return r},Mo=({children:r})=>{const[t,e]=v.useState([]),s=(a,o="info",l=5e3)=>{const c=Ao();e(u=>[...u,{id:c,message:a,variant:o,duration:l}])},n=a=>{e(o=>o.filter(l=>l.id!==a))};return i.jsxs(Ws.Provider,{value:{show:s},children:[r,i.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col items-end",children:t.map(a=>i.jsx(Bs,{id:a.id,message:a.message,variant:a.variant,duration:a.duration,onClose:n},a.id))})]})},Gr=(r,t,e)=>{if(r&&"reportValidity"in r){const s=A(e,t);r.setCustomValidity(s&&s.message||""),r.reportValidity()}},qs=(r,t)=>{for(const e in t.fields){const s=t.fields[e];s&&s.ref&&"reportValidity"in s.ref?Gr(s.ref,e,r):s&&s.refs&&s.refs.forEach(n=>Gr(n,e,r))}},Ro=(r,t)=>{t.shouldUseNativeValidation&&qs(r,t);const e={};for(const s in r){const n=A(t.fields,s),a=Object.assign(r[s]||{},{ref:n&&n.ref});if(Vo(t.names||Object.keys(r),s)){const o=Object.assign({},A(e,s));ae(o,"root",a),ae(e,s,o)}else ae(e,s,a)}return e},Vo=(r,t)=>{const e=Hr(t);return r.some(s=>Hr(s).match(`^${e}\\.\\d+`))};function Hr(r){return r.replace(/\]|\[/g,"")}function Yr(r,t,e){return e===void 0&&(e={}),function(s,n,a){try{return Promise.resolve(function(o,l){try{var c=(t!=null&&t.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[e.mode==="sync"?"validateSync":"validate"](s,Object.assign({abortEarly:!1},t,{context:n}))).then(function(u){return a.shouldUseNativeValidation&&qs({},a),{values:e.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:Ro((l=o,c=!a.shouldUseNativeValidation&&a.criteriaMode==="all",(l.inner||[]).reduce(function(u,f){if(u[f.path]||(u[f.path]={message:f.message,type:f.type}),c){var m=u[f.path].types,p=m&&m[f.type];u[f.path]=Ss(f.path,c,u,f.type,p?[].concat(p,f.message):f.message)}return u},{})),a)};var l,c}))}catch(o){return Promise.reject(o)}}}var Pt,Xr;function $o(){if(Xr)return Pt;Xr=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,y){return this._size>=this._maxSize&&this.clear(),w in this._values||this._size++,this._values[w]=y};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,e=/^\d+$/,s=/^\d/,n=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,o=512,l=new r(o),c=new r(o),u=new r(o);Pt={Cache:r,split:m,normalizePath:f,setter:function(w){var y=f(w);return c.get(w)||c.set(w,function(M,F){for(var W=0,J=y.length,S=M;W<J-1;){var $=y[W];if($==="__proto__"||$==="constructor"||$==="prototype")return M;S=S[y[W++]]}S[y[W]]=F})},getter:function(w,y){var E=f(w);return u.get(w)||u.set(w,function(F){for(var W=0,J=E.length;W<J;)if(F!=null||!y)F=F[E[W++]];else return;return F})},join:function(w){return w.reduce(function(y,E){return y+(b(E)||e.test(E)?"["+E+"]":(y?".":"")+E)},"")},forEach:function(w,y,E){p(Array.isArray(w)?w:m(w),y,E)}};function f(w){return l.get(w)||l.set(w,m(w).map(function(y){return y.replace(a,"$2")}))}function m(w){return w.match(t)||[""]}function p(w,y,E){var M=w.length,F,W,J,S;for(W=0;W<M;W++)F=w[W],F&&(T(F)&&(F='"'+F+'"'),S=b(F),J=!S&&/^\d+$/.test(F),y.call(E,F,S,J,W,w))}function b(w){return typeof w=="string"&&w&&["'",'"'].indexOf(w.charAt(0))!==-1}function N(w){return w.match(s)&&!w.match(e)}function j(w){return n.test(w)}function T(w){return!b(w)&&(N(w)||j(w))}return Pt}var Ze=$o(),zt,Jr;function Do(){if(Jr)return zt;Jr=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,t=f=>f.match(r)||[],e=f=>f[0].toUpperCase()+f.slice(1),s=(f,m)=>t(f).join(m).toLowerCase(),n=f=>t(f).reduce((m,p)=>`${m}${m?p[0].toUpperCase()+p.slice(1).toLowerCase():p.toLowerCase()}`,"");return zt={words:t,upperFirst:e,camelCase:n,pascalCase:f=>e(n(f)),snakeCase:f=>s(f,"_"),kebabCase:f=>s(f,"-"),sentenceCase:f=>e(s(f," ")),titleCase:f=>t(f).map(e).join(" ")},zt}var Ut=Do(),wt={exports:{}},Kr;function Io(){if(Kr)return wt.exports;Kr=1,wt.exports=function(n){return r(t(n),n)},wt.exports.array=r;function r(n,a){var o=n.length,l=new Array(o),c={},u=o,f=e(a),m=s(n);for(a.forEach(function(b){if(!m.has(b[0])||!m.has(b[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)c[u]||p(n[u],u,new Set);return l;function p(b,N,j){if(j.has(b)){var T;try{T=", node was:"+JSON.stringify(b)}catch{T=""}throw new Error("Cyclic dependency"+T)}if(!m.has(b))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(b));if(!c[N]){c[N]=!0;var w=f.get(b)||new Set;if(w=Array.from(w),N=w.length){j.add(b);do{var y=w[--N];p(y,m.get(y),j)}while(N);j.delete(b)}l[--o]=b}}}function t(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 e(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 wt.exports}var Lo=Io();const Po=kn(Lo),zo=Object.prototype.toString,Uo=Error.prototype.toString,Bo=RegExp.prototype.toString,Wo=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Zo=/^Symbol\((.*)\)(.*)$/;function qo(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function Qr(r,t=!1){if(r==null||r===!0||r===!1)return""+r;const e=typeof r;if(e==="number")return qo(r);if(e==="string")return t?`"${r}"`:r;if(e==="function")return"[Function "+(r.name||"anonymous")+"]";if(e==="symbol")return Wo.call(r).replace(Zo,"Symbol($1)");const s=zo.call(r).slice(8,-1);return s==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):s==="Error"||r instanceof Error?"["+Uo.call(r)+"]":s==="RegExp"?Bo.call(r):null}function ze(r,t){let e=Qr(r,t);return e!==null?e:JSON.stringify(r,function(s,n){let a=Qr(this[s],t);return a!==null?a:n},2)}function Gs(r){return r==null?[]:[].concat(r)}let Hs,Ys,Xs,Go=/\$\{\s*(\w+)\s*\}/g;Hs=Symbol.toStringTag;class es{constructor(t,e,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[Hs]="Error",this.name="ValidationError",this.value=e,this.path=s,this.type=n,this.errors=[],this.inner=[],Gs(t).forEach(a=>{if(we.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]}}Ys=Symbol.hasInstance;Xs=Symbol.toStringTag;class we extends Error{static formatError(t,e){const s=e.label||e.path||"this";return e=Object.assign({},e,{path:s,originalPath:e.path}),typeof t=="string"?t.replace(Go,(n,a)=>ze(e[a])):typeof t=="function"?t(e):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,e,s,n,a){const o=new es(t,e,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[Xs]="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,we)}static[Ys](t){return es[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Te={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:t,value:e,originalValue:s})=>{const n=s!=null&&s!==e?` (cast from the value \`${ze(s,!0)}\`).`:".";return t!=="mixed"?`${r} must be a \`${t}\` type, but the final value was: \`${ze(e,!0)}\``+n:`${r} must match the configured type. The validated value was: \`${ze(e,!0)}\``+n}},ve={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"},Le={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"},Kt={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ho={isValue:"${path} field must be ${value}"},Et={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Yo={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"},Xo={notType:r=>{const{path:t,value:e,spec:s}=r,n=s.types.length;if(Array.isArray(e)){if(e.length<n)return`${t} tuple value has too few items, expected a length of ${n} but got ${e.length} for value: \`${ze(e,!0)}\``;if(e.length>n)return`${t} tuple value has too many items, expected a length of ${n} but got ${e.length} for value: \`${ze(e,!0)}\``}return we.formatError(Te.notType,r)}};Object.assign(Object.create(null),{mixed:Te,string:ve,number:Le,date:Kt,object:Et,array:Yo,boolean:Ho,tuple:Xo});const ur=r=>r&&r.__isYupSchema__;class Ct{static fromOptions(t,e){if(!e.then&&!e.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:n,otherwise:a}=e,o=typeof s=="function"?s:(...l)=>l.every(c=>c===s);return new Ct(t,(l,c)=>{var u;let f=o(...l)?n:a;return(u=f==null?void 0:f(c))!=null?u:c})}constructor(t,e){this.fn=void 0,this.refs=t,this.refs=t,this.fn=e}resolve(t,e){let s=this.refs.map(a=>a.getValue(e==null?void 0:e.value,e==null?void 0:e.parent,e==null?void 0:e.context)),n=this.fn(s,t,e);if(n===void 0||n===t)return t;if(!ur(n))throw new TypeError("conditions must return a schema object");return n.resolve(e)}}const kt={context:"$",value:"."};class Ge{constructor(t,e={}){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 t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===kt.context,this.isValue=this.key[0]===kt.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?kt.context:this.isValue?kt.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&Ze.getter(this.path,!0),this.map=e.map}getValue(t,e,s){let n=this.isContext?s:this.isValue?t:e;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(t,e){return this.getValue(t,e==null?void 0:e.parent,e==null?void 0:e.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Ge.prototype.__isYupRef=!0;const Ve=r=>r==null;function Xe(r){function t({value:e,path:s="",options:n,originalValue:a,schema:o},l,c){const{name:u,test:f,params:m,message:p,skipAbsent:b}=r;let{parent:N,context:j,abortEarly:T=o.spec.abortEarly,disableStackTrace:w=o.spec.disableStackTrace}=n;function y(R){return Ge.isRef(R)?R.getValue(e,N,j):R}function E(R={}){const V=Object.assign({value:e,originalValue:a,label:o.spec.label,path:R.path||s,spec:o.spec,disableStackTrace:R.disableStackTrace||w},m,R.params);for(const K of Object.keys(V))V[K]=y(V[K]);const H=new we(we.formatError(R.message||p,V),e,V.path,R.type||u,V.disableStackTrace);return H.params=V,H}const M=T?l:c;let F={path:s,parent:N,type:u,from:n.from,createError:E,resolve:y,options:n,originalValue:a,schema:o};const W=R=>{we.isError(R)?M(R):R?c(null):M(E())},J=R=>{we.isError(R)?M(R):l(R)};if(b&&Ve(e))return W(!0);let $;try{var P;if($=f.call(F,e,F),typeof((P=$)==null?void 0:P.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($).then(W,J)}}catch(R){J(R);return}W($)}return t.OPTIONS=r,t}function Jo(r,t,e,s=e){let n,a,o;return t?(Ze.forEach(t,(l,c,u)=>{let f=c?l.slice(1,l.length-1):l;r=r.resolve({context:s,parent:n,value:e});let m=r.type==="tuple",p=u?parseInt(f,10):0;if(r.innerType||m){if(m&&!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(e&&p>=e.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${t}. because there is no value at that index. `);n=e,e=e&&e[p],r=m?r.spec.types[p]:r.innerType}if(!u){if(!r.fields||!r.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${r.type}")`);n=e,e=e&&e[f],r=r.fields[f]}a=f,o=c?"["+l+"]":"."+l}),{schema:r,parent:n,parentPath:a}):{parent:n,parentPath:t,schema:r}}class Ot extends Set{describe(){const t=[];for(const e of this.values())t.push(Ge.isRef(e)?e.describe():e);return t}resolveAll(t){let e=[];for(const s of this.values())e.push(t(s));return e}clone(){return new Ot(this.values())}merge(t,e){const s=this.clone();return t.forEach(n=>s.add(n)),e.forEach(n=>s.delete(n)),s}}function Je(r,t=new Map){if(ur(r)||!r||typeof r!="object")return r;if(t.has(r))return t.get(r);let e;if(r instanceof Date)e=new Date(r.getTime()),t.set(r,e);else if(r instanceof RegExp)e=new RegExp(r),t.set(r,e);else if(Array.isArray(r)){e=new Array(r.length),t.set(r,e);for(let s=0;s<r.length;s++)e[s]=Je(r[s],t)}else if(r instanceof Map){e=new Map,t.set(r,e);for(const[s,n]of r.entries())e.set(s,Je(n,t))}else if(r instanceof Set){e=new Set,t.set(r,e);for(const s of r)e.add(Je(s,t))}else if(r instanceof Object){e={},t.set(r,e);for(const[s,n]of Object.entries(r))e[s]=Je(n,t)}else throw Error(`Unable to clone ${r}`);return e}class Ne{constructor(t){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 Ot,this._blacklist=new Ot,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Te.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const e=Object.create(Object.getPrototypeOf(this));return e.type=this.type,e._typeCheck=this._typeCheck,e._whitelist=this._whitelist.clone(),e._blacklist=this._blacklist.clone(),e.internalTests=Object.assign({},this.internalTests),e.exclusiveTests=Object.assign({},this.exclusiveTests),e.deps=[...this.deps],e.conditions=[...this.conditions],e.tests=[...this.tests],e.transforms=[...this.transforms],e.spec=Je(Object.assign({},this.spec,t)),e}label(t){let e=this.clone();return e.spec.label=t,e}meta(...t){if(t.length===0)return this.spec.meta;let e=this.clone();return e.spec.meta=Object.assign(e.spec.meta||{},t[0]),e}withMutation(t){let e=this._mutate;this._mutate=!0;let s=t(this);return this._mutate=e,s}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let e=this,s=t.clone();const n=Object.assign({},e.spec,s.spec);return s.spec=n,s.internalTests=Object.assign({},e.internalTests,s.internalTests),s._whitelist=e._whitelist.merge(t._whitelist,t._blacklist),s._blacklist=e._blacklist.merge(t._blacklist,t._whitelist),s.tests=e.tests,s.exclusiveTests=e.exclusiveTests,s.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),s.transforms=[...e.transforms,...s.transforms],s}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let e=this;if(e.conditions.length){let s=e.conditions;e=e.clone(),e.conditions=[],e=s.reduce((n,a)=>a.resolve(n,t),e),e=e.resolve(t)}return e}resolveOptions(t){var e,s,n,a;return Object.assign({},t,{from:t.from||[],strict:(e=t.strict)!=null?e:this.spec.strict,abortEarly:(s=t.abortEarly)!=null?s:this.spec.abortEarly,recursive:(n=t.recursive)!=null?n:this.spec.recursive,disableStackTrace:(a=t.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(t,e={}){let s=this.resolve(Object.assign({value:t},e)),n=e.assert==="ignore-optionality",a=s._cast(t,e);if(e.assert!==!1&&!s.isType(a)){if(n&&Ve(a))return a;let o=ze(t),l=ze(a);throw new TypeError(`The value of ${e.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
|
|
26
|
+
text-ds-lg`,children:r}),t&&i.jsx("div",{className:"flex items-center space-x-2",children:t})]}),i.jsx("main",{className:"flex-1 overflow-auto",children:e})]})}function Ps({options:r,value:t,onChange:e,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(T=>T.value===t);if(u<0)return;const f=l.children[u],p=f.querySelector("span"),x=(p==null?void 0:p.offsetWidth)??f.offsetWidth,b=f.offsetWidth,j=f.offsetLeft+(b-x)/2;o({left:j,width:x})};return c(),window.addEventListener("resize",c),l.addEventListener("scroll",c),()=>{window.removeEventListener("resize",c),l.removeEventListener("scroll",c)}},[t,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===t;return i.jsx("li",{role:"tab","aria-selected":c,onClick:()=>e(l.value),className:$("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[t]})]})}const Kt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},jo={sm:"h-6",md:"h-10",lg:"h-12"},Eo={sm:"px-2",md:"px-2.5",lg:"px-3"},Ur={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function Br(r,t,e,s,n,a,o,l,c){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative flex items-center w-full",children:[i.jsx("select",{id:r,...s,disabled:n,className:$("box-border w-full rounded-lg border bg-[var(--color-ds-background-page)] outline-none transition font-[var(--font-primary)]",Kt[e],jo[e],Eo[e],a?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",n?"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)]",l),children:t.map(u=>i.jsx("option",{value:u.value,className:"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",children:u.label},u.value))}),c&&i.jsx("div",{className:"flex items-center h-full pr-2",children:c})]}),!o&&i.jsx("div",{className:"min-h-[18px] w-full",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 ct(r){const{control:t,name:e,rules:s,defaultValue:n,options:a=[],loadOptions:o,reloadDeps:l=[],value:c,onChange:u,size:f="sm",width:p="100%",label:x,labelHidden:b=!1,hasError:E=!1,errorMessage:j="",disableErrorPlaceholder:T=!1,disabled:w=!1,className:y,suffixButton:N}=r,O=v.useId(),_=e||O,[D,Q]=v.useState(a),[S,W]=v.useState(!!o);if(v.useEffect(()=>{o&&(W(!0),o().then(G=>Q(G)).finally(()=>W(!1)))},[o,...l]),v.useEffect(()=>{!t&&D.length>0&&(c===void 0||c===""||!D.some(G=>G.value===c))&&(u==null||u(D[0].value))},[D,c,u,t]),t&&e){const{field:G,fieldState:R}=Ss({name:e,control:t,rules:s,defaultValue:n});return v.useEffect(()=>{if(!S&&D.length>0){const P=G.value;(P===void 0||!D.some(X=>X.value===P))&&G.onChange(D[0].value)}},[D,S,G]),i.jsxs("div",{className:$("flex flex-col",y),style:{width:p,maxWidth:"100%"},children:[x&&i.jsx("label",{htmlFor:_,className:$("pb-2 text-[var(--color-ds-text-primary)]",Kt[f],b&&"sr-only"),children:x}),S?i.jsx(qe,{width:"100%",height:Ur[f],variant:"rect",className:"rounded-lg"}):Br(_,D,f,{value:G.value,onChange:P=>G.onChange(P.target.value)},w,R.error,T,y,N)]})}return i.jsxs("div",{className:$("flex flex-col",y),style:{width:p,maxWidth:"100%"},children:[x&&i.jsx("label",{htmlFor:_,className:$("pb-2 text-[var(--color-ds-text-primary)]",Kt[f],b&&"sr-only"),children:x}),S?i.jsx(qe,{width:"100%",height:Ur[f],variant:"rect",className:"rounded-lg"}):Br(_,D,f,{value:c,onChange:G=>u==null?void 0:u(G.target.value)},w,E?{message:j}:void 0,T,y,N)]})}const Wr={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"};function zs({groupLabel:r,inputs:t=[],separator:e=i.jsx("span",{className:"px-1 select-none",children:"/"}),useSeparator:s=!0,className:n,showVisibleLabel:a=!1,size:o="sm",width:l}){const c=t.length;return i.jsxs("div",{className:$("flex flex-col",n),style:l?{width:l}:void 0,children:[i.jsx("label",{className:$("sr-only pb-2",Wr[o]),children:r}),a&&i.jsx("label",{className:$("pb-2",Wr[o]),children:r}),i.jsx("div",{className:"flex items-center flex-nowrap",children:t.map((u,f)=>{const{width:p,className:x,options:b,loadOptions:E,...j}=u,T=Array.isArray(b)||typeof E=="function";let w="rounded-lg";!s&&c>1&&(f===0?w="rounded-l-lg rounded-r-none":f===c-1?w="rounded-r-lg rounded-l-none":w="rounded-none");const y=$("inline-flex items-center flex-shrink-0 overflow-hidden",typeof p=="string"&&p.startsWith("w-")?p:void 0),N=typeof p=="string"&&!p.startsWith("w-")?{width:p}:void 0,O=$(x,w);return i.jsxs("div",{className:y,style:N,children:[T?i.jsx(ct,{...j,size:o,className:O,options:b,loadOptions:E}):i.jsx(Mt,{...j,size:o,className:O}),s&&f<c-1&&e]},f)})})]})}const Zr={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},No={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function Us({groupLabel:r,options:t,control:e,name:s,rules:n,defaultValue:a,multiple:o=!0,size:l="sm",vertical:c=!0,className:u,showVisibleLabel:f=!0}){return i.jsx(Fe,{name:s,control:e,rules:n,defaultValue:a,render:({field:p,fieldState:x})=>{const{value:b,onChange:E}=p;x.error;const j=w=>o?Array.isArray(b)&&b.includes(w):b===w,T=w=>{if(o){const y=Array.isArray(b)?[...b]:[],N=y.indexOf(w);N>=0?y.splice(N,1):y.push(w),E(y)}else E(w)};return i.jsxs("div",{className:$("w-full",u),children:[i.jsx("label",{className:$("sr-only pb-2 text-[var(--color-ds-text-primary)]",Zr[l]),children:r}),f&&i.jsx("label",{className:$("block pb-2 text-[var(--color-ds-text-primary)]",Zr[l]),children:r}),i.jsx("div",{className:$(c?"flex flex-col gap-2":"flex flex-wrap gap-4"),children:t.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:j(w.value),onChange:()=>T(w.value),className:$(No[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 So(r){function t(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 f=t(o[u]);if(f)return`${u}.${f}`}}return null}const e=t(r);if(!e)return;const s=`[name="${e}"]`,n=`[name^="${e}["], [name^="${e}."]`,a=document.querySelector(s)??document.querySelector(n);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),a.focus({preventScroll:!0}))}const _o={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"},Bs=({id:r,message:t,variant:e="info",duration:s=5e3,onClose:n})=>(v.useEffect(()=>{const a=setTimeout(()=>n(r),s);return()=>clearTimeout(a)},[r,s,n]),i.jsxs("div",{className:$("w-80 max-w-full border-l-4 rounded shadow-md p-4 mb-2 flex justify-between items-start",_o[e]),role:"alert","aria-live":"assertive",children:[i.jsx("span",{className:"flex-1",children:t}),i.jsx("button",{onClick:()=>n(r),className:"ml-4 text-xl font-bold leading-none focus:outline-none",children:"×"})]}));let vt;const Fo=new Uint8Array(16);function To(){if(!vt&&(vt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vt(Fo)}const xe=[];for(let r=0;r<256;++r)xe.push((r+256).toString(16).slice(1));function Co(r,t=0){return xe[r[t+0]]+xe[r[t+1]]+xe[r[t+2]]+xe[r[t+3]]+"-"+xe[r[t+4]]+xe[r[t+5]]+"-"+xe[r[t+6]]+xe[r[t+7]]+"-"+xe[r[t+8]]+xe[r[t+9]]+"-"+xe[r[t+10]]+xe[r[t+11]]+xe[r[t+12]]+xe[r[t+13]]+xe[r[t+14]]+xe[r[t+15]]}const Oo=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qr={randomUUID:Oo};function Ao(r,t,e){if(qr.randomUUID&&!r)return qr.randomUUID();r=r||{};const s=r.random||(r.rng||To)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Co(s)}const Ws=v.createContext(null),Zs=()=>{const r=v.useContext(Ws);if(!r)throw new Error("useToast debe usarse dentro de <ToastProvider>");return r},Mo=({children:r})=>{const[t,e]=v.useState([]),s=(a,o="info",l=5e3)=>{const c=Ao();e(u=>[...u,{id:c,message:a,variant:o,duration:l}])},n=a=>{e(o=>o.filter(l=>l.id!==a))};return i.jsxs(Ws.Provider,{value:{show:s},children:[r,i.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col items-end",children:t.map(a=>i.jsx(Bs,{id:a.id,message:a.message,variant:a.variant,duration:a.duration,onClose:n},a.id))})]})},Gr=(r,t,e)=>{if(r&&"reportValidity"in r){const s=M(e,t);r.setCustomValidity(s&&s.message||""),r.reportValidity()}},qs=(r,t)=>{for(const e in t.fields){const s=t.fields[e];s&&s.ref&&"reportValidity"in s.ref?Gr(s.ref,e,r):s&&s.refs&&s.refs.forEach(n=>Gr(n,e,r))}},Ro=(r,t)=>{t.shouldUseNativeValidation&&qs(r,t);const e={};for(const s in r){const n=M(t.fields,s),a=Object.assign(r[s]||{},{ref:n&&n.ref});if(Vo(t.names||Object.keys(r),s)){const o=Object.assign({},M(e,s));oe(o,"root",a),oe(e,s,o)}else oe(e,s,a)}return e},Vo=(r,t)=>{const e=Hr(t);return r.some(s=>Hr(s).match(`^${e}\\.\\d+`))};function Hr(r){return r.replace(/\]|\[/g,"")}function Yr(r,t,e){return e===void 0&&(e={}),function(s,n,a){try{return Promise.resolve(function(o,l){try{var c=(t!=null&&t.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[e.mode==="sync"?"validateSync":"validate"](s,Object.assign({abortEarly:!1},t,{context:n}))).then(function(u){return a.shouldUseNativeValidation&&qs({},a),{values:e.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:Ro((l=o,c=!a.shouldUseNativeValidation&&a.criteriaMode==="all",(l.inner||[]).reduce(function(u,f){if(u[f.path]||(u[f.path]={message:f.message,type:f.type}),c){var p=u[f.path].types,x=p&&p[f.type];u[f.path]=_s(f.path,c,u,f.type,x?[].concat(x,f.message):f.message)}return u},{})),a)};var l,c}))}catch(o){return Promise.reject(o)}}}var Pt,Xr;function $o(){if(Xr)return Pt;Xr=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,y){return this._size>=this._maxSize&&this.clear(),w in this._values||this._size++,this._values[w]=y};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,e=/^\d+$/,s=/^\d/,n=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,o=512,l=new r(o),c=new r(o),u=new r(o);Pt={Cache:r,split:p,normalizePath:f,setter:function(w){var y=f(w);return c.get(w)||c.set(w,function(O,_){for(var D=0,Q=y.length,S=O;D<Q-1;){var W=y[D];if(W==="__proto__"||W==="constructor"||W==="prototype")return O;S=S[y[D++]]}S[y[D]]=_})},getter:function(w,y){var N=f(w);return u.get(w)||u.set(w,function(_){for(var D=0,Q=N.length;D<Q;)if(_!=null||!y)_=_[N[D++]];else return;return _})},join:function(w){return w.reduce(function(y,N){return y+(b(N)||e.test(N)?"["+N+"]":(y?".":"")+N)},"")},forEach:function(w,y,N){x(Array.isArray(w)?w:p(w),y,N)}};function f(w){return l.get(w)||l.set(w,p(w).map(function(y){return y.replace(a,"$2")}))}function p(w){return w.match(t)||[""]}function x(w,y,N){var O=w.length,_,D,Q,S;for(D=0;D<O;D++)_=w[D],_&&(T(_)&&(_='"'+_+'"'),S=b(_),Q=!S&&/^\d+$/.test(_),y.call(N,_,S,Q,D,w))}function b(w){return typeof w=="string"&&w&&["'",'"'].indexOf(w.charAt(0))!==-1}function E(w){return w.match(s)&&!w.match(e)}function j(w){return n.test(w)}function T(w){return!b(w)&&(E(w)||j(w))}return Pt}var Ze=$o(),zt,Kr;function Do(){if(Kr)return zt;Kr=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,t=f=>f.match(r)||[],e=f=>f[0].toUpperCase()+f.slice(1),s=(f,p)=>t(f).join(p).toLowerCase(),n=f=>t(f).reduce((p,x)=>`${p}${p?x[0].toUpperCase()+x.slice(1).toLowerCase():x.toLowerCase()}`,"");return zt={words:t,upperFirst:e,camelCase:n,pascalCase:f=>e(n(f)),snakeCase:f=>s(f,"_"),kebabCase:f=>s(f,"-"),sentenceCase:f=>e(s(f," ")),titleCase:f=>t(f).map(e).join(" ")},zt}var Ut=Do(),wt={exports:{}},Jr;function Io(){if(Jr)return wt.exports;Jr=1,wt.exports=function(n){return r(t(n),n)},wt.exports.array=r;function r(n,a){var o=n.length,l=new Array(o),c={},u=o,f=e(a),p=s(n);for(a.forEach(function(b){if(!p.has(b[0])||!p.has(b[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)c[u]||x(n[u],u,new Set);return l;function x(b,E,j){if(j.has(b)){var T;try{T=", node was:"+JSON.stringify(b)}catch{T=""}throw new Error("Cyclic dependency"+T)}if(!p.has(b))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(b));if(!c[E]){c[E]=!0;var w=f.get(b)||new Set;if(w=Array.from(w),E=w.length){j.add(b);do{var y=w[--E];x(y,p.get(y),j)}while(E);j.delete(b)}l[--o]=b}}}function t(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 e(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 wt.exports}var Lo=Io();const Po=kn(Lo),zo=Object.prototype.toString,Uo=Error.prototype.toString,Bo=RegExp.prototype.toString,Wo=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Zo=/^Symbol\((.*)\)(.*)$/;function qo(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function Qr(r,t=!1){if(r==null||r===!0||r===!1)return""+r;const e=typeof r;if(e==="number")return qo(r);if(e==="string")return t?`"${r}"`:r;if(e==="function")return"[Function "+(r.name||"anonymous")+"]";if(e==="symbol")return Wo.call(r).replace(Zo,"Symbol($1)");const s=zo.call(r).slice(8,-1);return s==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):s==="Error"||r instanceof Error?"["+Uo.call(r)+"]":s==="RegExp"?Bo.call(r):null}function ze(r,t){let e=Qr(r,t);return e!==null?e:JSON.stringify(r,function(s,n){let a=Qr(this[s],t);return a!==null?a:n},2)}function Gs(r){return r==null?[]:[].concat(r)}let Hs,Ys,Xs,Go=/\$\{\s*(\w+)\s*\}/g;Hs=Symbol.toStringTag;class es{constructor(t,e,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[Hs]="Error",this.name="ValidationError",this.value=e,this.path=s,this.type=n,this.errors=[],this.inner=[],Gs(t).forEach(a=>{if(we.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]}}Ys=Symbol.hasInstance;Xs=Symbol.toStringTag;class we extends Error{static formatError(t,e){const s=e.label||e.path||"this";return e=Object.assign({},e,{path:s,originalPath:e.path}),typeof t=="string"?t.replace(Go,(n,a)=>ze(e[a])):typeof t=="function"?t(e):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,e,s,n,a){const o=new es(t,e,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[Xs]="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,we)}static[Ys](t){return es[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Te={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:t,value:e,originalValue:s})=>{const n=s!=null&&s!==e?` (cast from the value \`${ze(s,!0)}\`).`:".";return t!=="mixed"?`${r} must be a \`${t}\` type, but the final value was: \`${ze(e,!0)}\``+n:`${r} must match the configured type. The validated value was: \`${ze(e,!0)}\``+n}},ve={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"},Le={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"},Jt={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ho={isValue:"${path} field must be ${value}"},Et={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Yo={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"},Xo={notType:r=>{const{path:t,value:e,spec:s}=r,n=s.types.length;if(Array.isArray(e)){if(e.length<n)return`${t} tuple value has too few items, expected a length of ${n} but got ${e.length} for value: \`${ze(e,!0)}\``;if(e.length>n)return`${t} tuple value has too many items, expected a length of ${n} but got ${e.length} for value: \`${ze(e,!0)}\``}return we.formatError(Te.notType,r)}};Object.assign(Object.create(null),{mixed:Te,string:ve,number:Le,date:Jt,object:Et,array:Yo,boolean:Ho,tuple:Xo});const ur=r=>r&&r.__isYupSchema__;class Ct{static fromOptions(t,e){if(!e.then&&!e.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:n,otherwise:a}=e,o=typeof s=="function"?s:(...l)=>l.every(c=>c===s);return new Ct(t,(l,c)=>{var u;let f=o(...l)?n:a;return(u=f==null?void 0:f(c))!=null?u:c})}constructor(t,e){this.fn=void 0,this.refs=t,this.refs=t,this.fn=e}resolve(t,e){let s=this.refs.map(a=>a.getValue(e==null?void 0:e.value,e==null?void 0:e.parent,e==null?void 0:e.context)),n=this.fn(s,t,e);if(n===void 0||n===t)return t;if(!ur(n))throw new TypeError("conditions must return a schema object");return n.resolve(e)}}const kt={context:"$",value:"."};class Ge{constructor(t,e={}){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 t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===kt.context,this.isValue=this.key[0]===kt.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?kt.context:this.isValue?kt.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&Ze.getter(this.path,!0),this.map=e.map}getValue(t,e,s){let n=this.isContext?s:this.isValue?t:e;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(t,e){return this.getValue(t,e==null?void 0:e.parent,e==null?void 0:e.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Ge.prototype.__isYupRef=!0;const Ve=r=>r==null;function Xe(r){function t({value:e,path:s="",options:n,originalValue:a,schema:o},l,c){const{name:u,test:f,params:p,message:x,skipAbsent:b}=r;let{parent:E,context:j,abortEarly:T=o.spec.abortEarly,disableStackTrace:w=o.spec.disableStackTrace}=n;function y(R){return Ge.isRef(R)?R.getValue(e,E,j):R}function N(R={}){const P=Object.assign({value:e,originalValue:a,label:o.spec.label,path:R.path||s,spec:o.spec,disableStackTrace:R.disableStackTrace||w},p,R.params);for(const ee of Object.keys(P))P[ee]=y(P[ee]);const X=new we(we.formatError(R.message||x,P),e,P.path,R.type||u,P.disableStackTrace);return X.params=P,X}const O=T?l:c;let _={path:s,parent:E,type:u,from:n.from,createError:N,resolve:y,options:n,originalValue:a,schema:o};const D=R=>{we.isError(R)?O(R):R?c(null):O(N())},Q=R=>{we.isError(R)?O(R):l(R)};if(b&&Ve(e))return D(!0);let W;try{var G;if(W=f.call(_,e,_),typeof((G=W)==null?void 0:G.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(W).then(D,Q)}}catch(R){Q(R);return}D(W)}return t.OPTIONS=r,t}function Ko(r,t,e,s=e){let n,a,o;return t?(Ze.forEach(t,(l,c,u)=>{let f=c?l.slice(1,l.length-1):l;r=r.resolve({context:s,parent:n,value:e});let p=r.type==="tuple",x=u?parseInt(f,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(e&&x>=e.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${t}. because there is no value at that index. `);n=e,e=e&&e[x],r=p?r.spec.types[x]:r.innerType}if(!u){if(!r.fields||!r.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${r.type}")`);n=e,e=e&&e[f],r=r.fields[f]}a=f,o=c?"["+l+"]":"."+l}),{schema:r,parent:n,parentPath:a}):{parent:n,parentPath:t,schema:r}}class Ot extends Set{describe(){const t=[];for(const e of this.values())t.push(Ge.isRef(e)?e.describe():e);return t}resolveAll(t){let e=[];for(const s of this.values())e.push(t(s));return e}clone(){return new Ot(this.values())}merge(t,e){const s=this.clone();return t.forEach(n=>s.add(n)),e.forEach(n=>s.delete(n)),s}}function Ke(r,t=new Map){if(ur(r)||!r||typeof r!="object")return r;if(t.has(r))return t.get(r);let e;if(r instanceof Date)e=new Date(r.getTime()),t.set(r,e);else if(r instanceof RegExp)e=new RegExp(r),t.set(r,e);else if(Array.isArray(r)){e=new Array(r.length),t.set(r,e);for(let s=0;s<r.length;s++)e[s]=Ke(r[s],t)}else if(r instanceof Map){e=new Map,t.set(r,e);for(const[s,n]of r.entries())e.set(s,Ke(n,t))}else if(r instanceof Set){e=new Set,t.set(r,e);for(const s of r)e.add(Ke(s,t))}else if(r instanceof Object){e={},t.set(r,e);for(const[s,n]of Object.entries(r))e[s]=Ke(n,t)}else throw Error(`Unable to clone ${r}`);return e}class Ne{constructor(t){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 Ot,this._blacklist=new Ot,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Te.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const e=Object.create(Object.getPrototypeOf(this));return e.type=this.type,e._typeCheck=this._typeCheck,e._whitelist=this._whitelist.clone(),e._blacklist=this._blacklist.clone(),e.internalTests=Object.assign({},this.internalTests),e.exclusiveTests=Object.assign({},this.exclusiveTests),e.deps=[...this.deps],e.conditions=[...this.conditions],e.tests=[...this.tests],e.transforms=[...this.transforms],e.spec=Ke(Object.assign({},this.spec,t)),e}label(t){let e=this.clone();return e.spec.label=t,e}meta(...t){if(t.length===0)return this.spec.meta;let e=this.clone();return e.spec.meta=Object.assign(e.spec.meta||{},t[0]),e}withMutation(t){let e=this._mutate;this._mutate=!0;let s=t(this);return this._mutate=e,s}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let e=this,s=t.clone();const n=Object.assign({},e.spec,s.spec);return s.spec=n,s.internalTests=Object.assign({},e.internalTests,s.internalTests),s._whitelist=e._whitelist.merge(t._whitelist,t._blacklist),s._blacklist=e._blacklist.merge(t._blacklist,t._whitelist),s.tests=e.tests,s.exclusiveTests=e.exclusiveTests,s.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),s.transforms=[...e.transforms,...s.transforms],s}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let e=this;if(e.conditions.length){let s=e.conditions;e=e.clone(),e.conditions=[],e=s.reduce((n,a)=>a.resolve(n,t),e),e=e.resolve(t)}return e}resolveOptions(t){var e,s,n,a;return Object.assign({},t,{from:t.from||[],strict:(e=t.strict)!=null?e:this.spec.strict,abortEarly:(s=t.abortEarly)!=null?s:this.spec.abortEarly,recursive:(n=t.recursive)!=null?n:this.spec.recursive,disableStackTrace:(a=t.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(t,e={}){let s=this.resolve(Object.assign({value:t},e)),n=e.assert==="ignore-optionality",a=s._cast(t,e);if(e.assert!==!1&&!s.isType(a)){if(n&&Ve(a))return a;let o=ze(t),l=ze(a);throw new TypeError(`The value of ${e.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(t,e){let s=t===void 0?t:this.transforms.reduce((n,a)=>a.call(this,n,t,this),t);return s===void 0&&(s=this.getDefault(e)),s}_validate(t,e={},s,n){let{path:a,originalValue:o=t,strict:l=this.spec.strict}=e,c=t;l||(c=this._cast(c,Object.assign({assert:!1},e)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:a,value:c,originalValue:o,options:e,tests:u},s,f=>{if(f.length)return n(f,c);this.runTests({path:a,value:c,originalValue:o,options:e,tests:this.tests},s,n)})}runTests(t,e,s){let n=!1,{tests:a,value:o,originalValue:l,path:c,options:u}=t,f=j=>{n||(n=!0,e(j,o))},m=j=>{n||(n=!0,s(j,o))},p=a.length,b=[];if(!p)return m([]);let N={value:o,originalValue:l,path:c,options:u,schema:this};for(let j=0;j<a.length;j++){const T=a[j];T(N,f,function(y){y&&(Array.isArray(y)?b.push(...y):b.push(y)),--p<=0&&m(b)})}}asNestedTest({key:t,index:e,parent:s,parentPath:n,originalParent:a,options:o}){const l=t??e;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let u=s[l];const f=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}.`:"")+t});return(m,p,b)=>this.resolve(f)._validate(u,f,p,b)}validate(t,e){var s;let n=this.resolve(Object.assign({},e,{value:t})),a=(s=e==null?void 0:e.disableStackTrace)!=null?s:n.spec.disableStackTrace;return new Promise((o,l)=>n._validate(t,e,(c,u)=>{we.isError(c)&&(c.value=u),l(c)},(c,u)=>{c.length?l(new we(c,u,void 0,void 0,a)):o(u)}))}validateSync(t,e){var s;let n=this.resolve(Object.assign({},e,{value:t})),a,o=(s=e==null?void 0:e.disableStackTrace)!=null?s:n.spec.disableStackTrace;return n._validate(t,Object.assign({},e,{sync:!0}),(l,c)=>{throw we.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new we(l,t,void 0,void 0,o);a=c}),a}isValid(t,e){return this.validate(t,e).then(()=>!0,s=>{if(we.isError(s))return!1;throw s})}isValidSync(t,e){try{return this.validateSync(t,e),!0}catch(s){if(we.isError(s))return!1;throw s}}_getDefault(t){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this,t):Je(e)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,e){const s=this.clone({nullable:t});return s.internalTests.nullable=Xe({message:e,name:"nullable",test(n){return n===null?this.schema.spec.nullable:!0}}),s}optionality(t,e){const s=this.clone({optional:t});return s.internalTests.optionality=Xe({message:e,name:"optionality",test(n){return n===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(t=Te.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Te.notNull){return this.nullability(!1,t)}required(t=Te.required){return this.clone().withMutation(e=>e.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let e=this.clone();return e.transforms.push(t),e}test(...t){let e;if(t.length===1?typeof t[0]=="function"?e={test:t[0]}:e=t[0]:t.length===2?e={name:t[0],test:t[1]}:e={name:t[0],message:t[1],test:t[2]},e.message===void 0&&(e.message=Te.default),typeof e.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),n=Xe(e),a=e.exclusive||e.name&&s.exclusiveTests[e.name]===!0;if(e.exclusive&&!e.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return e.name&&(s.exclusiveTests[e.name]=!!e.exclusive),s.tests=s.tests.filter(o=>!(o.OPTIONS.name===e.name&&(a||o.OPTIONS.test===n.OPTIONS.test))),s.tests.push(n),s}when(t,e){!Array.isArray(t)&&typeof t!="string"&&(e=t,t=".");let s=this.clone(),n=Gs(t).map(a=>new Ge(a));return n.forEach(a=>{a.isSibling&&s.deps.push(a.key)}),s.conditions.push(typeof e=="function"?new Ct(n,e):Ct.fromOptions(n,e)),s}typeError(t){let e=this.clone();return e.internalTests.typeError=Xe({message:t,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),e}oneOf(t,e=Te.oneOf){let s=this.clone();return t.forEach(n=>{s._whitelist.add(n),s._blacklist.delete(n)}),s.internalTests.whiteList=Xe({message:e,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(t,e=Te.notOneOf){let s=this.clone();return t.forEach(n=>{s._blacklist.add(n),s._whitelist.delete(n)}),s.internalTests.blacklist=Xe({message:e,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(t=!0){let e=this.clone();return e.spec.strip=t,e}describe(t){const e=(t?this.resolve(t):this).clone(),{label:s,meta:n,optional:a,nullable:o}=e.spec;return{meta:n,label:s,optional:a,nullable:o,default:e.getDefault(t),type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,u,f)=>f.findIndex(m=>m.name===c.name)===u)}}}Ne.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])Ne.prototype[`${r}At`]=function(t,e,s={}){const{parent:n,parentPath:a,schema:o}=Jo(this,t,e,s.context);return o[r](n&&n[a],Object.assign({},s,{parent:n,path:t}))};for(const r of["equals","is"])Ne.prototype[r]=Ne.prototype.oneOf;for(const r of["not","nope"])Ne.prototype[r]=Ne.prototype.notOneOf;const Ko=()=>!0;function Qt(r){return new Js(r)}class Js extends Ne{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:Ko},t))}}Qt.prototype=Js.prototype;const Qo=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function ei(r){const t=er(r);if(!t)return Date.parse?Date.parse(r):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let e=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(e=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(e=0-e)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+e,t.second,t.millisecond)}function er(r){var t,e;const s=Qo.exec(r);return s?{year:Re(s[1]),month:Re(s[2],1)-1,day:Re(s[3],1),hour:Re(s[4]),minute:Re(s[5]),second:Re(s[6]),millisecond:s[7]?Re(s[7].substring(0,3)):0,precision:(t=(e=s[7])==null?void 0:e.length)!=null?t:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:Re(s[10]),minuteOffset:Re(s[11])}:null}function Re(r,t=0){return Number(r)||t}let ti=/^[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])?)*$/,ri=/^((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,si=/^(?:[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,ni="^\\d{4}-\\d{2}-\\d{2}",ai="\\d{2}:\\d{2}:\\d{2}",oi="(([+-]\\d{2}(:?\\d{2})?)|Z)",ii=new RegExp(`${ni}T${ai}(\\.\\d+)?${oi}$`),li=r=>Ve(r)||r===r.trim(),ci={}.toString();function Ks(){return new Qs}class Qs extends Ne{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,e,s)=>{if(!s.spec.coerce||s.isType(t)||Array.isArray(t))return t;const n=t!=null&&t.toString?t.toString():t;return n===ci?t:n})})}required(t){return super.required(t).withMutation(e=>e.test({message:t||Te.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(e=>e.OPTIONS.name!=="required"),t))}length(t,e=ve.length){return this.test({message:e,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(s){return s.length===this.resolve(t)}})}min(t,e=ve.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s.length>=this.resolve(t)}})}max(t,e=ve.max){return this.test({name:"max",exclusive:!0,message:e,params:{max:t},skipAbsent:!0,test(s){return s.length<=this.resolve(t)}})}matches(t,e){let s=!1,n,a;return e&&(typeof e=="object"?{excludeEmptyString:s=!1,message:n,name:a}=e:n=e),this.test({name:a||"matches",message:n||ve.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&s||o.search(t)!==-1})}email(t=ve.email){return this.matches(ti,{name:"email",message:t,excludeEmptyString:!0})}url(t=ve.url){return this.matches(ri,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=ve.uuid){return this.matches(si,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let e="",s,n;return t&&(typeof t=="object"?{message:e="",allowOffset:s=!1,precision:n=void 0}=t:e=t),this.matches(ii,{name:"datetime",message:e||ve.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:e||ve.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:a=>{if(!a||s)return!0;const o=er(a);return o?!!o.z:!1}}).test({name:"datetime_precision",message:e||ve.datetime_precision,params:{precision:n},skipAbsent:!0,test:a=>{if(!a||n==null)return!0;const o=er(a);return o?o.precision===n:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=ve.trim){return this.transform(e=>e!=null?e.trim():e).test({message:t,name:"trim",test:li})}lowercase(t=ve.lowercase){return this.transform(e=>Ve(e)?e:e.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ve(e)||e===e.toLowerCase()})}uppercase(t=ve.uppercase){return this.transform(e=>Ve(e)?e:e.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ve(e)||e===e.toUpperCase()})}}Ks.prototype=Qs.prototype;let di=r=>r!=+r;function en(){return new tn}class tn extends Ne{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!di(t)}}),this.withMutation(()=>{this.transform((t,e,s)=>{if(!s.spec.coerce)return t;let n=t;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(t,e=Le.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(t)}})}max(t,e=Le.max){return this.test({message:e,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(t)}})}lessThan(t,e=Le.lessThan){return this.test({message:e,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(s){return s<this.resolve(t)}})}moreThan(t,e=Le.moreThan){return this.test({message:e,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(s){return s>this.resolve(t)}})}positive(t=Le.positive){return this.moreThan(0,t)}negative(t=Le.negative){return this.lessThan(0,t)}integer(t=Le.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:e=>Number.isInteger(e)})}truncate(){return this.transform(t=>Ve(t)?t:t|0)}round(t){var e;let s=["ceil","floor","round","trunc"];if(t=((e=t)==null?void 0:e.toLowerCase())||"round",t==="trunc")return this.truncate();if(s.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+s.join(", "));return this.transform(n=>Ve(n)?n:Math[t](n))}}en.prototype=tn.prototype;let rn=new Date(""),ui=r=>Object.prototype.toString.call(r)==="[object Date]";function fr(){return new ft}class ft extends Ne{constructor(){super({type:"date",check(t){return ui(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,e,s)=>!s.spec.coerce||s.isType(t)||t===null?t:(t=ei(t),isNaN(t)?ft.INVALID_DATE:new Date(t)))})}prepareParam(t,e){let s;if(Ge.isRef(t))s=t;else{let n=this.cast(t);if(!this._typeCheck(n))throw new TypeError(`\`${e}\` must be a Date or a value that can be \`cast()\` to a Date`);s=n}return s}min(t,e=Kt.min){let s=this.prepareParam(t,"min");return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(s)}})}max(t,e=Kt.max){let s=this.prepareParam(t,"max");return this.test({message:e,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(s)}})}}ft.INVALID_DATE=rn;fr.prototype=ft.prototype;fr.INVALID_DATE=rn;function fi(r,t=[]){let e=[],s=new Set,n=new Set(t.map(([o,l])=>`${o}-${l}`));function a(o,l){let c=Ze.split(o)[0];s.add(c),n.has(`${l}-${c}`)||e.push([l,c])}for(const o of Object.keys(r)){let l=r[o];s.add(o),Ge.isRef(l)&&l.isSibling?a(l.path,o):ur(l)&&"deps"in l&&l.deps.forEach(c=>a(c,o))}return Po.array(Array.from(s),e).reverse()}function ts(r,t){let e=1/0;return r.some((s,n)=>{var a;if((a=t.path)!=null&&a.includes(s))return e=n,!0}),e}function sn(r){return(t,e)=>ts(r,t)-ts(r,e)}const hi=(r,t,e)=>{if(typeof r!="string")return r;let s=r;try{s=JSON.parse(r)}catch{}return e.isType(s)?s:r};function Nt(r){if("fields"in r){const t={};for(const[e,s]of Object.entries(r.fields))t[e]=Nt(s);return r.setFields(t)}if(r.type==="array"){const t=r.optional();return t.innerType&&(t.innerType=Nt(t.innerType)),t}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(Nt)}):"optional"in r?r.optional():r}const mi=(r,t)=>{const e=[...Ze.normalizePath(t)];if(e.length===1)return e[0]in r;let s=e.pop(),n=Ze.getter(Ze.join(e),!0)(r);return!!(n&&s in n)};let rs=r=>Object.prototype.toString.call(r)==="[object Object]";function ss(r,t){let e=Object.keys(r.fields);return Object.keys(t).filter(s=>e.indexOf(s)===-1)}const pi=sn([]);function nn(r){return new an(r)}class an extends Ne{constructor(t){super({type:"object",check(e){return rs(e)||typeof e=="function"}}),this.fields=Object.create(null),this._sortErrors=pi,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,e={}){var s;let n=super._cast(t,e);if(n===void 0)return this.getDefault(e);if(!this._typeCheck(n))return n;let a=this.fields,o=(s=e.stripUnknown)!=null?s:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(n).filter(m=>!this._nodes.includes(m))),c={},u=Object.assign({},e,{parent:c,__validating:e.__validating||!1}),f=!1;for(const m of l){let p=a[m],b=m in n;if(p){let N,j=n[m];u.path=(e.path?`${e.path}.`:"")+m,p=p.resolve({value:j,context:e.context,parent:c});let T=p instanceof Ne?p.spec:void 0,w=T==null?void 0:T.strict;if(T!=null&&T.strip){f=f||m in n;continue}N=!e.__validating||!w?p.cast(n[m],u):n[m],N!==void 0&&(c[m]=N)}else b&&!o&&(c[m]=n[m]);(b!==m in c||c[m]!==n[m])&&(f=!0)}return f?c:n}_validate(t,e={},s,n){let{from:a=[],originalValue:o=t,recursive:l=this.spec.recursive}=e;e.from=[{schema:this,value:o},...a],e.__validating=!0,e.originalValue=o,super._validate(t,e,s,(c,u)=>{if(!l||!rs(u)){n(c,u);return}o=o||u;let f=[];for(let m of this._nodes){let p=this.fields[m];!p||Ge.isRef(p)||f.push(p.asNestedTest({options:e,key:m,parent:u,parentPath:e.path,originalParent:o}))}this.runTests({tests:f,value:u,originalValue:o,options:e},s,m=>{n(m.sort(this._sortErrors).concat(c),u)})})}clone(t){const e=super.clone(t);return e.fields=Object.assign({},this.fields),e._nodes=this._nodes,e._excludedEdges=this._excludedEdges,e._sortErrors=this._sortErrors,e}concat(t){let e=super.concat(t),s=e.fields;for(let[n,a]of Object.entries(this.fields)){const o=s[n];s[n]=o===void 0?a:o}return e.withMutation(n=>n.setFields(s,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let e={};return this._nodes.forEach(s=>{var n;const a=this.fields[s];let o=t;(n=o)!=null&&n.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[s]})),e[s]=a&&"getDefault"in a?a.getDefault(o):void 0}),e}setFields(t,e){let s=this.clone();return s.fields=t,s._nodes=fi(t,e),s._sortErrors=sn(Object.keys(t)),e&&(s._excludedEdges=e),s}shape(t,e=[]){return this.clone().withMutation(s=>{let n=s._excludedEdges;return e.length&&(Array.isArray(e[0])||(e=[e]),n=[...s._excludedEdges,...e]),s.setFields(Object.assign(s.fields,t),n)})}partial(){const t={};for(const[e,s]of Object.entries(this.fields))t[e]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(t)}deepPartial(){return Nt(this)}pick(t){const e={};for(const s of t)this.fields[s]&&(e[s]=this.fields[s]);return this.setFields(e,this._excludedEdges.filter(([s,n])=>t.includes(s)&&t.includes(n)))}omit(t){const e=[];for(const s of Object.keys(this.fields))t.includes(s)||e.push(s);return this.pick(e)}from(t,e,s){let n=Ze.getter(t,!0);return this.transform(a=>{if(!a)return a;let o=a;return mi(a,t)&&(o=Object.assign({},a),s||delete o[t],o[e]=n(a)),o})}json(){return this.transform(hi)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Et.exact,test(e){if(e==null)return!0;const s=ss(this.schema,e);return s.length===0||this.createError({params:{properties:s.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,e=Et.noUnknown){typeof t!="boolean"&&(e=t,t=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:e,test(n){if(n==null)return!0;const a=ss(this.schema,n);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return s.spec.noUnknown=t,s}unknown(t=!0,e=Et.noUnknown){return this.noUnknown(!t,e)}transformKeys(t){return this.transform(e=>{if(!e)return e;const s={};for(const n of Object.keys(e))s[t(n)]=e[n];return s})}camelCase(){return this.transformKeys(Ut.camelCase)}snakeCase(){return this.transformKeys(Ut.snakeCase)}constantCase(){return this.transformKeys(t=>Ut.snakeCase(t).toUpperCase())}describe(t){const e=(t?this.resolve(t):this).clone(),s=super.describe(t);s.fields={};for(const[a,o]of Object.entries(e.fields)){var n;let l=t;(n=l)!=null&&n.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[a]})),s.fields[a]=o.describe(l)}return s}}nn.prototype=an.prototype;function xi({fields:r,explicitSchema:t}){return v.useMemo(()=>{if(t)return Yr(t);const e={};r.forEach(n=>{var o,l,c,u,f,m,p;let a;switch(n.type){case"text":case"password":case"email":if(a=Ks(),(o=n.validation)!=null&&o.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}(l=n.validation)!=null&&l.minLength&&(a=a.min(n.validation.minLength.value,n.validation.minLength.message)),(c=n.validation)!=null&&c.maxLength&&(a=a.max(n.validation.maxLength.value,n.validation.maxLength.message)),(u=n.validation)!=null&&u.pattern&&(a=a.matches(n.validation.pattern.value,n.validation.pattern.message)),n.type==="email"&&(a=a.email("Email inválido"));break;case"number":if(a=en(),(f=n.validation)!=null&&f.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;case"select":case"optionGroup":if(a=Qt(),(m=n.validation)!=null&&m.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;case"date":if(a=fr(),(p=n.validation)!=null&&p.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;default:a=Qt()}e[n.name]=a});const s=nn().shape(e);return Yr(s)},[r,t])}function gi(r){return v.useMemo(()=>{const t={};return r.forEach(e=>{t[e.name]=e}),t},[r])}function bi(r){const t=v.useMemo(()=>r.filter(o=>o.type==="select"&&o.loadOptions),[r]),[e,s]=v.useState(t.length),[n,a]=v.useState({});return v.useEffect(()=>{t.length!==0&&t.forEach(o=>{o.loadOptions().then(l=>a(c=>({...c,[o.name]:l}))).finally(()=>s(l=>Math.max(0,l-1)))})},[t]),{loadingCount:e,optionsMap:n}}function yi(r,t){const e=v.useMemo(()=>r.filter(o=>o.disabledWhen),[r]),s=v.useMemo(()=>e.map(o=>o.disabledWhen.watchField),[e]),n=or({control:t,name:s}),a={};return e.forEach(o=>{const l=s.indexOf(o.disabledWhen.watchField),c=n[l];a[o.name]=c===o.disabledWhen.watchValue}),a}const ns={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},vi={sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"};function hr({control:r,name:t,rules:e,defaultValue:s,size:n="sm",width:a="100%",label:o,labelHidden:l=!1,hasError:c=!1,errorMessage:u="",maxLength:f,showCounter:m=!1,className:p,...b}){const N=v.useId(),j=t||N,[T,w]=v.useState(s||"");if(r&&t)return i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s||"",render:({field:E,fieldState:M})=>{var F;return i.jsx(hr,{...b,size:n,width:a,label:o,labelHidden:l,hasError:!!M.error,errorMessage:((F=M.error)==null?void 0:F.message)||"",maxLength:f,showCounter:m,className:p,value:E.value,onChange:E.onChange})}});v.useEffect(()=>{w(s||"")},[s]);const y=E=>{var M;f!==void 0&&E.target.value.length>f||(w(E.target.value),(M=b.onChange)==null||M.call(b,E))};return i.jsxs("div",{className:I("flex flex-col",p),style:{width:a},children:[o&&i.jsx("label",{htmlFor:j,className:I("pb-2 text-[var(--color-ds-text-primary)]",ns[n],l&&"sr-only"),children:o}),i.jsx("textarea",{id:j,className:I("box-border bg-[var(--color-ds-background-page)] w-full resize vertical rounded-lg border outline-none transition font-[var(--font-primary)]",ns[n],vi[n],c?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",b.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:T,onChange:y,maxLength:f,...b}),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:" "}),m&&f!==void 0&&i.jsxs("span",{className:"text-xs text-[var(--color-ds-text-secondary)]",children:[T.length,"/",f]})]})]})}const wi={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function on({control:r,name:t,rules:e,defaultValue:s=!1,label:n,labelHidden:a=!1,disabled:o=!1,size:l="sm",className:c,hasError:u=!1,errorMessage:f=""}){return i.jsx("div",{className:I("flex flex-col",c),children:i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s,render:({field:m,fieldState:p})=>{const b=p.error;return i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{id:t,type:"checkbox",className:I(wi[l],"text-[var(--color-ds-button-primary-bg)]","border-[var(--color-ds-border-default)]",o&&"opacity-50 cursor-not-allowed"),checked:m.value,onChange:N=>m.onChange(N.target.checked),disabled:o}),i.jsx("span",{className:I("text-[var(--color-ds-text-primary)] text-ds-md",o&&"text-[var(--color-ds-text-secondary)]"),children:n}),u&&(b==null?void 0:b.message)&&i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:b.message})]})}})})}function ln({name:r,control:t,searchFn:e,resolveByValue:s,label:n,size:a="sm",width:o="100%",disabled:l=!1}){const{watch:c,getValues:u,setValue:f}=ut(),m=or({control:t,name:r}),[p,b]=v.useState([]),[N,j]=v.useState(!1),[T,w]=v.useState(!1),[y,E]=v.useState(""),M=v.useRef(null),F=v.useMemo(()=>{const $=new Map;for(const P of p)$.set(String(P.value),P.label??"");return $},[p]),W=async $=>{if($){j(!0);try{const P=await e($,{watch:c,getValues:u});b(P??[]),w(!0)}finally{j(!1)}}};v.useEffect(()=>{function $(P){M.current&&!M.current.contains(P.target)&&w(!1)}if(T)return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[T]),v.useEffect(()=>{const $=m?String(m):"";if(!$){E("");return}const P=F.get($);if(P){E(P);return}let R=!1;return(async()=>{if(s)try{const V=await s($);R||E((V==null?void 0:V.label)??$)}catch{R||E($)}else E($)})(),()=>{R=!0}},[m,F,s]);const J=a==="sm"?"text-ds-sm":a==="md"?"text-ds-md":"text-ds-lg",S=a==="sm"?"h-6":a==="md"?"h-10":"h-12";return i.jsx(Fe,{name:r,control:t,render:({field:$,fieldState:P})=>{var R;return i.jsxs("div",{ref:M,className:"relative flex flex-col",style:{width:o},children:[n&&i.jsx("label",{className:`pb-2 text-[var(--color-ds-text-primary)] ${J}`,children:n}),i.jsx(Mt,{className:"rounded-r-none",type:"text",size:a,width:"100%",value:y,onChange:V=>{const H=V.target.value;E(H),f(r,"",{shouldDirty:!0})},disabled:l,hasError:P.invalid,errorMessage:(R=P.error)==null?void 0:R.message,onFocus:()=>y&&W(y),suffixButton:i.jsx($e,{type:"button",className:"!rounded-l-none",size:a,variant:"primary",onClick:()=>W(y),disabled:l,children:"Buscar"})}),N&&i.jsx("div",{className:"absolute top-14 left-0 right-0 z-10",children:i.jsx(qe,{width:"100%",height:a==="sm"?"1.5rem":a==="md"?"2.5rem":"3rem",variant:"rect",className:"rounded-lg"})}),T&&!N&&p.length>0&&i.jsx("ul",{className:`
|
|
29
|
+
`+(l!==o?`result of cast: ${l}`:""))}return a}_cast(t,e){let s=t===void 0?t:this.transforms.reduce((n,a)=>a.call(this,n,t,this),t);return s===void 0&&(s=this.getDefault(e)),s}_validate(t,e={},s,n){let{path:a,originalValue:o=t,strict:l=this.spec.strict}=e,c=t;l||(c=this._cast(c,Object.assign({assert:!1},e)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:a,value:c,originalValue:o,options:e,tests:u},s,f=>{if(f.length)return n(f,c);this.runTests({path:a,value:c,originalValue:o,options:e,tests:this.tests},s,n)})}runTests(t,e,s){let n=!1,{tests:a,value:o,originalValue:l,path:c,options:u}=t,f=j=>{n||(n=!0,e(j,o))},p=j=>{n||(n=!0,s(j,o))},x=a.length,b=[];if(!x)return p([]);let E={value:o,originalValue:l,path:c,options:u,schema:this};for(let j=0;j<a.length;j++){const T=a[j];T(E,f,function(y){y&&(Array.isArray(y)?b.push(...y):b.push(y)),--x<=0&&p(b)})}}asNestedTest({key:t,index:e,parent:s,parentPath:n,originalParent:a,options:o}){const l=t??e;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let u=s[l];const f=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}.`:"")+t});return(p,x,b)=>this.resolve(f)._validate(u,f,x,b)}validate(t,e){var s;let n=this.resolve(Object.assign({},e,{value:t})),a=(s=e==null?void 0:e.disableStackTrace)!=null?s:n.spec.disableStackTrace;return new Promise((o,l)=>n._validate(t,e,(c,u)=>{we.isError(c)&&(c.value=u),l(c)},(c,u)=>{c.length?l(new we(c,u,void 0,void 0,a)):o(u)}))}validateSync(t,e){var s;let n=this.resolve(Object.assign({},e,{value:t})),a,o=(s=e==null?void 0:e.disableStackTrace)!=null?s:n.spec.disableStackTrace;return n._validate(t,Object.assign({},e,{sync:!0}),(l,c)=>{throw we.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new we(l,t,void 0,void 0,o);a=c}),a}isValid(t,e){return this.validate(t,e).then(()=>!0,s=>{if(we.isError(s))return!1;throw s})}isValidSync(t,e){try{return this.validateSync(t,e),!0}catch(s){if(we.isError(s))return!1;throw s}}_getDefault(t){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this,t):Ke(e)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,e){const s=this.clone({nullable:t});return s.internalTests.nullable=Xe({message:e,name:"nullable",test(n){return n===null?this.schema.spec.nullable:!0}}),s}optionality(t,e){const s=this.clone({optional:t});return s.internalTests.optionality=Xe({message:e,name:"optionality",test(n){return n===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(t=Te.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Te.notNull){return this.nullability(!1,t)}required(t=Te.required){return this.clone().withMutation(e=>e.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let e=this.clone();return e.transforms.push(t),e}test(...t){let e;if(t.length===1?typeof t[0]=="function"?e={test:t[0]}:e=t[0]:t.length===2?e={name:t[0],test:t[1]}:e={name:t[0],message:t[1],test:t[2]},e.message===void 0&&(e.message=Te.default),typeof e.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),n=Xe(e),a=e.exclusive||e.name&&s.exclusiveTests[e.name]===!0;if(e.exclusive&&!e.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return e.name&&(s.exclusiveTests[e.name]=!!e.exclusive),s.tests=s.tests.filter(o=>!(o.OPTIONS.name===e.name&&(a||o.OPTIONS.test===n.OPTIONS.test))),s.tests.push(n),s}when(t,e){!Array.isArray(t)&&typeof t!="string"&&(e=t,t=".");let s=this.clone(),n=Gs(t).map(a=>new Ge(a));return n.forEach(a=>{a.isSibling&&s.deps.push(a.key)}),s.conditions.push(typeof e=="function"?new Ct(n,e):Ct.fromOptions(n,e)),s}typeError(t){let e=this.clone();return e.internalTests.typeError=Xe({message:t,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),e}oneOf(t,e=Te.oneOf){let s=this.clone();return t.forEach(n=>{s._whitelist.add(n),s._blacklist.delete(n)}),s.internalTests.whiteList=Xe({message:e,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(t,e=Te.notOneOf){let s=this.clone();return t.forEach(n=>{s._blacklist.add(n),s._whitelist.delete(n)}),s.internalTests.blacklist=Xe({message:e,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(t=!0){let e=this.clone();return e.spec.strip=t,e}describe(t){const e=(t?this.resolve(t):this).clone(),{label:s,meta:n,optional:a,nullable:o}=e.spec;return{meta:n,label:s,optional:a,nullable:o,default:e.getDefault(t),type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,u,f)=>f.findIndex(p=>p.name===c.name)===u)}}}Ne.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])Ne.prototype[`${r}At`]=function(t,e,s={}){const{parent:n,parentPath:a,schema:o}=Ko(this,t,e,s.context);return o[r](n&&n[a],Object.assign({},s,{parent:n,path:t}))};for(const r of["equals","is"])Ne.prototype[r]=Ne.prototype.oneOf;for(const r of["not","nope"])Ne.prototype[r]=Ne.prototype.notOneOf;const Jo=()=>!0;function Qt(r){return new Ks(r)}class Ks extends Ne{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:Jo},t))}}Qt.prototype=Ks.prototype;const Qo=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function ei(r){const t=er(r);if(!t)return Date.parse?Date.parse(r):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let e=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(e=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(e=0-e)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+e,t.second,t.millisecond)}function er(r){var t,e;const s=Qo.exec(r);return s?{year:Re(s[1]),month:Re(s[2],1)-1,day:Re(s[3],1),hour:Re(s[4]),minute:Re(s[5]),second:Re(s[6]),millisecond:s[7]?Re(s[7].substring(0,3)):0,precision:(t=(e=s[7])==null?void 0:e.length)!=null?t:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:Re(s[10]),minuteOffset:Re(s[11])}:null}function Re(r,t=0){return Number(r)||t}let ti=/^[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])?)*$/,ri=/^((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,si=/^(?:[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,ni="^\\d{4}-\\d{2}-\\d{2}",ai="\\d{2}:\\d{2}:\\d{2}",oi="(([+-]\\d{2}(:?\\d{2})?)|Z)",ii=new RegExp(`${ni}T${ai}(\\.\\d+)?${oi}$`),li=r=>Ve(r)||r===r.trim(),ci={}.toString();function Js(){return new Qs}class Qs extends Ne{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,e,s)=>{if(!s.spec.coerce||s.isType(t)||Array.isArray(t))return t;const n=t!=null&&t.toString?t.toString():t;return n===ci?t:n})})}required(t){return super.required(t).withMutation(e=>e.test({message:t||Te.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(e=>e.OPTIONS.name!=="required"),t))}length(t,e=ve.length){return this.test({message:e,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(s){return s.length===this.resolve(t)}})}min(t,e=ve.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s.length>=this.resolve(t)}})}max(t,e=ve.max){return this.test({name:"max",exclusive:!0,message:e,params:{max:t},skipAbsent:!0,test(s){return s.length<=this.resolve(t)}})}matches(t,e){let s=!1,n,a;return e&&(typeof e=="object"?{excludeEmptyString:s=!1,message:n,name:a}=e:n=e),this.test({name:a||"matches",message:n||ve.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&s||o.search(t)!==-1})}email(t=ve.email){return this.matches(ti,{name:"email",message:t,excludeEmptyString:!0})}url(t=ve.url){return this.matches(ri,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=ve.uuid){return this.matches(si,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let e="",s,n;return t&&(typeof t=="object"?{message:e="",allowOffset:s=!1,precision:n=void 0}=t:e=t),this.matches(ii,{name:"datetime",message:e||ve.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:e||ve.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:a=>{if(!a||s)return!0;const o=er(a);return o?!!o.z:!1}}).test({name:"datetime_precision",message:e||ve.datetime_precision,params:{precision:n},skipAbsent:!0,test:a=>{if(!a||n==null)return!0;const o=er(a);return o?o.precision===n:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=ve.trim){return this.transform(e=>e!=null?e.trim():e).test({message:t,name:"trim",test:li})}lowercase(t=ve.lowercase){return this.transform(e=>Ve(e)?e:e.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ve(e)||e===e.toLowerCase()})}uppercase(t=ve.uppercase){return this.transform(e=>Ve(e)?e:e.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ve(e)||e===e.toUpperCase()})}}Js.prototype=Qs.prototype;let di=r=>r!=+r;function en(){return new tn}class tn extends Ne{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!di(t)}}),this.withMutation(()=>{this.transform((t,e,s)=>{if(!s.spec.coerce)return t;let n=t;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(t,e=Le.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(t)}})}max(t,e=Le.max){return this.test({message:e,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(t)}})}lessThan(t,e=Le.lessThan){return this.test({message:e,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(s){return s<this.resolve(t)}})}moreThan(t,e=Le.moreThan){return this.test({message:e,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(s){return s>this.resolve(t)}})}positive(t=Le.positive){return this.moreThan(0,t)}negative(t=Le.negative){return this.lessThan(0,t)}integer(t=Le.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:e=>Number.isInteger(e)})}truncate(){return this.transform(t=>Ve(t)?t:t|0)}round(t){var e;let s=["ceil","floor","round","trunc"];if(t=((e=t)==null?void 0:e.toLowerCase())||"round",t==="trunc")return this.truncate();if(s.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+s.join(", "));return this.transform(n=>Ve(n)?n:Math[t](n))}}en.prototype=tn.prototype;let rn=new Date(""),ui=r=>Object.prototype.toString.call(r)==="[object Date]";function fr(){return new ft}class ft extends Ne{constructor(){super({type:"date",check(t){return ui(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,e,s)=>!s.spec.coerce||s.isType(t)||t===null?t:(t=ei(t),isNaN(t)?ft.INVALID_DATE:new Date(t)))})}prepareParam(t,e){let s;if(Ge.isRef(t))s=t;else{let n=this.cast(t);if(!this._typeCheck(n))throw new TypeError(`\`${e}\` must be a Date or a value that can be \`cast()\` to a Date`);s=n}return s}min(t,e=Jt.min){let s=this.prepareParam(t,"min");return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(s)}})}max(t,e=Jt.max){let s=this.prepareParam(t,"max");return this.test({message:e,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(s)}})}}ft.INVALID_DATE=rn;fr.prototype=ft.prototype;fr.INVALID_DATE=rn;function fi(r,t=[]){let e=[],s=new Set,n=new Set(t.map(([o,l])=>`${o}-${l}`));function a(o,l){let c=Ze.split(o)[0];s.add(c),n.has(`${l}-${c}`)||e.push([l,c])}for(const o of Object.keys(r)){let l=r[o];s.add(o),Ge.isRef(l)&&l.isSibling?a(l.path,o):ur(l)&&"deps"in l&&l.deps.forEach(c=>a(c,o))}return Po.array(Array.from(s),e).reverse()}function ts(r,t){let e=1/0;return r.some((s,n)=>{var a;if((a=t.path)!=null&&a.includes(s))return e=n,!0}),e}function sn(r){return(t,e)=>ts(r,t)-ts(r,e)}const hi=(r,t,e)=>{if(typeof r!="string")return r;let s=r;try{s=JSON.parse(r)}catch{}return e.isType(s)?s:r};function Nt(r){if("fields"in r){const t={};for(const[e,s]of Object.entries(r.fields))t[e]=Nt(s);return r.setFields(t)}if(r.type==="array"){const t=r.optional();return t.innerType&&(t.innerType=Nt(t.innerType)),t}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(Nt)}):"optional"in r?r.optional():r}const mi=(r,t)=>{const e=[...Ze.normalizePath(t)];if(e.length===1)return e[0]in r;let s=e.pop(),n=Ze.getter(Ze.join(e),!0)(r);return!!(n&&s in n)};let rs=r=>Object.prototype.toString.call(r)==="[object Object]";function ss(r,t){let e=Object.keys(r.fields);return Object.keys(t).filter(s=>e.indexOf(s)===-1)}const pi=sn([]);function nn(r){return new an(r)}class an extends Ne{constructor(t){super({type:"object",check(e){return rs(e)||typeof e=="function"}}),this.fields=Object.create(null),this._sortErrors=pi,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,e={}){var s;let n=super._cast(t,e);if(n===void 0)return this.getDefault(e);if(!this._typeCheck(n))return n;let a=this.fields,o=(s=e.stripUnknown)!=null?s:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(n).filter(p=>!this._nodes.includes(p))),c={},u=Object.assign({},e,{parent:c,__validating:e.__validating||!1}),f=!1;for(const p of l){let x=a[p],b=p in n;if(x){let E,j=n[p];u.path=(e.path?`${e.path}.`:"")+p,x=x.resolve({value:j,context:e.context,parent:c});let T=x instanceof Ne?x.spec:void 0,w=T==null?void 0:T.strict;if(T!=null&&T.strip){f=f||p in n;continue}E=!e.__validating||!w?x.cast(n[p],u):n[p],E!==void 0&&(c[p]=E)}else b&&!o&&(c[p]=n[p]);(b!==p in c||c[p]!==n[p])&&(f=!0)}return f?c:n}_validate(t,e={},s,n){let{from:a=[],originalValue:o=t,recursive:l=this.spec.recursive}=e;e.from=[{schema:this,value:o},...a],e.__validating=!0,e.originalValue=o,super._validate(t,e,s,(c,u)=>{if(!l||!rs(u)){n(c,u);return}o=o||u;let f=[];for(let p of this._nodes){let x=this.fields[p];!x||Ge.isRef(x)||f.push(x.asNestedTest({options:e,key:p,parent:u,parentPath:e.path,originalParent:o}))}this.runTests({tests:f,value:u,originalValue:o,options:e},s,p=>{n(p.sort(this._sortErrors).concat(c),u)})})}clone(t){const e=super.clone(t);return e.fields=Object.assign({},this.fields),e._nodes=this._nodes,e._excludedEdges=this._excludedEdges,e._sortErrors=this._sortErrors,e}concat(t){let e=super.concat(t),s=e.fields;for(let[n,a]of Object.entries(this.fields)){const o=s[n];s[n]=o===void 0?a:o}return e.withMutation(n=>n.setFields(s,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let e={};return this._nodes.forEach(s=>{var n;const a=this.fields[s];let o=t;(n=o)!=null&&n.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[s]})),e[s]=a&&"getDefault"in a?a.getDefault(o):void 0}),e}setFields(t,e){let s=this.clone();return s.fields=t,s._nodes=fi(t,e),s._sortErrors=sn(Object.keys(t)),e&&(s._excludedEdges=e),s}shape(t,e=[]){return this.clone().withMutation(s=>{let n=s._excludedEdges;return e.length&&(Array.isArray(e[0])||(e=[e]),n=[...s._excludedEdges,...e]),s.setFields(Object.assign(s.fields,t),n)})}partial(){const t={};for(const[e,s]of Object.entries(this.fields))t[e]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(t)}deepPartial(){return Nt(this)}pick(t){const e={};for(const s of t)this.fields[s]&&(e[s]=this.fields[s]);return this.setFields(e,this._excludedEdges.filter(([s,n])=>t.includes(s)&&t.includes(n)))}omit(t){const e=[];for(const s of Object.keys(this.fields))t.includes(s)||e.push(s);return this.pick(e)}from(t,e,s){let n=Ze.getter(t,!0);return this.transform(a=>{if(!a)return a;let o=a;return mi(a,t)&&(o=Object.assign({},a),s||delete o[t],o[e]=n(a)),o})}json(){return this.transform(hi)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Et.exact,test(e){if(e==null)return!0;const s=ss(this.schema,e);return s.length===0||this.createError({params:{properties:s.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,e=Et.noUnknown){typeof t!="boolean"&&(e=t,t=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:e,test(n){if(n==null)return!0;const a=ss(this.schema,n);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return s.spec.noUnknown=t,s}unknown(t=!0,e=Et.noUnknown){return this.noUnknown(!t,e)}transformKeys(t){return this.transform(e=>{if(!e)return e;const s={};for(const n of Object.keys(e))s[t(n)]=e[n];return s})}camelCase(){return this.transformKeys(Ut.camelCase)}snakeCase(){return this.transformKeys(Ut.snakeCase)}constantCase(){return this.transformKeys(t=>Ut.snakeCase(t).toUpperCase())}describe(t){const e=(t?this.resolve(t):this).clone(),s=super.describe(t);s.fields={};for(const[a,o]of Object.entries(e.fields)){var n;let l=t;(n=l)!=null&&n.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[a]})),s.fields[a]=o.describe(l)}return s}}nn.prototype=an.prototype;function xi({fields:r,explicitSchema:t}){return v.useMemo(()=>{if(t)return Yr(t);const e={};r.forEach(n=>{var o,l,c,u,f,p,x;let a;switch(n.type){case"text":case"password":case"email":if(a=Js(),(o=n.validation)!=null&&o.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}(l=n.validation)!=null&&l.minLength&&(a=a.min(n.validation.minLength.value,n.validation.minLength.message)),(c=n.validation)!=null&&c.maxLength&&(a=a.max(n.validation.maxLength.value,n.validation.maxLength.message)),(u=n.validation)!=null&&u.pattern&&(a=a.matches(n.validation.pattern.value,n.validation.pattern.message)),n.type==="email"&&(a=a.email("Email inválido"));break;case"number":if(a=en(),(f=n.validation)!=null&&f.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;case"select":case"optionGroup":if(a=Qt(),(p=n.validation)!=null&&p.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;case"date":if(a=fr(),(x=n.validation)!=null&&x.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;default:a=Qt()}e[n.name]=a});const s=nn().shape(e);return Yr(s)},[r,t])}function gi(r){return v.useMemo(()=>{const t={};return r.forEach(e=>{t[e.name]=e}),t},[r])}function bi(r){const t=v.useMemo(()=>r.filter(o=>o.type==="select"&&o.loadOptions),[r]),[e,s]=v.useState(t.length),[n,a]=v.useState({});return v.useEffect(()=>{t.length!==0&&t.forEach(o=>{o.loadOptions().then(l=>a(c=>({...c,[o.name]:l}))).finally(()=>s(l=>Math.max(0,l-1)))})},[t]),{loadingCount:e,optionsMap:n}}function yi(r,t){const e=v.useMemo(()=>r.filter(o=>o.disabledWhen),[r]),s=v.useMemo(()=>e.map(o=>o.disabledWhen.watchField),[e]),n=or({control:t,name:s}),a={};return e.forEach(o=>{const l=s.indexOf(o.disabledWhen.watchField),c=n[l];a[o.name]=c===o.disabledWhen.watchValue}),a}const ns={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},vi={sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"};function hr({control:r,name:t,rules:e,defaultValue:s,size:n="sm",width:a="100%",label:o,labelHidden:l=!1,hasError:c=!1,errorMessage:u="",maxLength:f,showCounter:p=!1,className:x,...b}){const E=v.useId(),j=t||E,[T,w]=v.useState(s||"");if(r&&t)return i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s||"",render:({field:N,fieldState:O})=>{var _;return i.jsx(hr,{...b,size:n,width:a,label:o,labelHidden:l,hasError:!!O.error,errorMessage:((_=O.error)==null?void 0:_.message)||"",maxLength:f,showCounter:p,className:x,value:N.value,onChange:N.onChange})}});v.useEffect(()=>{w(s||"")},[s]);const y=N=>{var O;f!==void 0&&N.target.value.length>f||(w(N.target.value),(O=b.onChange)==null||O.call(b,N))};return i.jsxs("div",{className:$("flex flex-col",x),style:{width:a},children:[o&&i.jsx("label",{htmlFor:j,className:$("pb-2 text-[var(--color-ds-text-primary)]",ns[n],l&&"sr-only"),children:o}),i.jsx("textarea",{id:j,className:$("box-border bg-[var(--color-ds-background-page)] w-full resize vertical rounded-lg border outline-none transition font-[var(--font-primary)]",ns[n],vi[n],c?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",b.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:T,onChange:y,maxLength:f,...b}),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&&f!==void 0&&i.jsxs("span",{className:"text-xs text-[var(--color-ds-text-secondary)]",children:[T.length,"/",f]})]})]})}const wi={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function on({control:r,name:t,rules:e,defaultValue:s=!1,label:n,labelHidden:a=!1,disabled:o=!1,size:l="sm",className:c,hasError:u=!1,errorMessage:f=""}){return i.jsx("div",{className:$("flex flex-col",c),children:i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s,render:({field:p,fieldState:x})=>{const b=x.error;return i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{id:t,type:"checkbox",className:$(wi[l],"text-[var(--color-ds-button-primary-bg)]","border-[var(--color-ds-border-default)]",o&&"opacity-50 cursor-not-allowed"),checked:p.value,onChange:E=>p.onChange(E.target.checked),disabled:o}),i.jsx("span",{className:$("text-[var(--color-ds-text-primary)] text-ds-md",o&&"text-[var(--color-ds-text-secondary)]"),children:n}),u&&(b==null?void 0:b.message)&&i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:b.message})]})}})})}function ln({name:r,control:t,searchFn:e,resolveByValue:s,label:n,size:a="sm",width:o="100%",disabled:l=!1,searchMode:c="button",minChars:u=3,debounceMs:f=600}){const{watch:p,getValues:x,setValue:b}=ut(),E=or({control:t,name:r}),[j,T]=v.useState([]),[w,y]=v.useState(!1),[N,O]=v.useState(!1),[_,D]=v.useState(""),Q=v.useRef(null),S=v.useRef(null),W=v.useRef(!1),G=v.useMemo(()=>{const I=new Map;for(const J of j)I.set(String(J.value),J.label??"");return I},[j]),R=async I=>{if(!I){T([]),O(!1);return}y(!0);try{const J=await e(I,{watch:p,getValues:x});T(J??[]),O(!0)}finally{y(!1)}};v.useEffect(()=>{function I(J){Q.current&&!Q.current.contains(J.target)&&O(!1)}if(N)return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[N]),v.useEffect(()=>{if(W.current)return;const I=E?String(E):"";if(!I){D("");return}const J=G.get(I);if(J){D(J);return}let Z=!1;return(async()=>{if(s)try{const h=await s(I);Z||D((h==null?void 0:h.label)??I)}catch{Z||D(I)}else D(I)})(),()=>{Z=!0}},[E,G,s]),v.useEffect(()=>{if(c!=="debounced"||l)return;S.current&&(window.clearTimeout(S.current),S.current=null);const I=(_||"").trim();return I.length>=u?S.current=window.setTimeout(()=>{R(I)},f):(T([]),O(!1)),()=>{S.current&&(window.clearTimeout(S.current),S.current=null)}},[_,c,u,f,l]);const P=a==="sm"?"text-ds-sm":a==="md"?"text-ds-md":"text-ds-lg",X=a==="sm"?"h-6":a==="md"?"h-10":"h-12",ee=I=>{if(l)return;const J=(_||"").trim();I.key==="Enter"&&(I.preventDefault(),c==="debounced"?J.length>=u&&R(J):R(J)),I.key==="Escape"&&O(!1)};return i.jsx(Fe,{name:r,control:t,render:({field:I,fieldState:J})=>{var Z;return i.jsxs("div",{ref:Q,className:"relative flex flex-col",style:{width:o},children:[n&&i.jsx("label",{className:`pb-2 text-[var(--color-ds-text-primary)] ${P}`,children:n}),i.jsx(Mt,{className:c==="button"?"rounded-r-none":void 0,type:"text",size:a,width:"100%",value:_,onChange:h=>{const K=h.target.value;W.current=!0,D(K),E&&b(r,"",{shouldDirty:!0})},onKeyDown:ee,onBlur:()=>{W.current=!1},disabled:l,hasError:J.invalid,errorMessage:(Z=J.error)==null?void 0:Z.message,onFocus:()=>{W.current=!0;const h=(_||"").trim();h&&c==="button"&&R(h)},suffixButton:c==="button"?i.jsx($e,{type:"button",className:"!rounded-l-none",size:a,variant:"primary",onClick:()=>R((_||"").trim()),disabled:l,children:"Buscar"}):void 0}),w&&i.jsx("div",{className:"absolute top-14 left-0 right-0 z-10",children:i.jsx(qe,{width:"100%",height:a==="sm"?"1.5rem":a==="md"?"2.5rem":"3rem",variant:"rect",className:"rounded-lg"})}),N&&!w&&j.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
|
-
shadow-lg ${
|
|
34
|
-
`,children:
|
|
33
|
+
shadow-lg ${P} max-h-48 overflow-auto z-10
|
|
34
|
+
`,children:j.map(h=>i.jsx("li",{className:`px-2 ${X} flex items-center cursor-pointer
|
|
35
35
|
text-[var(--color-ds-text-primary)]
|
|
36
|
-
hover:bg-[var(--color-ds-background-surface)]`,onClick:()=>{f(r,String(V.value),{shouldDirty:!0,shouldValidate:!0}),E(V.label??String(V.value)),w(!1)},children:V.label},String(V.value)))})]})}})}function ki({schema:r}){const{layout:t,fields:e,onSubmit:s,successMessage:n,errorMessage:a,footerButtons:o,defaultValues:l,loadDefaultValues:c,validationSchema:u}=r,{show:f}=Zs(),{t:m}=cr(),p=xi({fields:e,explicitSchema:u}),b=Ja({resolver:p,mode:"onBlur",reValidateMode:"onChange",defaultValues:l??{}}),N=v.useMemo(()=>({getValues:b.getValues,watch:b.watch}),[b.getValues,b.watch]),{control:j,reset:T,watch:w,handleSubmit:y,formState:{errors:E,isSubmitting:M}}=b,[F,W]=v.useState(!1);v.useEffect(()=>{c&&(W(!0),c().then(Y=>T(Y)).finally(()=>W(!1)))},[c,T]);const{loadingCount:J,optionsMap:S}=bi(e),$=gi(e),P=yi(e,j),R=v.useMemo(()=>{const Y={};return t.forEach((x,X)=>{x.type==="tabs"&&(Y[X]=x.tabs[0].key)}),Y},[t]),[V,H]=v.useState(R),K=v.useCallback(Y=>{if(F)return!1;const x=b.getValues(),{watchField:X,watchValue:h}=Y;return!(X in x)||x[X]===void 0?!1:typeof h=="function"?h(x):x[X]===h},[b,F]),Q=v.useMemo(()=>e.filter(Y=>"clearWhen"in Y&&Y.clearWhen).map(Y=>({name:Y.name,rule:Y.clearWhen})),[e]);v.useEffect(()=>{if(!Q.length)return;const Y=X=>{Q.forEach(({name:h,rule:_})=>{if(!(_.watchField in X)||X[_.watchField]===void 0)return;if(typeof _.watchValue=="function"?_.watchValue(X):X[_.watchField]===_.watchValue){const B=_.clearTo??"";X[h]!==B&&b.setValue(h,B,{shouldDirty:!0,shouldValidate:!0})}})},x=b.watch((X,h)=>{if(!(h!=null&&h.name)||!Q.some(({rule:B})=>B.watchField===h.name))return;const L=b.getValues();Y(L)});return()=>{var X;return(X=x==null?void 0:x.unsubscribe)==null?void 0:X.call(x)}},[b,Q]);const re=v.useCallback(Y=>{var te,le,pe,se;let x;if(typeof Y=="string"){if(x=$[Y],!x)return null}else x=Y;if("visibleWhen"in x&&x.visibleWhen&&!K(x.visibleWhen))return null;let X=!!x.disabled;const h="disabledWhen"in x&&!!x.disabledWhen;if(h&&(K(x.disabledWhen)?X=!0:X=!1),!h&&"name"in x&&x.name&&P[x.name]&&(X=!0),x.type==="search"){const q=ie=>x.searchFn(ie,N);return i.jsx(ln,{name:x.name,control:j,searchFn:q,label:x.label,size:x.size,width:x.width,disabled:X||M},x.name)}if(x.type==="inputGroup"){const q=x,ie=q.inputs.map(de=>{var tt;const ne=typeof de=="string"?$[de]:de;if(!ne)return null;let je=!!ne.disabled;const ht="disabledWhen"in ne&&!!ne.disabledWhen;ht&&(K(ne.disabledWhen)?je=!0:je=!1),!ht&&P[ne.name]&&(je=!0);const et={name:ne.name,control:j,rules:ne.validation,defaultValue:void 0,label:ne.label,size:ne.size,width:ne.width,placeholder:ne.placeholder,hasError:!!E[ne.name],errorMessage:((tt=E[ne.name])==null?void 0:tt.message)||"",loading:F,disabled:je,suffixButton:ne.suffixButton};return ne.type==="select"?{...et,options:ne.options??S[ne.name]??[],loadOptions:ne.options?void 0:ne.loadOptions}:et}).filter(de=>de!==null);return i.jsx(zs,{groupLabel:q.groupLabel,inputs:ie,separator:q.separator,useSeparator:q.useSeparator,className:q.className,showVisibleLabel:q.showVisibleLabel,size:q.size},`inputGroup_${q.groupLabel}`)}if(x.type==="button"){const q=x;return i.jsx("div",{className:"self-center",children:i.jsx($e,{type:"button",variant:q.variant,size:q.size,width:q.width,icon:q.icon,iconPosition:q.iconPosition,ariaLabel:q.ariaLabel,onClick:q.onClick,disabled:X||M,children:q.label})},q.name)}const _=x.suffixButton,L=typeof _=="string"?re(_):_,B={name:x.name,control:j,disabled:X||M,label:x.label,size:x.size,width:x.width,placeholder:x.placeholder,info:x.info,suffixButton:L};switch(x.type){case"select":return i.jsx(Fe,{name:x.name,control:j,render:({field:q})=>{var ie;return i.jsx(ct,{...B,value:q.value,onChange:q.onChange,options:x.options??S[x.name]??[],loadOptions:x.options?void 0:x.loadOptions,hasError:!!E[x.name],errorMessage:(ie=E[x.name])==null?void 0:ie.message,suffixButton:L})}},x.name);case"textarea":return i.jsx(Fe,{name:x.name,control:j,render:({field:q,fieldState:ie})=>{var de;return i.jsx(hr,{...B,value:q.value,onChange:q.onChange,maxLength:x.maxLength,showCounter:!!x.showCounter,hasError:!!ie.error,errorMessage:((de=ie.error)==null?void 0:de.message)||""})}},x.name);case"file":return i.jsx(Is,{...B,defaultValue:[],maxFiles:x.maxFiles,accept:x.accept,hasError:!!E[x.name],errorMessage:(te=E[x.name])==null?void 0:te.message},x.name);case"checkbox":return i.jsx(on,{...B,defaultValue:!1,hasError:!!E[x.name],errorMessage:(le=E[x.name])==null?void 0:le.message,name:x.name},x.name);case"date":return i.jsx(Vs,{...B,defaultValue:"",showTime:!!x.showTime,hasError:!!E[x.name],errorMessage:(pe=E[x.name])==null?void 0:pe.message},x.name);case"optionGroup":return i.jsx(Us,{...B,options:x.options||[],multiple:x.multiple,vertical:x.vertical,groupLabel:x.groupLabel,defaultValue:x.defaultValue,className:x.width?void 0:"w-full",name:x.name},x.name);default:return i.jsx(dr,{...B,type:x.type,loadingDefaults:F,hasError:!!E[x.name],errorMessage:(se=E[x.name])==null?void 0:se.message,suffixButton:L,name:x.name},x.name)}},[$,j,E,M,F,S,K,P]);return i.jsx($a,{...b,children:i.jsxs("form",{noValidate:!0,onSubmit:y(async Y=>{await s(Y),f(n??m("ds.form.saveSuccess"),"success")},Y=>{console.log("❌ errores de validación:",Y),_o(Y),f(a??m("ds.form.saveError"),"error")}),className:"space-y-6",children:[t.map((Y,x)=>Y.type==="rows"?i.jsx(v.Fragment,{children:Y.sections.map((X,h)=>i.jsx("div",{className:"mb-6",children:i.jsx(Bt,{title:X.sectionTitle,defaultOpen:X.defaultOpen,children:X.rows.map((_,L)=>i.jsxs("div",{children:[_.title&&i.jsx("h2",{className:"mb-2 text-lg text-[var(--color-ds-text-primary)]",children:_.title}),i.jsx("div",{className:"flex flex-wrap -mx-2",children:_.columns.map((B,te)=>{var le;return i.jsx("div",{className:`${B.width} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:B.fields?B.fields.map(pe=>re(pe)):(le=B.rows)==null?void 0:le.map((pe,se)=>i.jsx("div",{className:"mb-1",children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:pe.columns.map((q,ie)=>{var de;return i.jsx("div",{className:`${q.width} px-2`,children:(de=q.fields)==null?void 0:de.map(ne=>re(ne))},ie)})})},se))})},te)})})]},L))})},h))},x):i.jsx(Ps,{options:Y.tabs.map(X=>({label:X.label,value:X.key})),value:V[x],onChange:X=>H(h=>({...h,[x]:X})),children:Object.fromEntries(Y.tabs.map(X=>[X.key,i.jsx("div",{className:"space-y-6",children:X.sections.map((h,_)=>i.jsx("div",{className:"mb-6",children:i.jsx(Bt,{title:h.sectionTitle,defaultOpen:h.defaultOpen,children:h.rows.map((L,B)=>i.jsx("div",{children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:L.columns.map((te,le)=>{var pe;return i.jsx("div",{className:`${te.width??"flex-1"} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:(pe=te.fields)==null?void 0:pe.map((se,q)=>i.jsx(v.Fragment,{children:re(se)},q))})},le)})})},B))})},_))},X.key)]))},x)),i.jsx("footer",{className:"py-4 w-full flex justify-center space-x-4",children:o??i.jsx($e,{type:"submit",variant:"primary",icon:Mn,size:"sm",disabled:M||F||J>0,children:m(M?"ds.form.sending":"ds.form.submit")})})]})})}const ji={sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"};function cn({icon:r,size:t="md",ariaLabel:e,disabled:s=!1,onClick:n,...a}){return i.jsx("button",{type:"button","aria-label":e,disabled:s,onClick:n,className:I("inline-flex items-center justify-center","rounded-full","bg-transparent","text-[var(--color-ds-text-primary)]","transition-transform","focus:outline-none",ji[t],s?"opacity-50 cursor-not-allowed":["hover:scale-110","hover:animate-pulse"]),...a,children:i.jsx(r,{className:I(t==="sm"?"h-4 w-4":t==="md"?"h-5 w-5":"h-6 w-6")})})}function dn({dark:r,onToggle:t}){return i.jsx("button",{type:"button","aria-pressed":r,"aria-label":r?"Cambiar a modo claro":"Cambiar a modo oscuro",onClick:t,className:I("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:I("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(Ce,{component:Kn,size:"sm",className:I("absolute transition-opacity duration-200 ease-in-out",r?"opacity-0":"opacity-100 text-[var(--color-ds-background-accent)]")}),i.jsx(Ce,{component:Xn,size:"sm",className:I("absolute transition-opacity duration-200 ease-in-out",r?"opacity-100 text-[var(--color-ds-background-accent)]":"opacity-0")})]})})}const un=v.createContext({theme:"light",toggle:()=>{}});function Ei({children:r}){const[t,e]=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"),e(!0)},[]),v.useEffect(()=>{t&&(document.documentElement.classList.toggle("dark",s==="dark"),s==="dark"?localStorage.setItem("ds-theme","dark"):localStorage.removeItem("ds-theme"))},[s,t]);const a=()=>n(o=>o==="light"?"dark":"light");return t?i.jsx(un.Provider,{value:{theme:s,toggle:a},children:r}):null}const fn=()=>v.useContext(un),hn=({pinnedPages:r,onRemovePinned:t,onBack:e,dark:s,locale:n,languageOptions:a,onChangeLocale:o,profile:l,profileOptions:c,onChangeProfile:u})=>{const f=r.slice(0,3),{toggle:m}=fn(),{t:p,i18n:b}=cr(),N=j=>{b.changeLanguage(j),o(j)};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:f.map(j=>i.jsxs("div",{className:"flex items-center",children:[i.jsx("a",{href:j.href,className:I("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:j.label}),i.jsx(cn,{icon:tr,size:"sm",ariaLabel:`${p("remove")} ${j.label}`,onClick:()=>t(j.id)})]},j.id))}),i.jsx("div",{className:"flex-grow"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ct,{size:"sm",width:"auto",options:a,value:n,onChange:N,disableErrorPlaceholder:!0}),i.jsx(ct,{size:"sm",width:"auto",options:c,value:l,onChange:u,disableErrorPlaceholder:!0}),i.jsx(dn,{dark:s,onToggle:m})]})]})},Ni=({loading:r=!1,ariaLabel:t="Cargando..."})=>r?i.jsxs("div",{className:`\r
|
|
36
|
+
hover:bg-[var(--color-ds-background-surface)]`,onClick:()=>{b(r,String(h.value),{shouldDirty:!0,shouldValidate:!0}),D(h.label??String(h.value)),W.current=!1,O(!1)},children:h.label},String(h.value)))})]})}})}function ki({schema:r}){const{layout:t,fields:e,onSubmit:s,successMessage:n,errorMessage:a,footerButtons:o,defaultValues:l,loadDefaultValues:c,validationSchema:u}=r,{show:f}=Zs(),{t:p}=cr(),x=xi({fields:e,explicitSchema:u}),b=Ka({resolver:x,mode:"onBlur",reValidateMode:"onChange",defaultValues:l??{}}),E=v.useMemo(()=>({getValues:b.getValues,watch:b.watch}),[b.getValues,b.watch]),{control:j,reset:T,watch:w,handleSubmit:y,formState:{errors:N,isSubmitting:O}}=b,[_,D]=v.useState(!1);v.useEffect(()=>{c&&(D(!0),c().then(Z=>T(Z)).finally(()=>D(!1)))},[c,T]);const{loadingCount:Q,optionsMap:S}=bi(e),W=gi(e),G=yi(e,j),R=v.useMemo(()=>{const Z={};return t.forEach((h,K)=>{h.type==="tabs"&&(Z[K]=h.tabs[0].key)}),Z},[t]),[P,X]=v.useState(R),ee=v.useCallback(Z=>{if(_)return!1;const h=b.getValues(),{watchField:K,watchValue:m}=Z;return!(K in h)||h[K]===void 0?!1:typeof m=="function"?m(h):h[K]===m},[b,_]),I=v.useMemo(()=>e.filter(Z=>"clearWhen"in Z&&Z.clearWhen).map(Z=>({name:Z.name,rule:Z.clearWhen})),[e]);v.useEffect(()=>{if(!I.length)return;const Z=K=>{I.forEach(({name:m,rule:F})=>{if(!(F.watchField in K)||K[F.watchField]===void 0)return;if(typeof F.watchValue=="function"?F.watchValue(K):K[F.watchField]===F.watchValue){const B=F.clearTo??"";K[m]!==B&&b.setValue(m,B,{shouldDirty:!0,shouldValidate:!0})}})},h=b.watch((K,m)=>{if(!(m!=null&&m.name)||!I.some(({rule:B})=>B.watchField===m.name))return;const L=b.getValues();Z(L)});return()=>{var K;return(K=h==null?void 0:h.unsubscribe)==null?void 0:K.call(h)}},[b,I]);const J=v.useCallback(Z=>{var re,le,pe,se;let h;if(typeof Z=="string"){if(h=W[Z],!h)return null}else h=Z;if("visibleWhen"in h&&h.visibleWhen&&!ee(h.visibleWhen))return null;let K=!!h.disabled;const m="disabledWhen"in h&&!!h.disabledWhen;if(m&&(ee(h.disabledWhen)?K=!0:K=!1),!m&&"name"in h&&h.name&&G[h.name]&&(K=!0),h.type==="search"){const H=de=>h.searchFn(de,E),ne={};return h.searchMode&&(ne.searchMode=h.searchMode),h.minChars&&(ne.minChars=h.minChars),h.debounceMs&&(ne.debounceMs=h.debounceMs),h.resolveByValue&&(ne.resolveByValue=h.resolveByValue),i.jsx(ln,{name:h.name,control:j,searchFn:H,label:h.label,size:h.size,width:h.width,disabled:K||O,...ne},h.name)}if(h.type==="inputGroup"){const H=h,ne=H.inputs.map(de=>{var tt;const ae=typeof de=="string"?W[de]:de;if(!ae)return null;let je=!!ae.disabled;const ht="disabledWhen"in ae&&!!ae.disabledWhen;ht&&(ee(ae.disabledWhen)?je=!0:je=!1),!ht&&G[ae.name]&&(je=!0);const et={name:ae.name,control:j,rules:ae.validation,defaultValue:void 0,label:ae.label,size:ae.size,width:ae.width,placeholder:ae.placeholder,hasError:!!N[ae.name],errorMessage:((tt=N[ae.name])==null?void 0:tt.message)||"",loading:_,disabled:je,suffixButton:ae.suffixButton};return ae.type==="select"?{...et,options:ae.options??S[ae.name]??[],loadOptions:ae.options?void 0:ae.loadOptions}:et}).filter(de=>de!==null);return i.jsx(zs,{groupLabel:H.groupLabel,inputs:ne,separator:H.separator,useSeparator:H.useSeparator,className:H.className,showVisibleLabel:H.showVisibleLabel,size:H.size},`inputGroup_${H.groupLabel}`)}if(h.type==="button"){const H=h;return i.jsx("div",{className:"self-center",children:i.jsx($e,{type:"button",variant:H.variant,size:H.size,width:H.width,icon:H.icon,iconPosition:H.iconPosition,ariaLabel:H.ariaLabel,onClick:H.onClick,disabled:K||O,children:H.label})},H.name)}const F=h.suffixButton,L=typeof F=="string"?J(F):F,B={name:h.name,control:j,disabled:K||O,label:h.label,size:h.size,width:h.width,placeholder:h.placeholder,info:h.info,suffixButton:L};switch(h.type){case"select":return i.jsx(Fe,{name:h.name,control:j,render:({field:H})=>{var ne;return i.jsx(ct,{...B,value:H.value,onChange:H.onChange,options:h.options??S[h.name]??[],loadOptions:h.options?void 0:h.loadOptions,hasError:!!N[h.name],errorMessage:(ne=N[h.name])==null?void 0:ne.message,suffixButton:L})}},h.name);case"textarea":return i.jsx(Fe,{name:h.name,control:j,render:({field:H,fieldState:ne})=>{var de;return i.jsx(hr,{...B,value:H.value,onChange:H.onChange,maxLength:h.maxLength,showCounter:!!h.showCounter,hasError:!!ne.error,errorMessage:((de=ne.error)==null?void 0:de.message)||""})}},h.name);case"file":return i.jsx(Is,{...B,defaultValue:[],maxFiles:h.maxFiles,accept:h.accept,hasError:!!N[h.name],errorMessage:(re=N[h.name])==null?void 0:re.message},h.name);case"checkbox":return i.jsx(on,{...B,defaultValue:!1,hasError:!!N[h.name],errorMessage:(le=N[h.name])==null?void 0:le.message,name:h.name},h.name);case"date":return i.jsx(Vs,{...B,defaultValue:"",showTime:!!h.showTime,hasError:!!N[h.name],errorMessage:(pe=N[h.name])==null?void 0:pe.message},h.name);case"optionGroup":return i.jsx(Us,{...B,options:h.options||[],multiple:h.multiple,vertical:h.vertical,groupLabel:h.groupLabel,defaultValue:h.defaultValue,className:h.width?void 0:"w-full",name:h.name},h.name);default:return i.jsx(dr,{...B,type:h.type,loadingDefaults:_,hasError:!!N[h.name],errorMessage:(se=N[h.name])==null?void 0:se.message,suffixButton:L,name:h.name},h.name)}},[W,j,N,O,_,S,ee,G]);return i.jsx($a,{...b,children:i.jsxs("form",{noValidate:!0,onSubmit:y(async Z=>{await s(Z),f(n??p("ds.form.saveSuccess"),"success")},Z=>{console.log("❌ errores de validación:",Z),So(Z),f(a??p("ds.form.saveError"),"error")}),className:"space-y-6",children:[t.map((Z,h)=>Z.type==="rows"?i.jsx(v.Fragment,{children:Z.sections.map((K,m)=>i.jsx("div",{className:"mb-6",children:i.jsx(Bt,{title:K.sectionTitle,defaultOpen:K.defaultOpen,children:K.rows.map((F,L)=>i.jsxs("div",{children:[F.title&&i.jsx("h2",{className:"mb-2 text-lg text-[var(--color-ds-text-primary)]",children:F.title}),i.jsx("div",{className:"flex flex-wrap -mx-2",children:F.columns.map((B,re)=>{var le;return i.jsx("div",{className:`${B.width} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:B.fields?B.fields.map(pe=>J(pe)):(le=B.rows)==null?void 0:le.map((pe,se)=>i.jsx("div",{className:"mb-1",children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:pe.columns.map((H,ne)=>{var de;return i.jsx("div",{className:`${H.width} px-2`,children:(de=H.fields)==null?void 0:de.map(ae=>J(ae))},ne)})})},se))})},re)})})]},L))})},m))},h):i.jsx(Ps,{options:Z.tabs.map(K=>({label:K.label,value:K.key})),value:P[h],onChange:K=>X(m=>({...m,[h]:K})),children:Object.fromEntries(Z.tabs.map(K=>[K.key,i.jsx("div",{className:"space-y-6",children:K.sections.map((m,F)=>i.jsx("div",{className:"mb-6",children:i.jsx(Bt,{title:m.sectionTitle,defaultOpen:m.defaultOpen,children:m.rows.map((L,B)=>i.jsx("div",{children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:L.columns.map((re,le)=>{var pe;return i.jsx("div",{className:`${re.width??"flex-1"} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:(pe=re.fields)==null?void 0:pe.map((se,H)=>i.jsx(v.Fragment,{children:J(se)},H))})},le)})})},B))})},F))},K.key)]))},h)),i.jsx("footer",{className:"py-4 w-full flex justify-center space-x-4",children:o??i.jsx($e,{type:"submit",variant:"primary",icon:Mn,size:"sm",disabled:O||_||Q>0,children:p(O?"ds.form.sending":"ds.form.submit")})})]})})}const ji={sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"};function cn({icon:r,size:t="md",ariaLabel:e,disabled:s=!1,onClick:n,...a}){return i.jsx("button",{type:"button","aria-label":e,disabled:s,onClick:n,className:$("inline-flex items-center justify-center","rounded-full","bg-transparent","text-[var(--color-ds-text-primary)]","transition-transform","focus:outline-none",ji[t],s?"opacity-50 cursor-not-allowed":["hover:scale-110","hover:animate-pulse"]),...a,children:i.jsx(r,{className:$(t==="sm"?"h-4 w-4":t==="md"?"h-5 w-5":"h-6 w-6")})})}function dn({dark:r,onToggle:t}){return i.jsx("button",{type:"button","aria-pressed":r,"aria-label":r?"Cambiar a modo claro":"Cambiar a modo oscuro",onClick:t,className:$("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:$("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(Ce,{component:Jn,size:"sm",className:$("absolute transition-opacity duration-200 ease-in-out",r?"opacity-0":"opacity-100 text-[var(--color-ds-background-accent)]")}),i.jsx(Ce,{component:Xn,size:"sm",className:$("absolute transition-opacity duration-200 ease-in-out",r?"opacity-100 text-[var(--color-ds-background-accent)]":"opacity-0")})]})})}const un=v.createContext({theme:"light",toggle:()=>{}});function Ei({children:r}){const[t,e]=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"),e(!0)},[]),v.useEffect(()=>{t&&(document.documentElement.classList.toggle("dark",s==="dark"),s==="dark"?localStorage.setItem("ds-theme","dark"):localStorage.removeItem("ds-theme"))},[s,t]);const a=()=>n(o=>o==="light"?"dark":"light");return t?i.jsx(un.Provider,{value:{theme:s,toggle:a},children:r}):null}const fn=()=>v.useContext(un),hn=({pinnedPages:r,onRemovePinned:t,onBack:e,dark:s,locale:n,languageOptions:a,onChangeLocale:o,profile:l,profileOptions:c,onChangeProfile:u})=>{const f=r.slice(0,3),{toggle:p}=fn(),{t:x,i18n:b}=cr(),E=j=>{b.changeLanguage(j),o(j)};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:f.map(j=>i.jsxs("div",{className:"flex items-center",children:[i.jsx("a",{href:j.href,className:$("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:j.label}),i.jsx(cn,{icon:tr,size:"sm",ariaLabel:`${x("remove")} ${j.label}`,onClick:()=>t(j.id)})]},j.id))}),i.jsx("div",{className:"flex-grow"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ct,{size:"sm",width:"auto",options:a,value:n,onChange:E,disableErrorPlaceholder:!0}),i.jsx(ct,{size:"sm",width:"auto",options:c,value:l,onChange:u,disableErrorPlaceholder:!0}),i.jsx(dn,{dark:s,onToggle:p})]})]})},Ni=({loading:r=!1,ariaLabel:t="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:t})]}):null,
|
|
47
|
+
`}),i.jsx("span",{className:"sr-only",children:t})]}):null,Si=({isOpen:r,onClose:t,title:e,children:s,footer:n})=>(v.useEffect(()=>{const a=o=>o.key==="Escape"&&t();return r&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[r,t]),r?as.createPortal(i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 bg-[var(--color-ds-text-primary)]/50 z-40",onClick:t}),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(tr,{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),mr=({items:r,selected:t,onSelect:e,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:I(s>0?"mt-1":"mt-0"),children:r.map(l=>{var N;const c=l.value===t,u=n.has(l.value),f=["pl-2","pl-2","pl-2"][s]||"pl-4",m=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)]",p=s===0&&(u||c)?"text-[var(--color-ds-text-on-accent)]":"text-[var(--color-ds-text-secondary)]",b=!!((N=l.children)!=null&&N.length);return i.jsxs("li",{children:[i.jsxs("button",{type:"button",onClick:()=>b?o(l.value):e(l.value),"aria-expanded":b?u:void 0,className:I("w-full flex items-center justify-between h-8 transition-colors",f,m),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})]}),b&&(u?i.jsx(is,{className:I("w-4 h-4",p)}):i.jsx($n,{className:I("w-4 h-4",p)}))]}),b&&i.jsx("div",{className:I("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(mr,{items:l.children,selected:t,onSelect:e,level:s+1})})]},l.value)})})},Si="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",Fi="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",mn=({appName:r,orgName:t,username:e,footerText:s,navItems:n,selectedNav:a,onSelectNav:o,width:l="200px"})=>{const{theme:c}=fn(),u=c==="dark"?Si:Fi;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:t}),i.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:e}),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(mr,{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 Ti({sidebar:r,header:t,children:e}){return i.jsxs("div",{className:"flex h-screen overflow-hidden bg-[var(--color-ds-background-page)]",children:[i.jsx(mn,{...r}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-auto px-10 [scrollbar-gutter:stable_both-edges]",children:[i.jsx(hn,{...t}),i.jsx("main",{className:"flex-1 ",children:e})]})]})}function Ci({columns:r,data:t,loadData:e,loading:s,idAccessor:n,multiSelect:a=!1,onSelectionChange:o,pageSize:l=10,initialSort:c,onSort:u,className:f}){const m=t!==void 0,[p,b]=v.useState([]),[N,j]=v.useState(!1),T=v.useRef(null);v.useEffect(()=>{var _;if(!e||m)return;(_=T.current)==null||_.abort();const h=new AbortController;return T.current=h,j(!0),e().then(L=>{h.signal.aborted||b(L)}).finally(()=>{h.signal.aborted||j(!1)}),()=>h.abort()},[e,m]);const w=v.useMemo(()=>m?t:p,[t,p,m]),y=s??(e?N:!1),[E,M]=v.useState(new Set),[F,W]=v.useState(1),[J,S]=v.useState(c==null?void 0:c.sortBy),[$,P]=v.useState((c==null?void 0:c.sortDir)??"asc"),R=h=>typeof n=="function"?n(h):h[n],V=v.useRef(null);v.useEffect(()=>{V.current!==w&&(M(new Set),W(1),V.current=w)},[w]);const H=v.useMemo(()=>{if(!J)return w;const h=$==="asc"?1:-1;return[...w].sort((_,L)=>{const B=_[J],te=L[J];return B==null?-h:te==null||B>te?h:B<te?-h:0})},[w,J,$]),K=Math.max(1,Math.ceil(H.length/l)),Q=v.useMemo(()=>{const h=(F-1)*l;return H.slice(h,h+l)},[H,F,l]),re=h=>{const _=new Set(E);_.has(h)?_.delete(h):_.add(h),M(_),o==null||o(w.filter(L=>_.has(R(L))))},Y=()=>{const h=Q.every(L=>E.has(R(L))),_=new Set(E);Q.forEach(L=>{h?_.delete(R(L)):_.add(R(L))}),M(_),o==null||o(w.filter(L=>_.has(R(L))))},x=h=>{if(!h.sortable)return;const _=typeof h.accessor=="string"?h.accessor:h.sortKey;if(J===_){const L=$==="asc"?"desc":"asc";P(L),u==null||u(_,L)}else S(_),P("asc"),u==null||u(_,"asc");W(1)},X=()=>y?i.jsx("tbody",{children:Array.from({length:l}).map((h,_)=>i.jsxs("tr",{children:[a&&i.jsx("td",{children:i.jsx(qe,{width:"1rem",height:"1rem",variant:"circle"})}),r.map((L,B)=>i.jsx("td",{children:i.jsx(qe,{width:"100%",height:"1em",variant:"rect"})},B))]},_))}):Q.length?i.jsx("tbody",{children:Q.map(h=>{const _=R(h);return i.jsxs("tr",{className:"hover:bg-gray-50",children:[a&&i.jsx("td",{children:i.jsx("input",{type:"checkbox",checked:E.has(_),onChange:()=>re(_)})}),r.map((L,B)=>{const te=L.render?L.render(h):typeof L.accessor=="function"?L.accessor(h):h[L.accessor];return i.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm",children:te},B)})]},_)})}):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:I("w-full overflow-auto",f),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:Q.length>0&&Q.every(h=>E.has(R(h))),onChange:Y})}),r.map(h=>{const _=typeof h.accessor=="string"?h.accessor:h.header,L=J===(typeof h.accessor=="string"?h.accessor:h.sortKey);return i.jsx("th",{className:I("px-4 py-2 text-left text-sm font-medium text-gray-700",h.width),onClick:()=>x(h),children:i.jsxs("div",{className:"inline-flex items-center space-x-1 cursor-pointer",children:[i.jsx("span",{children:h.header}),h.sortable&&i.jsx("span",{className:"text-xs",children:L?$==="asc"?"▲":"▼":"⇵"})]})},_)})]})}),X()]}),i.jsxs("div",{className:"flex items-center justify-between py-2 px-4",children:[i.jsx("span",{className:"text-sm text-gray-700",children:y?"Cargando...":`Página ${F} de ${K}`}),i.jsxs("div",{className:"space-x-2",children:[i.jsx($e,{size:"sm",variant:"outline",disabled:y||F<=1,onClick:()=>W(h=>Math.max(1,h-1)),children:"Prev"}),i.jsx($e,{size:"sm",variant:"outline",disabled:y||F>=K,onClick:()=>W(h=>Math.min(K,h+1)),children:"Next"})]})]})]})}function pn({control:r,name:t,rules:e,defaultValue:s=!1,checked:n,onChange:a,disabled:o=!1,label:l,labelPosition:c="right",errorMessage:u="",className:f}){const m=v.useId();if(r&&t)return i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s,render:({field:b,fieldState:N})=>{var j;return i.jsx(pn,{checked:b.value,onChange:b.onChange,disabled:o,label:l,labelPosition:c,errorMessage:((j=N.error)==null?void 0:j.message)||"",className:f})}});const p=!!n;return i.jsxs("div",{className:I("flex flex-col",f),children:[i.jsxs("label",{className:I("inline-flex items-center space-x-3 select-none",o&&"opacity-50 cursor-not-allowed"),htmlFor:m,children:[l&&c==="left"&&i.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l}),i.jsx("button",{id:m,type:"button",role:"switch","aria-checked":p,disabled:o,onClick:()=>!o&&(a==null?void 0:a(!p)),className:I("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:I("absolute h-6 w-6 bg-[var(--color-ds-background-page)] rounded-full shadow transform transition-transform duration-200",p?"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:" "})})]})}exports.Button=$e;exports.Checkbox=on;exports.CollapsibleSection=Bt;exports.DateInput=Vs;exports.DropdownMenu=eo;exports.FileUploader=Is;exports.FormFieldInput=dr;exports.FormPageLayout=ko;exports.FormRenderer=ki;exports.Header=hn;exports.Icon=Ce;exports.IconButton=cn;exports.InfoButton=Ls;exports.Input=Mt;exports.InputGroup=zs;exports.LoadingScreen=Ni;exports.Modal=_i;exports.OptionGroup=Us;exports.PageLayout=Ti;exports.SearchField=ln;exports.Select=ct;exports.Sidebar=mn;exports.SidebarNav=mr;exports.SkeletonLoader=qe;exports.Table=Ci;exports.Tabs=Ps;exports.TextArea=hr;exports.ThemeProvider=Ei;exports.ThemeToggle=dn;exports.Toast=Bs;exports.ToastProvider=Mo;exports.ToggleSwitch=pn;exports.useToast=Zs;
|
|
61
|
+
`,children:[i.jsx(tr,{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),mr=({items:r,selected:t,onSelect:e,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:$(s>0?"mt-1":"mt-0"),children:r.map(l=>{var E;const c=l.value===t,u=n.has(l.value),f=["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)]",x=s===0&&(u||c)?"text-[var(--color-ds-text-on-accent)]":"text-[var(--color-ds-text-secondary)]",b=!!((E=l.children)!=null&&E.length);return i.jsxs("li",{children:[i.jsxs("button",{type:"button",onClick:()=>b?o(l.value):e(l.value),"aria-expanded":b?u:void 0,className:$("w-full flex items-center justify-between h-8 transition-colors",f,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})]}),b&&(u?i.jsx(is,{className:$("w-4 h-4",x)}):i.jsx($n,{className:$("w-4 h-4",x)}))]}),b&&i.jsx("div",{className:$("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(mr,{items:l.children,selected:t,onSelect:e,level:s+1})})]},l.value)})})},_i="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",Fi="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",mn=({appName:r,orgName:t,username:e,footerText:s,navItems:n,selectedNav:a,onSelectNav:o,width:l="200px"})=>{const{theme:c}=fn(),u=c==="dark"?_i:Fi;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:t}),i.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:e}),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(mr,{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 Ti({sidebar:r,header:t,children:e}){return i.jsxs("div",{className:"flex h-screen overflow-hidden bg-[var(--color-ds-background-page)]",children:[i.jsx(mn,{...r}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-auto px-10 [scrollbar-gutter:stable_both-edges]",children:[i.jsx(hn,{...t}),i.jsx("main",{className:"flex-1 ",children:e})]})]})}function Ci({columns:r,data:t,loadData:e,loading:s,idAccessor:n,multiSelect:a=!1,onSelectionChange:o,pageSize:l=10,initialSort:c,onSort:u,className:f}){const p=t!==void 0,[x,b]=v.useState([]),[E,j]=v.useState(!1),T=v.useRef(null);v.useEffect(()=>{var F;if(!e||p)return;(F=T.current)==null||F.abort();const m=new AbortController;return T.current=m,j(!0),e().then(L=>{m.signal.aborted||b(L)}).finally(()=>{m.signal.aborted||j(!1)}),()=>m.abort()},[e,p]);const w=v.useMemo(()=>p?t:x,[t,x,p]),y=s??(e?E:!1),[N,O]=v.useState(new Set),[_,D]=v.useState(1),[Q,S]=v.useState(c==null?void 0:c.sortBy),[W,G]=v.useState((c==null?void 0:c.sortDir)??"asc"),R=m=>typeof n=="function"?n(m):m[n],P=v.useRef(null);v.useEffect(()=>{P.current!==w&&(O(new Set),D(1),P.current=w)},[w]);const X=v.useMemo(()=>{if(!Q)return w;const m=W==="asc"?1:-1;return[...w].sort((F,L)=>{const B=F[Q],re=L[Q];return B==null?-m:re==null||B>re?m:B<re?-m:0})},[w,Q,W]),ee=Math.max(1,Math.ceil(X.length/l)),I=v.useMemo(()=>{const m=(_-1)*l;return X.slice(m,m+l)},[X,_,l]),J=m=>{const F=new Set(N);F.has(m)?F.delete(m):F.add(m),O(F),o==null||o(w.filter(L=>F.has(R(L))))},Z=()=>{const m=I.every(L=>N.has(R(L))),F=new Set(N);I.forEach(L=>{m?F.delete(R(L)):F.add(R(L))}),O(F),o==null||o(w.filter(L=>F.has(R(L))))},h=m=>{if(!m.sortable)return;const F=typeof m.accessor=="string"?m.accessor:m.sortKey;if(Q===F){const L=W==="asc"?"desc":"asc";G(L),u==null||u(F,L)}else S(F),G("asc"),u==null||u(F,"asc");D(1)},K=()=>y?i.jsx("tbody",{children:Array.from({length:l}).map((m,F)=>i.jsxs("tr",{children:[a&&i.jsx("td",{children:i.jsx(qe,{width:"1rem",height:"1rem",variant:"circle"})}),r.map((L,B)=>i.jsx("td",{children:i.jsx(qe,{width:"100%",height:"1em",variant:"rect"})},B))]},F))}):I.length?i.jsx("tbody",{children:I.map(m=>{const F=R(m);return i.jsxs("tr",{className:"hover:bg-gray-50",children:[a&&i.jsx("td",{children:i.jsx("input",{type:"checkbox",checked:N.has(F),onChange:()=>J(F)})}),r.map((L,B)=>{const re=L.render?L.render(m):typeof L.accessor=="function"?L.accessor(m):m[L.accessor];return i.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm",children:re},B)})]},F)})}):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:$("w-full overflow-auto",f),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:I.length>0&&I.every(m=>N.has(R(m))),onChange:Z})}),r.map(m=>{const F=typeof m.accessor=="string"?m.accessor:m.header,L=Q===(typeof m.accessor=="string"?m.accessor:m.sortKey);return i.jsx("th",{className:$("px-4 py-2 text-left text-sm font-medium text-gray-700",m.width),onClick:()=>h(m),children:i.jsxs("div",{className:"inline-flex items-center space-x-1 cursor-pointer",children:[i.jsx("span",{children:m.header}),m.sortable&&i.jsx("span",{className:"text-xs",children:L?W==="asc"?"▲":"▼":"⇵"})]})},F)})]})}),K()]}),i.jsxs("div",{className:"flex items-center justify-between py-2 px-4",children:[i.jsx("span",{className:"text-sm text-gray-700",children:y?"Cargando...":`Página ${_} de ${ee}`}),i.jsxs("div",{className:"space-x-2",children:[i.jsx($e,{size:"sm",variant:"outline",disabled:y||_<=1,onClick:()=>D(m=>Math.max(1,m-1)),children:"Prev"}),i.jsx($e,{size:"sm",variant:"outline",disabled:y||_>=ee,onClick:()=>D(m=>Math.min(ee,m+1)),children:"Next"})]})]})]})}function pn({control:r,name:t,rules:e,defaultValue:s=!1,checked:n,onChange:a,disabled:o=!1,label:l,labelPosition:c="right",errorMessage:u="",className:f}){const p=v.useId();if(r&&t)return i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s,render:({field:b,fieldState:E})=>{var j;return i.jsx(pn,{checked:b.value,onChange:b.onChange,disabled:o,label:l,labelPosition:c,errorMessage:((j=E.error)==null?void 0:j.message)||"",className:f})}});const x=!!n;return i.jsxs("div",{className:$("flex flex-col",f),children:[i.jsxs("label",{className:$("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":x,disabled:o,onClick:()=>!o&&(a==null?void 0:a(!x)),className:$("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:$("absolute h-6 w-6 bg-[var(--color-ds-background-page)] rounded-full shadow transform transition-transform duration-200",x?"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:" "})})]})}exports.Button=$e;exports.Checkbox=on;exports.CollapsibleSection=Bt;exports.DateInput=Vs;exports.DropdownMenu=eo;exports.FileUploader=Is;exports.FormFieldInput=dr;exports.FormPageLayout=ko;exports.FormRenderer=ki;exports.Header=hn;exports.Icon=Ce;exports.IconButton=cn;exports.InfoButton=Ls;exports.Input=Mt;exports.InputGroup=zs;exports.LoadingScreen=Ni;exports.Modal=Si;exports.OptionGroup=Us;exports.PageLayout=Ti;exports.SearchField=ln;exports.Select=ct;exports.Sidebar=mn;exports.SidebarNav=mr;exports.SkeletonLoader=qe;exports.Table=Ci;exports.Tabs=Ps;exports.TextArea=hr;exports.ThemeProvider=Ei;exports.ThemeToggle=dn;exports.Toast=Bs;exports.ToastProvider=Mo;exports.ToggleSwitch=pn;exports.useToast=Zs;
|