\ No newline at end of file
diff --git a/portal-ui/build/static/js/1191.1f6c42ce.chunk.js b/portal-ui/build/static/js/1191.1f6c42ce.chunk.js
new file mode 100644
index 0000000000..7d801d6959
--- /dev/null
+++ b/portal-ui/build/static/js/1191.1f6c42ce.chunk.js
@@ -0,0 +1,2 @@
+(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1191],{92217:function(e,t,n){"use strict";var r=n(72791),o=n(29945),i=n(78029),c=n.n(i),a=n(27454),s=n(80184);t.Z=function(e){var t=e.value,n=e.label,i=void 0===n?"":n,l=e.tooltip,u=void 0===l?"":l,d=e.mode,p=void 0===d?"json":d,f=e.onChange,h=e.editorHeight,y=void 0===h?250:h,m=e.helptip;return(0,s.jsx)(o.pq4,{value:t,onChange:function(e){return f(e)},mode:p,tooltip:u,editorHeight:y,label:i,helpTools:(0,s.jsx)(r.Fragment,{children:(0,s.jsx)(a.Z,{tooltip:"Copy to Clipboard",children:(0,s.jsx)(c(),{text:t,children:(0,s.jsx)(o.zxk,{type:"button",id:"copy-code-mirror",icon:(0,s.jsx)(o.TIy,{}),color:"primary",variant:"regular"})})})}),helpTip:m,helpTipPlacement:"right"})}},879:function(e,t,n){"use strict";n.d(t,{D_:function(){return c},Et:function(){return o},GJ:function(){return i},yh:function(){return r}});var r={RED:"#C83B51",GREEN:"#4CCB92",YELLOW:"#FFBD62"},o=function(e,t){return e<=t/2?"bad":2!==t&&e===t/2+1?"warn":e===t?"good":void 0},i=function(e){switch(e){case"offline":return"bad";case"online":return"good";default:return"warn"}},c=function(e,t){return e<=t/2?"bad":e===t/2+1?"warn":e===t?"good":void 0}},1191:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var r=n(1413),o=n(29439),i=n(72791),c=n(78687),a=n(57689),s=n(29945),l=n(23814),u=n(92217),d=n(56087),p=n(38442),f=n(75578),h=n(59114),y=n(879),m=n(80184),x={display:"grid",gridTemplateColumns:"70px 1fr",gap:15},j=function(e){var t=e.search,n=void 0===t?"":t,r=e.children,o=void 0===r?"":r,i=new RegExp("(".concat(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}(n),")"),"i"),c=String(o).split(i);return n?c.map((function(e,t){return i.test(e)?(0,m.jsx)("mark",{children:e},t):e})):o},b=function(e){var t=e.policyStatements,n=(0,i.useState)(""),r=(0,o.Z)(n,2),c=r[0],a=r[1];return(0,m.jsxs)(s.rjZ,{container:!0,children:[(0,m.jsx)(s.rjZ,{item:!0,xs:12,children:(0,m.jsxs)(s.rjZ,{container:!0,sx:{display:"flex",alignItems:"center"},children:[(0,m.jsx)(s.SYi,{content:(0,m.jsxs)(i.Fragment,{children:["Define which actions are permitted on a specified resource. Learn more about"," ",(0,m.jsx)("a",{target:"blank",href:"https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html",children:"IAM conditional statements"}),"."]}),placement:"right",children:(0,m.jsx)(s.rjZ,{item:!0,xs:12,sm:6,sx:{fontWeight:"bold"},children:"Statements"})}),(0,m.jsx)(s.rjZ,{item:!0,xs:12,sm:6,sx:{display:"flex",justifyContent:"flex-end"},children:(0,m.jsx)(h.Z,{placeholder:"Search",onChange:a,value:c,sx:{maxWidth:380}})})]})}),!t&&(0,m.jsx)(i.Fragment,{children:"Policy has no statements"}),t&&(0,m.jsx)(s.rjZ,{item:!0,xs:12,sx:{"& .policy-row":{borderBottom:"1px solid #eaeaea"},"& .policy-row:first-child":{borderTop:"1px solid #eaeaea"},"& .policy-row:last-child":{borderBottom:"0px"},paddingTop:"15px","& mark":{color:"#000000",fontWeight:500}},children:t.map((function(e,t){var n=e.Effect,r="Allow"===n;return(0,m.jsxs)(s.xuv,{className:"policy-row",sx:{display:"grid",gridTemplateColumns:"1fr",gap:"15px",fontSize:"14px",padding:"10px 0 10px 0","& .label":{fontWeight:600}},children:[(0,m.jsxs)(s.xuv,{sx:x,children:[(0,m.jsx)(s.xuv,{className:"label",children:"Effect:"}),(0,m.jsxs)(s.xuv,{sx:{display:"flex",alignItems:"center","& .min-icon":{marginRight:"5px",fill:r?y.yh.GREEN:y.yh.RED,height:"14px",width:"14px"}},children:[r?(0,m.jsx)(s.E31,{}):(0,m.jsx)(s.dRf,{}),n]})]}),(0,m.jsxs)(s.rjZ,{container:!0,sx:{gap:15},children:[(0,m.jsxs)(s.rjZ,{item:!0,xs:12,sm:6,sx:x,children:[(0,m.jsx)(s.xuv,{className:"label",children:"Actions:"}),(0,m.jsx)(s.xuv,{children:e.Action&&e.Action.map((function(e,n){return(0,m.jsx)("div",{children:(0,m.jsx)(j,{search:c,children:e})},"".concat(t,"-r-").concat(n))}))})]}),(0,m.jsxs)(s.rjZ,{item:!0,xs:12,sm:6,sx:x,children:[(0,m.jsx)(s.xuv,{className:"label",children:"Resources:"}),(0,m.jsx)(s.xuv,{children:e.Resource&&e.Resource.map((function(e,n){return(0,m.jsxs)("div",{children:[" ",(0,m.jsx)(j,{search:c,children:e})]},"".concat(t,"-r-").concat(n))}))})]})]})]},"".concat(t))}))})]})},g=n(45248),v=n(87995),C=n(46078),w=n(44690),S=n(27454),O=n(47974),P=n(31776),Z=n(99670),E=(0,f.Z)(i.lazy((function(){return n.e(312).then(n.bind(n,312))}))),k=function(){var e=(0,w.TL)(),t=(0,a.s0)(),n=(0,a.UO)(),f=(0,c.v9)(C.$4),y=(0,i.useState)(null),x=(0,o.Z)(y,2),j=x[0],k=x[1],R=(0,i.useState)([]),D=(0,o.Z)(R,2),_=D[0],F=D[1],T=(0,i.useState)([]),A=(0,o.Z)(T,2),I=A[0],M=A[1],N=(0,i.useState)([]),L=(0,o.Z)(N,2),B=L[0],U=L[1],G=(0,i.useState)(!1),z=(0,o.Z)(G,2),H=z[0],K=z[1],J=(0,g.IO)(n.policyName||""),W=(0,i.useState)(""),X=(0,o.Z)(W,2),Y=X[0],Q=X[1],$=(0,i.useState)(!0),q=(0,o.Z)($,2),V=q[0],ee=q[1],te=(0,i.useState)(""),ne=(0,o.Z)(te,2),re=ne[0],oe=ne[1],ie=(0,i.useState)(!0),ce=(0,o.Z)(ie,2),ae=ce[0],se=ce[1],le=(0,i.useState)(""),ue=(0,o.Z)(le,2),de=ue[0],pe=ue[1],fe=(0,i.useState)(!0),he=(0,o.Z)(fe,2),ye=he[0],me=he[1],xe=(0,i.useState)(!1),je=(0,o.Z)(xe,2),be=je[0],ge=je[1],ve=(0,i.useState)("summary"),Ce=(0,o.Z)(ve,2),we=Ce[0],Se=Ce[1],Oe=f&&f.includes("ldap-idp")||!1,Pe=(0,p.F)(d.C3,d.K6,!0),Ze=(0,p.F)(d.C3,d.k_,!0),Ee=(0,p.F)(d.C3,d.Rs,!0),ke=(0,p.F)(d.C3,d.iw,!0),Re=(0,p.F)(d.C3,d.GD,!0),De=(0,p.F)(d.C3,d.bE,!0),_e=(0,p.F)(d.C3,d.XM,!0);(0,i.useEffect)((function(){V&&(V&&(Re?P.h.policy.policyInfo((0,g.LL)(J)).then((function(e){if(e.data){var t,n;k(e.data),Q(e?JSON.stringify(JSON.parse(null===(t=e.data)||void 0===t?void 0:t.policy),null,4):"");var r=JSON.parse(null===(n=e.data)||void 0===n?void 0:n.policy);F(r.Statement)}ee(!1)})).catch((function(t){e((0,v.Ih)(t)),ee(!1)})):ee(!1)),ae&&(Ee&&!Oe?P.h.policies.listUsersForPolicy((0,g.LL)(J)).then((function(e){var t;M(null!==(t=e.data)&&void 0!==t?t:[]),se(!1)})).catch((function(t){e((0,v.Ih)(t)),se(!1)})):se(!1)),ye&&(Pe&&!Oe?P.h.policies.listGroupsForPolicy((0,g.LL)(J)).then((function(e){var t;U(null!==(t=e.data)&&void 0!==t?t:[]),me(!1)})).catch((function(t){e((0,v.Ih)(t)),me(!1)})):me(!1)))}),[J,V,ae,ye,M,U,Q,k,se,me,Ee,Pe,Re,Oe,e]);var Fe=""!==J.trim(),Te=[{type:"view",onClick:function(e){t("".concat(d.gA.USERS,"/").concat((0,g.LL)(e)))},disableButtonFunction:function(){return!ke}}],Ae=I.filter((function(e){return e.includes(re)})),Ie=[{type:"view",onClick:function(e){t("".concat(d.gA.GROUPS,"/").concat((0,g.LL)(e)))},disableButtonFunction:function(){return!Ze}}],Me=B.filter((function(e){return e.includes(de)})),Ne=function(){se(!0),me(!0),ee(!0)};return(0,i.useEffect)((function(){e((0,v.Sc)("policy_details_summary"))}),[]),(0,m.jsxs)(i.Fragment,{children:[be&&(0,m.jsx)(E,{deleteOpen:be,selectedPolicy:J,closeDeleteModalAndRefresh:function(e){ge(!1),t(d.gA.POLICIES)}}),(0,m.jsx)(O.Z,{label:(0,m.jsx)(i.Fragment,{children:(0,m.jsx)(s.hbI,{label:"Policy",onClick:function(){return t(d.gA.POLICIES)}})}),actions:(0,m.jsx)(Z.Z,{})}),(0,m.jsxs)(s.Xgh,{children:[(0,m.jsx)(s.UHn,{icon:(0,m.jsx)(s.v42,{width:40}),title:J,subTitle:(0,m.jsx)(i.Fragment,{children:"IAM Policy"}),actions:(0,m.jsxs)(i.Fragment,{children:[(0,m.jsx)(p.s,{scopes:[d.Ft.ADMIN_DELETE_POLICY],resource:d.C3,errorProps:{disabled:!0},children:(0,m.jsx)(S.Z,{tooltip:De?"":(0,d.MK)(d.bE,"delete Policies"),children:(0,m.jsx)(s.zxk,{id:"delete-policy",label:"Delete Policy",variant:"secondary",icon:(0,m.jsx)(s.XHJ,{}),onClick:function(){ge(!0)},disabled:!De})})}),(0,m.jsx)(S.Z,{tooltip:"Refresh",children:(0,m.jsx)(s.zxk,{id:"refresh-policy",label:"Refresh",variant:"regular",icon:(0,m.jsx)(s.DuK,{}),onClick:function(){Ne()}})})]}),sx:{marginBottom:15}}),(0,m.jsx)(s.xuv,{children:(0,m.jsx)(s.mQc,{options:[{tabConfig:{label:"Summary",disabled:!Re,id:"summary"},content:(0,m.jsx)(i.Fragment,{children:(0,m.jsxs)(s.rjZ,{onMouseMove:function(){return e((0,v.Sc)("policy_details_summary"))},children:[(0,m.jsx)(s.NZf,{separator:!0,sx:{marginBottom:15},children:"Policy Summary"}),(0,m.jsx)(s.xuv,{withBorders:!0,children:(0,m.jsx)(b,{policyStatements:_})})]})})},{tabConfig:{label:"Users",disabled:!Ee||Oe,id:"users"},content:(0,m.jsx)(i.Fragment,{children:(0,m.jsxs)(s.rjZ,{onMouseMove:function(){return e((0,v.Sc)("policy_details_users"))},children:[(0,m.jsx)(s.NZf,{separator:!0,sx:{marginBottom:15},children:"Users"}),(0,m.jsxs)(s.rjZ,{container:!0,children:[I.length>0&&(0,m.jsx)(s.rjZ,{item:!0,xs:12,sx:(0,r.Z)((0,r.Z)({},l.OR.actionsTray),{},{marginBottom:15}),children:(0,m.jsx)(h.Z,{value:re,placeholder:"Search Users",id:"search-resource",onChange:function(e){oe(e)}})}),(0,m.jsx)(s.wQF,{itemActions:Te,columns:[{label:"Name",elementKey:"name"}],isLoading:ae,records:Ae,entityName:"Users with this Policy associated",idField:"name",customPaperHeight:"500px"})]})]})})},{tabConfig:{label:"Groups",disabled:!Pe||Oe,id:"groups"},content:(0,m.jsx)(i.Fragment,{children:(0,m.jsxs)(s.rjZ,{onMouseMove:function(){return e((0,v.Sc)("policy_details_groups"))},children:[(0,m.jsx)(s.NZf,{separator:!0,sx:{marginBottom:15},children:"Groups"}),(0,m.jsxs)(s.rjZ,{container:!0,children:[B.length>0&&(0,m.jsx)(s.rjZ,{item:!0,xs:12,sx:(0,r.Z)((0,r.Z)({},l.OR.actionsTray),{},{marginBottom:15}),children:(0,m.jsx)(h.Z,{value:re,placeholder:"Search Groups",id:"search-resource",onChange:function(e){pe(e)}})}),(0,m.jsx)(s.wQF,{itemActions:Ie,columns:[{label:"Name",elementKey:"name"}],isLoading:ye,records:Me,entityName:"Groups with this Policy associated",idField:"name",customPaperHeight:"500px"})]})]})})},{tabConfig:{label:"Raw Policy",disabled:!Re,id:"raw-policy"},content:(0,m.jsx)(i.Fragment,{children:(0,m.jsxs)(s.rjZ,{onMouseMove:function(){return e((0,v.Sc)("policy_details_policy"))},children:[(0,m.jsx)(s.SYi,{content:(0,m.jsx)(i.Fragment,{children:(0,m.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/policy-based-access-control.html#policy-document-structure",children:"Guide to access policy structure"})}),placement:"right",children:(0,m.jsx)(s.NZf,{children:"Raw Policy"})}),(0,m.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(t){t.preventDefault(),H||(K(!0),_e?P.h.policies.addPolicy({name:J,policy:Y}).then((function(t){K(!1),e((0,v.y1)("Policy successfully updated")),Ne()})).catch((function(t){K(!1),e((0,v.Ih)({errorMessage:"There was an error updating the Policy ",detailedError:"There was an error updating the Policy: "+(t.error.detailedMessage||"")+". Please check Policy syntax."}))})):K(!1))},children:(0,m.jsxs)(s.rjZ,{container:!0,children:[(0,m.jsx)(s.rjZ,{item:!0,xs:12,children:(0,m.jsx)(u.Z,{value:Y,onChange:function(e){_e&&Q(e)},editorHeight:"350px",helptip:(0,m.jsx)(i.Fragment,{children:(0,m.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/policy-based-access-control.html#policy-document-structure",children:"Guide to access policy structure"})})})}),(0,m.jsxs)(s.rjZ,{item:!0,xs:12,sx:{display:"flex",justifyContent:"flex-end",paddingTop:16,gap:8},children:[!j&&(0,m.jsx)(s.zxk,{type:"button",variant:"regular",id:"clear-policy",onClick:function(){Q("{}")},children:"Clear"}),(0,m.jsx)(p.s,{scopes:[d.Ft.ADMIN_CREATE_POLICY],resource:d.C3,errorProps:{disabled:!0},children:(0,m.jsx)(S.Z,{tooltip:_e?"":(0,d.MK)(d.XM,"edit a Policy"),children:(0,m.jsx)(s.zxk,{id:"save",type:"submit",variant:"callAction",color:"primary",disabled:H||!Fe||!_e,label:"Save"})})})]}),H&&(0,m.jsx)(s.rjZ,{item:!0,xs:12,children:(0,m.jsx)(s.kod,{})})]})})]})})}],currentTabOrPath:we,onTabClick:function(e){return Se(e)}})})]})]})}},76998:function(e,t,n){"use strict";var r=n(42458),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,i,c,a,s,l,u=!1;t||(t={}),n=t.debug||!1;try{if(c=r(),a=document.createRange(),s=document.getSelection(),(l=document.createElement("span")).textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),"undefined"===typeof r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=o[t.format]||o.default;window.clipboardData.setData(i,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(l),a.selectNodeContents(l),s.addRange(a),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(d){n&&console.error("unable to copy using execCommand: ",d),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(d){n&&console.error("unable to copy using clipboardData: ",d),n&&console.error("falling back to prompt"),i=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(a):s.removeAllRanges()),l&&document.body.removeChild(l),c()}return u}},568:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var o=a(n(72791)),i=a(n(76998)),c=["text","onCopy","options","children"];function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function d(e,t){for(var n=0;n.\n\nimport React, { Fragment } from \"react\";\nimport { Button, CodeEditor, CopyIcon } from \"mds\";\nimport CopyToClipboard from \"react-copy-to-clipboard\";\nimport TooltipWrapper from \"../../TooltipWrapper/TooltipWrapper\";\n\ninterface ICodeWrapper {\n value: string;\n label?: string;\n mode?: string;\n tooltip?: string;\n onChange: (value: string) => any;\n editorHeight?: string | number;\n helptip?: any;\n}\n\nconst CodeMirrorWrapper = ({\n value,\n label = \"\",\n tooltip = \"\",\n mode = \"json\",\n onChange,\n editorHeight = 250,\n helptip,\n}: ICodeWrapper) => {\n return (\n onChange(value)}\n mode={mode}\n tooltip={tooltip}\n editorHeight={editorHeight}\n label={label}\n helpTools={\n \n \n \n }\n color={\"primary\"}\n variant={\"regular\"}\n />\n \n \n \n }\n helpTip={helptip}\n helpTipPlacement=\"right\"\n />\n );\n};\n\nexport default CodeMirrorWrapper;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nexport const STATUS_COLORS = {\n RED: \"#C83B51\",\n GREEN: \"#4CCB92\",\n YELLOW: \"#FFBD62\",\n};\n\nexport const getDriveStatusColor = (\n activeDisks: number,\n totalDrives: number,\n) => {\n if (activeDisks <= totalDrives / 2) {\n return \"bad\";\n }\n if (totalDrives !== 2 && activeDisks === totalDrives / 2 + 1) {\n return \"warn\";\n }\n if (activeDisks === totalDrives) {\n return \"good\";\n }\n};\n\nexport const serverStatusColor = (health_status: string) => {\n switch (health_status) {\n case \"offline\":\n return \"bad\";\n case \"online\":\n return \"good\";\n default:\n return \"warn\";\n }\n};\nexport const getNetworkStatusColor = (\n activeNetwork: number,\n networkTotal: number,\n) => {\n if (activeNetwork <= networkTotal / 2) {\n return \"bad\";\n }\n if (activeNetwork === networkTotal / 2 + 1) {\n return \"warn\";\n }\n if (activeNetwork === networkTotal) {\n return \"good\";\n }\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport { DisabledIcon, EnabledIcon, Box, Grid, HelpTip } from \"mds\";\nimport SearchBox from \"../Common/SearchBox\";\nimport { STATUS_COLORS } from \"../Dashboard/BasicDashboard/Utils\";\nimport { IAMStatement } from \"./types\";\n\nconst rowGridStyle = {\n display: \"grid\",\n gridTemplateColumns: \"70px 1fr\",\n gap: 15,\n};\n\nconst escapeRegExp = (str = \"\") =>\n str.replace(/([.?*+^$[\\]\\\\(){}|-])/g, \"\\\\$1\");\n\nconst Highlight = ({ search = \"\", children = \"\" }): any => {\n const txtParts = new RegExp(`(${escapeRegExp(search)})`, \"i\");\n const parts = String(children).split(txtParts);\n\n if (search) {\n return parts.map((part, index) =>\n txtParts.test(part) ? {part} : part,\n );\n } else {\n return children;\n }\n};\n\nconst PolicyView = ({\n policyStatements,\n}: {\n policyStatements: IAMStatement[];\n}) => {\n const [filter, setFilter] = useState(\"\");\n\n return (\n \n \n \n \n Define which actions are permitted on a specified resource.\n Learn more about{\" \"}\n \n IAM conditional statements\n \n .\n \n }\n placement=\"right\"\n >\n \n Statements\n \n \n \n \n \n \n \n {!policyStatements && Policy has no statements}\n {policyStatements && (\n \n {policyStatements.map((stmt, i) => {\n const effect = stmt.Effect;\n const isAllow = effect === \"Allow\";\n return (\n \n \n Effect:\n \n {isAllow ? : }\n {effect}\n \n \n \n \n Actions:\n \n {stmt.Action &&\n stmt.Action.map((act, actIndex) => (\n
\n \n );\n};\n\nexport default EditConfiguration;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { useLocation } from \"react-router-dom\";\nimport { Grid } from \"mds\";\nimport { configurationElements } from \"../utils\";\nimport EditConfiguration from \"../../EventDestinations/CustomForms/EditConfiguration\";\n\nconst ConfigurationsList = () => {\n const { pathname = \"\" } = useLocation();\n\n const configName = pathname.substring(pathname.lastIndexOf(\"/\") + 1);\n\n const validActiveConfig = configurationElements.find(\n (element) => element.configuration_id === configName,\n );\n const containerClassName = `${configName}`;\n return (\n \n {validActiveConfig && (\n \n )}\n \n );\n};\n\nexport default ConfigurationsList;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Button, UploadIcon } from \"mds\";\nimport useApi from \"../../Common/Hooks/useApi\";\nimport { performDownload } from \"../../../../common/utils\";\nimport { DateTime } from \"luxon\";\nimport { setErrorSnackMessage } from \"../../../../systemSlice\";\nimport { useDispatch } from \"react-redux\";\nimport TooltipWrapper from \"../../Common/TooltipWrapper/TooltipWrapper\";\n\nconst ExportConfigButton = () => {\n const dispatch = useDispatch();\n const [isReqLoading, invokeApi] = useApi(\n (res: any) => {\n //base64 encoded information so decode before downloading.\n performDownload(\n new Blob([window.atob(res.value)]),\n `minio-server-config-${DateTime.now().toFormat(\n \"LL-dd-yyyy-HH-mm-ss\",\n )}.conf`,\n );\n },\n (err) => {\n dispatch(setErrorSnackMessage(err));\n },\n );\n\n return (\n \n \n );\n};\n\nexport default ExportConfigButton;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useRef, useState } from \"react\";\nimport { Button, DownloadIcon } from \"mds\";\nimport useApi from \"../../Common/Hooks/useApi\";\nimport {\n setErrorSnackMessage,\n setServerNeedsRestart,\n} from \"../../../../systemSlice\";\nimport TooltipWrapper from \"../../Common/TooltipWrapper/TooltipWrapper\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useNavigate } from \"react-router-dom\";\nimport { AppState } from \"../../../../store\";\n\nconst ImportConfigButton = () => {\n const navigate = useNavigate();\n const dispatch = useDispatch();\n\n const needsRestart = useSelector(\n (state: AppState) => state.system.serverNeedsRestart,\n );\n\n const [refreshPage, setRefreshPage] = useState(\n undefined,\n );\n const fileUpload = useRef(null);\n\n const [isReqLoading, invokeApi] = useApi(\n (res: any) => {\n //base64 encoded information so decode before downloading.\n dispatch(setServerNeedsRestart(true)); //import should refreshPage as per mc.\n setRefreshPage(true);\n },\n (err) => {\n dispatch(setErrorSnackMessage(err));\n },\n );\n\n useEffect(() => {\n if (!needsRestart && refreshPage) {\n navigate(0); // refresh the page.\n }\n }, [needsRestart, refreshPage, navigate]);\n\n const handleUploadButton = (e: any) => {\n if (\n e === null ||\n e === undefined ||\n e.target.files === null ||\n e.target.files === undefined\n ) {\n return;\n }\n e.preventDefault();\n const [fileToUpload] = e.target.files;\n\n const formData = new FormData();\n const blobFile = new Blob([fileToUpload], { type: fileToUpload.type });\n\n formData.append(\"file\", blobFile, fileToUpload.name);\n // @ts-ignore\n invokeApi(\"POST\", `api/v1/configs/import`, formData);\n\n e.target.value = \"\";\n };\n\n return (\n \n \n \n \n \n );\n};\n\nexport default ImportConfigButton;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useCallback, useEffect, useState } from \"react\";\nimport {\n Box,\n Grid,\n HelpBox,\n PageLayout,\n ScreenTitle,\n SettingsIcon,\n Tabs,\n} from \"mds\";\n\nimport { configurationElements } from \"../utils\";\nimport {\n Navigate,\n Route,\n Routes,\n useLocation,\n useNavigate,\n} from \"react-router-dom\";\n\nimport ConfigurationForm from \"./ConfigurationForm\";\nimport { IAM_PAGES } from \"../../../../common/SecureComponent/permissions\";\nimport PageHeaderWrapper from \"../../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport ExportConfigButton from \"./ExportConfigButton\";\nimport ImportConfigButton from \"./ImportConfigButton\";\n\nimport HelpMenu from \"../../HelpMenu\";\nimport { setErrorSnackMessage, setHelpName } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport { api } from \"../../../../api\";\nimport { IElement } from \"../types\";\nimport { errorToHandler } from \"../../../../api/errors\";\n\nconst getRoutePath = (path: string) => {\n return `${IAM_PAGES.SETTINGS}/${path}`;\n};\n\n// region is not part of config subsystem list.\nconst NON_SUB_SYS_CONFIG_ITEMS = [\"region\"];\nconst IGNORED_CONFIG_SUB_SYS = [\"cache\"]; // cache config is not supported.\n\nconst ConfigurationOptions = () => {\n const { pathname = \"\" } = useLocation();\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n\n const [configSubSysList, setConfigSubSysList] = useState([]);\n const fetchConfigSubSysList = useCallback(async () => {\n api.configs\n .listConfig() // get a list of available config subsystems.\n .then((res) => {\n if (res && res?.data && res?.data?.configurations) {\n const confSubSysList = (res?.data?.configurations || []).reduce(\n (acc: string[], { key = \"\" }) => {\n if (!IGNORED_CONFIG_SUB_SYS.includes(key)) {\n acc.push(key);\n }\n return acc;\n },\n [],\n );\n\n setConfigSubSysList(confSubSysList);\n }\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err)));\n });\n }, [dispatch]);\n\n useEffect(() => {\n fetchConfigSubSysList();\n dispatch(setHelpName(\"settings_Region\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const availableConfigSubSys = configurationElements.filter(\n ({ configuration_id }: IElement) => {\n return (\n NON_SUB_SYS_CONFIG_ITEMS.includes(configuration_id) ||\n configSubSysList.includes(configuration_id) ||\n !configSubSysList.length\n );\n },\n );\n\n return (\n \n } />\n \n \n }\n title={\"MinIO Configuration:\"}\n actions={\n \n \n \n \n }\n sx={{ marginBottom: 15 }}\n />\n {\n navigate(path);\n }}\n useRouteTabs\n options={availableConfigSubSys.map((element) => {\n const { configuration_id, configuration_label, icon } = element;\n return {\n tabConfig: {\n id: `settings-tab-${configuration_label}`,\n label: configuration_label,\n value: configuration_id,\n icon: icon,\n to: getRoutePath(configuration_id),\n },\n };\n })}\n routes={\n \n {availableConfigSubSys.map((element) => (\n }\n />\n ))}\n }\n />\n \n }\n />\n \n \n }\n help={\n \n MinIO supports a variety of configurations ranging from\n encryption, compression, region, notifications, etc.\n \n \n You can learn more at our{\" \"}\n \n documentation\n \n .\n \n }\n />\n \n \n \n );\n};\n\nexport default ConfigurationOptions;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React from \"react\";\nimport { IElement, IElementValue, IOverrideEnv, OverrideValue } from \"./types\";\nimport {\n CodeIcon,\n CompressIcon,\n ConsoleIcon,\n FindReplaceIcon,\n FirstAidIcon,\n KeyIcon,\n LogsIcon,\n PendingItemsIcon,\n PublicIcon,\n} from \"mds\";\n\nexport const configurationElements: IElement[] = [\n {\n icon: ,\n configuration_id: \"region\",\n configuration_label: \"Region\",\n },\n {\n icon: ,\n configuration_id: \"compression\",\n configuration_label: \"Compression\",\n },\n {\n icon: ,\n configuration_id: \"api\",\n configuration_label: \"API\",\n },\n {\n icon: ,\n configuration_id: \"heal\",\n configuration_label: \"Heal\",\n },\n {\n icon: ,\n configuration_id: \"scanner\",\n configuration_label: \"Scanner\",\n },\n {\n icon: ,\n configuration_id: \"etcd\",\n configuration_label: \"Etcd\",\n },\n {\n icon: ,\n configuration_id: \"logger_webhook\",\n configuration_label: \"Logger Webhook\",\n },\n {\n icon: ,\n configuration_id: \"audit_webhook\",\n configuration_label: \"Audit Webhook\",\n },\n {\n icon: ,\n configuration_id: \"audit_kafka\",\n configuration_label: \"Audit Kafka\",\n },\n];\n\nexport const fieldsConfigurations: any = {\n region: [\n {\n name: \"name\",\n required: true,\n label: \"Server Location\",\n tooltip: 'Name of the location of the server e.g. \"us-west-rack2\"',\n type: \"string\",\n placeholder: \"e.g. us-west-rack-2\",\n },\n {\n name: \"comment\",\n required: false,\n label: \"Comment\",\n tooltip: \"You can add a comment to this setting\",\n type: \"comment\",\n placeholder: \"Enter custom notes if any\",\n },\n ],\n compression: [\n {\n name: \"extensions\",\n required: false,\n label: \"Extensions\",\n tooltip:\n 'Extensions to compress e.g. \".txt\", \".log\" or \".csv\" - you can write one per field',\n type: \"csv\",\n placeholder: \"Enter an Extension\",\n withBorder: true,\n },\n {\n name: \"mime_types\",\n required: false,\n label: \"Mime Types\",\n tooltip:\n 'Mime types e.g. \"text/*\", \"application/json\" or \"application/xml\" - you can write one per field',\n type: \"csv\",\n placeholder: \"Enter a Mime Type\",\n withBorder: true,\n },\n ],\n api: [\n {\n name: \"requests_max\",\n required: false,\n label: \"Requests Max\",\n tooltip: \"Maximum number of concurrent requests, e.g. '1600'\",\n type: \"number\",\n placeholder: \"Enter Requests Max\",\n },\n {\n name: \"cors_allow_origin\",\n required: false,\n label: \"Cors Allow Origin\",\n tooltip: \"List of origins allowed for CORS requests\",\n type: \"csv\",\n placeholder: \"Enter allowed origin e.g. https://example.com\",\n },\n {\n name: \"replication_workers\",\n required: false,\n label: \"Replication Workers\",\n tooltip: \"Number of replication workers, defaults to 100\",\n type: \"number\",\n placeholder: \"Enter Replication Workers\",\n },\n {\n name: \"replication_failed_workers\",\n required: false,\n label: \"Replication Failed Workers\",\n tooltip:\n \"Number of replication workers for recently failed replicas, defaults to 4\",\n type: \"number\",\n placeholder: \"Enter Replication Failed Workers\",\n },\n ],\n heal: [\n {\n name: \"bitrotscan\",\n required: false,\n label: \"Bitrot Scan\",\n tooltip:\n \"Perform bitrot scan on disks when checking objects during scanner\",\n type: \"on|off\",\n },\n {\n name: \"max_sleep\",\n required: false,\n label: \"Max Sleep\",\n tooltip:\n \"Maximum sleep duration between objects to slow down heal operation, e.g. 2s\",\n type: \"duration\",\n placeholder: \"Enter Max Sleep Duration\",\n },\n {\n name: \"max_io\",\n required: false,\n label: \"Max IO\",\n tooltip:\n \"Maximum IO requests allowed between objects to slow down heal operation, e.g. 3\",\n type: \"number\",\n placeholder: \"Enter Max IO\",\n },\n ],\n scanner: [\n {\n name: \"delay\",\n required: false,\n label: \"Delay Multiplier\",\n tooltip: \"Scanner delay multiplier, defaults to '10.0'\",\n type: \"number\",\n placeholder: \"Enter Delay\",\n },\n {\n name: \"max_wait\",\n required: false,\n label: \"Max Wait\",\n tooltip: \"Maximum wait time between operations, defaults to '15s'\",\n type: \"duration\",\n placeholder: \"Enter Max Wait\",\n },\n {\n name: \"cycle\",\n required: false,\n label: \"Cycle\",\n tooltip: \"Time duration between scanner cycles, defaults to '1m'\",\n type: \"duration\",\n placeholder: \"Enter Cycle\",\n },\n ],\n etcd: [\n {\n name: \"endpoints\",\n required: true,\n label: \"Endpoints\",\n tooltip:\n 'List of etcd endpoints e.g. \"http://localhost:2379\" - you can write one per field',\n type: \"csv\",\n placeholder: \"Enter Endpoint\",\n },\n {\n name: \"path_prefix\",\n required: false,\n label: \"Path Prefix\",\n tooltip: 'Namespace prefix to isolate tenants e.g. \"customer1/\"',\n type: \"string\",\n placeholder: \"Enter Path Prefix\",\n },\n {\n name: \"coredns_path\",\n required: false,\n label: \"Coredns Path\",\n tooltip: 'Shared bucket DNS records, default is \"/skydns\"',\n type: \"string\",\n placeholder: \"Enter Coredns Path\",\n },\n {\n name: \"client_cert\",\n required: false,\n label: \"Client Cert\",\n tooltip: \"Client cert for mTLS authentication\",\n type: \"string\",\n placeholder: \"Enter Client Cert\",\n },\n {\n name: \"client_cert_key\",\n required: false,\n label: \"Client Cert Key\",\n tooltip: \"Client cert key for mTLS authentication\",\n type: \"string\",\n placeholder: \"Enter Client Cert Key\",\n },\n {\n name: \"comment\",\n required: false,\n label: \"Comment\",\n tooltip: \"You can add a comment to this setting\",\n type: \"comment\",\n multiline: true,\n placeholder: \"Enter custom notes if any\",\n },\n ],\n logger_webhook: [\n {\n name: \"endpoint\",\n required: true,\n label: \"Endpoint\",\n type: \"string\",\n placeholder: \"Enter Endpoint\",\n },\n {\n name: \"auth_token\",\n required: true,\n label: \"Auth Token\",\n type: \"string\",\n placeholder: \"Enter Auth Token\",\n },\n ],\n audit_webhook: [\n {\n name: \"endpoint\",\n required: true,\n label: \"Endpoint\",\n type: \"string\",\n placeholder: \"Enter Endpoint\",\n },\n {\n name: \"auth_token\",\n required: true,\n label: \"Auth Token\",\n type: \"string\",\n placeholder: \"Enter Auth Token\",\n },\n ],\n audit_kafka: [\n {\n name: \"enable\",\n required: false,\n label: \"Enable\",\n tooltip: \"Enable audit_kafka target\",\n type: \"on|off\",\n customValueProcess: (origValue: string) => {\n return origValue === \"\" || origValue === \"on\" ? \"on\" : \"off\";\n },\n },\n {\n name: \"brokers\",\n required: true,\n label: \"Brokers\",\n type: \"csv\",\n placeholder: \"Enter Kafka Broker\",\n },\n {\n name: \"topic\",\n required: false,\n label: \"Topic\",\n type: \"string\",\n placeholder: \"Enter Kafka Topic\",\n tooltip: \"Kafka topic used for bucket notifications\",\n },\n {\n name: \"sasl\",\n required: false,\n label: \"Use SASL\",\n tooltip:\n \"Enable SASL (Simple Authentication and Security Layer) authentication\",\n type: \"on|off\",\n },\n {\n name: \"sasl_username\",\n required: false,\n label: \"SASL Username\",\n type: \"string\",\n placeholder: \"Enter SASL Username\",\n tooltip: \"Username for SASL/PLAIN or SASL/SCRAM authentication\",\n },\n {\n name: \"sasl_password\",\n required: false,\n label: \"SASL Password\",\n type: \"password\",\n placeholder: \"Enter SASL Password\",\n tooltip: \"Password for SASL/PLAIN or SASL/SCRAM authentication\",\n },\n {\n name: \"sasl_mechanism\",\n required: false,\n label: \"SASL Mechanism\",\n type: \"string\",\n placeholder: \"Enter SASL Mechanism\",\n tooltip: \"SASL authentication mechanism\",\n },\n {\n name: \"tls\",\n required: false,\n label: \"Use TLS\",\n tooltip: \"Enable TLS (Transport Layer Security)\",\n type: \"on|off\",\n },\n {\n name: \"tls_skip_verify\",\n required: false,\n label: \"Skip TLS Verification\",\n tooltip: \"Trust server TLS without verification\",\n type: \"on|off\",\n },\n {\n name: \"client_tls_cert\",\n required: false,\n label: \"Client Cert\",\n tooltip: \"Client cert for mTLS authentication\",\n type: \"string\",\n placeholder: \"Enter Client Cert\",\n },\n {\n name: \"client_tls_key\",\n required: false,\n label: \"Client Cert Key\",\n tooltip: \"Client cert key for mTLS authentication\",\n type: \"string\",\n placeholder: \"Enter Client Cert Key\",\n },\n {\n name: \"tls_client_auth\",\n required: false,\n label: \"TLS Client Auth\",\n tooltip:\n \"ClientAuth determines the Kafka server's policy for TLS client authorization\",\n type: \"string\",\n },\n {\n name: \"version\",\n required: false,\n label: \"Version\",\n tooltip: \"Specify the version of the Kafka cluster\",\n type: \"string\",\n },\n ],\n};\n\nexport const removeEmptyFields = (formFields: IElementValue[]) => {\n const nonEmptyFields = formFields.filter((field) => field.value !== \"\");\n\n return nonEmptyFields;\n};\n\nexport const selectSAs = (\n e: React.ChangeEvent,\n setSelectedSAs: Function,\n selectedSAs: string[],\n) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...selectedSAs]; // We clone the selectedSAs array\n if (checked) {\n // If the user has checked this field we need to push this to selectedSAs\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n setSelectedSAs(elements);\n return elements;\n};\n\nexport const overrideFields = (formFields: IElementValue[]): IOverrideEnv => {\n let overrideReturn: IOverrideEnv = {};\n\n formFields.forEach((envItem) => {\n // it has override values, we construct the value\n if (envItem.env_override) {\n const value: OverrideValue = {\n value: envItem.env_override.value || \"\",\n overrideEnv: envItem.env_override.name || \"\",\n };\n\n overrideReturn = { ...overrideReturn, [envItem.key]: value };\n }\n });\n\n return overrideReturn;\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport {\n CommentBox,\n ConsoleIcon,\n FormLayout,\n Grid,\n InputBox,\n ReadBox,\n Switch,\n Tooltip,\n} from \"mds\";\nimport { IElementValue, IOverrideEnv, KVField } from \"../Configurations/types\";\nimport CSVMultiSelector from \"../Common/FormComponents/CSVMultiSelector/CSVMultiSelector\";\n\ninterface IConfGenericProps {\n onChange: (newValue: IElementValue[]) => void;\n fields: KVField[];\n defaultVals?: IElementValue[];\n overrideEnv?: IOverrideEnv;\n}\n\n// Function to get defined values,\n//we make this because the backed sometimes don't return all the keys when there is an initial configuration\nexport const valueDef = (\n key: string,\n type: string,\n defaults: IElementValue[],\n) => {\n let defValue = type === \"on|off\" ? \"off\" : \"\";\n\n if (defaults.length > 0) {\n const storedConfig = defaults.find((element) => element.key === key);\n\n if (storedConfig) {\n defValue = storedConfig.value || \"\";\n }\n }\n\n return defValue;\n};\n\nconst ConfTargetGeneric = ({\n onChange,\n fields,\n defaultVals,\n overrideEnv,\n}: IConfGenericProps) => {\n const [valueHolder, setValueHolder] = useState([]);\n const fieldsElements = !fields ? [] : fields;\n const defValList = !defaultVals ? [] : defaultVals;\n\n // Effect to create all the values to hold\n useEffect(() => {\n const values: IElementValue[] = fields.map((field) => {\n const stateInsert: IElementValue = {\n key: field.name,\n value: valueDef(field.name, field.type, defValList),\n };\n return stateInsert;\n });\n\n setValueHolder(values);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields, defaultVals]);\n\n useEffect(() => {\n onChange(valueHolder);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [valueHolder]);\n\n const setValueElement = (key: string, value: string, index: number) => {\n const valuesDup = [...valueHolder];\n value = value.trim();\n valuesDup[index] = { key, value };\n\n setValueHolder(valuesDup);\n };\n\n const fieldDefinition = (field: KVField, item: number) => {\n const holderItem = valueHolder[item];\n\n if (holderItem) {\n // Override Value with env var, we display generic string component\n const override = overrideEnv?.[`${holderItem.key}`];\n\n if (override) {\n return (\n \n \n \n \n \n }\n sx={{ width: \"100%\" }}\n >\n {override.value}\n \n );\n }\n }\n\n switch (field.type) {\n case \"on|off\":\n const value = holderItem ? holderItem.value : \"off\";\n\n return (\n ) => {\n const value = e.target.checked ? \"on\" : \"off\";\n setValueElement(field.name, value, item);\n }}\n id={field.name}\n name={field.name}\n label={field.label}\n value={\"switch_on\"}\n tooltip={field.tooltip}\n checked={value === \"on\"}\n />\n );\n case \"csv\":\n return (\n {\n let valCh = \"\";\n\n if (Array.isArray(value)) {\n valCh = value.join(\",\");\n } else {\n valCh = value;\n }\n\n setValueElement(field.name, valCh, item);\n }}\n tooltip={field.tooltip}\n commonPlaceholder={field.placeholder}\n withBorder={true}\n />\n );\n case \"comment\":\n return (\n setValueElement(field.name, e.target.value, item)}\n placeholder={field.placeholder}\n />\n );\n default:\n return (\n ) =>\n setValueElement(field.name, e.target.value, item)\n }\n placeholder={field.placeholder}\n />\n );\n }\n };\n\n return (\n \n {fieldsElements.map((field, item) => (\n {fieldDefinition(field, item)}\n ))}\n \n );\n};\n\nexport default ConfTargetGeneric;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport ConfirmDialog from \"../../Common/ModalWrapper/ConfirmDialog\";\n\nimport { ConfirmDeleteIcon, ProgressBar } from \"mds\";\nimport { setErrorSnackMessage } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\n\ninterface IResetConfiguration {\n configurationName: string;\n closeResetModalAndRefresh: (reloadConfiguration: boolean) => void;\n resetOpen: boolean;\n}\n\nconst ResetConfigurationModal = ({\n configurationName,\n closeResetModalAndRefresh,\n resetOpen,\n}: IResetConfiguration) => {\n const dispatch = useAppDispatch();\n const [resetLoading, setResetLoading] = useState(false);\n\n useEffect(() => {\n if (resetLoading) {\n api.configs\n .resetConfig(configurationName)\n .then(() => {\n setResetLoading(false);\n closeResetModalAndRefresh(true);\n })\n .catch((err) => {\n setResetLoading(false);\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n });\n }\n }, [closeResetModalAndRefresh, configurationName, resetLoading, dispatch]);\n\n const resetConfiguration = () => {\n setResetLoading(true);\n };\n\n return (\n }\n isLoading={resetLoading}\n onConfirm={resetConfiguration}\n onClose={() => {\n closeResetModalAndRefresh(false);\n }}\n confirmationContent={\n \n {resetLoading && }\n \n Are you sure you want to restore these configurations to default\n values?\n \n \n Please note that this may cause your system to not be accessible\n \n \n \n }\n />\n );\n};\n\nexport default ResetConfigurationModal;\n"],"names":["_ref","elements","name","label","_ref$tooltip","tooltip","_ref$commonPlaceholde","commonPlaceholder","onChange","_ref$withBorder","withBorder","_useState","useState","_useState2","_slicedToArray","currentElements","setCurrentElements","bottomList","createRef","useEffect","length","elementsSplit","split","push","refScroll","current","scrollIntoView","onChangeCallback","useCallback","newString","firstUpdate","useRef","elementsString","filter","element","trim","join","onChangeElement","e","persist","updatedElement","_toConsumableArray","index","get","target","parseInt","value","inputs","map","_jsx","InputBox","id","concat","toString","placeholder","overlayIcon","AddIcon","overlayAction","elementsUp","cpList","addEmptyLine","Fragment","children","_jsxs","Box","sx","display","className","InputLabel","alignItems","marginLeft","width","Tooltip","placement","HelpIcon","withBorders","overflowY","height","position","ref","open","type","onCloseEndpoint","setName","_useState3","_useState4","endpoint","setEndpoint","_useState5","_useState6","authToken","setAuthToken","_useState7","_useState8","saving","setSaving","_useState9","_useState10","invalidInputs","setInvalidInput","_useState11","_useState12","initialInputs","setInitialInputs","dispatch","useAppDispatch","initializeInput","item","validateInput","valid","includes","title","icon","WebhookIcon","ConsoleIcon","PendingItemsIcon","ModalWrapper","modalOpen","onClose","titleIcon","FormLayout","containerPadding","event","validity","error","pattern","required","Grid","xs","marginBottom","ProgressBar","modalStyleUtils","modalButtonBar","Button","variant","disabled","onClick","marginRight","color","payload","key_values","key","arn_resource_id","api","configs","setConfig","then","res","setServerNeedsRestart","data","restart","setSnackBarMessage","configurationIsLoading","catch","err","setErrorSnackMessage","errorToHandler","selectedARN","deleteLoading","setDeleteLoading","resetConfig","defaultWH","message","ConfirmDialog","confirmText","isOpen","isLoading","onConfirm","ConfirmDeleteIcon","confirmationContent","_overrideValues$enabl","_overrideValues$enabl2","_overrideValues$endpo","_overrideValues$endpo2","_overrideValues$auth_","_overrideValues$auth_2","endpointInfo","endpointState","setEndpointState","endpointLocate","find","tokenLocate","enable","endpointValue","tokenValue","hasOverride","itm","env_override","overrideValues","overrideFields","ReadBox","actionButton","justifyContent","paddingRight","overrideEnv","style","auth_token","Switch","checked","setResetConfigurationOpen","WebhookSettingslist","newEndpointOpen","setNewEndpointOpen","deleteWebhookOpen","setDeleteWebhookOpen","editWebhookOpen","setEditWebhookOpen","setSelectedARN","selectedEndpoint","setSelectedEndpoint","actions","disableButtonFunction","wHook","_wHook$key_values","container","AddEndpointModal","DeleteWebhookEndpoint","EditWebhookEndpoint","padding","DataTable","columns","elementKey","renderFunction","EnableFilter","overrideEnabled","flexDirection","justifyItems","fontSize","fill","TierOfflineIcon","TierOnlineIcon","endpointFilter","itemActions","idField","records","entityName","customPaperHeight","selectedConfiguration","_ref$className","navigate","useNavigate","_useLocation$pathname","useLocation","pathname","selConfigTab","substring","lastIndexOf","valuesObj","setValueObj","configValues","setConfigValues","configSubsysList","setConfigSubsysList","resetConfigurationOpen","overrideEnvs","setOverrideEnvs","loadingConfig","useSelector","state","system","loadingConfigurations","configId","configInfo","values","keyVals","fieldsConfigurations","field","includedValue","customValue","customValueProcess","removeEmptyFields","configuration_id","onValueChange","newValue","resetConfigurationMOpen","onMouseMove","setHelpName","configuration_label","ResetConfigurationModal","configurationName","closeResetModalAndRefresh","resetOpen","textAlign","paddingTop","Loader","WebhookSettings","noValidate","onSubmit","preventDefault","flexFlow","gridTemplateColumns","gap","ConfTargetGeneric","fields","defaultVals","maxHeight","configName","validActiveConfig","configurationElements","containerClassName","minWidth","EditConfiguration","useDispatch","_useApi","useApi","performDownload","Blob","window","atob","DateTime","now","toFormat","_useApi2","isReqLoading","invokeApi","TooltipWrapper","UploadIcon","needsRestart","serverNeedsRestart","undefined","refreshPage","setRefreshPage","fileUpload","files","fileToUpload","formData","FormData","blobFile","append","click","DownloadIcon","NON_SUB_SYS_CONFIG_ITEMS","IGNORED_CONFIG_SUB_SYS","configSubSysList","setConfigSubSysList","fetchConfigSubSysList","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","listConfig","_res$data","configurations","_res$data2","confSubSysList","reduce","acc","_ref2","_ref2$key","stop","availableConfigSubSys","_ref3","PageHeaderWrapper","HelpMenu","PageLayout","ScreenTitle","SettingsIcon","ImportConfigButton","ExportConfigButton","Tabs","currentTabOrPath","onTabClick","path","useRouteTabs","options","tabConfig","to","IAM_PAGES","SETTINGS","routes","Routes","Route","ConfigurationForm","Navigate","HelpBox","iconComponent","help","href","rel","PublicIcon","CompressIcon","CodeIcon","FirstAidIcon","FindReplaceIcon","KeyIcon","LogsIcon","region","compression","heal","scanner","etcd","multiline","logger_webhook","audit_webhook","audit_kafka","origValue","formFields","selectSAs","setSelectedSAs","selectedSAs","targetD","overrideReturn","forEach","envItem","_objectSpread","_defineProperty","valueDef","defaults","defValue","storedConfig","valueHolder","setValueHolder","fieldsElements","defValList","setValueElement","valuesDup","fieldDefinition","holderItem","override","CSVMultiSelector","valCh","Array","isArray","CommentBox","resetLoading","setResetLoading","maxWidth","whiteSpace","wordWrap"],"sourceRoot":""}
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1520.8019c157.chunk.js b/portal-ui/build/static/js/1520.8019c157.chunk.js
deleted file mode 100644
index 3af70e5ced..0000000000
--- a/portal-ui/build/static/js/1520.8019c157.chunk.js
+++ /dev/null
@@ -1,2 +0,0 @@
-"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1520],{85523:function(e,o,r){r.d(o,{Z:function(){return S}});var n=r(4942),t=r(63366),a=r(87462),i=r(72791),c=r(63733),l=r(94419),s=r(52930),u=r(1582),d=r(20890),p=r(14036),f=r(66934),m=r(31402),v=r(75878),h=r(21217);function Z(e){return(0,h.Z)("MuiFormControlLabel",e)}var b=(0,v.Z)("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),g=r(76147),k=r(80184),y=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],w=(0,f.ZP)("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:function(e,o){var r=e.ownerState;return[(0,n.Z)({},"& .".concat(b.label),o.label),o.root,o["labelPlacement".concat((0,p.Z)(r.labelPlacement))]]}})((function(e){var o=e.theme,r=e.ownerState;return(0,a.Z)((0,n.Z)({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16},"&.".concat(b.disabled),{cursor:"default"}),"start"===r.labelPlacement&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},"top"===r.labelPlacement&&{flexDirection:"column-reverse",marginLeft:16},"bottom"===r.labelPlacement&&{flexDirection:"column",marginLeft:16},(0,n.Z)({},"& .".concat(b.label),(0,n.Z)({},"&.".concat(b.disabled),{color:(o.vars||o).palette.text.disabled})))})),x=(0,f.ZP)("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:function(e,o){return o.asterisk}})((function(e){var o=e.theme;return(0,n.Z)({},"&.".concat(b.error),{color:(o.vars||o).palette.error.main})})),S=i.forwardRef((function(e,o){var r,n,f=(0,m.Z)({props:e,name:"MuiFormControlLabel"}),v=f.className,h=f.componentsProps,b=void 0===h?{}:h,S=f.control,C=f.disabled,P=f.disableTypography,R=f.label,F=f.labelPlacement,N=void 0===F?"end":F,j=f.required,M=f.slotProps,z=void 0===M?{}:M,B=(0,t.Z)(f,y),q=(0,s.Z)(),I=null!=(r=null!=C?C:S.props.disabled)?r:null==q?void 0:q.disabled,L=null!=j?j:S.props.required,G={disabled:I,required:L};["checked","name","onChange","value","inputRef"].forEach((function(e){"undefined"===typeof S.props[e]&&"undefined"!==typeof f[e]&&(G[e]=f[e])}));var O=(0,g.Z)({props:f,muiFormControl:q,states:["error"]}),E=(0,a.Z)({},f,{disabled:I,labelPlacement:N,required:L,error:O.error}),T=function(e){var o=e.classes,r=e.disabled,n=e.labelPlacement,t=e.error,a=e.required,i={root:["root",r&&"disabled","labelPlacement".concat((0,p.Z)(n)),t&&"error",a&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",t&&"error"]};return(0,l.Z)(i,Z,o)}(E),A=null!=(n=z.typography)?n:b.typography,D=R;return null==D||D.type===d.Z||P||(D=(0,k.jsx)(d.Z,(0,a.Z)({component:"span"},A,{className:(0,c.Z)(T.label,null==A?void 0:A.className),children:D}))),(0,k.jsxs)(w,(0,a.Z)({className:(0,c.Z)(T.root,v),ownerState:E,ref:o},B,{children:[i.cloneElement(S,G),L?(0,k.jsxs)(u.Z,{direction:"row",alignItems:"center",children:[D,(0,k.jsxs)(x,{ownerState:E,"aria-hidden":!0,className:T.asterisk,children:["\u2009","*"]})]}):D]}))}))},61419:function(e,o,r){r.d(o,{Z:function(){return z}});var n=r(4942),t=r(63366),a=r(87462),i=r(72791),c=r(63733),l=r(94419),s=r(12065),u=r(97278),d=r(31402),p=r(76189),f=r(80184),m=(0,p.Z)((0,f.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),v=(0,p.Z)((0,f.jsx)("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),h=r(66934),Z=(0,h.ZP)("span")({position:"relative",display:"flex"}),b=(0,h.ZP)(m)({transform:"scale(1)"}),g=(0,h.ZP)(v)((function(e){var o=e.theme,r=e.ownerState;return(0,a.Z)({left:0,position:"absolute",transform:"scale(0)",transition:o.transitions.create("transform",{easing:o.transitions.easing.easeIn,duration:o.transitions.duration.shortest})},r.checked&&{transform:"scale(1)",transition:o.transitions.create("transform",{easing:o.transitions.easing.easeOut,duration:o.transitions.duration.shortest})})}));var k=function(e){var o=e.checked,r=void 0!==o&&o,n=e.classes,t=void 0===n?{}:n,i=e.fontSize,c=(0,a.Z)({},e,{checked:r});return(0,f.jsxs)(Z,{className:t.root,ownerState:c,children:[(0,f.jsx)(b,{fontSize:i,className:t.background,ownerState:c}),(0,f.jsx)(g,{fontSize:i,className:t.dot,ownerState:c})]})},y=r(14036),w=r(31260),x=r(18672);var S=r(75878),C=r(21217);function P(e){return(0,C.Z)("MuiRadio",e)}var R=(0,S.Z)("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),F=["checked","checkedIcon","color","icon","name","onChange","size","className"],N=(0,h.ZP)(u.Z,{shouldForwardProp:function(e){return(0,h.FO)(e)||"classes"===e},name:"MuiRadio",slot:"Root",overridesResolver:function(e,o){var r=e.ownerState;return[o.root,o["color".concat((0,y.Z)(r.color))]]}})((function(e){var o=e.theme,r=e.ownerState;return(0,a.Z)({color:(o.vars||o).palette.text.secondary},!r.disableRipple&&{"&:hover":{backgroundColor:o.vars?"rgba(".concat("default"===r.color?o.vars.palette.action.activeChannel:o.vars.palette[r.color].mainChannel," / ").concat(o.vars.palette.action.hoverOpacity,")"):(0,s.Fq)("default"===r.color?o.palette.action.active:o.palette[r.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==r.color&&(0,n.Z)({},"&.".concat(R.checked),{color:(o.vars||o).palette[r.color].main}),(0,n.Z)({},"&.".concat(R.disabled),{color:(o.vars||o).palette.action.disabled}))}));var j=(0,f.jsx)(k,{checked:!0}),M=(0,f.jsx)(k,{}),z=i.forwardRef((function(e,o){var r,n,s,u,p=(0,d.Z)({props:e,name:"MuiRadio"}),m=p.checked,v=p.checkedIcon,h=void 0===v?j:v,Z=p.color,b=void 0===Z?"primary":Z,g=p.icon,k=void 0===g?M:g,S=p.name,C=p.onChange,R=p.size,z=void 0===R?"medium":R,B=p.className,q=(0,t.Z)(p,F),I=(0,a.Z)({},p,{color:b,size:z}),L=function(e){var o=e.classes,r=e.color,n=e.size,t={root:["root","color".concat((0,y.Z)(r)),"medium"!==n&&"size".concat((0,y.Z)(n))]};return(0,a.Z)({},o,(0,l.Z)(t,P,o))}(I),G=i.useContext(x.Z),O=m,E=(0,w.Z)(C,G&&G.onChange),T=S;return G&&("undefined"===typeof O&&(s=G.value,O="object"===typeof(u=p.value)&&null!==u?s===u:String(s)===String(u)),"undefined"===typeof T&&(T=G.name)),(0,f.jsx)(N,(0,a.Z)({type:"radio",icon:i.cloneElement(k,{fontSize:null!=(r=M.props.fontSize)?r:z}),checkedIcon:i.cloneElement(h,{fontSize:null!=(n=j.props.fontSize)?n:z}),ownerState:I,classes:L,name:T,checked:O,onChange:E,ref:o,className:(0,c.Z)(L.root,B)},q))}))},10765:function(e,o,r){r.d(o,{Z:function(){return C}});var n=r(29439),t=r(87462),a=r(63366),i=r(72791),c=r(63733),l=r(94419),s=r(66934),u=r(31402),d=r(75878),p=r(21217);function f(e){return(0,p.Z)("MuiFormGroup",e)}(0,d.Z)("MuiFormGroup",["root","row","error"]);var m=r(52930),v=r(76147),h=r(80184),Z=["className","row"],b=(0,s.ZP)("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:function(e,o){var r=e.ownerState;return[o.root,r.row&&o.row]}})((function(e){var o=e.ownerState;return(0,t.Z)({display:"flex",flexDirection:"column",flexWrap:"wrap"},o.row&&{flexDirection:"row"})})),g=i.forwardRef((function(e,o){var r=(0,u.Z)({props:e,name:"MuiFormGroup"}),n=r.className,i=r.row,s=void 0!==i&&i,d=(0,a.Z)(r,Z),p=(0,m.Z)(),g=(0,v.Z)({props:r,muiFormControl:p,states:["error"]}),k=(0,t.Z)({},r,{row:s,error:g.error}),y=function(e){var o=e.classes,r={root:["root",e.row&&"row",e.error&&"error"]};return(0,l.Z)(r,f,o)}(k);return(0,h.jsx)(b,(0,t.Z)({className:(0,c.Z)(y.root,n),ownerState:k,ref:o},d))})),k=r(42071),y=r(98278),w=r(18672),x=r(67384),S=["actions","children","defaultValue","name","onChange","value"],C=i.forwardRef((function(e,o){var r=e.actions,c=e.children,l=e.defaultValue,s=e.name,u=e.onChange,d=e.value,p=(0,a.Z)(e,S),f=i.useRef(null),m=(0,y.Z)({controlled:d,default:l,name:"RadioGroup"}),v=(0,n.Z)(m,2),Z=v[0],b=v[1];i.useImperativeHandle(r,(function(){return{focus:function(){var e=f.current.querySelector("input:not(:disabled):checked");e||(e=f.current.querySelector("input:not(:disabled)")),e&&e.focus()}}}),[]);var C=(0,k.Z)(o,f),P=(0,x.Z)(s),R=i.useMemo((function(){return{name:P,onChange:function(e){b(e.target.value),u&&u(e,e.target.value)},value:Z}}),[P,u,b,Z]);return(0,h.jsx)(w.Z.Provider,{value:R,children:(0,h.jsx)(g,(0,t.Z)({role:"radiogroup",ref:C},p,{children:c}))})}))},18672:function(e,o,r){var n=r(72791).createContext(void 0);o.Z=n},1582:function(e,o,r){r.d(o,{Z:function(){return R}});var n=r(4942),t=r(63366),a=r(87462),i=r(72791),c=r(63733),l=r(82466),s=r(94419),u=r(21217),d=(0,r(44046).ZP)(),p=r(86083),f=r(78519),m=r(85080),v=r(51184),h=r(45682),Z=r(80184),b=["component","direction","spacing","divider","children","className","useFlexGap"],g=(0,m.Z)(),k=d("div",{name:"MuiStack",slot:"Root",overridesResolver:function(e,o){return o.root}});function y(e){return(0,p.Z)({props:e,name:"MuiStack",defaultTheme:g})}function w(e,o){var r=i.Children.toArray(e).filter(Boolean);return r.reduce((function(e,n,t){return e.push(n),t0?s[r[o-1]]:"column";s[e]=n}}));t=(0,l.Z)(t,(0,v.k9)({theme:r},u,(function(e,r){return o.useFlexGap?{gap:(0,h.NA)(i,e)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":(0,n.Z)({},"margin".concat((t=r?s[r]:o.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[t])),(0,h.NA)(i,e))};var t})))}return t=(0,v.dt)(r.breakpoints,t)};var S=r(66934),C=r(31402),P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=e.createStyledComponent,r=void 0===o?k:o,n=e.useThemeProps,l=void 0===n?y:n,d=e.componentName,p=void 0===d?"MuiStack":d,m=r(x),v=i.forwardRef((function(e,o){var r=l(e),n=(0,f.Z)(r),i=n.component,d=void 0===i?"div":i,v=n.direction,h=void 0===v?"column":v,g=n.spacing,k=void 0===g?0:g,y=n.divider,x=n.children,S=n.className,C=n.useFlexGap,P=void 0!==C&&C,R=(0,t.Z)(n,b),F={direction:h,spacing:k,useFlexGap:P},N=(0,s.Z)({root:["root"]},(function(e){return(0,u.Z)(p,e)}),{});return(0,Z.jsx)(m,(0,a.Z)({as:d,ownerState:F,ref:o,className:(0,c.Z)(N.root,S)},R,{children:y?w(x,y):x}))}));return v}({createStyledComponent:(0,S.ZP)("div",{name:"MuiStack",slot:"Root",overridesResolver:function(e,o){return o.root}}),useThemeProps:function(e){return(0,C.Z)({props:e,name:"MuiStack"})}}),R=P},97278:function(e,o,r){r.d(o,{Z:function(){return y}});var n=r(29439),t=r(63366),a=r(87462),i=r(72791),c=r(63733),l=r(94419),s=r(14036),u=r(66934),d=r(98278),p=r(52930),f=r(95080),m=r(75878),v=r(21217);function h(e){return(0,v.Z)("PrivateSwitchBase",e)}(0,m.Z)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);var Z=r(80184),b=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],g=(0,u.ZP)(f.Z)((function(e){var o=e.ownerState;return(0,a.Z)({padding:9,borderRadius:"50%"},"start"===o.edge&&{marginLeft:"small"===o.size?-3:-12},"end"===o.edge&&{marginRight:"small"===o.size?-3:-12})})),k=(0,u.ZP)("input")({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),y=i.forwardRef((function(e,o){var r=e.autoFocus,i=e.checked,u=e.checkedIcon,f=e.className,m=e.defaultChecked,v=e.disabled,y=e.disableFocusRipple,w=void 0!==y&&y,x=e.edge,S=void 0!==x&&x,C=e.icon,P=e.id,R=e.inputProps,F=e.inputRef,N=e.name,j=e.onBlur,M=e.onChange,z=e.onFocus,B=e.readOnly,q=e.required,I=void 0!==q&&q,L=e.tabIndex,G=e.type,O=e.value,E=(0,t.Z)(e,b),T=(0,d.Z)({controlled:i,default:Boolean(m),name:"SwitchBase",state:"checked"}),A=(0,n.Z)(T,2),D=A[0],$=A[1],H=(0,p.Z)(),V=v;H&&"undefined"===typeof V&&(V=H.disabled);var W="checkbox"===G||"radio"===G,_=(0,a.Z)({},e,{checked:D,disabled:V,disableFocusRipple:w,edge:S}),U=function(e){var o=e.classes,r=e.checked,n=e.disabled,t=e.edge,a={root:["root",r&&"checked",n&&"disabled",t&&"edge".concat((0,s.Z)(t))],input:["input"]};return(0,l.Z)(a,h,o)}(_);return(0,Z.jsxs)(g,(0,a.Z)({component:"span",className:(0,c.Z)(U.root,f),centerRipple:!0,focusRipple:!w,disabled:V,tabIndex:null,role:void 0,onFocus:function(e){z&&z(e),H&&H.onFocus&&H.onFocus(e)},onBlur:function(e){j&&j(e),H&&H.onBlur&&H.onBlur(e)},ownerState:_,ref:o},E,{children:[(0,Z.jsx)(k,(0,a.Z)({autoFocus:r,checked:i,defaultChecked:m,className:U.input,disabled:V,id:W?P:void 0,name:N,onChange:function(e){if(!e.nativeEvent.defaultPrevented){var o=e.target.checked;$(o),M&&M(e,o)}},readOnly:B,ref:F,required:I,ownerState:_,tabIndex:L,type:G},"checkbox"===G&&void 0===O?{}:{value:O},R)),D?u:C]}))}))},31260:function(e,o,r){var n=r(78949);o.Z=n.Z},78949:function(e,o,r){function n(){for(var e=arguments.length,o=new Array(e),r=0;r {\n const {\n classes,\n disabled,\n labelPlacement,\n error,\n required\n } = ownerState;\n const slots = {\n root: ['root', disabled && 'disabled', `labelPlacement${capitalize(labelPlacement)}`, error && 'error', required && 'required'],\n label: ['label', disabled && 'disabled'],\n asterisk: ['asterisk', error && 'error']\n };\n return composeClasses(slots, getFormControlLabelUtilityClasses, classes);\n};\nexport const FormControlLabelRoot = styled('label', {\n name: 'MuiFormControlLabel',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [{\n [`& .${formControlLabelClasses.label}`]: styles.label\n }, styles.root, styles[`labelPlacement${capitalize(ownerState.labelPlacement)}`]];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n display: 'inline-flex',\n alignItems: 'center',\n cursor: 'pointer',\n // For correct alignment with the text.\n verticalAlign: 'middle',\n WebkitTapHighlightColor: 'transparent',\n marginLeft: -11,\n marginRight: 16,\n // used for row presentation of radio/checkbox\n [`&.${formControlLabelClasses.disabled}`]: {\n cursor: 'default'\n }\n}, ownerState.labelPlacement === 'start' && {\n flexDirection: 'row-reverse',\n marginLeft: 16,\n // used for row presentation of radio/checkbox\n marginRight: -11\n}, ownerState.labelPlacement === 'top' && {\n flexDirection: 'column-reverse',\n marginLeft: 16\n}, ownerState.labelPlacement === 'bottom' && {\n flexDirection: 'column',\n marginLeft: 16\n}, {\n [`& .${formControlLabelClasses.label}`]: {\n [`&.${formControlLabelClasses.disabled}`]: {\n color: (theme.vars || theme).palette.text.disabled\n }\n }\n}));\nconst AsteriskComponent = styled('span', {\n name: 'MuiFormControlLabel',\n slot: 'Asterisk',\n overridesResolver: (props, styles) => styles.asterisk\n})(({\n theme\n}) => ({\n [`&.${formControlLabelClasses.error}`]: {\n color: (theme.vars || theme).palette.error.main\n }\n}));\n\n/**\n * Drop-in replacement of the `Radio`, `Switch` and `Checkbox` component.\n * Use this component if you want to display an extra label.\n */\nconst FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel(inProps, ref) {\n var _ref, _slotProps$typography;\n const props = useThemeProps({\n props: inProps,\n name: 'MuiFormControlLabel'\n });\n const {\n className,\n componentsProps = {},\n control,\n disabled: disabledProp,\n disableTypography,\n label: labelProp,\n labelPlacement = 'end',\n required: requiredProp,\n slotProps = {}\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const muiFormControl = useFormControl();\n const disabled = (_ref = disabledProp != null ? disabledProp : control.props.disabled) != null ? _ref : muiFormControl == null ? void 0 : muiFormControl.disabled;\n const required = requiredProp != null ? requiredProp : control.props.required;\n const controlProps = {\n disabled,\n required\n };\n ['checked', 'name', 'onChange', 'value', 'inputRef'].forEach(key => {\n if (typeof control.props[key] === 'undefined' && typeof props[key] !== 'undefined') {\n controlProps[key] = props[key];\n }\n });\n const fcs = formControlState({\n props,\n muiFormControl,\n states: ['error']\n });\n const ownerState = _extends({}, props, {\n disabled,\n labelPlacement,\n required,\n error: fcs.error\n });\n const classes = useUtilityClasses(ownerState);\n const typographySlotProps = (_slotProps$typography = slotProps.typography) != null ? _slotProps$typography : componentsProps.typography;\n let label = labelProp;\n if (label != null && label.type !== Typography && !disableTypography) {\n label = /*#__PURE__*/_jsx(Typography, _extends({\n component: \"span\"\n }, typographySlotProps, {\n className: clsx(classes.label, typographySlotProps == null ? void 0 : typographySlotProps.className),\n children: label\n }));\n }\n return /*#__PURE__*/_jsxs(FormControlLabelRoot, _extends({\n className: clsx(classes.root, className),\n ownerState: ownerState,\n ref: ref\n }, other, {\n children: [/*#__PURE__*/React.cloneElement(control, controlProps), required ? /*#__PURE__*/_jsxs(Stack, {\n direction: \"row\",\n alignItems: \"center\",\n children: [label, /*#__PURE__*/_jsxs(AsteriskComponent, {\n ownerState: ownerState,\n \"aria-hidden\": true,\n className: classes.asterisk,\n children: [\"\\u2009\", '*']\n })]\n }) : label]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? FormControlLabel.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * If `true`, the component appears selected.\n */\n checked: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The props used for each slot inside.\n * @default {}\n */\n componentsProps: PropTypes.shape({\n typography: PropTypes.object\n }),\n /**\n * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.\n */\n control: PropTypes.element.isRequired,\n /**\n * If `true`, the control is disabled.\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, the label is rendered as it is passed without an additional typography node.\n */\n disableTypography: PropTypes.bool,\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n /**\n * A text or an element to be used in an enclosing label element.\n */\n label: PropTypes.node,\n /**\n * The position of the label.\n * @default 'end'\n */\n labelPlacement: PropTypes.oneOf(['bottom', 'end', 'start', 'top']),\n /**\n * @ignore\n */\n name: PropTypes.string,\n /**\n * Callback fired when the state is changed.\n *\n * @param {React.SyntheticEvent} event The event source of the callback.\n * You can pull out the new checked state by accessing `event.target.checked` (boolean).\n */\n onChange: PropTypes.func,\n /**\n * If `true`, the label will indicate that the `input` is required.\n */\n required: PropTypes.bool,\n /**\n * The props used for each slot inside.\n * @default {}\n */\n slotProps: PropTypes.shape({\n typography: PropTypes.object\n }),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The value of the component.\n */\n value: PropTypes.any\n} : void 0;\nexport default FormControlLabel;","'use client';\n\nimport * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"\n}), 'RadioButtonUnchecked');","'use client';\n\nimport * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z\"\n}), 'RadioButtonChecked');","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport RadioButtonUncheckedIcon from '../internal/svg-icons/RadioButtonUnchecked';\nimport RadioButtonCheckedIcon from '../internal/svg-icons/RadioButtonChecked';\nimport styled from '../styles/styled';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst RadioButtonIconRoot = styled('span')({\n position: 'relative',\n display: 'flex'\n});\nconst RadioButtonIconBackground = styled(RadioButtonUncheckedIcon)({\n // Scale applied to prevent dot misalignment in Safari\n transform: 'scale(1)'\n});\nconst RadioButtonIconDot = styled(RadioButtonCheckedIcon)(({\n theme,\n ownerState\n}) => _extends({\n left: 0,\n position: 'absolute',\n transform: 'scale(0)',\n transition: theme.transitions.create('transform', {\n easing: theme.transitions.easing.easeIn,\n duration: theme.transitions.duration.shortest\n })\n}, ownerState.checked && {\n transform: 'scale(1)',\n transition: theme.transitions.create('transform', {\n easing: theme.transitions.easing.easeOut,\n duration: theme.transitions.duration.shortest\n })\n}));\n\n/**\n * @ignore - internal component.\n */\nfunction RadioButtonIcon(props) {\n const {\n checked = false,\n classes = {},\n fontSize\n } = props;\n const ownerState = _extends({}, props, {\n checked\n });\n return /*#__PURE__*/_jsxs(RadioButtonIconRoot, {\n className: classes.root,\n ownerState: ownerState,\n children: [/*#__PURE__*/_jsx(RadioButtonIconBackground, {\n fontSize: fontSize,\n className: classes.background,\n ownerState: ownerState\n }), /*#__PURE__*/_jsx(RadioButtonIconDot, {\n fontSize: fontSize,\n className: classes.dot,\n ownerState: ownerState\n })]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? RadioButtonIcon.propTypes = {\n /**\n * If `true`, the component is checked.\n */\n checked: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n /**\n * The size of the component.\n * `small` is equivalent to the dense radio styling.\n */\n fontSize: PropTypes.oneOf(['small', 'medium'])\n} : void 0;\nexport default RadioButtonIcon;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getRadioUtilityClass(slot) {\n return generateUtilityClass('MuiRadio', slot);\n}\nconst radioClasses = generateUtilityClasses('MuiRadio', ['root', 'checked', 'disabled', 'colorPrimary', 'colorSecondary', 'sizeSmall']);\nexport default radioClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"checked\", \"checkedIcon\", \"color\", \"icon\", \"name\", \"onChange\", \"size\", \"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { refType } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';\nimport { alpha } from '@mui/system';\nimport SwitchBase from '../internal/SwitchBase';\nimport useThemeProps from '../styles/useThemeProps';\nimport RadioButtonIcon from './RadioButtonIcon';\nimport capitalize from '../utils/capitalize';\nimport createChainedFunction from '../utils/createChainedFunction';\nimport useRadioGroup from '../RadioGroup/useRadioGroup';\nimport radioClasses, { getRadioUtilityClass } from './radioClasses';\nimport styled, { rootShouldForwardProp } from '../styles/styled';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n color,\n size\n } = ownerState;\n const slots = {\n root: ['root', `color${capitalize(color)}`, size !== 'medium' && `size${capitalize(size)}`]\n };\n return _extends({}, classes, composeClasses(slots, getRadioUtilityClass, classes));\n};\nconst RadioRoot = styled(SwitchBase, {\n shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',\n name: 'MuiRadio',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[`color${capitalize(ownerState.color)}`]];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n color: (theme.vars || theme).palette.text.secondary\n}, !ownerState.disableRipple && {\n '&:hover': {\n backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }\n}, ownerState.color !== 'default' && {\n [`&.${radioClasses.checked}`]: {\n color: (theme.vars || theme).palette[ownerState.color].main\n }\n}, {\n [`&.${radioClasses.disabled}`]: {\n color: (theme.vars || theme).palette.action.disabled\n }\n}));\nfunction areEqualValues(a, b) {\n if (typeof b === 'object' && b !== null) {\n return a === b;\n }\n\n // The value could be a number, the DOM will stringify it anyway.\n return String(a) === String(b);\n}\nconst defaultCheckedIcon = /*#__PURE__*/_jsx(RadioButtonIcon, {\n checked: true\n});\nconst defaultIcon = /*#__PURE__*/_jsx(RadioButtonIcon, {});\nconst Radio = /*#__PURE__*/React.forwardRef(function Radio(inProps, ref) {\n var _defaultIcon$props$fo, _defaultCheckedIcon$p;\n const props = useThemeProps({\n props: inProps,\n name: 'MuiRadio'\n });\n const {\n checked: checkedProp,\n checkedIcon = defaultCheckedIcon,\n color = 'primary',\n icon = defaultIcon,\n name: nameProp,\n onChange: onChangeProp,\n size = 'medium',\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n color,\n size\n });\n const classes = useUtilityClasses(ownerState);\n const radioGroup = useRadioGroup();\n let checked = checkedProp;\n const onChange = createChainedFunction(onChangeProp, radioGroup && radioGroup.onChange);\n let name = nameProp;\n if (radioGroup) {\n if (typeof checked === 'undefined') {\n checked = areEqualValues(radioGroup.value, props.value);\n }\n if (typeof name === 'undefined') {\n name = radioGroup.name;\n }\n }\n return /*#__PURE__*/_jsx(RadioRoot, _extends({\n type: \"radio\",\n icon: /*#__PURE__*/React.cloneElement(icon, {\n fontSize: (_defaultIcon$props$fo = defaultIcon.props.fontSize) != null ? _defaultIcon$props$fo : size\n }),\n checkedIcon: /*#__PURE__*/React.cloneElement(checkedIcon, {\n fontSize: (_defaultCheckedIcon$p = defaultCheckedIcon.props.fontSize) != null ? _defaultCheckedIcon$p : size\n }),\n ownerState: ownerState,\n classes: classes,\n name: name,\n checked: checked,\n onChange: onChange,\n ref: ref,\n className: clsx(classes.root, className)\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Radio.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * If `true`, the component is checked.\n */\n checked: PropTypes.bool,\n /**\n * The icon to display when the component is checked.\n * @default \n */\n checkedIcon: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).\n * @default 'primary'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n /**\n * If `true`, the component is disabled.\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, the ripple effect is disabled.\n * @default false\n */\n disableRipple: PropTypes.bool,\n /**\n * The icon to display when the component is unchecked.\n * @default \n */\n icon: PropTypes.node,\n /**\n * The id of the `input` element.\n */\n id: PropTypes.string,\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps: PropTypes.object,\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n /**\n * Name attribute of the `input` element.\n */\n name: PropTypes.string,\n /**\n * Callback fired when the state is changed.\n *\n * @param {React.ChangeEvent} event The event source of the callback.\n * You can pull out the new value by accessing `event.target.value` (string).\n * You can pull out the new checked state by accessing `event.target.checked` (boolean).\n */\n onChange: PropTypes.func,\n /**\n * If `true`, the `input` element is required.\n * @default false\n */\n required: PropTypes.bool,\n /**\n * The size of the component.\n * `small` is equivalent to the dense radio styling.\n * @default 'medium'\n */\n size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The value of the component. The DOM API casts this to a string.\n */\n value: PropTypes.any\n} : void 0;\nexport default Radio;","'use client';\n\nimport * as React from 'react';\nimport RadioGroupContext from './RadioGroupContext';\nexport default function useRadioGroup() {\n return React.useContext(RadioGroupContext);\n}","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getFormGroupUtilityClass(slot) {\n return generateUtilityClass('MuiFormGroup', slot);\n}\nconst formGroupClasses = generateUtilityClasses('MuiFormGroup', ['root', 'row', 'error']);\nexport default formGroupClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"row\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport { getFormGroupUtilityClass } from './formGroupClasses';\nimport useFormControl from '../FormControl/useFormControl';\nimport formControlState from '../FormControl/formControlState';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n row,\n error\n } = ownerState;\n const slots = {\n root: ['root', row && 'row', error && 'error']\n };\n return composeClasses(slots, getFormGroupUtilityClass, classes);\n};\nconst FormGroupRoot = styled('div', {\n name: 'MuiFormGroup',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.row && styles.row];\n }\n})(({\n ownerState\n}) => _extends({\n display: 'flex',\n flexDirection: 'column',\n flexWrap: 'wrap'\n}, ownerState.row && {\n flexDirection: 'row'\n}));\n\n/**\n * `FormGroup` wraps controls such as `Checkbox` and `Switch`.\n * It provides compact row layout.\n * For the `Radio`, you should be using the `RadioGroup` component instead of this one.\n */\nconst FormGroup = /*#__PURE__*/React.forwardRef(function FormGroup(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiFormGroup'\n });\n const {\n className,\n row = false\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const muiFormControl = useFormControl();\n const fcs = formControlState({\n props,\n muiFormControl,\n states: ['error']\n });\n const ownerState = _extends({}, props, {\n row,\n error: fcs.error\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(FormGroupRoot, _extends({\n className: clsx(classes.root, className),\n ownerState: ownerState,\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? FormGroup.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * Display group of elements in a compact row.\n * @default false\n */\n row: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default FormGroup;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"actions\", \"children\", \"defaultValue\", \"name\", \"onChange\", \"value\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport FormGroup from '../FormGroup';\nimport useForkRef from '../utils/useForkRef';\nimport useControlled from '../utils/useControlled';\nimport RadioGroupContext from './RadioGroupContext';\nimport useId from '../utils/useId';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {\n const {\n // private\n // eslint-disable-next-line react/prop-types\n actions,\n children,\n defaultValue,\n name: nameProp,\n onChange,\n value: valueProp\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootRef = React.useRef(null);\n const [value, setValueState] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: 'RadioGroup'\n });\n React.useImperativeHandle(actions, () => ({\n focus: () => {\n let input = rootRef.current.querySelector('input:not(:disabled):checked');\n if (!input) {\n input = rootRef.current.querySelector('input:not(:disabled)');\n }\n if (input) {\n input.focus();\n }\n }\n }), []);\n const handleRef = useForkRef(ref, rootRef);\n const name = useId(nameProp);\n const contextValue = React.useMemo(() => ({\n name,\n onChange(event) {\n setValueState(event.target.value);\n if (onChange) {\n onChange(event, event.target.value);\n }\n },\n value\n }), [name, onChange, setValueState, value]);\n return /*#__PURE__*/_jsx(RadioGroupContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(FormGroup, _extends({\n role: \"radiogroup\",\n ref: handleRef\n }, other, {\n children: children\n }))\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? RadioGroup.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue: PropTypes.any,\n /**\n * The name used to reference the value of the control.\n * If you don't provide this prop, it falls back to a randomly generated name.\n */\n name: PropTypes.string,\n /**\n * Callback fired when a radio button is selected.\n *\n * @param {React.ChangeEvent} event The event source of the callback.\n * @param {string} value The value of the selected radio button.\n * You can pull out the new value by accessing `event.target.value` (string).\n */\n onChange: PropTypes.func,\n /**\n * Value of the selected radio button. The DOM API casts this to a string.\n */\n value: PropTypes.any\n} : void 0;\nexport default RadioGroup;","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\nconst RadioGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== 'production') {\n RadioGroupContext.displayName = 'RadioGroupContext';\n}\nexport default RadioGroupContext;","import createStyled from './createStyled';\nconst styled = createStyled();\nexport default styled;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"component\", \"direction\", \"spacing\", \"divider\", \"children\", \"className\", \"useFlexGap\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { deepmerge, unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass } from '@mui/utils';\nimport systemStyled from '../styled';\nimport useThemePropsSystem from '../useThemeProps';\nimport { extendSxProp } from '../styleFunctionSx';\nimport createTheme from '../createTheme';\nimport { handleBreakpoints, mergeBreakpointsInOrder, resolveBreakpointValues } from '../breakpoints';\nimport { createUnarySpacing, getValue } from '../spacing';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst defaultTheme = createTheme();\n// widening Theme to any so that the consumer can own the theme structure.\nconst defaultCreateStyledComponent = systemStyled('div', {\n name: 'MuiStack',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n});\nfunction useThemePropsDefault(props) {\n return useThemePropsSystem({\n props,\n name: 'MuiStack',\n defaultTheme\n });\n}\n\n/**\n * Return an array with the separator React element interspersed between\n * each React node of the input children.\n *\n * > joinChildren([1,2,3], 0)\n * [1,0,2,0,3]\n */\nfunction joinChildren(children, separator) {\n const childrenArray = React.Children.toArray(children).filter(Boolean);\n return childrenArray.reduce((output, child, index) => {\n output.push(child);\n if (index < childrenArray.length - 1) {\n output.push( /*#__PURE__*/React.cloneElement(separator, {\n key: `separator-${index}`\n }));\n }\n return output;\n }, []);\n}\nconst getSideFromDirection = direction => {\n return {\n row: 'Left',\n 'row-reverse': 'Right',\n column: 'Top',\n 'column-reverse': 'Bottom'\n }[direction];\n};\nexport const style = ({\n ownerState,\n theme\n}) => {\n let styles = _extends({\n display: 'flex',\n flexDirection: 'column'\n }, handleBreakpoints({\n theme\n }, resolveBreakpointValues({\n values: ownerState.direction,\n breakpoints: theme.breakpoints.values\n }), propValue => ({\n flexDirection: propValue\n })));\n if (ownerState.spacing) {\n const transformer = createUnarySpacing(theme);\n const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {\n if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {\n acc[breakpoint] = true;\n }\n return acc;\n }, {});\n const directionValues = resolveBreakpointValues({\n values: ownerState.direction,\n base\n });\n const spacingValues = resolveBreakpointValues({\n values: ownerState.spacing,\n base\n });\n if (typeof directionValues === 'object') {\n Object.keys(directionValues).forEach((breakpoint, index, breakpoints) => {\n const directionValue = directionValues[breakpoint];\n if (!directionValue) {\n const previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';\n directionValues[breakpoint] = previousDirectionValue;\n }\n });\n }\n const styleFromPropValue = (propValue, breakpoint) => {\n if (ownerState.useFlexGap) {\n return {\n gap: getValue(transformer, propValue)\n };\n }\n return {\n // The useFlexGap={false} implement relies on each child to give up control of the margin.\n // We need to reset the margin to avoid double spacing.\n '& > :not(style):not(style)': {\n margin: 0\n },\n '& > :not(style) ~ :not(style)': {\n [`margin${getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)}`]: getValue(transformer, propValue)\n }\n };\n };\n styles = deepmerge(styles, handleBreakpoints({\n theme\n }, spacingValues, styleFromPropValue));\n }\n styles = mergeBreakpointsInOrder(theme.breakpoints, styles);\n return styles;\n};\nexport default function createStack(options = {}) {\n const {\n // This will allow adding custom styled fn (for example for custom sx style function)\n createStyledComponent = defaultCreateStyledComponent,\n useThemeProps = useThemePropsDefault,\n componentName = 'MuiStack'\n } = options;\n const useUtilityClasses = () => {\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, slot => generateUtilityClass(componentName, slot), {});\n };\n const StackRoot = createStyledComponent(style);\n const Stack = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {\n const themeProps = useThemeProps(inProps);\n const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.\n const {\n component = 'div',\n direction = 'column',\n spacing = 0,\n divider,\n children,\n className,\n useFlexGap = false\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = {\n direction,\n spacing,\n useFlexGap\n };\n const classes = useUtilityClasses();\n return /*#__PURE__*/_jsx(StackRoot, _extends({\n as: component,\n ownerState: ownerState,\n ref: ref,\n className: clsx(classes.root, className)\n }, other, {\n children: divider ? joinChildren(children, divider) : children\n }));\n });\n process.env.NODE_ENV !== \"production\" ? Stack.propTypes /* remove-proptypes */ = {\n children: PropTypes.node,\n direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),\n divider: PropTypes.node,\n spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n } : void 0;\n return Stack;\n}","'use client';\n\nimport PropTypes from 'prop-types';\nimport { createStack } from '@mui/system';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nconst Stack = createStack({\n createStyledComponent: styled('div', {\n name: 'MuiStack',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n }),\n useThemeProps: inProps => useThemeProps({\n props: inProps,\n name: 'MuiStack'\n })\n});\nprocess.env.NODE_ENV !== \"production\" ? Stack.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * Defines the `flex-direction` style property.\n * It is applied for all screen sizes.\n * @default 'column'\n */\n direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),\n /**\n * Add an element between each child.\n */\n divider: PropTypes.node,\n /**\n * Defines the space between immediate children.\n * @default 0\n */\n spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),\n /**\n * The system prop, which allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.\n *\n * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),\n * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.\n *\n * To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.\n * @default false\n */\n useFlexGap: PropTypes.bool\n} : void 0;\nexport default Stack;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getSwitchBaseUtilityClass(slot) {\n return generateUtilityClass('PrivateSwitchBase', slot);\n}\nconst switchBaseClasses = generateUtilityClasses('PrivateSwitchBase', ['root', 'checked', 'disabled', 'input', 'edgeStart', 'edgeEnd']);\nexport default switchBaseClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"autoFocus\", \"checked\", \"checkedIcon\", \"className\", \"defaultChecked\", \"disabled\", \"disableFocusRipple\", \"edge\", \"icon\", \"id\", \"inputProps\", \"inputRef\", \"name\", \"onBlur\", \"onChange\", \"onFocus\", \"readOnly\", \"required\", \"tabIndex\", \"type\", \"value\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { refType } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';\nimport capitalize from '../utils/capitalize';\nimport styled from '../styles/styled';\nimport useControlled from '../utils/useControlled';\nimport useFormControl from '../FormControl/useFormControl';\nimport ButtonBase from '../ButtonBase';\nimport { getSwitchBaseUtilityClass } from './switchBaseClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n checked,\n disabled,\n edge\n } = ownerState;\n const slots = {\n root: ['root', checked && 'checked', disabled && 'disabled', edge && `edge${capitalize(edge)}`],\n input: ['input']\n };\n return composeClasses(slots, getSwitchBaseUtilityClass, classes);\n};\nconst SwitchBaseRoot = styled(ButtonBase)(({\n ownerState\n}) => _extends({\n padding: 9,\n borderRadius: '50%'\n}, ownerState.edge === 'start' && {\n marginLeft: ownerState.size === 'small' ? -3 : -12\n}, ownerState.edge === 'end' && {\n marginRight: ownerState.size === 'small' ? -3 : -12\n}));\nconst SwitchBaseInput = styled('input')({\n cursor: 'inherit',\n position: 'absolute',\n opacity: 0,\n width: '100%',\n height: '100%',\n top: 0,\n left: 0,\n margin: 0,\n padding: 0,\n zIndex: 1\n});\n\n/**\n * @ignore - internal component.\n */\nconst SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref) {\n const {\n autoFocus,\n checked: checkedProp,\n checkedIcon,\n className,\n defaultChecked,\n disabled: disabledProp,\n disableFocusRipple = false,\n edge = false,\n icon,\n id,\n inputProps,\n inputRef,\n name,\n onBlur,\n onChange,\n onFocus,\n readOnly,\n required = false,\n tabIndex,\n type,\n value\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [checked, setCheckedState] = useControlled({\n controlled: checkedProp,\n default: Boolean(defaultChecked),\n name: 'SwitchBase',\n state: 'checked'\n });\n const muiFormControl = useFormControl();\n const handleFocus = event => {\n if (onFocus) {\n onFocus(event);\n }\n if (muiFormControl && muiFormControl.onFocus) {\n muiFormControl.onFocus(event);\n }\n };\n const handleBlur = event => {\n if (onBlur) {\n onBlur(event);\n }\n if (muiFormControl && muiFormControl.onBlur) {\n muiFormControl.onBlur(event);\n }\n };\n const handleInputChange = event => {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n const newChecked = event.target.checked;\n setCheckedState(newChecked);\n if (onChange) {\n // TODO v6: remove the second argument.\n onChange(event, newChecked);\n }\n };\n let disabled = disabledProp;\n if (muiFormControl) {\n if (typeof disabled === 'undefined') {\n disabled = muiFormControl.disabled;\n }\n }\n const hasLabelFor = type === 'checkbox' || type === 'radio';\n const ownerState = _extends({}, props, {\n checked,\n disabled,\n disableFocusRipple,\n edge\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(SwitchBaseRoot, _extends({\n component: \"span\",\n className: clsx(classes.root, className),\n centerRipple: true,\n focusRipple: !disableFocusRipple,\n disabled: disabled,\n tabIndex: null,\n role: undefined,\n onFocus: handleFocus,\n onBlur: handleBlur,\n ownerState: ownerState,\n ref: ref\n }, other, {\n children: [/*#__PURE__*/_jsx(SwitchBaseInput, _extends({\n autoFocus: autoFocus,\n checked: checkedProp,\n defaultChecked: defaultChecked,\n className: classes.input,\n disabled: disabled,\n id: hasLabelFor ? id : undefined,\n name: name,\n onChange: handleInputChange,\n readOnly: readOnly,\n ref: inputRef,\n required: required,\n ownerState: ownerState,\n tabIndex: tabIndex,\n type: type\n }, type === 'checkbox' && value === undefined ? {} : {\n value\n }, inputProps)), checked ? checkedIcon : icon]\n }));\n});\n\n// NB: If changed, please update Checkbox, Switch and Radio\n// so that the API documentation is updated.\nprocess.env.NODE_ENV !== \"production\" ? SwitchBase.propTypes = {\n /**\n * If `true`, the `input` element is focused during the first mount.\n */\n autoFocus: PropTypes.bool,\n /**\n * If `true`, the component is checked.\n */\n checked: PropTypes.bool,\n /**\n * The icon to display when the component is checked.\n */\n checkedIcon: PropTypes.node.isRequired,\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * @ignore\n */\n defaultChecked: PropTypes.bool,\n /**\n * If `true`, the component is disabled.\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, the keyboard focus ripple is disabled.\n * @default false\n */\n disableFocusRipple: PropTypes.bool,\n /**\n * If given, uses a negative margin to counteract the padding on one\n * side (this is often helpful for aligning the left or right\n * side of the icon with content above or below, without ruining the border\n * size and shape).\n * @default false\n */\n edge: PropTypes.oneOf(['end', 'start', false]),\n /**\n * The icon to display when the component is unchecked.\n */\n icon: PropTypes.node.isRequired,\n /**\n * The id of the `input` element.\n */\n id: PropTypes.string,\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps: PropTypes.object,\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n /*\n * @ignore\n */\n name: PropTypes.string,\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n /**\n * Callback fired when the state is changed.\n *\n * @param {object} event The event source of the callback.\n * You can pull out the new checked state by accessing `event.target.checked` (boolean).\n */\n onChange: PropTypes.func,\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n /**\n * It prevents the user from changing the value of the field\n * (not from interacting with the field).\n */\n readOnly: PropTypes.bool,\n /**\n * If `true`, the `input` element is required.\n */\n required: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.object,\n /**\n * @ignore\n */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n /**\n * The input component prop `type`.\n */\n type: PropTypes.string.isRequired,\n /**\n * The value of the component.\n */\n value: PropTypes.any\n} : void 0;\nexport default SwitchBase;","import { unstable_createChainedFunction as createChainedFunction } from '@mui/utils';\nexport default createChainedFunction;","/**\n * Safe chained function.\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n */\nexport default function createChainedFunction(...funcs) {\n return funcs.reduce((acc, func) => {\n if (func == null) {\n return acc;\n }\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, () => {});\n}"],"names":["getFormControlLabelUtilityClasses","slot","generateUtilityClass","generateUtilityClasses","_excluded","FormControlLabelRoot","styled","name","overridesResolver","props","styles","ownerState","_defineProperty","concat","formControlLabelClasses","label","root","capitalize","labelPlacement","_ref3","theme","_extends","display","alignItems","cursor","verticalAlign","WebkitTapHighlightColor","marginLeft","marginRight","disabled","flexDirection","color","vars","palette","text","AsteriskComponent","asterisk","_ref4","error","main","React","inProps","ref","_ref","_slotProps$typography","useThemeProps","className","_props$componentsProp","componentsProps","control","disabledProp","disableTypography","labelProp","_props$labelPlacement","requiredProp","required","_props$slotProps","slotProps","other","_objectWithoutPropertiesLoose","muiFormControl","useFormControl","controlProps","forEach","key","fcs","formControlState","states","classes","slots","composeClasses","useUtilityClasses","typographySlotProps","typography","type","Typography","_jsx","component","clsx","children","_jsxs","Stack","direction","createSvgIcon","d","RadioButtonIconRoot","position","RadioButtonIconBackground","RadioButtonUncheckedIcon","transform","RadioButtonIconDot","RadioButtonCheckedIcon","left","transition","transitions","create","easing","easeIn","duration","shortest","checked","easeOut","_props$checked","_props$classes","fontSize","background","dot","getRadioUtilityClass","RadioRoot","SwitchBase","shouldForwardProp","prop","rootShouldForwardProp","secondary","disableRipple","backgroundColor","action","activeChannel","mainChannel","hoverOpacity","alpha","active","radioClasses","defaultCheckedIcon","RadioButtonIcon","defaultIcon","_defaultIcon$props$fo","_defaultCheckedIcon$p","a","b","checkedProp","_props$checkedIcon","checkedIcon","_props$color","_props$icon","icon","nameProp","onChangeProp","onChange","_props$size","size","radioGroup","RadioGroupContext","createChainedFunction","value","String","getFormGroupUtilityClass","FormGroupRoot","row","flexWrap","_props$row","actions","defaultValue","valueProp","rootRef","_useControlled","useControlled","controlled","default","_useControlled2","_slicedToArray","setValueState","focus","input","current","querySelector","handleRef","useForkRef","useId","contextValue","event","target","Provider","FormGroup","role","undefined","createStyled","defaultTheme","createTheme","defaultCreateStyledComponent","systemStyled","useThemePropsDefault","useThemePropsSystem","joinChildren","separator","childrenArray","toArray","filter","Boolean","reduce","output","child","index","push","length","style","handleBreakpoints","resolveBreakpointValues","values","breakpoints","propValue","spacing","transformer","createUnarySpacing","base","Object","keys","acc","breakpoint","directionValues","spacingValues","previousDirectionValue","deepmerge","useFlexGap","gap","getValue","margin","column","mergeBreakpointsInOrder","options","arguments","_options$createStyled","createStyledComponent","_options$useThemeProp","_options$componentNam","componentName","StackRoot","themeProps","extendSxProp","_props$component","_props$direction","_props$spacing","divider","_props$useFlexGap","as","createStack","getSwitchBaseUtilityClass","SwitchBaseRoot","ButtonBase","padding","borderRadius","edge","SwitchBaseInput","opacity","width","height","top","zIndex","autoFocus","defaultChecked","_props$disableFocusRi","disableFocusRipple","_props$edge","id","inputProps","inputRef","onBlur","onFocus","readOnly","_props$required","tabIndex","state","setCheckedState","hasLabelFor","centerRipple","focusRipple","nativeEvent","defaultPrevented","newChecked","_len","funcs","Array","_key","func","_len2","args","_key2","apply","this"],"sourceRoot":""}
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1581.2174ac68.chunk.js b/portal-ui/build/static/js/1581.2174ac68.chunk.js
new file mode 100644
index 0000000000..6ef0a9d098
--- /dev/null
+++ b/portal-ui/build/static/js/1581.2174ac68.chunk.js
@@ -0,0 +1,2 @@
+"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1581],{1581:function(e,t,n){n.r(t);var a=n(29439),o=n(72791),i=n(29945),u=n(45248),r=n(23814),c=n(56028),l=n(84741),d=n(87995),s=n(44690),f=n(31776),b=n(82342),h=n(80184);t.default=function(e){var t=e.open,n=e.enabled,x=e.cfg,p=e.selectedBucket,g=e.closeModalAndRefresh,k=(0,s.TL)(),v=(0,o.useState)(!1),j=(0,a.Z)(v,2),m=j[0],C=j[1],S=(0,o.useState)(!1),Z=(0,a.Z)(S,2),q=Z[0],B=Z[1],_=(0,o.useState)("1"),z=(0,a.Z)(_,2),E=z[0],y=z[1],A=(0,o.useState)("Ti"),T=(0,a.Z)(A,2),w=T[0],F=T[1],O=(0,o.useState)(!1),P=(0,a.Z)(O,2),Q=P[0],I=P[1];(0,o.useEffect)((function(){if(n&&(B(!0),x)){var e=(0,u.Am)(x.quota||0,!0,!1,!0);y(e.total.toString()),F(e.unit),I(!0)}}),[n,x]),(0,o.useEffect)((function(){I(!q||/^\d*(?:\.\d{1,2})?$/.test(E))}),[q,E]);return(0,h.jsx)(c.Z,{modalOpen:t,onClose:function(){g()},title:"Enable Bucket Quota",titleIcon:(0,h.jsx)(i.Wqw,{}),children:(0,h.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),!m&&Q&&f.h.buckets.setBucketQuota(p,{enabled:q,amount:parseInt((0,u.Pw)(E,w,!0)),quota_type:"hard"}).then((function(){C(!1),g()})).catch((function(e){C(!1),k((0,d.zb)((0,b.g)(e.error)))}))},children:(0,h.jsxs)(i.ltY,{withBorders:!1,containerPadding:!1,children:[(0,h.jsx)(i.rsf,{value:"bucket_quota",id:"bucket_quota",name:"bucket_quota",checked:q,onChange:function(e){B(e.target.checked)},label:"Enabled"}),q&&(0,h.jsx)(i.Wzg,{id:"quota_size",name:"quota_size",onChange:function(e){y(e.target.value),e.target.validity.valid?I(!0):I(!1)},label:"Quota",value:E,required:!0,min:"1",overlayObject:(0,h.jsx)(l.Z,{id:"quota_unit",onUnitChange:function(e){F(e)},unitSelected:w,unitsList:(0,u.zQ)(["Ki"]),disabled:!1}),error:Q?"":"Please enter a valid quota"}),(0,h.jsxs)(i.rjZ,{item:!0,xs:12,sx:r.ID.modalButtonBar,children:[(0,h.jsx)(i.zxk,{id:"cancel",type:"button",variant:"regular",disabled:m,onClick:function(){g()},label:"Cancel"}),(0,h.jsx)(i.zxk,{id:"save",type:"submit",variant:"callAction",disabled:m||!Q,label:"Save"})]}),m&&(0,h.jsx)(i.rjZ,{item:!0,xs:12,children:(0,h.jsx)(i.kod,{})})]})})})}},84741:function(e,t,n){var a=n(29439),o=n(72791),i=n(29945),u=n(17691),r=n(26181),c=n.n(r),l=n(80184),d=u.ZP.button((function(e){var t=e.theme;return{border:"1px solid ".concat(c()(t,"borderColor","#E2E2E2")),borderRadius:3,color:c()(t,"secondaryText","#5B5C5C"),backgroundColor:c()(t,"boxBackground","#FBFAFA"),fontSize:12}}));t.Z=function(e){var t=e.id,n=e.unitSelected,u=e.unitsList,r=e.disabled,c=void 0!==r&&r,s=e.onUnitChange,f=o.useState(null),b=(0,a.Z)(f,2),h=b[0],x=b[1],p=Boolean(h),g=function(e){x(null),""!==e&&s&&s(e)};return(0,l.jsxs)(o.Fragment,{children:[(0,l.jsx)(d,{id:"".concat(t,"-button"),"aria-controls":"".concat(t,"-menu"),"aria-haspopup":"true","aria-expanded":p?"true":void 0,onClick:function(e){x(e.currentTarget)},disabled:c,type:"button",children:n}),(0,l.jsx)(i.udT,{id:"upload-main-menu",options:u,selectedOption:"",onSelect:function(e){return g(e)},hideTriggerAction:function(){g("")},open:p,anchorEl:h,anchorOrigin:"end"})]})}}}]);
+//# sourceMappingURL=1581.2174ac68.chunk.js.map
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1581.2174ac68.chunk.js.map b/portal-ui/build/static/js/1581.2174ac68.chunk.js.map
new file mode 100644
index 0000000000..5c972c9eb9
--- /dev/null
+++ b/portal-ui/build/static/js/1581.2174ac68.chunk.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"static/js/1581.2174ac68.chunk.js","mappings":"2PAsMA,UApJoB,SAAHA,GAMS,IALxBC,EAAID,EAAJC,KACAC,EAAOF,EAAPE,QACAC,EAAGH,EAAHG,IACAC,EAAcJ,EAAdI,eACAC,EAAoBL,EAApBK,qBAEMC,GAAWC,EAAAA,EAAAA,MACjBC,GAA8BC,EAAAA,EAAAA,WAAkB,GAAMC,GAAAC,EAAAA,EAAAA,GAAAH,EAAA,GAA/CI,EAAO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C4D,kBAAmB,WACjBT,EAAY,GACd,EACAvH,KAAMA,EACNoH,SAAUA,EACVa,aAAc,UAItB,C","sources":["screens/Console/Buckets/BucketDetails/EnableQuota.tsx","screens/Console/Common/FormComponents/InputUnitMenu/InputUnitMenu.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport {\n BucketQuotaIcon,\n Button,\n FormLayout,\n InputBox,\n Switch,\n Grid,\n ProgressBar,\n} from \"mds\";\nimport {\n calculateBytes,\n getBytes,\n k8sScalarUnitsExcluding,\n} from \"../../../../common/utils\";\n\nimport { modalStyleUtils } from \"../../Common/FormComponents/common/styleLibrary\";\nimport ModalWrapper from \"../../Common/ModalWrapper/ModalWrapper\";\nimport InputUnitMenu from \"../../Common/FormComponents/InputUnitMenu/InputUnitMenu\";\n\nimport { setModalErrorSnackMessage } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport { BucketQuota } from \"api/consoleApi\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\n\ninterface IEnableQuotaProps {\n open: boolean;\n enabled: boolean;\n cfg: BucketQuota | null;\n selectedBucket: string;\n closeModalAndRefresh: () => void;\n}\n\nconst EnableQuota = ({\n open,\n enabled,\n cfg,\n selectedBucket,\n closeModalAndRefresh,\n}: IEnableQuotaProps) => {\n const dispatch = useAppDispatch();\n const [loading, setLoading] = useState(false);\n const [quotaEnabled, setQuotaEnabled] = useState(false);\n const [quotaSize, setQuotaSize] = useState(\"1\");\n const [quotaUnit, setQuotaUnit] = useState(\"Ti\");\n const [validInput, setValidInput] = useState(false);\n\n useEffect(() => {\n if (enabled) {\n setQuotaEnabled(true);\n if (cfg) {\n const unitCalc = calculateBytes(cfg.quota || 0, true, false, true);\n\n setQuotaSize(unitCalc.total.toString());\n setQuotaUnit(unitCalc.unit);\n setValidInput(true);\n }\n }\n }, [enabled, cfg]);\n\n useEffect(() => {\n const valRegExp = /^\\d*(?:\\.\\d{1,2})?$/;\n\n if (!quotaEnabled) {\n setValidInput(true);\n return;\n }\n\n setValidInput(valRegExp.test(quotaSize));\n }, [quotaEnabled, quotaSize]);\n\n const enableBucketEncryption = () => {\n if (loading || !validInput) {\n return;\n }\n\n api.buckets\n .setBucketQuota(selectedBucket, {\n enabled: quotaEnabled,\n amount: parseInt(getBytes(quotaSize, quotaUnit, true)),\n quota_type: \"hard\",\n })\n .then(() => {\n setLoading(false);\n closeModalAndRefresh();\n })\n .catch((err) => {\n setLoading(false);\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n });\n };\n\n return (\n {\n closeModalAndRefresh();\n }}\n title=\"Enable Bucket Quota\"\n titleIcon={}\n >\n \n \n );\n};\n\nexport default EnableQuota;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { DropdownSelector, SelectorType } from \"mds\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\n\ninterface IInputUnitBox {\n id: string;\n unitSelected: string;\n unitsList: SelectorType[];\n disabled?: boolean;\n onUnitChange?: (newValue: string) => void;\n}\n\nconst UnitMenuButton = styled.button(({ theme }) => ({\n border: `1px solid ${get(theme, \"borderColor\", \"#E2E2E2\")}`,\n borderRadius: 3,\n color: get(theme, \"secondaryText\", \"#5B5C5C\"),\n backgroundColor: get(theme, \"boxBackground\", \"#FBFAFA\"),\n fontSize: 12,\n}));\n\nconst InputUnitMenu = ({\n id,\n unitSelected,\n unitsList,\n disabled = false,\n onUnitChange,\n}: IInputUnitBox) => {\n const [anchorEl, setAnchorEl] = React.useState(null);\n const open = Boolean(anchorEl);\n const handleClick = (event: React.MouseEvent) => {\n setAnchorEl(event.currentTarget);\n };\n const handleClose = (newUnit: string) => {\n setAnchorEl(null);\n if (newUnit !== \"\" && onUnitChange) {\n onUnitChange(newUnit);\n }\n };\n\n return (\n \n \n {unitSelected}\n \n handleClose(value)}\n hideTriggerAction={() => {\n handleClose(\"\");\n }}\n open={open}\n anchorEl={anchorEl}\n anchorOrigin={\"end\"}\n />\n \n );\n};\n\nexport default InputUnitMenu;\n"],"names":["_ref","open","enabled","cfg","selectedBucket","closeModalAndRefresh","dispatch","useAppDispatch","_useState","useState","_useState2","_slicedToArray","loading","setLoading","_useState3","_useState4","quotaEnabled","setQuotaEnabled","_useState5","_useState6","quotaSize","setQuotaSize","_useState7","_useState8","quotaUnit","setQuotaUnit","_useState9","_useState10","validInput","setValidInput","useEffect","unitCalc","calculateBytes","quota","total","toString","unit","test","_jsx","ModalWrapper","modalOpen","onClose","title","titleIcon","BucketQuotaIcon","children","noValidate","autoComplete","onSubmit","e","preventDefault","api","buckets","setBucketQuota","amount","parseInt","getBytes","quota_type","then","catch","err","setModalErrorSnackMessage","errorToHandler","error","_jsxs","FormLayout","withBorders","containerPadding","Switch","value","id","name","checked","onChange","event","target","label","InputBox","validity","valid","required","min","overlayObject","InputUnitMenu","onUnitChange","newValue","unitSelected","unitsList","k8sScalarUnitsExcluding","disabled","Grid","item","xs","sx","modalStyleUtils","modalButtonBar","Button","type","variant","onClick","ProgressBar","UnitMenuButton","styled","button","theme","border","concat","get","borderRadius","color","backgroundColor","fontSize","_ref2","_ref2$disabled","_React$useState","React","_React$useState2","anchorEl","setAnchorEl","Boolean","handleClose","newUnit","Fragment","undefined","currentTarget","DropdownSelector","options","selectedOption","onSelect","hideTriggerAction","anchorOrigin"],"sourceRoot":""}
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1581.9e1d2acf.chunk.js b/portal-ui/build/static/js/1581.9e1d2acf.chunk.js
deleted file mode 100644
index aa88dc23d1..0000000000
--- a/portal-ui/build/static/js/1581.9e1d2acf.chunk.js
+++ /dev/null
@@ -1,2 +0,0 @@
-"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1581],{1581:function(t,e,n){n.r(e);var a=n(29439),o=n(72791),i=n(29945),u=n(45248),r=n(23814),l=n(56028),c=n(84741),s=n(87995),d=n(44690),f=n(31776),b=n(82342),h=n(80184);e.default=function(t){var e=t.open,n=t.enabled,v=t.cfg,x=t.selectedBucket,g=t.closeModalAndRefresh,p=(0,d.TL)(),m=(0,o.useState)(!1),k=(0,a.Z)(m,2),j=k[0],Z=k[1],C=(0,o.useState)(!1),S=(0,a.Z)(C,2),q=S[0],z=S[1],_=(0,o.useState)("1"),y=(0,a.Z)(_,2),B=y[0],w=y[1],E=(0,o.useState)("Ti"),T=(0,a.Z)(E,2),F=T[0],O=T[1],Q=(0,o.useState)(!1),A=(0,a.Z)(Q,2),I=A[0],L=A[1];(0,o.useEffect)((function(){if(n&&(z(!0),v)){var t=(0,u.Am)(v.quota||0,!0,!1,!0);w(t.total.toString()),O(t.unit),L(!0)}}),[n,v]),(0,o.useEffect)((function(){L(!q||/^\d*(?:\.\d{1,2})?$/.test(B))}),[q,B]);return(0,h.jsx)(l.Z,{modalOpen:e,onClose:function(){g()},title:"Enable Bucket Quota",titleIcon:(0,h.jsx)(i.Wqw,{}),children:(0,h.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(t){t.preventDefault(),!j&&I&&f.h.buckets.setBucketQuota(x,{enabled:q,amount:parseInt((0,u.Pw)(B,F,!0)),quota_type:"hard"}).then((function(){Z(!1),g()})).catch((function(t){Z(!1),p((0,s.zb)((0,b.g)(t.error)))}))},children:(0,h.jsxs)(i.ltY,{withBorders:!1,containerPadding:!1,children:[(0,h.jsx)(i.rsf,{value:"bucket_quota",id:"bucket_quota",name:"bucket_quota",checked:q,onChange:function(t){z(t.target.checked)},label:"Enabled"}),q&&(0,h.jsx)(i.Wzg,{id:"quota_size",name:"quota_size",onChange:function(t){w(t.target.value),t.target.validity.valid?L(!0):L(!1)},label:"Quota",value:B,required:!0,min:"1",overlayObject:(0,h.jsx)(c.Z,{id:"quota_unit",onUnitChange:function(t){O(t)},unitSelected:F,unitsList:(0,u.zQ)(["Ki"]),disabled:!1}),error:I?"":"Please enter a valid quota"}),(0,h.jsxs)(i.rjZ,{item:!0,xs:12,sx:r.ID.modalButtonBar,children:[(0,h.jsx)(i.zxk,{id:"cancel",type:"button",variant:"regular",disabled:j,onClick:function(){g()},label:"Cancel"}),(0,h.jsx)(i.zxk,{id:"save",type:"submit",variant:"callAction",disabled:j||!I,label:"Save"})]}),j&&(0,h.jsx)(i.rjZ,{item:!0,xs:12,children:(0,h.jsx)(i.kod,{})})]})})})}},84741:function(t,e,n){var a=n(29439),o=n(72791),i=n(11135),u=n(25787),r=n(80911),l=n(77865),c=n(80184);e.Z=(0,u.Z)((function(t){return(0,i.Z)({buttonTrigger:{border:"#F0F2F2 1px solid",borderRadius:3,color:"#838383",backgroundColor:"#fff",fontSize:12}})}))((function(t){var e=t.classes,n=t.id,i=t.unitSelected,u=t.unitsList,s=t.disabled,d=void 0!==s&&s,f=t.onUnitChange,b=o.useState(null),h=(0,a.Z)(b,2),v=h[0],x=h[1],g=Boolean(v),p=function(t){x(null),""!==t&&f&&f(t)};return(0,c.jsxs)(o.Fragment,{children:[(0,c.jsx)("button",{id:"".concat(n,"-button"),"aria-controls":"".concat(n,"-menu"),"aria-haspopup":"true","aria-expanded":g?"true":void 0,onClick:function(t){x(t.currentTarget)},className:e.buttonTrigger,disabled:d,type:"button",children:i}),(0,c.jsx)(r.Z,{id:"".concat(n,"-menu"),"aria-labelledby":"".concat(n,"-button"),anchorEl:v,open:g,onClose:function(){p("")},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:u.map((function(t){return(0,c.jsx)(l.Z,{onClick:function(){return p(t.value)},children:t.label},"itemUnit-".concat(t.value,"-").concat(t.label))}))})]})}))}}]);
-//# sourceMappingURL=1581.9e1d2acf.chunk.js.map
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1581.9e1d2acf.chunk.js.map b/portal-ui/build/static/js/1581.9e1d2acf.chunk.js.map
deleted file mode 100644
index f92737fc26..0000000000
--- a/portal-ui/build/static/js/1581.9e1d2acf.chunk.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"static/js/1581.9e1d2acf.chunk.js","mappings":"2PAsMA,UApJoB,SAAHA,GAMS,IALxBC,EAAID,EAAJC,KACAC,EAAOF,EAAPE,QACAC,EAAGH,EAAHG,IACAC,EAAcJ,EAAdI,eACAC,EAAoBL,EAApBK,qBAEMC,GAAWC,EAAAA,EAAAA,MACjBC,GAA8BC,EAAAA,EAAAA,WAAkB,GAAMC,GAAAC,EAAAA,EAAAA,GAAAH,EAAA,GAA/CI,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GAC1BI,GAAwCL,EAAAA,EAAAA,WAAkB,GAAMM,GAAAJ,EAAAA,EAAAA,GAAAG,EAAA,GAAzDE,EAAYD,EAAA,GAAEE,EAAeF,EAAA,GACpCG,GAAkCT,EAAAA,EAAAA,UAAiB,KAAIU,GAAAR,EAAAA,EAAAA,GAAAO,EAAA,GAAhDE,EAASD,EAAA,GAAEE,EAAYF,EAAA,GAC9BG,GAAkCb,EAAAA,EAAAA,UAAiB,MAAKc,GAAAZ,EAAAA,EAAAA,GAAAW,E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/InputUnitMenu/InputUnitMenu.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport {\n BucketQuotaIcon,\n Button,\n FormLayout,\n InputBox,\n Switch,\n Grid,\n ProgressBar,\n} from \"mds\";\nimport {\n calculateBytes,\n getBytes,\n k8sScalarUnitsExcluding,\n} from \"../../../../common/utils\";\n\nimport { modalStyleUtils } from \"../../Common/FormComponents/common/styleLibrary\";\nimport ModalWrapper from \"../../Common/ModalWrapper/ModalWrapper\";\nimport InputUnitMenu from \"../../Common/FormComponents/InputUnitMenu/InputUnitMenu\";\n\nimport { setModalErrorSnackMessage } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport { BucketQuota } from \"api/consoleApi\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\n\ninterface IEnableQuotaProps {\n open: boolean;\n enabled: boolean;\n cfg: BucketQuota | null;\n selectedBucket: string;\n closeModalAndRefresh: () => void;\n}\n\nconst EnableQuota = ({\n open,\n enabled,\n cfg,\n selectedBucket,\n closeModalAndRefresh,\n}: IEnableQuotaProps) => {\n const dispatch = useAppDispatch();\n const [loading, setLoading] = useState(false);\n const [quotaEnabled, setQuotaEnabled] = useState(false);\n const [quotaSize, setQuotaSize] = useState(\"1\");\n const [quotaUnit, setQuotaUnit] = useState(\"Ti\");\n const [validInput, setValidInput] = useState(false);\n\n useEffect(() => {\n if (enabled) {\n setQuotaEnabled(true);\n if (cfg) {\n const unitCalc = calculateBytes(cfg.quota || 0, true, false, true);\n\n setQuotaSize(unitCalc.total.toString());\n setQuotaUnit(unitCalc.unit);\n setValidInput(true);\n }\n }\n }, [enabled, cfg]);\n\n useEffect(() => {\n const valRegExp = /^\\d*(?:\\.\\d{1,2})?$/;\n\n if (!quotaEnabled) {\n setValidInput(true);\n return;\n }\n\n setValidInput(valRegExp.test(quotaSize));\n }, [quotaEnabled, quotaSize]);\n\n const enableBucketEncryption = () => {\n if (loading || !validInput) {\n return;\n }\n\n api.buckets\n .setBucketQuota(selectedBucket, {\n enabled: quotaEnabled,\n amount: parseInt(getBytes(quotaSize, quotaUnit, true)),\n quota_type: \"hard\",\n })\n .then(() => {\n setLoading(false);\n closeModalAndRefresh();\n })\n .catch((err) => {\n setLoading(false);\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n });\n };\n\n return (\n {\n closeModalAndRefresh();\n }}\n title=\"Enable Bucket Quota\"\n titleIcon={}\n >\n \n \n );\n};\n\nexport default EnableQuota;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport { SelectorType } from \"mds\";\nimport { Menu, MenuItem } from \"@mui/material\";\n\ninterface IInputUnitBox {\n classes: any;\n id: string;\n unitSelected: string;\n unitsList: SelectorType[];\n disabled?: boolean;\n onUnitChange?: (newValue: string) => void;\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n buttonTrigger: {\n border: \"#F0F2F2 1px solid\",\n borderRadius: 3,\n color: \"#838383\",\n backgroundColor: \"#fff\",\n fontSize: 12,\n },\n });\n\nconst InputUnitMenu = ({\n classes,\n id,\n unitSelected,\n unitsList,\n disabled = false,\n onUnitChange,\n}: IInputUnitBox) => {\n const [anchorEl, setAnchorEl] = React.useState(null);\n const open = Boolean(anchorEl);\n const handleClick = (event: React.MouseEvent) => {\n setAnchorEl(event.currentTarget);\n };\n const handleClose = (newUnit: string) => {\n setAnchorEl(null);\n if (newUnit !== \"\" && onUnitChange) {\n onUnitChange(newUnit);\n }\n };\n\n return (\n \n \n \n \n );\n};\n\nexport default withStyles(styles)(InputUnitMenu);\n"],"names":["_ref","open","enabled","cfg","selectedBucket","closeModalAndRefresh","dispatch","useAppDispatch","_useState","useState","_useState2","_slicedToArray","loading","setLoading","_useState3","_useState4","quotaEnabled","setQuotaEnabled","_useState5","_useState6","quotaSize","setQuotaSize","_useState7","_useState8","quotaUnit","setQuotaUnit","_useState9","_useState10","validInput","setValidInput","useEffect","unitCalc","calculateBytes","quota","total","toString","unit","test","_jsx","ModalWrapper","modalOpen","onClose","title","titleIcon","BucketQuotaIcon","children","noValidate","autoComplete","onSubmit","e","preventDefault","api","buckets","setBucketQuota","amount","parseInt","getBytes","quota_type","then","catch","err","setModalErrorSnackMessage","errorToHandler","error","_jsxs","FormLayout","withBorders","containerPadding","Switch","value","id","name","checked","onChange","event","target","label","InputBox","validity","valid","required","min","overlayObject","InputUnitMenu","onUnitChange","newValue","unitSelected","unitsList","k8sScalarUnitsExcluding","disabled","Grid","item","xs","sx","modalStyleUtils","modalButtonBar","Button","type","variant","onClick","ProgressBar","withStyles","theme","createStyles","buttonTrigger","border","borderRadius","color","backgroundColor","fontSize","classes","_ref$disabled","_React$useState","React","_React$useState2","anchorEl","setAnchorEl","Boolean","handleClose","newUnit","Fragment","concat","undefined","currentTarget","className","Menu","anchorOrigin","vertical","horizontal","transformOrigin","map","MenuItem"],"sourceRoot":""}
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1604.64ec26a0.chunk.js b/portal-ui/build/static/js/1604.64ec26a0.chunk.js
deleted file mode 100644
index 473c23a0f6..0000000000
--- a/portal-ui/build/static/js/1604.64ec26a0.chunk.js
+++ /dev/null
@@ -1,2 +0,0 @@
-"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1604],{1604:function(e,t,n){n.r(t);var a=n(29439),i=n(72791),o=n(29945),l=n(31776),u=n(66315),r=n(82342),s=n(23814),c=n(87995),d=n(44690),f=n(56028),m=n(80184);t.default=function(e){var t=e.open,n=e.bucketName,b=e.closeModalAndRefresh,h=(0,d.TL)(),p=(0,i.useState)(!1),v=(0,a.Z)(p,2),g=v[0],x=v[1],y=(0,i.useState)(!0),C=(0,a.Z)(y,2),j=C[0],k=C[1],S=(0,i.useState)(u.oO.Compliance),R=(0,a.Z)(S,2),Z=R[0],_=R[1],z=(0,i.useState)(u.zR.Days),N=(0,a.Z)(z,2),w=N[0],B=N[1],D=(0,i.useState)(1),O=(0,a.Z)(D,2),E=O[0],V=O[1],A=(0,i.useState)(!1),M=(0,a.Z)(A,2),Y=M[0],q=M[1];return(0,i.useEffect)((function(){Number.isNaN(E)||(E||1)<1?q(!1):q(!0)}),[E]),(0,i.useEffect)((function(){j&&l.h.buckets.getBucketRetentionConfig(n).then((function(e){k(!1),_(e.data.mode),V(e.data.validity),B(e.data.unit)})).catch((function(){k(!1)}))}),[j,n]),(0,m.jsx)(f.Z,{title:"Set Retention Configuration",modalOpen:t,onClose:function(){b()},children:j?(0,m.jsx)(o.aNw,{style:{width:16,height:16}}):(0,m.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),g||(x(!0),l.h.buckets.setBucketRetentionConfig(n,{mode:Z||u.oO.Compliance,unit:w||u.zR.Days,validity:E||1}).then((function(){x(!1),b()})).catch((function(e){x(!1),h((0,c.zb)((0,r.g)(e.error)))})))},children:(0,m.jsxs)(o.ltY,{containerPadding:!1,withBorders:!1,children:[(0,m.jsx)(o.Eep,{currentValue:Z,id:"retention_mode",name:"retention_mode",label:"Retention Mode",onChange:function(e){_(e.target.value)},selectorOptions:[{value:"compliance",label:"Compliance"},{value:"governance",label:"Governance"}]}),(0,m.jsx)(o.Eep,{currentValue:w,id:"retention_unit",name:"retention_unit",label:"Retention Unit",onChange:function(e){B(e.target.value)},selectorOptions:[{value:"days",label:"Days"},{value:"years",label:"Years"}]}),(0,m.jsx)(o.Wzg,{type:"number",id:"retention_validity",name:"retention_validity",onChange:function(e){V(e.target.valueAsNumber)},label:"Retention Validity",value:String(E),required:!0,min:"1"}),(0,m.jsxs)(o.rjZ,{item:!0,xs:12,sx:s.ID.modalButtonBar,children:[(0,m.jsx)(o.zxk,{id:"cancel",type:"button",variant:"regular",disabled:g,onClick:function(){b()},label:"Cancel"}),(0,m.jsx)(o.zxk,{id:"set",type:"submit",variant:"callAction",color:"primary",disabled:g||!Y,label:"Set"})]}),g&&(0,m.jsx)(o.rjZ,{item:!0,xs:12,children:(0,m.jsx)(o.kod,{})})]})})})}}}]);
-//# sourceMappingURL=1604.64ec26a0.chunk.js.map
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1604.64ec26a0.chunk.js.map b/portal-ui/build/static/js/1604.64ec26a0.chunk.js.map
deleted file mode 100644
index 20ed27f2a4..0000000000
--- a/portal-ui/build/static/js/1604.64ec26a0.chunk.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"static/js/1604.64ec26a0.chunk.js","mappings":"gPAqMA,UA5J2B,SAAHA,GAIS,IAH/BC,EAAID,EAAJC,KACAC,EAAUF,EAAVE,WACAC,EAAoBH,EAApBG,qBAEMC,GAAWC,EAAAA,EAAAA,MACjBC,GAAoCC,EAAAA,EAAAA,WAAkB,GAAMC,GAAAC,EAAAA,EAAAA,GAAAH,EAAA,GAArDI,EAAUF,EAAA,GAAEG,EAAaH,EAAA,GAChCI,GAAsCL,EAAA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AIC,GAAIC,EAAAA,GAAgBC,eAAevC,SAAA,EACpDL,EAAAA,EAAAA,KAAC6C,EAAAA,IAAM,CACLnB,GAAI,SACJQ,KAAK,SACLY,QAAQ,UACRC,SAAUtF,EACVuF,QAAS,WACP9F,GACF,EACA0E,MAAO,YAET5B,EAAAA,EAAAA,KAAC6C,EAAAA,IAAM,CACLnB,GAAI,MACJQ,KAAK,SACLY,QAAQ,aACRG,MAAM,UACNF,SAAUtF,IAAewB,EACzB2C,MAAO,WAGVnE,IACCuC,EAAAA,EAAAA,KAACuC,EAAAA,IAAI,CAACC,MAAI,EAACC,GAAI,GAAGpC,UAChBL,EAAAA,EAAAA,KAACkD,EAAAA,IAAW,YAQ5B,C","sources":["screens/Console/Buckets/BucketDetails/SetRetentionConfig.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport {\n Button,\n Loader,\n Grid,\n FormLayout,\n RadioGroup,\n InputBox,\n ProgressBar,\n} from \"mds\";\nimport { api } from \"api\";\nimport { ObjectRetentionMode, ObjectRetentionUnit } from \"api/consoleApi\";\nimport { errorToHandler } from \"api/errors\";\n\nimport { modalStyleUtils } from \"../../Common/FormComponents/common/styleLibrary\";\nimport { setModalErrorSnackMessage } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport ModalWrapper from \"../../Common/ModalWrapper/ModalWrapper\";\n\ninterface ISetRetentionConfigProps {\n open: boolean;\n bucketName: string;\n closeModalAndRefresh: () => void;\n}\n\nconst SetRetentionConfig = ({\n open,\n bucketName,\n closeModalAndRefresh,\n}: ISetRetentionConfigProps) => {\n const dispatch = useAppDispatch();\n const [addLoading, setAddLoading] = useState(false);\n const [loadingForm, setLoadingForm] = useState(true);\n const [retentionMode, setRetentionMode] = useState<\n ObjectRetentionMode | undefined\n >(ObjectRetentionMode.Compliance);\n const [retentionUnit, setRetentionUnit] = useState<\n ObjectRetentionUnit | undefined\n >(ObjectRetentionUnit.Days);\n const [retentionValidity, setRetentionValidity] = useState<\n number | undefined\n >(1);\n const [valid, setValid] = useState(false);\n\n const setRetention = (event: React.FormEvent) => {\n event.preventDefault();\n if (addLoading) {\n return;\n }\n setAddLoading(true);\n api.buckets\n .setBucketRetentionConfig(bucketName, {\n mode: retentionMode || ObjectRetentionMode.Compliance,\n unit: retentionUnit || ObjectRetentionUnit.Days,\n validity: retentionValidity || 1,\n })\n .then(() => {\n setAddLoading(false);\n closeModalAndRefresh();\n })\n .catch((err) => {\n setAddLoading(false);\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n });\n };\n\n useEffect(() => {\n if (Number.isNaN(retentionValidity) || (retentionValidity || 1) < 1) {\n setValid(false);\n return;\n }\n setValid(true);\n }, [retentionValidity]);\n\n useEffect(() => {\n if (loadingForm) {\n api.buckets\n .getBucketRetentionConfig(bucketName)\n .then((res) => {\n setLoadingForm(false);\n\n // We set default values\n setRetentionMode(res.data.mode);\n setRetentionValidity(res.data.validity);\n setRetentionUnit(res.data.unit);\n })\n .catch(() => {\n setLoadingForm(false);\n });\n }\n }, [loadingForm, bucketName]);\n\n return (\n {\n closeModalAndRefresh();\n }}\n >\n {loadingForm ? (\n \n ) : (\n \n )}\n \n );\n};\n\nexport default SetRetentionConfig;\n"],"names":["_ref","open","bucketName","closeModalAndRefresh","dispatch","useAppDispatch","_useState","useState","_useState2","_slicedToArray","addLoading","setAddLoading","_useState3","_useState4","loadingForm","setLoadingForm","_useState5","ObjectRetentionMode","Compliance","_useState6","retentionMode","setRetentionMode","_useState7","ObjectRetentionUnit","Days","_useState8","retentionUnit","setRetentionUnit","_useState9","_useState10","retentionValidity","setRetentionValidity","_useState11","_useState12","valid","setValid","useEffect","Number","isNaN","api","buckets","getBucketRetentionConfig","then","res","data","mode","validity","unit","catch","_jsx","ModalWrapper","title","modalOpen","onClose","children","Loader","style","width","height","noValidate","autoComplete","onSubmit","e","preventDefault","setBucketRetentionConfig","err","setModalErrorSnackMessage","errorToHandler","error","_jsxs","FormLayout","containerPadding","withBorders","RadioGroup","currentValue","id","name","label","onChange","target","value","selectorOptions","InputBox","type","valueAsNumber","String","required","min","Grid","item","xs","sx","modalStyleUtils","modalButtonBar","Button","variant","disabled","onClick","color","ProgressBar"],"sourceRoot":""}
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1604.7bfdfe29.chunk.js b/portal-ui/build/static/js/1604.7bfdfe29.chunk.js
new file mode 100644
index 0000000000..2025e91ce6
--- /dev/null
+++ b/portal-ui/build/static/js/1604.7bfdfe29.chunk.js
@@ -0,0 +1,2 @@
+"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1604],{1604:function(e,t,n){n.r(t);var i=n(29439),a=n(72791),o=n(29945),l=n(31776),r=n(66315),c=n(82342),s=n(23814),u=n(87995),d=n(44690),m=n(56028),b=n(80184);t.default=function(e){var t=e.open,n=e.bucketName,h=e.closeModalAndRefresh,p=(0,d.TL)(),f=(0,a.useState)(!1),g=(0,i.Z)(f,2),j=g[0],v=g[1],x=(0,a.useState)(!0),k=(0,i.Z)(x,2),y=k[0],C=k[1],S=(0,a.useState)(r.oO.Compliance),R=(0,i.Z)(S,2),Z=R[0],O=R[1],_=(0,a.useState)(r.zR.Days),w=(0,i.Z)(_,2),z=w[0],N=w[1],B=(0,a.useState)(1),D=(0,i.Z)(B,2),E=D[0],V=D[1],A=(0,a.useState)(!1),M=(0,i.Z)(A,2),T=M[0],G=M[1];return(0,a.useEffect)((function(){Number.isNaN(E)||(E||1)<1?G(!1):G(!0)}),[E]),(0,a.useEffect)((function(){y&&l.h.buckets.getBucketRetentionConfig(n).then((function(e){C(!1),O(e.data.mode),V(e.data.validity),N(e.data.unit)})).catch((function(){C(!1)}))}),[y,n]),(0,b.jsx)(m.Z,{title:"Set Retention Configuration",modalOpen:t,onClose:function(){h()},children:y?(0,b.jsx)(o.aNw,{style:{width:16,height:16}}):(0,b.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),j||(v(!0),l.h.buckets.setBucketRetentionConfig(n,{mode:Z||r.oO.Compliance,unit:z||r.zR.Days,validity:E||1}).then((function(){v(!1),h()})).catch((function(e){v(!1),p((0,u.zb)((0,c.g)(e.error)))})))},children:(0,b.jsxs)(o.ltY,{containerPadding:!1,withBorders:!1,children:[(0,b.jsx)(o.Eep,{currentValue:Z,id:"retention_mode",name:"retention_mode",label:"Retention Mode",onChange:function(e){O(e.target.value)},selectorOptions:[{value:"compliance",label:"Compliance"},{value:"governance",label:"Governance"}],helpTip:(0,b.jsxs)(a.Fragment,{children:[" ",(0,b.jsx)("a",{href:"https://min.io/docs/minio/macos/administration/object-management/object-retention.html#minio-object-locking-compliance",target:"blank",children:"Compliance"})," ","lock protects Objects from write operations by all users, including the MinIO root user.",(0,b.jsx)("br",{}),(0,b.jsx)("br",{}),(0,b.jsx)("a",{href:"https://min.io/docs/minio/macos/administration/object-management/object-retention.html#minio-object-locking-governance",target:"blank",children:"Governance"})," ","lock protects Objects from write operations by non-privileged users."]}),helpTipPlacement:"right"}),(0,b.jsx)(o.Eep,{currentValue:z,id:"retention_unit",name:"retention_unit",label:"Retention Unit",onChange:function(e){N(e.target.value)},selectorOptions:[{value:"days",label:"Days"},{value:"years",label:"Years"}]}),(0,b.jsx)(o.Wzg,{type:"number",id:"retention_validity",name:"retention_validity",onChange:function(e){V(e.target.valueAsNumber)},label:"Retention Validity",value:String(E),required:!0,min:"1"}),(0,b.jsxs)(o.rjZ,{item:!0,xs:12,sx:s.ID.modalButtonBar,children:[(0,b.jsx)(o.zxk,{id:"cancel",type:"button",variant:"regular",disabled:j,onClick:function(){h()},label:"Cancel"}),(0,b.jsx)(o.zxk,{id:"set",type:"submit",variant:"callAction",color:"primary",disabled:j||!T,label:"Set"})]}),j&&(0,b.jsx)(o.rjZ,{item:!0,xs:12,children:(0,b.jsx)(o.kod,{})})]})})})}}}]);
+//# sourceMappingURL=1604.7bfdfe29.chunk.js.map
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1604.7bfdfe29.chunk.js.map b/portal-ui/build/static/js/1604.7bfdfe29.chunk.js.map
new file mode 100644
index 0000000000..73a56e5b34
--- /dev/null
+++ b/portal-ui/build/static/js/1604.7bfdfe29.chunk.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"static/js/1604.7bfdfe29.chunk.js","mappings":"gPA6NA,UApL2B,SAAHA,GAIS,IAH/BC,EAAID,EAAJC,KACAC,EAAUF,EAAVE,WACAC,EAAoBH,EAApBG,qBAEMC,GAAWC,EAAAA,EAAAA,MACjBC,GAAoCC,EAAAA,EAAAA,WAAkB,GAAMC,GAAAC,EAAAA,EAAAA,GAAAH,EAAA,GAArDI,EAAUF,EAAA,GAAEG,EAAaH,EAAA,GAChCI,GAAsCL,EAAAA,EAAAA,WAAkB,GAAKM,GAAAJ,EAAAA,EAAAA,GAAAG,EAAA,GAAtDE,EAAWD,EAAA,GAAEE,EAAcF,EAAA,GAClCG,GAA0CT,EAAAA,EAAAA,UAExCU,EAAAA,GAAoBC,YAAWC,GAAAV,EAAAA,EAAAA,GAAAO,EAAA,GAF1BI,EAAaD,EAAA,GAAEE,EAAgBF,EAAA,GAGtCG,GAA0Cf,EAAAA,EAAAA,UAExCgB,EAAAA,GAAoBC,MAAKC,GAAAhB,EAAAA,EAAAA,GAAAa,EAAA,GAFpBI,EAAaD,EAAA,GAAEE,EAAgBF,EAAA,GAGtCG,GAAkDrB,EAAAA,EAAAA,UAEhD,GAAEsB,GAAApB,EAAAA,EAAAA,GAAAmB,E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A0E,MAAO,YAET5B,EAAAA,EAAAA,KAACiD,EAAAA,IAAM,CACLvB,GAAI,MACJY,KAAK,SACLY,QAAQ,aACRG,MAAM,UACNF,SAAU1F,IAAewB,EACzB2C,MAAO,WAGVnE,IACCuC,EAAAA,EAAAA,KAAC2C,EAAAA,IAAI,CAACC,MAAI,EAACC,GAAI,GAAGxC,UAChBL,EAAAA,EAAAA,KAACsD,EAAAA,IAAW,YAQ5B,C","sources":["screens/Console/Buckets/BucketDetails/SetRetentionConfig.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState, Fragment } from \"react\";\nimport {\n Button,\n Loader,\n Grid,\n FormLayout,\n RadioGroup,\n InputBox,\n ProgressBar,\n} from \"mds\";\nimport { api } from \"api\";\nimport { ObjectRetentionMode, ObjectRetentionUnit } from \"api/consoleApi\";\nimport { errorToHandler } from \"api/errors\";\n\nimport { modalStyleUtils } from \"../../Common/FormComponents/common/styleLibrary\";\nimport { setModalErrorSnackMessage } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport ModalWrapper from \"../../Common/ModalWrapper/ModalWrapper\";\n\ninterface ISetRetentionConfigProps {\n open: boolean;\n bucketName: string;\n closeModalAndRefresh: () => void;\n}\n\nconst SetRetentionConfig = ({\n open,\n bucketName,\n closeModalAndRefresh,\n}: ISetRetentionConfigProps) => {\n const dispatch = useAppDispatch();\n const [addLoading, setAddLoading] = useState(false);\n const [loadingForm, setLoadingForm] = useState(true);\n const [retentionMode, setRetentionMode] = useState<\n ObjectRetentionMode | undefined\n >(ObjectRetentionMode.Compliance);\n const [retentionUnit, setRetentionUnit] = useState<\n ObjectRetentionUnit | undefined\n >(ObjectRetentionUnit.Days);\n const [retentionValidity, setRetentionValidity] = useState<\n number | undefined\n >(1);\n const [valid, setValid] = useState(false);\n\n const setRetention = (event: React.FormEvent) => {\n event.preventDefault();\n if (addLoading) {\n return;\n }\n setAddLoading(true);\n api.buckets\n .setBucketRetentionConfig(bucketName, {\n mode: retentionMode || ObjectRetentionMode.Compliance,\n unit: retentionUnit || ObjectRetentionUnit.Days,\n validity: retentionValidity || 1,\n })\n .then(() => {\n setAddLoading(false);\n closeModalAndRefresh();\n })\n .catch((err) => {\n setAddLoading(false);\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n });\n };\n\n useEffect(() => {\n if (Number.isNaN(retentionValidity) || (retentionValidity || 1) < 1) {\n setValid(false);\n return;\n }\n setValid(true);\n }, [retentionValidity]);\n\n useEffect(() => {\n if (loadingForm) {\n api.buckets\n .getBucketRetentionConfig(bucketName)\n .then((res) => {\n setLoadingForm(false);\n\n // We set default values\n setRetentionMode(res.data.mode);\n setRetentionValidity(res.data.validity);\n setRetentionUnit(res.data.unit);\n })\n .catch(() => {\n setLoadingForm(false);\n });\n }\n }, [loadingForm, bucketName]);\n\n return (\n {\n closeModalAndRefresh();\n }}\n >\n {loadingForm ? (\n \n ) : (\n \n )}\n \n );\n};\n\nexport default SetRetentionConfig;\n"],"names":["_ref","open","bucketName","closeModalAndRefresh","dispatch","useAppDispatch","_useState","useState","_useState2","_slicedToArray","addLoading","setAddLoading","_useState3","_useState4","loadingForm","setLoadingForm","_useState5","ObjectRetentionMode","Compliance","_useState6","retentionMode","setRetentionMode","_useState7","ObjectRetentionUnit","Days","_useState8","retentionUnit","setRetentionUnit","_useState9","_useState10","retentionValidity","setRetentionValidity","_useState11","_useState12","valid","setValid","useEffect","Number","isNaN","api","buckets","getBucketRetentionConfig","then","res","data","mode","validity","unit","catch","_jsx","ModalWrapper","title","modalOpen","onClose","children","Loader","style","width","height","noValidate","autoComplete","onSubmit","e","preventDefault","setBucketRetentionConfig","err","setModalErrorSnackMessage","errorToHandler","error","_jsxs","FormLayout","containerPadding","withBorders","RadioGroup","currentValue","id","name","label","onChange","target","value","selectorOptions","helpTip","Fragment","href","helpTipPlacement","InputBox","type","valueAsNumber","String","required","min","Grid","item","xs","sx","modalStyleUtils","modalButtonBar","Button","variant","disabled","onClick","color","ProgressBar"],"sourceRoot":""}
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1690.48a846c2.chunk.js b/portal-ui/build/static/js/1690.48a846c2.chunk.js
new file mode 100644
index 0000000000..caa860c283
--- /dev/null
+++ b/portal-ui/build/static/js/1690.48a846c2.chunk.js
@@ -0,0 +1,2 @@
+"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1690],{90767:function(e,n,t){var i=t(29439),r=t(72791),o=t(31776),s=t(82342),a=t(23508),l=t(29945),c=t(87995),u=t(44690),d=t(80184);n.Z=function(e){var n=e.configurationName,t=e.closeResetModalAndRefresh,p=e.resetOpen,x=(0,u.TL)(),f=(0,r.useState)(!1),h=(0,i.Z)(f,2),g=h[0],m=h[1];(0,r.useEffect)((function(){g&&o.h.configs.resetConfig(n).then((function(){m(!1),t(!0)})).catch((function(e){m(!1),x((0,c.Ih)((0,s.g)(e.error)))}))}),[t,n,g,x]);return(0,d.jsx)(a.Z,{title:"Restore Defaults",confirmText:"Yes, Reset Configuration",isOpen:p,titleIcon:(0,d.jsx)(l.NvT,{}),isLoading:g,onConfirm:function(){m(!0)},onClose:function(){t(!1)},confirmationContent:(0,d.jsxs)(r.Fragment,{children:[g&&(0,d.jsx)(l.kod,{}),(0,d.jsxs)(r.Fragment,{children:["Are you sure you want to restore these configurations to default values?",(0,d.jsx)("br",{}),(0,d.jsx)("b",{style:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},children:"Please note that this may cause your system to not be accessible"})]})]})})}},37099:function(e,n,t){var i=t(72791),r=t(29945),o=t(80184),s=function(e){var n=e.icon,t=e.description;return(0,o.jsxs)(r.xuv,{sx:{display:"flex","& .min-icon":{marginRight:"10px",height:"23px",width:"23px",marginBottom:"10px"}},children:[n," ",(0,o.jsx)("div",{style:{fontSize:"14px",fontStyle:"italic",color:"#5E5E5E"},children:t})]})};n.Z=function(e){var n=e.helpText,t=e.docLink,a=e.docText,l=e.contents;return(0,o.jsxs)(r.xuv,{sx:{flex:1,border:"1px solid #eaeaea",borderRadius:"2px",display:"flex",flexFlow:"column",padding:"20px"},children:[(0,o.jsxs)(r.xuv,{sx:{fontSize:"16px",fontWeight:600,display:"flex",alignItems:"center",marginBottom:"16px",paddingBottom:"20px","& .min-icon":{height:"21px",width:"21px",marginRight:"15px"}},children:[(0,o.jsx)(r.M9A,{}),(0,o.jsx)("div",{children:n})]}),(0,o.jsxs)(r.xuv,{sx:{fontSize:"14px",marginBottom:"15px"},children:[l.map((function(e,n){return(0,o.jsxs)(i.Fragment,{children:[e.icon&&(0,o.jsx)(r.xuv,{sx:{paddingBottom:"20px"},children:(0,o.jsx)(s,{icon:e.icon,description:e.iconDescription})}),(0,o.jsx)(r.xuv,{sx:{paddingBottom:"20px"},children:e.text})]},"feature-item-".concat(n))})),(0,o.jsx)(r.xuv,{sx:{paddingBottom:"20px"},children:(0,o.jsx)("a",{href:t,target:"_blank",rel:"noopener",children:a})})]})]})}},11690:function(e,n,t){t.r(n),t.d(n,{default:function(){return P}});var i=t(4942),r=t(74165),o=t(15861),s=t(1413),a=t(29439),l=t(72791),c=t(29945),u=t(31776),d=t(82342),p=t(44690),x=t(87995),f=t(79979),h=t(47974),g=t(37099),m=t(93433),v=t(78687),y=t(99779),j=t(80184),b=function(e){var n=e.name;return(0,j.jsxs)("h4",{children:[(0,j.jsx)(c.ZyT,{style:{transform:"rotateZ(90deg)"}}),n]})},k=function(e){var n=e.blockName,t=e.results;return(0,j.jsxs)(l.Fragment,{children:[(0,j.jsxs)("strong",{children:[n,":"]}),(0,j.jsx)("ul",{children:t.map((function(e,t){return(0,j.jsx)("li",{children:e},"policy-".concat(n,"-").concat(t))}))})]})},C=function(e){var n,t,i,r,o,s,a=e.entityName,u=e.results,d=0;switch(a){case"Group":d=(null===(n=u.groups)||void 0===n?void 0:n.length)||0;break;case"Policy":d=(null===(t=u.policies)||void 0===t?void 0:t.length)||0;break;case"User":d=(null===(i=u.users)||void 0===i?void 0:i.length)||0}return(0,j.jsxs)(c.xuv,{className:"resultElement",sx:{marginTop:50,"&:first-of-type":{marginTop:0}},children:[(0,j.jsxs)(c.NZf,{separator:!0,sx:{fontSize:12},icon:(0,j.jsx)(c.anK,{style:{width:17,height:17}}),actions:(0,j.jsxs)(c.xuv,{sx:{fontSize:14},children:[(0,j.jsx)("strong",{children:d})," Entit",1===d?"y":"ies"," Found"]}),children:[a," Mappings"]}),(0,j.jsxs)(c.xuv,{className:"resultsList",sx:{h4:{borderBottom:"#e2e2e2 1px solid",padding:"12px 0",margin:0,marginBottom:15,display:"flex",alignItems:"center","& svg":{marginRight:10,fill:"#3C77A7"}}},children:["Group"===a&&(null===(r=u.groups)||void 0===r?void 0:r.map((function(e,n){return(0,j.jsxs)(l.Fragment,{children:[(0,j.jsx)(b,{name:e.group||""}),e.policies&&(0,j.jsx)(k,{blockName:"Policies",results:e.policies})]},"policy-res-".concat(n))}))),"User"===a&&(null===(o=u.users)||void 0===o?void 0:o.map((function(e,n){return(0,j.jsxs)(l.Fragment,{children:[(0,j.jsx)(b,{name:e.user||""}),e.policies&&(0,j.jsx)(k,{blockName:"Policies",results:e.policies})]},"users-res-".concat(n))}))),"Policy"===a&&(null===(s=u.policies)||void 0===s?void 0:s.map((function(e,n){return(0,j.jsxs)(l.Fragment,{children:[(0,j.jsx)(b,{name:e.policy||""}),e.groups&&(0,j.jsx)(k,{blockName:"Groups",results:e.groups}),e.users&&(0,j.jsx)(k,{blockName:"Users",results:e.users})]},"policy-map-".concat(n))})))]})]})},D=t(58400),Z=function(){var e=(0,p.TL)(),n=(0,l.useState)(!1),t=(0,a.Z)(n,2),i=t[0],r=t[1],o=(0,l.useState)([""]),s=(0,a.Z)(o,2),f=s[0],h=s[1],g=(0,l.useState)([""]),b=(0,a.Z)(g,2),k=b[0],Z=b[1],S=(0,l.useState)(null),_=(0,a.Z)(S,2),w=_[0],P=_[1],I=(0,v.v9)((function(e){return e.createUser.selectedPolicies}));return(0,j.jsxs)(c.xuv,{sx:{marginTop:15,paddingTop:0},children:[(0,j.jsxs)(c.rjZ,{container:!0,sx:{marginTop:5},children:[(0,j.jsxs)(c.rjZ,{item:!0,sm:12,md:6,lg:5,sx:{padding:10,paddingTop:0},children:[(0,j.jsx)(c.NZf,{children:"Query Filters"}),(0,j.jsxs)(c.xuv,{sx:{padding:"0 10px",display:"flex",flexDirection:"column",gap:40},children:[(0,j.jsxs)(c.xuv,{sx:{padding:"10px 26px"},withBorders:!0,children:[(0,j.jsx)(c.xuv,{sx:{display:"flex"},children:(0,j.jsx)("h4",{style:{margin:0,marginBottom:10,fontSize:14},children:"Users"})}),(0,j.jsx)(c.xuv,{sx:{overflowY:"auto",minHeight:50,maxHeight:250,"& > div > div":{width:"100%"}},children:f.map((function(e,n){return(0,j.jsx)(c.Wzg,{id:"search-user-".concat(n),value:e,onChange:function(e){var t=(0,m.Z)(f);t[n]=e.target.value,h(t)},overlayIcon:f.length===n+1?(0,j.jsx)(c.dtP,{}):(0,j.jsx)(c.HFL,{}),overlayAction:function(){!function(e,n){if(e){var t=[].concat((0,m.Z)(f),[""]);h(t)}else{var i=f.filter((function(e,t){return t!==n}));h(i)}}(f.length===n+1,n)}},"search-user-".concat(n))}))})]}),(0,j.jsxs)(c.xuv,{sx:{padding:"10px 26px"},withBorders:!0,children:[(0,j.jsx)("h4",{style:{margin:0,marginBottom:10,fontSize:14},children:"Groups"}),(0,j.jsx)(c.xuv,{sx:{overflowY:"auto",minHeight:50,maxHeight:"calc(100vh - 340px)","& > div > div":{width:"100%"}},children:k.map((function(e,n){return(0,j.jsx)(c.Wzg,{id:"search-group-".concat(n),value:e,onChange:function(e){var t=(0,m.Z)(k);t[n]=e.target.value,Z(t)},overlayIcon:k.length===n+1?(0,j.jsx)(c.dtP,{}):(0,j.jsx)(c.HFL,{}),overlayAction:function(){!function(e,n){if(e){var t=[].concat((0,m.Z)(k),[""]);Z(t)}else{var i=k.filter((function(e,t){return t!==n}));Z(i)}}(k.length===n+1,n)}},"search-group-".concat(n))}))})]}),(0,j.jsxs)(c.xuv,{sx:{padding:"10px 26px"},withBorders:!0,children:[(0,j.jsx)("h4",{style:{margin:0,marginBottom:10,fontSize:14},children:"Policies"}),(0,j.jsx)(c.xuv,{sx:{minHeight:265,maxHeight:"calc(100vh - 740px)"},children:(0,j.jsx)(D.Z,{selectedPolicy:I,noTitle:!0})})]})]})]}),(0,j.jsx)(c.rjZ,{item:!0,sm:12,md:6,lg:7,sx:{padding:10,paddingTop:0,display:"flex",flexDirection:"column"},children:i?(0,j.jsx)(c.xuv,{sx:{textAlign:"center"},children:(0,j.jsx)(c.aNw,{})}):(0,j.jsxs)(l.Fragment,{children:[(0,j.jsx)(c.NZf,{actions:(0,j.jsx)(c.xuv,{sx:{display:"flex",flexDirection:"row",alignItems:"center",fontSize:14},children:null!==w&&void 0!==w&&w.timestamp?(0,j.jsxs)(l.Fragment,{children:[(0,j.jsx)(c.wZd,{style:{width:14,height:14,marginRight:5,fill:"#BEBFBF"}}),y.ou.fromISO(w.timestamp).toFormat("D HH:mm:ss")]}):""}),children:"Query Results"}),w?(0,j.jsxs)(c.xuv,{sx:{backgroundColor:"#FBFAFA",padding:"8px 22px",flexGrow:1,overflowY:"auto"},children:[!w.groups&&!w.users&&!w.policies&&(0,j.jsx)(c.xuv,{sx:{textAlign:"center"},children:(0,j.jsx)("h4",{children:"No Results Available"})}),!!w.groups&&(0,j.jsx)(C,{results:w,entityName:"Group"}),!!w.users&&(0,j.jsx)(C,{results:w,entityName:"User"}),!!w.policies&&(0,j.jsx)(C,{results:w,entityName:"Policy"})]}):(0,j.jsx)(c.xuv,{sx:{textAlign:"center"},children:"No query results yet"})]})})]}),(0,j.jsx)(c.rjZ,{container:!0,children:(0,j.jsx)(c.rjZ,{item:!0,xs:12,sx:{display:"flex",justifyContent:"flex-start",marginTop:45,padding:"0 20px"},children:(0,j.jsx)(c.zxk,{id:"search-entity",type:"button",variant:"callAction",onClick:function(){r(!0);var n={},t=I.filter((function(e){return""!==e})),i=f.filter((function(e){return""!==e})),o=k.filter((function(e){return""!==e}));t.length>0&&(n.policies=t),i.length>0&&(n.users=i),o.length>0&&(n.groups=o),u.h.ldapEntities.getLdapEntities(n).then((function(e){P(e.data),r(!1)})).catch((function(n){e((0,x.Ih)((0,d.g)(n.error))),r(!1)}))},icon:(0,j.jsx)(c.W1M,{}),children:"Search"})})})]})},S=t(90767),_=t(99670),w=["server_addr","lookup_bind_dn","user_dn_search_base_dn","user_dn_search_filter"],P=function(){var e=(0,p.TL)(),n=f.iR,t=(0,l.useState)(!0),m=(0,a.Z)(t,2),v=m[0],y=m[1],b=(0,l.useState)(!1),k=(0,a.Z)(b,2),C=k[0],D=k[1],P=(0,l.useState)(!1),I=(0,a.Z)(P,2),A=I[0],N=I[1],E=(0,l.useState)({}),O=(0,a.Z)(E,2),L=O[0],F=O[1],q=(0,l.useState)({}),B=(0,a.Z)(q,2),T=B[0],R=B[1],z=(0,l.useState)(void 0),U=(0,a.Z)(z,2),M=U[0],K=U[1],H=(0,l.useState)(!1),G=(0,a.Z)(H,2),Y=G[0],W=G[1],Q=(0,l.useState)(!1),X=(0,a.Z)(Q,2),V=X[0],J=X[1],$=(0,l.useState)("configuration"),ee=(0,a.Z)($,2),ne=ee[0],te=ee[1],ie=(0,l.useState)(!1),re=(0,a.Z)(ie,2),oe=re[0],se=re[1],ae=function(){Y&&M&&le(M),W(!Y)},le=function(e){var n={},t={};if(e&&e.length>0){var i=e.find((function(e){return"enable"===e.key})),r=0,o=0;e.forEach((function(e){e.env_override?(n[e.key]=e.env_override.value,t[e.key]=e.env_override.name):n[e.key]=e.value,w.includes(e.key)&&(e.value&&""!==e.value&&"off"!==e.value||e.env_override&&""!==e.env_override.value&&"off"!==e.env_override.value)&&r++,w.includes(e.key)&&e.env_override&&o++}));var s=0!==r;s&&(i&&"off"!==i.value||!i)?D(!0):D(!1),0!==o&&se(!0),N(s)}R(t),F(n)};(0,l.useEffect)((function(){v&&u.h.configs.configInfo("identity_ldap").then((function(e){e.data.length>0&&(K(e.data[0].key_values),le(e.data[0].key_values||[])),y(!1)})).catch((function(n){y(!1),e((0,x.Ih)((0,d.g)(n.error)))}))}),[e,v]);var ce=function(){var n=(0,o.Z)((0,r.Z)().mark((function n(t){return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:J(!1),t&&(e((0,x.cN)(t)),K(void 0),F({}),D(!1),N(!1),W(!1));case 2:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}();return(0,l.useEffect)((function(){e((0,x.Sc)("LDAP"))}),[]),(0,j.jsxs)(c.rjZ,{item:!0,xs:12,children:[V&&(0,j.jsx)(S.Z,{configurationName:"identity_ldap",closeResetModalAndRefresh:ce,resetOpen:V}),(0,j.jsx)(h.Z,{label:"LDAP",actions:(0,j.jsx)(_.Z,{})}),(0,j.jsx)(c.Xgh,{variant:"constrained",children:(0,j.jsx)(c.mQc,{horizontal:!0,options:[{tabConfig:{id:"configuration",label:"Configuration"},content:(0,j.jsxs)(l.Fragment,{children:[(0,j.jsx)(c.UHn,{icon:null,title:Y?"Edit Configuration":"",actions:Y?null:(0,j.jsxs)(l.Fragment,{children:[(0,j.jsx)(c.ua7,{tooltip:oe?"Configuration cannot be edited in this module as LDAP environment variables are set for this MinIO instance.":"",children:(0,j.jsx)(c.zxk,{id:"edit",type:"button",variant:"callAction",icon:(0,j.jsx)(c.dY8,{}),onClick:ae,label:"Edit Configuration",disabled:v||oe})}),A&&(0,j.jsx)(c.ua7,{tooltip:oe?"Configuration cannot be disabled / enabled in this module as LDAP environment variables are set for this MinIO instance.":"",children:(0,j.jsx)(c.zxk,{id:"is-configuration-enabled",onClick:function(){return function(n){var t={key_values:[{key:"enable",value:n?"on":"off"}]};u.h.configs.setConfig("identity_ldap",t).then((function(n){D(!C),e((0,x.cN)(n.data.restart||!1)),n.data.restart||e((0,x.y1)("Configuration saved successfully"))})).catch((function(n){e((0,x.Ih)((0,d.g)(n.error)))}))}(!C)},label:C?"Disable LDAP":"Enable LDAP",variant:C?"secondary":"regular",disabled:oe})}),(0,j.jsx)(c.zxk,{id:"refresh-idp-config",onClick:function(){return y(!0)},label:"Refresh",icon:(0,j.jsx)(c.DuK,{})})]})}),(0,j.jsx)("br",{}),v?(0,j.jsx)(c.xuv,{sx:{display:"flex",justifyContent:"center",marginTop:10},children:(0,j.jsx)(c.aNw,{})}):(0,j.jsx)(l.Fragment,{children:Y?(0,j.jsx)(l.Fragment,{children:(0,j.jsxs)(c.ltY,{helpBox:(0,j.jsx)(g.Z,{helpText:"Learn more about LDAP Configurations",contents:f.Si,docLink:"https://min.io/docs/minio/linux/operations/external-iam.html?ref=con#minio-external-iam-ad-ldap",docText:"Learn more about LDAP Configurations"}),children:[Y&&A?(0,j.jsx)(c.xuv,{sx:{marginBottom:15},children:(0,j.jsx)(c.KfX,{title:(0,j.jsx)(c.xuv,{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1},children:"Lookup Bind Password must be re-entered to change LDAP configurations"}),iconComponent:(0,j.jsx)(c.e6P,{}),help:null})}):null,Object.entries(n).map((function(e){var n=(0,a.Z)(e,2);return function(e,n){return"toggle"===n.type?(0,j.jsx)(c.rsf,{indicatorLabels:["Enabled","Disabled"],checked:"on"===L[e],value:"is-field-enabled",id:"is-field-enabled",name:"is-field-enabled",label:n.label,tooltip:n.tooltip,onChange:function(n){return F((0,s.Z)((0,s.Z)({},L),{},(0,i.Z)({},e,n.target.checked?"on":"off")))},description:"",disabled:!Y},e):(0,j.jsx)(c.Wzg,{id:e,required:n.required,name:e,label:n.label,tooltip:n.tooltip,error:n.hasError(L[e],Y),value:L[e]?L[e]:"",onChange:function(n){return F((0,s.Z)((0,s.Z)({},L),{},(0,i.Z)({},e,n.target.value)))},placeholder:n.placeholder,disabled:!Y,type:n.type},e)}(n[0],n[1])})),(0,j.jsxs)(c.xuv,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",marginTop:"20px",gap:"15px"},children:[Y&&A&&(0,j.jsx)(c.zxk,{id:"clear",type:"button",variant:"secondary",onClick:function(){return J(!0)},label:"Reset Configuration"}),(0,j.jsx)(c.zxk,{id:"cancel",type:"button",variant:"regular",onClick:ae,label:"Cancel"}),(0,j.jsx)(c.zxk,{id:"save-key",type:"submit",variant:"callAction",color:"primary",disabled:v||!function(){for(var e=0,t=Object.entries(n);e0?(0,f.jsxs)(o.Fragment,{children:[(0,f.jsx)(s.rjZ,{item:!0,xs:12,className:"inputItem",children:(0,f.jsx)(l.Z,{placeholder:"Start typing to search for a Policy",onChange:function(e){_(e)},value:S,label:t?"":"Assign Policies"})}),(0,f.jsx)(s.wQF,{columns:[{label:"Policy",elementKey:"name"}],onSelect:function(e){var n=e.target,t=n.value,r=n.checked,o=(0,i.Z)(w);r?o.push(t):o=o.filter((function(e){return e!==t})),o=o.filter((function(e){return""!==e})),h((0,d.ue)(o))},selectedItems:w,isLoading:k,records:I,entityName:"Policies",idField:"name",customPaperHeight:"200px"})]}):(0,f.jsx)(s.xuv,{sx:{textAlign:"center",padding:"10px 0"},children:"No Policies Available"})]})}},21639:function(e,n,t){t.d(n,{KE:function(){return s},LQ:function(){return i},V2:function(){return o},g4:function(){return r}});var i=function(e,n){if(e.accessKey&&n.accessKey){if(e.accessKey>n.accessKey)return 1;if(e.accessKeyn.name?1:e.namen?1:en.policy?1:e.policy.\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport ConfirmDialog from \"../../Common/ModalWrapper/ConfirmDialog\";\n\nimport { ConfirmDeleteIcon, ProgressBar } from \"mds\";\nimport { setErrorSnackMessage } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\n\ninterface IResetConfiguration {\n configurationName: string;\n closeResetModalAndRefresh: (reloadConfiguration: boolean) => void;\n resetOpen: boolean;\n}\n\nconst ResetConfigurationModal = ({\n configurationName,\n closeResetModalAndRefresh,\n resetOpen,\n}: IResetConfiguration) => {\n const dispatch = useAppDispatch();\n const [resetLoading, setResetLoading] = useState(false);\n\n useEffect(() => {\n if (resetLoading) {\n api.configs\n .resetConfig(configurationName)\n .then(() => {\n setResetLoading(false);\n closeResetModalAndRefresh(true);\n })\n .catch((err) => {\n setResetLoading(false);\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n });\n }\n }, [closeResetModalAndRefresh, configurationName, resetLoading, dispatch]);\n\n const resetConfiguration = () => {\n setResetLoading(true);\n };\n\n return (\n }\n isLoading={resetLoading}\n onConfirm={resetConfiguration}\n onClose={() => {\n closeResetModalAndRefresh(false);\n }}\n confirmationContent={\n \n {resetLoading && }\n \n Are you sure you want to restore these configurations to default\n values?\n \n \n Please note that this may cause your system to not be accessible\n \n \n \n }\n />\n );\n};\n\nexport default ResetConfigurationModal;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { HelpIconFilled, Box } from \"mds\";\n\ninterface IContent {\n icon: React.ReactNode;\n text: string;\n iconDescription: string;\n}\n\ninterface IAddIDPConfigurationHelpBoxProps {\n helpText: string;\n docLink: string;\n docText: string;\n contents: IContent[];\n}\n\nconst FeatureItem = ({\n icon,\n description,\n}: {\n icon: any;\n description: string;\n}) => {\n return (\n \n {icon}{\" \"}\n