@zydon/common 1.1.94 → 1.1.95

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
@@ -1,4 +1,4 @@
1
- import { a8 as d, aO as p, a9 as m, aP as c, aJ as v, ae as C, aQ as S, aS as k, aT as T, aa as P, ab as g, ac as A, ad as F, af as I, ag as h, ah as B, aU as M, aV as f, aW as y, ai as D, b7 as x, aj as E, ak as R, al as w, b9 as U, aX as L, am as N, aY as O, an as W, ba as G, ao as H, ap as V, aq as q, aZ as z, ar as K, as as j, at as J, a_ as Q, bv as X, au as Y, av as Z, aw as _, bc as $, bd as aa, bb as sa, aR as ea, ax as oa, a$ as ra, b0 as ta, az as ba, ay as ia, b1 as na, aA as la, aB as ua, aC as da, bw as pa, bx as ma, aD as ca, aE as va, aF as Ca, aG as Sa, b2 as ka, be as Ta, aH as Pa, b8 as ga, aI as Aa, b3 as Fa, by as Ia, aK as ha, aL as Ba, b5 as Ma, aM as fa, aN as ya, b4 as Da, b6 as xa, bz as Ea, bR as Ra, bA as wa, bO as Ua, bP as La, bQ as Na, bY as Oa, bW as Wa, bV as Ga, bS as Ha, bT as Va, bC as qa, bD as za, bE as Ka, bF as ja, bG as Ja, bH as Qa, bN as Xa, bM as Ya, bL as Za, bI as _a, bB as $a, bJ as as, bK as ss, bX as es, bU as os, bs as rs, bt as ts, bu as bs, bl as is, bo as ns, bg as ls, bi as us, bn as ds, bf as ps, bm as ms, bk as cs, bj as vs, bq as Cs, br as Ss, bp as ks, bh as Ts } from "./index-c02b6c75.js";
1
+ import { a8 as d, aO as p, a9 as m, aP as c, aJ as v, ae as C, aQ as S, aS as k, aT as T, aa as P, ab as g, ac as A, ad as F, af as I, ag as h, ah as B, aU as M, aV as f, aW as y, ai as D, b7 as x, aj as E, ak as R, al as w, b9 as U, aX as L, am as N, aY as O, an as W, ba as G, ao as H, ap as V, aq as q, aZ as z, ar as K, as as j, at as J, a_ as Q, bv as X, au as Y, av as Z, aw as _, bc as $, bd as aa, bb as sa, aR as ea, ax as oa, a$ as ra, b0 as ta, az as ba, ay as ia, b1 as na, aA as la, aB as ua, aC as da, bw as pa, bx as ma, aD as ca, aE as va, aF as Ca, aG as Sa, b2 as ka, be as Ta, aH as Pa, b8 as ga, aI as Aa, b3 as Fa, by as Ia, aK as ha, aL as Ba, b5 as Ma, aM as fa, aN as ya, b4 as Da, b6 as xa, bz as Ea, bR as Ra, bA as wa, bO as Ua, bP as La, bQ as Na, bY as Oa, bW as Wa, bV as Ga, bS as Ha, bT as Va, bC as qa, bD as za, bE as Ka, bF as ja, bG as Ja, bH as Qa, bN as Xa, bM as Ya, bL as Za, bI as _a, bB as $a, bJ as as, bK as ss, bX as es, bU as os, bs as rs, bt as ts, bu as bs, bl as is, bo as ns, bg as ls, bi as us, bn as ds, bf as ps, bm as ms, bk as cs, bj as vs, bq as Cs, br as Ss, bp as ks, bh as Ts } from "./index-781d2137.js";
2
2
  import "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -260,4 +260,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
260
260
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sJ(e){if(Array.isArray(e))return Rh(e)}function Z5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Q5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z5(Object(r),!0).forEach(function(n){J5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function J5(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Po(e,t){return cJ(e)||uJ(e,t)||ex(e,t)||lJ()}function lJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
261
261
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ex(e,t){if(e){if(typeof e=="string")return Rh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rh(e,t)}}function Rh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uJ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function cJ(e){if(Array.isArray(e))return e}var fJ="file-invalid-type",dJ="file-too-large",hJ="file-too-small",pJ="too-many-files",gJ=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var r=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:fJ,message:"File type must be ".concat(r)}},tx=function(t){return{code:dJ,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},rx=function(t){return{code:hJ,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},mJ={code:pJ,message:"Too many files"};function nx(e,t){var r=e.type==="application/x-moz-file"||iJ(e,t);return[r,r?null:gJ(t)]}function ix(e,t,r){if(Yn(e.size))if(Yn(t)&&Yn(r)){if(e.size>r)return[!1,tx(r)];if(e.size<t)return[!1,rx(t)]}else{if(Yn(t)&&e.size<t)return[!1,rx(t)];if(Yn(r)&&e.size>r)return[!1,tx(r)]}return[!0,null]}function Yn(e){return e!=null}function vJ(e){var t=e.files,r=e.accept,n=e.minSize,i=e.maxSize,a=e.multiple,o=e.maxFiles,s=e.validator;return!a&&t.length>1||a&&o>=1&&t.length>o?!1:t.every(function(u){var l=nx(u,r),c=Po(l,1),f=c[0],d=ix(u,n,i),h=Po(d,1),m=h[0],g=s?s(u):null;return f&&m&&!g})}function gu(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function mu(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function ax(e){e.preventDefault()}function yJ(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function bJ(e){return e.indexOf("Edge/")!==-1}function xJ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return yJ(e)||bJ(e)}function Tr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return t.some(function(s){return!gu(n)&&s&&s.apply(void 0,[n].concat(a)),gu(n)})}}function wJ(){return"showOpenFilePicker"in window}function CJ(e){if(Yn(e)){var t=Object.entries(e).filter(function(r){var n=Po(r,2),i=n[0],a=n[1],o=!0;return ox(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(a)||!a.every(sx))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(r,n){var i=Po(n,2),a=i[0],o=i[1];return Q5(Q5({},r),{},J5({},a,o))},{});return[{description:"Files",accept:t}]}return e}function SJ(e){if(Yn(e))return Object.entries(e).reduce(function(t,r){var n=Po(r,2),i=n[0],a=n[1];return[].concat(X5(t),[i],X5(a))},[]).filter(function(t){return ox(t)||sx(t)}).join(",")}function EJ(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function TJ(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ox(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function sx(e){return/^.*\.[\w]+$/.test(e)}var kJ=["children"],_J=["open"],MJ=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],OJ=["refKey","onChange","onClick"];function AJ(e){return $J(e)||DJ(e)||lx(e)||PJ()}function PJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
262
262
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $J(e){if(Array.isArray(e))return Bh(e)}function Nh(e,t){return jJ(e)||FJ(e,t)||lx(e,t)||IJ()}function IJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
263
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lx(e,t){if(e){if(typeof e=="string")return Bh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bh(e,t)}}function Bh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function FJ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function jJ(e){if(Array.isArray(e))return e}function ux(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ux(Object(r),!0).forEach(function(n){zh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ux(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vu(e,t){if(e==null)return{};var r=LJ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LJ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var Vh=v.forwardRef(function(e,t){var r=e.children,n=vu(e,kJ),i=yu(n),a=i.open,o=vu(i,_J);return v.useImperativeHandle(t,function(){return{open:a}},[a]),v.createElement(v.Fragment,null,r(ot(ot({},o),{},{open:a})))});Vh.displayName="Dropzone";var cx={disabled:!1,getFilesFromEvent:KQ,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Vh.defaultProps=cx,Vh.propTypes={children:_.func,accept:_.objectOf(_.arrayOf(_.string)),multiple:_.bool,preventDropOnDocument:_.bool,noClick:_.bool,noKeyboard:_.bool,noDrag:_.bool,noDragEventsBubbling:_.bool,minSize:_.number,maxSize:_.number,maxFiles:_.number,disabled:_.bool,getFilesFromEvent:_.func,onFileDialogCancel:_.func,onFileDialogOpen:_.func,useFsAccessApi:_.bool,autoFocus:_.bool,onDragEnter:_.func,onDragLeave:_.func,onDragOver:_.func,onDrop:_.func,onDropAccepted:_.func,onDropRejected:_.func,onError:_.func,validator:_.func};var Wh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function yu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=ot(ot({},cx),e),r=t.accept,n=t.disabled,i=t.getFilesFromEvent,a=t.maxSize,o=t.minSize,s=t.multiple,u=t.maxFiles,l=t.onDragEnter,c=t.onDragLeave,f=t.onDragOver,d=t.onDrop,h=t.onDropAccepted,m=t.onDropRejected,g=t.onFileDialogCancel,y=t.onFileDialogOpen,b=t.useFsAccessApi,x=t.autoFocus,C=t.preventDropOnDocument,M=t.noClick,w=t.noKeyboard,k=t.noDrag,T=t.noDragEventsBubbling,O=t.onError,P=t.validator,B=v.useMemo(function(){return SJ(r)},[r]),H=v.useMemo(function(){return CJ(r)},[r]),pe=v.useMemo(function(){return typeof y=="function"?y:fx},[y]),ne=v.useMemo(function(){return typeof g=="function"?g:fx},[g]),K=v.useRef(null),G=v.useRef(null),j=v.useReducer(RJ,Wh),U=Nh(j,2),Ce=U[0],fe=U[1],D=Ce.isFocused,$=Ce.isFileDialogActive,W=v.useRef(typeof window<"u"&&window.isSecureContext&&b&&wJ()),se=function(){!W.current&&$&&setTimeout(function(){if(G.current){var he=G.current.files;he.length||(fe({type:"closeDialog"}),ne())}},300)};v.useEffect(function(){return window.addEventListener("focus",se,!1),function(){window.removeEventListener("focus",se,!1)}},[G,$,ne,W]);var Z=v.useRef([]),ce=function(he){K.current&&K.current.contains(he.target)||(he.preventDefault(),Z.current=[])};v.useEffect(function(){return C&&(document.addEventListener("dragover",ax,!1),document.addEventListener("drop",ce,!1)),function(){C&&(document.removeEventListener("dragover",ax),document.removeEventListener("drop",ce))}},[K,C]),v.useEffect(function(){return!n&&x&&K.current&&K.current.focus(),function(){}},[K,x,n]);var ie=v.useCallback(function(V){O?O(V):console.error(V)},[O]),le=v.useCallback(function(V){V.preventDefault(),V.persist(),Ye(V),Z.current=[].concat(AJ(Z.current),[V.target]),mu(V)&&Promise.resolve(i(V)).then(function(he){if(!(gu(V)&&!T)){var st=he.length,lt=st>0&&vJ({files:he,accept:B,minSize:o,maxSize:a,multiple:s,maxFiles:u,validator:P}),Dt=st>0&&!lt;fe({isDragAccept:lt,isDragReject:Dt,isDragActive:!0,type:"setDraggedFiles"}),l&&l(V)}}).catch(function(he){return ie(he)})},[i,l,ie,T,B,o,a,s,u,P]),ee=v.useCallback(function(V){V.preventDefault(),V.persist(),Ye(V);var he=mu(V);if(he&&V.dataTransfer)try{V.dataTransfer.dropEffect="copy"}catch{}return he&&f&&f(V),!1},[f,T]),X=v.useCallback(function(V){V.preventDefault(),V.persist(),Ye(V);var he=Z.current.filter(function(lt){return K.current&&K.current.contains(lt)}),st=he.indexOf(V.target);st!==-1&&he.splice(st,1),Z.current=he,!(he.length>0)&&(fe({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),mu(V)&&c&&c(V))},[K,c,T]),te=v.useCallback(function(V,he){var st=[],lt=[];V.forEach(function(Dt){var dn=nx(Dt,B),Br=Nh(dn,2),Gn=Br[0],Do=Br[1],$o=ix(Dt,o,a),fa=Nh($o,2),Io=fa[0],Fo=fa[1],jo=P?P(Dt):null;if(Gn&&Io&&!jo)st.push(Dt);else{var Lo=[Do,Fo];jo&&(Lo=Lo.concat(jo)),lt.push({file:Dt,errors:Lo.filter(function(Ro){return Ro})})}}),(!s&&st.length>1||s&&u>=1&&st.length>u)&&(st.forEach(function(Dt){lt.push({file:Dt,errors:[mJ]})}),st.splice(0)),fe({acceptedFiles:st,fileRejections:lt,type:"setFiles"}),d&&d(st,lt,he),lt.length>0&&m&&m(lt,he),st.length>0&&h&&h(st,he)},[fe,s,B,o,a,u,d,h,m,P]),Se=v.useCallback(function(V){V.preventDefault(),V.persist(),Ye(V),Z.current=[],mu(V)&&Promise.resolve(i(V)).then(function(he){gu(V)&&!T||te(he,V)}).catch(function(he){return ie(he)}),fe({type:"reset"})},[i,te,ie,T]),F=v.useCallback(function(){if(W.current){fe({type:"openDialog"}),pe();var V={multiple:s,types:H};window.showOpenFilePicker(V).then(function(he){return i(he)}).then(function(he){te(he,null),fe({type:"closeDialog"})}).catch(function(he){EJ(he)?(ne(he),fe({type:"closeDialog"})):TJ(he)?(W.current=!1,G.current?(G.current.value=null,G.current.click()):ie(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ie(he)});return}G.current&&(fe({type:"openDialog"}),pe(),G.current.value=null,G.current.click())},[fe,pe,ne,b,te,ie,H,s]),Je=v.useCallback(function(V){!K.current||!K.current.isEqualNode(V.target)||(V.key===" "||V.key==="Enter"||V.keyCode===32||V.keyCode===13)&&(V.preventDefault(),F())},[K,F]),J=v.useCallback(function(){fe({type:"focus"})},[]),z=v.useCallback(function(){fe({type:"blur"})},[]),re=v.useCallback(function(){M||(xJ()?setTimeout(F,0):F())},[M,F]),de=function(he){return n?null:he},Xe=function(he){return w?null:de(he)},Ue=function(he){return k?null:de(he)},Ye=function(he){T&&he.stopPropagation()},pt=v.useMemo(function(){return function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=V.refKey,st=he===void 0?"ref":he,lt=V.role,Dt=V.onKeyDown,dn=V.onFocus,Br=V.onBlur,Gn=V.onClick,Do=V.onDragEnter,$o=V.onDragOver,fa=V.onDragLeave,Io=V.onDrop,Fo=vu(V,MJ);return ot(ot(zh({onKeyDown:Xe(Tr(Dt,Je)),onFocus:Xe(Tr(dn,J)),onBlur:Xe(Tr(Br,z)),onClick:de(Tr(Gn,re)),onDragEnter:Ue(Tr(Do,le)),onDragOver:Ue(Tr($o,ee)),onDragLeave:Ue(Tr(fa,X)),onDrop:Ue(Tr(Io,Se)),role:typeof lt=="string"&&lt!==""?lt:"presentation"},st,K),!n&&!w?{tabIndex:0}:{}),Fo)}},[K,Je,J,z,re,le,ee,X,Se,w,k,n]),gt=v.useCallback(function(V){V.stopPropagation()},[]),Nr=v.useMemo(function(){return function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=V.refKey,st=he===void 0?"ref":he,lt=V.onChange,Dt=V.onClick,dn=vu(V,OJ),Br=zh({accept:B,multiple:s,type:"file",style:{display:"none"},onChange:de(Tr(lt,Se)),onClick:de(Tr(Dt,gt)),tabIndex:-1},st,G);return ot(ot({},Br),dn)}},[G,r,s,Se,n]);return ot(ot({},Ce),{},{isFocused:D&&!n,getRootProps:pt,getInputProps:Nr,rootRef:K,inputRef:G,open:de(F)})}function RJ(e,t){switch(t.type){case"focus":return ot(ot({},e),{},{isFocused:!0});case"blur":return ot(ot({},e),{},{isFocused:!1});case"openDialog":return ot(ot({},Wh),{},{isFileDialogActive:!0});case"closeDialog":return ot(ot({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ot(ot({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ot(ot({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ot({},Wh);default:return e}}function fx(){}const NJ=["pdf"],BJ=["txt"],zJ=["psd"],VJ=["doc","docx"],WJ=["xls","xlsx"],HJ=["zip","rar","iso"],UJ=["ai","esp"],YJ=["ppt","pptx"],GJ=["wav","aif","mp3","aac"],qJ=["jpg","jpeg","gif","bmp","png","svg"],KJ=["m4v","avi","mpg","mp4","webm"],Qt=e=>`/assets/icons/files/${e}.svg`;function dx(e){let t;switch(e==null?void 0:e.includes(zt(e))){case BJ.includes(zt(e)):t="txt";break;case HJ.includes(zt(e)):t="zip";break;case GJ.includes(zt(e)):t="audio";break;case qJ.includes(zt(e)):t="image";break;case KJ.includes(zt(e)):t="video";break;case VJ.includes(zt(e)):t="word";break;case WJ.includes(zt(e)):t="excel";break;case YJ.includes(zt(e)):t="powerpoint";break;case NJ.includes(zt(e)):t="pdf";break;case zJ.includes(zt(e)):t="photoshop";break;case UJ.includes(zt(e)):t="illustrator";break;default:t=zt(e)}return t}function XJ(e){let t;switch(dx(e)){case"folder":t=Qt("ic_folder");break;case"txt":t=Qt("ic_txt");break;case"zip":t=Qt("ic_zip");break;case"audio":t=Qt("ic_audio");break;case"video":t=Qt("ic_video");break;case"word":t=Qt("ic_word");break;case"excel":t=Qt("ic_excel");break;case"powerpoint":t=Qt("ic_power_point");break;case"pdf":t=Qt("ic_pdf");break;case"photoshop":t=Qt("ic_pts");break;case"illustrator":t=Qt("ic_ai");break;case"image":t=Qt("ic_img");break;default:t=Qt("ic_file")}return t}function zt(e=""){return e&&e.split(".").pop()||""}function ZJ(e){return e.split("/").pop()}function Hh(e){return typeof e=="string"?{key:e,preview:e,name:ZJ(e),type:zt(e)}:{key:e.preview,name:e.name,size:e.size,path:e.path,type:e.type,preview:e.preview,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate}}const hx=({onDownload:e})=>{const t=hi();return p.jsx(S.IconButton,{onClick:e,sx:{p:0,top:0,right:0,width:1,height:1,zIndex:9,opacity:0,position:"absolute",borderRadius:"unset",justifyContent:"center",bgcolor:"grey.800",color:"common.white",transition:t.transitions.create("opacity"),"&:hover":{opacity:1,...V5({opacity:.64,color:t.palette.grey[900]})}},children:p.jsx(Le,{icon:"eva:arrow-circle-down-fill",width:24})})},px=({file:e,tooltip:t,imageView:r,onDownload:n,sx:i,imgSx:a})=>{const{name:o="",path:s="",preview:u=""}=Hh(e),l=dx(s||u),c=l==="image"&&r?p.jsx(S.Box,{component:"img",src:u,sx:{width:1,height:1,flexShrink:0,objectFit:"cover",...a}}):p.jsx(S.Box,{component:"img",src:XJ(l),sx:{width:32,height:32,flexShrink:0,...i}});return t?p.jsx(S.Tooltip,{title:o,children:p.jsxs(S.Stack,{flexShrink:0,component:"span",alignItems:"center",justifyContent:"center",sx:{width:"fit-content",height:"inherit"},children:[c,n&&p.jsx(hx,{onDownload:n})]})}):p.jsxs(p.Fragment,{children:[c,n&&p.jsx(hx,{onDownload:n})]})},gx=({fileRejections:e})=>e.length?p.jsx(S.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>L(t.palette.error.main,.08),borderColor:t=>L(t.palette.error.main,.24)},children:e.map(({file:t,errors:r})=>{const{path:n,size:i}=Hh(t);return p.jsxs(S.Box,{sx:{my:1},children:[p.jsxs(S.Typography,{variant:"subtitle2",noWrap:!0,children:[n," - ",i?Th(i):""]}),r.map(a=>p.jsxs(S.Box,{component:"span",sx:{typography:"caption"},children:["- ",a.message]},a.code))]},n)})}):null,QJ=({thumbnail:e,files:t,onRemove:r,sx:n})=>t!=null&&t.length?p.jsx(C1,{initial:!1,children:t.map(i=>{const{key:a,name:o="",size:s=0}=Hh(i),u=typeof i=="string";return e?p.jsxs(S.Stack,{component:Ft.div,...pa().inUp,alignItems:"center",display:"inline-flex",justifyContent:"center",sx:{m:.5,width:80,height:80,borderRadius:1.25,overflow:"hidden",position:"relative",border:l=>`solid 1px ${l.palette.divider}`,...n},children:[p.jsx(px,{tooltip:!0,imageView:!0,file:i,sx:{position:"absolute"},imgSx:{position:"absolute"}}),r&&p.jsx(S.IconButton,{size:"small",onClick:()=>r(i),sx:{top:4,right:4,p:"1px",position:"absolute",color:l=>L(l.palette.common.white,.72),bgcolor:l=>L(l.palette.grey[900],.48),"&:hover":{bgcolor:l=>L(l.palette.grey[900],.72)}},children:p.jsx(Le,{icon:"eva:close-fill",width:16})})]},a):p.jsxs(S.Stack,{component:Ft.div,...pa().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:l=>`solid 1px ${l.palette.divider}`,...n},children:[p.jsx(px,{file:i}),p.jsxs(S.Stack,{flexGrow:1,sx:{minWidth:0},children:[p.jsx(S.Typography,{variant:"subtitle2",noWrap:!0,children:u?i:o}),p.jsx(S.Typography,{variant:"caption",sx:{color:"text.secondary"},children:u?"":Th(s)})]}),r&&p.jsx(S.IconButton,{edge:"end",size:"small",onClick:()=>r(i),children:p.jsx(Le,{icon:"eva:close-fill"})})]},a)})}):null,JJ=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return p.jsx(S.Stack,{position:"absolute",width:1,height:1,maxHeight:"100%",alignItems:"center",justifyContent:"center",top:0,right:0,bottom:0,left:0,padding:2,margin:"auto",children:p.jsx("img",{alt:"file preview",src:t,style:{borderRadius:8,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},eee=Qr("div")(({theme:e})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`1px dashed ${L(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),tee=({header:e,description:t,sx:r,...n})=>p.jsxs(S.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...r},...n,children:[p.jsx(gX,{sx:{width:220}}),p.jsxs("div",{children:[p.jsx(S.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),p.jsx(S.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||p.jsxs(p.Fragment,{children:["Solte os arquivos aqui ou clique",p.jsx(S.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),mx=({id:e,disabled:t,multiple:r=!1,error:n,helperText:i,file:a,onDelete:o,files:s,thumbnail:u,onUpload:l,onRemove:c,onRemoveAll:f,sx:d,dropZoneProps:h,placeholderProps:m,placeholderAlt:g,image:y,tabIndex:b,...x})=>{const{getRootProps:C,getInputProps:M,isDragActive:w,isDragReject:k,fileRejections:T}=yu({multiple:r,disabled:t,...x}),O=!!a&&!r||y,P=s&&r&&s.length>0,B=k||!!n;return p.jsxs(S.Box,{sx:{width:1,position:"relative",...d},children:[p.jsxs(eee,{...C(),sx:{...w&&{opacity:.72},...B&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...t&&{opacity:.48,pointerEvents:"none"},...h},children:[p.jsx("input",{...M(),id:e,tabIndex:b}),g?p.jsx(S.Stack,{sx:{...O&&{opacity:0}},children:g}):p.jsx(tee,{sx:{...O&&{opacity:0}},header:m==null?void 0:m.title,description:m==null?void 0:m.description}),O&&p.jsx(JJ,{file:a||y||""})]}),i&&p.jsx(S.FormHelperText,{error:!!n,sx:H=>({mx:"14px",color:t?H.palette.grey[500]:void 0}),children:i}),p.jsx(gx,{fileRejections:T}),O&&o&&p.jsx(S.IconButton,{size:"small",onClick:o,sx:{top:16,right:16,zIndex:9,position:"absolute",color:H=>L(H.palette.common.white,.8),bgcolor:H=>L(H.palette.grey[900],.72),"&:hover":{bgcolor:H=>L(H.palette.grey[900],.48)}},children:p.jsx(Le,{icon:"eva:close-fill",width:18})}),P&&p.jsxs(p.Fragment,{children:[p.jsx(S.Box,{sx:{my:3},children:p.jsx(QJ,{files:s,thumbnail:u,onRemove:c})}),p.jsxs(S.Stack,{direction:"row",justifyContent:"flex-end",spacing:1.5,children:[f&&p.jsx(S.Button,{color:"inherit",variant:"outlined",size:"small",onClick:f,children:"Remove all"}),l&&p.jsx(S.Button,{size:"small",variant:"contained",onClick:l,children:"Upload files"})]})]})]})},ree=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return p.jsx("img",{alt:"avatar",src:t,style:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},nee=Qr("div")(({theme:e})=>({width:144,height:144,margin:"auto",display:"flex",cursor:"pointer",overflow:"hidden",borderRadius:"50%",alignItems:"center",position:"relative",justifyContent:"center",border:`1px dashed ${L(e.palette.grey[500],.32)}`})),iee=Qr("div")(({theme:e})=>({zIndex:7,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",flexDirection:"column",justifyContent:"center",width:"calc(100% - 16px)",height:"calc(100% - 16px)",color:e.palette.text.disabled,backgroundColor:e.palette.background.neutral,transition:e.transitions.create("opacity",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.shorter})})),vx=({error:e,file:t,image:r,disabled:n,helperText:i,sx:a,tabIndex:o,...s})=>{const{getRootProps:u,getInputProps:l,isDragActive:c,isDragReject:f,fileRejections:d}=yu({multiple:!1,disabled:n,...s}),h=!!t||r,m=f||!!e;return p.jsxs(p.Fragment,{children:[p.jsxs(nee,{...u(),sx:{...c&&{opacity:.72},...m&&{borderColor:"error.light",...h&&{bgcolor:"error.lighter"}},...n&&{opacity:.48,pointerEvents:"none"},...h&&{"&:hover":{"& .placeholder":{opacity:1}}},...a},children:[p.jsx("input",{...l(),tabIndex:o}),h&&p.jsx(ree,{file:t||r||""}),p.jsxs(iee,{className:"placeholder",sx:{"&:hover":{opacity:.72},...h&&{zIndex:9,opacity:0,color:"common.white",bgcolor:g=>L(g.palette.grey[900],.64)},...m&&{color:"error.main",bgcolor:"error.lighter"}},children:[p.jsx(Le,{icon:"ic:round-add-a-photo",width:24,sx:{mb:1}}),p.jsx(S.Typography,{variant:"caption",children:t?"Update photo":"Upload photo"})]})]}),i&&i,p.jsx(gx,{fileRejections:d})]})},aee=Qr("div")(({theme:e})=>({width:64,height:64,fontSize:24,display:"flex",flexShrink:0,cursor:"pointer",alignItems:"center",justifyContent:"center",margin:e.spacing(.5),color:e.palette.text.disabled,borderRadius:e.shape.borderRadius,border:`dashed 1px ${e.palette.divider}`,backgroundColor:L(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),oee=({placeholderAlt:e,error:t,disabled:r,sx:n,tabIndex:i,...a})=>{const{getRootProps:o,getInputProps:s,isDragActive:u,isDragReject:l}=yu({disabled:r,...a}),c=l||t;return p.jsxs(aee,{...o(),sx:{...u&&{opacity:.72},...c&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...r&&{opacity:.48,pointerEvents:"none"},...n},children:[p.jsx("input",{...s(),tabIndex:i}),e||p.jsx(Le,{icon:"eva:cloud-upload-fill",width:28})]})},see=e=>new Promise((t,r)=>{const n=new Image;n.addEventListener("load",()=>t(n)),n.addEventListener("error",i=>r(i)),n.setAttribute("crossOrigin","anonymous"),n.src=e});function yx(e){return e*Math.PI/180}function lee(e,t,r){const n=yx(r);return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}async function uee(e,t,r=0,n={horizontal:!1,vertical:!1}){const i=await see(e),a=document.createElement("canvas"),o=a.getContext("2d");if(!o)return null;const s=yx(r),{width:u,height:l}=lee(i.width,i.height,r);a.width=u,a.height=l,o.translate(u/2,l/2),o.rotate(s),o.scale(n.horizontal?-1:1,n.vertical?-1:1),o.translate(-i.width/2,-i.height/2),o.drawImage(i,0,0);const c=o.getImageData(t.x,t.y,t.width,t.height);return a.width=t.width,a.height=t.height,o.putImageData(c,0,0),new Promise((f,d)=>{a.toBlob(h=>{f(h)},"image/png")})}const bx=({onFileCropped:e,onImageUploaded:t,onCancel:r,image:n})=>{const i=v.useId(),[a,o,s]=ph(),[u,l]=v.useState({x:0,y:0}),[c,f]=v.useState(1),d=v.useRef();return{id:i,crop:u,setCrop:l,zoom:c,setZoom:f,fileRef:d,onCropComplete:async(b,x)=>{try{const C=await uee(n,x,0);d.current=new File([C],"image.png",{type:C.type})}catch{e(void 0)}},saveChanges:()=>{e(d.current),o()},cancelChanges:()=>{r&&r(),s(!1)},handleRemove:()=>{e(void 0),t(void 0),l({x:0,y:0}),f(1),s(!1)},cropModalOpen:a,toggleCropModalOpen:o,setCropModalOpen:s}},xx=({id:e,open:t,onClose:r,label:n,onSave:i,onRemove:a,imgSrc:o,aspect:s,size:{height:u,width:l},crop:c,zoom:f,onCropComplete:d,onCropChange:h,onZoomChange:m})=>p.jsx(N5,{open:t,onClose:r,dialogTitle:n,actions:p.jsxs(p.Fragment,{children:[p.jsx(S.Button,{variant:"outlined",size:"medium",onClick:r,color:"inherit",children:"Cancelar"}),p.jsx(S.Button,{variant:"contained",size:"medium",onClick:i,children:"Salvar"})]}),children:p.jsxs(S.Stack,{gap:2,children:[p.jsx(g5,{image:{width:l,height:u,aspect:s,imgSrc:o},crop:c,zoom:f,onCropComplete:d,onCropChange:h,onZoomChange:m}),p.jsxs(S.Stack,{gap:1.5,children:[p.jsxs(S.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",mr:"auto",children:[p.jsx(S.Typography,{variant:"body1",children:"Zoom"}),p.jsx(S.Slider,{value:f,onChange:(g,y)=>m(Array.isArray(y)?y[0]:y),min:1,max:5,size:"medium",step:.5})]}),p.jsxs(S.Stack,{direction:"row",gap:2,children:[p.jsx(S.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:p.jsx(Le,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:a,children:"Remover"}),p.jsx(S.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:p.jsx(Le,{icon:"ic:outline-image-search",color:dh.main}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})}),cee=S.styled(S.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),fee=S.styled(S.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:S.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),dee=S.styled(S.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),wx=({onFileCropped:e,onImageUploaded:t,onCancel:r,aspect:n,size:i,label:a,image:o="",uploading:s,file:u,tabIndex:l,...c})=>{const{id:f,crop:d,cropModalOpen:h,zoom:m,cancelChanges:g,handleRemove:y,onCropComplete:b,saveChanges:x,setCrop:C,setCropModalOpen:M,setZoom:w,toggleCropModalOpen:k}=bx({image:o,onFileCropped:e,onImageUploaded:t,onCancel:r});return p.jsxs(p.Fragment,{children:[p.jsxs(cee,{children:[s&&p.jsx(ql,{}),p.jsx(mx,{...c,id:f,file:u,onDrop:T=>{if(T.length>0){M(!0),w(1),C({x:0,y:0});const O=new FileReader;O.addEventListener("load",()=>{var B;const P=((B=O.result)==null?void 0:B.toString())||"";t(P),e(void 0)}),O.readAsDataURL(T[0])}},image:o,tabIndex:l}),(u||o)&&p.jsxs(fee,{className:"actions",children:[p.jsx(S.Button,{color:"inherit",startIcon:p.jsx(Le,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:y,children:"Remover"}),p.jsx(S.Button,{color:"inherit",startIcon:p.jsx(Le,{icon:"ic:outline-image",color:dh.main}),onClick:k,children:"Editar"})]})]}),p.jsx(xx,{id:f,open:h,onClose:g,label:a,aspect:n,crop:d,zoom:m,onCropComplete:b,onCropChange:C,onZoomChange:w,imgSrc:o,onRemove:y,onSave:x,size:i})]})},Cx=({name:e,helperText:t,rules:r,onSelectOption:n,...i})=>{const{control:a}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:a,rules:r,render:({field:o,fieldState:{error:s}})=>p.jsx(Af,{...o,...i,onChange:u=>{n&&n(u),o.onChange(u)},error:!!s,helperText:(s==null?void 0:s.message)||t})})},At=({name:e,helperText:t,rules:r,onChange:n,tabIndex:i,...a})=>{const{control:o}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:o,rules:r,render:({field:{ref:s,...u},fieldState:{error:l}})=>p.jsx(S.TextField,{...u,onChange:c=>{u.onChange(c),n&&n(c)},inputRef:s,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...a,inputProps:{...a.inputProps,tabIndex:i}})})},Sx=({name:e,helperText:t,rules:r,...n})=>{const{control:i}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:i,rules:r,render:({field:{name:a,onChange:o,value:s,ref:u},fieldState:{error:l}})=>p.jsx($h,{ref:u,...n,name:a,value:s,error:!!l,helperText:(l==null?void 0:l.message)||t,onChange:({target:{value:c}})=>o(c)})})},hee=({name:e,containerProps:t,required:r,rules:n,tabIndex:i})=>{const a=`${e}.zipCode`,o=`${e}.publicPlace`,s=`${e}.number`,u=`${e}.district`,l=`${e}.complement`,c=`${e}.state`,f=`${e}.city`,d=h=>{h.key==="Enter"&&h.preventDefault()};return p.jsxs(S.Stack,{gap:1.5,...t,children:[p.jsxs(S.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[p.jsx(Sx,{name:a,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:p.jsx(S.InputAdornment,{position:"end",children:p.jsx(S.CircularProgress,{size:24})})},rules:n,onKeyDown:d,required:r,sx:{width:"auto",flex:1,minWidth:160},tabIndex:i}),p.jsxs(S.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[p.jsx(At,{name:o,label:"Logradouro",onKeyDown:d,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:i}),p.jsx(At,{name:s,label:"Número",onKeyDown:d,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:i})]})]}),p.jsxs(S.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[p.jsx(At,{name:u,label:"Bairro",onKeyDown:d,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:i}),p.jsx(At,{name:l,label:"Complemento",onKeyDown:d,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:i})]}),p.jsxs(S.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[p.jsx(Cx,{name:c,label:"Estado",options:[],disabled:!0,required:r,sx:{flex:1},tabIndex:i}),p.jsx(At,{name:f,label:"Cidade",disabled:!0,required:r,sx:{flex:1},tabIndex:i})]})]})},pee=({name:e,rules:t,helperText:r,tabIndex:n,...i})=>{const{control:a}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:a,rules:t,render:({field:o,fieldState:{error:s}})=>p.jsxs("div",{children:[p.jsx(S.FormControlLabel,{control:p.jsx(S.Checkbox,{...o,checked:o.value,tabIndex:n}),...i}),(!!s||r)&&p.jsx(S.FormHelperText,{error:!!s,children:s?s==null?void 0:s.message:r})]})})},gee=({row:e,name:t,rules:r,label:n,options:i,spacing:a,helperText:o,required:s,...u})=>{const{control:l}=Ee.useFormContext(),c=(f,d)=>f.includes(d)?f.filter(h=>h!==d):[...f,d];return p.jsx(Ee.Controller,{name:t,control:l,rules:r,render:({field:{value:f=[],...d},fieldState:{error:h}})=>p.jsxs(S.FormControl,{component:"fieldset",children:[n&&p.jsx(S.FormLabel,{component:"legend",sx:{typography:"body2"},required:s,children:n}),p.jsx(S.FormGroup,{sx:{...e&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:a||0},...e&&{mr:0,"&:not(:last-of-type)":{mr:a||2}}}},children:i.map(m=>p.jsx(S.FormControlLabel,{control:p.jsx(S.Checkbox,{checked:f.includes(m.value),onChange:()=>d.onChange(c(f,m.value))}),label:m.label,...u},m.value))}),(!!h||o)&&p.jsx(S.FormHelperText,{error:!!h,sx:m=>({color:u.disabled?m.palette.grey[500]:void 0}),children:h?h==null?void 0:h.message:o})]})})},mee=({keyName:e,inputs:t=[],rules:r,tabIndex:n,...i})=>{const a=v.useRef(null),{control:o,setValue:s,formState:{errors:u}}=Ee.useFormContext(),l=d=>{const h=d.clipboardData.getData("text").split("");t.map((m,g)=>s(m,h[g])),d.preventDefault()},c=(d,h)=>{const{maxLength:m,value:g,name:y}=d.target,b=y.replace(e,""),x=Number(b),C=document.querySelector(`input[name=${e}${x+1}]`);g.length>m&&(d.target.value=g[0]),g.length>=m&&x<6&&C!==null&&C.focus(),h(d)};hh("paste",l,a);const f=t.some(d=>u[d]);return p.jsxs(S.Stack,{children:[p.jsx(S.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:a,children:t.map((d,h)=>p.jsx(Ee.Controller,{name:`${e}${h+1}`,control:o,rules:r,render:({field:m,fieldState:{error:g}})=>p.jsx(S.TextField,{...i,...m,autoComplete:"none",error:!!g,autoFocus:h===0,placeholder:"-",onChange:y=>{c(y,m.onChange)},onFocus:y=>y.currentTarget.select(),InputProps:{sx:{width:{xs:36,sm:56},height:{xs:36,sm:56},"& input":{p:0,textAlign:"center"}}},inputProps:{maxLength:1,type:"number",tabIndex:n}})},d))}),f&&p.jsx(S.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},vee=({name:e,rules:t,helperText:r,...n})=>{const{control:i}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:i,rules:{...t,validate:{...t==null?void 0:t.validate,validation:a=>{const o="#"+a.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(o)?!0:"Cor inválida"}}},render:({field:{ref:a,onChange:o,...s},fieldState:{error:u}})=>p.jsx(Ry,{...s,onChangeColor:o,inputRef:a,fullWidth:!0,error:!!u,helperText:(u==null?void 0:u.message)||r,...n})})},yee=({name:e,rules:t,tabIndex:r,helperText:n,required:i,...a})=>{const{control:o}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:o,rules:t,render:({field:{ref:s,...u},fieldState:{error:l}})=>{var c;return p.jsx(qn.DatePicker,{inputRef:s,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...a.localeText},...u,...a,value:u.value?new Date(u.value):null,slotProps:{textField:{...(c=a.slotProps)==null?void 0:c.textField,required:i,error:!!l,helperText:(l==null?void 0:l.message)||n,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:r}},openPickerButton:{tabIndex:r}}})}})},bee=({name:e,label:t,rules:r,tabIndex:n,helperText:i,required:a,...o})=>{const{control:s,setError:u}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:s,rules:r,render:({field:{value:l,onChange:c},fieldState:{error:f}})=>p.jsx(qn.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...o.localeText},value:[(l==null?void 0:l.startDate)||null,(l==null?void 0:l.endDate)||null],onChange:d=>c({startDate:d[0],endDate:d[1]}),onError:d=>{u(e,{message:d[0]||d[1]||void 0})},...o,slotProps:{textField:({position:d})=>{var h;return{...(h=o.slotProps)==null?void 0:h.textField,required:a,error:!!f,helperText:(f==null?void 0:f.message)||i,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:d==="start"?`${t} (Dt. Início)`:`${t} (Dt. Fim)`,inputProps:{tabIndex:n}}}},sx:{width:1}})})},xee=({name:e,rules:t,tabIndex:r,helperText:n,required:i,...a})=>{const{control:o}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:o,rules:t,render:({field:{ref:s,...u},fieldState:{error:l}})=>{var c;return p.jsx(qn.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:s,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...a.localeText},...u,...a,value:u.value?new Date(u.value):null,slotProps:{textField:{...(c=a.slotProps)==null?void 0:c.textField,required:i,error:!!l,helperText:(l==null?void 0:l.message)||n,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:r}},openPickerButton:{tabIndex:r}}})}})},wee=({id:e,children:t,onSubmit:r,methods:n,...i})=>p.jsx(Ee.FormProvider,{...n,children:p.jsx(S.Stack,{component:"form",id:e,onSubmit:r,flex:1,width:1,noValidate:!0,...i,children:t})}),Cee=({name:e,helperText:t,rules:r,...n})=>{const{control:i}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:i,rules:r,render:({field:{ref:a,value:o,...s},fieldState:{error:u}})=>p.jsx(Oh,{value:o,inputRef:a,fullWidth:!0,error:!!u,helperText:(u==null?void 0:u.message)||t,...n,...s,name:e})})},See=({name:e,helperText:t,rules:r,onChange:n,...i})=>{const{control:a}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:a,rules:r,render:({field:o,fieldState:{error:s}})=>p.jsx(au,{...o,onChange:u=>{o.onChange(u),n&&n(u)},fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||t,...i})})},Eee=({name:e,sx:t,rules:r,passwordSize:n,specialCharacter:i,upperCaseChar:a,numberChar:o,...s})=>{const{watch:u}=Ee.useFormContext(),l=u(e),[c,f]=v.useState(!1),{hasNumberChar:d,hasSpecialCharacter:h,hasUpperCaseChar:m,isLengthValid:g}=cu(l,n,o,i,a);return p.jsx(At,{...s,name:e,type:c?"text":"password",InputProps:{endAdornment:p.jsx(S.InputAdornment,{position:"end",children:p.jsx(S.IconButton,{onClick:()=>f(!c),edge:"end","aria-label":"Mostrar/Ocultar senha",children:p.jsx(Le,{icon:c?"eva:eye-off-fill":"eva:eye-fill"})})})},rules:{...r,validate:{...r==null?void 0:r.validate,validationPassword:y=>{const b=cu(y,n,o,i,a);return!b.hasNumberChar||!b.hasSpecialCharacter||!b.hasUpperCaseChar||!b.isLengthValid?"Senha inválida":!0}}},sx:{...t,"& .MuiFormHelperText-root":{display:!h||!m||!g||!d?"none":void 0}}})},Uh=({name:e,rules:t,row:r,label:n,options:i,spacing:a,helperText:o,decorated:s,onChange:u,tabIndex:l,required:c,disabled:f,...d})=>{const{control:h}=Ee.useFormContext(),m=n?`${e}-${n}`:"";return p.jsx(Ee.Controller,{name:e,control:h,rules:t,render:({field:g,fieldState:{error:y}})=>p.jsxs(S.FormControl,{component:"fieldset",sx:{...s&&{paddingLeft:1.5}},children:[n&&p.jsx(S.FormLabel,{component:"legend",id:m,sx:{typography:"body2"},required:c,children:n}),p.jsx(S.RadioGroup,{...d,...g,onChange:(b,x)=>{g.onChange(b),u&&u(b,x)},"aria-labelledby":m,row:r,children:i.map(b=>p.jsx(S.FormControlLabel,{value:b.value,control:p.jsx(S.Radio,{inputProps:{tabIndex:l},disabled:f,checked:b.value===g.value}),label:b.label,sx:({palette:x})=>({"&:not(:last-of-type)":{mb:a||0},...r&&{mr:0,"&:not(:last-of-type)":{mr:a||2}},...s&&{border:`1px solid ${S.alpha(x.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(a||0)/2||1,...g.value===b.value&&{borderColor:"primary.main",backgroundColor:S.alpha(x.primary.main,.05)}}})},b.value))}),(!!y||o)&&p.jsx(S.FormHelperText,{error:!!y,sx:b=>({color:f?b.palette.grey[500]:void 0}),children:y?y==null?void 0:y.message:o})]})})},Ex=({name:e,helperText:t,onChange:r,tabIndex:n,...i})=>{const{control:a}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:a,render:({field:o,fieldState:{error:s}})=>p.jsxs("div",{children:[p.jsx(S.FormControlLabel,{control:p.jsx(S.Switch,{...o,checked:o.value,onChange:(u,l)=>{o.onChange(u),r&&r(u,l)},inputProps:{tabIndex:n}}),...i}),(!!s||t)&&p.jsx(S.FormHelperText,{error:!!s,sx:u=>({mx:"14px",color:i.disabled?u.palette.grey[500]:void 0}),children:s?s==null?void 0:s.message:t})]})})},Tee=({name:e,rules:t,tabIndex:r,helperText:n,required:i,...a})=>{const{control:o}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:o,rules:t,render:({field:{ref:s,...u},fieldState:{error:l}})=>{var c;return p.jsx(qn.TimePicker,{ampm:!1,format:"HH:mm",inputRef:s,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...a.localeText},...u,...a,value:u.value?new Date(u.value):null,slotProps:{textField:{...(c=a.slotProps)==null?void 0:c.textField,error:!!l,required:i,helperText:(l==null?void 0:l.message)||n,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:r}},openPickerButton:{tabIndex:r}}})}})};function Tx(e,t){const{watch:r,setValue:n}=Ee.useFormContext(),[i,a]=v.useState(t),o=r(e)||[];return{uploadFile:async d=>{if(!d){n(e,void 0),a(void 0);return}n(e,d),a(Object.assign(d,{preview:URL.createObjectURL(d)}))},uploadFiles:async d=>{n(e,[...o,...d.map(h=>Object.assign(h,{preview:URL.createObjectURL(h)}))])},handleDeleteFile:()=>{n(e,void 0),a(void 0)},handleRemoveAll:()=>{n(e,void 0)},handleRemove:d=>{const h=o.filter(m=>m!==d);n(e,h)},file:i,setFileValue:a}}const kee=({name:e,rules:t,helperText:r,aspect:n,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:u,onCancel:l,...c})=>{const{control:f}=Ee.useFormContext(),{uploadFile:d,file:h,setFileValue:m}=Tx(e);return p.jsx(Ee.Controller,{name:e,control:f,rules:t,render:({field:{value:g},fieldState:{error:y}})=>p.jsx(wx,{accept:{"image/*":[]},file:g?h:void 0,onFileCropped:b=>{d(b),s&&s(b)},onImageUploaded:u,onCancel:()=>{m(void 0),l&&l()},error:!!y,disableMultiple:!0,helperText:(!!y||r)&&p.jsx(S.FormHelperText,{error:!!y,sx:{px:2},children:y?y==null?void 0:y.message:r}),aspect:n,label:i,size:a,image:o,...c})})},_ee=({onFileCropped:e,onImageUploaded:t,onCancel:r,aspect:n,size:i,label:a,image:o="",uploading:s,file:u,tabIndex:l,...c})=>{const{id:f,crop:d,cropModalOpen:h,zoom:m,cancelChanges:g,handleRemove:y,onCropComplete:b,saveChanges:x,setCrop:C,setCropModalOpen:M,setZoom:w}=bx({image:o,onFileCropped:e,onImageUploaded:t,onCancel:r});return p.jsxs(p.Fragment,{children:[p.jsxs(S.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[s&&p.jsx(dee,{}),p.jsx(vx,{...c,id:f,file:u,onDrop:k=>{if(k.length>0){M(!0),w(1),C({x:0,y:0});const T=new FileReader;T.addEventListener("load",()=>{var P;const O=((P=T.result)==null?void 0:P.toString())||"";t(O),e(void 0)}),T.readAsDataURL(k[0])}},image:o,tabIndex:l})]}),p.jsx(xx,{id:f,open:h,onClose:g,label:a,aspect:n,crop:d,zoom:m,onCropComplete:b,onCropChange:C,onZoomChange:w,imgSrc:o,onRemove:y,onSave:x,size:i})]})},Mee=({name:e,rules:t,helperText:r,aspect:n,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:u,onCancel:l,...c})=>{const{control:f}=Ee.useFormContext(),{uploadFile:d,file:h,setFileValue:m}=Tx(e);return p.jsx(Ee.Controller,{name:e,control:f,rules:t,render:({field:{value:g},fieldState:{error:y}})=>p.jsx(_ee,{accept:{"image/*":[]},file:g?h:void 0,onFileCropped:b=>{d(b),s&&s(b)},onImageUploaded:u,onCancel:()=>{m(void 0),l&&l()},error:!!y,disableMultiple:!0,helperText:(!!y||r)&&p.jsx(S.FormHelperText,{error:!!y,sx:{px:2},children:y?y==null?void 0:y.message:r}),aspect:n,label:i,size:a,image:o,...c})})},Oee=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],Aee=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],Pee=S.styled(S.Stack)(({theme:e})=>({border:`1px solid ${S.alpha(e.palette.primary.main,.3)}`,backgroundColor:S.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),Dee=S.styled(S.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),$ee=S.styled(S.IconButton)(()=>({height:"38px",alignSelf:"center"})),Iee=({webhookData:e,isEditing:t=!1,haveTip:r=!1,onCreateHeaders:n,onRemoveHeader:i,headers:a})=>p.jsxs(p.Fragment,{children:[r&&p.jsxs(Pee,{children:[p.jsx(Le,{icon:"material-symbols:info-rounded"}),p.jsx(S.Typography,{variant:"caption",color:"text.secondary",children:"Webhooks permitem que serviços externos sejam notificados quando determinados eventos acontecem. Saiba mais acessando a documentação do Webhook"})]}),t&&p.jsx(At,{name:"name",label:"Nome do webhook"}),p.jsxs(S.Stack,{direction:"row",gap:2,children:[p.jsx(At,{name:"url",label:"URL de endpoint"}),p.jsx(At,{name:"filter",label:"Filtro"})]}),t&&p.jsxs(p.Fragment,{children:[p.jsx(At,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),p.jsxs(S.Stack,{direction:"row",gap:2,children:[p.jsx(At,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),p.jsx(At,{variant:"filled",name:"resource_id",label:"ID origem",disabled:!0,InputProps:{endAdornment:p.jsx(S.InputAdornment,{position:"end",children:p.jsx(Dee,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:p.jsx(Le,{className:"copyIcon",icon:"ic:baseline-content-copy"})})})}}),p.jsx(At,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),p.jsxs(S.Stack,{direction:"row",gap:2,children:[p.jsxs(S.Stack,{width:"35%",gap:2,children:[p.jsx(S.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),p.jsx(Uh,{name:"content_type",options:Oee,row:!0,decorated:!0})]}),p.jsxs(S.Stack,{gap:2,children:[p.jsx(S.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),p.jsx(Uh,{name:"http_method",options:Aee,row:!0,decorated:!0})]})]}),p.jsx(S.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),p.jsx(Ex,{name:"active",label:"Ativo"}),p.jsx(S.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),a==null?void 0:a.map((o,s)=>p.jsxs(S.Stack,{direction:"row",gap:2,children:[p.jsx(At,{name:`headers.${s}.name`,label:"Chave"}),p.jsx(At,{name:`headers.${s}.value`,label:"Valor"}),p.jsx($ee,{onClick:()=>i(s),color:"error",children:p.jsx(Le,{icon:"eva:trash-2-outline"})})]},o.id)),p.jsx(Tf,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>n(),children:"Adicionar novo cabeçalho"}),p.jsx(S.Divider,{}),p.jsx(S.Stack,{direction:"row",justifyContent:"flex-end",children:p.jsx(Tf,{actionType:"SAVE",type:"submit",children:"Salvar"})})]}),Fee=Object.freeze(Object.defineProperty({__proto__:null,default:n9},Symbol.toStringTag,{value:"Module"}));A.ActionButton=Tf,A.Address=hee,A.Autocomplete=Af,A.AutocompleteField=Cx,A.BuilderLayout=UQ,A.BuilderSidebar=uX,A.Checkbox=pee,A.Codes=mee,A.ColorPickerField=vee,A.ColorPickerInput=Ry,A.Common=BK,A.CommonSSR=VK,A.Confirm=WK,A.CustomAvatar=Lb,A.CustomAvatarGroup=Rb,A.DataGrid=vX,A.DatePicker=yee,A.DateRangePicker=bee,A.DateTimePicker=xee,A.Delayed=yX,A.DialogAnimate=O9,A.Drawer=OX,A.EmptyContent=PX,A.EmptyView=Bb,A.FabButtonAnimate=O1,A.Field=At,A.FixedProgressBar=ql,A.Form=wee,A.HelpButton=Jb,A.IconButtonAnimate=A1,A.Iconify=Le,A.ImageCrop=g5,A.Incrementer=Oh,A.IncrementerField=Cee,A.Label=O5,A.LoadingScreen=FZ,A.MaskedInput=$h,A.MaskedInputField=Sx,A.MaterialDesignContent=Jg,A.MenuPopover=QZ,A.Modal=N5,A.ModalActions=nQ,A.MotionContainer=kC,A.MotionLazyContainer=Xc,A.MotionViewport=TC,A.MultiCheckbox=gee,A.NumberInput=au,A.NumberInputField=See,A.PasswordField=Eee,A.PasswordRules=uQ,A.Portal=B5,A.RadioGroupField=Uh,A.SavedChanges=IQ,A.Scrollbar=Qb,A.SearchInput=FQ,A.SnackbarContent=af,A.SnackbarProvider=rm,A.SplashScreen=jQ,A.Steps=NQ,A.StyledTab=BQ,A.StyledTabs=zQ,A.Switch=Ex,A.TRANSITION=Xh,A.TabPanel=VQ,A.TextAnimate=A9,A.ThemeProvider=jb,A.TimePicker=Tee,A.Transition=Bs,A.Upload=mx,A.UploadAvatar=vx,A.UploadAvatarWithCropField=Mee,A.UploadBox=oee,A.UploadWithCrop=wx,A.UploadWithCropField=kee,A.Webhook=Iee,A.cssStyles=TQ,A.file=cQ,A.formatNumber=uZ,A.formatTime=wQ,A.loadable=$Q,A.mask=PQ,A.number=nZ,A.routes=_Q,A.sort=AQ,A.useActiveElement=HK,A.useCopyToClipboard=UK,A.useDatagrid=YK,A.useDeepCompareEffect=JK,A.useEventListener=hh,A.useIsMounting=tX,A.useOffSetTop=aX,A.useOnClickOutside=iX,A.usePagination=nX,A.useResponsive=Og,A.useSnackbar=iS,A.useTabs=rX,A.useToggle=ph,A.uuidv4=DQ,A.validators=oQ,A.varBgColor=Hx,A.varBgKenburns=Ux,A.varBgPan=Yx,A.varBounce=zx,A.varContainer=No,A.varFade=pa,A.varFlip=Rx,A.varHover=Wx,A.varPath=Fx,A.varRotate=Vx,A.varScale=Bx,A.varSlide=Nx,A.varTranEnter=xe,A.varTranExit=ke,A.varTranHover=jx,A.varZoom=Lx,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
263
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lx(e,t){if(e){if(typeof e=="string")return Bh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bh(e,t)}}function Bh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function FJ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function jJ(e){if(Array.isArray(e))return e}function ux(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ux(Object(r),!0).forEach(function(n){zh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ux(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vu(e,t){if(e==null)return{};var r=LJ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LJ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var Vh=v.forwardRef(function(e,t){var r=e.children,n=vu(e,kJ),i=yu(n),a=i.open,o=vu(i,_J);return v.useImperativeHandle(t,function(){return{open:a}},[a]),v.createElement(v.Fragment,null,r(ot(ot({},o),{},{open:a})))});Vh.displayName="Dropzone";var cx={disabled:!1,getFilesFromEvent:KQ,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Vh.defaultProps=cx,Vh.propTypes={children:_.func,accept:_.objectOf(_.arrayOf(_.string)),multiple:_.bool,preventDropOnDocument:_.bool,noClick:_.bool,noKeyboard:_.bool,noDrag:_.bool,noDragEventsBubbling:_.bool,minSize:_.number,maxSize:_.number,maxFiles:_.number,disabled:_.bool,getFilesFromEvent:_.func,onFileDialogCancel:_.func,onFileDialogOpen:_.func,useFsAccessApi:_.bool,autoFocus:_.bool,onDragEnter:_.func,onDragLeave:_.func,onDragOver:_.func,onDrop:_.func,onDropAccepted:_.func,onDropRejected:_.func,onError:_.func,validator:_.func};var Wh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function yu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=ot(ot({},cx),e),r=t.accept,n=t.disabled,i=t.getFilesFromEvent,a=t.maxSize,o=t.minSize,s=t.multiple,u=t.maxFiles,l=t.onDragEnter,c=t.onDragLeave,f=t.onDragOver,d=t.onDrop,h=t.onDropAccepted,m=t.onDropRejected,g=t.onFileDialogCancel,y=t.onFileDialogOpen,b=t.useFsAccessApi,x=t.autoFocus,C=t.preventDropOnDocument,M=t.noClick,w=t.noKeyboard,k=t.noDrag,T=t.noDragEventsBubbling,O=t.onError,P=t.validator,B=v.useMemo(function(){return SJ(r)},[r]),H=v.useMemo(function(){return CJ(r)},[r]),pe=v.useMemo(function(){return typeof y=="function"?y:fx},[y]),ne=v.useMemo(function(){return typeof g=="function"?g:fx},[g]),K=v.useRef(null),G=v.useRef(null),j=v.useReducer(RJ,Wh),U=Nh(j,2),Ce=U[0],fe=U[1],D=Ce.isFocused,$=Ce.isFileDialogActive,W=v.useRef(typeof window<"u"&&window.isSecureContext&&b&&wJ()),se=function(){!W.current&&$&&setTimeout(function(){if(G.current){var he=G.current.files;he.length||(fe({type:"closeDialog"}),ne())}},300)};v.useEffect(function(){return window.addEventListener("focus",se,!1),function(){window.removeEventListener("focus",se,!1)}},[G,$,ne,W]);var Z=v.useRef([]),ce=function(he){K.current&&K.current.contains(he.target)||(he.preventDefault(),Z.current=[])};v.useEffect(function(){return C&&(document.addEventListener("dragover",ax,!1),document.addEventListener("drop",ce,!1)),function(){C&&(document.removeEventListener("dragover",ax),document.removeEventListener("drop",ce))}},[K,C]),v.useEffect(function(){return!n&&x&&K.current&&K.current.focus(),function(){}},[K,x,n]);var ie=v.useCallback(function(V){O?O(V):console.error(V)},[O]),le=v.useCallback(function(V){V.preventDefault(),V.persist(),Ye(V),Z.current=[].concat(AJ(Z.current),[V.target]),mu(V)&&Promise.resolve(i(V)).then(function(he){if(!(gu(V)&&!T)){var st=he.length,lt=st>0&&vJ({files:he,accept:B,minSize:o,maxSize:a,multiple:s,maxFiles:u,validator:P}),Dt=st>0&&!lt;fe({isDragAccept:lt,isDragReject:Dt,isDragActive:!0,type:"setDraggedFiles"}),l&&l(V)}}).catch(function(he){return ie(he)})},[i,l,ie,T,B,o,a,s,u,P]),ee=v.useCallback(function(V){V.preventDefault(),V.persist(),Ye(V);var he=mu(V);if(he&&V.dataTransfer)try{V.dataTransfer.dropEffect="copy"}catch{}return he&&f&&f(V),!1},[f,T]),X=v.useCallback(function(V){V.preventDefault(),V.persist(),Ye(V);var he=Z.current.filter(function(lt){return K.current&&K.current.contains(lt)}),st=he.indexOf(V.target);st!==-1&&he.splice(st,1),Z.current=he,!(he.length>0)&&(fe({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),mu(V)&&c&&c(V))},[K,c,T]),te=v.useCallback(function(V,he){var st=[],lt=[];V.forEach(function(Dt){var dn=nx(Dt,B),Br=Nh(dn,2),Gn=Br[0],Do=Br[1],$o=ix(Dt,o,a),fa=Nh($o,2),Io=fa[0],Fo=fa[1],jo=P?P(Dt):null;if(Gn&&Io&&!jo)st.push(Dt);else{var Lo=[Do,Fo];jo&&(Lo=Lo.concat(jo)),lt.push({file:Dt,errors:Lo.filter(function(Ro){return Ro})})}}),(!s&&st.length>1||s&&u>=1&&st.length>u)&&(st.forEach(function(Dt){lt.push({file:Dt,errors:[mJ]})}),st.splice(0)),fe({acceptedFiles:st,fileRejections:lt,type:"setFiles"}),d&&d(st,lt,he),lt.length>0&&m&&m(lt,he),st.length>0&&h&&h(st,he)},[fe,s,B,o,a,u,d,h,m,P]),Se=v.useCallback(function(V){V.preventDefault(),V.persist(),Ye(V),Z.current=[],mu(V)&&Promise.resolve(i(V)).then(function(he){gu(V)&&!T||te(he,V)}).catch(function(he){return ie(he)}),fe({type:"reset"})},[i,te,ie,T]),F=v.useCallback(function(){if(W.current){fe({type:"openDialog"}),pe();var V={multiple:s,types:H};window.showOpenFilePicker(V).then(function(he){return i(he)}).then(function(he){te(he,null),fe({type:"closeDialog"})}).catch(function(he){EJ(he)?(ne(he),fe({type:"closeDialog"})):TJ(he)?(W.current=!1,G.current?(G.current.value=null,G.current.click()):ie(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ie(he)});return}G.current&&(fe({type:"openDialog"}),pe(),G.current.value=null,G.current.click())},[fe,pe,ne,b,te,ie,H,s]),Je=v.useCallback(function(V){!K.current||!K.current.isEqualNode(V.target)||(V.key===" "||V.key==="Enter"||V.keyCode===32||V.keyCode===13)&&(V.preventDefault(),F())},[K,F]),J=v.useCallback(function(){fe({type:"focus"})},[]),z=v.useCallback(function(){fe({type:"blur"})},[]),re=v.useCallback(function(){M||(xJ()?setTimeout(F,0):F())},[M,F]),de=function(he){return n?null:he},Xe=function(he){return w?null:de(he)},Ue=function(he){return k?null:de(he)},Ye=function(he){T&&he.stopPropagation()},pt=v.useMemo(function(){return function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=V.refKey,st=he===void 0?"ref":he,lt=V.role,Dt=V.onKeyDown,dn=V.onFocus,Br=V.onBlur,Gn=V.onClick,Do=V.onDragEnter,$o=V.onDragOver,fa=V.onDragLeave,Io=V.onDrop,Fo=vu(V,MJ);return ot(ot(zh({onKeyDown:Xe(Tr(Dt,Je)),onFocus:Xe(Tr(dn,J)),onBlur:Xe(Tr(Br,z)),onClick:de(Tr(Gn,re)),onDragEnter:Ue(Tr(Do,le)),onDragOver:Ue(Tr($o,ee)),onDragLeave:Ue(Tr(fa,X)),onDrop:Ue(Tr(Io,Se)),role:typeof lt=="string"&&lt!==""?lt:"presentation"},st,K),!n&&!w?{tabIndex:0}:{}),Fo)}},[K,Je,J,z,re,le,ee,X,Se,w,k,n]),gt=v.useCallback(function(V){V.stopPropagation()},[]),Nr=v.useMemo(function(){return function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=V.refKey,st=he===void 0?"ref":he,lt=V.onChange,Dt=V.onClick,dn=vu(V,OJ),Br=zh({accept:B,multiple:s,type:"file",style:{display:"none"},onChange:de(Tr(lt,Se)),onClick:de(Tr(Dt,gt)),tabIndex:-1},st,G);return ot(ot({},Br),dn)}},[G,r,s,Se,n]);return ot(ot({},Ce),{},{isFocused:D&&!n,getRootProps:pt,getInputProps:Nr,rootRef:K,inputRef:G,open:de(F)})}function RJ(e,t){switch(t.type){case"focus":return ot(ot({},e),{},{isFocused:!0});case"blur":return ot(ot({},e),{},{isFocused:!1});case"openDialog":return ot(ot({},Wh),{},{isFileDialogActive:!0});case"closeDialog":return ot(ot({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ot(ot({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ot(ot({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ot({},Wh);default:return e}}function fx(){}const NJ=["pdf"],BJ=["txt"],zJ=["psd"],VJ=["doc","docx"],WJ=["xls","xlsx"],HJ=["zip","rar","iso"],UJ=["ai","esp"],YJ=["ppt","pptx"],GJ=["wav","aif","mp3","aac"],qJ=["jpg","jpeg","gif","bmp","png","svg"],KJ=["m4v","avi","mpg","mp4","webm"],Qt=e=>`/assets/icons/files/${e}.svg`;function dx(e){let t;switch(e==null?void 0:e.includes(zt(e))){case BJ.includes(zt(e)):t="txt";break;case HJ.includes(zt(e)):t="zip";break;case GJ.includes(zt(e)):t="audio";break;case qJ.includes(zt(e)):t="image";break;case KJ.includes(zt(e)):t="video";break;case VJ.includes(zt(e)):t="word";break;case WJ.includes(zt(e)):t="excel";break;case YJ.includes(zt(e)):t="powerpoint";break;case NJ.includes(zt(e)):t="pdf";break;case zJ.includes(zt(e)):t="photoshop";break;case UJ.includes(zt(e)):t="illustrator";break;default:t=zt(e)}return t}function XJ(e){let t;switch(dx(e)){case"folder":t=Qt("ic_folder");break;case"txt":t=Qt("ic_txt");break;case"zip":t=Qt("ic_zip");break;case"audio":t=Qt("ic_audio");break;case"video":t=Qt("ic_video");break;case"word":t=Qt("ic_word");break;case"excel":t=Qt("ic_excel");break;case"powerpoint":t=Qt("ic_power_point");break;case"pdf":t=Qt("ic_pdf");break;case"photoshop":t=Qt("ic_pts");break;case"illustrator":t=Qt("ic_ai");break;case"image":t=Qt("ic_img");break;default:t=Qt("ic_file")}return t}function zt(e=""){return e&&e.split(".").pop()||""}function ZJ(e){return e.split("/").pop()}function Hh(e){return typeof e=="string"?{key:e,preview:e,name:ZJ(e),type:zt(e)}:{key:e.preview,name:e.name,size:e.size,path:e.path,type:e.type,preview:e.preview,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate}}const hx=({onDownload:e})=>{const t=hi();return p.jsx(S.IconButton,{onClick:e,sx:{p:0,top:0,right:0,width:1,height:1,zIndex:9,opacity:0,position:"absolute",borderRadius:"unset",justifyContent:"center",bgcolor:"grey.800",color:"common.white",transition:t.transitions.create("opacity"),"&:hover":{opacity:1,...V5({opacity:.64,color:t.palette.grey[900]})}},children:p.jsx(Le,{icon:"eva:arrow-circle-down-fill",width:24})})},px=({file:e,tooltip:t,imageView:r,onDownload:n,sx:i,imgSx:a})=>{const{name:o="",path:s="",preview:u=""}=Hh(e),l=dx(s||u),c=l==="image"&&r?p.jsx(S.Box,{component:"img",src:u,sx:{width:1,height:1,flexShrink:0,objectFit:"cover",...a}}):p.jsx(S.Box,{component:"img",src:XJ(l),sx:{width:32,height:32,flexShrink:0,...i}});return t?p.jsx(S.Tooltip,{title:o,children:p.jsxs(S.Stack,{flexShrink:0,component:"span",alignItems:"center",justifyContent:"center",sx:{width:"fit-content",height:"inherit"},children:[c,n&&p.jsx(hx,{onDownload:n})]})}):p.jsxs(p.Fragment,{children:[c,n&&p.jsx(hx,{onDownload:n})]})},gx=({fileRejections:e})=>e.length?p.jsx(S.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>L(t.palette.error.main,.08),borderColor:t=>L(t.palette.error.main,.24)},children:e.map(({file:t,errors:r})=>{const{path:n,size:i}=Hh(t);return p.jsxs(S.Box,{sx:{my:1},children:[p.jsxs(S.Typography,{variant:"subtitle2",noWrap:!0,children:[n," - ",i?Th(i):""]}),r.map(a=>p.jsxs(S.Box,{component:"span",sx:{typography:"caption"},children:["- ",a.message]},a.code))]},n)})}):null,QJ=({thumbnail:e,files:t,onRemove:r,sx:n})=>t!=null&&t.length?p.jsx(C1,{initial:!1,children:t.map(i=>{const{key:a,name:o="",size:s=0}=Hh(i),u=typeof i=="string";return e?p.jsxs(S.Stack,{component:Ft.div,...pa().inUp,alignItems:"center",display:"inline-flex",justifyContent:"center",sx:{m:.5,width:80,height:80,borderRadius:1.25,overflow:"hidden",position:"relative",border:l=>`solid 1px ${l.palette.divider}`,...n},children:[p.jsx(px,{tooltip:!0,imageView:!0,file:i,sx:{position:"absolute"},imgSx:{position:"absolute"}}),r&&p.jsx(S.IconButton,{size:"small",onClick:()=>r(i),sx:{top:4,right:4,p:"1px",position:"absolute",color:l=>L(l.palette.common.white,.72),bgcolor:l=>L(l.palette.grey[900],.48),"&:hover":{bgcolor:l=>L(l.palette.grey[900],.72)}},children:p.jsx(Le,{icon:"eva:close-fill",width:16})})]},a):p.jsxs(S.Stack,{component:Ft.div,...pa().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:l=>`solid 1px ${l.palette.divider}`,...n},children:[p.jsx(px,{file:i}),p.jsxs(S.Stack,{flexGrow:1,sx:{minWidth:0},children:[p.jsx(S.Typography,{variant:"subtitle2",noWrap:!0,children:u?i:o}),p.jsx(S.Typography,{variant:"caption",sx:{color:"text.secondary"},children:u?"":Th(s)})]}),r&&p.jsx(S.IconButton,{edge:"end",size:"small",onClick:()=>r(i),children:p.jsx(Le,{icon:"eva:close-fill"})})]},a)})}):null,JJ=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return p.jsx(S.Stack,{position:"absolute",width:1,height:1,maxHeight:"100%",alignItems:"center",justifyContent:"center",top:0,right:0,bottom:0,left:0,padding:2,margin:"auto",children:p.jsx("img",{alt:"file preview",src:t,style:{borderRadius:8,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},eee=Qr("div")(({theme:e})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`1px dashed ${L(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),tee=({header:e,description:t,sx:r,...n})=>p.jsxs(S.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...r},...n,children:[p.jsx(gX,{sx:{width:220}}),p.jsxs("div",{children:[p.jsx(S.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),p.jsx(S.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||p.jsxs(p.Fragment,{children:["Solte os arquivos aqui ou clique",p.jsx(S.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),mx=({id:e,disabled:t,multiple:r=!1,error:n,helperText:i,file:a,onDelete:o,files:s,thumbnail:u,onUpload:l,onRemove:c,onRemoveAll:f,sx:d,dropZoneProps:h,placeholderProps:m,placeholderAlt:g,image:y,tabIndex:b,...x})=>{const{getRootProps:C,getInputProps:M,isDragActive:w,isDragReject:k,fileRejections:T}=yu({multiple:r,disabled:t,...x}),O=!!a&&!r||y,P=s&&r&&s.length>0,B=k||!!n;return p.jsxs(S.Box,{sx:{width:1,position:"relative",...d},children:[p.jsxs(eee,{...C(),sx:{...w&&{opacity:.72},...B&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...t&&{opacity:.48,pointerEvents:"none"},...h},children:[p.jsx("input",{...M(),id:e,tabIndex:b}),g?p.jsx(S.Stack,{sx:{...O&&{opacity:0}},children:g}):p.jsx(tee,{sx:{...O&&{opacity:0}},header:m==null?void 0:m.title,description:m==null?void 0:m.description}),O&&p.jsx(JJ,{file:a||y||""})]}),i&&p.jsx(S.FormHelperText,{error:!!n,sx:H=>({mx:"14px",color:t?H.palette.grey[500]:void 0}),children:i}),p.jsx(gx,{fileRejections:T}),O&&o&&p.jsx(S.IconButton,{size:"small",onClick:o,sx:{top:16,right:16,zIndex:9,position:"absolute",color:H=>L(H.palette.common.white,.8),bgcolor:H=>L(H.palette.grey[900],.72),"&:hover":{bgcolor:H=>L(H.palette.grey[900],.48)}},children:p.jsx(Le,{icon:"eva:close-fill",width:18})}),P&&p.jsxs(p.Fragment,{children:[p.jsx(S.Box,{sx:{my:3},children:p.jsx(QJ,{files:s,thumbnail:u,onRemove:c})}),p.jsxs(S.Stack,{direction:"row",justifyContent:"flex-end",spacing:1.5,children:[f&&p.jsx(S.Button,{color:"inherit",variant:"outlined",size:"small",onClick:f,children:"Remove all"}),l&&p.jsx(S.Button,{size:"small",variant:"contained",onClick:l,children:"Upload files"})]})]})]})},ree=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return p.jsx("img",{alt:"avatar",src:t,style:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},nee=Qr("div")(({theme:e})=>({width:144,height:144,margin:"auto",display:"flex",cursor:"pointer",overflow:"hidden",borderRadius:"50%",alignItems:"center",position:"relative",justifyContent:"center",border:`1px dashed ${L(e.palette.grey[500],.32)}`})),iee=Qr("div")(({theme:e})=>({zIndex:7,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",flexDirection:"column",justifyContent:"center",width:"calc(100% - 16px)",height:"calc(100% - 16px)",color:e.palette.text.disabled,backgroundColor:e.palette.background.neutral,transition:e.transitions.create("opacity",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.shorter})})),vx=({error:e,file:t,image:r,disabled:n,helperText:i,sx:a,tabIndex:o,...s})=>{const{getRootProps:u,getInputProps:l,isDragActive:c,isDragReject:f,fileRejections:d}=yu({multiple:!1,disabled:n,...s}),h=!!t||r,m=f||!!e;return p.jsxs(p.Fragment,{children:[p.jsxs(nee,{...u(),sx:{...c&&{opacity:.72},...m&&{borderColor:"error.light",...h&&{bgcolor:"error.lighter"}},...n&&{opacity:.48,pointerEvents:"none"},...h&&{"&:hover":{"& .placeholder":{opacity:1}}},...a},children:[p.jsx("input",{...l(),tabIndex:o}),h&&p.jsx(ree,{file:t||r||""}),p.jsxs(iee,{className:"placeholder",sx:{"&:hover":{opacity:.72},...h&&{zIndex:9,opacity:0,color:"common.white",bgcolor:g=>L(g.palette.grey[900],.64)},...m&&{color:"error.main",bgcolor:"error.lighter"}},children:[p.jsx(Le,{icon:"ic:round-add-a-photo",width:24,sx:{mb:1}}),p.jsx(S.Typography,{variant:"caption",children:t?"Update photo":"Upload photo"})]})]}),i&&i,p.jsx(gx,{fileRejections:d})]})},aee=Qr("div")(({theme:e})=>({width:64,height:64,fontSize:24,display:"flex",flexShrink:0,cursor:"pointer",alignItems:"center",justifyContent:"center",margin:e.spacing(.5),color:e.palette.text.disabled,borderRadius:e.shape.borderRadius,border:`dashed 1px ${e.palette.divider}`,backgroundColor:L(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),oee=({placeholderAlt:e,error:t,disabled:r,sx:n,tabIndex:i,...a})=>{const{getRootProps:o,getInputProps:s,isDragActive:u,isDragReject:l}=yu({disabled:r,...a}),c=l||t;return p.jsxs(aee,{...o(),sx:{...u&&{opacity:.72},...c&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...r&&{opacity:.48,pointerEvents:"none"},...n},children:[p.jsx("input",{...s(),tabIndex:i}),e||p.jsx(Le,{icon:"eva:cloud-upload-fill",width:28})]})},see=e=>new Promise((t,r)=>{const n=new Image;n.addEventListener("load",()=>t(n)),n.addEventListener("error",i=>r(i)),n.setAttribute("crossOrigin","anonymous"),n.src=e});function yx(e){return e*Math.PI/180}function lee(e,t,r){const n=yx(r);return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}async function uee(e,t,r=0,n={horizontal:!1,vertical:!1}){const i=await see(e),a=document.createElement("canvas"),o=a.getContext("2d");if(!o)return null;const s=yx(r),{width:u,height:l}=lee(i.width,i.height,r);a.width=u,a.height=l,o.translate(u/2,l/2),o.rotate(s),o.scale(n.horizontal?-1:1,n.vertical?-1:1),o.translate(-i.width/2,-i.height/2),o.drawImage(i,0,0);const c=o.getImageData(t.x,t.y,t.width,t.height);return a.width=t.width,a.height=t.height,o.putImageData(c,0,0),new Promise((f,d)=>{a.toBlob(h=>{f(h)},"image/png")})}const bx=({onFileCropped:e,onImageUploaded:t,onCancel:r,image:n})=>{const i=v.useId(),[a,o,s]=ph(),[u,l]=v.useState({x:0,y:0}),[c,f]=v.useState(1),d=v.useRef();return{id:i,crop:u,setCrop:l,zoom:c,setZoom:f,fileRef:d,onCropComplete:async(b,x)=>{try{const C=await uee(n,x,0);d.current=new File([C],"image.png",{type:C.type})}catch{e(void 0)}},saveChanges:()=>{e(d.current),o()},cancelChanges:()=>{r&&r(),s(!1)},handleRemove:()=>{e(void 0),t(void 0),l({x:0,y:0}),f(1),s(!1)},cropModalOpen:a,toggleCropModalOpen:o,setCropModalOpen:s}},xx=({id:e,open:t,onClose:r,label:n,onSave:i,onRemove:a,imgSrc:o,aspect:s,size:{height:u,width:l},crop:c,zoom:f,onCropComplete:d,onCropChange:h,onZoomChange:m})=>p.jsx(N5,{open:t,onClose:r,dialogTitle:n,actions:p.jsxs(p.Fragment,{children:[p.jsx(S.Button,{variant:"outlined",size:"medium",onClick:r,color:"inherit",children:"Cancelar"}),p.jsx(S.Button,{variant:"contained",size:"medium",onClick:i,children:"Salvar"})]}),children:p.jsxs(S.Stack,{gap:2,children:[p.jsx(g5,{image:{width:l,height:u,aspect:s,imgSrc:o},crop:c,zoom:f,onCropComplete:d,onCropChange:h,onZoomChange:m}),p.jsxs(S.Stack,{gap:1.5,children:[p.jsxs(S.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",mr:"auto",children:[p.jsx(S.Typography,{variant:"body1",children:"Zoom"}),p.jsx(S.Slider,{value:f,onChange:(g,y)=>m(Array.isArray(y)?y[0]:y),min:1,max:5,size:"medium",step:.5})]}),p.jsxs(S.Stack,{direction:"row",gap:2,children:[p.jsx(S.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:p.jsx(Le,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:a,children:"Remover"}),p.jsx(S.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:p.jsx(Le,{icon:"ic:outline-image-search",color:dh.main}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})}),cee=S.styled(S.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),fee=S.styled(S.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:S.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),dee=S.styled(S.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),wx=({onFileCropped:e,onImageUploaded:t,onCancel:r,aspect:n,size:i,label:a,image:o="",uploading:s,file:u,tabIndex:l,...c})=>{const{id:f,crop:d,cropModalOpen:h,zoom:m,cancelChanges:g,handleRemove:y,onCropComplete:b,saveChanges:x,setCrop:C,setCropModalOpen:M,setZoom:w,toggleCropModalOpen:k}=bx({image:o,onFileCropped:e,onImageUploaded:t,onCancel:r});return p.jsxs(p.Fragment,{children:[p.jsxs(cee,{children:[s&&p.jsx(ql,{}),p.jsx(mx,{...c,id:f,file:u,onDrop:T=>{if(T.length>0){M(!0),w(1),C({x:0,y:0});const O=new FileReader;O.addEventListener("load",()=>{var B;const P=((B=O.result)==null?void 0:B.toString())||"";t(P),e(void 0)}),O.readAsDataURL(T[0])}},image:o,tabIndex:l}),(u||o)&&p.jsxs(fee,{className:"actions",children:[p.jsx(S.Button,{color:"inherit",startIcon:p.jsx(Le,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:y,children:"Remover"}),p.jsx(S.Button,{color:"inherit",startIcon:p.jsx(Le,{icon:"ic:outline-image",color:dh.main}),onClick:k,children:"Editar"})]})]}),p.jsx(xx,{id:f,open:h,onClose:g,label:a,aspect:n,crop:d,zoom:m,onCropComplete:b,onCropChange:C,onZoomChange:w,imgSrc:o,onRemove:y,onSave:x,size:i})]})},Cx=({name:e,helperText:t,rules:r,onSelectOption:n,...i})=>{const{control:a}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:a,rules:r,render:({field:o,fieldState:{error:s}})=>p.jsx(Af,{...o,...i,onChange:u=>{n&&n(u),o.onChange(u)},error:!!s,helperText:(s==null?void 0:s.message)||t})})},At=({name:e,helperText:t,rules:r,onChange:n,tabIndex:i,...a})=>{const{control:o}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:o,rules:r,render:({field:{ref:s,...u},fieldState:{error:l}})=>p.jsx(S.TextField,{...u,onChange:c=>{u.onChange(c),n&&n(c)},inputRef:s,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...a,inputProps:{...a.inputProps,tabIndex:i}})})},Sx=({name:e,helperText:t,rules:r,...n})=>{const{control:i}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:i,rules:r,render:({field:{name:a,onChange:o,value:s,ref:u},fieldState:{error:l}})=>p.jsx($h,{ref:u,...n,name:a,value:s,error:!!l,helperText:(l==null?void 0:l.message)||t,onChange:({target:{value:c}})=>o(c)})})},hee=({name:e,containerProps:t,required:r,rules:n,tabIndex:i})=>{const a=`${e}.zipCode`,o=`${e}.publicPlace`,s=`${e}.number`,u=`${e}.district`,l=`${e}.complement`,c=`${e}.state`,f=`${e}.city`,d=h=>{h.key==="Enter"&&h.preventDefault()};return p.jsxs(S.Stack,{gap:1.5,...t,children:[p.jsxs(S.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[p.jsx(Sx,{name:a,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:p.jsx(S.InputAdornment,{position:"end",children:p.jsx(S.CircularProgress,{size:24})})},rules:n,onKeyDown:d,required:r,sx:{width:"auto",flex:1,minWidth:160},tabIndex:i}),p.jsxs(S.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[p.jsx(At,{name:o,label:"Logradouro",onKeyDown:d,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:i}),p.jsx(At,{name:s,label:"Número",onKeyDown:d,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:i})]})]}),p.jsxs(S.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[p.jsx(At,{name:u,label:"Bairro",onKeyDown:d,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:i}),p.jsx(At,{name:l,label:"Complemento",onKeyDown:d,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:i})]}),p.jsxs(S.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[p.jsx(Cx,{name:c,label:"Estado",options:[],disabled:!0,required:r,sx:{flex:1},tabIndex:i}),p.jsx(At,{name:f,label:"Cidade",disabled:!0,required:r,sx:{flex:1},tabIndex:i})]})]})},pee=({name:e,rules:t,helperText:r,tabIndex:n,...i})=>{const{control:a}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:a,rules:t,render:({field:o,fieldState:{error:s}})=>p.jsxs("div",{children:[p.jsx(S.FormControlLabel,{control:p.jsx(S.Checkbox,{...o,checked:o.value,tabIndex:n}),...i}),(!!s||r)&&p.jsx(S.FormHelperText,{error:!!s,children:s?s==null?void 0:s.message:r})]})})},gee=({row:e,name:t,rules:r,label:n,options:i,spacing:a,helperText:o,required:s,...u})=>{const{control:l}=Ee.useFormContext(),c=(f,d)=>f.includes(d)?f.filter(h=>h!==d):[...f,d];return p.jsx(Ee.Controller,{name:t,control:l,rules:r,render:({field:{value:f=[],...d},fieldState:{error:h}})=>p.jsxs(S.FormControl,{component:"fieldset",children:[n&&p.jsx(S.FormLabel,{component:"legend",sx:{typography:"body2"},required:s,children:n}),p.jsx(S.FormGroup,{sx:{...e&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:a||0},...e&&{mr:0,"&:not(:last-of-type)":{mr:a||2}}}},children:i.map(m=>p.jsx(S.FormControlLabel,{control:p.jsx(S.Checkbox,{checked:f.includes(m.value),onChange:()=>d.onChange(c(f,m.value))}),label:m.label,...u},m.value))}),(!!h||o)&&p.jsx(S.FormHelperText,{error:!!h,sx:m=>({color:u.disabled?m.palette.grey[500]:void 0}),children:h?h==null?void 0:h.message:o})]})})},mee=({keyName:e,inputs:t=[],rules:r,tabIndex:n,...i})=>{const a=v.useRef(null),{control:o,setValue:s,formState:{errors:u}}=Ee.useFormContext(),l=d=>{const h=d.clipboardData.getData("text").split("");t.map((m,g)=>s(m,h[g])),d.preventDefault()},c=(d,h)=>{const{maxLength:m,value:g,name:y}=d.target,b=y.replace(e,""),x=Number(b),C=document.querySelector(`input[name=${e}${x+1}]`);g.length>m&&(d.target.value=g[0]),g.length>=m&&x<6&&C!==null&&C.focus(),h(d)};hh("paste",l,a);const f=t.some(d=>u[d]);return p.jsxs(S.Stack,{children:[p.jsx(S.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:a,children:t.map((d,h)=>p.jsx(Ee.Controller,{name:`${e}${h+1}`,control:o,rules:r,render:({field:m,fieldState:{error:g}})=>p.jsx(S.TextField,{...i,...m,autoComplete:"none",error:!!g,autoFocus:h===0,placeholder:"-",onChange:y=>{c(y,m.onChange)},onFocus:y=>y.currentTarget.select(),InputProps:{sx:{width:{xs:36,sm:56},height:{xs:36,sm:56},"& input":{p:0,textAlign:"center"}}},inputProps:{maxLength:1,type:"number",tabIndex:n}})},d))}),f&&p.jsx(S.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},vee=({name:e,rules:t,helperText:r,...n})=>{const{control:i}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:i,rules:{...t,validate:{...t==null?void 0:t.validate,validation:a=>{const o="#"+a.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(o)?!0:"Cor inválida"}}},render:({field:{ref:a,onChange:o,...s},fieldState:{error:u}})=>p.jsx(Ry,{...s,onChangeColor:o,inputRef:a,fullWidth:!0,error:!!u,helperText:(u==null?void 0:u.message)||r,...n})})},yee=({name:e,rules:t,tabIndex:r,helperText:n,required:i,...a})=>{const{control:o}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:o,rules:t,render:({field:{ref:s,...u},fieldState:{error:l}})=>{var c;return p.jsx(qn.DatePicker,{inputRef:s,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...a.localeText},...u,...a,value:u.value?new Date(u.value):null,slotProps:{textField:{...(c=a.slotProps)==null?void 0:c.textField,required:i,error:!!l,helperText:(l==null?void 0:l.message)||n,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:r}},openPickerButton:{tabIndex:r}}})}})},bee=({name:e,label:t,rules:r,tabIndex:n,helperText:i,required:a,...o})=>{const{control:s,setError:u}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:s,rules:r,render:({field:{value:l,onChange:c},fieldState:{error:f}})=>p.jsx(qn.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...o.localeText},value:[(l==null?void 0:l.startDate)||null,(l==null?void 0:l.endDate)||null],onChange:d=>c({startDate:d[0],endDate:d[1]}),onError:d=>{u(e,{message:d[0]||d[1]||void 0})},...o,slotProps:{textField:({position:d})=>{var h;return{...(h=o.slotProps)==null?void 0:h.textField,required:a,error:!!f,helperText:(f==null?void 0:f.message)||i,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:d==="start"?`${t} (Dt. Início)`:`${t} (Dt. Fim)`,inputProps:{tabIndex:n}}}},sx:{width:1}})})},xee=({name:e,rules:t,tabIndex:r,helperText:n,required:i,...a})=>{const{control:o}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:o,rules:t,render:({field:{ref:s,...u},fieldState:{error:l}})=>{var c;return p.jsx(qn.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:s,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...a.localeText},...u,...a,value:u.value?new Date(u.value):null,slotProps:{textField:{...(c=a.slotProps)==null?void 0:c.textField,required:i,error:!!l,helperText:(l==null?void 0:l.message)||n,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:r}},openPickerButton:{tabIndex:r}}})}})},wee=({id:e,children:t,onSubmit:r,methods:n,...i})=>p.jsx(Ee.FormProvider,{...n,children:p.jsx(S.Stack,{component:"form",id:e,onSubmit:r,flex:1,width:1,noValidate:!0,...i,children:t})}),Cee=({name:e,helperText:t,rules:r,...n})=>{const{control:i}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:i,rules:r,render:({field:{ref:a,value:o,...s},fieldState:{error:u}})=>p.jsx(Oh,{value:o,inputRef:a,fullWidth:!0,error:!!u,helperText:(u==null?void 0:u.message)||t,...n,...s,name:e})})},See=({name:e,helperText:t,rules:r,onChange:n,...i})=>{const{control:a}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:a,rules:r,render:({field:o,fieldState:{error:s}})=>p.jsx(au,{...o,onChange:u=>{o.onChange(u),n&&n(u)},fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||t,...i})})},Eee=({name:e,sx:t,rules:r,passwordSize:n,specialCharacter:i,upperCaseChar:a,numberChar:o,...s})=>{const{watch:u}=Ee.useFormContext(),l=u(e),[c,f]=v.useState(!1),{hasNumberChar:d,hasSpecialCharacter:h,hasUpperCaseChar:m,isLengthValid:g}=cu(l,n,o,i,a);return p.jsx(At,{...s,name:e,type:c?"text":"password",InputProps:{endAdornment:p.jsx(S.InputAdornment,{position:"end",children:p.jsx(S.IconButton,{onClick:()=>f(!c),edge:"end","aria-label":"Mostrar/Ocultar senha",children:p.jsx(Le,{icon:c?"eva:eye-off-fill":"eva:eye-fill"})})})},rules:{...r,validate:{...r==null?void 0:r.validate,validationPassword:y=>{const b=cu(y,n,o,i,a);return!b.hasNumberChar||!b.hasSpecialCharacter||!b.hasUpperCaseChar||!b.isLengthValid?"Senha inválida":!0}}},sx:{...t,"& .MuiFormHelperText-root":{display:!h||!m||!g||!d?"none":void 0}}})},Uh=({name:e,rules:t,row:r,label:n,options:i,spacing:a,helperText:o,decorated:s,onChange:u,tabIndex:l,required:c,disabled:f,...d})=>{const{control:h}=Ee.useFormContext(),m=n?`${e}-${n}`:"";return p.jsx(Ee.Controller,{name:e,control:h,rules:t,render:({field:g,fieldState:{error:y}})=>p.jsxs(S.FormControl,{component:"fieldset",sx:{...s&&{paddingLeft:1.5}},children:[n&&p.jsx(S.FormLabel,{component:"legend",id:m,sx:{typography:"body2"},required:c,children:n}),p.jsx(S.RadioGroup,{...d,...g,onChange:(b,x)=>{g.onChange(b),u&&u(b,x)},"aria-labelledby":m,row:r,children:i.map(b=>p.jsx(S.FormControlLabel,{value:b.value,control:p.jsx(S.Radio,{inputProps:{tabIndex:l},disabled:f,checked:b.value===g.value}),label:b.label,sx:({palette:x})=>({"&:not(:last-of-type)":{mb:a||0},...r&&{mr:0,"&:not(:last-of-type)":{mr:a||2}},...s&&{border:`1px solid ${S.alpha(x.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(a||0)/2||1,...g.value===b.value&&{borderColor:"primary.main",backgroundColor:S.alpha(x.primary.main,.05)}}})},b.value))}),(!!y||o)&&p.jsx(S.FormHelperText,{error:!!y,sx:b=>({color:f?b.palette.grey[500]:void 0}),children:y?y==null?void 0:y.message:o})]})})},Ex=({name:e,helperText:t,onChange:r,tabIndex:n,...i})=>{const{control:a}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:a,render:({field:o,fieldState:{error:s}})=>p.jsxs("div",{children:[p.jsx(S.FormControlLabel,{control:p.jsx(S.Switch,{...o,checked:o.value,onChange:(u,l)=>{o.onChange(u),r&&r(u,l)},inputProps:{tabIndex:n}}),...i}),(!!s||t)&&p.jsx(S.FormHelperText,{error:!!s,sx:u=>({mx:"14px",color:i.disabled?u.palette.grey[500]:void 0}),children:s?s==null?void 0:s.message:t})]})})},Tee=({name:e,rules:t,tabIndex:r,helperText:n,required:i,...a})=>{const{control:o}=Ee.useFormContext();return p.jsx(Ee.Controller,{name:e,control:o,rules:t,render:({field:{ref:s,...u},fieldState:{error:l}})=>{var c;return p.jsx(qn.TimePicker,{ampm:!1,format:"HH:mm",inputRef:s,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...a.localeText},...u,...a,value:u.value?new Date(u.value):null,slotProps:{textField:{...(c=a.slotProps)==null?void 0:c.textField,error:!!l,required:i,helperText:(l==null?void 0:l.message)||n,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:r}},openPickerButton:{tabIndex:r}}})}})};function Tx(e,t){const{watch:r,setValue:n}=Ee.useFormContext(),[i,a]=v.useState(t),o=r(e)||[];return{uploadFile:async d=>{if(!d){n(e,void 0),a(void 0);return}n(e,d),a(Object.assign(d,{preview:URL.createObjectURL(d)}))},uploadFiles:async d=>{n(e,[...o,...d.map(h=>Object.assign(h,{preview:URL.createObjectURL(h)}))])},handleDeleteFile:()=>{n(e,void 0),a(void 0)},handleRemoveAll:()=>{n(e,void 0)},handleRemove:d=>{const h=o.filter(m=>m!==d);n(e,h)},file:i,setFileValue:a}}const kee=({name:e,rules:t,helperText:r,aspect:n,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:u,onCancel:l,...c})=>{const{control:f}=Ee.useFormContext(),{uploadFile:d,file:h,setFileValue:m}=Tx(e);return p.jsx(Ee.Controller,{name:e,control:f,rules:t,render:({field:{value:g},fieldState:{error:y}})=>p.jsx(wx,{accept:{"image/*":[]},file:g?h:void 0,onFileCropped:b=>{d(b),s&&s(b)},onImageUploaded:u,onCancel:()=>{m(void 0),l&&l()},error:!!y,disableMultiple:!0,helperText:(!!y||r)&&p.jsx(S.FormHelperText,{error:!!y,sx:{px:2},children:y?y==null?void 0:y.message:r}),aspect:n,label:i,size:a,image:o,...c})})},_ee=({onFileCropped:e,onImageUploaded:t,onCancel:r,aspect:n,size:i,label:a,image:o="",uploading:s,file:u,tabIndex:l,...c})=>{const{id:f,crop:d,cropModalOpen:h,zoom:m,cancelChanges:g,handleRemove:y,onCropComplete:b,saveChanges:x,setCrop:C,setCropModalOpen:M,setZoom:w}=bx({image:o,onFileCropped:e,onImageUploaded:t,onCancel:r});return p.jsxs(p.Fragment,{children:[p.jsxs(S.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[s&&p.jsx(dee,{}),p.jsx(vx,{...c,id:f,file:u,onDrop:k=>{if(k.length>0){M(!0),w(1),C({x:0,y:0});const T=new FileReader;T.addEventListener("load",()=>{var P;const O=((P=T.result)==null?void 0:P.toString())||"";t(O),e(void 0)}),T.readAsDataURL(k[0])}},image:o,tabIndex:l})]}),p.jsx(xx,{id:f,open:h,onClose:g,label:a,aspect:n,crop:d,zoom:m,onCropComplete:b,onCropChange:C,onZoomChange:w,imgSrc:o,onRemove:y,onSave:x,size:i})]})},Mee=({name:e,rules:t,helperText:r,aspect:n,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:u,onCancel:l,...c})=>{const{control:f}=Ee.useFormContext(),{uploadFile:d,file:h,setFileValue:m}=Tx(e);return p.jsx(Ee.Controller,{name:e,control:f,rules:t,render:({field:{value:g},fieldState:{error:y}})=>p.jsx(_ee,{accept:{"image/*":[]},file:g?h:void 0,onFileCropped:b=>{d(b),s&&s(b)},onImageUploaded:u,onCancel:()=>{m(void 0),l&&l()},error:!!y,disableMultiple:!0,helperText:(!!y||r)&&p.jsx(S.FormHelperText,{error:!!y,sx:{px:2},children:y?y==null?void 0:y.message:r}),aspect:n,label:i,size:a,image:o,...c})})},Oee=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],Aee=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],Pee=S.styled(S.Stack)(({theme:e})=>({border:`1px solid ${S.alpha(e.palette.primary.main,.3)}`,backgroundColor:S.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),Dee=S.styled(S.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),$ee=S.styled(S.IconButton)(()=>({height:"38px",alignSelf:"center"})),Iee=({webhookData:e,isEditing:t=!1,haveTip:r=!1,onCreateHeaders:n,onRemoveHeader:i,headers:a,isLoading:o})=>p.jsxs(p.Fragment,{children:[r&&p.jsxs(Pee,{children:[p.jsx(Le,{icon:"material-symbols:info-rounded"}),p.jsx(S.Typography,{variant:"caption",color:"text.secondary",children:"Webhooks permitem que serviços externos sejam notificados quando determinados eventos acontecem. Saiba mais acessando a documentação do Webhook"})]}),t&&p.jsx(At,{name:"name",label:"Nome do webhook"}),p.jsxs(S.Stack,{direction:"row",gap:2,children:[p.jsx(At,{name:"url",label:"URL de endpoint"}),p.jsx(At,{name:"filter",label:"Filtro"})]}),t&&p.jsxs(p.Fragment,{children:[p.jsx(At,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),p.jsxs(S.Stack,{direction:"row",gap:2,children:[p.jsx(At,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),p.jsx(At,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:p.jsx(S.InputAdornment,{position:"end",children:p.jsx(Dee,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:p.jsx(Le,{className:"copyIcon",icon:"ic:baseline-content-copy"})})})}}),p.jsx(At,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),p.jsxs(S.Stack,{direction:"row",gap:2,children:[p.jsxs(S.Stack,{width:"35%",gap:2,children:[p.jsx(S.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),p.jsx(Uh,{name:"content_type",options:Oee,row:!0,decorated:!0})]}),p.jsxs(S.Stack,{gap:2,children:[p.jsx(S.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),p.jsx(Uh,{name:"http_method",options:Aee,row:!0,decorated:!0})]})]}),p.jsx(S.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),p.jsx(Ex,{name:"active",label:"Ativo"}),p.jsx(S.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),a==null?void 0:a.map((s,u)=>p.jsxs(S.Stack,{direction:"row",gap:2,children:[p.jsx(At,{name:`headers.${u}.name`,label:"Chave"}),p.jsx(At,{name:`headers.${u}.value`,label:"Valor"}),p.jsx($ee,{onClick:()=>i(u),color:"error",children:p.jsx(Le,{icon:"eva:trash-2-outline"})})]},s.id)),p.jsx(Tf,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>n(),children:"Adicionar novo cabeçalho"}),p.jsx(S.Divider,{}),p.jsx(S.Stack,{direction:"row",justifyContent:"flex-end",children:p.jsx(Tf,{actionType:"SAVE",type:"submit",loading:o,children:"Salvar"})})]}),Fee=Object.freeze(Object.defineProperty({__proto__:null,default:n9},Symbol.toStringTag,{value:"Module"}));A.ActionButton=Tf,A.Address=hee,A.Autocomplete=Af,A.AutocompleteField=Cx,A.BuilderLayout=UQ,A.BuilderSidebar=uX,A.Checkbox=pee,A.Codes=mee,A.ColorPickerField=vee,A.ColorPickerInput=Ry,A.Common=BK,A.CommonSSR=VK,A.Confirm=WK,A.CustomAvatar=Lb,A.CustomAvatarGroup=Rb,A.DataGrid=vX,A.DatePicker=yee,A.DateRangePicker=bee,A.DateTimePicker=xee,A.Delayed=yX,A.DialogAnimate=O9,A.Drawer=OX,A.EmptyContent=PX,A.EmptyView=Bb,A.FabButtonAnimate=O1,A.Field=At,A.FixedProgressBar=ql,A.Form=wee,A.HelpButton=Jb,A.IconButtonAnimate=A1,A.Iconify=Le,A.ImageCrop=g5,A.Incrementer=Oh,A.IncrementerField=Cee,A.Label=O5,A.LoadingScreen=FZ,A.MaskedInput=$h,A.MaskedInputField=Sx,A.MaterialDesignContent=Jg,A.MenuPopover=QZ,A.Modal=N5,A.ModalActions=nQ,A.MotionContainer=kC,A.MotionLazyContainer=Xc,A.MotionViewport=TC,A.MultiCheckbox=gee,A.NumberInput=au,A.NumberInputField=See,A.PasswordField=Eee,A.PasswordRules=uQ,A.Portal=B5,A.RadioGroupField=Uh,A.SavedChanges=IQ,A.Scrollbar=Qb,A.SearchInput=FQ,A.SnackbarContent=af,A.SnackbarProvider=rm,A.SplashScreen=jQ,A.Steps=NQ,A.StyledTab=BQ,A.StyledTabs=zQ,A.Switch=Ex,A.TRANSITION=Xh,A.TabPanel=VQ,A.TextAnimate=A9,A.ThemeProvider=jb,A.TimePicker=Tee,A.Transition=Bs,A.Upload=mx,A.UploadAvatar=vx,A.UploadAvatarWithCropField=Mee,A.UploadBox=oee,A.UploadWithCrop=wx,A.UploadWithCropField=kee,A.Webhook=Iee,A.cssStyles=TQ,A.file=cQ,A.formatNumber=uZ,A.formatTime=wQ,A.loadable=$Q,A.mask=PQ,A.number=nZ,A.routes=_Q,A.sort=AQ,A.useActiveElement=HK,A.useCopyToClipboard=UK,A.useDatagrid=YK,A.useDeepCompareEffect=JK,A.useEventListener=hh,A.useIsMounting=tX,A.useOffSetTop=aX,A.useOnClickOutside=iX,A.usePagination=nX,A.useResponsive=Og,A.useSnackbar=iS,A.useTabs=rX,A.useToggle=ph,A.uuidv4=DQ,A.validators=oQ,A.varBgColor=Hx,A.varBgKenburns=Ux,A.varBgPan=Yx,A.varBounce=zx,A.varContainer=No,A.varFade=pa,A.varFlip=Rx,A.varHover=Wx,A.varPath=Fx,A.varRotate=Vx,A.varScale=Bx,A.varSlide=Nx,A.varTranEnter=xe,A.varTranExit=ke,A.varTranHover=jx,A.varZoom=Lx,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
3
  "private": false,
4
- "version": "1.1.94",
4
+ "version": "1.1.95",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",