@zydon/common 1.3.36 → 1.3.37

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.
@@ -1,4 +1,4 @@
1
- import { p as rt, f as C, n as B, r as mn, c as gn, i as tt, d as Ts, a as yn, v as Vs, w as ie, b as yt, e as K, g as R, t as Pt, h as et, j as Ss, k as bs, l as k, m as nt, o as vn, q as xt, s as vt, u as As, x as Ds, y as Cs, z as at, A as Ms, B as Pn, C as Kt, D as xn, E as Tn, F as w, G as zt, H as dt, P as ws, I as Ls, L as Rs, S as Bs, J as Vn, K as Sn, M as bn, N as Et, O as jt, Q as ye, R as Ht, T as Fs, U as An, V as Dn, W as Es, X as js, Y as Cn, Z as Mn, _ as ks, $ as Is, a0 as Os, a1 as Us, a2 as Ns, a3 as Gs, a4 as $s, a5 as Ks, a6 as zs, a7 as Hs } from "./index-b8bd0606.js";
1
+ import { p as rt, f as C, n as B, r as mn, c as gn, i as tt, d as Ts, a as yn, v as Vs, w as ie, b as yt, e as K, g as R, t as Pt, h as et, j as Ss, k as bs, l as k, m as nt, o as vn, q as xt, s as vt, u as As, x as Ds, y as Cs, z as at, A as Ms, B as Pn, C as Kt, D as xn, E as Tn, F as w, G as zt, H as dt, P as ws, I as Ls, L as Rs, S as Bs, J as Vn, K as Sn, M as bn, N as Et, O as jt, Q as ye, R as Ht, T as Fs, U as An, V as Dn, W as Es, X as js, Y as Cn, Z as Mn, _ as ks, $ as Is, a0 as Os, a1 as Us, a2 as Ns, a3 as Gs, a4 as $s, a5 as Ks, a6 as zs, a7 as Hs } from "./index-5ef2750f.js";
2
2
  import wn, { useContext as _t, useId as _s, useEffect as Ws } from "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -7751,7 +7751,7 @@ const ulu = ({
7751
7751
  ...a,
7752
7752
  children: n
7753
7753
  }
7754
- ), Ir1 = () => import("./features-289807a6.js").then((e) => e.default), YHn = ({ children: e }) => /* @__PURE__ */ g.jsx(Yn1, { strict: !0, features: Ir1, children: /* @__PURE__ */ g.jsxs(An.div, { style: { height: "100%" }, children: [
7754
+ ), Ir1 = () => import("./features-ab7d0fc2.js").then((e) => e.default), YHn = ({ children: e }) => /* @__PURE__ */ g.jsx(Yn1, { strict: !0, features: Ir1, children: /* @__PURE__ */ g.jsxs(An.div, { style: { height: "100%" }, children: [
7755
7755
  " ",
7756
7756
  e,
7757
7757
  " "
@@ -279512,7 +279512,7 @@ const D5u = ({
279512
279512
  }
279513
279513
  ),
279514
279514
  children: /* @__PURE__ */ g.jsx(Kmt, { sx: { maxHeight: 280 }, children: v.map((E) => /* @__PURE__ */ g.jsxs(Q, { gap: 1, marginTop: "8px", children: [
279515
- /* @__PURE__ */ g.jsxs(Q, { direction: "row", gap: 0.5, alignItems: "center", children: [
279515
+ /* @__PURE__ */ g.jsxs(Q, { direction: "row", gap: 0.5, alignItems: "center", marginTop: "8px", children: [
279516
279516
  /* @__PURE__ */ g.jsx(
279517
279517
  IO,
279518
279518
  {
@@ -279576,7 +279576,7 @@ const D5u = ({
279576
279576
  }
279577
279577
  ),
279578
279578
  children: /* @__PURE__ */ g.jsx(Kmt, { sx: { maxHeight: 280 }, children: m.map((E) => /* @__PURE__ */ g.jsxs(Q, { gap: 1, children: [
279579
- /* @__PURE__ */ g.jsxs(Q, { direction: "row", gap: 0.5, alignItems: "center", children: [
279579
+ /* @__PURE__ */ g.jsxs(Q, { direction: "row", gap: 0.5, alignItems: "center", marginTop: "8px", children: [
279580
279580
  /* @__PURE__ */ g.jsx(
279581
279581
  IO,
279582
279582
  {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ad as u, b0 as p, ae as m, b1 as d, af as C, ag as v, bR as S, bV as T, bU as g, bT as k, b2 as P, b4 as A, b5 as I, ah as h, ai as F, aj as y, ak as B, al as M, am as x, an as D, b6 as f, b7 as w, b8 as E, ao as R, bm as L, ap as N, aq as U, ar as W, as as H, bo as O, b9 as G, at as q, ba as V, a_ as j, au as z, av as K, bp as Z, aw as J, a9 as Q, ax as X, ay as Y, bb as _, az as $, ab as aa, aA as sa, aB as ea, bc as oa, bK as ra, aC as ta, aD as ba, aE as ia, br as na, bs as la, bq as ca, b3 as ua, bd as pa, aa as ma, aF as da, be as Ca, bf as va, aG as Sa, aY as Ta, aH as ga, bg as ka, aI as Pa, aJ as Aa, aK as Ia, aL as ha, bL as Fa, bM as ya, aM as Ba, aN as Ma, aO as xa, aP as Da, aZ as fa, bl as wa, bh as Ea, bt as Ra, aQ as La, bZ as Na, b_ as Ua, bX as Wa, c0 as Ha, b$ as Oa, bY as Ga, bn as qa, aR as Va, aS as ja, bi as za, bN as Ka, aT as Za, aU as Ja, bj as Qa, aV as Xa, a8 as Ya, aW as _a, bk as $a, a$ as as, aX as ss, bO as es, cq as os, cr as rs, ck as ts, c1 as bs, bP as is, ch as ns, ci as ls, cj as cs, c2 as us, ct as ps, cp as ms, co as ds, cl as Cs, cm as vs, c3 as Ss, cg as Ts, bS as gs, c4 as ks, c5 as Ps, c6 as As, c7 as Is, c8 as hs, ac as Fs, ce as ys, cd as Bs, cc as Ms, cf as xs, c9 as Ds, bQ as fs, bW as ws, ca as Es, cb as Rs, cs as Ls, cn as Ns, bH as Us, bI as Ws, bJ as Hs, bA as Os, bD as Gs, bv as qs, bx as Vs, bC as js, bu as zs, bB as Ks, bz as Zs, by as Js, bF as Qs, bG as Xs, bE as Ys, bw as _s } from "./index-b8bd0606.js";
1
+ import { ad as u, b0 as p, ae as m, b1 as d, af as C, ag as v, bR as S, bV as T, bU as g, bT as k, b2 as P, b4 as A, b5 as I, ah as h, ai as F, aj as y, ak as B, al as M, am as x, an as D, b6 as f, b7 as w, b8 as E, ao as R, bm as L, ap as N, aq as U, ar as W, as as H, bo as O, b9 as G, at as q, ba as V, a_ as j, au as z, av as K, bp as Z, aw as J, a9 as Q, ax as X, ay as Y, bb as _, az as $, ab as aa, aA as sa, aB as ea, bc as oa, bK as ra, aC as ta, aD as ba, aE as ia, br as na, bs as la, bq as ca, b3 as ua, bd as pa, aa as ma, aF as da, be as Ca, bf as va, aG as Sa, aY as Ta, aH as ga, bg as ka, aI as Pa, aJ as Aa, aK as Ia, aL as ha, bL as Fa, bM as ya, aM as Ba, aN as Ma, aO as xa, aP as Da, aZ as fa, bl as wa, bh as Ea, bt as Ra, aQ as La, bZ as Na, b_ as Ua, bX as Wa, c0 as Ha, b$ as Oa, bY as Ga, bn as qa, aR as Va, aS as ja, bi as za, bN as Ka, aT as Za, aU as Ja, bj as Qa, aV as Xa, a8 as Ya, aW as _a, bk as $a, a$ as as, aX as ss, bO as es, cq as os, cr as rs, ck as ts, c1 as bs, bP as is, ch as ns, ci as ls, cj as cs, c2 as us, ct as ps, cp as ms, co as ds, cl as Cs, cm as vs, c3 as Ss, cg as Ts, bS as gs, c4 as ks, c5 as Ps, c6 as As, c7 as Is, c8 as hs, ac as Fs, ce as ys, cd as Bs, cc as Ms, cf as xs, c9 as Ds, bQ as fs, bW as ws, ca as Es, cb as Rs, cs as Ls, cn as Ns, bH as Us, bI as Ws, bJ as Hs, bA as Os, bD as Gs, bv as qs, bx as Vs, bC as js, bu as zs, bB as Ks, bz as Zs, by as Js, bF as Qs, bG as Xs, bE as Ys, bw as _s } from "./index-5ef2750f.js";
2
2
  import "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -35406,4 +35406,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
35406
35406
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function So2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Do2(e){if(Array.isArray(e))return TBn(e)}function $Un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function xUn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$Un(Object(n),!0).forEach(function(a){zUn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$Un(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function zUn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ymt(e,t){return Io2(e)||Wo2(e,t)||HUn(e,t)||Bo2()}function Bo2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35407
35407
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HUn(e,t){if(e){if(typeof e=="string")return TBn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TBn(e,t)}}function TBn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function Wo2(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],r=!0,u=!1,c,l;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(f){u=!0,l=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw l}}return a}}function Io2(e){if(Array.isArray(e))return e}var $o2="file-invalid-type",xo2="file-too-large",zo2="file-too-small",Ho2="too-many-files",Ao2=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:$o2,message:"File type must be ".concat(n)}},AUn=function(t){return{code:xo2,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},RUn=function(t){return{code:zo2,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Ro2={code:Ho2,message:"Too many files"};function VUn(e,t){var n=e.type==="application/x-moz-file"||Eo2(e,t);return[n,n?null:Ao2(t)]}function FUn(e,t,n){if(hT(e.size))if(hT(t)&&hT(n)){if(e.size>n)return[!1,AUn(n)];if(e.size<t)return[!1,RUn(t)]}else{if(hT(t)&&e.size<t)return[!1,RUn(t)];if(hT(n)&&e.size>n)return[!1,AUn(n)]}return[!0,null]}function hT(e){return e!=null}function Vo2(e){var t=e.files,n=e.accept,a=e.minSize,r=e.maxSize,u=e.multiple,c=e.maxFiles,l=e.validator;return!u&&t.length>1||u&&c>=1&&t.length>c?!1:t.every(function(f){var s=VUn(f,n),d=ymt(s,1),g=d[0],m=FUn(f,a,r),v=ymt(m,1),C=v[0],h=l?l(f):null;return g&&C&&!h})}function WCt(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function ICt(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 NUn(e){e.preventDefault()}function Fo2(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function No2(e){return e.indexOf("Edge/")!==-1}function To2(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Fo2(e)||No2(e)}function Sc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(a){for(var r=arguments.length,u=new Array(r>1?r-1:0),c=1;c<r;c++)u[c-1]=arguments[c];return t.some(function(l){return!WCt(a)&&l&&l.apply(void 0,[a].concat(u)),WCt(a)})}}function Zo2(){return"showOpenFilePicker"in window}function Uo2(e){if(hT(e)){var t=Object.entries(e).filter(function(n){var a=ymt(n,2),r=a[0],u=a[1],c=!0;return TUn(r)||(console.warn('Skipped "'.concat(r,'" 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.')),c=!1),(!Array.isArray(u)||!u.every(ZUn))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,a){var r=ymt(a,2),u=r[0],c=r[1];return xUn(xUn({},n),{},zUn({},u,c))},{});return[{description:"Files",accept:t}]}return e}function Go2(e){if(hT(e))return Object.entries(e).reduce(function(t,n){var a=ymt(n,2),r=a[0],u=a[1];return[].concat(IUn(t),[r],IUn(u))},[]).filter(function(t){return TUn(t)||ZUn(t)}).join(",")}function Yo2(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Ko2(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function TUn(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function ZUn(e){return/^.*\.[\w]+$/.test(e)}var Xo2=["children"],Qo2=["open"],Jo2=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],qo2=["refKey","onChange","onClick"];function e22(e){return r22(e)||n22(e)||UUn(e)||t22()}function t22(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
35408
35408
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n22(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r22(e){if(Array.isArray(e))return UBn(e)}function ZBn(e,t){return o22(e)||i22(e,t)||UUn(e,t)||a22()}function a22(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35409
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UUn(e,t){if(e){if(typeof e=="string")return UBn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UBn(e,t)}}function UBn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function i22(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],r=!0,u=!1,c,l;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(f){u=!0,l=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw l}}return a}}function o22(e){if(Array.isArray(e))return e}function GUn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GUn(Object(n),!0).forEach(function(a){GBn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GUn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function GBn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ct(e,t){if(e==null)return{};var n=u22(e,t),a,r;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)a=u[r],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function u22(e,t){if(e==null)return{};var n={},a=Object.keys(e),r,u;for(u=0;u<a.length;u++)r=a[u],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var YBn=o.forwardRef(function(e,t){var n=e.children,a=$Ct(e,Xo2),r=xCt(a),u=r.open,c=$Ct(r,Qo2);return o.useImperativeHandle(t,function(){return{open:u}},[u]),o.createElement(o.Fragment,null,n(Pt(Pt({},c),{},{open:u})))});YBn.displayName="Dropzone";var YUn={disabled:!1,getFilesFromEvent:bo2,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};YBn.defaultProps=YUn,YBn.propTypes={children:L.func,accept:L.objectOf(L.arrayOf(L.string)),multiple:L.bool,preventDropOnDocument:L.bool,noClick:L.bool,noKeyboard:L.bool,noDrag:L.bool,noDragEventsBubbling:L.bool,minSize:L.number,maxSize:L.number,maxFiles:L.number,disabled:L.bool,getFilesFromEvent:L.func,onFileDialogCancel:L.func,onFileDialogOpen:L.func,useFsAccessApi:L.bool,autoFocus:L.bool,onDragEnter:L.func,onDragLeave:L.func,onDragOver:L.func,onDrop:L.func,onDropAccepted:L.func,onDropRejected:L.func,onError:L.func,validator:L.func};var KBn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function xCt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Pt(Pt({},YUn),e),n=t.accept,a=t.disabled,r=t.getFilesFromEvent,u=t.maxSize,c=t.minSize,l=t.multiple,f=t.maxFiles,s=t.onDragEnter,d=t.onDragLeave,g=t.onDragOver,m=t.onDrop,v=t.onDropAccepted,C=t.onDropRejected,h=t.onFileDialogCancel,b=t.onFileDialogOpen,p=t.useFsAccessApi,y=t.autoFocus,j=t.preventDropOnDocument,E=t.noClick,O=t.noKeyboard,M=t.noDrag,S=t.noDragEventsBubbling,D=t.onError,k=t.validator,B=o.useMemo(function(){return Go2(n)},[n]),x=o.useMemo(function(){return Uo2(n)},[n]),N=o.useMemo(function(){return typeof b=="function"?b:KUn},[b]),$=o.useMemo(function(){return typeof h=="function"?h:KUn},[h]),H=o.useRef(null),Z=o.useRef(null),A=o.useReducer(c22,KBn),T=ZBn(A,2),Q=T[0],ne=T[1],V=Q.isFocused,F=Q.isFileDialogActive,Y=o.useRef(typeof window<"u"&&window.isSecureContext&&p&&Zo2()),ie=function(){!Y.current&&F&&setTimeout(function(){if(Z.current){var he=Z.current.files;he.length||(ne({type:"closeDialog"}),$())}},300)};o.useEffect(function(){return window.addEventListener("focus",ie,!1),function(){window.removeEventListener("focus",ie,!1)}},[Z,F,$,Y]);var q=o.useRef([]),fe=function(he){H.current&&H.current.contains(he.target)||(he.preventDefault(),q.current=[])};o.useEffect(function(){return j&&(document.addEventListener("dragover",NUn,!1),document.addEventListener("drop",fe,!1)),function(){j&&(document.removeEventListener("dragover",NUn),document.removeEventListener("drop",fe))}},[H,j]),o.useEffect(function(){return!a&&y&&H.current&&H.current.focus(),function(){}},[H,y,a]);var ce=o.useCallback(function(J){D?D(J):console.error(J)},[D]),Ce=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J),q.current=[].concat(e22(q.current),[J.target]),ICt(J)&&Promise.resolve(r(J)).then(function(he){if(!(WCt(J)&&!S)){var at=he.length,He=at>0&&Vo2({files:he,accept:B,minSize:c,maxSize:u,multiple:l,maxFiles:f,validator:k}),Et=at>0&&!He;ne({isDragAccept:He,isDragReject:Et,isDragActive:!0,type:"setDraggedFiles"}),s&&s(J)}}).catch(function(he){return ce(he)})},[r,s,ce,S,B,c,u,l,f,k]),le=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J);var he=ICt(J);if(he&&J.dataTransfer)try{J.dataTransfer.dropEffect="copy"}catch{}return he&&g&&g(J),!1},[g,S]),ee=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J);var he=q.current.filter(function(He){return H.current&&H.current.contains(He)}),at=he.indexOf(J.target);at!==-1&&he.splice(at,1),q.current=he,!(he.length>0)&&(ne({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),ICt(J)&&d&&d(J))},[H,d,S]),ge=o.useCallback(function(J,he){var at=[],He=[];J.forEach(function(Et){var je=VUn(Et,B),qt=ZBn(je,2),_n=qt[0],Dc=qt[1],KO=FUn(Et,c,u),XO=ZBn(KO,2),CT=XO[0],bT=XO[1],yT=k?k(Et):null;if(_n&&CT&&!yT)at.push(Et);else{var pT=[Dc,bT];yT&&(pT=pT.concat(yT)),He.push({file:Et,errors:pT.filter(function(OT){return OT})})}}),(!l&&at.length>1||l&&f>=1&&at.length>f)&&(at.forEach(function(Et){He.push({file:Et,errors:[Ro2]})}),at.splice(0)),ne({acceptedFiles:at,fileRejections:He,type:"setFiles"}),m&&m(at,He,he),He.length>0&&C&&C(He,he),at.length>0&&v&&v(at,he)},[ne,l,B,c,u,f,m,v,C,k]),We=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J),q.current=[],ICt(J)&&Promise.resolve(r(J)).then(function(he){WCt(J)&&!S||ge(he,J)}).catch(function(he){return ce(he)}),ne({type:"reset"})},[r,ge,ce,S]),U=o.useCallback(function(){if(Y.current){ne({type:"openDialog"}),N();var J={multiple:l,types:x};window.showOpenFilePicker(J).then(function(he){return r(he)}).then(function(he){ge(he,null),ne({type:"closeDialog"})}).catch(function(he){Yo2(he)?($(he),ne({type:"closeDialog"})):Ko2(he)?(Y.current=!1,Z.current?(Z.current.value=null,Z.current.click()):ce(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."))):ce(he)});return}Z.current&&(ne({type:"openDialog"}),N(),Z.current.value=null,Z.current.click())},[ne,N,$,p,ge,ce,x,l]),qe=o.useCallback(function(J){!H.current||!H.current.isEqualNode(J.target)||(J.key===" "||J.key==="Enter"||J.keyCode===32||J.keyCode===13)&&(J.preventDefault(),U())},[H,U]),se=o.useCallback(function(){ne({type:"focus"})},[]),te=o.useCallback(function(){ne({type:"blur"})},[]),_e=o.useCallback(function(){E||(To2()?setTimeout(U,0):U())},[E,U]),Oe=function(he){return a?null:he},K=function(he){return O?null:Oe(he)},pe=function(he){return M?null:Oe(he)},Pe=function(he){S&&he.stopPropagation()},xe=o.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=J.refKey,at=he===void 0?"ref":he,He=J.role,Et=J.onKeyDown,je=J.onFocus,qt=J.onBlur,_n=J.onClick,Dc=J.onDragEnter,KO=J.onDragOver,XO=J.onDragLeave,CT=J.onDrop,bT=$Ct(J,Jo2);return Pt(Pt(GBn({onKeyDown:K(Sc(Et,qe)),onFocus:K(Sc(je,se)),onBlur:K(Sc(qt,te)),onClick:Oe(Sc(_n,_e)),onDragEnter:pe(Sc(Dc,Ce)),onDragOver:pe(Sc(KO,le)),onDragLeave:pe(Sc(XO,ee)),onDrop:pe(Sc(CT,We)),role:typeof He=="string"&&He!==""?He:"presentation"},at,H),!a&&!O?{tabIndex:0}:{}),bT)}},[H,qe,se,te,_e,Ce,le,ee,We,O,M,a]),ze=o.useCallback(function(J){J.stopPropagation()},[]),Zt=o.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=J.refKey,at=he===void 0?"ref":he,He=J.onChange,Et=J.onClick,je=$Ct(J,qo2),qt=GBn({accept:B,multiple:l,type:"file",style:{display:"none"},onChange:Oe(Sc(He,We)),onClick:Oe(Sc(Et,ze)),tabIndex:-1},at,Z);return Pt(Pt({},qt),je)}},[Z,n,l,We,a]);return Pt(Pt({},Q),{},{isFocused:V&&!a,getRootProps:xe,getInputProps:Zt,rootRef:H,inputRef:Z,open:Oe(U)})}function c22(e,t){switch(t.type){case"focus":return Pt(Pt({},e),{},{isFocused:!0});case"blur":return Pt(Pt({},e),{},{isFocused:!1});case"openDialog":return Pt(Pt({},KBn),{},{isFileDialogActive:!0});case"closeDialog":return Pt(Pt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Pt(Pt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Pt(Pt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Pt({},KBn);default:return e}}function KUn(){}const XUn=({fileRejections:e})=>e.length?_.jsx(P.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>X(t.palette.error.main,.08),borderColor:t=>X(t.palette.error.main,.24)},children:e.map(({file:t,errors:n})=>{const{path:a,size:r}=FBn(t);return _.jsxs(P.Box,{sx:{my:1},children:[_.jsxs(P.Typography,{variant:"subtitle2",noWrap:!0,children:[a," - ",r?SBn(r):""]}),n.map(u=>_.jsxs(P.Box,{component:"span",sx:{typography:"caption"},children:["- ",u.message]},u.code))]},a)})}):null,l22=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return _.jsx(P.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:_.jsx("img",{alt:"file preview",src:t,style:{borderRadius:8,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},f22=Bt("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 ${X(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),s22=({header:e,description:t,sx:n,...a})=>_.jsxs(P.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...a,children:[_.jsx(bIn,{sx:{width:220}}),_.jsxs("div",{children:[_.jsx(P.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),_.jsx(P.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||_.jsxs(_.Fragment,{children:["Solte os arquivos aqui ou clique",_.jsx(P.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),QUn=({id:e,disabled:t,multiple:n=!1,error:a,helperText:r,file:u,onDelete:c,files:l,thumbnail:f,onRemove:s,onHandleMainImage:d,mainUrl:g,sx:m,dropZoneProps:v,placeholderProps:C,placeholderAlt:h,image:b,tabIndex:p,...y})=>{const{getRootProps:j,getInputProps:E,isDragActive:O,isDragReject:M,fileRejections:S}=xCt({multiple:n,disabled:t,...y}),D=!!u&&!n||b,k=l&&n&&l.length>0,B=M||!!a;return _.jsxs(P.Box,{sx:{width:1,position:"relative",...m},children:[_.jsxs(f22,{...j(),sx:{...O&&{opacity:.72},...B&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...t&&{opacity:.48,pointerEvents:"none"},...v},children:[_.jsx("input",{...E(),id:e,tabIndex:p}),h?_.jsx(P.Stack,{sx:{...D&&{opacity:0}},children:h}):_.jsx(s22,{sx:{...D&&{opacity:0}},header:C==null?void 0:C.title,description:C==null?void 0:C.description}),D&&_.jsx(l22,{file:u||b||""})]}),r&&_.jsx(P.FormHelperText,{error:!!a,sx:x=>({mx:"14px",color:t?x.palette.grey[500]:void 0}),children:r}),_.jsx(XUn,{fileRejections:S}),D&&c&&_.jsx(P.IconButton,{size:"small",onClick:c,sx:{top:16,right:16,zIndex:9,position:"absolute",color:x=>X(x.palette.common.white,.8),bgcolor:x=>X(x.palette.grey[900],.72),"&:hover":{bgcolor:x=>X(x.palette.grey[900],.48)}},children:_.jsx(Le,{icon:"CLOSE_MARK_BUTTON",width:18})}),k&&_.jsx(_.Fragment,{children:_.jsx(P.Box,{sx:{my:3},children:_.jsx(mo2,{files:l,thumbnail:f,onRemove:s,onHandleMainImage:d,mainUrl:g})})})]})},d22=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return _.jsx("img",{alt:"avatar",src:t,style:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},g22=Bt("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 ${X(e.palette.grey[500],.32)}`})),_22=Bt("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})})),JUn=({error:e,file:t,image:n,disabled:a,helperText:r,sx:u,tabIndex:c,...l})=>{const{getRootProps:f,getInputProps:s,isDragActive:d,isDragReject:g,fileRejections:m}=xCt({multiple:!1,disabled:a,...l}),v=!!t||n,C=g||!!e;return _.jsxs(_.Fragment,{children:[_.jsxs(g22,{...f(),sx:{...d&&{opacity:.72},...C&&{borderColor:"error.light",...v&&{bgcolor:"error.lighter"}},...a&&{opacity:.48,pointerEvents:"none"},...v&&{"&:hover":{"& .placeholder":{opacity:1}}},...u},children:[_.jsx("input",{...s(),tabIndex:c}),v&&_.jsx(d22,{file:t||n||""}),_.jsxs(_22,{className:"placeholder",sx:{"&:hover":{opacity:.72},...v&&{zIndex:9,opacity:0,color:"common.white",bgcolor:h=>X(h.palette.grey[900],.64)},...C&&{color:"error.main",bgcolor:"error.lighter"}},children:[_.jsx(Le,{icon:"ADD_IMAGE",width:24,sx:{mb:1}}),_.jsx(P.Typography,{variant:"caption",children:t?"Atualizar foto":"Carregar foto"})]})]}),r&&r,_.jsx(XUn,{fileRejections:m})]})},m22=Bt("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:X(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),v22=({placeholderAlt:e,error:t,disabled:n,sx:a,tabIndex:r,...u})=>{const{getRootProps:c,getInputProps:l,isDragActive:f,isDragReject:s}=xCt({disabled:n,...u}),d=s||t;return _.jsxs(m22,{...c(),sx:{...f&&{opacity:.72},...d&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...a},children:[_.jsx("input",{...l(),tabIndex:r}),e||_.jsx(Le,{icon:"CLOUD_UPLOAD",width:28})]})},qUn=({onFileCropped:e,onImageUploaded:t,onCancel:n})=>{const a=o.useId(),[r,u]=o.useState(),[c,l,f]=BSn(),[s,d]=o.useState();return{id:a,setCropModalOpen:f,handleRemove:()=>{e(void 0),t(void 0),f(!1)},toggleCropModalOpen:l,cropModalOpen:c,cancelChanges:()=>{n&&n(),f(!1)},saveChanges:()=>{r!==void 0&&r.getCroppedCanvas().toBlob(b=>{if(!b)return;const p=new File([b],"imagem");e(p),l()},"image/png",1)},previewImage:()=>{r!==void 0&&d(r.getCroppedCanvas().toDataURL())},setCropper:u,preview:s,closePreviewImage:()=>d(void 0)}},eGn=({id:e,open:t,onClose:n,label:a,onSave:r,onRemove:u,onPreview:c,imageSrc:l,aspectRatio:f,onInitialized:s})=>{const[d,g]=o.useState(.5);return _.jsx(CUn,{open:t,onClose:n,dialogTitle:a,actions:_.jsxs(_.Fragment,{children:[_.jsx(P.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),_.jsx(P.Button,{variant:"contained",size:"medium",onClick:r,children:"Salvar"})]}),fullWidth:!0,maxWidth:"sm",keepMounted:!0,children:_.jsxs(P.Stack,{gap:2,children:[_.jsx(GZn,{imageSrc:l,aspectRatio:f,onInitialized:s,zoom:d,onZoomChange:g}),_.jsxs(P.Stack,{gap:1.5,children:[_.jsxs(P.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",children:[_.jsx(P.Typography,{variant:"body1",children:"Zoom"}),_.jsx(P.Slider,{value:d,onChange:(m,v)=>g(Array.isArray(v)?v[0]:v),min:.1,max:2,size:"medium",step:.0125})]}),_.jsxs(P.Stack,{direction:"row",gap:2,children:[_.jsx(P.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:_.jsx(Le,{icon:"DELETE_MARK_BUTTON_02"}),onClick:u,children:"Remover"}),_.jsx(P.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:_.jsx(Le,{icon:"PLAY_SIMPLE"}),onClick:c,children:"Pré-visualizar"}),_.jsx(P.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:_.jsx(Le,{icon:"SEARCH_IMAGE"}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})})},h22=P.styled(P.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),C22=P.styled(P.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:P.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),b22=P.styled(P.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),tGn=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:l,tabIndex:f,...s})=>{const{id:d,setCropModalOpen:g,handleRemove:m,toggleCropModalOpen:v,cropModalOpen:C,cancelChanges:h,saveChanges:b,previewImage:p,setCropper:y,preview:j,closePreviewImage:E}=qUn({onFileCropped:e,onImageUploaded:t,onCancel:n});return _.jsxs(_.Fragment,{children:[_.jsxs(h22,{children:[c&&_.jsx(fCt,{}),_.jsx(QUn,{...s,id:d,file:l,onDrop:O=>{if(O.length>0){g(!0);const M=new FileReader;M.addEventListener("load",()=>{var D;const S=((D=M.result)==null?void 0:D.toString())||"";t(S),e(void 0)}),M.readAsDataURL(O[0])}},image:u,tabIndex:f}),(l||u)&&_.jsxs(C22,{className:"actions",children:[_.jsx(P.Button,{color:"inherit",startIcon:_.jsx(Le,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:m,children:"Remover"}),_.jsx(P.Button,{color:"inherit",startIcon:_.jsx(Le,{icon:"SEARCH_IMAGE",color:"primary.maon"}),onClick:v,children:"Editar"})]})]}),_.jsx(eGn,{id:d,open:C,onClose:h,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:b,onPreview:p,onInitialized:y}),_.jsx(P.Dialog,{open:!!j,onClose:E,scroll:"body",PaperProps:{sx:{p:2}},children:j&&_.jsx("img",{src:j,alt:"Preview"})})]})},y22=P.styled(P.Stack)(({theme:e})=>({backgroundColor:"#fff",border:`1px solid ${e.palette.grey[300]}`})),nGn=({children:e,...t})=>_.jsx(y22,{borderRadius:1,gap:3,padding:3,...t,children:e}),p22=P.styled(P.Box)(()=>({marginLeft:"4px",fontWeight:"fontWeightBold"})),O22=P.styled(P.Button)(()=>({fontWeight:"fontWeightSemiBold"})),j22=P.styled(Le)(({theme:e})=>({color:e.palette.primary.main})),w22=({selectedTitle:e,onSelect:t,options:n})=>{const a=WSn();return _.jsxs(_.Fragment,{children:[_.jsx(O22,{disableRipple:!0,color:"inherit",onClick:a.onOpen,endIcon:_.jsx(j22,{icon:a.open?"CHEVRON_UP":"ARROW_DOWN_SIMPLE"}),children:_.jsx(p22,{component:"span",children:e.label})}),_.jsx(hUn,{open:a.open,onClose:a.onClose,children:n.map(r=>_.jsx(P.MenuItem,{selected:r.value===e.value,onClick:()=>{a.onClose(),t(r.value)},children:r.label},r.value))})]})},M22=P.styled(P.Stack)({display:"grid",gridTemplateColumns:"auto auto"}),L22=P.styled(P.Typography)(({theme:e})=>({color:e.palette.grey[600]})),P22=P.styled(P.Typography)(({theme:e})=>({textAlign:"right",color:e.palette.grey[800]})),E22=({data:e,...t})=>e.length===0?null:_.jsx(M22,{gap:1,...t,children:e.map(n=>[_.jsx(L22,{variant:"body2",children:n.label},`label:${n.id}`),_.jsx(P22,{variant:"body2",children:n.value},`value:${n.id}`)])}),k22=P.styled(P.Stack)(({theme:e})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${e.palette.grey[300]}`})),S22=P.styled(P.Stack)(({theme:e})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${e.palette.grey[300]}`})),D22=P.styled(P.Stack)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),B22=P.styled(P.Stack)(({theme:e})=>({height:"100%",width:"50%",flex:1,[e.breakpoints.down(1680)]:{width:"70%"}})),W22=P.styled(P.Typography)(({theme:e})=>({color:e.palette.grey[800],fontSize:18,fontWeight:700})),I22=P.styled(P.Typography)(({theme:e})=>({color:e.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24})),$22=P.styled(P.Button)(({theme:e})=>({paddingTop:6,paddingBottom:6,paddingLeft:0,margin:0,marginBottom:4,marginTop:4,width:"100%",display:"block",cursor:"pointer",color:e.palette.grey[600],textAlign:"left",fontWeight:400,fontSize:14,"> span":{color:e.palette.error.main}})),x22=P.styled(q_t)(()=>({height:1,"& .simplebar-content":{height:1}})),z22=P.styled(P.Stack)(()=>({position:"fixed",width:"202px"})),H22=({title:e,sections:t,headerLeftContent:n,headerRightContent:a,onClickBack:r})=>_.jsx(P.Stack,{children:_.jsxs(P.Stack,{direction:"row",children:[_.jsx(k22,{children:_.jsx(x22,{children:_.jsxs(z22,{children:[_.jsx(P.Typography,{variant:"overline",color:"text.disabled",fontWeight:700,children:"ACESSO RÁPIDO"}),t.map((u,c)=>_.jsxs(P.Stack,{children:[_.jsxs($22,{onClick:()=>{u.ref.current&&u.ref.current.scrollIntoView({block:"end",behavior:"smooth"})},children:[u.title,u.isRequired&&_.jsx("span",{children:"*"})]}),c<t.length-1&&_.jsx(P.Divider,{})]},c))]})})}),_.jsxs(P.Stack,{width:"100%",alignItems:"center",mb:8,children:[_.jsx(S22,{children:_.jsxs(D22,{children:[_.jsxs(P.Stack,{flexDirection:"row",gap:2,children:[_.jsx(P.IconButton,{color:"primary",onClick:()=>r(),children:_.jsx(Le,{icon:"CHEVRON_LEFT"})}),_.jsx(P.Typography,{variant:"h4",children:e}),n]}),_.jsxs(P.Stack,{direction:"row",gap:2,alignItems:"center",minWidth:"max-content",children:[_.jsx(sSn,{disabled:!0}),a]})]})}),_.jsx(B22,{children:t.map(u=>_.jsxs(P.Stack,{ref:u.ref,paddingTop:3,paddingBottom:2,alignItems:"start",width:"100%",children:[_.jsx(W22,{children:u.title}),_.jsx(I22,{children:u.subTitle}),_.jsx(nGn,{width:"100%",borderRadius:1,gap:1.5,padding:3,children:u.child})]},u.title))})]})]})}),un=({name:e,helperText:t,rules:n,onChange:a,tabIndex:r,...u})=>{const{control:c}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:c,rules:n,render:({field:{ref:l,...f},fieldState:{error:s}})=>_.jsx(P.TextField,{...f,onChange:d=>{f.onChange(d),a&&a(d)},inputRef:l,fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||t,...u,inputProps:{...u.inputProps,tabIndex:r}})})},rGn=({name:e,helperText:t,onChange:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:u,render:({field:c,fieldState:{error:l}})=>_.jsxs("div",{children:[_.jsx(P.FormControlLabel,{control:_.jsx(P.Switch,{...c,checked:c.value,onChange:(f,s)=>{c.onChange(f),n&&n(f,s)},inputProps:{tabIndex:a}}),...r}),(!!l||t)&&_.jsx(P.FormHelperText,{error:!!l,sx:f=>({mx:"14px",color:r.disabled?f.palette.grey[500]:void 0}),children:l?l==null?void 0:l.message:t})]})})},A22=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],R22=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],V22=P.styled(P.Stack)(({theme:e})=>({border:`1px solid ${P.alpha(e.palette.primary.main,.3)}`,backgroundColor:P.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),F22=P.styled(P.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),N22=P.styled(P.IconButton)(()=>({height:"38px",alignSelf:"center"})),T22=({webhookData:e,isEditing:t=!1,haveTip:n=!1})=>{const{control:a}=Ie.useFormContext(),{fields:r,append:u,remove:c}=Ie.useFieldArray({name:"headers",control:a}),l=()=>{u({value:"",name:""})};return _.jsxs(_.Fragment,{children:[n&&_.jsxs(V22,{children:[_.jsx(Le,{icon:"INFO_CIRCLE"}),_.jsx(P.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&&_.jsx(un,{name:"name",label:"Nome do webhook"}),_.jsxs(P.Stack,{direction:"row",gap:2,children:[_.jsx(un,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url é obrigatório"}}}),_.jsx(un,{name:"filter",label:"Filtro"})]}),t&&e&&_.jsxs(_.Fragment,{children:[_.jsx(un,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),_.jsxs(P.Stack,{direction:"row",gap:2,children:[_.jsx(un,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),_.jsx(un,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:_.jsx(P.InputAdornment,{position:"end",children:_.jsx(F22,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:_.jsx(Le,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),_.jsx(un,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),_.jsxs(P.Stack,{direction:"row",gap:2,children:[_.jsxs(P.Stack,{width:"35%",gap:2,children:[_.jsx(P.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),_.jsx(XBn,{name:"content_type",options:A22,row:!0,decorated:!0})]}),_.jsxs(P.Stack,{gap:2,children:[_.jsx(P.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),_.jsx(XBn,{name:"http_method",options:R22,row:!0,decorated:!0})]})]}),_.jsx(P.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),_.jsx(rGn,{name:"active",label:"Ativo"}),_.jsx(P.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),r==null?void 0:r.map((f,s)=>_.jsxs(P.Stack,{direction:"row",gap:2,children:[_.jsx(un,{name:`headers.${s}.name`,label:"Chave",rules:{required:{value:!0,message:"Chave é obrigatório"}}}),_.jsx(un,{name:`headers.${s}.value`,label:"Valor",rules:{required:{value:!0,message:"Valor é obrigatório"}}}),_.jsx(N22,{onClick:()=>c(s),color:"error",children:_.jsx(Le,{icon:"DELETE_MARK_BUTTON_02"})})]},f.id)),_.jsx(hRn,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>l(),children:"Adicionar novo cabeçalho"}),_.jsx(P.Divider,{})]})},aGn=({name:e,helperText:t,rules:n,onSelectOption:a,...r})=>{const{control:u}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>_.jsx(fSn,{...c,...r,onChange:f=>{a&&a(f),c.onChange(f)},error:!!l,helperText:(l==null?void 0:l.message)||t})})},iGn=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{name:u,onChange:c,value:l,ref:f},fieldState:{error:s}})=>_.jsx(HBn,{ref:f,...a,name:u,value:l,error:!!s,helperText:(s==null?void 0:s.message)||t,onChange:({target:{value:d}})=>c(d)})})},Z22=({name:e,containerProps:t,required:n,rules:a,tabIndex:r})=>{const u=`${e}.zipCode`,c=`${e}.publicPlace`,l=`${e}.number`,f=`${e}.district`,s=`${e}.complement`,d=`${e}.state`,g=`${e}.city`,m=v=>{v.key==="Enter"&&v.preventDefault()};return _.jsxs(P.Stack,{gap:1.5,...t,children:[_.jsxs(P.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[_.jsx(iGn,{name:u,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:_.jsx(P.InputAdornment,{position:"end",children:_.jsx(P.CircularProgress,{size:24})})},rules:a,onKeyDown:m,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:r}),_.jsxs(P.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[_.jsx(un,{name:c,label:"Logradouro",onKeyDown:m,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:r}),_.jsx(un,{name:l,label:"Número",onKeyDown:m,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:r})]})]}),_.jsxs(P.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[_.jsx(un,{name:f,label:"Bairro",onKeyDown:m,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:r}),_.jsx(un,{name:s,label:"Complemento",onKeyDown:m,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:r})]}),_.jsxs(P.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[_.jsx(aGn,{name:d,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:r}),_.jsx(un,{name:g,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:r})]})]})},U22=({name:e,rules:t,helperText:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:u,rules:t,render:({field:c,fieldState:{error:l}})=>_.jsxs("div",{children:[_.jsx(P.FormControlLabel,{control:_.jsx(P.Checkbox,{...c,checked:c.value,tabIndex:a}),...r}),(!!l||n)&&_.jsx(P.FormHelperText,{error:!!l,children:l?l==null?void 0:l.message:n})]})})},G22=({row:e,name:t,rules:n,label:a,options:r,spacing:u,helperText:c,required:l,...f})=>{const{control:s}=Ie.useFormContext(),d=(g,m)=>g.includes(m)?g.filter(v=>v!==m):[...g,m];return _.jsx(Ie.Controller,{name:t,control:s,rules:n,render:({field:{value:g=[],...m},fieldState:{error:v}})=>_.jsxs(P.FormControl,{component:"fieldset",children:[a&&_.jsx(P.FormLabel,{component:"legend",sx:{typography:"body2"},required:l,children:a}),_.jsx(P.FormGroup,{sx:{...e&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:u||0},...e&&{mr:0,"&:not(:last-of-type)":{mr:u||2}}}},children:r.map(C=>_.jsx(P.FormControlLabel,{control:_.jsx(P.Checkbox,{checked:g.includes(C.value),onChange:()=>m.onChange(d(g,C.value))}),label:C.label,...f},C.value))}),(!!v||c)&&_.jsx(P.FormHelperText,{error:!!v,sx:C=>({color:f.disabled?C.palette.grey[500]:void 0}),children:v?v==null?void 0:v.message:c})]})})},Y22=({keyName:e,inputs:t=[],rules:n,tabIndex:a,...r})=>{const u=o.useRef(null),{control:c,setValue:l,formState:{errors:f}}=Ie.useFormContext(),s=m=>{const v=m.clipboardData.getData("text").split("");t.map((C,h)=>l(C,v[h])),m.preventDefault()},d=(m,v)=>{const{maxLength:C,value:h,name:b}=m.target,p=b.replace(e,""),y=Number(p),j=document.querySelector(`input[name=${e}${y+1}]`);h.length>C&&(m.target.value=h[0]),h.length>=C&&y<6&&j!==null&&j.focus(),v(m)};DSn("paste",s,u);const g=t.some(m=>f[m]);return _.jsxs(P.Stack,{children:[_.jsx(P.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:u,children:t.map((m,v)=>_.jsx(Ie.Controller,{name:`${e}${v+1}`,control:c,rules:n,render:({field:C,fieldState:{error:h}})=>_.jsx(P.TextField,{...r,...C,autoComplete:"none",error:!!h,autoFocus:v===0,placeholder:"-",onChange:b=>{d(b,C.onChange)},onFocus:b=>b.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:a}})},m))}),g&&_.jsx(P.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},K22=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:r,rules:{...t,validate:{...t==null?void 0:t.validate,validation:u=>{const c="#"+u.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(c)?!0:"Cor inválida"}}},render:({field:{ref:u,onChange:c,...l},fieldState:{error:f}})=>_.jsx(MNn,{...l,onChangeColor:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||n,...a})})},X22=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return _.jsx(jT.DatePicker,{inputRef:l,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Q22=({name:e,label:t,rules:n,tabIndex:a,helperText:r,required:u,...c})=>{const{control:l,setError:f}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:l,rules:n,render:({field:{value:s,onChange:d},fieldState:{error:g}})=>_.jsx(jT.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...c.localeText},value:[(s==null?void 0:s.startDate)||null,(s==null?void 0:s.endDate)||null],onChange:m=>d({startDate:m[0],endDate:m[1]}),onError:m=>{f(e,{message:m[0]||m[1]||void 0})},...c,slotProps:{textField:({position:m})=>{var v;return{...(v=c.slotProps)==null?void 0:v.textField,required:u,error:!!g,helperText:(g==null?void 0:g.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:m==="start"?`${t} (Dt. Início)`:`${t} (Dt. Fim)`,inputProps:{tabIndex:a}}}},sx:{width:1}})})},J22=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return _.jsx(jT.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:l,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},q22=({id:e,children:t,onSubmit:n,methods:a,...r})=>_.jsx(Ie.FormProvider,{...a,children:_.jsx(P.Stack,{component:"form",id:e,onSubmit:n,flex:1,width:1,noValidate:!0,...r,children:t})}),eu2=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{ref:u,value:c,...l},fieldState:{error:f}})=>_.jsx(IBn,{value:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||t,...a,...l,name:e})})},tu2=({name:e,label:t="",rules:n,helperText:a,changed:r,...u})=>{const{control:c}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:c,rules:n,render:({field:l,fieldState:{error:f}})=>_.jsx(P.Autocomplete,{...l,onChange:(s,d)=>{r&&r(d),l.onChange(d)},renderInput:s=>_.jsx(P.TextField,{label:t,error:!!f,helperText:f?f==null?void 0:f.message:a,...s}),...u})})},nu2=({name:e,helperText:t,rules:n,onChange:a,...r})=>{const{control:u}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>_.jsx(MCt,{...c,onChange:f=>{c.onChange(f),a&&a(f)},fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...r})})},ru2=({name:e,sx:t,rules:n,passwordSize:a,specialCharacter:r,upperCaseChar:u,numberChar:c,showErrorMessage:l,match:f,...s})=>{const{watch:d}=Ie.useFormContext(),g=d(e),[m,v]=o.useState(!1),{hasNumberChar:C,hasSpecialCharacter:h,hasUpperCaseChar:b,isLengthValid:p}=SCt(g,a,c,r,u);return _.jsx(un,{...s,name:e,type:m?"text":"password",InputProps:{endAdornment:_.jsx(P.InputAdornment,{position:"end",children:_.jsx(P.IconButton,{onClick:()=>v(!m),edge:"end","aria-label":"Mostrar/Ocultar senha",children:_.jsx(Le,{icon:m?"VIEW_ON":"VIEW_OFF"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:y=>{const j=SCt(y,a,c,r,u);return!j.hasNumberChar||!j.hasSpecialCharacter||!j.hasUpperCaseChar||!j.isLengthValid?"Senha inválida":f&&f.fieldPassword&&d(f.fieldPassword)!==y?"As senhas devem ser iguais":!0}}},sx:{...t,"& .MuiFormHelperText-root":{display:(!h||!b||!p||!C)&&!l?"none":void 0}}})},XBn=({name:e,rules:t,row:n,label:a,options:r,spacing:u,helperText:c,decorated:l,onChange:f,tabIndex:s,required:d,disabled:g,...m})=>{const{control:v}=Ie.useFormContext(),C=a?`${e}-${a}`:"";return _.jsx(Ie.Controller,{name:e,control:v,rules:t,render:({field:h,fieldState:{error:b}})=>_.jsxs(P.FormControl,{component:"fieldset",sx:{...l&&{paddingLeft:1.5}},children:[a&&_.jsx(P.FormLabel,{component:"legend",id:C,sx:{typography:"body2"},required:d,children:a}),_.jsx(P.RadioGroup,{...m,...h,onChange:(p,y)=>{h.onChange(p),f&&f(p,y)},"aria-labelledby":C,row:n,children:r.map(p=>_.jsx(P.FormControlLabel,{value:p.value,control:_.jsx(P.Radio,{inputProps:{tabIndex:s},disabled:g,checked:p.value===h.value}),label:p.label,sx:({palette:y})=>({"&:not(:last-of-type)":{mb:u||0},...n&&{mr:0,"&:not(:last-of-type)":{mr:u||2}},...l&&{border:`1px solid ${P.alpha(y.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(u||0)/2||1,...h.value===p.value&&{borderColor:"primary.main",backgroundColor:P.alpha(y.primary.main,.05)}}})},p.value))}),(!!b||c)&&_.jsx(P.FormHelperText,{error:!!b,sx:p=>({color:g?p.palette.grey[500]:void 0}),children:b?b==null?void 0:b.message:c})]})})},au2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return _.jsx(jT.TimePicker,{ampm:!1,format:"HH:mm",inputRef:l,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,error:!!s,required:r,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},iu2=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:l,tabIndex:f,...s})=>{const{id:d,setCropModalOpen:g,handleRemove:m,cropModalOpen:v,cancelChanges:C,saveChanges:h,previewImage:b,setCropper:p,preview:y,closePreviewImage:j}=qUn({onFileCropped:e,onImageUploaded:t,onCancel:n});return _.jsxs(_.Fragment,{children:[_.jsxs(P.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[c&&_.jsx(b22,{}),_.jsx(JUn,{...s,id:d,file:l,onDrop:E=>{if(E.length>0){g(!0);const O=new FileReader;O.addEventListener("load",()=>{var S;const M=((S=O.result)==null?void 0:S.toString())||"";t(M),e(void 0)}),O.readAsDataURL(E[0])}},image:u,tabIndex:f})]}),_.jsx(eGn,{id:d,open:v,onClose:C,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:h,onPreview:b,onInitialized:p}),_.jsx(P.Dialog,{open:!!y,onClose:j,scroll:"body",PaperProps:{sx:{p:2}},children:y&&_.jsx("img",{src:y,alt:"Preview"})})]})};function oGn(e,t){const{watch:n,setValue:a}=Ie.useFormContext(),[r,u]=o.useState(t),c=n(e)||[];return{uploadFile:async m=>{if(!m){a(e,void 0),u(void 0);return}a(e,m),u(Object.assign(m,{preview:URL.createObjectURL(m)}))},uploadFiles:async m=>{a(e,[...c,...m.map(v=>Object.assign(v,{preview:URL.createObjectURL(v)}))])},handleDeleteFile:()=>{a(e,void 0),u(void 0)},handleRemoveAll:()=>{a(e,void 0)},handleRemove:m=>{const v=c.filter(C=>C!==m);a(e,v)},file:r,setFileValue:u}}const ou2=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:l,onCancel:f,...s})=>{const{control:d}=Ie.useFormContext(),{uploadFile:g,file:m,setFileValue:v}=oGn(e);return _.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>_.jsx(iu2,{accept:{"image/*":[]},file:C?m:void 0,onFileCropped:b=>{g(b),c&&c(b)},onImageUploaded:l,onCancel:()=>{v(void 0),f&&f()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&_.jsx(P.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},uu2=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:l,onCancel:f,...s})=>{const{control:d}=Ie.useFormContext(),{uploadFile:g,file:m,setFileValue:v}=oGn(e);return _.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>_.jsx(tGn,{accept:{"image/*":[]},file:C?m:void 0,onFileCropped:b=>{g(b),c&&c(b)},onImageUploaded:l,onCancel:()=>{v(void 0),f&&f()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&_.jsx(P.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},uGn=P.styled(P.Button)(({theme:e})=>({borderColor:e.palette.grey[300]})),cGn=P.styled(P.Box)(({theme:e})=>({border:"1.5px solid",borderColor:e.palette.grey[300],height:450,width:"40%",borderRadius:8})),cu2=({selectedItems:e,items:t,loading:n,searchText:a,onAdd:r,onRemove:u,search:c,itemsTitle:l,selectedItemsTitle:f,additionalContent:s,onSearch:d})=>{const g=P.debounce(d,400),m=t.filter(k=>!e.some(B=>B.id===k.id)),v=t.filter(k=>e.some(B=>B.id===k.id)),[C,h]=o.useState([]),[b,p]=o.useState([]),y=()=>{r(C),h([])},j=()=>{u(b),p([])},E=k=>{p(k?v:[])},O=k=>{h(k?m:[])},M=(k,B)=>{p(B?x=>[...x,k]:x=>x.filter(N=>N.id!==k.id))},S=(k,B)=>{h(B?x=>[...x,k]:x=>x.filter(N=>N.id!==k.id))},D=k=>{k.key==="Enter"&&k.preventDefault()};return _.jsx(P.Stack,{children:_.jsxs(P.Stack,{direction:"row",alignItems:"center",gap:3,children:[_.jsx(cGn,{display:"flex",flex:1,children:_.jsxs(P.Stack,{flex:1,children:[_.jsxs(P.Stack,{direction:"row",gap:1,padding:2,children:[_.jsx(P.Checkbox,{size:"small",indeterminate:C.length>0&&C.length!==m.length,checked:C.length>0&&C.length===m.length,onChange:k=>O(k.target.checked)}),_.jsxs(P.Stack,{children:[_.jsx(P.Typography,{variant:"subtitle2",color:"text.primary",children:`${l} cadastrados`}),_.jsx(P.Typography,{variant:"caption",color:"text.disabled",children:`${C.length}/${m.length} selecionados`})]})]}),_.jsx(P.Divider,{}),_.jsxs(P.Stack,{p:2,flex:1,children:[_.jsxs(P.Stack,{direction:"row",gap:1,children:[_.jsx(pUn,{iconPosition:"start",placeholder:"Buscar",onKeyDown:D,size:"small",fullWidth:!0,trigger:"change",onSearch:k=>g(k)}),s]}),_.jsx(ABn,{isLoading:n,loading:_.jsx(P.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:_.jsx(P.CircularProgress,{})}),isEmpty:m.length===0,empty:_.jsx(sCt,{text:c?`Nenhum ${a} encontrado`:`Nenhum ${a} disponível`,sx:{svg:{height:140}}}),children:_.jsx(q_t,{sx:{maxHeight:280},children:m.map(k=>_.jsxs(P.Stack,{gap:1,marginTop:"8px",children:[_.jsxs(P.Stack,{direction:"row",gap:.5,alignItems:"center",children:[_.jsx(P.Checkbox,{size:"small",checked:C.includes(k),onChange:B=>S(k,B.target.checked)}),k.label]}),_.jsx(P.Divider,{})]},k.id))})})]})]})}),_.jsxs(P.Stack,{gap:3,children:[_.jsx(uGn,{variant:"outlined",onClick:y,children:_.jsx(Le,{icon:"ARROW_RIGHT_SIMPLE"})}),_.jsx(uGn,{variant:"outlined",onClick:j,children:_.jsx(Le,{icon:"ARROW_LEFT_SIMPLE"})})]}),_.jsx(cGn,{display:"flex",flex:1,children:_.jsxs(P.Stack,{flex:1,children:[_.jsxs(P.Stack,{direction:"row",gap:1,padding:2,children:[_.jsx(P.Checkbox,{size:"small",indeterminate:b.length>0&&b.length!==v.length,checked:b.length>0&&b.length===v.length,onChange:k=>E(k.target.checked)}),_.jsxs(P.Stack,{children:[_.jsx(P.Typography,{variant:"subtitle2",color:"text.primary",children:`${f} selecionados`}),_.jsx(P.Typography,{variant:"caption",color:"text.disabled",children:`${b.length}/${v.length} selecionados`})]})]}),_.jsx(P.Divider,{}),_.jsx(P.Box,{display:"flex",p:2,flex:1,justifyContent:"center",alignItems:"center",children:_.jsx(ABn,{isLoading:n,loading:_.jsx(P.CircularProgress,{}),isEmpty:v.length===0,empty:_.jsx(sCt,{text:`Nenhum ${a} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:_.jsx(q_t,{sx:{maxHeight:280},children:v.map(k=>_.jsxs(P.Stack,{gap:1,children:[_.jsxs(P.Stack,{direction:"row",gap:.5,alignItems:"center",children:[_.jsx(P.Checkbox,{size:"small",checked:b.includes(k),onChange:B=>M(k,B.target.checked)}),k.label]}),_.jsx(P.Divider,{})]},k.id))})})})]})})]})})},lu2=Object.freeze(Object.defineProperty({__proto__:null,default:Ner},Symbol.toStringTag,{value:"Module"}));R.ActionButton=hRn,R.Address=Z22,R.Autocomplete=fSn,R.AutocompleteField=aGn,R.BuilderLayout=uDo,R.BuilderSidebar=$zo,R.Carousel=bEo,R.CarouselArrowIndex=xEo,R.CarouselArrows=wEo,R.CarouselDots=jEo,R.Checkbox=U22,R.Codes=Y22,R.ColorPickerField=K22,R.ColorPickerInput=MNn,R.Common=Yn2,R.CommonSSR=Xn2,R.Confirm=Qn2,R.CustomAvatar=MTn,R.CustomAvatarGroup=LTn,R.DataGrid=tr2,R.DatePicker=X22,R.DateRangePicker=Q22,R.DateTimePicker=J22,R.Delayed=nr2,R.DialogAnimate=mtr,R.Drawer=gr2,R.EmptyContent=XHn,R.EmptyView=sCt,R.Error=mr2,R.FabButtonAnimate=qxn,R.Field=un,R.FixedProgressBar=fCt,R.Form=q22,R.FrameSkeleton=H22,R.HelpButton=sSn,R.Icon=Le,R.IconButtonAnimate=ezn,R.Iconify=_Zn,R.IllustrationEmptyContent=yIn,R.ImageCrop=GZn,R.Incrementer=IBn,R.IncrementerField=eu2,R.Label=uUn,R.Lightbox=HSo,R.LoadingScreen=Na2,R.MaskedInput=HBn,R.MaskedInputField=iGn,R.MaterialDesignContent=Dyt,R.MenuPopover=hUn,R.Modal=CUn,R.ModalActions=fi2,R.MotionContainer=ktr,R.MotionLazyContainer=Oyt,R.MotionViewport=Etr,R.MultiCheckbox=G22,R.MultipleChipField=tu2,R.NoData=pIn,R.NumberInput=MCt,R.NumberInputField=nu2,R.PasswordField=ru2,R.PasswordRules=vi2,R.PopoverSelect=w22,R.Portal=bUn,R.RadioGroupField=XBn,R.Result=ABn,R.SavedChanges=Hi2,R.Scrollbar=q_t,R.SearchInput=pUn,R.SnackbarContent=Syt,R.SnackbarProvider=Ezn,R.SplashScreen=Ai2,R.Steps=Fi2,R.StyledTab=Ni2,R.StyledTabs=Ti2,R.Summary=E22,R.SwapList=cu2,R.Switch=rGn,R.TRANSITION=OIn,R.TabPanel=Zi2,R.TableEmptyRows=NEo,R.TableHeadCustom=ZEo,R.TableNoData=VEo,R.TablePaginationCustom=GEo,R.TableSelectedAction=UEo,R.TableSkeleton=FEo,R.TextAnimate=vtr,R.TextMaxLine=wUn,R.ThemeProvider=wTn,R.TimePicker=au2,R.Transition=Dvt,R.Upload=QUn,R.UploadAvatar=JUn,R.UploadAvatarWithCropField=ou2,R.UploadBox=v22,R.UploadIllustration=bIn,R.UploadWithCrop=tGn,R.UploadWithCropField=uu2,R.Webhook=T22,R.WhiteBox=nGn,R.color=Pt2,R.compare=pzo,R.cssStyles=IEo,R.emptyRows=zEo,R.file=hi2,R.formatNumber=ha2,R.formatTime=ki2,R.getComparator=HEo,R.loadable=zi2,R.mask=$i2,R.number=sa2,R.routes=Di2,R.sort=Ii2,R.useActiveElement=cDo,R.useApiMessage=Szo,R.useCarousel=yEo,R.useCopyToClipboard=lDo,R.useDatagrid=fDo,R.useDeepCompareEffect=jzo,R.useEventListener=DSn,R.useIsMounting=Mzo,R.useLightBox=VSo,R.useOffSetTop=kzo,R.useOnClickOutside=Ezo,R.usePagination=Pzo,R.usePopover=WSn,R.useResponsive=nzn,R.useSnackbar=kzn,R.useTable=AEo,R.useTabs=Lzo,R.useToggle=BSn,R.uuidv4=xi2,R.validators=gi2,R.varBgColor=BXn,R.varBgKenburns=WXn,R.varBgPan=IXn,R.varBounce=kXn,R.varContainer=nvt,R.varFade=lle,R.varFlip=LXn,R.varHover=DXn,R.varPath=jXn,R.varRotate=SXn,R.varScale=EXn,R.varSlide=PXn,R.varTranEnter=$e,R.varTranExit=Ne,R.varTranHover=wXn,R.varZoom=MXn,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
35409
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UUn(e,t){if(e){if(typeof e=="string")return UBn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UBn(e,t)}}function UBn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function i22(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],r=!0,u=!1,c,l;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(f){u=!0,l=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw l}}return a}}function o22(e){if(Array.isArray(e))return e}function GUn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GUn(Object(n),!0).forEach(function(a){GBn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GUn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function GBn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ct(e,t){if(e==null)return{};var n=u22(e,t),a,r;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)a=u[r],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function u22(e,t){if(e==null)return{};var n={},a=Object.keys(e),r,u;for(u=0;u<a.length;u++)r=a[u],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var YBn=o.forwardRef(function(e,t){var n=e.children,a=$Ct(e,Xo2),r=xCt(a),u=r.open,c=$Ct(r,Qo2);return o.useImperativeHandle(t,function(){return{open:u}},[u]),o.createElement(o.Fragment,null,n(Pt(Pt({},c),{},{open:u})))});YBn.displayName="Dropzone";var YUn={disabled:!1,getFilesFromEvent:bo2,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};YBn.defaultProps=YUn,YBn.propTypes={children:L.func,accept:L.objectOf(L.arrayOf(L.string)),multiple:L.bool,preventDropOnDocument:L.bool,noClick:L.bool,noKeyboard:L.bool,noDrag:L.bool,noDragEventsBubbling:L.bool,minSize:L.number,maxSize:L.number,maxFiles:L.number,disabled:L.bool,getFilesFromEvent:L.func,onFileDialogCancel:L.func,onFileDialogOpen:L.func,useFsAccessApi:L.bool,autoFocus:L.bool,onDragEnter:L.func,onDragLeave:L.func,onDragOver:L.func,onDrop:L.func,onDropAccepted:L.func,onDropRejected:L.func,onError:L.func,validator:L.func};var KBn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function xCt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Pt(Pt({},YUn),e),n=t.accept,a=t.disabled,r=t.getFilesFromEvent,u=t.maxSize,c=t.minSize,l=t.multiple,f=t.maxFiles,s=t.onDragEnter,d=t.onDragLeave,g=t.onDragOver,m=t.onDrop,v=t.onDropAccepted,C=t.onDropRejected,h=t.onFileDialogCancel,b=t.onFileDialogOpen,p=t.useFsAccessApi,y=t.autoFocus,j=t.preventDropOnDocument,E=t.noClick,O=t.noKeyboard,M=t.noDrag,S=t.noDragEventsBubbling,D=t.onError,k=t.validator,B=o.useMemo(function(){return Go2(n)},[n]),x=o.useMemo(function(){return Uo2(n)},[n]),N=o.useMemo(function(){return typeof b=="function"?b:KUn},[b]),$=o.useMemo(function(){return typeof h=="function"?h:KUn},[h]),H=o.useRef(null),Z=o.useRef(null),A=o.useReducer(c22,KBn),T=ZBn(A,2),Q=T[0],ne=T[1],V=Q.isFocused,F=Q.isFileDialogActive,Y=o.useRef(typeof window<"u"&&window.isSecureContext&&p&&Zo2()),ie=function(){!Y.current&&F&&setTimeout(function(){if(Z.current){var he=Z.current.files;he.length||(ne({type:"closeDialog"}),$())}},300)};o.useEffect(function(){return window.addEventListener("focus",ie,!1),function(){window.removeEventListener("focus",ie,!1)}},[Z,F,$,Y]);var q=o.useRef([]),fe=function(he){H.current&&H.current.contains(he.target)||(he.preventDefault(),q.current=[])};o.useEffect(function(){return j&&(document.addEventListener("dragover",NUn,!1),document.addEventListener("drop",fe,!1)),function(){j&&(document.removeEventListener("dragover",NUn),document.removeEventListener("drop",fe))}},[H,j]),o.useEffect(function(){return!a&&y&&H.current&&H.current.focus(),function(){}},[H,y,a]);var ce=o.useCallback(function(J){D?D(J):console.error(J)},[D]),Ce=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J),q.current=[].concat(e22(q.current),[J.target]),ICt(J)&&Promise.resolve(r(J)).then(function(he){if(!(WCt(J)&&!S)){var at=he.length,He=at>0&&Vo2({files:he,accept:B,minSize:c,maxSize:u,multiple:l,maxFiles:f,validator:k}),Et=at>0&&!He;ne({isDragAccept:He,isDragReject:Et,isDragActive:!0,type:"setDraggedFiles"}),s&&s(J)}}).catch(function(he){return ce(he)})},[r,s,ce,S,B,c,u,l,f,k]),le=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J);var he=ICt(J);if(he&&J.dataTransfer)try{J.dataTransfer.dropEffect="copy"}catch{}return he&&g&&g(J),!1},[g,S]),ee=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J);var he=q.current.filter(function(He){return H.current&&H.current.contains(He)}),at=he.indexOf(J.target);at!==-1&&he.splice(at,1),q.current=he,!(he.length>0)&&(ne({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),ICt(J)&&d&&d(J))},[H,d,S]),ge=o.useCallback(function(J,he){var at=[],He=[];J.forEach(function(Et){var je=VUn(Et,B),qt=ZBn(je,2),_n=qt[0],Dc=qt[1],KO=FUn(Et,c,u),XO=ZBn(KO,2),CT=XO[0],bT=XO[1],yT=k?k(Et):null;if(_n&&CT&&!yT)at.push(Et);else{var pT=[Dc,bT];yT&&(pT=pT.concat(yT)),He.push({file:Et,errors:pT.filter(function(OT){return OT})})}}),(!l&&at.length>1||l&&f>=1&&at.length>f)&&(at.forEach(function(Et){He.push({file:Et,errors:[Ro2]})}),at.splice(0)),ne({acceptedFiles:at,fileRejections:He,type:"setFiles"}),m&&m(at,He,he),He.length>0&&C&&C(He,he),at.length>0&&v&&v(at,he)},[ne,l,B,c,u,f,m,v,C,k]),We=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J),q.current=[],ICt(J)&&Promise.resolve(r(J)).then(function(he){WCt(J)&&!S||ge(he,J)}).catch(function(he){return ce(he)}),ne({type:"reset"})},[r,ge,ce,S]),U=o.useCallback(function(){if(Y.current){ne({type:"openDialog"}),N();var J={multiple:l,types:x};window.showOpenFilePicker(J).then(function(he){return r(he)}).then(function(he){ge(he,null),ne({type:"closeDialog"})}).catch(function(he){Yo2(he)?($(he),ne({type:"closeDialog"})):Ko2(he)?(Y.current=!1,Z.current?(Z.current.value=null,Z.current.click()):ce(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."))):ce(he)});return}Z.current&&(ne({type:"openDialog"}),N(),Z.current.value=null,Z.current.click())},[ne,N,$,p,ge,ce,x,l]),qe=o.useCallback(function(J){!H.current||!H.current.isEqualNode(J.target)||(J.key===" "||J.key==="Enter"||J.keyCode===32||J.keyCode===13)&&(J.preventDefault(),U())},[H,U]),se=o.useCallback(function(){ne({type:"focus"})},[]),te=o.useCallback(function(){ne({type:"blur"})},[]),_e=o.useCallback(function(){E||(To2()?setTimeout(U,0):U())},[E,U]),Oe=function(he){return a?null:he},K=function(he){return O?null:Oe(he)},pe=function(he){return M?null:Oe(he)},Pe=function(he){S&&he.stopPropagation()},xe=o.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=J.refKey,at=he===void 0?"ref":he,He=J.role,Et=J.onKeyDown,je=J.onFocus,qt=J.onBlur,_n=J.onClick,Dc=J.onDragEnter,KO=J.onDragOver,XO=J.onDragLeave,CT=J.onDrop,bT=$Ct(J,Jo2);return Pt(Pt(GBn({onKeyDown:K(Sc(Et,qe)),onFocus:K(Sc(je,se)),onBlur:K(Sc(qt,te)),onClick:Oe(Sc(_n,_e)),onDragEnter:pe(Sc(Dc,Ce)),onDragOver:pe(Sc(KO,le)),onDragLeave:pe(Sc(XO,ee)),onDrop:pe(Sc(CT,We)),role:typeof He=="string"&&He!==""?He:"presentation"},at,H),!a&&!O?{tabIndex:0}:{}),bT)}},[H,qe,se,te,_e,Ce,le,ee,We,O,M,a]),ze=o.useCallback(function(J){J.stopPropagation()},[]),Zt=o.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=J.refKey,at=he===void 0?"ref":he,He=J.onChange,Et=J.onClick,je=$Ct(J,qo2),qt=GBn({accept:B,multiple:l,type:"file",style:{display:"none"},onChange:Oe(Sc(He,We)),onClick:Oe(Sc(Et,ze)),tabIndex:-1},at,Z);return Pt(Pt({},qt),je)}},[Z,n,l,We,a]);return Pt(Pt({},Q),{},{isFocused:V&&!a,getRootProps:xe,getInputProps:Zt,rootRef:H,inputRef:Z,open:Oe(U)})}function c22(e,t){switch(t.type){case"focus":return Pt(Pt({},e),{},{isFocused:!0});case"blur":return Pt(Pt({},e),{},{isFocused:!1});case"openDialog":return Pt(Pt({},KBn),{},{isFileDialogActive:!0});case"closeDialog":return Pt(Pt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Pt(Pt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Pt(Pt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Pt({},KBn);default:return e}}function KUn(){}const XUn=({fileRejections:e})=>e.length?_.jsx(P.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>X(t.palette.error.main,.08),borderColor:t=>X(t.palette.error.main,.24)},children:e.map(({file:t,errors:n})=>{const{path:a,size:r}=FBn(t);return _.jsxs(P.Box,{sx:{my:1},children:[_.jsxs(P.Typography,{variant:"subtitle2",noWrap:!0,children:[a," - ",r?SBn(r):""]}),n.map(u=>_.jsxs(P.Box,{component:"span",sx:{typography:"caption"},children:["- ",u.message]},u.code))]},a)})}):null,l22=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return _.jsx(P.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:_.jsx("img",{alt:"file preview",src:t,style:{borderRadius:8,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},f22=Bt("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 ${X(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),s22=({header:e,description:t,sx:n,...a})=>_.jsxs(P.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...a,children:[_.jsx(bIn,{sx:{width:220}}),_.jsxs("div",{children:[_.jsx(P.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),_.jsx(P.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||_.jsxs(_.Fragment,{children:["Solte os arquivos aqui ou clique",_.jsx(P.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),QUn=({id:e,disabled:t,multiple:n=!1,error:a,helperText:r,file:u,onDelete:c,files:l,thumbnail:f,onRemove:s,onHandleMainImage:d,mainUrl:g,sx:m,dropZoneProps:v,placeholderProps:C,placeholderAlt:h,image:b,tabIndex:p,...y})=>{const{getRootProps:j,getInputProps:E,isDragActive:O,isDragReject:M,fileRejections:S}=xCt({multiple:n,disabled:t,...y}),D=!!u&&!n||b,k=l&&n&&l.length>0,B=M||!!a;return _.jsxs(P.Box,{sx:{width:1,position:"relative",...m},children:[_.jsxs(f22,{...j(),sx:{...O&&{opacity:.72},...B&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...t&&{opacity:.48,pointerEvents:"none"},...v},children:[_.jsx("input",{...E(),id:e,tabIndex:p}),h?_.jsx(P.Stack,{sx:{...D&&{opacity:0}},children:h}):_.jsx(s22,{sx:{...D&&{opacity:0}},header:C==null?void 0:C.title,description:C==null?void 0:C.description}),D&&_.jsx(l22,{file:u||b||""})]}),r&&_.jsx(P.FormHelperText,{error:!!a,sx:x=>({mx:"14px",color:t?x.palette.grey[500]:void 0}),children:r}),_.jsx(XUn,{fileRejections:S}),D&&c&&_.jsx(P.IconButton,{size:"small",onClick:c,sx:{top:16,right:16,zIndex:9,position:"absolute",color:x=>X(x.palette.common.white,.8),bgcolor:x=>X(x.palette.grey[900],.72),"&:hover":{bgcolor:x=>X(x.palette.grey[900],.48)}},children:_.jsx(Le,{icon:"CLOSE_MARK_BUTTON",width:18})}),k&&_.jsx(_.Fragment,{children:_.jsx(P.Box,{sx:{my:3},children:_.jsx(mo2,{files:l,thumbnail:f,onRemove:s,onHandleMainImage:d,mainUrl:g})})})]})},d22=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return _.jsx("img",{alt:"avatar",src:t,style:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},g22=Bt("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 ${X(e.palette.grey[500],.32)}`})),_22=Bt("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})})),JUn=({error:e,file:t,image:n,disabled:a,helperText:r,sx:u,tabIndex:c,...l})=>{const{getRootProps:f,getInputProps:s,isDragActive:d,isDragReject:g,fileRejections:m}=xCt({multiple:!1,disabled:a,...l}),v=!!t||n,C=g||!!e;return _.jsxs(_.Fragment,{children:[_.jsxs(g22,{...f(),sx:{...d&&{opacity:.72},...C&&{borderColor:"error.light",...v&&{bgcolor:"error.lighter"}},...a&&{opacity:.48,pointerEvents:"none"},...v&&{"&:hover":{"& .placeholder":{opacity:1}}},...u},children:[_.jsx("input",{...s(),tabIndex:c}),v&&_.jsx(d22,{file:t||n||""}),_.jsxs(_22,{className:"placeholder",sx:{"&:hover":{opacity:.72},...v&&{zIndex:9,opacity:0,color:"common.white",bgcolor:h=>X(h.palette.grey[900],.64)},...C&&{color:"error.main",bgcolor:"error.lighter"}},children:[_.jsx(Le,{icon:"ADD_IMAGE",width:24,sx:{mb:1}}),_.jsx(P.Typography,{variant:"caption",children:t?"Atualizar foto":"Carregar foto"})]})]}),r&&r,_.jsx(XUn,{fileRejections:m})]})},m22=Bt("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:X(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),v22=({placeholderAlt:e,error:t,disabled:n,sx:a,tabIndex:r,...u})=>{const{getRootProps:c,getInputProps:l,isDragActive:f,isDragReject:s}=xCt({disabled:n,...u}),d=s||t;return _.jsxs(m22,{...c(),sx:{...f&&{opacity:.72},...d&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...a},children:[_.jsx("input",{...l(),tabIndex:r}),e||_.jsx(Le,{icon:"CLOUD_UPLOAD",width:28})]})},qUn=({onFileCropped:e,onImageUploaded:t,onCancel:n})=>{const a=o.useId(),[r,u]=o.useState(),[c,l,f]=BSn(),[s,d]=o.useState();return{id:a,setCropModalOpen:f,handleRemove:()=>{e(void 0),t(void 0),f(!1)},toggleCropModalOpen:l,cropModalOpen:c,cancelChanges:()=>{n&&n(),f(!1)},saveChanges:()=>{r!==void 0&&r.getCroppedCanvas().toBlob(b=>{if(!b)return;const p=new File([b],"imagem");e(p),l()},"image/png",1)},previewImage:()=>{r!==void 0&&d(r.getCroppedCanvas().toDataURL())},setCropper:u,preview:s,closePreviewImage:()=>d(void 0)}},eGn=({id:e,open:t,onClose:n,label:a,onSave:r,onRemove:u,onPreview:c,imageSrc:l,aspectRatio:f,onInitialized:s})=>{const[d,g]=o.useState(.5);return _.jsx(CUn,{open:t,onClose:n,dialogTitle:a,actions:_.jsxs(_.Fragment,{children:[_.jsx(P.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),_.jsx(P.Button,{variant:"contained",size:"medium",onClick:r,children:"Salvar"})]}),fullWidth:!0,maxWidth:"sm",keepMounted:!0,children:_.jsxs(P.Stack,{gap:2,children:[_.jsx(GZn,{imageSrc:l,aspectRatio:f,onInitialized:s,zoom:d,onZoomChange:g}),_.jsxs(P.Stack,{gap:1.5,children:[_.jsxs(P.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",children:[_.jsx(P.Typography,{variant:"body1",children:"Zoom"}),_.jsx(P.Slider,{value:d,onChange:(m,v)=>g(Array.isArray(v)?v[0]:v),min:.1,max:2,size:"medium",step:.0125})]}),_.jsxs(P.Stack,{direction:"row",gap:2,children:[_.jsx(P.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:_.jsx(Le,{icon:"DELETE_MARK_BUTTON_02"}),onClick:u,children:"Remover"}),_.jsx(P.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:_.jsx(Le,{icon:"PLAY_SIMPLE"}),onClick:c,children:"Pré-visualizar"}),_.jsx(P.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:_.jsx(Le,{icon:"SEARCH_IMAGE"}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})})},h22=P.styled(P.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),C22=P.styled(P.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:P.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),b22=P.styled(P.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),tGn=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:l,tabIndex:f,...s})=>{const{id:d,setCropModalOpen:g,handleRemove:m,toggleCropModalOpen:v,cropModalOpen:C,cancelChanges:h,saveChanges:b,previewImage:p,setCropper:y,preview:j,closePreviewImage:E}=qUn({onFileCropped:e,onImageUploaded:t,onCancel:n});return _.jsxs(_.Fragment,{children:[_.jsxs(h22,{children:[c&&_.jsx(fCt,{}),_.jsx(QUn,{...s,id:d,file:l,onDrop:O=>{if(O.length>0){g(!0);const M=new FileReader;M.addEventListener("load",()=>{var D;const S=((D=M.result)==null?void 0:D.toString())||"";t(S),e(void 0)}),M.readAsDataURL(O[0])}},image:u,tabIndex:f}),(l||u)&&_.jsxs(C22,{className:"actions",children:[_.jsx(P.Button,{color:"inherit",startIcon:_.jsx(Le,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:m,children:"Remover"}),_.jsx(P.Button,{color:"inherit",startIcon:_.jsx(Le,{icon:"SEARCH_IMAGE",color:"primary.maon"}),onClick:v,children:"Editar"})]})]}),_.jsx(eGn,{id:d,open:C,onClose:h,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:b,onPreview:p,onInitialized:y}),_.jsx(P.Dialog,{open:!!j,onClose:E,scroll:"body",PaperProps:{sx:{p:2}},children:j&&_.jsx("img",{src:j,alt:"Preview"})})]})},y22=P.styled(P.Stack)(({theme:e})=>({backgroundColor:"#fff",border:`1px solid ${e.palette.grey[300]}`})),nGn=({children:e,...t})=>_.jsx(y22,{borderRadius:1,gap:3,padding:3,...t,children:e}),p22=P.styled(P.Box)(()=>({marginLeft:"4px",fontWeight:"fontWeightBold"})),O22=P.styled(P.Button)(()=>({fontWeight:"fontWeightSemiBold"})),j22=P.styled(Le)(({theme:e})=>({color:e.palette.primary.main})),w22=({selectedTitle:e,onSelect:t,options:n})=>{const a=WSn();return _.jsxs(_.Fragment,{children:[_.jsx(O22,{disableRipple:!0,color:"inherit",onClick:a.onOpen,endIcon:_.jsx(j22,{icon:a.open?"CHEVRON_UP":"ARROW_DOWN_SIMPLE"}),children:_.jsx(p22,{component:"span",children:e.label})}),_.jsx(hUn,{open:a.open,onClose:a.onClose,children:n.map(r=>_.jsx(P.MenuItem,{selected:r.value===e.value,onClick:()=>{a.onClose(),t(r.value)},children:r.label},r.value))})]})},M22=P.styled(P.Stack)({display:"grid",gridTemplateColumns:"auto auto"}),L22=P.styled(P.Typography)(({theme:e})=>({color:e.palette.grey[600]})),P22=P.styled(P.Typography)(({theme:e})=>({textAlign:"right",color:e.palette.grey[800]})),E22=({data:e,...t})=>e.length===0?null:_.jsx(M22,{gap:1,...t,children:e.map(n=>[_.jsx(L22,{variant:"body2",children:n.label},`label:${n.id}`),_.jsx(P22,{variant:"body2",children:n.value},`value:${n.id}`)])}),k22=P.styled(P.Stack)(({theme:e})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${e.palette.grey[300]}`})),S22=P.styled(P.Stack)(({theme:e})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${e.palette.grey[300]}`})),D22=P.styled(P.Stack)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),B22=P.styled(P.Stack)(({theme:e})=>({height:"100%",width:"50%",flex:1,[e.breakpoints.down(1680)]:{width:"70%"}})),W22=P.styled(P.Typography)(({theme:e})=>({color:e.palette.grey[800],fontSize:18,fontWeight:700})),I22=P.styled(P.Typography)(({theme:e})=>({color:e.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24})),$22=P.styled(P.Button)(({theme:e})=>({paddingTop:6,paddingBottom:6,paddingLeft:0,margin:0,marginBottom:4,marginTop:4,width:"100%",display:"block",cursor:"pointer",color:e.palette.grey[600],textAlign:"left",fontWeight:400,fontSize:14,"> span":{color:e.palette.error.main}})),x22=P.styled(q_t)(()=>({height:1,"& .simplebar-content":{height:1}})),z22=P.styled(P.Stack)(()=>({position:"fixed",width:"202px"})),H22=({title:e,sections:t,headerLeftContent:n,headerRightContent:a,onClickBack:r})=>_.jsx(P.Stack,{children:_.jsxs(P.Stack,{direction:"row",children:[_.jsx(k22,{children:_.jsx(x22,{children:_.jsxs(z22,{children:[_.jsx(P.Typography,{variant:"overline",color:"text.disabled",fontWeight:700,children:"ACESSO RÁPIDO"}),t.map((u,c)=>_.jsxs(P.Stack,{children:[_.jsxs($22,{onClick:()=>{u.ref.current&&u.ref.current.scrollIntoView({block:"end",behavior:"smooth"})},children:[u.title,u.isRequired&&_.jsx("span",{children:"*"})]}),c<t.length-1&&_.jsx(P.Divider,{})]},c))]})})}),_.jsxs(P.Stack,{width:"100%",alignItems:"center",mb:8,children:[_.jsx(S22,{children:_.jsxs(D22,{children:[_.jsxs(P.Stack,{flexDirection:"row",gap:2,children:[_.jsx(P.IconButton,{color:"primary",onClick:()=>r(),children:_.jsx(Le,{icon:"CHEVRON_LEFT"})}),_.jsx(P.Typography,{variant:"h4",children:e}),n]}),_.jsxs(P.Stack,{direction:"row",gap:2,alignItems:"center",minWidth:"max-content",children:[_.jsx(sSn,{disabled:!0}),a]})]})}),_.jsx(B22,{children:t.map(u=>_.jsxs(P.Stack,{ref:u.ref,paddingTop:3,paddingBottom:2,alignItems:"start",width:"100%",children:[_.jsx(W22,{children:u.title}),_.jsx(I22,{children:u.subTitle}),_.jsx(nGn,{width:"100%",borderRadius:1,gap:1.5,padding:3,children:u.child})]},u.title))})]})]})}),un=({name:e,helperText:t,rules:n,onChange:a,tabIndex:r,...u})=>{const{control:c}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:c,rules:n,render:({field:{ref:l,...f},fieldState:{error:s}})=>_.jsx(P.TextField,{...f,onChange:d=>{f.onChange(d),a&&a(d)},inputRef:l,fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||t,...u,inputProps:{...u.inputProps,tabIndex:r}})})},rGn=({name:e,helperText:t,onChange:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:u,render:({field:c,fieldState:{error:l}})=>_.jsxs("div",{children:[_.jsx(P.FormControlLabel,{control:_.jsx(P.Switch,{...c,checked:c.value,onChange:(f,s)=>{c.onChange(f),n&&n(f,s)},inputProps:{tabIndex:a}}),...r}),(!!l||t)&&_.jsx(P.FormHelperText,{error:!!l,sx:f=>({mx:"14px",color:r.disabled?f.palette.grey[500]:void 0}),children:l?l==null?void 0:l.message:t})]})})},A22=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],R22=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],V22=P.styled(P.Stack)(({theme:e})=>({border:`1px solid ${P.alpha(e.palette.primary.main,.3)}`,backgroundColor:P.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),F22=P.styled(P.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),N22=P.styled(P.IconButton)(()=>({height:"38px",alignSelf:"center"})),T22=({webhookData:e,isEditing:t=!1,haveTip:n=!1})=>{const{control:a}=Ie.useFormContext(),{fields:r,append:u,remove:c}=Ie.useFieldArray({name:"headers",control:a}),l=()=>{u({value:"",name:""})};return _.jsxs(_.Fragment,{children:[n&&_.jsxs(V22,{children:[_.jsx(Le,{icon:"INFO_CIRCLE"}),_.jsx(P.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&&_.jsx(un,{name:"name",label:"Nome do webhook"}),_.jsxs(P.Stack,{direction:"row",gap:2,children:[_.jsx(un,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url é obrigatório"}}}),_.jsx(un,{name:"filter",label:"Filtro"})]}),t&&e&&_.jsxs(_.Fragment,{children:[_.jsx(un,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),_.jsxs(P.Stack,{direction:"row",gap:2,children:[_.jsx(un,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),_.jsx(un,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:_.jsx(P.InputAdornment,{position:"end",children:_.jsx(F22,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:_.jsx(Le,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),_.jsx(un,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),_.jsxs(P.Stack,{direction:"row",gap:2,children:[_.jsxs(P.Stack,{width:"35%",gap:2,children:[_.jsx(P.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),_.jsx(XBn,{name:"content_type",options:A22,row:!0,decorated:!0})]}),_.jsxs(P.Stack,{gap:2,children:[_.jsx(P.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),_.jsx(XBn,{name:"http_method",options:R22,row:!0,decorated:!0})]})]}),_.jsx(P.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),_.jsx(rGn,{name:"active",label:"Ativo"}),_.jsx(P.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),r==null?void 0:r.map((f,s)=>_.jsxs(P.Stack,{direction:"row",gap:2,children:[_.jsx(un,{name:`headers.${s}.name`,label:"Chave",rules:{required:{value:!0,message:"Chave é obrigatório"}}}),_.jsx(un,{name:`headers.${s}.value`,label:"Valor",rules:{required:{value:!0,message:"Valor é obrigatório"}}}),_.jsx(N22,{onClick:()=>c(s),color:"error",children:_.jsx(Le,{icon:"DELETE_MARK_BUTTON_02"})})]},f.id)),_.jsx(hRn,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>l(),children:"Adicionar novo cabeçalho"}),_.jsx(P.Divider,{})]})},aGn=({name:e,helperText:t,rules:n,onSelectOption:a,...r})=>{const{control:u}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>_.jsx(fSn,{...c,...r,onChange:f=>{a&&a(f),c.onChange(f)},error:!!l,helperText:(l==null?void 0:l.message)||t})})},iGn=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{name:u,onChange:c,value:l,ref:f},fieldState:{error:s}})=>_.jsx(HBn,{ref:f,...a,name:u,value:l,error:!!s,helperText:(s==null?void 0:s.message)||t,onChange:({target:{value:d}})=>c(d)})})},Z22=({name:e,containerProps:t,required:n,rules:a,tabIndex:r})=>{const u=`${e}.zipCode`,c=`${e}.publicPlace`,l=`${e}.number`,f=`${e}.district`,s=`${e}.complement`,d=`${e}.state`,g=`${e}.city`,m=v=>{v.key==="Enter"&&v.preventDefault()};return _.jsxs(P.Stack,{gap:1.5,...t,children:[_.jsxs(P.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[_.jsx(iGn,{name:u,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:_.jsx(P.InputAdornment,{position:"end",children:_.jsx(P.CircularProgress,{size:24})})},rules:a,onKeyDown:m,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:r}),_.jsxs(P.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[_.jsx(un,{name:c,label:"Logradouro",onKeyDown:m,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:r}),_.jsx(un,{name:l,label:"Número",onKeyDown:m,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:r})]})]}),_.jsxs(P.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[_.jsx(un,{name:f,label:"Bairro",onKeyDown:m,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:r}),_.jsx(un,{name:s,label:"Complemento",onKeyDown:m,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:r})]}),_.jsxs(P.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[_.jsx(aGn,{name:d,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:r}),_.jsx(un,{name:g,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:r})]})]})},U22=({name:e,rules:t,helperText:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:u,rules:t,render:({field:c,fieldState:{error:l}})=>_.jsxs("div",{children:[_.jsx(P.FormControlLabel,{control:_.jsx(P.Checkbox,{...c,checked:c.value,tabIndex:a}),...r}),(!!l||n)&&_.jsx(P.FormHelperText,{error:!!l,children:l?l==null?void 0:l.message:n})]})})},G22=({row:e,name:t,rules:n,label:a,options:r,spacing:u,helperText:c,required:l,...f})=>{const{control:s}=Ie.useFormContext(),d=(g,m)=>g.includes(m)?g.filter(v=>v!==m):[...g,m];return _.jsx(Ie.Controller,{name:t,control:s,rules:n,render:({field:{value:g=[],...m},fieldState:{error:v}})=>_.jsxs(P.FormControl,{component:"fieldset",children:[a&&_.jsx(P.FormLabel,{component:"legend",sx:{typography:"body2"},required:l,children:a}),_.jsx(P.FormGroup,{sx:{...e&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:u||0},...e&&{mr:0,"&:not(:last-of-type)":{mr:u||2}}}},children:r.map(C=>_.jsx(P.FormControlLabel,{control:_.jsx(P.Checkbox,{checked:g.includes(C.value),onChange:()=>m.onChange(d(g,C.value))}),label:C.label,...f},C.value))}),(!!v||c)&&_.jsx(P.FormHelperText,{error:!!v,sx:C=>({color:f.disabled?C.palette.grey[500]:void 0}),children:v?v==null?void 0:v.message:c})]})})},Y22=({keyName:e,inputs:t=[],rules:n,tabIndex:a,...r})=>{const u=o.useRef(null),{control:c,setValue:l,formState:{errors:f}}=Ie.useFormContext(),s=m=>{const v=m.clipboardData.getData("text").split("");t.map((C,h)=>l(C,v[h])),m.preventDefault()},d=(m,v)=>{const{maxLength:C,value:h,name:b}=m.target,p=b.replace(e,""),y=Number(p),j=document.querySelector(`input[name=${e}${y+1}]`);h.length>C&&(m.target.value=h[0]),h.length>=C&&y<6&&j!==null&&j.focus(),v(m)};DSn("paste",s,u);const g=t.some(m=>f[m]);return _.jsxs(P.Stack,{children:[_.jsx(P.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:u,children:t.map((m,v)=>_.jsx(Ie.Controller,{name:`${e}${v+1}`,control:c,rules:n,render:({field:C,fieldState:{error:h}})=>_.jsx(P.TextField,{...r,...C,autoComplete:"none",error:!!h,autoFocus:v===0,placeholder:"-",onChange:b=>{d(b,C.onChange)},onFocus:b=>b.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:a}})},m))}),g&&_.jsx(P.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},K22=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:r,rules:{...t,validate:{...t==null?void 0:t.validate,validation:u=>{const c="#"+u.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(c)?!0:"Cor inválida"}}},render:({field:{ref:u,onChange:c,...l},fieldState:{error:f}})=>_.jsx(MNn,{...l,onChangeColor:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||n,...a})})},X22=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return _.jsx(jT.DatePicker,{inputRef:l,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Q22=({name:e,label:t,rules:n,tabIndex:a,helperText:r,required:u,...c})=>{const{control:l,setError:f}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:l,rules:n,render:({field:{value:s,onChange:d},fieldState:{error:g}})=>_.jsx(jT.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...c.localeText},value:[(s==null?void 0:s.startDate)||null,(s==null?void 0:s.endDate)||null],onChange:m=>d({startDate:m[0],endDate:m[1]}),onError:m=>{f(e,{message:m[0]||m[1]||void 0})},...c,slotProps:{textField:({position:m})=>{var v;return{...(v=c.slotProps)==null?void 0:v.textField,required:u,error:!!g,helperText:(g==null?void 0:g.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:m==="start"?`${t} (Dt. Início)`:`${t} (Dt. Fim)`,inputProps:{tabIndex:a}}}},sx:{width:1}})})},J22=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return _.jsx(jT.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:l,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},q22=({id:e,children:t,onSubmit:n,methods:a,...r})=>_.jsx(Ie.FormProvider,{...a,children:_.jsx(P.Stack,{component:"form",id:e,onSubmit:n,flex:1,width:1,noValidate:!0,...r,children:t})}),eu2=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{ref:u,value:c,...l},fieldState:{error:f}})=>_.jsx(IBn,{value:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||t,...a,...l,name:e})})},tu2=({name:e,label:t="",rules:n,helperText:a,changed:r,...u})=>{const{control:c}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:c,rules:n,render:({field:l,fieldState:{error:f}})=>_.jsx(P.Autocomplete,{...l,onChange:(s,d)=>{r&&r(d),l.onChange(d)},renderInput:s=>_.jsx(P.TextField,{label:t,error:!!f,helperText:f?f==null?void 0:f.message:a,...s}),...u})})},nu2=({name:e,helperText:t,rules:n,onChange:a,...r})=>{const{control:u}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>_.jsx(MCt,{...c,onChange:f=>{c.onChange(f),a&&a(f)},fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...r})})},ru2=({name:e,sx:t,rules:n,passwordSize:a,specialCharacter:r,upperCaseChar:u,numberChar:c,showErrorMessage:l,match:f,...s})=>{const{watch:d}=Ie.useFormContext(),g=d(e),[m,v]=o.useState(!1),{hasNumberChar:C,hasSpecialCharacter:h,hasUpperCaseChar:b,isLengthValid:p}=SCt(g,a,c,r,u);return _.jsx(un,{...s,name:e,type:m?"text":"password",InputProps:{endAdornment:_.jsx(P.InputAdornment,{position:"end",children:_.jsx(P.IconButton,{onClick:()=>v(!m),edge:"end","aria-label":"Mostrar/Ocultar senha",children:_.jsx(Le,{icon:m?"VIEW_ON":"VIEW_OFF"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:y=>{const j=SCt(y,a,c,r,u);return!j.hasNumberChar||!j.hasSpecialCharacter||!j.hasUpperCaseChar||!j.isLengthValid?"Senha inválida":f&&f.fieldPassword&&d(f.fieldPassword)!==y?"As senhas devem ser iguais":!0}}},sx:{...t,"& .MuiFormHelperText-root":{display:(!h||!b||!p||!C)&&!l?"none":void 0}}})},XBn=({name:e,rules:t,row:n,label:a,options:r,spacing:u,helperText:c,decorated:l,onChange:f,tabIndex:s,required:d,disabled:g,...m})=>{const{control:v}=Ie.useFormContext(),C=a?`${e}-${a}`:"";return _.jsx(Ie.Controller,{name:e,control:v,rules:t,render:({field:h,fieldState:{error:b}})=>_.jsxs(P.FormControl,{component:"fieldset",sx:{...l&&{paddingLeft:1.5}},children:[a&&_.jsx(P.FormLabel,{component:"legend",id:C,sx:{typography:"body2"},required:d,children:a}),_.jsx(P.RadioGroup,{...m,...h,onChange:(p,y)=>{h.onChange(p),f&&f(p,y)},"aria-labelledby":C,row:n,children:r.map(p=>_.jsx(P.FormControlLabel,{value:p.value,control:_.jsx(P.Radio,{inputProps:{tabIndex:s},disabled:g,checked:p.value===h.value}),label:p.label,sx:({palette:y})=>({"&:not(:last-of-type)":{mb:u||0},...n&&{mr:0,"&:not(:last-of-type)":{mr:u||2}},...l&&{border:`1px solid ${P.alpha(y.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(u||0)/2||1,...h.value===p.value&&{borderColor:"primary.main",backgroundColor:P.alpha(y.primary.main,.05)}}})},p.value))}),(!!b||c)&&_.jsx(P.FormHelperText,{error:!!b,sx:p=>({color:g?p.palette.grey[500]:void 0}),children:b?b==null?void 0:b.message:c})]})})},au2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return _.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return _.jsx(jT.TimePicker,{ampm:!1,format:"HH:mm",inputRef:l,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,error:!!s,required:r,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},iu2=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:l,tabIndex:f,...s})=>{const{id:d,setCropModalOpen:g,handleRemove:m,cropModalOpen:v,cancelChanges:C,saveChanges:h,previewImage:b,setCropper:p,preview:y,closePreviewImage:j}=qUn({onFileCropped:e,onImageUploaded:t,onCancel:n});return _.jsxs(_.Fragment,{children:[_.jsxs(P.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[c&&_.jsx(b22,{}),_.jsx(JUn,{...s,id:d,file:l,onDrop:E=>{if(E.length>0){g(!0);const O=new FileReader;O.addEventListener("load",()=>{var S;const M=((S=O.result)==null?void 0:S.toString())||"";t(M),e(void 0)}),O.readAsDataURL(E[0])}},image:u,tabIndex:f})]}),_.jsx(eGn,{id:d,open:v,onClose:C,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:h,onPreview:b,onInitialized:p}),_.jsx(P.Dialog,{open:!!y,onClose:j,scroll:"body",PaperProps:{sx:{p:2}},children:y&&_.jsx("img",{src:y,alt:"Preview"})})]})};function oGn(e,t){const{watch:n,setValue:a}=Ie.useFormContext(),[r,u]=o.useState(t),c=n(e)||[];return{uploadFile:async m=>{if(!m){a(e,void 0),u(void 0);return}a(e,m),u(Object.assign(m,{preview:URL.createObjectURL(m)}))},uploadFiles:async m=>{a(e,[...c,...m.map(v=>Object.assign(v,{preview:URL.createObjectURL(v)}))])},handleDeleteFile:()=>{a(e,void 0),u(void 0)},handleRemoveAll:()=>{a(e,void 0)},handleRemove:m=>{const v=c.filter(C=>C!==m);a(e,v)},file:r,setFileValue:u}}const ou2=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:l,onCancel:f,...s})=>{const{control:d}=Ie.useFormContext(),{uploadFile:g,file:m,setFileValue:v}=oGn(e);return _.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>_.jsx(iu2,{accept:{"image/*":[]},file:C?m:void 0,onFileCropped:b=>{g(b),c&&c(b)},onImageUploaded:l,onCancel:()=>{v(void 0),f&&f()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&_.jsx(P.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},uu2=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:l,onCancel:f,...s})=>{const{control:d}=Ie.useFormContext(),{uploadFile:g,file:m,setFileValue:v}=oGn(e);return _.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>_.jsx(tGn,{accept:{"image/*":[]},file:C?m:void 0,onFileCropped:b=>{g(b),c&&c(b)},onImageUploaded:l,onCancel:()=>{v(void 0),f&&f()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&_.jsx(P.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},uGn=P.styled(P.Button)(({theme:e})=>({borderColor:e.palette.grey[300]})),cGn=P.styled(P.Box)(({theme:e})=>({border:"1.5px solid",borderColor:e.palette.grey[300],height:450,width:"40%",borderRadius:8})),cu2=({selectedItems:e,items:t,loading:n,searchText:a,onAdd:r,onRemove:u,search:c,itemsTitle:l,selectedItemsTitle:f,additionalContent:s,onSearch:d})=>{const g=P.debounce(d,400),m=t.filter(k=>!e.some(B=>B.id===k.id)),v=t.filter(k=>e.some(B=>B.id===k.id)),[C,h]=o.useState([]),[b,p]=o.useState([]),y=()=>{r(C),h([])},j=()=>{u(b),p([])},E=k=>{p(k?v:[])},O=k=>{h(k?m:[])},M=(k,B)=>{p(B?x=>[...x,k]:x=>x.filter(N=>N.id!==k.id))},S=(k,B)=>{h(B?x=>[...x,k]:x=>x.filter(N=>N.id!==k.id))},D=k=>{k.key==="Enter"&&k.preventDefault()};return _.jsx(P.Stack,{children:_.jsxs(P.Stack,{direction:"row",alignItems:"center",gap:3,children:[_.jsx(cGn,{display:"flex",flex:1,children:_.jsxs(P.Stack,{flex:1,children:[_.jsxs(P.Stack,{direction:"row",gap:1,padding:2,children:[_.jsx(P.Checkbox,{size:"small",indeterminate:C.length>0&&C.length!==m.length,checked:C.length>0&&C.length===m.length,onChange:k=>O(k.target.checked)}),_.jsxs(P.Stack,{children:[_.jsx(P.Typography,{variant:"subtitle2",color:"text.primary",children:`${l} cadastrados`}),_.jsx(P.Typography,{variant:"caption",color:"text.disabled",children:`${C.length}/${m.length} selecionados`})]})]}),_.jsx(P.Divider,{}),_.jsxs(P.Stack,{p:2,flex:1,children:[_.jsxs(P.Stack,{direction:"row",gap:1,children:[_.jsx(pUn,{iconPosition:"start",placeholder:"Buscar",onKeyDown:D,size:"small",fullWidth:!0,trigger:"change",onSearch:k=>g(k)}),s]}),_.jsx(ABn,{isLoading:n,loading:_.jsx(P.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:_.jsx(P.CircularProgress,{})}),isEmpty:m.length===0,empty:_.jsx(sCt,{text:c?`Nenhum ${a} encontrado`:`Nenhum ${a} disponível`,sx:{svg:{height:140}}}),children:_.jsx(q_t,{sx:{maxHeight:280},children:m.map(k=>_.jsxs(P.Stack,{gap:1,marginTop:"8px",children:[_.jsxs(P.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[_.jsx(P.Checkbox,{size:"small",checked:C.includes(k),onChange:B=>S(k,B.target.checked)}),k.label]}),_.jsx(P.Divider,{})]},k.id))})})]})]})}),_.jsxs(P.Stack,{gap:3,children:[_.jsx(uGn,{variant:"outlined",onClick:y,children:_.jsx(Le,{icon:"ARROW_RIGHT_SIMPLE"})}),_.jsx(uGn,{variant:"outlined",onClick:j,children:_.jsx(Le,{icon:"ARROW_LEFT_SIMPLE"})})]}),_.jsx(cGn,{display:"flex",flex:1,children:_.jsxs(P.Stack,{flex:1,children:[_.jsxs(P.Stack,{direction:"row",gap:1,padding:2,children:[_.jsx(P.Checkbox,{size:"small",indeterminate:b.length>0&&b.length!==v.length,checked:b.length>0&&b.length===v.length,onChange:k=>E(k.target.checked)}),_.jsxs(P.Stack,{children:[_.jsx(P.Typography,{variant:"subtitle2",color:"text.primary",children:`${f} selecionados`}),_.jsx(P.Typography,{variant:"caption",color:"text.disabled",children:`${b.length}/${v.length} selecionados`})]})]}),_.jsx(P.Divider,{}),_.jsx(P.Box,{display:"flex",p:2,flex:1,justifyContent:"center",alignItems:"center",children:_.jsx(ABn,{isLoading:n,loading:_.jsx(P.CircularProgress,{}),isEmpty:v.length===0,empty:_.jsx(sCt,{text:`Nenhum ${a} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:_.jsx(q_t,{sx:{maxHeight:280},children:v.map(k=>_.jsxs(P.Stack,{gap:1,children:[_.jsxs(P.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[_.jsx(P.Checkbox,{size:"small",checked:b.includes(k),onChange:B=>M(k,B.target.checked)}),k.label]}),_.jsx(P.Divider,{})]},k.id))})})})]})})]})})},lu2=Object.freeze(Object.defineProperty({__proto__:null,default:Ner},Symbol.toStringTag,{value:"Module"}));R.ActionButton=hRn,R.Address=Z22,R.Autocomplete=fSn,R.AutocompleteField=aGn,R.BuilderLayout=uDo,R.BuilderSidebar=$zo,R.Carousel=bEo,R.CarouselArrowIndex=xEo,R.CarouselArrows=wEo,R.CarouselDots=jEo,R.Checkbox=U22,R.Codes=Y22,R.ColorPickerField=K22,R.ColorPickerInput=MNn,R.Common=Yn2,R.CommonSSR=Xn2,R.Confirm=Qn2,R.CustomAvatar=MTn,R.CustomAvatarGroup=LTn,R.DataGrid=tr2,R.DatePicker=X22,R.DateRangePicker=Q22,R.DateTimePicker=J22,R.Delayed=nr2,R.DialogAnimate=mtr,R.Drawer=gr2,R.EmptyContent=XHn,R.EmptyView=sCt,R.Error=mr2,R.FabButtonAnimate=qxn,R.Field=un,R.FixedProgressBar=fCt,R.Form=q22,R.FrameSkeleton=H22,R.HelpButton=sSn,R.Icon=Le,R.IconButtonAnimate=ezn,R.Iconify=_Zn,R.IllustrationEmptyContent=yIn,R.ImageCrop=GZn,R.Incrementer=IBn,R.IncrementerField=eu2,R.Label=uUn,R.Lightbox=HSo,R.LoadingScreen=Na2,R.MaskedInput=HBn,R.MaskedInputField=iGn,R.MaterialDesignContent=Dyt,R.MenuPopover=hUn,R.Modal=CUn,R.ModalActions=fi2,R.MotionContainer=ktr,R.MotionLazyContainer=Oyt,R.MotionViewport=Etr,R.MultiCheckbox=G22,R.MultipleChipField=tu2,R.NoData=pIn,R.NumberInput=MCt,R.NumberInputField=nu2,R.PasswordField=ru2,R.PasswordRules=vi2,R.PopoverSelect=w22,R.Portal=bUn,R.RadioGroupField=XBn,R.Result=ABn,R.SavedChanges=Hi2,R.Scrollbar=q_t,R.SearchInput=pUn,R.SnackbarContent=Syt,R.SnackbarProvider=Ezn,R.SplashScreen=Ai2,R.Steps=Fi2,R.StyledTab=Ni2,R.StyledTabs=Ti2,R.Summary=E22,R.SwapList=cu2,R.Switch=rGn,R.TRANSITION=OIn,R.TabPanel=Zi2,R.TableEmptyRows=NEo,R.TableHeadCustom=ZEo,R.TableNoData=VEo,R.TablePaginationCustom=GEo,R.TableSelectedAction=UEo,R.TableSkeleton=FEo,R.TextAnimate=vtr,R.TextMaxLine=wUn,R.ThemeProvider=wTn,R.TimePicker=au2,R.Transition=Dvt,R.Upload=QUn,R.UploadAvatar=JUn,R.UploadAvatarWithCropField=ou2,R.UploadBox=v22,R.UploadIllustration=bIn,R.UploadWithCrop=tGn,R.UploadWithCropField=uu2,R.Webhook=T22,R.WhiteBox=nGn,R.color=Pt2,R.compare=pzo,R.cssStyles=IEo,R.emptyRows=zEo,R.file=hi2,R.formatNumber=ha2,R.formatTime=ki2,R.getComparator=HEo,R.loadable=zi2,R.mask=$i2,R.number=sa2,R.routes=Di2,R.sort=Ii2,R.useActiveElement=cDo,R.useApiMessage=Szo,R.useCarousel=yEo,R.useCopyToClipboard=lDo,R.useDatagrid=fDo,R.useDeepCompareEffect=jzo,R.useEventListener=DSn,R.useIsMounting=Mzo,R.useLightBox=VSo,R.useOffSetTop=kzo,R.useOnClickOutside=Ezo,R.usePagination=Pzo,R.usePopover=WSn,R.useResponsive=nzn,R.useSnackbar=kzn,R.useTable=AEo,R.useTabs=Lzo,R.useToggle=BSn,R.uuidv4=xi2,R.validators=gi2,R.varBgColor=BXn,R.varBgKenburns=WXn,R.varBgPan=IXn,R.varBounce=kXn,R.varContainer=nvt,R.varFade=lle,R.varFlip=LXn,R.varHover=DXn,R.varPath=jXn,R.varRotate=SXn,R.varScale=EXn,R.varSlide=PXn,R.varTranEnter=$e,R.varTranExit=Ne,R.varTranHover=wXn,R.varZoom=MXn,Object.defineProperty(R,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.3.36",
4
+ "version": "1.3.37",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",