1"use strict";(self.webpackChunkzimvie_adobe_frontend=self.webpackChunkzimvie_adobe_frontend||[]).push([[4012],{98810:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(37948),i=n(21337),l=n(51787),r=n(32143),a=n(85865),d=n(44978),s=n(24858),c=n(98983),u=n(50227),p=n(70579);const m={PaperProps:{style:{maxHeight:224,width:250}}},v=e=>{var t;let{options:n=[],defaultValue:v="",name:h,label:f,values:x,handleChange:g,error:y,helperText:A,disabled:C,required:b=!1,countryField:S=!1,valueData:j=!1,placeholder:M=(0,d.t)("form.select"),forCustomField:I=!1}=e;const{control:k,formState:{errors:w},clearErrors:T}=(0,s.xW)(),E=null!==y&&void 0!==y?y:!!w[h],z=A||(null===(t=w[h])||void 0===t?void 0:t.message)||"";return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(c.U,{htmlFor:h,children:[f,b&&(0,p.jsx)("span",{className:"required",children:"*"})]}),(0,p.jsx)(u.bv,{fullWidth:!0,error:E,children:(0,p.jsx)(s.xI,{name:h,control:k,defaultValue:v,render:e=>{let{field:t}=e;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(u.Iu,{id:`${h}-select`,...t,value:x||(null===t||void 0===t?void 0:t.value)||v,onChange:e=>((e,t)=>{const n=e.target.value;t.onChange(e),n&&T(h),g&&g(e)})(e,t),displayEmpty:!0,MenuProps:m,IconComponent:i.A,sx:{"& .MuiSelect-icon":{fontSize:"2rem"}},InputProps:{endAdornment:E&&(0,p.jsx)(l.A,{position:"end",children:(0,p.jsx)(o.A,{sx:{color:"red"}})})},disabled:C,children:[(0,p.jsx)(r.A,{value:"",disabled:!S,children:(0,p.jsx)(a.A,{color:S?"inherit":"textSecondary",sx:{fontSize:"14px"},children:M})}),null===n||void 0===n?void 0:n.map((e=>{let{id:t,label:n,value:o,name:i}=e;const l=I?i:(0,d.t)(`${i}`),a=n||l;return(0,p.jsx)(r.A,{value:j?o:n||l,sx:{fontSize:"14px"},children:a},t)}))]}),(0,p.jsx)(u.dR,{children:z})]})}})})]})}},50227:(e,t,n)=>{n.d(t,{Iu:()=>u,Ul:()=>s,bv:()=>c,dR:()=>p,ph:()=>m});var o=n(45903),i=n(18356),l=n(53193),r=n(72221),a=n(81673),d=n(4598);const s=(0,o.A)(i.A)` 2 font-size: 1rem; 3 color: #333; 4 margin-bottom: 8px; 5 text-align: left; 6 & .required { 7 color: #d32f2f; 8 } 9`,c=(0,o.A)(l.A)` 10 margin-bottom: 16px; 11 text-align: left; 12 .MuiInputBase-root { 13 background: #fff; 14 padding: 15px 0px; 15 border-radius: 14px; 16 17 .MuiList-root .MuiMenuItem-root { 18 font=size: 14px; 19 } 20 } 21`,u=(0,o.A)(r.A)` 22 height: 40px; 23 24 & .MuiOutlinedInput-root { 25 height: 40px; 26 27 & fieldset { 28 border-color: #ccc; 29 } 30 &:hover fieldset { 31 border-color: #888; 32 } 33 &.Mui-focused fieldset { 34 border-color: #1976d2; 35 } 36 & .MuiMenuItem-root { 37 text-align: left; 38 } 39 } 40 & .MuiSelect-select { 41 border-radius: 10px; // Adjust the border-radius here 42 } 43 & .MuiOutlinedInput-notchedOutline { 44 border-radius: 10px; // Ensure the border-radius is applied to the dropdown outline 45 } 46`,p=(0,o.A)(a.A)` 47 // color: #ff0000; 48 color: #d32f2f; 49 margin-left: 0px; 50 font-size: 14px; 51 font-family: 'Soleil', sans-serif; 52 .Mui-error { 53 font-size: 14px; 54 font-family: 'Soleil', sans-serif; 55 color: #d60000; 56 } 57`,m=(0,o.A)(l.A)` 58 .MuiSvgIcon-root { 59 width: 28px; 60 height: 28px; 61 margin-left: -10px; 62 } 63 .MuiCheckbox-sizeMedium { 64 color: #758591; 65 } 66 .MuiCheckbox-sizeMedium.Mui-error { 67 color: #d32f2f; 68 } 69 .MuiCheckbox-sizeMedium.Mui-checked { 70 color: #a1ce5e; 71 } 72 .MuiSwitch-root .MuiSwitch-track { 73 background: white; 74 } 75 .MuiSwitch-root .MuiSwitch-thumb { 76 background: #a1ce5e; 77 } 78 .MuiList-root .MuiMenu-list .MuiMenuItem-root { 79 font-size: 14px; 80 } 81 .CustomCheckbox { 82 position: relative; 83 padding-left: 34px; 84 margin-top: 23px; 85 .MuiCheckbox-root { 86 position: absolute; 87 top: -13px; 88 left: 0; 89 } 90 } 91`;(0,o.A)(d.A)` 92 width: 69px; 93 .MuiSwitch-switchBase { 94 .Mui-checked { 95 .MuiSwitch-track { 96 background-color: #a1ce5e; 97 width: 75px; 98 height: 26px; 99 } 100 } 101 } 102 .MuiSwitch-thumb { 103 color: #fff; 104 width: 26px; 105 height: 26px; 106 margin-top: -4px; 107 } 108 .MuiSwitch-track { 109 background-color: #a1ce5e; 110 width: 75px; 111 height: 26px; 112 border-radius: 15px; 113 } 114 .css-byenzh-MuiButtonBase-root-MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track { 115 background-color: #758591; 116 } 117 .Mui-checked { 118 .MuiSwitch-track { 119 background-color: #a1ce5e; 120 width: 69px;
121 height: 26px; 122 border-radius: 15px; 123 } 124 .MuiSwitch-thumb { 125 color: #fff; 126 } 127 } 128`},98983:(e,t,n)=>{n.d(t,{U:()=>r,d:()=>a});var o=n(45903),i=n(18356),l=n(81673);const r=(0,o.A)(i.A)` 129 font-size: 1rem; 130 color: #333; 131 margin-bottom: 8px; 132 text-align: left; 133 134 & .required { 135 color: red; 136 } 137`,a=(0,o.A)(l.A)` 138 color: red; 139 margin-left: 0px; 140 font-size: 14px; 141`},34012:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Z});var o=n(96446),i=n(68903),l=n(85865),r=n(11906),a=n(58914),d=n(52299),s=n(53536);var c=n(42035),u=n(65043),p=n(24858),m=n(83003);const v=()=>{const e=(0,m.wA)(),{getManageFieldsStatus:t,addMetaDataFieldStatus:n,updateCustomFieldStatus:o,deleteMetaDataFieldStatus:i,reshuffleCustomFieldStatus:l,getManageFieldsData:r}=(0,m.d4)((e=>e.fieldManagement)),v=(0,p.mN)(),{reset:h,control:f}=v,x=(0,p.FH)({control:f}),{plannerEmail:g,division:y,meetingType:A,meetingTypeSelected:C,segment:b,segmentSelected:S,area:j,areaSelected:M,districtSelected:I,dentalEducationMethod:k,dentalClinicalCaseType:w}=x,T=(0,u.useMemo)((()=>null===b||void 0===b?void 0:b.map((e=>{return{...e,value:(t=e.value,(0,s.startCase)((0,s.toLower)(t))),key:(0,s.snakeCase)(e.key)};var t}))),[b]),{handleApiCall:E}=(e=>({handleApiCall:async(t,n,o,i)=>{try{const i=await e(t(n)).unwrap();e((0,d.fT)({type:"success",text:(0,c.m)(`apiSuccessMessages.${(null===i||void 0===i?void 0:i.messageKey)||o}`)}
141))}catch(l){const t=(null===l||void 0===l?void 0:l.messageKey)||(null===l||void 0===l?void 0:l.message)||i;e((0,d.fT)({type:"error",text:(0,c.l)(`apiErrorMessages.${t}`)}))}}}))(e),z=(0,u.useRef)(!1);(0,u.useEffect)((()=>{z.current||"idle"!==t||(z.current=!0,e((0,a.iC)()))}),[e,t]),(0,u.useEffect)((()=>{"succeeded"!==n&&"succeeded"!==o&&"succeeded"!==i&&"succeeded"!==l||e((0,a.iC)())}),[n,o,i,l,e]),(0,u.useEffect)((()=>{h({...r})}),[h,r]);return{methods:v,dropdownConfigs:[{name:"plannerEmail",title:"Planner Email",options:g,currentLevel:0,isEditable:!0},{name:"division",title:"Division",options:y,currentLevel:0,isEditable:!0},{name:"area",title:"Area",options:j,currentLevel:0,isEditable:!0},{name:"district",title:"District",options:(null===M||void 0===M?void 0:M.level0)||[],parentOptions:j,selectedParent:M,currentLevel:1,isEditable:!0},{name:"region",title:"Region",options:(null===I||void 0===I?void 0:I.level1)||[],parentOptions:(null===M||void 0===M?void 0:M.level0)||[],selectedParent:I,selectedGrandParent:M,currentLevel:2,isEditable:!0},{name:"meetingType",title:"Meeting Type",options:A,currentLevel:0,isEditable:!1},{name:"meetingSubType",title:"Meeting Sub Type",options:(null===C||void 0===C?void 0:C.level0)||[],parentOptions:A,selectedParent:C,extraDropdownOptions:[{value:"Online",name:"Online"},{value:"On-demand",name:"On-demand"},{value:"In-person",name:"In-person"}],currentLevel:1,isEditable:!1},{name:"segment",title:"Segment",options:T,currentLevel:0,isEditable:!0},{name:"product",title:"Product",options:(null===S||void 0===S?void 0:S.level0)||[],parentOptions:b,selectedParent:S,currentLevel:1,isEditable:!0},{name:"dentalEducationMethod",title:"Dental - Education Method",options:k,currentLevel:0,isEditable:!0},{name:"dentalClinicalCaseType",title:"Dental Clinical Case Type/Procedure",options:w,currentLevel:0,isEditable:!0}],handleAction:async(e,t,n,o,i)=>{const l="delete"===i?((e,t)=>{switch(e){case"plannerEmail":return{plannerEmailId:null===t||void 0===t?void 0:t.id};case"division":return{divisionId:null===t||void 0===t?void 0:t.id};case"area":return{areaId:null===t||void 0===t?void 0:t.id};case"district":return{districtId:null===t||void 0===t?void 0:t.id};case"region":return{regionId:null===t||void 0===t?void 0:t.id};case"meetingType":return{meetingTypeId:null===t||void 0===t?void 0:t.id};case"meetingSubType":return{meetingSubTypeId:null===t||void 0===t?void 0:t.id};case"segment":return{segmentId:null===t||void 0===t?void 0:t.id};case"product":return{productId:null===t||void 0===t?void 0:t.id};case"dentalEducationMethod":return{educationMethodId:null===t||void 0===t?void 0:t.id};case"dentalClinicalCaseType":return{dentalClinicalTypeProcedureId:null===t||void 0===t?void 0:t.id};default:return{}}})(e,t):((e,t,n,o,i)=>{const l={..."update"===i&&{[`${e}Id`]:null===t||void 0===t?void 0:t.id}},r={..."create"===i&&{areaId:null===o||void 0===o?void 0:o.id}};switch(e){case"plannerEmail":return{...l,plannerEmail:t.value};case"division":return{...l,divisionKey:(0,s.snakeCase)(null===t||void 0===t?void 0:t.value),division:null===t||void 0===t?void 0:t.value};case"area":return{...l,areaKey:(0,s.snakeCase)(null===t||void 0===t?void 0:t.value),area:t.value};case"district":return{areaId:null===n||void 0===n?void 0:n.id,...l,districtKey:(0,s.snakeCase)(null===t||void 0===t?void 0:t.value),district:t.value};case"region":return{...r,...l,districtId:null===n||void 0===n?void 0:n.id,regionKey:(0,s.snakeCase)(null===t||void 0===t?void 0:t.value),region:t.value};case"meetingType":return{...l,meetingTypeKey:(0,s.snakeCase)(null===t||void 0===t?void 0:t.value),meetingType:t.value};case"meetingSubType":return{meetingTypeId:null===n||void 0===n?void 0:n.id,...l,meetingSubTypeKey:(0,s.snakeCase)(null===t||void 0===t?void 0:t.value),meetingSubType:t.value,courseType:t.type};case"segment":return{...l,segmentKey:(0,s.snakeCase)(null===t||void 0===t?void 0:t.value),segment:t.value};case"product":return{segmentId:null===n||void 0===n?void 0:n.id,...l,productKey:(0,s.snakeCase)(null===t||void 0===t?void 0:t.value),product:t.value};case"dentalEducationMethod":return{...l,dentalEducationMethodKey:(0,s.snakeCase)(null===t||void 0===t?void 0:t.value),dentalEducationMethod:t.value};case"dentalClinicalCaseType":return{..."update"===i&&{dentalClinicalCaseTypeId:null===t||void 0===t?void 0:t.id},dentalClinicalCaseTypeKey:(0,s.snakeCase)(null===t||void 0===t?void 0:t.value),dentalClinicalCaseType:t.value};default:return{}}})(e,t,n,o,i),r={create:a.ow,update:a.Y4,delete:a.ih}[i];if(!r)return;const d="delete"===i?{payload:l}:l;await E(r,d)},handleShuffle:async(e,t,n)=>{const o=((e,t,n)=>{var o,i,l,r;switch(e){case"district":return{fromAreaId:null===t||void 0===t?void 0:t.fromCategory,districtIds:null===t||void 0===t?void 0:t.selectedItems,toAreaIds:null===t||void 0===t||null===(o=t.toCategory)||void 0===o?void 0:o.flatMap((e=>null===e||void 0===e?void 0:e.id))};case"region":return{areaId:null===n||void 0===n?void 0:n.id,fromDistrictId:null===t||void 0===t?void 0:t.fromCategory,regionIds:null===t||void 0===t?void 0:t.selectedItems,toDistrictIds:null===t||void 0===t||null===(i=t.toCategory)||void 0===i?void 0:i.flatMap((e=>null===e||void 0===e?void 0:e.id))};case"meetingSubType":return{fromMeetingTypeId:null===t||void 0===t?void 0:t.fromCategory,meetingSubTypeIds:null===t||void 0===t?void 0:t.selectedItems,toMeetingTypeIds:null===t||void 0===t||null===(l=t.toCategory)||void 0===l?void 0:l.flatMap((e=>null===e||void 0===e?void 0:e.id))};case"product":return{fromSegmentId:null===t||void 0===t?void 0:t.fromCategory,productIds:null===t||void 0===t?void 0:t.selectedItems,toSegmentIds:null===t||void 0===t||null===(r=t.toCategory)||void 0===r?void 0:r.flatMap((e=>null===e||void 0===e?void 0:e.id))};default:return{}}})(e,t,n);await E(a.lZ,o)}}};var h=n(44978),f=n(85502),x=n(95953),g=n(63336),y=n(37036);const A=e=>{let{isOpen:t,anchorRef:n,popperRef:o,onClose:i}=e;(0,u.useEffect)((()=>{const e=e=>{var l;if(!t)return;const r=(null===(l=e.composedPath)||void 0===l?void 0:l.call(e))||[],a=r.includes(o.current),d=r.includes(n.current),s=r.some((e=>e instanceof HTMLElement&&(e.className.includes("MuiPaper-root")||e.className.includes("MuiPopover-root"))));a||d||s||i()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[t,n,o,i])};
141var C=n(40430),b=n(10155),S=n(67784),j=n(51787),M=n(17392),I=n(70579);const k=e=>{let{anchorRef:t,onClick:n,title:o,error:i,selectedItem:l,searchTerm:r,onSearchChange:a,onClear:d,disabled:s=!1}=e;const c=(null===l||void 0===l?void 0:l.value)||r||"";return(0,I.jsxs)("div",{className:"categorized-input-wrapper",children:[(0,I.jsx)("label",{className:"categorized-input-label",children:o}),(0,I.jsx)(S.A,{className:"categorized-input",inputRef:t,onClick:n,value:c,onChange:e=>a(e.target.value),placeholder:`Search or manage ${o.toLowerCase()}`,InputProps:{endAdornment:(0,I.jsxs)(j.A,{position:"end",children:[c&&(0,I.jsx)(M.A,{size:"small",edge:"end",onClick:e=>{e.stopPropagation(),d()},sx:{padding:"4px",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},disabled:s,children:(0,I.jsx)(b.A,{fontSize:"small"})}),(0,I.jsx)(C.A,{})]})},error:!!i,helperText:null===i||void 0===i?void 0:i.message,size:"small",fullWidth:!0,disabled:s})]})};var w=n(98810);const T=e=>{let{value:t,newItem:n,setNewItem:i,onSubmit:l,isEdit:a,label:d,extraDropdownOptions:c}=e;return(0,I.jsxs)(I.Fragment,{children:[!(0,s.isEmpty)(c)&&(0,I.jsx)(w.A,{name:"type",options:c,placeholder:"Select course type",handleChange:e=>{i({...n,type:e.target.value})},defaultValue:null===n||void 0===n?void 0:n.type,forCustomField:!0}),(0,I.jsxs)(o.A,{display:"flex",gap:1,mb:1,children:[(0,I.jsx)(S.A,{fullWidth:!0,size:"small",value:t,onChange:e=>i({...n,value:e.target.value}),placeholder:d}),(0,I.jsx)(r.A,{variant:"contained",size:"small",onClick:l,children:a?"Update":"Create"})]})]})};const E=(0,n(66734).A)((0,I.jsx)("path",{d:"M10.59 9.17 5.41 4 4 5.41l5.17 5.17zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4zm.33 9.41-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04z"}),"Shuffle");var z=n(35721),P=n(24628),L=n(48734),O=n(8266),D=n(16289);const $=e=>{let{items:t,selectedItem:n,selectedParent:i,isEditable:r,onSelect:a,onEdit:d,onDelete:s,onShuffle:c}=e;return(0,I.jsxs)(o.A,{mt:2,mb:1,children:[i&&(0,I.jsxs)(o.A,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,I.jsx)(l.A,{variant:"subtitle2",fontWeight:"bold",children:null===i||void 0===i?void 0:i.value}),(0,I.jsx)(M.A,{onClick:()=>c(null===i||void 0===i?void 0:i.id),size:"small",children:(0,I.jsx)(E,{fontSize:"small"})})]}),(0,I.jsx)(z.A,{dense:!0,children:t.map(((e,t)=>(0,I.jsxs)(P.Ay,{component:"li",onClick:()=>a(e),className:"categorized-list-item"+(e.key===(null===n||void 0===n?void 0:n.key)?" selected":""),children:[(0,I.jsx)(L.A,{primary:e.value,primaryTypographyProps:{className:"list-item-text"}}),(0,I.jsx)(O.A,{sx:{right:0},children:(0,I.jsxs)(o.A,{className:"item-actions",children:[(0,I.jsx)(M.A,{onClick:t=>{t.stopPropagation(),s(e)},size:"small",children:(0,I.jsx)("img",{src:D.fk,alt:"Delete"})}),r&&(0,I.jsx)(M.A,{onClick:n=>{n.stopPropagation(),d(e,t)},size:"small",children:(0,I.jsx)("img",{src:D.eC,alt:"Edit"})})]})})]},e.id||e.key||t)))})]})};var N=n(83462),R=n(26600),F=n(35316),B=n(88911),H=n(74605),K=n(51962),V=n(29347),W=n(53193),U=n(72221),Y=n(32143);const q=e=>{let{label:t,value:n,onChange:o,options:i}=e;return(0,I.jsx)(W.A,{fullWidth:!0,size:"small",sx:{mb:2},children:(0,I.jsx)(U.A,{multiple:!0,value:n.map((e=>e.id)),onChange:e=>{const t=e.target.value,n=i.filter((e=>t.includes(e.id)));o(n)},displayEmpty:!0,renderValue:e=>{if(0===e.length)return`Select ${t.toLowerCase()}`;const n=i.filter((t=>e.includes(t.id))).map((e=>e.value));return 1===n.length?n[0]:`${n.length} ${t}(s)`},children:i.map((e=>(0,I.jsxs)(Y.A,{value:e.id,children:[(0,I.jsx)(K.A,{checked:n.some((t=>t.id===e.id))}),(0,I.jsx)(L.A,{primary:e.value})]},e.id)))})})},G=e=>{let{open:t,selectedItems:n=[],fromCategory:i,toCategory:a,fromItems:d=[],moveTocategories:s=[],setShuffleDialog:c,confirmShuffle:u,currentParent:p}=e;const m=()=>{c({open:!1,fromCategory:"",selectedItems:[],toCategory:[]})};return(0,I.jsxs)(N.A,{open:t,onClose:m,fullWidth:!0,maxWidth:"sm",children:[(0,I.jsx)(R.A,{children:`Shuffle Items from ${null===p||void 0===p?void 0:p.value}`}),(0,I.jsx)(F.A,{dividers:!0,children:(0,I.jsxs)(o.A,{display:"flex",gap:3,children:[(0,I.jsxs)(o.A,{flex:1,children:[(0,I.jsx)(l.A,{variant:"subtitle2",component:"h2",gutterBottom:!0,children:(0,h.t)("fieldManagement.selectItems")}),0===(null===d||void 0===d?void 0:d.length)?(0,I.jsx)(l.A,{variant:"body2",color:"text.secondary",children:(0,h.t)("fieldManagement.noItemsToMove")}):(0,I.jsx)(B.A,{spacing:1,children:null===d||void 0===d?void 0:d.map((e=>(0,I.jsx)(H.A,{control:(0,I.jsx)(K.A,{checked:n.includes(null===e||void 0===e?void 0:e.id),onChange:()=>{return t=null===e||void 0===e?void 0:e.id,void c((e=>{const n=e.selectedItems.includes(t)?e.selectedItems.filter((e=>e!==t)):[...e.selectedItems,t];return{...e,selectedItems:n}}));var t}}),label:null===e||void 0===e?void 0:e.value},null===e||void 0===e?void 0:e.id)))})]}),(0,I.jsxs)(o.A,{flex:1,children:[(0,I.jsx)(l.A,{variant:"subtitle2",gutterBottom:!0,children:(0,h.t)("fieldManagement.moveTo")}),(0,I.jsx)(q,{label:"Move To",value:a,onChange:e=>c((t=>({...t,toCategory:e}))),options:s})]})]})}),(0,I.jsxs)(V.A,{children:[(0,I.jsx)(r.A,{onClick:m,color:"inherit",children:(0,h.t)("button.cancel")}),(0,I.jsx)(r.A,{onClick:u,variant:"contained",disabled:!a||0===n.length||a===i,children:(0,h.t)("button.move")})]})]})},_=e=>{let{name:t,options:n=[],parentOptions:i=[],selectedParent:l,selectedGrandParent:r,extraDropdownOptions:a=[],currentLevel:c=0,isEditable:v=!1,rules:C={},title:b="Manage Items",onCreateOrUpdate:S,onDelete:j,onShuffle:M}=e;const w=(0,m.wA)(),{control:E,setValue:z}=(0,p.xW)(),P=(0,p.FH)({control:E,name:`${t}Selected`}),L=(0,p.FH)({control:E,name:"type"}),O=(0,u.useRef)(null),D=(0,u.useRef)(null),[N,R]=(0,u.useState)(!1),[F,B]=(0,u.useState)({}),[H,K]=(0,u.useState)(null),[V,W]=(0,u.useState)(""),[U,Y]=(0,u.useState)({open:!1,item:{}}),[q,_]=(0,u.useState)({open:!1,fromCategory:"",selectedItems:[],toCategory:[]});
141A({isOpen:N,anchorRef:O,popperRef:D,onClose:()=>R(!1)});const X=e=>{Y({open:!0,item:e})},Z=()=>{j(t,null===U||void 0===U?void 0:U.item,l,r,"delete"),J()},J=()=>{Y({open:!1,item:{}})},Q=(e,t)=>{B(e),K(t),R(!0)},ee=e=>{z(`${t}Selected`,e),R(!1),W("")},te=()=>{M(t,q,r),K(null),B({}),W(""),z("areaSelected",{}),z("meetingTypeSelected",{}),z("segmentSelected",{}),_({open:!1,fromCategory:"",selectedItems:[],toCategory:[]})},ne=(null===n||void 0===n?void 0:n.filter((e=>e.value.toLowerCase().includes(V.toLowerCase()))))||[],oe=i.filter((e=>e.id!==q.fromCategory));return(0,I.jsx)(p.xI,{control:E,name:t,rules:C,render:e=>{let{fieldState:{error:u}}=e;return(0,I.jsxs)(o.A,{children:[(0,I.jsx)(k,{anchorRef:O,onClick:()=>{R(!0),W("")},title:b,error:u,selectedItem:P,searchTerm:V,onSearchChange:e=>{W(e)},onClear:()=>{W(""),z(`${t}Selected`,{})},disabled:(0,s.isEmpty)(l)&&c>0}),(0===c||!(0,s.isEmpty)(l)&&c>0)&&(0,I.jsx)(x.A,{open:N,anchorEl:O.current,placement:"bottom-start",style:{zIndex:1300,width:380},children:(0,I.jsxs)(g.A,{ref:D,sx:{width:"100%",maxHeight:300,overflowY:"auto",p:1},children:[(0,I.jsx)(T,{value:(0,s.isEmpty)(F)?"":null===F||void 0===F?void 0:F.value,newItem:F,setNewItem:B,onSubmit:()=>(e=>{if(!L&&"meetingSubType"===t)return void w((0,d.fT)({type:"error",text:(0,h.t)("fieldManagement.selectType")}));S(t,e,l,r,null!==H?"update":"create"),K(null),B({}),W(""),z(`${t}Selected`,{})})(F),isEdit:null!==H,label:`Type ${b}`,extraDropdownOptions:a}),(0,I.jsx)($,{items:ne,selectedItem:P,selectedParent:l,isEditable:v,onSelect:ee,onEdit:Q,onDelete:X,onShuffle:e=>{const t=i.filter((t=>t.id!==e));(0,s.isEmpty)(t)?w((0,d.fT)({type:"error",text:(0,h.t)("fieldManagement.canNotReshuffle")})):_({open:!0,fromCategory:e,selectedItems:[],toCategory:[]})}})]})}),(0,I.jsx)(G,{open:q.open,selectedItems:q.selectedItems,fromCategory:q.fromCategory,toCategory:q.toCategory,setShuffleDialog:_,confirmShuffle:te,fromItems:n||[],currentParent:l,moveTocategories:oe}),(0,I.jsx)(y.A,{open:null===U||void 0===U?void 0:U.open,text:(0,h.t)("fieldManagement.areYouSureToDelete"),Icon:f.A,successButtonText:(0,h.t)("button.yes"),cancelButtonText:(0,h.t)("button.no"),handleClose:J,handleYes:Z,iconColor:"red",cancelPopup:"Yes"})]})}})},X=e=>{let{configList:t,onAction:n,onShuffle:o}=e;return t.map((e=>{let{name:t,title:l,options:r,parentOptions:a,selectedParent:d,selectedGrandParent:s,extraDropdownOptions:c,currentLevel:u,isEditable:p}=e;return(0,I.jsx)(i.Ay,{item:!0,xs:12,sm:4,children:(0,I.jsx)(_,{name:t,title:l,options:r,parentOptions:a,selectedParent:d,selectedGrandParent:s,extraDropdownOptions:c,currentLevel:u,isEditable:p,onCreateOrUpdate:function(){return n(...arguments)},onDelete:function(){return n(...arguments)},onShuffle:function(){return o(...arguments)}})},t)}))},Z=()=>{const{methods:e,dropdownConfigs:t,handleAction:n,handleShuffle:a}=v();return(0,I.jsx)(p.Op,{...e,children:(0,I.jsx)("form",{onSubmit:e.handleSubmit((e=>{console.log("handle submit",e)})),children:(0,I.jsxs)(o.A,{className:"field-management-main",children:[(0,I.jsx)(i.Ay,{container:!0,spacing:2,className:"field-management-header",children:(0,I.jsx)(i.Ay,{item:!0,children:(0,I.jsx)(l.A,{variant:"h6",className:"field-management-title",children:(0,h.t)("fieldManagement.title")})})}),(0,I.jsx)(i.Ay,{container:!0,spacing:2,children:(0,I.jsx)(X,{configList:t,onAction:n,onShuffle:a})}),(0,I.jsx)(o.A,{sx:{display:"none"},children:(0,I.jsxs)(i.Ay,{item:!0,xs:12,sm:8,children:[(0,I.jsx)(r.A,{variant:"outlined",color:"primary",onClick:()=>{console.log("Handle Cancel")},sx:{mt:2},children:(0,h.t)("button.cancel")}),(0,I.jsx)(r.A,{type:"submit",variant:"contained",color:"primary",sx:{mt:2,ml:2},children:(0,h.t)("button.save")})]})})]})})})}},40430:(e,t,n)=>{var o=n(24994);t.A=void 0;var i=o(n(40039)),l=n(70579);t.A=(0,i.default)((0,l.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown")},10155:(e,t,n)=>{var o=n(24994);t.A=void 0;var i=o(n(40039)),l=n(70579);t.A=(0,i.default)((0,l.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear")}
141,51962:(e,t,n)=>{n.d(t,{A:()=>w});var o=n(98587),i=n(58168),l=n(65043),r=n(58387),a=n(98610),d=n(67266),s=n(33064),c=n(66734),u=n(70579);const p=(0,c.A)((0,u.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),m=(0,c.A)((0,u.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),v=(0,c.A)((0,u.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");var h=n(6803),f=n(98206),x=n(34535),g=n(61475),y=n(92532),A=n(72372);function C(e){return(0,A.Ay)("MuiCheckbox",e)}const b=(0,y.A)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),S=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],j=(0,x.Ay)(s.A,{shouldForwardProp:e=>(0,g.A)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${(0,h.A)(n.size)}`],"default"!==n.color&&t[`color${(0,h.A)(n.color)}`]]}})((e=>{let{theme:t,ownerState:n}=e;return(0,i.A)({color:(t.vars||t).palette.text.secondary},!n.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${"default"===n.color?t.vars.palette.action.activeChannel:t.vars.palette[n.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:(0,d.X4)("default"===n.color?t.palette.action.active:t.palette[n.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==n.color&&{[`&.${b.checked}, &.${b.indeterminate}`]:{color:(t.vars||t).palette[n.color].main},[`&.${b.disabled}`]:{color:(t.vars||t).palette.action.disabled}})})),M=(0,u.jsx)(m,{}),I=(0,u.jsx)(p,{}),k=(0,u.jsx)(v,{}),w=l.forwardRef((function(e,t){var n,d;const s=(0,f.b)({props:e,name:"MuiCheckbox"}),{checkedIcon:c=M,color:p="primary",icon:m=I,indeterminate:v=!1,indeterminateIcon:x=k,inputProps:g,size:y="medium",className:A}=s,b=(0,o.A)(s,S),w=v?x:m,T=v?x:c,E=(0,i.A)({},s,{color:p,indeterminate:v,size:y}),z=(e=>{const{classes:t,indeterminate:n,color:o,size:l}=e,r={root:["root",n&&"indeterminate",`color${(0,h.A)(o)}`,`size${(0,h.A)(l)}`]},d=(0,a.A)(r,C,t);return(0,i.A)({},t,d)})(E);return(0,u.jsx)(j,(0,i.A)({type:"checkbox",inputProps:(0,i.A)({"data-indeterminate":v},g),icon:l.cloneElement(w,{fontSize:null!=(n=w.props.fontSize)?n:y}),checkedIcon:l.cloneElement(T,{fontSize:null!=(d=T.props.fontSize)?d:y}),ownerState:E,ref:t,className:(0,r.A)(z.root,A)},b,{classes:z}))}))},48734:(e,t,n)=>{n.d(t,{A:()=>f});var o=n(98587),i=n(58168),l=n(65043),r=n(58387),a=n(98610),d=n(85865),s=n(51347),c=n(98206),u=n(34535),p=n(28052),m=n(70579);const v=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],h=(0,u.Ay)("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${p.A.primary}`]:t.primary},{[`& .${p.A.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})((e=>{let{ownerState:t}=e;return(0,i.A)({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},t.primary&&t.secondary&&{marginTop:6,marginBottom:6},t.inset&&{paddingLeft:56})})),f=l.forwardRef((function(e,t){const n=(0,c.b)({props:e,name:"MuiListItemText"}),{children:u,className:f,disableTypography:x=!1,inset:g=!1,primary:y,primaryTypographyProps:A,secondary:C,secondaryTypographyProps:b}=n,S=(0,o.A)(n,v),{dense:j}=l.useContext(s.A);let M=null!=y?y:u,I=C;const k=(0,i.A)({},n,{disableTypography:x,inset:g,primary:!!M,secondary:!!I,dense:j}),w=(e=>{const{classes:t,inset:n,primary:o,secondary:i,dense:l}=e,r={root:["root",n&&"inset",l&&"dense",o&&i&&"multiline"],primary:["primary"],secondary:["secondary"]};return(0,a.A)(r,p.b,t)})(k);return null==M||M.type===d.A||x||(M=(0,m.jsx)(d.A,(0,i.A)({variant:j?"body2":"body1",className:w.primary,component:null!=A&&A.variant?void 0:"span",display:"block"},A,{children:M}))),null==I||I.type===d.A||x||(I=(0,m.jsx)(d.A,(0,i.A)({variant:"body2",className:w.secondary,color:"text.secondary",display:"block"},b,{children:I}))),(0,m.jsxs)(h,(0,i.A)({className:(0,r.A)(w.root,f),ownerState:k,ref:t},S,{children:[M,I]}))}))}}]); 142//# sourceMappingURL=4012.e5833e49.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.