@data-c/ui 0.0.127-alpha.0 → 0.0.128-alpha.0

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.js CHANGED
@@ -3,7 +3,7 @@ Valid keys: `+JSON.stringify(Object.keys(f),null," "));var ee=ie(F,D,S,M,O+"."+
3
3
  `)):n.some(i=>i===void 0)&&console.error(`MUI: the styled(${o})(...args) API requires all its args to be defined.`),r(...n)}:r}var pi=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))};function me(t,e){if(t==null)return{};var r={},n=Object.keys(t),o,i;for(i=0;i<n.length;i++)o=n[i],!(e.indexOf(o)>=0)&&(r[o]=t[o]);return r}var Bl=["values","unit","step"];var Il=t=>{let e=Object.keys(t).map(r=>({key:r,val:t[r]}))||[];return e.sort((r,n)=>r.val-n.val),e.reduce((r,n)=>$({},r,{[n.key]:n.val}),{})};function _n(t){let{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=t,o=me(t,Bl),i=Il(e),s=Object.keys(i);function l(p){return`@media (min-width:${typeof e[p]=="number"?e[p]:p}${r})`}function a(p){return`@media (max-width:${(typeof e[p]=="number"?e[p]:p)-n/100}${r})`}function u(p,m){let y=s.indexOf(m);return`@media (min-width:${typeof e[p]=="number"?e[p]:p}${r}) and (max-width:${(y!==-1&&typeof e[s[y]]=="number"?e[s[y]]:m)-n/100}${r})`}function d(p){return s.indexOf(p)+1<s.length?u(p,s[s.indexOf(p)+1]):l(p)}function c(p){let m=s.indexOf(p);return m===0?l(s[1]):m===s.length-1?a(s[m]):u(p,s[s.indexOf(p)+1]).replace("@media","@media not all and")}return $({keys:s,values:i,up:l,down:a,between:u,only:d,not:c,unit:r},o)}var Ll={borderRadius:4},mi=Ll;var rt=Ne(Jt()),jl=process.env.NODE_ENV!=="production"?rt.default.oneOfType([rt.default.number,rt.default.string,rt.default.object,rt.default.array]):{},xe=jl;function Nl(t,e){return e?ue(t,e,{clone:!1}):t}var Ie=Nl;var fr={xs:0,sm:600,md:900,lg:1200,xl:1536},hi={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${fr[t]}px)`};function re(t,e,r){let n=t.theme||{};if(Array.isArray(e)){let i=n.breakpoints||hi;return e.reduce((s,l,a)=>(s[i.up(i.keys[a])]=r(e[a]),s),{})}if(typeof e=="object"){let i=n.breakpoints||hi;return Object.keys(e).reduce((s,l)=>{if(Object.keys(i.values||fr).indexOf(l)!==-1){let a=i.up(l);s[a]=r(e[l],l)}else{let a=l;s[a]=e[a]}return s},{})}return r(e)}function On(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((n,o)=>{let i=t.up(o);return n[i]={},n},{}))||{}}function Fn(t,e){return t.reduce((r,n)=>{let o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},e)}function yi(t,...e){let r=On(t),n=[r,...e].reduce((o,i)=>ue(o,i),{});return Fn(Object.keys(r),n)}function zl(t,e){if(typeof t!="object")return{};let r={},n=Object.keys(e);return Array.isArray(t)?n.forEach((o,i)=>{i<t.length&&(r[o]=!0)}):n.forEach(o=>{t[o]!=null&&(r[o]=!0)}),r}function pr({values:t,breakpoints:e,base:r}){let n=r||zl(t,e),o=Object.keys(n);if(o.length===0)return t;let i;return o.reduce((s,l,a)=>(Array.isArray(t)?(s[l]=t[a]!=null?t[a]:t[i],i=a):typeof t=="object"?(s[l]=t[l]!=null?t[l]:t[i],i=l):s[l]=t,s),{})}function nt(t,e,r=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&r){let n=`vars.${e}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,t);if(n!=null)return n}return e.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,t)}function vt(t,e,r,n=r){let o;return typeof t=="function"?o=t(r):Array.isArray(t)?o=t[r]||n:o=nt(t,r)||n,e&&(o=e(o,n,t)),o}function Vl(t){let{prop:e,cssProperty:r=t.prop,themeKey:n,transform:o}=t,i=s=>{if(s[e]==null)return null;let l=s[e],a=s.theme,u=nt(a,n)||{};return re(s,l,c=>{let p=vt(u,o,c);return c===p&&typeof c=="string"&&(p=vt(u,o,`${e}${c==="default"?"":de(c)}`,c)),r===!1?p:{[r]:p}})};return i.propTypes=process.env.NODE_ENV!=="production"?{[e]:xe}:{},i.filterProps=[e],i}var R=Vl;function kn(t){let e={};return r=>(e[r]===void 0&&(e[r]=t(r)),e[r])}var Ul={m:"margin",p:"padding"},ql={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},gi={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Wl=kn(t=>{if(t.length>2)if(gi[t])t=gi[t];else return[t];let[e,r]=t.split(""),n=Ul[e],o=ql[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),dr=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],mr=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Mn=[...dr,...mr];function Ve(t,e,r,n){var o;let i=(o=nt(t,e,!1))!=null?o:r;return typeof i=="number"?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&typeof s!="number"&&console.error(`MUI: Expected ${n} argument to be a number or a string, got ${s}.`),i*s):Array.isArray(i)?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&(Number.isInteger(s)?s>i.length-1&&console.error([`MUI: The value provided (${s}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${s} > ${i.length-1}, you need to add the missing values.`].join(`
4
4
  `)):console.error([`MUI: The \`theme.${e}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${e}\` as a number.`].join(`
5
5
  `))),i[s]):typeof i=="function"?i:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${e}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join(`
6
- `)),()=>{})}function Tt(t){return Ve(t,"spacing",8,"spacing")}function Ee(t,e){if(typeof e=="string"||e==null)return e;let r=Math.abs(e),n=t(r);return e>=0?n:typeof n=="number"?-n:`-${n}`}function Yl(t,e){return r=>t.reduce((n,o)=>(n[o]=Ee(e,r),n),{})}function Kl(t,e,r,n){if(e.indexOf(r)===-1)return null;let o=Wl(r),i=Yl(o,n),s=t[r];return re(t,s,i)}function An(t,e){let r=Tt(t.theme);return Object.keys(t).map(n=>Kl(t,e,n,r)).reduce(Ie,{})}function H(t){return An(t,dr)}H.propTypes=process.env.NODE_ENV!=="production"?dr.reduce((t,e)=>(t[e]=xe,t),{}):{};H.filterProps=dr;function Z(t){return An(t,mr)}Z.propTypes=process.env.NODE_ENV!=="production"?mr.reduce((t,e)=>(t[e]=xe,t),{}):{};Z.filterProps=mr;function xi(t){return An(t,Mn)}xi.propTypes=process.env.NODE_ENV!=="production"?Mn.reduce((t,e)=>(t[e]=xe,t),{}):{};xi.filterProps=Mn;function Dn(t=8){if(t.mui)return t;let e=Tt({spacing:t}),r=(...n)=>(process.env.NODE_ENV!=="production"&&(n.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${n.length}`)),(n.length===0?[1]:n).map(i=>{let s=e(i);return typeof s=="number"?`${s}px`:s}).join(" "));return r.mui=!0,r}function Gl(...t){let e=t.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>e[i]?Ie(o,e[i](n)):o,{});return r.propTypes=process.env.NODE_ENV!=="production"?t.reduce((n,o)=>Object.assign(n,o.propTypes),{}):{},r.filterProps=t.reduce((n,o)=>n.concat(o.filterProps),[]),r}var Le=Gl;function Ce(t){return typeof t!="number"?t:`${t}px solid`}var Hl=R({prop:"border",themeKey:"borders",transform:Ce}),Zl=R({prop:"borderTop",themeKey:"borders",transform:Ce}),Xl=R({prop:"borderRight",themeKey:"borders",transform:Ce}),Jl=R({prop:"borderBottom",themeKey:"borders",transform:Ce}),Ql=R({prop:"borderLeft",themeKey:"borders",transform:Ce}),eu=R({prop:"borderColor",themeKey:"palette"}),tu=R({prop:"borderTopColor",themeKey:"palette"}),ru=R({prop:"borderRightColor",themeKey:"palette"}),nu=R({prop:"borderBottomColor",themeKey:"palette"}),ou=R({prop:"borderLeftColor",themeKey:"palette"}),Ct=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){let e=Ve(t.theme,"shape.borderRadius",4,"borderRadius"),r=n=>({borderRadius:Ee(e,n)});return re(t,t.borderRadius,r)}return null};Ct.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:xe}:{};Ct.filterProps=["borderRadius"];var sy=Le(Hl,Zl,Xl,Jl,Ql,eu,tu,ru,nu,ou,Ct);var St=t=>{if(t.gap!==void 0&&t.gap!==null){let e=Ve(t.theme,"spacing",8,"gap"),r=n=>({gap:Ee(e,n)});return re(t,t.gap,r)}return null};St.propTypes=process.env.NODE_ENV!=="production"?{gap:xe}:{};St.filterProps=["gap"];var Pt=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){let e=Ve(t.theme,"spacing",8,"columnGap"),r=n=>({columnGap:Ee(e,n)});return re(t,t.columnGap,r)}return null};Pt.propTypes=process.env.NODE_ENV!=="production"?{columnGap:xe}:{};Pt.filterProps=["columnGap"];var wt=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){let e=Ve(t.theme,"spacing",8,"rowGap"),r=n=>({rowGap:Ee(e,n)});return re(t,t.rowGap,r)}return null};wt.propTypes=process.env.NODE_ENV!=="production"?{rowGap:xe}:{};wt.filterProps=["rowGap"];var iu=R({prop:"gridColumn"}),su=R({prop:"gridRow"}),au=R({prop:"gridAutoFlow"}),lu=R({prop:"gridAutoColumns"}),uu=R({prop:"gridAutoRows"}),cu=R({prop:"gridTemplateColumns"}),fu=R({prop:"gridTemplateRows"}),pu=R({prop:"gridTemplateAreas"}),du=R({prop:"gridArea"}),dy=Le(St,Pt,wt,iu,su,au,lu,uu,cu,fu,pu,du);function Ue(t,e){return e==="grey"?e:t}var mu=R({prop:"color",themeKey:"palette",transform:Ue}),hu=R({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Ue}),yu=R({prop:"backgroundColor",themeKey:"palette",transform:Ue}),gy=Le(mu,hu,yu);function fe(t){return t<=1&&t!==0?`${t*100}%`:t}var gu=R({prop:"width",transform:fe}),hr=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){let e=r=>{var n,o;let i=((n=t.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||fr[r];return i?((o=t.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${t.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:fe(r)}};return re(t,t.maxWidth,e)}return null};hr.filterProps=["maxWidth"];var xu=R({prop:"minWidth",transform:fe}),bu=R({prop:"height",transform:fe}),vu=R({prop:"maxHeight",transform:fe}),Tu=R({prop:"minHeight",transform:fe}),Cy=R({prop:"size",cssProperty:"width",transform:fe}),Sy=R({prop:"size",cssProperty:"height",transform:fe}),Cu=R({prop:"boxSizing"}),Py=Le(gu,hr,xu,bu,vu,Tu,Cu);var Su={border:{themeKey:"borders",transform:Ce},borderTop:{themeKey:"borders",transform:Ce},borderRight:{themeKey:"borders",transform:Ce},borderBottom:{themeKey:"borders",transform:Ce},borderLeft:{themeKey:"borders",transform:Ce},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ct},color:{themeKey:"palette",transform:Ue},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Ue},backgroundColor:{themeKey:"palette",transform:Ue},p:{style:Z},pt:{style:Z},pr:{style:Z},pb:{style:Z},pl:{style:Z},px:{style:Z},py:{style:Z},padding:{style:Z},paddingTop:{style:Z},paddingRight:{style:Z},paddingBottom:{style:Z},paddingLeft:{style:Z},paddingX:{style:Z},paddingY:{style:Z},paddingInline:{style:Z},paddingInlineStart:{style:Z},paddingInlineEnd:{style:Z},paddingBlock:{style:Z},paddingBlockStart:{style:Z},paddingBlockEnd:{style:Z},m:{style:H},mt:{style:H},mr:{style:H},mb:{style:H},ml:{style:H},mx:{style:H},my:{style:H},margin:{style:H},marginTop:{style:H},marginRight:{style:H},marginBottom:{style:H},marginLeft:{style:H},marginX:{style:H},marginY:{style:H},marginInline:{style:H},marginInlineStart:{style:H},marginInlineEnd:{style:H},marginBlock:{style:H},marginBlockStart:{style:H},marginBlockEnd:{style:H},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:St},rowGap:{style:wt},columnGap:{style:Pt},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:fe},maxWidth:{style:hr},minWidth:{transform:fe},height:{transform:fe},maxHeight:{transform:fe},minHeight:{transform:fe},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},ot=Su;function Pu(...t){let e=t.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(e);return t.every(n=>r.size===Object.keys(n).length)}function wu(t,e){return typeof t=="function"?t(e):t}function Eu(){function t(r,n,o,i){let s={[r]:n,theme:o},l=i[r];if(!l)return{[r]:n};let{cssProperty:a=r,themeKey:u,transform:d,style:c}=l;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};let p=nt(o,u)||{};return c?c(s):re(s,n,y=>{let w=vt(p,d,y);return y===w&&typeof y=="string"&&(w=vt(p,d,`${r}${y==="default"?"":de(y)}`,y)),a===!1?w:{[a]:w}})}function e(r){var n;let{sx:o,theme:i={}}=r||{};if(!o)return null;let s=(n=i.unstable_sxConfig)!=null?n:ot;function l(a){let u=a;if(typeof a=="function")u=a(i);else if(typeof a!="object")return a;if(!u)return null;let d=On(i.breakpoints),c=Object.keys(d),p=d;return Object.keys(u).forEach(m=>{let y=wu(u[m],i);if(y!=null)if(typeof y=="object")if(s[m])p=Ie(p,t(m,y,i,s));else{let w=re({theme:i},y,j=>({[m]:j}));Pu(w,y)?p[m]=e({sx:y,theme:i}):p=Ie(p,w)}else p=Ie(p,t(m,y,i,s))}),Fn(c,p)}return Array.isArray(o)?o.map(l):l(o)}return e}var bi=Eu();bi.filterProps=["sx"];var Et=bi;var _u=["breakpoints","palette","spacing","shape"];function Ou(t={},...e){let{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=t,s=me(t,_u),l=_n(r),a=Dn(o),u=ue({breakpoints:l,direction:"ltr",components:{},palette:$({mode:"light"},n),spacing:a,shape:$({},mi,i)},s);return u=e.reduce((d,c)=>ue(d,c),u),u.unstable_sxConfig=$({},ot,s==null?void 0:s.unstable_sxConfig),u.unstable_sx=function(c){return Et({sx:c,theme:this})},u}var qe=Ou;function Fu(t){return Object.keys(t).length===0}function ku(t=null){let e=vi.useContext(_react2.ThemeContext);return!e||Fu(e)?t:e}var Ti=ku;var Mu=qe();function Au(t=Mu){return Ti(t)}var Ci=Au;var Du=["sx"],Ru=t=>{var e,r;let n={systemProps:{},otherProps:{}},o=(e=t==null||(r=t.theme)==null?void 0:r.unstable_sxConfig)!=null?e:ot;return Object.keys(t).forEach(i=>{o[i]?n.systemProps[i]=t[i]:n.otherProps[i]=t[i]}),n};function yr(t){let{sx:e}=t,r=me(t,Du),{systemProps:n,otherProps:o}=Ru(r),i;return Array.isArray(e)?i=[n,...e]:typeof e=="function"?i=(...s)=>{let l=e(...s);return ye(l)?$({},n,l):n}:i=$({},n,e),$({},o,{sx:i})}function Si(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=Si(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function $u(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=Si(t))&&(n&&(n+=" "),n+=e);return n}var Pi=$u;var Bu=["variant"];function wi(t){return t.length===0}function gr(t){let{variant:e}=t,r=me(t,Bu),n=e||"";return Object.keys(r).sort().forEach(o=>{o==="color"?n+=wi(n)?t[o]:de(t[o]):n+=`${wi(n)?o:de(o)}${de(t[o].toString())}`}),n}var Iu=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Lu(t){return Object.keys(t).length===0}function ju(t){return typeof t=="string"&&t.charCodeAt(0)>96}var Nu=(t,e)=>e.components&&e.components[t]&&e.components[t].styleOverrides?e.components[t].styleOverrides:null,br=t=>{let e={};return t&&t.forEach(r=>{let n=gr(r.props);e[n]=r.style}),e},zu=(t,e)=>{let r=[];return e&&e.components&&e.components[t]&&e.components[t].variants&&(r=e.components[t].variants),br(r)},vr=(t,e,r)=>{let{ownerState:n={}}=t,o=[];return r&&r.forEach(i=>{let s=!0;Object.keys(i.props).forEach(l=>{n[l]!==i.props[l]&&t[l]!==i.props[l]&&(s=!1)}),s&&o.push(e[gr(i.props)])}),o},Vu=(t,e,r,n)=>{var o;let i=r==null||(o=r.components)==null||(o=o[n])==null?void 0:o.variants;return vr(t,e,i)};function Rn(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}var Uu=qe(),Ei=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function xr({defaultTheme:t,theme:e,themeId:r}){return Lu(e)?t:e[r]||e}function qu(t){return t?(e,r)=>r[t]:null}var _i=({styledArg:t,props:e,defaultTheme:r,themeId:n})=>{let o=t($({},e,{theme:xr($({},e,{defaultTheme:r,themeId:n}))})),i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){let s=vr(e,br(i),i);return[o,...s]}return o};function $n(t={}){let{themeId:e,defaultTheme:r=Uu,rootShouldForwardProp:n=Rn,slotShouldForwardProp:o=Rn}=t,i=s=>Et($({},s,{theme:xr($({},s,{defaultTheme:r,themeId:e}))}));return i.__mui_systemSx=!0,(s,l={})=>{pi(s,P=>P.filter(B=>!(B!=null&&B.__mui_systemSx)));let{name:a,slot:u,skipVariantsResolver:d,skipSx:c,overridesResolver:p=qu(Ei(u))}=l,m=me(l,Iu),y=d!==void 0?d:u&&u!=="Root"&&u!=="root"||!1,w=c||!1,j;process.env.NODE_ENV!=="production"&&a&&(j=`${a}-${Ei(u||"Root")}`);let W=Rn;u==="Root"||u==="root"?W=n:u?W=o:ju(s)&&(W=void 0);let k=En(s,$({shouldForwardProp:W,label:j},m)),ne=(P,...B)=>{let Q=B?B.map(C=>{if(typeof C=="function"&&C.__emotion_real!==C)return E=>_i({styledArg:C,props:E,defaultTheme:r,themeId:e});if(ye(C)){let E=C,_;return C&&C.variants&&(_=C.variants,delete E.variants,E=f=>{let h=C;return vr(f,br(_),_).forEach(T=>{h=ue(h,T)}),h}),E}return C}):[],J=P;if(ye(P)){let C;P&&P.variants&&(C=P.variants,delete J.variants,J=E=>{let _=P;return vr(E,br(C),C).forEach(h=>{_=ue(_,h)}),_})}else typeof P=="function"&&P.__emotion_real!==P&&(J=C=>_i({styledArg:P,props:C,defaultTheme:r,themeId:e}));a&&p&&Q.push(C=>{let E=xr($({},C,{defaultTheme:r,themeId:e})),_=Nu(a,E);if(_){let f={};return Object.entries(_).forEach(([h,v])=>{f[h]=typeof v=="function"?v($({},C,{theme:E})):v}),p(C,f)}return null}),a&&!y&&Q.push(C=>{let E=xr($({},C,{defaultTheme:r,themeId:e}));return Vu(C,zu(a,E),E,a)}),w||Q.push(i);let Te=Q.length-B.length;if(Array.isArray(P)&&Te>0){let C=new Array(Te).fill("");J=[...P,...C],J.raw=[...P.raw,...C]}let G=k(J,...Q);if(process.env.NODE_ENV!=="production"){let C;a&&(C=`${a}${de(u||"")}`),C===void 0&&(C=`Styled(${cr(s)})`),G.displayName=C}return s.muiName&&(G.muiName=s.muiName),G};return k.withConfig&&(ne.withConfig=k.withConfig),ne}}var Wu=$n(),Oi=Wu;function Bn(t){let{theme:e,name:r,props:n}=t;return!e||!e.components||!e.components[r]||!e.components[r].defaultProps?n:gt(e.components[r].defaultProps,n)}function Tr({props:t,name:e,defaultTheme:r,themeId:n}){let o=Ci(r);return n&&(o=o[n]||o),Bn({theme:o,name:e,props:t})}var Y=Ne(Jt());var K=Ne(Jt());var Yu=["component","direction","spacing","divider","children","className","useFlexGap"],Gu=qe(),Hu=Oi("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function Zu(t){return Tr({props:t,name:"MuiStack",defaultTheme:Gu})}function Xu(t,e){let r=it.Children.toArray(t).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i<r.length-1&&n.push(it.cloneElement(e,{key:`separator-${i}`})),n),[])}var Ju=t=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],Qu=({ownerState:t,theme:e})=>{let r=$({display:"flex",flexDirection:"column"},re({theme:e},pr({values:t.direction,breakpoints:e.breakpoints.values}),n=>({flexDirection:n})));if(t.spacing){let n=Tt(e),o=Object.keys(e.breakpoints.values).reduce((a,u)=>((typeof t.spacing=="object"&&t.spacing[u]!=null||typeof t.direction=="object"&&t.direction[u]!=null)&&(a[u]=!0),a),{}),i=pr({values:t.direction,base:o}),s=pr({values:t.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((a,u,d)=>{if(!i[a]){let p=u>0?i[d[u-1]]:"column";i[a]=p}}),r=ue(r,re({theme:e},s,(a,u)=>t.useFlexGap?{gap:Ee(n,a)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Ju(u?i[u]:t.direction)}`]:Ee(n,a)}}))}return r=yi(e.breakpoints,r),r};function In(t={}){let{createStyledComponent:e=Hu,useThemeProps:r=Zu,componentName:n="MuiStack"}=t,o=()=>xt({root:["root"]},a=>bt(n,a),{}),i=e(Qu),s=it.forwardRef(function(a,u){let d=r(a),c=yr(d),{component:p="div",direction:m="column",spacing:y=0,divider:w,children:j,className:W,useFlexGap:k=!1}=c,ne=me(c,Yu),P={direction:m,spacing:y,useFlexGap:k},B=o();return _jsxruntime.jsx.call(void 0, i,$({as:p,ownerState:P,ref:u,className:Pi(B.root,W)},ne,{children:w?Xu(j,w):j}))});return process.env.NODE_ENV!=="production"&&(s.propTypes={children:K.default.node,direction:K.default.oneOfType([K.default.oneOf(["column-reverse","column","row-reverse","row"]),K.default.arrayOf(K.default.oneOf(["column-reverse","column","row-reverse","row"])),K.default.object]),divider:K.default.node,spacing:K.default.oneOfType([K.default.arrayOf(K.default.oneOfType([K.default.number,K.default.string])),K.default.number,K.default.object,K.default.string]),sx:K.default.oneOfType([K.default.arrayOf(K.default.oneOfType([K.default.func,K.default.object,K.default.bool])),K.default.func,K.default.object])}),s}var Fi=In();process.env.NODE_ENV!=="production"&&(Fi.propTypes={children:Y.default.node,component:Y.default.elementType,direction:Y.default.oneOfType([Y.default.oneOf(["column-reverse","column","row-reverse","row"]),Y.default.arrayOf(Y.default.oneOf(["column-reverse","column","row-reverse","row"])),Y.default.object]),divider:Y.default.node,spacing:Y.default.oneOfType([Y.default.arrayOf(Y.default.oneOfType([Y.default.number,Y.default.string])),Y.default.number,Y.default.object,Y.default.string]),sx:Y.default.oneOfType([Y.default.arrayOf(Y.default.oneOfType([Y.default.func,Y.default.object,Y.default.bool])),Y.default.func,Y.default.object]),useFlexGap:Y.default.bool});var Cr=Fi;var nc=_styled2.default.call(void 0, (0, _material.Typography))(({theme:t})=>({fontWeight:"bold"}));function Ai(t){let{label:e,children:r,labelProps:n,contentProps:o,isNumber:i,showDivider:s}=t;return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",gap:4},children:[_jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsx.call(void 0, Cr,{children:_jsxruntime.jsx.call(void 0, nc,q(b({},n),{children:e}))}),_jsxruntime.jsx.call(void 0, Cr,{direction:i?"row":"column",justifyContent:i?"flex-end":"center",children:r})]}),s&&_jsxruntime.jsx.call(void 0, _material.Divider,{orientation:"vertical",flexItem:!0})]})}function Bi(t){let{title:e,children:r,onBack:n,onClose:o}=t,i=_material.useMediaQuery.call(void 0, s=>s.breakpoints.down("sm"));return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",flexDirection:i||o?"column":"row",justifyContent:"space-between",alignItems:i?"center":"flex-end",gap:2,marginBottom:2},children:[_jsxruntime.jsxs.call(void 0, _material.Stack,{width:"100%",direction:"row",sx:{alignItems:"center"},children:[n&&_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{mr:1},onClick:n,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.ArrowBack,{})}),_jsxruntime.jsx.call(void 0, _material.Typography,{component:"h1",variant:"h2",sx:{fontWeight:"700"},children:e}),o&&_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{marginLeft:"auto"},onClick:o,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Close,{fontSize:"medium"})})]}),_jsxruntime.jsx.call(void 0, _material.Box,{children:r})]})}var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash);function Pr(t){let i=t,{onSearch:e}=i,r=X(i,["onSearch"]),n=_lodash2.default.debounce(s=>e(s),500);function o(s){let l=s.target.value;n(l)}return _jsxruntime.jsx.call(void 0, _material.TextField,b({onChange:o,autoFocus:!0,InputProps:{startAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Search,{})})}},r))}function zn(t){let E=t,{value:e,label:r,options:n,isLoading:o,form:i,table:s,tableProps:l,onChange:a,onSearch:u,renderValue:d,dialogProps:c,disabled:p,filterOptions:m,optionKeyName:y}=E,w=X(E,["value","label","options","isLoading","form","table","tableProps","onChange","onSearch","renderValue","dialogProps","disabled","filterOptions","optionKeyName"]),{isOpen:j,openDialog:W,closeDialog:k}=_hooks.useDialog.call(void 0, ),[ne,P]=_react.useState.call(void 0, null),B=i||vi.default.Fragment,Q=_lodash2.default.debounce(_=>u(_),500),J=_react.useCallback.call(void 0, (_,f)=>he(this,null,function*(){Q(f)}),[Q]),Te=_react.useCallback.call(void 0, (_,f,h)=>{if(y&&(f!=null&&f[y].includes("Adicionar op\xE7\xE3o:"))){let v=f[y].replace("Adicionar op\xE7\xE3o:","").trim().replace(/["']/g,""),T=q(b({},f),{[y]:v});a&&a(T);return}a&&a(f)},[a]);function G(_,f=!1,h=!1){var v;if(_){let T=vi.default.Children.toArray((v=_.props)==null?void 0:v.children),S=T.length===1?0:1;return T.splice(S,0,_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{padding:"2px"},size:"small",color:"default",onClick:()=>W(),disabled:h,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.SearchOutlined,{fontSize:"small"})})),f&&T.unshift(_jsxruntime.jsx.call(void 0, _material.IconButton,{disabled:!0,children:_jsxruntime.jsx.call(void 0, _material.CircularProgress,{color:"primary",size:18})})),vi.default.cloneElement(_,{},T)}return _}function C(_,f){if(!y)return _;let v=_material.createFilterOptions.call(void 0, )(_,f),{inputValue:T}=f,S=_.some(M=>T===M[y]);return T!==""&&!S&&v.push({[y]:`Adicionar op\xE7\xE3o: "${T}"`}),v}return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _material.Autocomplete,{disabled:p,loadingText:"Carregando...",loading:o,onChange:Te,value:e,onInputChange:J,options:n,getOptionLabel:d,filterOptions:C,renderInput:_=>_jsxruntime.jsx.call(void 0, _material.TextField,b(q(b({label:r,onDoubleClick:()=>{p||W()}},_),{InputProps:q(b({},_.InputProps),{endAdornment:G(_.InputProps.endAdornment,o,p)}),disabled:p}),w)),clearIcon:_jsxruntime.jsx.call(void 0, _iconsmaterial.BackspaceOutlined,{}),componentsProps:{clearIndicator:{sx:{visibility:"visible"}}},noOptionsText:"Nenhum registro"}),_jsxruntime.jsx.call(void 0, _providers.FormProvider,{children:_jsxruntime.jsx.call(void 0, Fe,q(b({open:j,onClose:()=>k(),actions:"none"},c),{children:_jsxruntime.jsxs.call(void 0, _material.Stack,{spacing:1,children:[_jsxruntime.jsxs.call(void 0, _material.Stack,{direction:"row",justifyContent:"flex-end",alignItems:"center",spacing:1,children:[_jsxruntime.jsx.call(void 0, Pr,{placeholder:"Pesquisar",onSearch:_=>P(_)}),i&&_jsxruntime.jsx.call(void 0, B,{})]}),_jsxruntime.jsx.call(void 0, s,b({query:ne,enableTransporter:!0,onTransport:_=>{k(),a&&a(_)}},l))]})}))})]})}var Sc={dialogProps:{maxWidth:"md",fullWidth:!0}};zn.defaultProps=Sc;function Vn(t){let{label:e}=t;return _jsxruntime.jsx.call(void 0, _material.Stack,{component:"header",sx:{alignItems:"center",gap:1},children:_jsxruntime.jsx.call(void 0, _material.Typography,{component:"h1",variant:"h3",sx:{fontWeight:"medium",color:r=>r.palette.grey[600]},children:e})})}var ve=Ne(Yi()),_t=Ne(Hi()),ts=Ne(Xi()),qc=Object.prototype.toString,Wc=Error.prototype.toString,Yc=RegExp.prototype.toString,Kc=typeof Symbol!="undefined"?Symbol.prototype.toString:()=>"",Gc=/^Symbol\((.*)\)(.*)$/;function Hc(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function Ji(t,e=!1){if(t==null||t===!0||t===!1)return""+t;let r=typeof t;if(r==="number")return Hc(t);if(r==="string")return e?`"${t}"`:t;if(r==="function")return"[Function "+(t.name||"anonymous")+"]";if(r==="symbol")return Kc.call(t).replace(Gc,"Symbol($1)");let n=qc.call(t).slice(8,-1);return n==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):n==="Error"||t instanceof Error?"["+Wc.call(t)+"]":n==="RegExp"?Yc.call(t):null}function Ae(t,e){let r=Ji(t,e);return r!==null?r:JSON.stringify(t,function(n,o){let i=Ji(this[n],e);return i!==null?i:o},2)}function rs(t){return t==null?[]:[].concat(t)}var ns,Zc=/\$\{\s*(\w+)\s*\}/g;ns=Symbol.toStringTag;var ae=class extends Error{static formatError(e,r){let n=r.label||r.path||"this";return n!==r.path&&(r=Object.assign({},r,{path:n})),typeof e=="string"?e.replace(Zc,(o,i)=>Ae(r[i])):typeof e=="function"?e(r):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,r,n,o,i){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this[ns]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=o,this.errors=[],this.inner=[],rs(e).forEach(s=>{if(ae.isError(s)){this.errors.push(...s.errors);let l=s.inner.length?s.inner:[s];this.inner.push(...l)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],!i&&Error.captureStackTrace&&Error.captureStackTrace(this,ae)}},_e={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:t,type:e,value:r,originalValue:n})=>{let o=n!=null&&n!==r?` (cast from the value \`${Ae(n,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Ae(r,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${Ae(r,!0)}\``+o}},Se={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",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},je={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"},Hn={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Zn={isValue:"${path} field must be ${value}"},Xn={noUnknown:"${path} field has unspecified keys: ${unknown}"},Or={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"},os={notType:t=>{let{path:e,value:r,spec:n}=t,o=n.types.length;if(Array.isArray(r)){if(r.length<o)return`${e} tuple value has too few items, expected a length of ${o} but got ${r.length} for value: \`${Ae(r,!0)}\``;if(r.length>o)return`${e} tuple value has too many items, expected a length of ${o} but got ${r.length} for value: \`${Ae(r,!0)}\``}return ae.formatError(_e.notType,t)}},qx=Object.assign(Object.create(null),{mixed:_e,string:Se,number:je,date:Hn,object:Xn,array:Or,boolean:Zn,tuple:os}),Ir=t=>t&&t.__isYupSchema__,ut=class{static fromOptions(e,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:o,otherwise:i}=r,s=typeof n=="function"?n:(...l)=>l.every(a=>a===n);return new ut(e,(l,a)=>{var u;let d=s(...l)?o:i;return(u=d==null?void 0:d(a))!=null?u:a})}constructor(e,r){this.fn=void 0,this.refs=e,this.refs=e,this.fn=r}resolve(e,r){let n=this.refs.map(i=>i.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),o=this.fn(n,e,r);if(o===void 0||o===e)return e;if(!Ir(o))throw new TypeError("conditions must return a schema object");return o.resolve(r)}},_r={context:"$",value:"."};var De=class{constructor(e,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===_r.context,this.isValue=this.key[0]===_r.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?_r.context:this.isValue?_r.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&(0,ve.getter)(this.path,!0),this.map=r.map}getValue(e,r,n){let o=this.isContext?n:this.isValue?e:r;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(e,r){return this.getValue(e,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};De.prototype.__isYupRef=!0;var Pe=t=>t==null;function at(t){function e({value:r,path:n="",options:o,originalValue:i,schema:s},l,a){let{name:u,test:d,params:c,message:p,skipAbsent:m}=t,{parent:y,context:w,abortEarly:j=s.spec.abortEarly,disableStackTrace:W=s.spec.disableStackTrace}=o;function k(E){return De.isRef(E)?E.getValue(r,y,w):E}function ne(E={}){var _;let f=Object.assign({value:r,originalValue:i,label:s.spec.label,path:E.path||n,spec:s.spec},c,E.params);for(let v of Object.keys(f))f[v]=k(f[v]);let h=new ae(ae.formatError(E.message||p,f),r,f.path,E.type||u,(_=E.disableStackTrace)!=null?_:W);return h.params=f,h}let P=j?l:a,B={path:n,parent:y,type:u,from:o.from,createError:ne,resolve:k,options:o,originalValue:i,schema:s},Q=E=>{ae.isError(E)?P(E):E?a(null):P(ne())},J=E=>{ae.isError(E)?P(E):l(E)};if(m&&Pe(r))return Q(!0);let G;try{var C;if(G=d.call(B,r,B),typeof((C=G)==null?void 0:C.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${B.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(G).then(Q,J)}}catch(E){J(E);return}Q(G)}return e.OPTIONS=t,e}function Xc(t,e,r,n=r){let o,i,s;return e?((0,ve.forEach)(e,(l,a,u)=>{let d=a?l.slice(1,l.length-1):l;t=t.resolve({context:n,parent:o,value:r});let c=t.type==="tuple",p=u?parseInt(d,10):0;if(t.innerType||c){if(c&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&p>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);o=r,r=r&&r[p],t=c?t.spec.types[p]:t.innerType}if(!u){if(!t.fields||!t.fields[d])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${s} which is a type: "${t.type}")`);o=r,r=r&&r[d],t=t.fields[d]}i=d,s=a?"["+l+"]":"."+l}),{schema:t,parent:o,parentPath:i}):{parent:o,parentPath:e,schema:t}}var ct=class extends Set{describe(){let e=[];for(let r of this.values())e.push(De.isRef(r)?r.describe():r);return e}resolveAll(e){let r=[];for(let n of this.values())r.push(e(n));return r}clone(){return new ct(this.values())}merge(e,r){let n=this.clone();return e.forEach(o=>n.add(o)),r.forEach(o=>n.delete(o)),n}};function lt(t,e=new Map){if(Ir(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let r;if(t instanceof Date)r=new Date(t.getTime()),e.set(t,r);else if(t instanceof RegExp)r=new RegExp(t),e.set(t,r);else if(Array.isArray(t)){r=new Array(t.length),e.set(t,r);for(let n=0;n<t.length;n++)r[n]=lt(t[n],e)}else if(t instanceof Map){r=new Map,e.set(t,r);for(let[n,o]of t.entries())r.set(n,lt(o,e))}else if(t instanceof Set){r=new Set,e.set(t,r);for(let n of t)r.add(lt(n,e))}else if(t instanceof Object){r={},e.set(t,r);for(let[n,o]of Object.entries(t))r[n]=lt(o,e)}else throw Error(`Unable to clone ${t}`);return r}var oe=class{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ct,this._blacklist=new ct,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(_e.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=lt(Object.assign({},this.spec,e)),r}label(e){let r=this.clone();return r.spec.label=e,r}meta(...e){if(e.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},e[0]),r}withMutation(e){let r=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=r,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let r=this,n=e.clone(),o=Object.assign({},r.spec,n.spec);return n.spec=o,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=r._blacklist.merge(e._blacklist,e._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(i=>{e.tests.forEach(s=>{i.test(s.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((o,i)=>i.resolve(o,e),r),r=r.resolve(e)}return r}resolveOptions(e){var r,n,o,i;return Object.assign({},e,{from:e.from||[],strict:(r=e.strict)!=null?r:this.spec.strict,abortEarly:(n=e.abortEarly)!=null?n:this.spec.abortEarly,recursive:(o=e.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,r={}){let n=this.resolve(Object.assign({value:e},r)),o=r.assert==="ignore-optionality",i=n._cast(e,r);if(r.assert!==!1&&!n.isType(i)){if(o&&Pe(i))return i;let s=Ae(e),l=Ae(i);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
6
+ `)),()=>{})}function Tt(t){return Ve(t,"spacing",8,"spacing")}function Ee(t,e){if(typeof e=="string"||e==null)return e;let r=Math.abs(e),n=t(r);return e>=0?n:typeof n=="number"?-n:`-${n}`}function Yl(t,e){return r=>t.reduce((n,o)=>(n[o]=Ee(e,r),n),{})}function Kl(t,e,r,n){if(e.indexOf(r)===-1)return null;let o=Wl(r),i=Yl(o,n),s=t[r];return re(t,s,i)}function An(t,e){let r=Tt(t.theme);return Object.keys(t).map(n=>Kl(t,e,n,r)).reduce(Ie,{})}function H(t){return An(t,dr)}H.propTypes=process.env.NODE_ENV!=="production"?dr.reduce((t,e)=>(t[e]=xe,t),{}):{};H.filterProps=dr;function Z(t){return An(t,mr)}Z.propTypes=process.env.NODE_ENV!=="production"?mr.reduce((t,e)=>(t[e]=xe,t),{}):{};Z.filterProps=mr;function xi(t){return An(t,Mn)}xi.propTypes=process.env.NODE_ENV!=="production"?Mn.reduce((t,e)=>(t[e]=xe,t),{}):{};xi.filterProps=Mn;function Dn(t=8){if(t.mui)return t;let e=Tt({spacing:t}),r=(...n)=>(process.env.NODE_ENV!=="production"&&(n.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${n.length}`)),(n.length===0?[1]:n).map(i=>{let s=e(i);return typeof s=="number"?`${s}px`:s}).join(" "));return r.mui=!0,r}function Gl(...t){let e=t.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>e[i]?Ie(o,e[i](n)):o,{});return r.propTypes=process.env.NODE_ENV!=="production"?t.reduce((n,o)=>Object.assign(n,o.propTypes),{}):{},r.filterProps=t.reduce((n,o)=>n.concat(o.filterProps),[]),r}var Le=Gl;function Ce(t){return typeof t!="number"?t:`${t}px solid`}var Hl=R({prop:"border",themeKey:"borders",transform:Ce}),Zl=R({prop:"borderTop",themeKey:"borders",transform:Ce}),Xl=R({prop:"borderRight",themeKey:"borders",transform:Ce}),Jl=R({prop:"borderBottom",themeKey:"borders",transform:Ce}),Ql=R({prop:"borderLeft",themeKey:"borders",transform:Ce}),eu=R({prop:"borderColor",themeKey:"palette"}),tu=R({prop:"borderTopColor",themeKey:"palette"}),ru=R({prop:"borderRightColor",themeKey:"palette"}),nu=R({prop:"borderBottomColor",themeKey:"palette"}),ou=R({prop:"borderLeftColor",themeKey:"palette"}),Ct=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){let e=Ve(t.theme,"shape.borderRadius",4,"borderRadius"),r=n=>({borderRadius:Ee(e,n)});return re(t,t.borderRadius,r)}return null};Ct.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:xe}:{};Ct.filterProps=["borderRadius"];var sy=Le(Hl,Zl,Xl,Jl,Ql,eu,tu,ru,nu,ou,Ct);var St=t=>{if(t.gap!==void 0&&t.gap!==null){let e=Ve(t.theme,"spacing",8,"gap"),r=n=>({gap:Ee(e,n)});return re(t,t.gap,r)}return null};St.propTypes=process.env.NODE_ENV!=="production"?{gap:xe}:{};St.filterProps=["gap"];var Pt=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){let e=Ve(t.theme,"spacing",8,"columnGap"),r=n=>({columnGap:Ee(e,n)});return re(t,t.columnGap,r)}return null};Pt.propTypes=process.env.NODE_ENV!=="production"?{columnGap:xe}:{};Pt.filterProps=["columnGap"];var wt=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){let e=Ve(t.theme,"spacing",8,"rowGap"),r=n=>({rowGap:Ee(e,n)});return re(t,t.rowGap,r)}return null};wt.propTypes=process.env.NODE_ENV!=="production"?{rowGap:xe}:{};wt.filterProps=["rowGap"];var iu=R({prop:"gridColumn"}),su=R({prop:"gridRow"}),au=R({prop:"gridAutoFlow"}),lu=R({prop:"gridAutoColumns"}),uu=R({prop:"gridAutoRows"}),cu=R({prop:"gridTemplateColumns"}),fu=R({prop:"gridTemplateRows"}),pu=R({prop:"gridTemplateAreas"}),du=R({prop:"gridArea"}),dy=Le(St,Pt,wt,iu,su,au,lu,uu,cu,fu,pu,du);function Ue(t,e){return e==="grey"?e:t}var mu=R({prop:"color",themeKey:"palette",transform:Ue}),hu=R({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Ue}),yu=R({prop:"backgroundColor",themeKey:"palette",transform:Ue}),gy=Le(mu,hu,yu);function fe(t){return t<=1&&t!==0?`${t*100}%`:t}var gu=R({prop:"width",transform:fe}),hr=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){let e=r=>{var n,o;let i=((n=t.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||fr[r];return i?((o=t.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${t.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:fe(r)}};return re(t,t.maxWidth,e)}return null};hr.filterProps=["maxWidth"];var xu=R({prop:"minWidth",transform:fe}),bu=R({prop:"height",transform:fe}),vu=R({prop:"maxHeight",transform:fe}),Tu=R({prop:"minHeight",transform:fe}),Cy=R({prop:"size",cssProperty:"width",transform:fe}),Sy=R({prop:"size",cssProperty:"height",transform:fe}),Cu=R({prop:"boxSizing"}),Py=Le(gu,hr,xu,bu,vu,Tu,Cu);var Su={border:{themeKey:"borders",transform:Ce},borderTop:{themeKey:"borders",transform:Ce},borderRight:{themeKey:"borders",transform:Ce},borderBottom:{themeKey:"borders",transform:Ce},borderLeft:{themeKey:"borders",transform:Ce},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ct},color:{themeKey:"palette",transform:Ue},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Ue},backgroundColor:{themeKey:"palette",transform:Ue},p:{style:Z},pt:{style:Z},pr:{style:Z},pb:{style:Z},pl:{style:Z},px:{style:Z},py:{style:Z},padding:{style:Z},paddingTop:{style:Z},paddingRight:{style:Z},paddingBottom:{style:Z},paddingLeft:{style:Z},paddingX:{style:Z},paddingY:{style:Z},paddingInline:{style:Z},paddingInlineStart:{style:Z},paddingInlineEnd:{style:Z},paddingBlock:{style:Z},paddingBlockStart:{style:Z},paddingBlockEnd:{style:Z},m:{style:H},mt:{style:H},mr:{style:H},mb:{style:H},ml:{style:H},mx:{style:H},my:{style:H},margin:{style:H},marginTop:{style:H},marginRight:{style:H},marginBottom:{style:H},marginLeft:{style:H},marginX:{style:H},marginY:{style:H},marginInline:{style:H},marginInlineStart:{style:H},marginInlineEnd:{style:H},marginBlock:{style:H},marginBlockStart:{style:H},marginBlockEnd:{style:H},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:St},rowGap:{style:wt},columnGap:{style:Pt},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:fe},maxWidth:{style:hr},minWidth:{transform:fe},height:{transform:fe},maxHeight:{transform:fe},minHeight:{transform:fe},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},ot=Su;function Pu(...t){let e=t.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(e);return t.every(n=>r.size===Object.keys(n).length)}function wu(t,e){return typeof t=="function"?t(e):t}function Eu(){function t(r,n,o,i){let s={[r]:n,theme:o},l=i[r];if(!l)return{[r]:n};let{cssProperty:a=r,themeKey:u,transform:d,style:c}=l;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};let p=nt(o,u)||{};return c?c(s):re(s,n,y=>{let w=vt(p,d,y);return y===w&&typeof y=="string"&&(w=vt(p,d,`${r}${y==="default"?"":de(y)}`,y)),a===!1?w:{[a]:w}})}function e(r){var n;let{sx:o,theme:i={}}=r||{};if(!o)return null;let s=(n=i.unstable_sxConfig)!=null?n:ot;function l(a){let u=a;if(typeof a=="function")u=a(i);else if(typeof a!="object")return a;if(!u)return null;let d=On(i.breakpoints),c=Object.keys(d),p=d;return Object.keys(u).forEach(m=>{let y=wu(u[m],i);if(y!=null)if(typeof y=="object")if(s[m])p=Ie(p,t(m,y,i,s));else{let w=re({theme:i},y,j=>({[m]:j}));Pu(w,y)?p[m]=e({sx:y,theme:i}):p=Ie(p,w)}else p=Ie(p,t(m,y,i,s))}),Fn(c,p)}return Array.isArray(o)?o.map(l):l(o)}return e}var bi=Eu();bi.filterProps=["sx"];var Et=bi;var _u=["breakpoints","palette","spacing","shape"];function Ou(t={},...e){let{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=t,s=me(t,_u),l=_n(r),a=Dn(o),u=ue({breakpoints:l,direction:"ltr",components:{},palette:$({mode:"light"},n),spacing:a,shape:$({},mi,i)},s);return u=e.reduce((d,c)=>ue(d,c),u),u.unstable_sxConfig=$({},ot,s==null?void 0:s.unstable_sxConfig),u.unstable_sx=function(c){return Et({sx:c,theme:this})},u}var qe=Ou;function Fu(t){return Object.keys(t).length===0}function ku(t=null){let e=vi.useContext(_react2.ThemeContext);return!e||Fu(e)?t:e}var Ti=ku;var Mu=qe();function Au(t=Mu){return Ti(t)}var Ci=Au;var Du=["sx"],Ru=t=>{var e,r;let n={systemProps:{},otherProps:{}},o=(e=t==null||(r=t.theme)==null?void 0:r.unstable_sxConfig)!=null?e:ot;return Object.keys(t).forEach(i=>{o[i]?n.systemProps[i]=t[i]:n.otherProps[i]=t[i]}),n};function yr(t){let{sx:e}=t,r=me(t,Du),{systemProps:n,otherProps:o}=Ru(r),i;return Array.isArray(e)?i=[n,...e]:typeof e=="function"?i=(...s)=>{let l=e(...s);return ye(l)?$({},n,l):n}:i=$({},n,e),$({},o,{sx:i})}function Si(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=Si(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function $u(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=Si(t))&&(n&&(n+=" "),n+=e);return n}var Pi=$u;var Bu=["variant"];function wi(t){return t.length===0}function gr(t){let{variant:e}=t,r=me(t,Bu),n=e||"";return Object.keys(r).sort().forEach(o=>{o==="color"?n+=wi(n)?t[o]:de(t[o]):n+=`${wi(n)?o:de(o)}${de(t[o].toString())}`}),n}var Iu=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Lu(t){return Object.keys(t).length===0}function ju(t){return typeof t=="string"&&t.charCodeAt(0)>96}var Nu=(t,e)=>e.components&&e.components[t]&&e.components[t].styleOverrides?e.components[t].styleOverrides:null,br=t=>{let e={};return t&&t.forEach(r=>{let n=gr(r.props);e[n]=r.style}),e},zu=(t,e)=>{let r=[];return e&&e.components&&e.components[t]&&e.components[t].variants&&(r=e.components[t].variants),br(r)},vr=(t,e,r)=>{let{ownerState:n={}}=t,o=[];return r&&r.forEach(i=>{let s=!0;Object.keys(i.props).forEach(l=>{n[l]!==i.props[l]&&t[l]!==i.props[l]&&(s=!1)}),s&&o.push(e[gr(i.props)])}),o},Vu=(t,e,r,n)=>{var o;let i=r==null||(o=r.components)==null||(o=o[n])==null?void 0:o.variants;return vr(t,e,i)};function Rn(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}var Uu=qe(),Ei=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function xr({defaultTheme:t,theme:e,themeId:r}){return Lu(e)?t:e[r]||e}function qu(t){return t?(e,r)=>r[t]:null}var _i=({styledArg:t,props:e,defaultTheme:r,themeId:n})=>{let o=t($({},e,{theme:xr($({},e,{defaultTheme:r,themeId:n}))})),i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){let s=vr(e,br(i),i);return[o,...s]}return o};function $n(t={}){let{themeId:e,defaultTheme:r=Uu,rootShouldForwardProp:n=Rn,slotShouldForwardProp:o=Rn}=t,i=s=>Et($({},s,{theme:xr($({},s,{defaultTheme:r,themeId:e}))}));return i.__mui_systemSx=!0,(s,l={})=>{pi(s,P=>P.filter(B=>!(B!=null&&B.__mui_systemSx)));let{name:a,slot:u,skipVariantsResolver:d,skipSx:c,overridesResolver:p=qu(Ei(u))}=l,m=me(l,Iu),y=d!==void 0?d:u&&u!=="Root"&&u!=="root"||!1,w=c||!1,j;process.env.NODE_ENV!=="production"&&a&&(j=`${a}-${Ei(u||"Root")}`);let W=Rn;u==="Root"||u==="root"?W=n:u?W=o:ju(s)&&(W=void 0);let k=En(s,$({shouldForwardProp:W,label:j},m)),ne=(P,...B)=>{let Q=B?B.map(C=>{if(typeof C=="function"&&C.__emotion_real!==C)return E=>_i({styledArg:C,props:E,defaultTheme:r,themeId:e});if(ye(C)){let E=C,_;return C&&C.variants&&(_=C.variants,delete E.variants,E=f=>{let h=C;return vr(f,br(_),_).forEach(T=>{h=ue(h,T)}),h}),E}return C}):[],J=P;if(ye(P)){let C;P&&P.variants&&(C=P.variants,delete J.variants,J=E=>{let _=P;return vr(E,br(C),C).forEach(h=>{_=ue(_,h)}),_})}else typeof P=="function"&&P.__emotion_real!==P&&(J=C=>_i({styledArg:P,props:C,defaultTheme:r,themeId:e}));a&&p&&Q.push(C=>{let E=xr($({},C,{defaultTheme:r,themeId:e})),_=Nu(a,E);if(_){let f={};return Object.entries(_).forEach(([h,v])=>{f[h]=typeof v=="function"?v($({},C,{theme:E})):v}),p(C,f)}return null}),a&&!y&&Q.push(C=>{let E=xr($({},C,{defaultTheme:r,themeId:e}));return Vu(C,zu(a,E),E,a)}),w||Q.push(i);let Te=Q.length-B.length;if(Array.isArray(P)&&Te>0){let C=new Array(Te).fill("");J=[...P,...C],J.raw=[...P.raw,...C]}let G=k(J,...Q);if(process.env.NODE_ENV!=="production"){let C;a&&(C=`${a}${de(u||"")}`),C===void 0&&(C=`Styled(${cr(s)})`),G.displayName=C}return s.muiName&&(G.muiName=s.muiName),G};return k.withConfig&&(ne.withConfig=k.withConfig),ne}}var Wu=$n(),Oi=Wu;function Bn(t){let{theme:e,name:r,props:n}=t;return!e||!e.components||!e.components[r]||!e.components[r].defaultProps?n:gt(e.components[r].defaultProps,n)}function Tr({props:t,name:e,defaultTheme:r,themeId:n}){let o=Ci(r);return n&&(o=o[n]||o),Bn({theme:o,name:e,props:t})}var Y=Ne(Jt());var K=Ne(Jt());var Yu=["component","direction","spacing","divider","children","className","useFlexGap"],Gu=qe(),Hu=Oi("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function Zu(t){return Tr({props:t,name:"MuiStack",defaultTheme:Gu})}function Xu(t,e){let r=it.Children.toArray(t).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i<r.length-1&&n.push(it.cloneElement(e,{key:`separator-${i}`})),n),[])}var Ju=t=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],Qu=({ownerState:t,theme:e})=>{let r=$({display:"flex",flexDirection:"column"},re({theme:e},pr({values:t.direction,breakpoints:e.breakpoints.values}),n=>({flexDirection:n})));if(t.spacing){let n=Tt(e),o=Object.keys(e.breakpoints.values).reduce((a,u)=>((typeof t.spacing=="object"&&t.spacing[u]!=null||typeof t.direction=="object"&&t.direction[u]!=null)&&(a[u]=!0),a),{}),i=pr({values:t.direction,base:o}),s=pr({values:t.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((a,u,d)=>{if(!i[a]){let p=u>0?i[d[u-1]]:"column";i[a]=p}}),r=ue(r,re({theme:e},s,(a,u)=>t.useFlexGap?{gap:Ee(n,a)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Ju(u?i[u]:t.direction)}`]:Ee(n,a)}}))}return r=yi(e.breakpoints,r),r};function In(t={}){let{createStyledComponent:e=Hu,useThemeProps:r=Zu,componentName:n="MuiStack"}=t,o=()=>xt({root:["root"]},a=>bt(n,a),{}),i=e(Qu),s=it.forwardRef(function(a,u){let d=r(a),c=yr(d),{component:p="div",direction:m="column",spacing:y=0,divider:w,children:j,className:W,useFlexGap:k=!1}=c,ne=me(c,Yu),P={direction:m,spacing:y,useFlexGap:k},B=o();return _jsxruntime.jsx.call(void 0, i,$({as:p,ownerState:P,ref:u,className:Pi(B.root,W)},ne,{children:w?Xu(j,w):j}))});return process.env.NODE_ENV!=="production"&&(s.propTypes={children:K.default.node,direction:K.default.oneOfType([K.default.oneOf(["column-reverse","column","row-reverse","row"]),K.default.arrayOf(K.default.oneOf(["column-reverse","column","row-reverse","row"])),K.default.object]),divider:K.default.node,spacing:K.default.oneOfType([K.default.arrayOf(K.default.oneOfType([K.default.number,K.default.string])),K.default.number,K.default.object,K.default.string]),sx:K.default.oneOfType([K.default.arrayOf(K.default.oneOfType([K.default.func,K.default.object,K.default.bool])),K.default.func,K.default.object])}),s}var Fi=In();process.env.NODE_ENV!=="production"&&(Fi.propTypes={children:Y.default.node,component:Y.default.elementType,direction:Y.default.oneOfType([Y.default.oneOf(["column-reverse","column","row-reverse","row"]),Y.default.arrayOf(Y.default.oneOf(["column-reverse","column","row-reverse","row"])),Y.default.object]),divider:Y.default.node,spacing:Y.default.oneOfType([Y.default.arrayOf(Y.default.oneOfType([Y.default.number,Y.default.string])),Y.default.number,Y.default.object,Y.default.string]),sx:Y.default.oneOfType([Y.default.arrayOf(Y.default.oneOfType([Y.default.func,Y.default.object,Y.default.bool])),Y.default.func,Y.default.object]),useFlexGap:Y.default.bool});var Cr=Fi;var nc=_styled2.default.call(void 0, (0, _material.Typography))(({theme:t})=>({fontWeight:"bold"}));function Ai(t){let{label:e,children:r,labelProps:n,contentProps:o,isNumber:i,showDivider:s}=t;return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",gap:4},children:[_jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsx.call(void 0, Cr,{children:_jsxruntime.jsx.call(void 0, nc,q(b({},n),{children:e}))}),_jsxruntime.jsx.call(void 0, Cr,{direction:i?"row":"column",justifyContent:i?"flex-end":"center",children:r})]}),s&&_jsxruntime.jsx.call(void 0, _material.Divider,{orientation:"vertical",flexItem:!0})]})}function Bi(t){let{title:e,children:r,onBack:n,onClose:o}=t,i=_material.useMediaQuery.call(void 0, s=>s.breakpoints.down("sm"));return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",flexDirection:i||o?"column":"row",justifyContent:"space-between",alignItems:i?"center":"flex-end",gap:2,marginBottom:2},children:[_jsxruntime.jsxs.call(void 0, _material.Stack,{width:"100%",direction:"row",sx:{alignItems:"center"},children:[n&&_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{mr:1},onClick:n,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.ArrowBack,{})}),_jsxruntime.jsx.call(void 0, _material.Typography,{component:"h1",variant:"h4",sx:{fontWeight:"500"},children:e}),o&&_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{marginLeft:"auto"},onClick:o,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Close,{fontSize:"medium"})})]}),_jsxruntime.jsx.call(void 0, _material.Box,{children:r})]})}var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash);function Pr(t){let i=t,{onSearch:e}=i,r=X(i,["onSearch"]),n=_lodash2.default.debounce(s=>e(s),500);function o(s){let l=s.target.value;n(l)}return _jsxruntime.jsx.call(void 0, _material.TextField,b({onChange:o,autoFocus:!0,InputProps:{startAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Search,{})})}},r))}function zn(t){let E=t,{value:e,label:r,options:n,isLoading:o,form:i,table:s,tableProps:l,onChange:a,onSearch:u,renderValue:d,dialogProps:c,disabled:p,filterOptions:m,optionKeyName:y}=E,w=X(E,["value","label","options","isLoading","form","table","tableProps","onChange","onSearch","renderValue","dialogProps","disabled","filterOptions","optionKeyName"]),{isOpen:j,openDialog:W,closeDialog:k}=_hooks.useDialog.call(void 0, ),[ne,P]=_react.useState.call(void 0, null),B=i||vi.default.Fragment,Q=_lodash2.default.debounce(_=>u(_),500),J=_react.useCallback.call(void 0, (_,f)=>he(this,null,function*(){Q(f)}),[Q]),Te=_react.useCallback.call(void 0, (_,f,h)=>{if(y&&(f!=null&&f[y].includes("Adicionar op\xE7\xE3o:"))){let v=f[y].replace("Adicionar op\xE7\xE3o:","").trim().replace(/["']/g,""),T=q(b({},f),{[y]:v});a&&a(T);return}a&&a(f)},[a]);function G(_,f=!1,h=!1){var v;if(_){let T=vi.default.Children.toArray((v=_.props)==null?void 0:v.children),S=T.length===1?0:1;return T.splice(S,0,_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{padding:"2px"},size:"small",color:"default",onClick:()=>W(),disabled:h,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.SearchOutlined,{fontSize:"small"})})),f&&T.unshift(_jsxruntime.jsx.call(void 0, _material.IconButton,{disabled:!0,children:_jsxruntime.jsx.call(void 0, _material.CircularProgress,{color:"primary",size:18})})),vi.default.cloneElement(_,{},T)}return _}function C(_,f){if(!y)return _;let v=_material.createFilterOptions.call(void 0, )(_,f),{inputValue:T}=f,S=_.some(M=>T===M[y]);return T!==""&&!S&&v.push({[y]:`Adicionar op\xE7\xE3o: "${T}"`}),v}return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _material.Autocomplete,{disabled:p,loadingText:"Carregando...",loading:o,onChange:Te,value:e,onInputChange:J,options:n,getOptionLabel:d,filterOptions:C,renderInput:_=>_jsxruntime.jsx.call(void 0, _material.TextField,b(q(b({label:r,onDoubleClick:()=>{p||W()}},_),{InputProps:q(b({},_.InputProps),{endAdornment:G(_.InputProps.endAdornment,o,p)}),disabled:p}),w)),clearIcon:_jsxruntime.jsx.call(void 0, _iconsmaterial.BackspaceOutlined,{}),componentsProps:{clearIndicator:{sx:{visibility:"visible"}}},noOptionsText:"Nenhum registro"}),_jsxruntime.jsx.call(void 0, _providers.FormProvider,{children:_jsxruntime.jsx.call(void 0, Fe,q(b({open:j,onClose:()=>k(),actions:"none"},c),{children:_jsxruntime.jsxs.call(void 0, _material.Stack,{spacing:1,children:[_jsxruntime.jsxs.call(void 0, _material.Stack,{direction:"row",justifyContent:"flex-end",alignItems:"center",spacing:1,children:[_jsxruntime.jsx.call(void 0, Pr,{placeholder:"Pesquisar",onSearch:_=>P(_)}),i&&_jsxruntime.jsx.call(void 0, B,{})]}),_jsxruntime.jsx.call(void 0, s,b({query:ne,enableTransporter:!0,onTransport:_=>{k(),a&&a(_)}},l))]})}))})]})}var Sc={dialogProps:{maxWidth:"md",fullWidth:!0}};zn.defaultProps=Sc;function Vn(t){let{label:e}=t;return _jsxruntime.jsx.call(void 0, _material.Stack,{component:"header",sx:{alignItems:"center",gap:1},children:_jsxruntime.jsx.call(void 0, _material.Typography,{component:"h1",variant:"h3",sx:{fontWeight:"medium",color:r=>r.palette.grey[600]},children:e})})}var ve=Ne(Yi()),_t=Ne(Hi()),ts=Ne(Xi()),qc=Object.prototype.toString,Wc=Error.prototype.toString,Yc=RegExp.prototype.toString,Kc=typeof Symbol!="undefined"?Symbol.prototype.toString:()=>"",Gc=/^Symbol\((.*)\)(.*)$/;function Hc(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function Ji(t,e=!1){if(t==null||t===!0||t===!1)return""+t;let r=typeof t;if(r==="number")return Hc(t);if(r==="string")return e?`"${t}"`:t;if(r==="function")return"[Function "+(t.name||"anonymous")+"]";if(r==="symbol")return Kc.call(t).replace(Gc,"Symbol($1)");let n=qc.call(t).slice(8,-1);return n==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):n==="Error"||t instanceof Error?"["+Wc.call(t)+"]":n==="RegExp"?Yc.call(t):null}function Ae(t,e){let r=Ji(t,e);return r!==null?r:JSON.stringify(t,function(n,o){let i=Ji(this[n],e);return i!==null?i:o},2)}function rs(t){return t==null?[]:[].concat(t)}var ns,Zc=/\$\{\s*(\w+)\s*\}/g;ns=Symbol.toStringTag;var ae=class extends Error{static formatError(e,r){let n=r.label||r.path||"this";return n!==r.path&&(r=Object.assign({},r,{path:n})),typeof e=="string"?e.replace(Zc,(o,i)=>Ae(r[i])):typeof e=="function"?e(r):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,r,n,o,i){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this[ns]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=o,this.errors=[],this.inner=[],rs(e).forEach(s=>{if(ae.isError(s)){this.errors.push(...s.errors);let l=s.inner.length?s.inner:[s];this.inner.push(...l)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],!i&&Error.captureStackTrace&&Error.captureStackTrace(this,ae)}},_e={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:t,type:e,value:r,originalValue:n})=>{let o=n!=null&&n!==r?` (cast from the value \`${Ae(n,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Ae(r,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${Ae(r,!0)}\``+o}},Se={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",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},je={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"},Hn={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Zn={isValue:"${path} field must be ${value}"},Xn={noUnknown:"${path} field has unspecified keys: ${unknown}"},Or={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"},os={notType:t=>{let{path:e,value:r,spec:n}=t,o=n.types.length;if(Array.isArray(r)){if(r.length<o)return`${e} tuple value has too few items, expected a length of ${o} but got ${r.length} for value: \`${Ae(r,!0)}\``;if(r.length>o)return`${e} tuple value has too many items, expected a length of ${o} but got ${r.length} for value: \`${Ae(r,!0)}\``}return ae.formatError(_e.notType,t)}},qx=Object.assign(Object.create(null),{mixed:_e,string:Se,number:je,date:Hn,object:Xn,array:Or,boolean:Zn,tuple:os}),Ir=t=>t&&t.__isYupSchema__,ut=class{static fromOptions(e,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:o,otherwise:i}=r,s=typeof n=="function"?n:(...l)=>l.every(a=>a===n);return new ut(e,(l,a)=>{var u;let d=s(...l)?o:i;return(u=d==null?void 0:d(a))!=null?u:a})}constructor(e,r){this.fn=void 0,this.refs=e,this.refs=e,this.fn=r}resolve(e,r){let n=this.refs.map(i=>i.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),o=this.fn(n,e,r);if(o===void 0||o===e)return e;if(!Ir(o))throw new TypeError("conditions must return a schema object");return o.resolve(r)}},_r={context:"$",value:"."};var De=class{constructor(e,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===_r.context,this.isValue=this.key[0]===_r.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?_r.context:this.isValue?_r.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&(0,ve.getter)(this.path,!0),this.map=r.map}getValue(e,r,n){let o=this.isContext?n:this.isValue?e:r;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(e,r){return this.getValue(e,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};De.prototype.__isYupRef=!0;var Pe=t=>t==null;function at(t){function e({value:r,path:n="",options:o,originalValue:i,schema:s},l,a){let{name:u,test:d,params:c,message:p,skipAbsent:m}=t,{parent:y,context:w,abortEarly:j=s.spec.abortEarly,disableStackTrace:W=s.spec.disableStackTrace}=o;function k(E){return De.isRef(E)?E.getValue(r,y,w):E}function ne(E={}){var _;let f=Object.assign({value:r,originalValue:i,label:s.spec.label,path:E.path||n,spec:s.spec},c,E.params);for(let v of Object.keys(f))f[v]=k(f[v]);let h=new ae(ae.formatError(E.message||p,f),r,f.path,E.type||u,(_=E.disableStackTrace)!=null?_:W);return h.params=f,h}let P=j?l:a,B={path:n,parent:y,type:u,from:o.from,createError:ne,resolve:k,options:o,originalValue:i,schema:s},Q=E=>{ae.isError(E)?P(E):E?a(null):P(ne())},J=E=>{ae.isError(E)?P(E):l(E)};if(m&&Pe(r))return Q(!0);let G;try{var C;if(G=d.call(B,r,B),typeof((C=G)==null?void 0:C.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${B.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(G).then(Q,J)}}catch(E){J(E);return}Q(G)}return e.OPTIONS=t,e}function Xc(t,e,r,n=r){let o,i,s;return e?((0,ve.forEach)(e,(l,a,u)=>{let d=a?l.slice(1,l.length-1):l;t=t.resolve({context:n,parent:o,value:r});let c=t.type==="tuple",p=u?parseInt(d,10):0;if(t.innerType||c){if(c&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&p>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);o=r,r=r&&r[p],t=c?t.spec.types[p]:t.innerType}if(!u){if(!t.fields||!t.fields[d])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${s} which is a type: "${t.type}")`);o=r,r=r&&r[d],t=t.fields[d]}i=d,s=a?"["+l+"]":"."+l}),{schema:t,parent:o,parentPath:i}):{parent:o,parentPath:e,schema:t}}var ct=class extends Set{describe(){let e=[];for(let r of this.values())e.push(De.isRef(r)?r.describe():r);return e}resolveAll(e){let r=[];for(let n of this.values())r.push(e(n));return r}clone(){return new ct(this.values())}merge(e,r){let n=this.clone();return e.forEach(o=>n.add(o)),r.forEach(o=>n.delete(o)),n}};function lt(t,e=new Map){if(Ir(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let r;if(t instanceof Date)r=new Date(t.getTime()),e.set(t,r);else if(t instanceof RegExp)r=new RegExp(t),e.set(t,r);else if(Array.isArray(t)){r=new Array(t.length),e.set(t,r);for(let n=0;n<t.length;n++)r[n]=lt(t[n],e)}else if(t instanceof Map){r=new Map,e.set(t,r);for(let[n,o]of t.entries())r.set(n,lt(o,e))}else if(t instanceof Set){r=new Set,e.set(t,r);for(let n of t)r.add(lt(n,e))}else if(t instanceof Object){r={},e.set(t,r);for(let[n,o]of Object.entries(t))r[n]=lt(o,e)}else throw Error(`Unable to clone ${t}`);return r}var oe=class{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ct,this._blacklist=new ct,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(_e.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=lt(Object.assign({},this.spec,e)),r}label(e){let r=this.clone();return r.spec.label=e,r}meta(...e){if(e.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},e[0]),r}withMutation(e){let r=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=r,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let r=this,n=e.clone(),o=Object.assign({},r.spec,n.spec);return n.spec=o,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=r._blacklist.merge(e._blacklist,e._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(i=>{e.tests.forEach(s=>{i.test(s.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((o,i)=>i.resolve(o,e),r),r=r.resolve(e)}return r}resolveOptions(e){var r,n,o,i;return Object.assign({},e,{from:e.from||[],strict:(r=e.strict)!=null?r:this.spec.strict,abortEarly:(n=e.abortEarly)!=null?n:this.spec.abortEarly,recursive:(o=e.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,r={}){let n=this.resolve(Object.assign({value:e},r)),o=r.assert==="ignore-optionality",i=n._cast(e,r);if(r.assert!==!1&&!n.isType(i)){if(o&&Pe(i))return i;let s=Ae(e),l=Ae(i);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
7
7
 
8
8
  attempted value: ${s}
9
9
  `+(l!==s?`result of cast: ${l}`:""))}return i}_cast(e,r){let n=e===void 0?e:this.transforms.reduce((o,i)=>i.call(this,o,e,this),e);return n===void 0&&(n=this.getDefault(r)),n}_validate(e,r={},n,o){let{path:i,originalValue:s=e,strict:l=this.spec.strict}=r,a=e;l||(a=this._cast(a,Object.assign({assert:!1},r)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:i,value:a,originalValue:s,options:r,tests:u},n,d=>{if(d.length)return o(d,a);this.runTests({path:i,value:a,originalValue:s,options:r,tests:this.tests},n,o)})}runTests(e,r,n){let o=!1,{tests:i,value:s,originalValue:l,path:a,options:u}=e,d=w=>{o||(o=!0,r(w,s))},c=w=>{o||(o=!0,n(w,s))},p=i.length,m=[];if(!p)return c([]);let y={value:s,originalValue:l,path:a,options:u,schema:this};for(let w=0;w<i.length;w++){let j=i[w];j(y,d,function(k){k&&(Array.isArray(k)?m.push(...k):m.push(k)),--p<=0&&c(m)})}}asNestedTest({key:e,index:r,parent:n,parentPath:o,originalParent:i,options:s}){let l=e!=null?e:r;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");let a=typeof l=="number",u=n[l],d=Object.assign({},s,{strict:!0,parent:n,value:u,originalValue:i[l],key:void 0,[a?"index":"key"]:l,path:a||l.includes(".")?`${o||""}[${u?l:`"${l}"`}]`:(o?`${o}.`:"")+e});return(c,p,m)=>this.resolve(d)._validate(u,d,p,m)}validate(e,r){var n;let o=this.resolve(Object.assign({},r,{value:e})),i=(n=r==null?void 0:r.disableStackTrace)!=null?n:o.spec.disableStackTrace;return new Promise((s,l)=>o._validate(e,r,(a,u)=>{ae.isError(a)&&(a.value=u),l(a)},(a,u)=>{a.length?l(new ae(a,u,void 0,void 0,i)):s(u)}))}validateSync(e,r){var n;let o=this.resolve(Object.assign({},r,{value:e})),i,s=(n=r==null?void 0:r.disableStackTrace)!=null?n:o.spec.disableStackTrace;return o._validate(e,Object.assign({},r,{sync:!0}),(l,a)=>{throw ae.isError(l)&&(l.value=a),l},(l,a)=>{if(l.length)throw new ae(l,e,void 0,void 0,s);i=a}),i}isValid(e,r){return this.validate(e,r).then(()=>!0,n=>{if(ae.isError(n))return!1;throw n})}isValidSync(e,r){try{return this.validateSync(e,r),!0}catch(n){if(ae.isError(n))return!1;throw n}}_getDefault(e){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,e):lt(r)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,r){let n=this.clone({nullable:e});return n.internalTests.nullable=at({message:r,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),n}optionality(e,r){let n=this.clone({optional:e});return n.internalTests.optionality=at({message:r,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(e=_e.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=_e.notNull){return this.nullability(!1,e)}required(e=_e.required){return this.clone().withMutation(r=>r.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let r=this.clone();return r.transforms.push(e),r}test(...e){let r;if(e.length===1?typeof e[0]=="function"?r={test:e[0]}:r=e[0]:e.length===2?r={name:e[0],test:e[1]}:r={name:e[0],message:e[1],test:e[2]},r.message===void 0&&(r.message=_e.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),o=at(r),i=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(s=>!(s.OPTIONS.name===r.name&&(i||s.OPTIONS.test===o.OPTIONS.test))),n.tests.push(o),n}when(e,r){!Array.isArray(e)&&typeof e!="string"&&(r=e,e=".");let n=this.clone(),o=rs(e).map(i=>new De(i));return o.forEach(i=>{i.isSibling&&n.deps.push(i.key)}),n.conditions.push(typeof r=="function"?new ut(o,r):ut.fromOptions(o,r)),n}typeError(e){let r=this.clone();return r.internalTests.typeError=at({message:e,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(e,r=_e.oneOf){let n=this.clone();return e.forEach(o=>{n._whitelist.add(o),n._blacklist.delete(o)}),n.internalTests.whiteList=at({message:r,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),n}notOneOf(e,r=_e.notOneOf){let n=this.clone();return e.forEach(o=>{n._blacklist.add(o),n._whitelist.delete(o)}),n.internalTests.blacklist=at({message:r,name:"notOneOf",test(o){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!0}}),n}strip(e=!0){let r=this.clone();return r.spec.strip=e,r}describe(e){let r=(e?this.resolve(e):this).clone(),{label:n,meta:o,optional:i,nullable:s}=r.spec;return{meta:o,label:n,optional:i,nullable:s,default:r.getDefault(e),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(a=>({name:a.OPTIONS.name,params:a.OPTIONS.params})).filter((a,u,d)=>d.findIndex(c=>c.name===a.name)===u)}}};oe.prototype.__isYupSchema__=!0;for(let t of["validate","validateSync"])oe.prototype[`${t}At`]=function(e,r,n={}){let{parent:o,parentPath:i,schema:s}=Xc(this,e,r,n.context);return s[t](o&&o[i],Object.assign({},n,{parent:o,path:e}))};for(let t of["equals","is"])oe.prototype[t]=oe.prototype.oneOf;for(let t of["not","nope"])oe.prototype[t]=oe.prototype.notOneOf;var Jc=()=>!0;function Qc(t){return new kr(t)}var kr=class extends oe{constructor(e){super(typeof e=="function"?{type:"mixed",check:e}:Object.assign({type:"mixed",check:Jc},e))}};Qc.prototype=kr.prototype;function ef(){return new Mr}var Mr=class extends oe{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(n.spec.coerce&&!n.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=Zn.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return Pe(r)||r===!0}})}isFalse(e=Zn.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return Pe(r)||r===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}};ef.prototype=Mr.prototype;var tf=/^[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])?)*$/,rf=/^((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,nf=/^(?:[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,of=t=>Pe(t)||t===t.trim(),sf={}.toString();function ft(){return new Ar}var Ar=class extends oe{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(!n.spec.coerce||n.isType(e)||Array.isArray(e))return e;let o=e!=null&&e.toString?e.toString():e;return o===sf?e:o})})}required(e){return super.required(e).withMutation(r=>r.test({message:e||_e.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(r=>r.OPTIONS.name!=="required"),e))}length(e,r=Se.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,r=Se.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,r=Se.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}matches(e,r){let n=!1,o,i;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:o,name:i}=r:o=r),this.test({name:i||"matches",message:o||Se.matches,params:{regex:e},skipAbsent:!0,test:s=>s===""&&n||s.search(e)!==-1})}email(e=Se.email){return this.matches(tf,{name:"email",message:e,excludeEmptyString:!0})}url(e=Se.url){return this.matches(rf,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Se.uuid){return this.matches(nf,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=Se.trim){return this.transform(r=>r!=null?r.trim():r).test({message:e,name:"trim",test:of})}lowercase(e=Se.lowercase){return this.transform(r=>Pe(r)?r:r.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>Pe(r)||r===r.toLowerCase()})}uppercase(e=Se.uppercase){return this.transform(r=>Pe(r)?r:r.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>Pe(r)||r===r.toUpperCase()})}};ft.prototype=Ar.prototype;var af=t=>t!=+t;function lf(){return new Dr}var Dr=class extends oe{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!af(e)}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(!n.spec.coerce)return e;let o=e;if(typeof o=="string"){if(o=o.replace(/\s/g,""),o==="")return NaN;o=+o}return n.isType(o)||o===null?o:parseFloat(o)})})}min(e,r=je.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n>=this.resolve(e)}})}max(e,r=je.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n<=this.resolve(e)}})}lessThan(e,r=je.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(n){return n<this.resolve(e)}})}moreThan(e,r=je.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(n){return n>this.resolve(e)}})}positive(e=je.positive){return this.moreThan(0,e)}negative(e=je.negative){return this.lessThan(0,e)}integer(e=je.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(e=>Pe(e)?e:e|0)}round(e){var r;let n=["ceil","floor","round","trunc"];if(e=((r=e)==null?void 0:r.toLowerCase())||"round",e==="trunc")return this.truncate();if(n.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(o=>Pe(o)?o:Math[e](o))}};lf.prototype=Dr.prototype;var uf=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Me(t,e=0){return Number(t)||e}function cf(t){let e=uf.exec(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;let r={year:Me(e[1]),month:Me(e[2],1)-1,day:Me(e[3],1),hour:Me(e[4]),minute:Me(e[5]),second:Me(e[6]),millisecond:e[7]?Me(e[7].substring(0,3)):0,z:e[8]||void 0,plusMinus:e[9]||void 0,hourOffset:Me(e[10]),minuteOffset:Me(e[11])};if(r.z===void 0&&r.plusMinus===void 0)return new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond).valueOf();let n=0;return r.z!=="Z"&&r.plusMinus!==void 0&&(n=r.hourOffset*60+r.minuteOffset,r.plusMinus==="+"&&(n=0-n)),Date.UTC(r.year,r.month,r.day,r.hour,r.minute+n,r.second,r.millisecond)}var is=new Date(""),ff=t=>Object.prototype.toString.call(t)==="[object Date]";function ss(){return new Ye}var Ye=class extends oe{constructor(){super({type:"date",check(e){return ff(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,r,n)=>!n.spec.coerce||n.isType(e)||e===null?e:(e=cf(e),isNaN(e)?Ye.INVALID_DATE:new Date(e)))})}prepareParam(e,r){let n;if(De.isRef(e))n=e;else{let o=this.cast(e);if(!this._typeCheck(o))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=o}return n}min(e,r=Hn.min){let n=this.prepareParam(e,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(o){return o>=this.resolve(n)}})}max(e,r=Hn.max){let n=this.prepareParam(e,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(o){return o<=this.resolve(n)}})}};Ye.INVALID_DATE=is;ss.prototype=Ye.prototype;ss.INVALID_DATE=is;function pf(t,e=[]){let r=[],n=new Set,o=new Set(e.map(([s,l])=>`${s}-${l}`));function i(s,l){let a=(0,ve.split)(s)[0];n.add(a),o.has(`${l}-${a}`)||r.push([l,a])}for(let s of Object.keys(t)){let l=t[s];n.add(s),De.isRef(l)&&l.isSibling?i(l.path,s):Ir(l)&&"deps"in l&&l.deps.forEach(a=>i(a,s))}return ts.default.array(Array.from(n),r).reverse()}function Qi(t,e){let r=1/0;return t.some((n,o)=>{var i;if((i=e.path)!=null&&i.includes(n))return r=o,!0}),r}function as(t){return(e,r)=>Qi(t,e)-Qi(t,r)}var ls=(t,e,r)=>{if(typeof t!="string")return t;let n=t;try{n=JSON.parse(t)}catch(o){}return r.isType(n)?n:t};function Fr(t){if("fields"in t){let e={};for(let[r,n]of Object.entries(t.fields))e[r]=Fr(n);return t.setFields(e)}if(t.type==="array"){let e=t.optional();return e.innerType&&(e.innerType=Fr(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(Fr)}):"optional"in t?t.optional():t}var df=(t,e)=>{let r=[...(0,ve.normalizePath)(e)];if(r.length===1)return r[0]in t;let n=r.pop(),o=(0,ve.getter)((0,ve.join)(r),!0)(t);return!!(o&&n in o)},es=t=>Object.prototype.toString.call(t)==="[object Object]";function mf(t,e){let r=Object.keys(t.fields);return Object.keys(e).filter(n=>r.indexOf(n)===-1)}var hf=as([]);function Ot(t){return new Rr(t)}var Rr=class extends oe{constructor(e){super({type:"object",check(r){return es(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=hf,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,r={}){var n;let o=super._cast(e,r);if(o===void 0)return this.getDefault(r);if(!this._typeCheck(o))return o;let i=this.fields,s=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(o).filter(c=>!this._nodes.includes(c))),a={},u=Object.assign({},r,{parent:a,__validating:r.__validating||!1}),d=!1;for(let c of l){let p=i[c],m=c in o;if(p){let y,w=o[c];u.path=(r.path?`${r.path}.`:"")+c,p=p.resolve({value:w,context:r.context,parent:a});let j=p instanceof oe?p.spec:void 0,W=j==null?void 0:j.strict;if(j!=null&&j.strip){d=d||c in o;continue}y=!r.__validating||!W?p.cast(o[c],u):o[c],y!==void 0&&(a[c]=y)}else m&&!s&&(a[c]=o[c]);(m!==c in a||a[c]!==o[c])&&(d=!0)}return d?a:o}_validate(e,r={},n,o){let{from:i=[],originalValue:s=e,recursive:l=this.spec.recursive}=r;r.from=[{schema:this,value:s},...i],r.__validating=!0,r.originalValue=s,super._validate(e,r,n,(a,u)=>{if(!l||!es(u)){o(a,u);return}s=s||u;let d=[];for(let c of this._nodes){let p=this.fields[c];!p||De.isRef(p)||d.push(p.asNestedTest({options:r,key:c,parent:u,parentPath:r.path,originalParent:s}))}this.runTests({tests:d,value:u,originalValue:s,options:r},n,c=>{o(c.sort(this._sortErrors).concat(a),u)})})}clone(e){let r=super.clone(e);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(e){let r=super.concat(e),n=r.fields;for(let[o,i]of Object.entries(this.fields)){let s=n[o];n[o]=s===void 0?i:s}return r.withMutation(o=>o.setFields(n,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var o;let i=this.fields[n],s=e;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),r[n]=i&&"getDefault"in i?i.getDefault(s):void 0}),r}setFields(e,r){let n=this.clone();return n.fields=e,n._nodes=pf(e,r),n._sortErrors=as(Object.keys(e)),r&&(n._excludedEdges=r),n}shape(e,r=[]){return this.clone().withMutation(n=>{let o=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),o=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,e),o)})}partial(){let e={};for(let[r,n]of Object.entries(this.fields))e[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return Fr(this)}pick(e){let r={};for(let n of e)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,o])=>e.includes(n)&&e.includes(o)))}omit(e){let r=[];for(let n of Object.keys(this.fields))e.includes(n)||r.push(n);return this.pick(r)}from(e,r,n){let o=(0,ve.getter)(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return df(i,e)&&(s=Object.assign({},i),n||delete s[e],s[r]=o(i)),s})}json(){return this.transform(ls)}noUnknown(e=!0,r=Xn.noUnknown){typeof e!="boolean"&&(r=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(o){if(o==null)return!0;let i=mf(this.schema,o);return!e||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,r=Xn.noUnknown){return this.noUnknown(!e,r)}transformKeys(e){return this.transform(r=>{if(!r)return r;let n={};for(let o of Object.keys(r))n[e(o)]=r[o];return n})}camelCase(){return this.transformKeys(_t.camelCase)}snakeCase(){return this.transformKeys(_t.snakeCase)}constantCase(){return this.transformKeys(e=>(0,_t.snakeCase)(e).toUpperCase())}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(let[i,s]of Object.entries(r.fields)){var o;let l=e;(o=l)!=null&&o.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[i]})),n.fields[i]=s.describe(l)}return n}};Ot.prototype=Rr.prototype;function yf(t){return new $r(t)}var $r=class extends oe{constructor(e){super({type:"array",spec:{types:e},check(r){return Array.isArray(r)}}),this.innerType=void 0,this.innerType=e}_cast(e,r){let n=super._cast(e,r);if(!this._typeCheck(n)||!this.innerType)return n;let o=!1,i=n.map((s,l)=>{let a=this.innerType.cast(s,Object.assign({},r,{path:`${r.path||""}[${l}]`}));return a!==s&&(o=!0),a});return o?i:n}_validate(e,r={},n,o){var i;let s=this.innerType,l=(i=r.recursive)!=null?i:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(e,r,n,(a,u)=>{var d;if(!l||!s||!this._typeCheck(u)){o(a,u);return}let c=new Array(u.length);for(let m=0;m<u.length;m++){var p;c[m]=s.asNestedTest({options:r,index:m,parent:u,parentPath:r.path,originalParent:(p=r.originalValue)!=null?p:e})}this.runTests({value:u,tests:c,originalValue:(d=r.originalValue)!=null?d:e,options:r},n,m=>o(m.concat(a),u))})}clone(e){let r=super.clone(e);return r.innerType=this.innerType,r}json(){return this.transform(ls)}concat(e){let r=super.concat(e);return r.innerType=this.innerType,e.innerType&&(r.innerType=r.innerType?r.innerType.concat(e.innerType):e.innerType),r}of(e){let r=this.clone();if(!Ir(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Ae(e));return r.innerType=e,r.spec=Object.assign({},r.spec,{types:e}),r}length(e,r=Or.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,r){return r=r||Or.min,this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,r){return r=r||Or.max,this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,r)=>this._typeCheck(e)?e:r==null?[]:[].concat(r))}compact(e){let r=e?(n,o,i)=>!e(n,o,i):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);if(r.innerType){var o;let i=e;(o=i)!=null&&o.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=r.innerType.describe(i)}return n}};yf.prototype=$r.prototype;function gf(t){return new Br(t)}var Br=class extends oe{constructor(e){super({type:"tuple",spec:{types:e},check(r){let n=this.spec.types;return Array.isArray(r)&&r.length===n.length}}),this.withMutation(()=>{this.typeError(os.notType)})}_cast(e,r){let{types:n}=this.spec,o=super._cast(e,r);if(!this._typeCheck(o))return o;let i=!1,s=n.map((l,a)=>{let u=l.cast(o[a],Object.assign({},r,{path:`${r.path||""}[${a}]`}));return u!==o[a]&&(i=!0),u});return i?s:o}_validate(e,r={},n,o){let i=this.spec.types;super._validate(e,r,n,(s,l)=>{var a;if(!this._typeCheck(l)){o(s,l);return}let u=[];for(let[c,p]of i.entries()){var d;u[c]=p.asNestedTest({options:r,index:c,parent:l,parentPath:r.path,originalParent:(d=r.originalValue)!=null?d:e})}this.runTests({value:l,tests:u,originalValue:(a=r.originalValue)!=null?a:e,options:r},n,c=>o(c.concat(s),l))})}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);return n.innerType=r.spec.types.map((o,i)=>{var s;let l=e;return(s=l)!=null&&s.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[i]})),o.describe(l)}),n}};gf.prototype=Br.prototype;var Pf=Ot().shape({email:ft().required("Informe o e-mail"),password:ft().required("Informe a senha")});function Jn(t){let{onLoginSuccess:e,onLoginFailed:r,onEsqueciSenhaClick:n,credentialsConfig:o}=t,[i,s]=_react.useState.call(void 0, ""),[l,a]=_react.useState.call(void 0, ""),[u,d]=_react.useState.call(void 0, !1),[c,p]=_react.useState.call(void 0, !1),{login:m}=_hooks.useCredentials.call(void 0, o),{validationProps:y,setValidationErrors:w}=_hooks.useValidations.call(void 0, );function j(){d(!u)}function W(){return he(this,null,function*(){w(null),Pf.validate({email:i,password:l},{abortEarly:!1}).then(()=>he(this,null,function*(){p(!0);try{let k=yield m(i,l);k&&e(k)}catch(k){r(k)}})).catch(k=>{w(k)}).finally(()=>{p(!1)})})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",children:[_jsxruntime.jsx.call(void 0, _material.TextField,b({name:"email",label:"E-mail",margin:"normal",autoFocus:!0,value:i||"",onChange:k=>s(k.target.value)},y("email"))),_jsxruntime.jsx.call(void 0, _material.TextField,b({name:"password",label:"Senha",margin:"normal",value:l||"",onChange:k=>a(k.target.value),type:u?"text":"password",onKeyDown:k=>k.key==="Enter"&&W(),InputProps:{endAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"end",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:j,edge:"end",children:u?_jsxruntime.jsx.call(void 0, _iconsmaterial.VisibilityOff,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Visibility,{})})})})}},y("password"))),_jsxruntime.jsx.call(void 0, ce,{fullWidth:!0,variant:"contained",onClick:W,isLoading:c,sx:{mt:1},children:"Entrar"}),_jsxruntime.jsx.call(void 0, ce,{onClick:n,variant:"text",sx:{marginTop:.5,fontWeight:"400",":hover":{color:k=>k.palette.primary.dark}},children:"Esqueci a senha"})]})}var kf=Ot().shape({email:ft().required("Informe o e-mail")});function eo(t){let{onLoginClick:e,credentialsConfig:r}=t,[n,o]=_react.useState.call(void 0, ""),[i,s]=_react.useState.call(void 0, !1),{recuperarSenha:l}=_hooks.useCredentials.call(void 0, r),{validationProps:a,setValidationErrors:u}=_hooks.useValidations.call(void 0, );function d(){return he(this,null,function*(){u(null),kf.validate({email:n},{abortEarly:!1}).then(()=>he(this,null,function*(){try{s(!0),yield l(n)}catch(c){throw new Error(c)}finally{s(!1)}})).catch(c=>{u(c)})})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",children:[_jsxruntime.jsx.call(void 0, _material.TextField,b({name:"email",label:"E-mail",margin:"normal",placeholder:"Informe o e-mail utilizado para acessar o sistema",autoFocus:!0,value:n||"",onChange:c=>o(c.target.value)},a("email"))),_jsxruntime.jsxs.call(void 0, He,{sx:{display:"inline-flex",justifyContent:"space-between",width:"100%",marginTop:1},children:[_jsxruntime.jsx.call(void 0, ce,{onClick:e,variant:"text",sx:{fontWeight:"400",":hover":{color:c=>c.palette.primary.dark}},children:"Voltar"}),_jsxruntime.jsx.call(void 0, ce,{variant:"contained",onClick:d,isLoading:i,children:"Recuperar Senha"})]})]})}function ro(t){var d;let{loginData:e,credentialsConfig:r,onLoginFailed:n,onLoginSuccess:o}=t,[i,s]=_react.useState.call(void 0, ""),{selecionarLicenca:l,isSubmitting:a}=_hooks.useCredentials.call(void 0, r);_react.useEffect.call(void 0, ()=>{if(Array.isArray(e==null?void 0:e.empresas)){let c=e==null?void 0:e.empresas[0];s(c==null?void 0:c.uuid)}},[e]);function u(){return he(this,null,function*(){try{let c=yield l(e,i);c?o(c):n("Nenhuma token definida")}catch(c){n(c)}})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",sx:{minWidth:"290px"},children:[_jsxruntime.jsx.call(void 0, _material.TextField,{label:"Licen\xE7as",margin:"normal",select:!0,autoFocus:!0,value:i,onChange:c=>{s(c.target.value)},children:(d=e==null?void 0:e.empresas)==null?void 0:d.map(c=>_jsxruntime.jsx.call(void 0, _material.MenuItem,{value:c.uuid,children:c.nome},c.uuid))}),_jsxruntime.jsx.call(void 0, ce,{fullWidth:!0,variant:"contained",onClick:u,isLoading:a,sx:{mt:1},children:"Confirmar"})]})}function ys(t){var p;let{credentialsConfig:e,onLoginSuccess:r,onLoginFailed:n,appName:o}=t,[i,s]=_react.useState.call(void 0, ),[l,a]=_react.useState.call(void 0, !1),{selecionarLicenca:u}=_hooks.useCredentials.call(void 0, e);function d(m){return he(this,null,function*(){try{if(Array.isArray(m==null?void 0:m.empresas)){if((m==null?void 0:m.empresas.length)===1){let y=yield u(m,m.empresas[0].uuid);y&&r(y);return}s(m);return}r(m)}catch(y){n(y)}})}function c(){a(!l)}return _jsxruntime.jsx.call(void 0, _material.Box,{sx:{height:"100vh"},children:_jsxruntime.jsxs.call(void 0, _material.Container,{component:"main",maxWidth:"xs",sx:{height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:[_jsxruntime.jsx.call(void 0, "img",{src:"https://datac-site-assets.s3.sa-east-1.amazonaws.com/logo.png"}),_jsxruntime.jsx.call(void 0, _material.Paper,{children:_jsxruntime.jsxs.call(void 0, _material.Stack,{sx:{padding:5},children:[_jsxruntime.jsx.call(void 0, Vn,{label:o}),!l&&_jsxruntime.jsx.call(void 0, _material.Box,{sx:{marginTop:3},children:i!=null&&i.empresas&&((p=i==null?void 0:i.empresas)==null?void 0:p.length)>0?_jsxruntime.jsx.call(void 0, ro,{loginData:i,credentialsConfig:e,onLoginSuccess:r,onLoginFailed:n}):_jsxruntime.jsx.call(void 0, Jn,{credentialsConfig:e,onLoginSuccess:d,onLoginFailed:n,onEsqueciSenhaClick:c})}),l&&_jsxruntime.jsx.call(void 0, _material.Box,{sx:{marginTop:3},children:_jsxruntime.jsx.call(void 0, eo,{onLoginClick:c,credentialsConfig:e})})]})})]})})}var Yf=t=>({transition:t.transitions.create(["transform"],{duration:500})}),Kf=_styles.styled.call(void 0, _iconsmaterial.KeyboardArrowRight,{shouldForwardProp:t=>t!=="open"})(({theme:t,open:e})=>b(b(b({color:t.palette.primary.dark},Yf(t)),e&&{transform:"rotate(-180deg)"}),!e&&{transform:"rotate(0)"}));function io(t){let{open:e,onToogleDrawerMenu:r}=t;return _jsxruntime.jsx.call(void 0, _material.Stack,{width:"90%",direction:"row",justifyContent:e?"flex-end":"center",margin:"16px auto",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{size:"small","aria-label":"open drawer",onClick:r,children:_jsxruntime.jsx.call(void 0, Kf,{fontSize:"small",open:e})})})}var Zf=_styles.styled.call(void 0, _material.MenuItem,{})(({theme:t})=>({borderRadius:"6px",width:"90%",gap:"16px",margin:"0 auto",padding:"8px 16px",transition:"0.1s ease-in-out","&:hover":{backgroundColor:"rgba(89, 195, 224, 15%);","& .MuiTypography-root":{color:t.palette.primary.main},"& .MuiSvgIcon-root":{color:t.palette.primary.main},"& .MuiIcon-root":{color:t.palette.primary.main}},"& .MuiIcon-root":{color:t.palette.grey[500],fontSize:"20px"},"& .MuiTypography-root":{letterSpacing:"0.5px",color:t.palette.text.secondary,fontSize:t.typography.body1},"& .MuiSvgIcon-root":{fontSize:"24px"}})),Xf=t=>_jsxruntime.jsx.call(void 0, Zf,b({},t)),jr=Xf;function so(t){let{menuItem:e,activeMenu:r,onMenuClick:n}=t,[o,i]=_react.useState.call(void 0, !1);if(!e.visible)return null;let s=!!(e!=null&&e.items&&(e==null?void 0:e.items.length)>0);function l(){i(!o)}return _jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsxs.call(void 0, jr,{onClick:()=>{if(e!=null&&e.link){n(e.link);return}l()},selected:r===e.link,children:[!!e.icon&&_jsxruntime.jsx.call(void 0, _material.Icon,{children:e.icon}),_jsxruntime.jsx.call(void 0, _material.ListItemText,{primary:e.label}),s&&!o&&_jsxruntime.jsx.call(void 0, _iconsmaterial.ExpandMore,{}),s&&o&&_jsxruntime.jsx.call(void 0, _iconsmaterial.ExpandLess,{})]}),(e==null?void 0:e.items)&&_jsxruntime.jsx.call(void 0, _material.Collapse,{in:o,timeout:"auto",unmountOnExit:!0,children:_jsxruntime.jsx.call(void 0, Ke,{activeMenu:r,sx:{pl:a=>a.spacing(1.5)},menus:(e==null?void 0:e.items)||[],onMenuClick:n})})]})}function Ke(t){let i=t,{menus:e,activeMenu:r,onMenuClick:n}=i,o=X(i,["menus","activeMenu","onMenuClick"]);return _jsxruntime.jsx.call(void 0, _material.List,q(b({component:"nav",disablePadding:!0},o),{children:e.map(s=>_jsxruntime.jsx.call(void 0, so,{onMenuClick:n,activeMenu:r,menuItem:s},s.id))}))}function ao(t){let{menus:e,activeMenu:r,onMenuClick:n}=t,[o,i]=_react.useState.call(void 0, null),s=(a,u,d)=>{i({element:a.currentTarget,id:u,items:d})},l=()=>{i(null)};return _jsxruntime.jsx.call(void 0, _material.List,{component:"nav",disablePadding:!0,children:e.map(a=>a.visible?(console.log(r,a.link),_jsxruntime.jsxs.call(void 0, jr,{onMouseEnter:u=>{a!=null&&a.link||s(u,a.id,a.items)},onMouseLeave:()=>{a!=null&&a.link||l()},onClick:()=>{a!=null&&a.link&&n(a.link)},selected:r===a.link,children:[_jsxruntime.jsx.call(void 0, _material.ListItemIcon,{children:_jsxruntime.jsx.call(void 0, _material.Icon,{children:a.icon})}),(o==null?void 0:o.id)===a.id&&_jsxruntime.jsx.call(void 0, _material.Popper,{sx:{zIndex:999999},anchorEl:o==null?void 0:o.element,open:!!(o!=null&&o.element),placement:"right-start",children:_jsxruntime.jsx.call(void 0, Ke,{activeMenu:r,onMenuClick:n,menus:(a==null?void 0:a.items)||[],sx:{minWidth:"240px",backgroundColor:L.palette.background.paper,borderRadius:"12px",padding:"16px 4px",boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%);"}})})]},`minMenu-${a.id}`)):null)})}var bs=(t,e)=>({width:t,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),vs=t=>({transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${t.spacing(8)} + 1px)`,[t.breakpoints.up("sm")]:{width:`calc(${t.spacing(8)} + 1px)`}}),bp=_styles.styled.call(void 0, _material.Drawer,{shouldForwardProp:t=>t!=="open"&&t!=="width"})(({theme:t,open:e,width:r})=>b(b({width:r,bgcolor:t.palette.background.paper,boxShadow:"2px 3px 20px -16px rgb(32 32 36 / 30%)",borderRightStyle:"none",whiteSpace:"nowrap",boxSizing:"border-box"},e&&q(b({},bs(r,t)),{"& .MuiDrawer-paper":bs(r,t)})),!e&&q(b({},vs(t)),{"& .MuiDrawer-paper":vs(t)})));function Ts(t){let y=t,{open:e,items:r,width:n,logo:o,minLogo:i,label:s,minLabel:l,link:a,version:u,activeMenu:d,onMenuClick:c,toggleMenu:p}=y,m=X(y,["open","items","width","logo","minLogo","label","minLabel","link","version","activeMenu","onMenuClick","toggleMenu"]);return _jsxruntime.jsxs.call(void 0, bp,q(b({width:n,open:e,onClose:()=>p(!1)},m),{children:[_jsxruntime.jsx.call(void 0, _material.Box,{sx:{height:L.mixins.toolbar},children:_jsxruntime.jsxs.call(void 0, _material.Stack,{spacing:.5,alignItems:"center",p:1,children:[_jsxruntime.jsx.call(void 0, "img",{src:e?o:i,alt:"logo"}),_jsxruntime.jsxs.call(void 0, _material.Typography,{variant:"body2",fontWeight:e?"700":"400",children:[e?s:l," ",u&&_jsxruntime.jsx.call(void 0, _material.Link,{underline:"none",target:"_blank",rel:"noreferrer",href:a,children:u})]})]})}),_jsxruntime.jsx.call(void 0, io,{open:!!e,onToogleDrawerMenu:p}),e&&_jsxruntime.jsx.call(void 0, Ke,{onMenuClick:c,activeMenu:d,menus:r}),!e&&_jsxruntime.jsx.call(void 0, ao,{onMenuClick:c,activeMenu:d,menus:r})]}))}exports.Button = ce; exports.ButtonContainer = He; exports.Checkbox = mo; exports.ColorsGrid = yo; exports.CurrencyCellStyle = Ud; exports.CurrencyTextField = Zr; exports.DataTable = Fa; exports.DataTableOptions = tn; exports.DeleteContainer = Qr; exports.Dialog = Fe; exports.DrawerMenu = Ts; exports.FilterContainer = ln; exports.FilterControl = Bt; exports.Flag = Ro; exports.FormContainer = fn; exports.LabelValue = Ai; exports.MioAuth = ys; exports.OptionStyles = Vd; exports.PageTitle = Bi; exports.SearchTextField = Pr; exports.Tooltip = Xe; exports.Transporter = zn; exports.theme = L;