@realtek/core-theme-live 0.0.345 → 0.0.346

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-Chgba0Kb.cjs"),t=require("./authApi-0pIx1vUD.cjs"),n=require("./Breadcrumb-D4uJH_Jv.cjs"),r=require("./diceCandidateMapper-BjMhHno3.cjs"),i=require("./formGroupsCache-Bbz-28ws.cjs"),a=require("./addFormApi-DhugyuLa.cjs");let o=require("react");o=e.n(o,1);let s=require("antd"),c=require("@ant-design/icons"),l=require("react/jsx-runtime"),u=require("dayjs");u=e.n(u,1);let d=require("react-router-dom"),f=require("prop-types");f=e.n(f,1);async function p(e,{method:n=`POST`,params:r={},body:i={}}={}){let a={"Content-Type":`application/json`,Authorization:`Bearer ${await t.a()}`},o=new URLSearchParams({moduleName:e});Object.entries(r).forEach(([e,t])=>{t!=null&&t!==``&&o.append(e,String(t))});let s={method:n,headers:a};(n===`POST`||n===`PUT`)&&(s.body=JSON.stringify(i??{}));let c=await fetch(`${t.x}/dashboard/cards?${o.toString()}`,s);if(!c.ok)throw Error(`API ${c.status}: ${c.statusText}`);return c.json()}async function m(e={}){let n=await t.a(),r=await fetch(`${t.x}/dynamic-common-count`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`},body:JSON.stringify(e)});if(!r.ok)throw Error(`API ${r.status}: ${r.statusText}`);return r.json()}async function h(e={}){let n=await t.a(),r=await fetch(`${t.x}/dashboard-calendar`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`},body:JSON.stringify(e)});if(!r.ok)throw Error(`API ${r.status}: ${r.statusText}`);return r.json()}async function g(){return t.t(t.x,`/users/hierarchy-tree`)}var{Title:_,Text:v}=s.Typography,y=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],b=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],x=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],S={green:`#22c55e`,red:`#ef4444`,orange:`#f97316`,blue:`#3b82f6`};function C(e){return S[e]||e||`#586888`}function w(e){return String(e).padStart(2,`0`)}function T(e,t,n=`Sun`){let r=new Date(e,t,1).getDay(),i=n===`Mon`?r===0?6:r-1:r,a=new Date(e,t+1,0).getDate(),o=[];for(let e=0;e<i;e++)o.push({day:null,cur:!1});for(let e=1;e<=a;e++)o.push({day:e,cur:!0});for(;o.length%7!=0;)o.push({day:null,cur:!1});return o}function E(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function D(e){if(!e)return{text:``,author:null};let t=e.match(/\n\s*-\s*([^\n]+)\s*$/);return t?{text:e.slice(0,t.index).trim(),author:t[1].trim()}:{text:e.trim(),author:null}}function O(e=[]){let t={};return e.forEach(e=>{t[e.date]=(e.events||[]).map(e=>{let{text:t,author:n}=D(e.description);return{color:e.color,label:e.label,title:e.title,text:t,author:n}})}),t}function k({events:e}){return(0,l.jsx)(`div`,{style:{maxWidth:280,maxHeight:260,overflowY:`auto`},children:e.map((t,n)=>(0,l.jsxs)(`div`,{style:{display:`flex`,gap:8,padding:`6px 0`,borderBottom:n<e.length-1?`1px solid #f0f0f0`:`none`},children:[(0,l.jsx)(`span`,{className:`calendar-dot`,style:{background:C(t.color),marginTop:6,flexShrink:0}}),(0,l.jsxs)(`div`,{style:{minWidth:0},children:[(0,l.jsx)(v,{strong:!0,style:{fontSize:13,display:`block`},children:t.title||t.label}),t.text&&(0,l.jsx)(v,{style:{fontSize:12,color:`#555`,whiteSpace:`pre-line`,wordBreak:`break-word`},children:t.text}),t.author&&(0,l.jsxs)(v,{style:{fontSize:11,color:`#999`,display:`block`,marginTop:2},children:[`— `,t.author]})]})]},n))})}function A({userIds:e=[],days:t=void 0,startDay:n=`Sun`,renderDayContent:r=void 0,onDayClick:i=void 0,headerExtra:a=void 0,legend:u=void 0,readonly:d=!1,className:f=``,monthLabel:p=void 0,year:m=void 0,month:g=void 0,onPrevMonth:S=void 0,onNextMonth:D=void 0,prevDisabled:A=!1,nextDisabled:j=!1}){let M=t!==void 0||r!==void 0||i!==void 0,N=new Date,[P,F]=(0,o.useState)({year:N.getFullYear(),month:N.getMonth()}),I=m!=null&&g!=null?{year:Number(m),month:Number(g)-1}:P,[L,R]=(0,o.useState)({}),[z,B]=(0,o.useState)([]),[V,H]=(0,o.useState)(!1),[U,ee]=(0,o.useState)(null),te=JSON.stringify(e),ne=n===`Mon`?b:y,re=(0,o.useCallback)(async()=>{H(!0);try{let t=await h({userIds:e});t?.status&&t?.data?(B(t.data.legend||[]),R(O(t.data.days||[]))):(B([]),R({}))}catch(e){console.error(`CalendarCard fetch error:`,e)}finally{H(!1)}},[te]);(0,o.useEffect)(()=>{M||re()},[M,re]),(0,o.useEffect)(()=>(window.addEventListener(`dashboard-calendar:refresh`,re),()=>window.removeEventListener(`dashboard-calendar:refresh`,re)),[re]);let ie=S??(()=>F(e=>e.month===0?{year:e.year-1,month:11}:{...e,month:e.month-1})),ae=D??(()=>F(e=>e.month===11?{year:e.year+1,month:0}:{...e,month:e.month+1})),W=E(T(I.year,I.month,n),7),oe={};t!==void 0&&(t||[]).forEach(e=>{e?.date&&(oe[e.date]=e)});let se=u??z,ce=p??`${x[I.month]} ${I.year}`;return(0,l.jsx)(s.Card,{className:`calendar-card${f?` ${f}`:``}`,title:(0,l.jsxs)(`div`,{className:`calendar-header-title`,children:[(0,l.jsx)(c.CalendarOutlined,{}),(0,l.jsx)(_,{level:5,style:{margin:0},children:ce}),a]}),extra:(0,l.jsxs)(`div`,{className:`calendar-nav`,style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,l.jsx)(s.Tooltip,{title:`Previous month`,children:(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.LeftOutlined,{}),size:`small`,onClick:ie,disabled:A})}),(0,l.jsx)(s.Tooltip,{title:`Next month`,children:(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.RightOutlined,{}),size:`small`,onClick:ae,disabled:j})})]}),children:(0,l.jsxs)(s.Spin,{spinning:V,children:[(0,l.jsx)(s.Row,{gutter:[6,0],className:`calendar-day-names`,children:ne.map(e=>(0,l.jsx)(s.Col,{flex:`1`,className:`calendar-day-name`,children:e},e))}),(0,l.jsx)(`div`,{className:`calendar-weeks`,children:W.map((e,t)=>(0,l.jsx)(s.Row,{gutter:[6,6],align:`top`,className:`calendar-week-row`,children:e.map((e,t)=>{if(!e.cur||e.day===null)return(0,l.jsx)(s.Col,{flex:`1`,children:(0,l.jsx)(`div`,{className:`calendar-cell calendar-cell--filler`})},t);let n=`${I.year}-${w(I.month+1)}-${w(e.day)}`,a=e.day===N.getDate()&&I.month===N.getMonth()&&I.year===N.getFullYear();if(M){let o=oe[n]??null;return r?(0,l.jsx)(s.Col,{flex:`1`,children:r(n,o,{isToday:a,readonly:d})},t):(0,l.jsx)(s.Col,{flex:`1`,children:(0,l.jsx)(`div`,{className:[`calendar-cell`,a?`today`:``,d?`calendar-cell--readonly`:``].filter(Boolean).join(` `),onClick:()=>!d&&i?.(n,o),style:{cursor:d?`default`:`pointer`},children:(0,l.jsx)(`div`,{className:`calendar-cell-inner`,children:(0,l.jsx)(v,{className:`calendar-cell-number`,children:e.day})})})},t)}let o=L[n]||[],c=[...new Set(o.map(e=>e.color))].slice(0,3);return(0,l.jsx)(s.Col,{flex:`1`,children:(0,l.jsx)(`div`,{className:`calendar-cell${a?` today`:``}`,children:(0,l.jsxs)(`div`,{className:`calendar-cell-inner`,children:[(0,l.jsx)(v,{className:`calendar-cell-number`,children:e.day}),o.length>0&&(0,l.jsx)(s.Popover,{open:U===n,trigger:`click`,content:(0,l.jsx)(k,{events:o}),placement:`topRight`,destroyTooltipOnHide:!0,onOpenChange:e=>ee(e?n:null),children:(0,l.jsx)(`div`,{className:`calendar-cell-dots`,children:c.map((e,t)=>(0,l.jsx)(`span`,{className:`calendar-dot`,style:{background:C(e)}},t))})})]})})},t)})},t))}),se.length>0&&(0,l.jsx)(`div`,{className:`calendar-legend`,children:se.map(({label:e,color:t,icon:n})=>(0,l.jsxs)(`div`,{className:`calendar-legend-item`,children:[n?(0,l.jsx)(`span`,{className:`calendar-legend-badge`,style:{background:C(t)},children:n}):(0,l.jsx)(`span`,{className:`calendar-legend-dot`,style:{background:C(t)}}),(0,l.jsx)(v,{children:e})]},e))})]})})}function j(e){return e!=null}function M(e){let t=String(e);return t.charAt(0).toUpperCase()+t.slice(1)}function N(e,t){if(!e||typeof e!=`object`)return null;let n=e.key??e.value??e.id??String(t),r=e.title??e.tabTitle??e.label??e.name,i=e.count??e.countValue;return!n||!r?null:{...e,key:String(n),label:(0,l.jsxs)(s.Space,{size:6,children:[(0,l.jsx)(`span`,{children:M(r)}),j(i)&&(0,l.jsx)(s.Badge,{className:`dynamic-tabs-count`,count:i,overflowCount:2**53-1})]})}}function P({tabs:e=[],activeKey:t,onChange:n,className:r,extra:i}){let a=e.map(N).filter(Boolean);if(!a.length)return null;let o=a.some(e=>e.key===t)?t:a[0].key;return(0,l.jsx)(s.Tabs,{activeKey:o,className:r,items:a,onChange:n,tabBarExtraContent:i})}function F(){return{tenantId:localStorage.getItem(`tenantId`)||``,businessId:localStorage.getItem(`businessId`)||``,businessUnitId:localStorage.getItem(`businessUnitId`)||``}}function I(){return Number(localStorage.getItem(`userId`))||0}var L=e=>e?.data??e,R=new Map;function z(e){return e?.recruiterId??e?.legacyUserId??e?.user_id??e?.userId??e?.USER_ID??e?.id??e?._id}function B(e){return!e||typeof e!=`object`?``:[e.first_name??e.firstName??e.FIRST_NAME,e.last_name??e.lastName??e.LAST_NAME].filter(Boolean).join(` `).trim()||e.recruiterName||e.name||e.user_name||e.userName||e.USER_NAME||e.email||``}async function V(e){let n=String(e??``).trim();return n?(R.has(n)||R.set(n,t.o(t.x,`/get-detailed-view?userId=${encodeURIComponent(n)}`).then(e=>B(e?.data??e??null)).catch(()=>``)),R.get(n)):``}var H=null;function U(e){let t=new Map;return(Array.isArray(e)?e:[]).forEach(e=>{let n={name:B(e),role_name:e?.roleName??e?.role_name??``,reporting_name:e?.reportingName??e?.reporting_name??``};[e?.userId,e?.user_id,e?.legacyUserId,e?.id,e?._id].forEach(e=>{let r=String(e??``).trim();r&&t.set(r,n)})}),t}function ee(){return H||=t.o(t.x,`/get-all-users?limit=500&offset=0`).then(e=>{let t=e?.data??e??{};return U(t.users??t??[])}).catch(()=>new Map),H}async function te(e){let t=z(e),n=(await ee()).get(String(t??``).trim())??{},r=n.name||await V(t)||B(e);return{...e,name:r,role_name:n.role_name||e?.role_name||e?.roleName||``,reporting_name:n.reporting_name||e?.reporting_name||e?.reportingName||``}}async function ne(e,n,r){return L(await t.o(t.x,`/module-data-update`,{method:`PUT`,body:JSON.stringify({module:e,ids:n,updates:{status:r}})}))}async function re(e,n){let r=Array.isArray(n)?n:[n],i=await Promise.all(r.filter(Boolean).map(n=>t.o(t.x,`/module/delete/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`,{method:`DELETE`})));return i[i.length-1]??{}}async function ie(e){return L(await t.o(t.T,`/joblist`,{method:`POST`,body:JSON.stringify({...F(),searchQuery:e,userId:I()})}))}async function ae(e=``){let n=e?`?search=${encodeURIComponent(e)}`:``;return t.t(t.T,`/users/any${n}`)}async function W({relatedIds:e,module:n,title:r,targetDate:i,notes:a}){return t.o(t.T,`/notes`,{method:`POST`,body:JSON.stringify({schemaVersion:1,...F(),title:r,notes:a,notesFor:n||`general`,notesRelatedId:Array.isArray(e)&&e.length?e:null,reminder:i?{type:`single`,time:i,interval:``}:null,targetDate:i||null})})}async function oe(e,{title:n,targetDate:r,notes:i}){return t.o(t.T,`/notes/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify({title:n,notes:i,reminder:r?{type:`single`,time:r,interval:``}:null,targetDate:r||null})})}async function se(e){return t.o(t.T,`/notes/${encodeURIComponent(e)}/resolve`,{method:`PUT`})}async function ce({jobId:e,candidateIds:n,hiringStage:r}){return t.o(t.T,`/source/hiringStgUpdate`,{method:`PUT`,body:JSON.stringify({...F(),multiJobId:Array.isArray(e)?e:[e],applicantId:Array.isArray(n)?n:[n],updateStatus:String(r??``).toLowerCase(),updateStatusType:`call`,responseType:`responded`,hiriringStatusChangeType:`tagToJobs`,comments:``,userId:I()})})}async function le(){return L(await t.o(t.x,`/masters/dropdown?masterName=candidateGroups&offset=0&limit=50`))}async function ue({candidateIds:e,groupId:n,groupName:r}){return L(await t.o(t.S,`/actions/update-group`,{method:`PUT`,body:JSON.stringify({candidateIds:e,groupId:n,groupName:r})}))}async function de({jobIds:e,rate:n,priority:r}){return t.o(t.T,`/assign?type=self`,{method:`PUT`,body:JSON.stringify({multiJobId:Array.isArray(e)?e:[e],userId:I(),schemaVersion:1,...F(),priority:r==null?`false`:String(r),priorityFrom:null,recruitersData:[]})})}async function fe(e){if(!e)return{assignedUsers:[],totalSubmissions:0,targetSubmissions:0,message:``};let n=await t.o(t.T,`/self-assign?jobId=${encodeURIComponent(e)}`),r=n?.data,i=n?.message??``;return Array.isArray(r)?{assignedUsers:await Promise.all(r.map(te)),totalSubmissions:0,targetSubmissions:0,message:i}:!r||typeof r!=`object`?{assignedUsers:[],totalSubmissions:0,targetSubmissions:0,message:i}:{assignedUsers:await Promise.all((Array.isArray(r.assignedUsers)?r.assignedUsers:[]).map(te)),totalSubmissions:r.totalSubmissions??0,targetSubmissions:r.targetSubmissions??0,message:i}}function pe(e){let t=e?.user_id??e?.userId??e?.USER_ID??e?.legacyUserId??e?.id??e?._id,n=t==null?``:String(t).trim();if(!n)return null;let r=[e?.first_name??e?.firstName,e?.last_name??e?.lastName].filter(Boolean).join(` `).trim(),i=e?.name||e?.user_name||e?.userName||e?.USER_NAME||r||e?.email||n;return{...e,label:String(i),value:n}}async function me(){let e=await t.t(t.T,`/users/manager`);return(Array.isArray(e)?e:e?[e]:[]).map(pe).filter(Boolean)}async function he(e){if(!e)return{recruitersData:[]};let n=await t.t(t.T,`/pay-details/${encodeURIComponent(e)}`),r=n&&typeof n==`object`&&Array.isArray(n.recruiters)?n.recruiters:[],i=(await Promise.all(r.map(async e=>{let t=e?.recruiterId??e?.user_id??e?.userId??e?.id;if(t==null||t===``)return null;let n=await te({...e,recruiterId:t});return{recruiterId:t,id:t,user_id:t,name:n.name,role_name:n.role_name??n.roleName??``,reporting_name:n.reporting_name??n.reportingName??``}}))).filter(Boolean);return{...n&&typeof n==`object`?n:{},recruitersData:i}}function ge(e){let t=typeof e==`object`?e?.recruiterId??e?.user_id??e?.userId??e?.id:e,n=Number(t);return Number.isInteger(n)&&n>0?n:null}function _e({jobIds:e,userId:t,rate:n,priority:r,removedIds:i,existingRecruiters:a}){let o=new Set((i??[]).map(String)),s=(a??[]).map(ge).filter(e=>e!==null&&!o.has(String(e))),c=(Array.isArray(t)?t:[t]).map(ge).filter(e=>e!==null);if(c.length===0)throw Error(`A valid user must be selected before assigning the job`);let l=Array.from(new Set([...s,...c]));return{multiJobId:Array.isArray(e)?e:[e],userId:c[0],schemaVersion:1,...F(),priority:String(r??!1),priorityFrom:``,recruitersData:l}}async function G(e,n){let r=new Set((n??[]).map(String));r.size&&await Promise.all((e??[]).map(async e=>{let n=await t.o(t.x,`/module/list?module=jobs&id=${encodeURIComponent(e)}`),i=n?.data?.data??n?.data??n,a=Array.isArray(i)?i[0]:i,o=Array.isArray(a?.recruiters)?a.recruiters:[],s=o.filter(e=>!r.has(String(ge(e)??``)));s.length!==o.length&&await t.o(t.x,`/module/update/${encodeURIComponent(e)}?module=jobs`,{method:`PATCH`,body:JSON.stringify({recruiters:s})})}))}async function K(e){let n=Array.isArray(e?.jobIds)?e.jobIds:[e?.jobIds].filter(Boolean),r=e?.removedIds??[],i=(Array.isArray(e?.userId)?e.userId:[e?.userId]).map(ge).filter(e=>e!==null),a;return i.length>0&&(a=await t.o(t.T,`/assign?type=other`,{method:`PUT`,body:JSON.stringify(_e(e))})),await G(n,r),a}async function ve({submissionId:e,isMail:n=!1}){return L(await t.o(t.x,`/submissions/move-to-onboarding`,{method:`POST`,body:JSON.stringify({submissionId:e,isMail:!!n})}))}async function ye(e,n){return L(await t.o(t.x,`/submissions/approve`,{method:`POST`,body:JSON.stringify({submissionId:e,...n})}))}async function be(e){return L(await t.o(t.x,`/submissions/vms-approve?submissionId=${encodeURIComponent(e)}`))}async function xe(e,{submissionId:n=``,billRate:r,payRate:i,currency:a=`$`,rateUnit:o=`hr`,referralId:s,referralRate:c,referralType:l,referralEnabled:u,vmsPercent:d=0,documentIds:f=[],remarks:p=null}={}){let m=e?`/workforce-engagements/${encodeURIComponent(e)}/cfo-approval/send`:`/submissions/${encodeURIComponent(n)}/cfo-approval/send`;if(!e&&!n)throw Error(`Submission is required to send for approval.`);let h=typeof window<`u`?window.location.origin:``,g=e||n;return L(await t.o(t.D,m,{method:`POST`,body:JSON.stringify({proposedRate:{candidateProposedRate:Number(r)||0,candidateProposedRateCurrency:a,candidateProposedRateCurrencySymbol:``,candidateProposedRateUnit:o},candidateRate:{candidateAcceptedRate:Number(i)||0,candidateAcceptedCurrency:a,candidateAcceptedCurrencySymbol:``,candidateAcceptedPayUnit:o,candidateAcceptedRateNegotiable:!1},...s!=null&&s!==``?{referralId:s}:{},...c==null?{}:{referralRate:Number(c)||0},...l!=null&&l!==``?{referralType:l}:{},...u==null?{}:{referralEnabled:!!u},vmsPercent:Number(d)||0,documentIds:f,remarks:p,approvalUrl:`${h}/cfo-approval/${encodeURIComponent(g)}`})}))}async function Se({submissionId:e,rejectReasonId:n,rejectReason:r,rejectReasonComments:i}){return L(await t.o(t.x,`/submissions/reject`,{method:`POST`,body:JSON.stringify({submissionId:e,rejectReasonId:n,rejectReason:r,rejectReasonComments:i})}))}async function Ce({jobId:e,applicantId:n}){let r=new URLSearchParams({jobId:String(e??``),applicantId:String(n??``)});return L(await t.o(t.x,`/submissions/exists?${r.toString()}`))??{exists:!1}}async function we({searchQuery:e,candidateId:n}){let r=L(await t.o(t.x,`/quick-submit/job-search`,{method:`POST`,body:JSON.stringify({searchQuery:e??``,candidateId:n?String(n):``})}));return Array.isArray(r)?r:[]}async function Te({search:e,jobId:n}){let r=L(await t.o(t.x,`/quick-submit/candidate-search`,{method:`POST`,body:JSON.stringify({search:e??``,jobId:n?String(n):``})}));return Array.isArray(r)?r:[]}async function Ee({jobId:e,applicantId:n,jobIds:r,applicantIds:i}){let a=!!e,o={};if(e&&(o.jobId=String(e)),n&&(o.applicantId=String(n)),Array.isArray(r)&&(o.jobIds=r.filter(Boolean).map(String)),Array.isArray(i)&&(o.applicantIds=i.filter(Boolean).map(String)),!(a?o.applicantIds:o.jobIds)?.length)return new Map;let s=L(await t.o(t.x,`/submissions/exists-bulk`,{method:`POST`,body:JSON.stringify(o)}))?.pairs??[];return new Map(s.map(e=>[String(a?e.applicantId:e.jobId),{submissionId:e.submissionId??``,submittedAt:e.submittedAt??null}]))}async function De({jobId:e,candidateIds:n}){return t.o(t.T,`/source/hiringStgUpdate`,{method:`PUT`,body:JSON.stringify({...F(),multiJobId:Array.isArray(e)?e:[e],applicantId:Array.isArray(n)?n:[n],updateStatus:`pipeline`,updateStatusType:`call`,responseType:`responded`,hiriringStatusChangeType:`tagToJobs`,comments:``,userId:I()})})}var Oe={jobsCount:[`total`,`Total Jobs`,`active`,`Active Jobs`,`myAssignedCount`,`My Jobs`],submissionCount:[`Selected`,`Submitted to client`,`Submitted to Client`,`Not Submitted`,`Approved`]};function ke(e){return Oe[e]??null}var Ae={stickyNotes:{title:`Sticky Notes`,variant:`sticky`,request:{method:`GET`,params:{limit:20,offset:0}},listPath:`data.data`,maxCount:4,viewAllUrl:`/viewall-sticky`,refreshEvent:`sticky-notes:refresh`,pillKey:`status`,headingKey:`title`,bodyKey:`notes`,bodyLines:3,footerLeftKey:`createdByName`,footerRightKey:`createdAt`,dateKey:`reminder.time`,colorBy:`status`,colorMap:{Note:`green`,Tagged:`red`},color:`auto`},jobsCount:{variant:`counts`,dynamicCommonCount:{module:`jobs`,keys:[`jobRecruitmentStatus`,`jobStatus`]},listPath:``,layout:`4x2`,groupSeparator:``,labelMap:{total:`Total Jobs`,active:`Active Jobs`,myAssignedCount:`My Jobs`},color:`#f1f3f8`,show:ke(`jobsCount`),hide:[`inactive`,`submitted`,`noSubmissions`]},submissionCount:{title:`Total Client Submission`,tooltipText:`Includes all submissions that are pending and submitted to the client.`,variant:`submission`,dynamicCommonCount:{module:`submissions`,keys:[`clientSubmissionStatus.clientSubmissionStatusText`]},listPath:``,totalKey:`total`,labelMap:{Selected:`Selected`,"Submitted to client":`Submitted to Client`,"Not Submitted":`Not Submitted`,Approved:`Approved`},colorMap:{Selected:`rgb(234, 175, 12)`,"Submitted to client":`green`,"Not Submitted":`red`,Approved:`#1d4ed8`},show:ke(`submissionCount`)},leadAptitude:{title:`Aptitude Test Results`,variant:`assessment`,request:{method:`GET`,params:{}},listPath:`data`,totalKey:`totalScore`,maxKey:`maximumScore`,statusKey:`status`,attemptDateKey:`attemptDate`,timeTakenKey:`timeTaken`,rankKey:`rank`,labelMap:{logicalReasoning:`Logical Reasoning`,quantitativeAptitude:`Quantitative Aptitude`,verbalAbility:`Verbal Ability`},colorMap:{logicalReasoning:`#7c3aed`,quantitativeAptitude:`#0891b2`,verbalAbility:`#16a34a`},hide:[`status`,`attemptDate`,`timeTaken`,`rank`,`maximumScore`]},onboardingCount:{variant:`counts`,dynamicCommonCount:{module:`onboarding`,keys:[`onboardingObStage`]},listPath:``,frame:!0,frameTitle:`Onboarding`,frameClassName:`onboarding-card`,viewAll:!0,footer:!0,columns:4,valueMap:{inProgress:`Under Review`,hired:`Onboarded`,projectCompleted:`Project cycle closed`,archive:`No longer active`},labelMap:{inProgress:`In Progress`,hired:`Hired`,projectCompleted:`Project Completed`,archive:`Archive`},aggregateMap:{inProgress:[`inProgress`,`In Progress`],hired:[`hired`,`Hired`,`Active`],projectCompleted:[`projectCompleted`,`Project Completed`,`Completed`],archive:[`archive`,`Archive`,`Not Hired`,`Candidate Backout`]},show:ke(`onboardingCount`),hide:[`total`,`totalGrossMargin`,`totalNetMargin`]},timesheetMonthlySummary:{variant:`metrics`,title:`Monthly Summary`,valueSuffix:` hrs`,rows:[{key:`unapprovedPayableHours`,label:`Unapproved Payable hours`,sublabel:`(S + O)`},{key:`nonPayableHours`,label:`Non-payable hours`,sublabel:`(Leave/Holidays)`},{key:`approvedPayableHours`,label:`Approved Payable hours`,valueColor:`#15803d`}]},timesheetWeeklyTotals:{variant:`metrics`,title:`Weekly Totals (S + O)`,plainHeader:!0,valueSuffix:` hrs`,listRows:{itemValueKey:`weeklyTotals.payable`,itemLabel:(e,t)=>{let n=e.weekStart?(0,u.default)(e.weekStart).format(`MMM D`):``,r=e.weekEnd?(0,u.default)(e.weekEnd).format(`MMM D`):``,i=`Week ${e.weekNumber??t+1}`;return n&&r?`${i} (${n} - ${r})`:i}}},timesheetHourBreakdown:{variant:`bars`,valueSuffix:` hrs`,rows:[{key:`totalSTHours`,label:`Standard`,color:`#1d4ed8`,bg:`#D0E6FF`},{key:`totalOTHours`,label:`Overtime`,color:`#15803d`,bg:`#d9f7e3`},{key:`leaveHours`,label:`Leaves`,color:`#b45309`,bg:`#FFECBA`},{key:`holidayHours`,label:`Holidays`,color:`#6d28d9`,bg:`#ede9fe`,fallback:0}]},financeKpiRow:{variant:`kpi`}},je=[`blue`,`green`,`purple`,`peach`,`red`,`gray`],Me=[`purple`,`peach`,`green`],Ne=[`#1d4ed8`,`#ef4444`,`#16a34a`,`#9333ea`,`#f59e0b`,`#0891b2`],Pe={blue:`#1d4ed8`,green:`#16a34a`,purple:`#9333ea`,peach:`#f97316`,red:`#ef4444`,gray:`#6b7280`};function Fe(){let e=(typeof window<`u`&&window.__CORE_THEME_CONFIG__?.cardConfig)??{};return{...Ae,...e}}var Ie={timesheet:{currentLabel:`Standard`,currentColor:`blue`,pastLabel:`Supplementary`,pastColor:`gold`,thresholdMonths:0}};function Le(e){let t=(typeof window<`u`&&window.__CORE_THEME_CONFIG__?.periodBadgeConfig)??{};return{...Ie[e],...t[e]}}function Re({current:e,pageSize:t,total:r,onChange:i,onPageSizeChange:a}){let o=Math.min((e-1)*t+1,r),c=Math.min(e*t,r);return(0,l.jsxs)(s.Flex,{align:`center`,justify:`space-between`,className:`custom-pagination`,style:{color:n.En.textSecondary},children:[(0,l.jsxs)(s.Space,{size:5,align:`center`,children:[(0,l.jsx)(n.Tn,{variant:`body`,color:`secondary`,children:`Show`}),(0,l.jsx)(s.Select,{value:t,size:`small`,style:{width:72},popupMatchSelectWidth:72,onChange:e=>{a(e),i(1)},options:[{value:10,label:`10`},{value:12,label:`12`},{value:25,label:`25`},{value:50,label:`50`},{value:100,label:`100`}]}),(0,l.jsx)(n.Tn,{variant:`body`,color:`secondary`,children:`/ page`})]}),(0,l.jsxs)(s.Space,{size:16,align:`center`,children:[(0,l.jsx)(n.Tn,{variant:`body`,color:`secondary`,children:`Showing ${o} - ${c} of ${r}`}),(0,l.jsx)(s.Pagination,{current:e,pageSize:t,total:r,showSizeChanger:!1,showQuickJumper:!1,showLessItems:!0,onChange:i})]})]})}var{Title:ze,Text:q}=s.Typography;function J(e,t){return Array.isArray(t)?t.map(t=>J(e,t)).filter(Y).join(` `):typeof t==`string`&&t.includes(`.`)?t.split(`.`).reduce((e,t)=>e==null?e:e[t],e):e[t]}var Y=e=>e!=null&&e!==``;function X(e,t,n={}){return{...n,...e.styles?.[t]||{}}}function Be(e){return Y(e.title)?(0,l.jsx)(ze,{level:5,style:X(e,`headerTitle`),children:e.title}):void 0}function Ve(e,t){return Y(e.title)?t:void 0}function He(e){return[`blue`,`green`,`purple`,`peach`,`red`,`gray`].includes(nt(e))}function Ue(e,t){let n=t||``,r=X(e,`card`);return Y(n)?He(n)?{className:n,style:r}:{className:``,style:{...r,background:n,borderColor:e.styles?.card?.borderColor||n}}:{className:``,style:r}}function We(e,t){return t?t.split(`.`).reduce((e,t)=>e==null?e:e[t],e):e}function Ge(e){return String(e).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function Ke(e){if(!Y(e))return null;let t=new Date(e);return isNaN(t)||t.getFullYear()<=1?null:n.kn(t,n.zn().dateFormat)}function qe(e){let t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function Je(e){return String(e??``).replace(/(?:\s*\(\d+[\d,]*\))+\s*$/,``).trim()}function Ye(e,t){let n=[e?.data?.total,e?.data?.count,e?.data?.totalCount,e?.data?.pagination?.total,e?.data?.data?.total,e?.data?.data?.count,e?.data?.data?.totalCount,e?.total,e?.count,e?.totalCount,e?.pagination?.total],r=[e?.data?.todoCount,e?.data?.toDoCount,e?.data?.pendingCount,e?.data?.data?.todoCount,e?.data?.data?.toDoCount,e?.todoCount,e?.toDoCount,e?.pendingCount],i=[e?.data?.resolvedCount,e?.data?.data?.resolvedCount,e?.resolvedCount],a=r.map(qe).find(e=>e!==null),o=i.map(qe).find(e=>e!==null),s=n.map(qe).find(e=>e!==null),c=a!==null&&o!==null?a+o:null,l=Array.isArray(t)?t.length:null;return{totalCount:s??c??l,todoCount:a,resolvedCount:o}}function Xe(e,t){let n=RegExp(`^${t}\\d+$`);return Object.keys(e).filter(e=>e===t||n.test(e)).map(n=>({field:e[n],n:n===t?1:Number(n.slice(t.length))})).sort((e,t)=>t.n-e.n).map(e=>e.field)}function Ze(e){return Math.max(1,Math.floor(24/(e||4)))}function Qe(e){if(typeof e!=`string`)return{};let t=e.toLowerCase().replace(/\s/g,``).match(/^(\d+)x(\d+)$/);if(!t)return{};let n=Number(t[1]);return{columns:n,maxCount:n*Number(t[2])}}function $e(e,t){let n=Qe(e.layout),r=e.columns??n.columns??t,i=e.maxCount??n.maxCount;return{columns:r,span:Ze(r),maxCount:i}}function et(e,t){return t?e.slice(0,t):e}function tt(e,t){return e.color?e.color===`auto`?je[t%je.length]:e.color:``}var nt=e=>String(e??``).trim().toLowerCase();function rt(e,t){return(Array.isArray(t)?t:[t]).some(t=>Y(t)&&nt(t)===nt(e))}function it(e,t){if(!e.colorMap)return null;let n=Object.keys(e.colorMap).find(e=>rt(e,t));return n?e.colorMap[n]:null}function at(e,t,n){if(!e.labelMap)return n;let r=Object.keys(e.labelMap).find(e=>rt(e,t));return r?e.labelMap[r]:n}function ot(e,t){if(!e.valueMap)return null;let n=Object.keys(e.valueMap).find(e=>rt(e,t));return n?e.valueMap[n]:null}function st(e,t){return!Array.isArray(e.show)||e.show.length===0||e.show.some(e=>rt(e,t))}function ct(e,t,n){return st(e,t)?Array.isArray(e.hide)?e.hide.some(e=>typeof e==`number`?e===n:rt(e,t)):!1:!0}function lt(e,t){for(let n of Xe(e,`titleKey`)){let e=J(t,n);if(Y(e))return e}return null}function ut(e){return!e||typeof e!=`object`||Array.isArray(e)?[]:Object.entries(e).filter(([,e])=>typeof e==`number`||typeof e==`string`&&e!==``&&!isNaN(e)).map(([e,t])=>({key:e,label:Ge(e),value:Number(t)}))}function dt(e,t){let n=e?.data??e,r=Array.isArray(n?.fields)?n.fields:null,i=t.dynamicCommonCount?.keys?.[0],a=r?[...r.find(e=>e.key===i)?[r.find(e=>e.key===i)]:[],...r.filter(e=>e.key!==i)]:[n];return a.some(e=>Array.isArray(e?.counts))?a.reduce((e,t)=>!t||!Array.isArray(t.counts)?e:(e.total=Math.max(Number(e.total)||0,Number(t.total)||0),t.counts.forEach(({key:t,count:n})=>{e[t]=Number(n)||0}),e),{total:0}):n}function ft(e,t){let n=ut(e),r=t.totalKey,i=r?J(e||{},r):void 0,a=r&&Y(i)&&!isNaN(i),o=n.map((e,t)=>({...e,_i:t})).filter(e=>!(a&&rt(r,[e.key,e.label]))).filter(e=>!ct(t,[e.key,e.label],e._i)).map((e,n)=>{let r=it(t,[e.key,e.label]),i=r?Pe[nt(r)]||r:Ne[e._i%Ne.length];return{label:at(t,[e.key,e.label],e.label),value:e.value,barColor:i,accentColor:n===0?`#f97316`:null,showInfo:n===0}});return{total:a?Number(i):o.reduce((e,t)=>e+t.value,0),rows:et(o,$e(t,1).maxCount)}}function pt({item:e,group:t,color:n}){let r=n=>Xe(t,n).map(t=>J(e,t)).filter(Y),i=r(`titleKey`),a=r(`countKey`),o=r(`nameKey`),c=r(`valueKey`),u=Ue(t,n);return(0,l.jsxs)(s.Card,{className:`dyn-card-item ${u.className}`.trim(),style:u.style,bordered:!0,children:[i.map((e,n)=>(0,l.jsx)(q,{className:`dyn-card-title`,style:X(t,`cardTitle`),children:e},`t${n}`)),a.map((e,n)=>(0,l.jsx)(s.Statistic,{value:e,className:`dyn-card-stat`,valueStyle:X(t,`cardValue`)},`c${n}`)),o.map((e,n)=>(0,l.jsx)(q,{className:`dyn-card-name`,style:X(t,`cardName`),children:e},`n${n}`)),c.length>0&&(0,l.jsx)(`div`,{className:`dyn-card-footer`,style:X(t,`cardFooter`),children:c.map((e,n)=>(0,l.jsx)(q,{className:`dyn-card-sub`,style:X(t,`cardSub`),children:e},`v${n}`))})]})}function mt({group:e}){let{span:t,maxCount:n}=$e(e,4),r=et((Array.isArray(e.list)?e.list:[]).map((t,n)=>({item:t,name:lt(e,t),_i:n})).filter(t=>!ct(e,t.name,t._i)),n);return(0,l.jsx)(s.Card,{className:`dyn-card-section`,style:X(e,`section`),title:Be(e),extra:Ve(e,(0,l.jsxs)(q,{type:`secondary`,style:X(e,`headerExtra`),children:[r.length,` cards`]})),children:(0,l.jsx)(s.Row,{gutter:[16,16],children:r.map(n=>{let r=it(e,n.name)||tt(e,n._i);return(0,l.jsx)(s.Col,{xs:24,sm:12,md:t>=12?12:t*2,lg:t,xl:t,children:(0,l.jsx)(pt,{item:n.item,group:e,color:r})},n._i)})})})}function ht({group:e,items:t}){let{span:n,maxCount:r}=$e(e,4),i=et(t.map((e,t)=>({...e,_i:t})).filter(t=>!ct(e,[t.key,t.label],t._i)),r);return(0,l.jsx)(s.Card,{className:`dyn-card-section`,style:X(e,`section`),title:Be(e),extra:Ve(e,(0,l.jsxs)(q,{type:`secondary`,style:X(e,`headerExtra`),children:[i.length,` cards`]})),children:(0,l.jsx)(s.Row,{gutter:[16,16],children:i.map(t=>{let r=Ue(e,it(e,[t.key,t.label])||tt(e,t._i));return(0,l.jsx)(s.Col,{xs:24,sm:12,md:n>=12?12:n*2,lg:n,xl:n,children:(0,l.jsxs)(s.Card,{className:`dyn-card-item ${r.className}`.trim(),style:r.style,bordered:!0,children:[(0,l.jsx)(q,{className:`dyn-card-title`,style:X(e,`cardTitle`),children:at(e,[t.key,t.label],t.label)}),(0,l.jsx)(s.Statistic,{value:t.value,groupSeparator:e.groupSeparator??`,`,className:`dyn-card-stat`,valueStyle:X(e,`cardValue`)}),Y(ot(e,[t.key,t.label]))&&(0,l.jsx)(q,{className:`dyn-card-sub`,style:X(e,`cardSub`),children:ot(e,[t.key,t.label])})]})},t._i)})})})}function gt({group:e,data:t}){let{total:n,rows:r}=ft(t,e),i=e.tooltipText;return(0,l.jsxs)(s.Card,{className:`submission-card`,style:X(e,`card`),children:[Y(e.title)&&(0,l.jsxs)(s.Row,{justify:`space-between`,align:`middle`,className:`submission-header`,style:X(e,`submissionHeader`),children:[(0,l.jsx)(s.Col,{children:(0,l.jsxs)(q,{className:`submission-title`,style:X(e,`submissionTitle`),children:[e.title,` `,i&&(0,l.jsx)(s.Tooltip,{title:i,children:(0,l.jsx)(c.InfoCircleOutlined,{className:`submission-info-icon`,style:X(e,`infoIcon`)})})]})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{className:`submission-total`,style:X(e,`submissionTotal`),children:Number(n||0).toLocaleString()})})]}),(0,l.jsx)(`div`,{className:`submission-rows`,style:X(e,`submissionRows`),children:r.map((t,r)=>(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(s.Row,{justify:`space-between`,align:`middle`,className:`submission-row-header`,style:X(e,`submissionRowHeader`),children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Row,{align:`middle`,gutter:6,children:(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{className:`submission-row-label`,style:X(e,`submissionRowLabel`),children:t.label})})})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{className:`submission-row-value`,style:X(e,`submissionRowValue`),children:t.value})})]}),(0,l.jsx)(`div`,{className:`submission-bar-track`,style:X(e,`submissionBarTrack`),children:(0,l.jsx)(`div`,{className:`submission-bar-fill`,style:{width:`${t.value/(n||1)*100}%`,background:t.barColor}})})]},`${t.label}-${r}`))})]})}function _t(e){if(!Y(e))return`-`;let t=new Date(e);return!Number.isNaN(t.getTime())&&/date|time/i.test(String(e))?n.An(t):String(e)}function vt({group:e,data:t}){let n=e.totalKey??`totalScore`,r=e.maxKey??`maximumScore`,i=e.statusKey??`status`,a=e.attemptDateKey??`attemptDate`,o=e.timeTakenKey??`timeTaken`,c=e.rankKey??`rank`,u=Number(J(t||{},n)??0),d=Number(J(t||{},r)??100)||100,f=Math.max(0,Math.min(100,Math.round(u/d*100))),p=ft(t,{...e,totalKey:n,hide:[...Array.isArray(e.hide)?e.hide:[],r,i,a,o,c]}).rows,m=[{key:i,label:e.statusLabel??`Status`},{key:a,label:e.attemptDateLabel??`Attempt Date`},{key:o,label:e.timeTakenLabel??`Time Taken`},{key:c,label:e.rankLabel??`Rank`}].filter(e=>Y(J(t||{},e.key)));return(0,l.jsxs)(s.Card,{className:`assessment-card`,style:X(e,`card`),title:Be(e),children:[(0,l.jsxs)(`div`,{className:`assessment-card__top`,children:[(0,l.jsx)(s.Progress,{type:`circle`,percent:f,format:()=>`${Number(u||0).toLocaleString()}/${d.toLocaleString()}`,strokeColor:e.scoreColor??`#6d4aff`,trailColor:e.trailColor??`#edf0f5`}),(0,l.jsx)(`dl`,{className:`assessment-card__meta`,children:m.map(e=>(0,l.jsxs)(`div`,{className:`assessment-card__meta-row`,children:[(0,l.jsx)(`dt`,{children:e.label}),(0,l.jsx)(`dd`,{children:_t(J(t||{},e.key))})]},e.key))})]}),(0,l.jsx)(`div`,{className:`submission-rows assessment-card__rows`,style:X(e,`submissionRows`),children:p.map(t=>(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(s.Row,{justify:`space-between`,align:`middle`,className:`submission-row-header`,style:X(e,`submissionRowHeader`),children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{className:`submission-row-label`,style:X(e,`submissionRowLabel`),children:t.label})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{className:`submission-row-value`,style:X(e,`submissionRowValue`),children:t.value})})]}),(0,l.jsx)(`div`,{className:`submission-bar-track`,style:X(e,`submissionBarTrack`),children:(0,l.jsx)(`div`,{className:`submission-bar-fill`,style:{width:`${Math.max(0,Math.min(100,Number(t.value)/d*100))}%`,background:t.barColor}})})]},t.label))})]})}function yt(e,t={},n={}){let r=Y(e)?e:t.fallback;if(!Y(r))return`-`;let i=Number(r);if(!Number.isFinite(i))return String(r);let a=t.suffix??n.valueSuffix??``;return`${i.toFixed(1).replace(/\.0$/,``)}${a}`}function bt({group:e,data:t}){let n=Array.isArray(t);return(0,l.jsxs)(s.Card,{className:`timesheet-summary-card`,size:`small`,children:[Y(e.title)&&(e.plainHeader?(0,l.jsx)(q,{type:`secondary`,style:{fontSize:12,fontWeight:600},children:e.title}):(0,l.jsxs)(`div`,{className:`timesheet-summary-card__head`,children:[(0,l.jsx)(ze,{level:5,style:{margin:0},children:e.title}),e.headerExtra]})),!n&&(0,l.jsx)(`div`,{className:`timesheet-summary-card__metrics`,children:(e.rows??[]).map(n=>(0,l.jsxs)(`div`,{className:`timesheet-summary-card__metric-row`,children:[(0,l.jsxs)(q,{type:`secondary`,style:{fontSize:12},children:[n.label,` `,n.sublabel&&(0,l.jsx)(`span`,{style:{fontSize:11},children:n.sublabel})]}),(0,l.jsx)(q,{strong:!0,style:{fontSize:13,whiteSpace:`nowrap`,color:n.valueColor},children:yt(J(t??{},n.key),n,e)})]},n.key))}),n&&t.length>0&&(0,l.jsx)(`div`,{className:`timesheet-summary-card__weekly`,children:t.map((t,n)=>(0,l.jsxs)(`div`,{className:`timesheet-summary-card__week-row`,children:[(0,l.jsx)(q,{type:`secondary`,style:{fontSize:12},children:e.listRows?.itemLabel?e.listRows.itemLabel(t,n):`Row ${n+1}`}),(0,l.jsx)(q,{strong:!0,style:{fontSize:12},children:yt(J(t,e.listRows?.itemValueKey),e.listRows,e)})]},n))})]})}function xt({group:e,data:t}){return(0,l.jsxs)(s.Card,{className:`timesheet-summary-card`,size:`small`,children:[(Y(e.title)||e.headerExtra)&&(0,l.jsxs)(`div`,{className:`timesheet-summary-card__head`,children:[Y(e.title)&&(0,l.jsx)(ze,{level:5,style:{margin:0},children:e.title}),e.headerExtra]}),(0,l.jsx)(`div`,{className:`timesheet-summary-card__bars`,children:(e.rows??[]).map(n=>(0,l.jsxs)(`div`,{className:`timesheet-summary-card__bar`,style:{background:n.bg},children:[(0,l.jsx)(q,{style:{fontSize:12,color:n.color,fontWeight:500},children:n.label}),(0,l.jsx)(q,{strong:!0,style:{fontSize:13,color:n.color},children:yt(J(t??{},n.key),n,e)})]},n.key))})]})}function St({group:e,data:t}){let n=Array.isArray(t)?t:[],r=`finance-kpi-row${e.compact?` finance-kpi-row--compact`:``}`;if(e.loading){let e=n.length||4;return(0,l.jsx)(`div`,{className:r,children:Array.from({length:e},(e,t)=>(0,l.jsxs)(`div`,{className:`finance-kpi fin-kpi--skeleton`,children:[(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--label`}),(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--value`})]},t))})}return(0,l.jsx)(`div`,{className:r,children:n.map(e=>(0,l.jsxs)(`div`,{className:`finance-kpi fin-kpi--${e.tone??`neutral`}`,children:[e.icon?(0,l.jsx)(`span`,{className:`fin-kpi__icon`,children:e.icon}):null,(0,l.jsxs)(`span`,{className:`fin-kpi__body`,children:[(0,l.jsx)(`span`,{className:`finance-kpi__label`,children:e.label}),(0,l.jsx)(`strong`,{className:`finance-kpi__value`,children:e.value}),e.sub??e.hint?(0,l.jsx)(`span`,{className:`finance-kpi__hint`,children:e.sub??e.hint}):null]})]},e.key??e.label))})}function Ct(e,t){return nt(J(t,e.pillKey||`status`))===`resolved`}function wt(e,t){return Y(e.dateKey?Ke(J(t,e.dateKey)):null)}function Tt(e,t){let n=nt(J(t,e.pillKey||`status`));if(n===`tagged`||n===`tag user`||n===`tagged user`)return!0;let r=t?.receiver??t?.receivers??t?.receiverId??t?.receiverName??t?.taggedUser;if(Array.isArray(r))return r.length>0;if(r&&typeof r==`object`)return Object.keys(r).length>0;if(Y(r))return!0;let i=`${J(t,e.headingKey||`title`)??``} ${J(t,e.bodyKey||`notes`)??``}`;return/(^|\s)@[^\s]+/.test(i)}function Et(e,t,n){return Ct(e,t)?`gray`:Tt(e,t)?`blue`:wt(e,t)?`peach`:it(e,e.colorBy?J(t,e.colorBy):null)||(e.color&&e.color!==`auto`?e.color:Me[n%Me.length])}function Dt(e,t){let{start:n,end:r}=e.dateRange||{};if(!n||!r)return!0;let i=J(t,e.footerRightKey||`createdAt`);if(!Y(i))return!0;let a=new Date(i);return isNaN(a)?!0:a>=n&&a<=r}function Ot(e,t,n){let r=t.dateKey?Ke(J(e,t.dateKey)):null;return{type:Et(t,e,n),pill:t.pillKey?J(e,t.pillKey):null,heading:t.headingKey?J(e,t.headingKey):null,body:t.bodyKey?J(e,t.bodyKey):null,footerLeft:t.footerLeftKey?J(e,t.footerLeftKey):null,footerRight:t.footerRightKey?Ke(J(e,t.footerRightKey)):null,dot:r?`#f97316`:null,date:r}}function kt({text:e,lines:t,style:n}){let r=(0,o.useRef)(null),[i,a]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=r.current;if(!e)return;let t=0,n=()=>{t=requestAnimationFrame(()=>{let t=e.scrollHeight-e.clientHeight>1;a(e=>e===t?e:t)})};n();let i=new ResizeObserver(n);return i.observe(e),()=>{cancelAnimationFrame(t),i.disconnect()}},[e,t]);let c=`sticky-note-body${t?` clamp-${t}`:``}`;return(0,l.jsx)(s.Popover,{trigger:`hover`,placement:`topLeft`,overlayClassName:`sticky-note-popover`,content:i?(0,l.jsx)(`div`,{className:`sticky-note-popover-content`,children:e}):null,open:i?void 0:!1,children:(0,l.jsx)(`div`,{ref:r,className:c,style:n,children:e})})}function At({group:e}){let t=(0,d.useNavigate)(),n=(0,d.useLocation)(),r=()=>t(`/popup/sticky-notes`,{state:{background:n,selectedIds:[],selectedRecords:[],moduleName:`general`,popupContext:{}}}),i=e=>t(`/popup/sticky-notes`,{state:{background:n,selectedIds:[],selectedRecords:[],moduleName:`general`,popupContext:{editingNoteId:e._id??e.id,editingHeading:e.title,editingComments:e.notes,editingTargetDate:e.reminder?.time||void 0}}}),[a,u]=(0,o.useState)(new Set),f=async e=>{let t=e._id??e.id;u(e=>new Set(e).add(t));try{await se(t),s.message.success(`Note resolved`)}catch{s.message.error(`Failed to resolve note`),u(e=>{let n=new Set(e);return n.delete(t),n})}},{span:p,maxCount:m}=$e(e,2),h=t=>e.colorBy?J(t,e.colorBy):e.headingKey?J(t,e.headingKey):null,g=(Array.isArray(e.list)?e.list:[]).filter(e=>!a.has(e._id??e.id)).map((e,t)=>({item:e,_i:t})).filter(({item:t,_i:n})=>!ct(e,h(t),n)).filter(({item:t})=>Dt(e,t)),[_,v]=(0,o.useState)(`todo`),y=g.filter(({item:t})=>!Ct(e,t)),b=g.filter(({item:t})=>Ct(e,t)),x=e.showTabs,S=x?_===`resolved`?b:y:g,[C,w]=(0,o.useState)(e.pageSize||12),[T,E]=(0,o.useState)(1);(0,o.useEffect)(()=>{E(1)},[_,e.dateRange]);let D=Math.max(1,Math.ceil(S.length/C));(0,o.useEffect)(()=>{E(e=>Math.min(e,D))},[D]);let O=x?S.slice((T-1)*C,T*C):et(g,m);return(0,l.jsxs)(s.Card,{className:`sticky-card`,style:X(e,`section`),title:Be(e),extra:Ve(e,(0,l.jsxs)(`div`,{className:`sticky-card-actions`,children:[e.headerExtra,(0,l.jsx)(s.Tooltip,{title:`Add note`,children:(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.PlusOutlined,{}),size:`small`,onClick:r})}),Y(e.viewAllUrl)&&(0,l.jsx)(s.Button,{type:`link`,size:`small`,onClick:()=>t(e.viewAllUrl,{state:{moduleName:e.moduleName,title:e.title,request:e.request}}),children:`View all`})]})),children:[x&&(0,l.jsx)(P,{activeKey:_,onChange:v,tabs:[{key:`todo`,title:`To-do`,count:y.length},{key:`resolved`,title:`Resolved Notes`,count:b.length}]}),O.length===0?(0,l.jsx)(s.Empty,{description:`No notes found`}):(0,l.jsx)(`div`,{className:x?`sticky-notes-scroll`:void 0,children:(0,l.jsx)(s.Row,{gutter:[12,12],children:O.map(({item:t,_i:n})=>{let r=Ot(t,e,n),a=Ue(e,r.type);return(0,l.jsx)(s.Col,{xs:24,sm:24,md:p>=12?12:p*2,lg:p,xl:p,children:(0,l.jsxs)(`div`,{className:`sticky-note ${a.className}`.trim(),style:a.style,children:[(0,l.jsxs)(s.Space,{size:4,className:`sticky-note-hover-actions`,children:[(0,l.jsx)(s.Tooltip,{title:`Edit`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.EditOutlined,{}),onClick:()=>i(t)})}),(0,l.jsx)(s.Tooltip,{title:`Resolve`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.CheckCircleOutlined,{}),onClick:()=>f(t)})})]}),(0,l.jsxs)(s.Space,{size:8,align:`center`,className:`sticky-note-pill-row`,children:[Y(r.pill)&&(0,l.jsxs)(s.Tag,{style:X(e,`stickyPill`),children:[r.dot&&(0,l.jsx)(`span`,{className:`sticky-note-dot`,style:{background:r.dot}}),r.pill]}),r.date&&(0,l.jsx)(q,{className:`sticky-note-date`,style:X(e,`stickyDate`),children:r.date})]}),Y(r.heading)&&(0,l.jsx)(q,{strong:!0,className:`sticky-note-heading`,style:X(e,`stickyHeading`),children:r.heading}),Y(r.body)&&(0,l.jsx)(kt,{text:r.body,lines:e.bodyLines,style:X(e,`stickyBody`)}),(0,l.jsxs)(s.Row,{justify:`space-between`,align:`middle`,className:`sticky-note-footer`,style:X(e,`stickyFooter`),children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{style:X(e,`stickyFooterText`),children:r.footerLeft})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{style:X(e,`stickyFooterText`),children:r.footerRight})})]})]})},n)})})}),x&&S.length>0&&(0,l.jsx)(`div`,{className:`sticky-notes-pagination`,children:(0,l.jsx)(Re,{current:T,pageSize:C,total:S.length,onChange:E,onPageSizeChange:w})})]})}function jt({group:e,children:t}){let n=e.frameClassName||`dyn-frame`,r=e.viewAll?(0,l.jsx)(`a`,{className:`dyn-frame-view-all`,children:typeof e.viewAll==`string`?e.viewAll:`View all`}):void 0;return(0,l.jsxs)(s.Card,{className:n,title:e.frameTitle,extra:r,children:[t,e.footer&&(0,l.jsx)(`div`,{className:`${n}-footer`})]})}function Mt({group:e,data:t}){let n=e.variant===`sticky`?Je(e.title):e.title,r=e.variant===`sticky`&&Y(e.totalCount)?`${n} (${Number(e.totalCount).toLocaleString()})`:n,i=r===e.title?e:{...e,title:r},a=i.frame?{...i,title:void 0}:i,o=a.variant===`sticky`?(0,l.jsx)(At,{group:{...a,list:Array.isArray(t)?t:[]}}):a.variant===`counts`?(0,l.jsx)(ht,{group:a,items:ut(t)}):a.variant===`submission`?(0,l.jsx)(gt,{group:a,data:t}):a.variant===`assessment`?(0,l.jsx)(vt,{group:a,data:t}):a.variant===`metrics`?(0,l.jsx)(bt,{group:a,data:t}):a.variant===`bars`?(0,l.jsx)(xt,{group:a,data:t}):a.variant===`kpi`?(0,l.jsx)(St,{group:a,data:t}):(0,l.jsx)(mt,{group:{...a,list:Array.isArray(t)?t:[]}});return i.frame?(0,l.jsx)(jt,{group:i,children:o}):o}function Nt({moduleName:e,title:t,maxCount:n,layout:r,columns:i,request:a,viewAll:c=!0,staticData:u,showTabs:d,dateRange:f,headerExtra:h,rows:g,loading:_}){let v=Fe()[e],y=a?JSON.stringify(a):``,b=g?JSON.stringify(g):``,x=(0,o.useMemo)(()=>{if(!v)return v;let o={title:t,maxCount:n,layout:r,columns:i,showTabs:d,dateRange:f,headerExtra:h,rows:g,loading:_},s={...v,moduleName:e};for(let e in o)Y(o[e])&&(s[e]=o[e]);return a&&(s.request={...v.request,...a,params:{...v.request?.params,...a.params},body:{...v.request?.body,...a.body}}),c||(s.viewAllUrl=void 0),s},[v,t,n,r,i,y,c,d,f,h,b,_]),[S,C]=(0,o.useState)({moduleName:null,resp:null,error:null}),[w,T]=(0,o.useState)(0);(0,o.useEffect)(()=>{if(!x?.refreshEvent)return;let e=()=>T(e=>e+1);return window.addEventListener(x.refreshEvent,e),()=>window.removeEventListener(x.refreshEvent,e)},[x?.refreshEvent]),(0,o.useEffect)(()=>{if(!x)return;if(u!==void 0){let t=dt(u,x);C({moduleName:e,resp:t,error:null});return}if(x.dynamicCommonCount){let t=!0;return m(x.dynamicCommonCount).then(n=>{t&&C({moduleName:e,resp:dt(n,x),error:null})}).catch(n=>{t&&C({moduleName:e,resp:null,error:n})}),()=>{t=!1}}if(!x.request)return;let t=!0;return p(e,x.request).then(n=>{t&&C({moduleName:e,resp:n,error:null})}).catch(n=>{t&&C({moduleName:e,resp:null,error:n})}),()=>{t=!1}},[e,x,u,w]);let E=S.moduleName!==e,D=E?null:S.error,O=E?null:S.resp;if(!x)return(0,l.jsx)(s.Empty,{description:`Unknown dashboard module: ${e}`});if(E)return(0,l.jsx)(s.Card,{className:`dyn-card-section`,style:X(x,`section`),title:Be(x),children:(0,l.jsx)(`div`,{style:{textAlign:`center`,padding:24},children:(0,l.jsx)(s.Spin,{})})});if(D)return(0,l.jsx)(s.Card,{className:`dyn-card-section`,style:X(x,`section`),title:Be(x),children:(0,l.jsx)(s.Empty,{description:`Failed to load: ${D.message}`})});let k=We(O,x.listPath),A=x.variant===`sticky`?Ye(O,k):null,j=x.variant===`sticky`?{...x,...A}:x;return(0,l.jsx)(Mt,{group:j,data:k})}function Pt({moduleName:e,title:t,layout:n,columns:r,maxCount:i,request:a,viewAll:o,staticData:c,showTabs:u,dateRange:d,headerExtra:f,rows:p,loading:m}){return e?(0,l.jsx)(`div`,{className:`dyn-cards`,children:(0,l.jsx)(Nt,{moduleName:e,title:t,layout:n,columns:r,maxCount:i,request:a,viewAll:o,staticData:c,showTabs:u,dateRange:d,headerExtra:f,rows:p,loading:m})}):(0,l.jsx)(s.Empty,{description:`DynamicCards: a moduleName prop is required`})}var{Text:Ft}=s.Typography;function It(e){return(e??[]).map(e=>({key:e.userId,title:e.isSelf?`${e.name} (You)`:e.name,searchText:`${e.name} ${e.email??``}`.toLowerCase(),children:It(e.children)}))}function Lt(e,t){let n=[];for(let r of e){let e=Lt(r.children??[],t);(r.searchText.includes(t)||e.length>0)&&n.push({...r,children:e})}return n}function Rt(e,t=[]){for(let n of e)t.push(n.key),Rt(n.children??[],t);return t}function zt({value:e=[],onChange:t}){let[n,r]=(0,o.useState)(null),[i,a]=(0,o.useState)(!0),[u,d]=(0,o.useState)(null),[f,p]=(0,o.useState)(``),[m,h]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=!0;return g().then(t=>{e&&r(It(t?.users))}).catch(t=>{e&&d(t)}).finally(()=>{e&&a(!1)}),()=>{e=!1}},[]);let _=f.trim().toLowerCase(),v=(0,o.useMemo)(()=>_&&n?Lt(n,_):n,[n,_]),y=_?{expandedKeys:Rt(v??[])}:{},b=(0,l.jsxs)(`div`,{style:{width:280},children:[(0,l.jsx)(s.Input.Search,{placeholder:`Search users`,allowClear:!0,value:f,onChange:e=>p(e.target.value),style:{marginBottom:8}}),i&&(0,l.jsx)(`div`,{style:{padding:24,textAlign:`center`},children:(0,l.jsx)(s.Spin,{size:`small`})}),u&&(0,l.jsx)(s.Empty,{description:`Could not load users`}),!i&&!u&&(v?.length?(0,l.jsx)(`div`,{style:{maxHeight:280,overflow:`auto`},children:(0,l.jsx)(s.Tree,{checkable:!0,selectable:!1,defaultExpandAll:!0,treeData:v,checkedKeys:e,onCheck:(e,n)=>t(n.checkedNodes.map(e=>e.key)),...y})}):(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:`No users`})),e.length>0&&(0,l.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginTop:8,paddingTop:8,borderTop:`1px solid #f0f0f0`},children:[(0,l.jsxs)(Ft,{type:`secondary`,children:[e.length,` selected`]}),(0,l.jsx)(s.Button,{type:`link`,size:`small`,onClick:()=>t([]),children:`Clear`})]})]});return(0,l.jsx)(s.Popover,{content:b,trigger:`click`,placement:`bottomRight`,open:m,onOpenChange:h,children:(0,l.jsx)(s.Badge,{count:e.length,size:`small`,offset:[-4,4],children:(0,l.jsxs)(s.Button,{icon:(0,l.jsx)(c.FilterOutlined,{}),children:[`Filter by `,(0,l.jsx)(c.DownOutlined,{style:{fontSize:10}})]})})})}function Bt(e,t={}){let n=Array.isArray(e?.autoValueRules)?e.autoValueRules:[];for(let e of n){let n=Array.isArray(e?.whenRoleId)?e.whenRoleId.map(Number):[],r=Array.isArray(e?.whenUserId)?e.whenUserId.map(Number):[],i=t.roleId!==void 0&&n.includes(t.roleId),a=t.userId!==void 0&&r.includes(t.userId);if(i||a)return{matched:!0,value:e.value}}return{matched:!1,value:void 0}}function Vt(e){if(e==null||e===``)return``;let t=Number(e);if(!Number.isFinite(t)||t<0)return``;if(t===0)return`today`;if(t===1)return`yesterday`;if(t<30)return`${t} days ago`;if(t<60)return`about a month ago`;if(t<365)return`about ${Math.round(t/30)} months ago`;let n=Math.floor(t/365);return n===1?`over a year ago`:`over ${n} years ago`}function Ht(e,t){return(Array.isArray(t)&&t.length?t:Object.keys(e??{})).map(t=>e?.[t]).map(e=>e==null?``:String(e).trim()).filter(Boolean).join(` · `)}function Ut(e,t={}){return e?String(e).replace(/\{(\w+)\}/g,(e,n)=>t[n]===void 0?e:String(t[n])):``}function Wt(e,t){let n=Ht(e?.record,t),r=Vt(e?.updatedDaysAgo);return{name:n||`an existing record`,age:r||`previously`,days:Number.isFinite(Number(e?.updatedDaysAgo))?String(e.updatedDaysAgo):``,updatedOn:e?.updatedAt?String(e.updatedAt).slice(0,10):``,stage:e?.stage??``,weight:e?.weight??``}}function Gt(e,t={}){let n=Wt(e,t.displayFields),r=(e?.policy??t.policy)===`block`;return Ut(e?.message||t.message||(r?`We already have {name} on file — last updated {age}. Please open that record and update it, rather than adding a second copy.`:`We already have {name} on file — last updated {age}. You can carry on and update that record with what you’ve just entered, or go back and check first.`),n)}function Kt(e,t={}){return e?.duplicate?(e.policy??t.policy??`prompt`)===`block`:!1}function qt(e,t){let n=e?.record??{},r=(Array.isArray(t)&&t.length?t:Object.keys(n)).map(e=>({label:Jt(e),value:n[e]})).filter(e=>e.label&&e.value!==void 0&&e.value!==null&&String(e.value).trim()!==``),i=Vt(e?.updatedDaysAgo);return i&&r.push({label:`Last updated`,value:i}),r}function Jt(e){let t=String(e??``).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_\-.]+/g,` `).trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):``}function Yt({form:e,moduleName:t,recordId:r,config:i={},onUseExisting:a}={}){let[s,c]=(0,o.useState)(!1),l=(0,o.useRef)(null),u=(0,o.useCallback)(async i=>{if(!t)return{duplicate:!1};c(!0);try{return await n.mt({module:t,payload:i??e.getFieldsValue(!0)??{},excludeId:r})}finally{c(!1)}},[e,t,r]);return{prompt:(0,o.useCallback)(async({reason:e,payload:t,carry:r}={})=>{let o=await u(t);if(!o?.duplicate)return l.current=null,`clear`;if(l.current&&l.current===o.id)return`existing`;let s=Gt(o,i),c=qt(o,i.displayFields),d=o.weight===`weak`?`This might be someone you already have`:`You already have this person on file`;return Kt(o,i)?(await n.Vt({tone:`duplicate`,title:d,facts:c,body:s}),`blocked`):await n.Bt({tone:`duplicate`,title:d,facts:c,body:s,okText:`Open their record`,cancelText:`Let me check first`,footnote:r?.files?`We’ll take you to their record with the résumé you just uploaded already attached — save there to keep it. The one already on file is kept too, as an earlier version. Nothing on this form has been filled in.`:`Everything already on their record is kept. Nothing on this form has been filled in.`})?(l.current=o.id??!0,a?.(o.id,o,e,r),`existing`):`blocked`},[u,i,a]),check:u,checking:s,acknowledgedId:l}}var Xt=[[`uploadname`,`uploadedfilename`,`originalname`,`filename`],[`uniquename`]],Zt=`copyuniquename`;function Qt(e,t,{excludeSanitised:n=!1}={}){let r=String(e).toLowerCase();return n&&r.endsWith(Zt)?!1:t.some(e=>r.endsWith(e))}function $t(e){if(!e||typeof e!=`object`)return``;let t=e.uploadedFileName??e.name;if(typeof t==`string`&&t.trim())return t.trim();let n=Object.entries(e).filter(([,e])=>typeof e==`string`&&e.trim());for(let e of Xt){let t=n.find(([t])=>Qt(t,e,{excludeSanitised:!0}));if(t)return t[1].trim()}let r=n.find(([e])=>String(e).toLowerCase().endsWith(Zt));return r?r[1].trim():``}function en(e){if(!e||typeof e!=`object`)return``;let t=e.location??e.url;if(typeof t==`string`&&t.trim())return t.trim();let n=Object.entries(e).find(([e,t])=>typeof t==`string`&&t.trim()&&String(e).toLowerCase().endsWith(`copylocation`));return n?n[1].trim():``}var tn=`authToken`,nn=`authUser`,rn=`authLoginSession`,an=[`access_token`,`refresh_token`,`id_token`,`token_type`,`expires_in`,`refresh_expires_in`,`menu`,`footermenu`,`menuPermission`,`default_values`,`roleId`,`companyName`,`preferred_Username`,`user_Email`,`userName`,`userId`,`tenantId`,`businessId`,`businessUnitId`,`activeKey`,`ct_project_id`,`ct_project_name`],on=`test-flows`,sn=[{value:`module`,label:`Module`,isVisible:!0,type:`text`},{value:`flow`,label:`Flow`,isVisible:!0,type:`text`},{value:`step_order`,label:`Step Order`,isVisible:!0,type:`number`},{value:`keyword`,label:`Action`,isVisible:!0,type:`text`},{value:`description`,label:`Description`,isVisible:!0,type:`text`},{value:`target`,label:`Key`,isVisible:!0,type:`text`},{value:`tags`,label:`Tags`,isVisible:!0,type:`text`},{value:`value`,label:`Value`,isVisible:!0,type:`text`},{value:`expected`,label:`Expected`,isVisible:!0,type:`text`}],cn=`lms-flows`,ln=[{value:`module`,label:`Module`,isVisible:!0,type:`text`},{value:`flow`,label:`Flow`,isVisible:!0,type:`text`},{value:`step_order`,label:`Step Order`,isVisible:!0,type:`number`},{value:`keyword`,label:`Action`,isVisible:!0,type:`text`},{value:`description`,label:`Description`,isVisible:!0,type:`text`},{value:`target`,label:`Key`,isVisible:!0,type:`text`},{value:`tags`,label:`Tags`,isVisible:!0,type:`text`},{value:`value`,label:`Value`,isVisible:!0,type:`text`},{value:`expected`,label:`Expected`,isVisible:!0,type:`text`}];function un(){let e=localStorage.getItem(tn),t=sessionStorage.getItem(rn)===`1`;return e&&t?e:null}async function dn({jobId:e,limit:n=10,offset:r=0,sortBy:i=`new`,type:a=`myVendor`}){return await bn(t.T,`/vendor/hotlist`,{method:`POST`,body:JSON.stringify({jobId:e,limit:n,offset:r,sortBy:i,type:a})})}async function fn(e){let n=await bn(t.S,`/get-bulkmail-details?jobId=${encodeURIComponent(e)}`);return n.data??n}async function pn(e,n=``){let r=String(e??``).trim();if(!r)return``;let i=await bn(t.E,`/format-mail-content`,{method:`POST`,body:JSON.stringify({contents:r,subject:String(n??``)})});if(i?.status===!1)throw Error(i?.error||`Unable to format mail content`);return String(i?.html??i?.contents??i?.data?.html??i?.data?.contents??``).trim()}async function mn({jobId:e,toMail:n,ccMail:r,bccMail:i,subject:a,contents:o,attachments:s=[]}){let c=localStorage.getItem(`tenantId`)||`93c782a4aa626175e5d11afa`,l=localStorage.getItem(`businessId`)||`83c782a4aa626175e5d11afa`,u=localStorage.getItem(`businessUnitId`)||`63b57588fd768a839dbc0f63`,d=new FormData;d.append(`json`,JSON.stringify({schemaVersion:1,tenantId:c,businessId:l,businessUnitId:u,jobId:e,toMail:n,ccMail:r,bccMail:i,contents:o,subject:a})),(s??[]).forEach(e=>{e instanceof File&&d.append(`attachments`,e,e.name)});let{"Content-Type":f,...p}=await yn(),m=await fetch(`${t.S}/send-bulkmail`,{method:`POST`,headers:p,body:d});if(m.status===401&&hn(),!m.ok)throw Error(`API ${m.status}: ${m.statusText}`);let h=await m.text();return h?JSON.parse(h):{}}function hn(){localStorage.removeItem(tn),localStorage.removeItem(nn),an.forEach(e=>localStorage.removeItem(e)),sessionStorage.removeItem(rn),window.dispatchEvent(new Event(`auth:logout`))}function gn(e=``){let t=String(e??``).trim();return t===`myJobs`||t===`allJobs`||t===`fulfilled`?t:``}function _n(e){let t=String(n.xn(e)??``).trim().toLowerCase();return t===`job`||t===`jobs`}async function vn(){let e=un();if(e)return e;let t=Error(`Authentication required`);throw t.status=401,t}async function yn(){return{"Content-Type":`application/json`,Authorization:`Bearer ${await vn()}`}}async function bn(e,t,n={}){let r=await yn(),i={...n,headers:{...r,...n.headers}},a=await fetch(`${e}${t}`,i);if(a.status===401&&hn(),!a.ok){let e=Error(`API ${a.status}: ${a.statusText}`);throw e.status=a.status,e}return a.json()}async function xn(e,t){let n=await bn(e,t);return n.data??n}async function Sn(e){return xn(t.D,e)}async function Cn(e){return xn(t.x,e)}async function wn(e){return e===on?sn:e===cn?ln:Sn(`/filter-dropdown-fields?module=${encodeURIComponent(n.xn(e))}`)}async function Tn(e,{configType:t,userId:r,roleId:i}={}){if(e===on)return sn;if(e===cn)return ln;let a=new URLSearchParams({module:n.xn(e)});return t&&a.set(`configType`,t),r!=null&&a.set(`userId`,String(r)),i!=null&&a.set(`roleId`,String(i)),Cn(`/admin/field-config?${a}`)}async function En({limit:e=10,offset:t=0,search:n=``,module:r=``,keyword:i=``,tags:a=``,active:o}={}){let s=new URLSearchParams({limit:String(e),offset:String(t)});return n&&s.append(`search`,n),r&&s.append(`module`,r),i&&s.append(`keyword`,i),a&&s.append(`tags`,a),o!=null&&o!==``&&s.append(`active`,String(o)),Cn(`/test-flows?${s.toString()}`)}async function Dn({limit:e=10,offset:t=0,search:n=``,module:r=``,keyword:i=``,tags:a=``,active:o}={}){let s=new URLSearchParams({limit:String(e),offset:String(t)});return n&&s.append(`search`,n),r&&s.append(`module`,r),i&&s.append(`keyword`,i),a&&s.append(`tags`,a),o!=null&&o!==``&&s.append(`active`,String(o)),Cn(`/lms-flows?${s.toString()}`)}async function On(e,r=10,i=0,a={}){let{scope:o=``,sort:s=``,sortDir:c=``,search:l=``,filters:u=[],queryParams:d={}}=a;if(e===on){let e=await En({limit:r,offset:i}),t=Array.isArray(e?.items)?e.items:[],n=Number(e?.total)||0;return{items:t,total:n,limit:r,offset:i,tabs:[{key:`all`,title:`Test Cases`,count:n}]}}if(e===cn){let e=await Dn({limit:r,offset:i}),t=Array.isArray(e?.items)?e.items:[],n=Number(e?.total)||0;return{items:t,total:n,limit:r,offset:i,tabs:[{key:`all`,title:`LMS Cases`,count:n}]}}let f=new URLSearchParams({module:n.xn(e),limit:String(r),offset:String(i)}),p=_n(e)?gn(o):String(o??``).trim();p&&f.set(`scope`,p),s&&f.set(`sort`,s),c&&f.set(`sortDir`,c),String(l??``).trim()&&f.set(`search`,String(l).trim());let m=Pn(u.filter(e=>e?.field));m.length&&f.set(`filters`,JSON.stringify(m)),Object.entries(d??{}).forEach(([e,t])=>{t!=null&&String(t).trim()!==``&&f.set(e,String(t))});let h=await bn(t.x,`/module-data-list?${f.toString()}`),g=kn(h),_=g.some(e=>Mn(e)),v=g.some(e=>Nn(e));if(_||v)try{let{transformDiceResponseToInternalFormat:e}=await Promise.resolve().then(()=>require("./diceCandidateMapper-BjMhHno3.cjs")).then(e=>e.t),t=e(h,h),n=t?.data?.data??[];return{items:n,total:jn(h,p)||jn(t,p)||n.length,limit:r,offset:i,tabs:t?.data?.tabs??h?.tabs??h?.data?.tabs??[],fields:t?.data?.fields??h?.fields??h?.data?.fields??[],tabField:t?.data?.tabField??h?.tabField??h?.data?.tabField??``,actionRules:t?.data?.actionRules??h?.data?.actionRules??[],actions:t?.data?.actions??h?.data?.actions??[],columnActions:t?.data?.columnActions??h?.data?.columnActions??[]}}catch(e){console.error(`[getModuleDataList] Dice transformation failed:`,e)}return h}function kn(e){let t=e?.data??e,n=Array.isArray(t)?t:t?.rows??t?.records??t?.items??t?.list??t?.data??e?.items??e?.records??[];return Array.isArray(n)?n:[]}function An(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function jn(e,t=``){let n=e?.data??e,r=kn(e),i=e?.count,a=n?.count,o=String(t??``).trim().toLowerCase();if(i&&typeof i==`object`){let e=An(o?i[o]:void 0,i.total,i.searchCount,i.count);if(e!==void 0)return e}if(a&&typeof a==`object`){let e=An(o?a[o]:void 0,a.total,a.searchCount,a.count);if(e!==void 0)return e}return An(e?.total,typeof i==`object`?void 0:i,e?.totalCount,n?.total,typeof a==`object`?void 0:a,n?.totalCount,r.length)??0}function Mn(e){let t=e?.skills??e?.technicalSkills??e?.primarySkills;return!Array.isArray(t)||t.length===0?!1:t.some(e=>e&&typeof e==`object`&&(`skill`in e||`lastUsed`in e))}function Nn(e){return[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].flat().some(e=>String(e??``).trim().toLowerCase()===`dice`)||!!e?.customFields?.diceProfileData}function Pn(e){let t=[];for(let n of e){if(!n.field)continue;let e=n.operator===`or`?`or`:`and`;if(n.operator===`isEmpty`){t.push({field:n.field,op:`isEmpty`,operator:`and`});continue}if(n.operator===`notEmpty`){t.push({field:n.field,op:`notEmpty`,operator:`and`});continue}if(n.filterInputType===`text`){let r=typeof n.value==`string`?n.value.trim():``;r&&t.push({field:n.field,op:`contains`,value:r,operator:e});continue}if(n.from||n.to){n.from&&t.push({field:n.field,op:`gte`,value:String(n.from),operator:e}),n.to&&t.push({field:n.field,op:`lte`,value:String(n.to),operator:`and`});continue}Array.isArray(n.values)&&n.values.length>0&&t.push({field:n.field,op:`in`,values:n.values.map(String),operator:e,...Array.isArray(n.groupFields)&&n.groupFields.length>1?{groupFields:n.groupFields}:{}})}return t}async function Fn(e,t,r=``,i={}){let{limit:a=50,offset:o=0,dataSource:s,groupName:c,lookup:l,groupFields:u=[],groupSeparator:d=` `}=i,f=new URLSearchParams({module:n.xn(e),field:t,value:r,limit:String(a),offset:String(o)});return s&&f.set(`dataSource`,s),Array.isArray(u)&&u.length>1&&(f.set(`groupFields`,u.join(`,`)),f.set(`groupSeparator`,d??` `)),s===`group`&&c&&f.set(`groupName`,c),s===`lookup`&&l?.collection&&(f.set(`lookupCollection`,l.collection),l.displayField&&f.set(`lookupField`,l.displayField)),Sn(`/filter-dropdown-values?${f}`)}function In(e){let t=e?.data??e,n=Array.isArray(t)?t:Array.isArray(t?.groups)?t.groups:Array.isArray(e?.groups)?e.groups:[],r=t?.recordMeta??e?.recordMeta;return r&&typeof r==`object`&&(n.recordMeta=r),n}async function Ln({module:e,id:n,view:r}={}){if(!e)throw Error(`module is required to fetch form groups`);let a=await yn(),o=new URLSearchParams({module:e});n&&o.set(`id`,String(n)),r&&o.set(`view`,String(r));let s=`${t.x}/admin/form-groups?${o.toString()}`;return In(await i.t(s,async()=>{let e=await fetch(s,{method:`GET`,headers:a});if(!e.ok)throw Error(`API ${e.status}: ${e.statusText}`);return e.json()}))}async function Rn({searchQuery:e,candidateId:n}){let r=localStorage.getItem(`tenantId`)||`93c782a4aa626175e5d11afa`,i=localStorage.getItem(`businessId`)||`83c782a4aa626175e5d11afa`,a=localStorage.getItem(`businessUnitId`)||`63b57588fd768a839dbc0f63`,o=Number(localStorage.getItem(`userId`))||1;return bn(t.T,`/joblist`,{method:`POST`,body:JSON.stringify({tenantId:r,businessId:i,businessUnitId:a,searchQuery:e,userId:o,candidateId:Array.isArray(n)?n:[n]})})}async function zn(e=``){let n=e?`?search=${encodeURIComponent(e)}`:``;return xn(t.T,`/users/any${n}`)}function Bn(e){if(!e||typeof e!=`string`)return null;try{let t=e.split(`.`)[1];if(!t)return null;let n=t.replace(/-/g,`+`).replace(/_/g,`/`),r=n.padEnd(Math.ceil(n.length/4)*4,`=`);return JSON.parse(atob(r))}catch{return null}}function Vn(){return Bn(localStorage.getItem(`access_token`)||localStorage.getItem(`authToken`))??{}}function Hn(){let e=Vn();return{userId:e.userId??e.user_id??e.USER_ID,roleId:e.roleId??e.role_id??e.ROLE_ID}}function Un(){let e=Hn();return{userId:e.userId??localStorage.getItem(`userId`)??void 0,roleId:e.roleId??localStorage.getItem(`roleId`)??void 0}}function Wn(e){let[t,n]=(0,o.useState)([]),[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(null);return(0,o.useEffect)(()=>{if(!e)return;let t=!1;return i(!0),s(null),wn(e).then(e=>{t||n(Array.isArray(e)?e:[])}).catch(e=>{t||s(e.message)}).finally(()=>{t||i(!1)}),()=>{t=!0}},[e]),{fields:t,loading:r,error:a}}function Gn(e){let[t,n]=(0,o.useState)(null),[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(null);return(0,o.useEffect)(()=>{if(!e)return;let t=!1;return i(!0),s(null),Tn(e).then(e=>{t||n(Array.isArray(e)?e:null)}).catch(e=>{t||s(e.message)}).finally(()=>{t||i(!1)}),()=>{t=!0}},[e]),{config:t,loading:r,error:a}}function Kn(e){let[t,n]=(0,o.useState)([]),[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(null);return(0,o.useEffect)(()=>{if(!e)return;let t=!1;i(!0),s(null);let{userId:r,roleId:a}=Un(),o=e=>{let t=e?.isVisible??e?.is_visible??e?.visible;return t==null?!0:typeof t==`boolean`?t:typeof t==`string`?![`false`,`0`,`no`,`hide`,`hidden`].includes(t.toLowerCase()):!!t};return Tn(e,{configType:`filter`,userId:r,roleId:a}).then(async t=>{let n=(Array.isArray(t)?t:t?.visibleFields??[]).filter(o);if(n.length>0)return n;let r=await wn(e);return Array.isArray(r)?r.filter(o):[]}).then(e=>{t||n(Array.isArray(e)?e:[])}).catch(e=>{t||s(e.message)}).finally(()=>{t||i(!1)}),()=>{t=!0}},[e]),{fields:t,loading:r,error:a}}var qn={campaign:`campaingns`,campaigns:`campaingns`};function Jn(e,t){return e===t||`${e}s`===t||`${t}s`===e}function Yn(e){try{let t=localStorage.getItem(`menu`);if(!t)return null;let n=JSON.parse(t);if(!Array.isArray(n))return null;let r=n.find(t=>{let n=String(t?.key??``).trim().toLowerCase();return n&&Jn(e,n)});return r?String(r.key).trim().toLowerCase():null}catch{return null}}function Xn(e){try{let t=localStorage.getItem(`menuPermission`);if(!t||!e)return{};let n=JSON.parse(t);if(!n||typeof n!=`object`)return{};let r=String(e).trim().toLowerCase(),i=qn[r]??Yn(r)??r,a=Object.keys(n),o=e=>e.trim().toLowerCase(),s=a.find(e=>o(e)===i)??a.find(e=>Jn(i,o(e)))??a.find(e=>Jn(r,o(e)));return(s?n[s]:null)??{}}catch{return{}}}function Zn(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`value`)?e.value:e}function Qn(e){let t=Zn(e);return t==null||Number(t)!==0&&t!==!1&&t!==`0`}function $n(e){let t=Zn(e);return t==null?!1:t===!0||t===1||t===`1`}function er(e,t){if(!e||typeof e!=`object`)return;if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=String(t).trim().toLowerCase(),r=Object.keys(e).find(e=>String(e).trim().toLowerCase()===n);return r?e[r]:void 0}function tr(e){return(0,o.useMemo)(()=>{let t=Xn(e);return{canView:Qn(er(t,`view`)),canAdd:Qn(er(t,`add`)),canEdit:Qn(er(t,`edit`)),canDelete:Qn(er(t,`delete`)),canApprove:Qn(er(t,`approve`)),canReject:Qn(er(t,`reject`)),canReApprove:$n(er(t,`reApprove`)),canSendApprove:$n(er(t,`sendApprove`))}},[e])}function nr(e){return[e?.key,e?.label,e?.name].filter(Boolean).join(` `).trim().toLowerCase()}function rr(e){let t=String(e?.permissionKey??``).trim().toLowerCase();if([`add`,`edit`,`delete`].includes(t))return t;if(e?.danger)return`delete`;let n=nr(e);return/(^|[\s_-])edit([\s_-]|$)/.test(n)?`edit`:/(^|[\s_-])(add|create)([\s_-]|$)/.test(n)?`add`:null}function ir(e,t){if(e!=null)return t.length===0?e:Array.isArray(e)?e.map(e=>ir(e,t)).filter(e=>e!=null).flat():ir(e[t[0]],t.slice(1))}function ar(e,t){if(!t||typeof t!=`string`||!e)return;if(t in e)return e[t];let n=ir(e,t.split(`.`));if(n!==void 0&&!(Array.isArray(n)&&n.length===0))return n;let r=t.split(`.`).pop();return r===t?void 0:e[r]}function or(){try{return typeof localStorage<`u`?localStorage.getItem(`userId`)??``:``}catch{return``}}var sr={"{currentuserid}":or,"{currentuser}":or,"{me}":or};function cr(e){let t=sr[String(e??``).trim().toLowerCase()];return t?t():e}function lr(e){return String(e??``).trim().toLowerCase()}function ur(e){return lr(e).replace(/[^a-z0-9]/g,``)}function dr(e,t){return e===t||ur(e)===ur(t)}function fr(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function pr(e,t,n){let r=e?.operator,i=r===`scope`?n:ar(t,e?.field),a=cr(e?.value),o=lr(i),s=lr(a);if(r===`eq`||r===`scope`)return dr(o,s);if(r===`ne`)return!dr(o,s);if(r===`isEmpty`)return fr(i);if(r===`notEmpty`)return!fr(i);if(r===`fieldEq`)return dr(o,lr(ar(t,e?.compareField)));if(r===`includes`||r===`notIncludes`){let e=(Array.isArray(i)?i:[i]).some(e=>dr(lr(e),s))&&s!==``;return r===`includes`?e:!e}return r===`contains`?Array.isArray(i)?i.some(e=>lr(e).includes(s)):o.includes(s):!1}function mr(e,t,n){if(!e||e.isActive===!1)return!1;let r=e.conditions??[];return r.length?r.every(e=>pr(e,t,n)):!1}function hr(e){let t=e?.allowedActions;return!Array.isArray(t)||t.length===0?null:t.map(String)}function gr(e,t,n,r){let i=Array.isArray(n)?n:[];if(!i.length)return!1;let a=String(e);return i.some(e=>{if(!mr(e,t,r))return!1;let n=hr(e);return n&&!n.some(e=>dr(e,a))?!0:(e?.blockedActions??[]).map(String).includes(a)})}function _r(e,t,n,r){let i=(Array.isArray(n)?n:[]).find(n=>(n?.disabledActions??[]).map(String).includes(String(e))&&mr(n,t,r));return i?i.description||`${e} is temporarily unavailable`:null}function vr(e,t,n){let r=e?.doneWhen;return!r||!r.field||!pr(r,t,n)?null:{label:e.doneLabel||e.label,tone:e.doneTone||`success`}}function yr(e,t,n,r){let i=Array.isArray(t)?t:[];return i.length?i.some(t=>gr(e,t,n,r)):!1}var br=e.t({actionRules:()=>Er,actions:()=>Dr,columnActions:()=>Or,default:()=>kr,fields:()=>wr,rows:()=>xr,synthesizeFieldsFromRows:()=>!0,tabField:()=>Tr,tabs:()=>Cr,total:()=>Sr,visibilityFlag:()=>null}),xr={sources:[`payload`],paths:[`rows`,`records`,`items`,`list`,`data`]},Sr={sources:[`response`,`payload`],paths:[`total`,`count`,`totalCount`]},Cr={sources:[`response`,`payload`],paths:[`tabs`,`tabList`]},wr={sources:[`response`,`payload`],paths:[`fields`,`fieldConfig`]},Tr={sources:[`payload`],paths:[`tabField`]},Er={sources:[`payload`],paths:[`actionRules`]},Dr={sources:[`payload`],paths:[`actions`]},Or={sources:[`payload`],paths:[`columnActions`]},kr={rows:xr,total:Sr,tabs:Cr,fields:wr,tabField:Tr,actionRules:Er,actions:Dr,columnActions:Or,synthesizeFieldsFromRows:!0,visibilityFlag:null},Ar=Object.assign({"../../config/responseMappings/default.json":br});function jr(e){if(!e)return null;for(let t of Object.keys(Ar))if(t.split(`/`).pop().replace(/\.json$/,``)===e){let e=Ar[t];return e.default??e}return null}function Mr(e){let t=jr(e);return t?{...kr,...t}:kr}function Nr(e,t){return String(t).split(`.`).reduce((e,t)=>e?.[t],e)}function Pr(e,t,n){if(!n)return;let r={response:e,payload:t};for(let e of n.sources)for(let t of n.paths){let n=Nr(r[e],t);if(n!==void 0)return n}}function Fr(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function Ir(e){return e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase())}var Lr=/token|password|passwd|secret|apikey|api_key|auth|credential|salary|ssn|ein\b/i;function Rr(e){return Lr.test(e)}function zr(e){let t=e[0];return t?Object.keys(t).filter(e=>!e.startsWith(`_`)&&!Rr(e)&&typeof t[e]!=`object`).map(e=>({value:e,field:e,label:Ir(e),isVisible:!0})):[]}function Br(e,t){return t?e.filter(e=>e[t]===1||e[t]===!0||e[t]===void 0).map(e=>({...e,isVisible:!0})):e}var Vr=5e3,Hr=300,Ur=100,Wr=100,Gr=300,Kr=100;function qr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Jr(e,t){return Array.isArray(e)?e.slice(0,t):[]}function Yr(e,t){return Jr(e,t).filter(qr)}function Xr(e,t){return Yr(e,t).filter(e=>typeof e.value==`string`||typeof e.field==`string`)}var Zr=/^\s*(javascript|data|vbscript|file):/i,Qr=[`url`,`href`,`routeUrl`,`routeURL`];function $r(e){let t={...e};for(let e of Qr)typeof t[e]==`string`&&Zr.test(t[e])&&delete t[e];return t}function ei(e,t){return Yr(e,t).map($r)}function ti(e,t){return e.flatMap(e=>{let n=Nr(e,t);return n==null?[]:(Array.isArray(n)?n:[n]).filter(e=>e!=null).map(e=>qr(e)?e:{value:e})})}function ni(e,t){if(!Array.isArray(t)||Array.isArray(e)||!qr(e))return;let n=[`actions`,`actionRules`,`columnActions`,`tabField`].filter(t=>e[t]!==void 0);n.length!==0&&console.warn(`[mapListResponse] response.data is an array, so ${n.join(`, `)} cannot be resolved from it. Send rows under "items" instead of "data", or pass the full envelope rather than the unwrapped payload.`)}function ri(e,t){let{baseModule:r,nestedPath:i}=n.Sn(t),a=Mr(r),o=e?.data??e;ni(e,o);let s=Jr(Array.isArray(o)?o:Pr(e,o,a.rows),Vr);i&&(s=Jr(ti(s,i),Vr),console.log(`[mapListResponse] module "${r}" → nested path "${i}": ${s.length} row(s)`));let c=Pr(e,o,a.total),l=qr(c)?Fr(c.total,c.searchCount,c.count):c,u=Number(l??s.length)||0,d=Yr(Pr(e,o,a.tabs),Ur),f=i?[]:Pr(e,o,a.fields),p=Array.isArray(f)?f:[];p.length===0&&(i||a.synthesizeFieldsFromRows)&&(p=zr(s)),p=Xr(p,Hr),a.visibilityFlag&&(p=Br(p,a.visibilityFlag));let m=Pr(e,o,a.tabField);return{rows:s,total:u,tabs:d,fields:p,tabField:typeof m==`string`?m:``,actionRules:ei(Pr(e,o,a.actionRules),Gr),actions:ei(Pr(e,o,a.actions),Wr),columnActions:ei(Pr(e,o,a.columnActions),Kr)}}var ii={jobs:{module:`jobs`,keys:[`jobRecruitmentStatus`,`jobStatus`],dateField:`createdAt`},candidates:{module:`candidates`,keys:[`candidateSummary`],items:[{key:`created`,label:`Created`,collection:`candidates`,countType:`documents`,dateField:`createdAt`},{key:`submitted`,label:`Submitted`,collection:`submissions`,countType:`distinct`,distinctField:`applicantId`,dateField:`submittedAt`},{key:`onboarded`,label:`Onboarded`,collection:`onboarding`,countType:`distinct`,distinctField:`candidateId`,dateField:`onboardingActivity.activityTime`,filters:{onboardingObStage:[`Completed`]}}]},submissions:{module:`submission`,keys:[`internalSubmissionStatus.internalSubmissionStatusText`,`clientSubmissionStatus.clientSubmissionStatusText`],dateField:`createdAt`}},ai={jobSummary:[{label:`Open`,field:`jobStatus`,keys:[`open`,`active`]},{label:`Partially Fulfilled`,field:`jobRecruitmentStatus`,keys:[`partially fulfilled`,`partiallyFulfilled`]},{label:`Fulfilled`,field:`jobRecruitmentStatus`,keys:[`fulfilled`]},{label:`In-active / Closed`,field:`jobStatus`,keys:[`closed`,`inactive`,`in-active`]}]};function oi(e){return String(e??``).trim().toLowerCase()}function si(e,t){return{label:e,count:Number.isFinite(Number(t))?Number(t):0}}function ci(e){return Array.isArray(e?.counts)?e.counts:[]}function li(e,t){return e?.key===t?e:(Array.isArray(e?.fields)?e.fields:[]).find(e=>e?.key===t)??{}}function ui(e,t){let n=Array.isArray(t)?t:[t],r=Array.isArray(e?.counts)?e.counts:[],i=n.filter(Boolean).map(oi),a=r.find(e=>[e?.key,e?.label].map(oi).some(e=>i.includes(e)));if(a)return Number(a.count)||0;for(let t of n){let n=e?.[t];if(Number.isFinite(Number(n)))return Number(n)}return 0}function di(e,t){let n=(Array.isArray(t)?t:[t].filter(Boolean)).map(oi);return ci(e).reduce((e,t)=>{let r=oi(t?.key??t?.label);return n.includes(r)?e+(Number(t?.count)||0):e},0)}function fi(e){let t=oi(e);return t.includes(`candidate`)?ii.candidates:t.includes(`submission`)?ii.submissions:t.includes(`job`)?ii.jobs:null}function pi(e){return ai[e]??null}function mi(e){return Array.isArray(e?.counts)||e?.openCount!==void 0||e?.myAssignedCount!==void 0?[si(`Open`,ui(e,[`openCount`,`open`])),si(`Partially Fulfilled`,ui(e,[`partiallyFulfilledCount`,`partially fulfilled`])),si(`Fulfilled`,ui(e,[`fulfilledCount`,`fulfilled`])),si(`In-active / Closed`,ui(e,[`closedCount`,`closed`,`inactive`,`in active`]))]:(pi(`jobSummary`)??[]).map(t=>{let n=li(e,t.field);return si(t.label,di(n,t.keys??[]))})}function hi(e){return ci(e).map(({label:e,key:t,count:n})=>si(e||t,n))}function gi(e){let t=Array.isArray(e?.fields)?e.fields:[],n=t.find(e=>e.key===`clientSubmissionStatus.clientSubmissionStatusText`)??{},r=t.find(e=>e.key===`internalSubmissionStatus.internalSubmissionStatusText`)??{},i=e=>Array.isArray(e.counts)?e.counts.map(({label:e,count:t})=>si(e,t)):[],a=Number(n.total)||0,o=Number(r.total)||0;return{total:a+o,clientCount:a,internalCount:o,clientBreakdown:i(n),internalBreakdown:i(r)}}var{RangePicker:_i}=s.DatePicker,vi=[{value:`today`,label:`Today`},{value:`yesterday`,label:`Yesterday`},{value:`last-7-days`,label:`Last 7 Days`},{value:`last-30-days`,label:`Last 30 Days`},{value:`this-month`,label:`This Month`},{value:`last-month`,label:`Last Month`},{value:`custom-range`,label:`Custom Range`}];function yi(e){return e.closest(`.view-summary-card`)??document.body}function bi(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function xi(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function Si(e){let t=new Date,n=new Date(t.getFullYear(),t.getMonth(),1),r=new Date(t.getFullYear(),t.getMonth()-1,1),i=new Date(t.getFullYear(),t.getMonth(),0);if(e===`today`)return{startDate:t,endDate:t};if(e===`yesterday`){let e=xi(t,-1);return{startDate:e,endDate:e}}return e===`last-30-days`?{startDate:xi(t,-29),endDate:t}:e===`this-month`?{startDate:n,endDate:t}:e===`last-month`?{startDate:r,endDate:i}:{startDate:xi(t,-6),endDate:t}}function Ci(e,t){if(e===`custom-range`){let[e,n]=t??[];return!e||!n?null:{startDate:e.format(`YYYY-MM-DD`),endDate:n.format(`YYYY-MM-DD`)}}let n=Si(e);return{startDate:bi(n.startDate),endDate:bi(n.endDate)}}function wi(e){return String(e??``).trim().toLowerCase()}function Ti(e){return String(e??``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function Ei(e){let t=wi(e);return t.includes(`candidate`)?`Candidate`:t.includes(`submission`)?`Submission`:t.includes(`job`)?`Job`:Ti(e||`List`)}function Di(e){return e?.data??e}function Oi(e,t){let n={module:e.module,dateRange:{startDate:t.startDate,endDate:t.endDate}};return e.summary&&(n.summary=e.summary),Array.isArray(e.items)&&e.items.length>0&&(n.items=e.items),Array.isArray(e.keys)&&e.keys.length>0&&(n.keys=e.keys),e.dateField&&(n.dateRange.key=e.dateField),n}function ki({moduleName:e,open:t,onClose:r}){let i=Ei(e),a=wi(e),u=a.includes(`submission`),d=a.includes(`job`),f=a.includes(`candidate`),p=fi(e),h=u?`last-30-days`:`last-7-days`,[g,_]=(0,o.useState)(h),[v,y]=(0,o.useState)(null),[b,x]=(0,o.useState)(null),[S,C]=(0,o.useState)(null),[w,T]=(0,o.useState)(null),[E,D]=(0,o.useState)(``),O=mi(b),k=hi(S),A=gi(w),j=Math.max(A.total,1),M=Math.round(A.internalCount/j*100),N=Math.max(0,100-M),P=g===`custom-range`;return(0,o.useEffect)(()=>{t&&(_(h),y(null))},[h,t]),(0,o.useEffect)(()=>{if(!t||!p)return;let e=Ci(g,v);if(!e)return;let n=!1;return D(``),m(Oi(p,e)).then(e=>{if(n)return;let t=Di(e);if(d){x(t),C(null),T(null);return}if(f){C(t),x(null),T(null);return}T(t),x(null),C(null)}).catch(e=>{n||(x(null),C(null),T(null),D(e.message||`Could not load summary`))}),()=>{n=!0}},[v,f,d,u,t,g,p]),t?(0,l.jsxs)(`div`,{className:`view-summary-layer`,role:`presentation`,children:[(0,l.jsx)(`div`,{className:`view-summary-scrim`}),(0,l.jsxs)(s.Card,{"aria-label":`${i} summary`,bordered:!1,className:`view-summary-card view-summary-card--${u?`submission`:`simple`}`,children:[(0,l.jsx)(s.Button,{"aria-label":`Close summary`,className:`view-summary-close`,icon:(0,l.jsx)(c.CloseOutlined,{}),type:`text`,onClick:r}),(0,l.jsxs)(`header`,{className:`view-summary-header`,children:[(0,l.jsxs)(n.Tn,{className:`view-summary-title`,color:`primary`,size:`md`,tag:`h2`,variant:`h2`,weight:`medium`,children:[i,` Summary`]}),(0,l.jsx)(s.Select,{"aria-label":`Summary date range`,className:`view-summary-range`,popupClassName:`view-summary-range-dropdown`,getPopupContainer:yi,popupMatchSelectWidth:!1,value:g,options:vi,onChange:e=>{_(e),e!==`custom-range`&&y(null)}})]}),u?(0,l.jsxs)(l.Fragment,{children:[P&&(0,l.jsx)(_i,{allowClear:!0,className:`view-summary-custom-range view-summary-custom-range--full`,format:`MMM DD, YYYY`,getPopupContainer:yi,placeholder:[`Start date`,`End date`],value:v,onChange:y}),(0,l.jsxs)(`section`,{className:`view-summary-submission-top`,"aria-label":`Submission totals`,children:[(0,l.jsxs)(`div`,{className:`view-summary-donut`,style:{"--summary-internal":`${M}%`,"--summary-client":`${N}%`},children:[(0,l.jsx)(n.Tn,{color:`success`,size:`2xl`,tag:`span`,variant:`metric`,weight:`semibold`,children:A.total}),(0,l.jsx)(n.Tn,{color:`success`,size:`xs`,tag:`span`,variant:`caption`,weight:`semibold`,children:`Total`})]}),(0,l.jsxs)(`div`,{className:`view-summary-legend`,children:[(0,l.jsxs)(n.Tn,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,l.jsx)(`i`,{className:`view-summary-dot view-summary-dot--internal`}),`Internal`,(0,l.jsx)(n.Tn,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:A.internalCount})]}),(0,l.jsxs)(n.Tn,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,l.jsx)(`i`,{className:`view-summary-dot view-summary-dot--client`}),`Client`,(0,l.jsx)(n.Tn,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:A.clientCount})]})]})]}),(0,l.jsx)(`div`,{className:`view-summary-divider`}),(0,l.jsxs)(`section`,{className:`view-summary-breakdown`,children:[(0,l.jsx)(n.Tn,{className:`view-summary-subtitle`,color:`primary`,size:`md`,tag:`h3`,variant:`h4`,weight:`medium`,children:`Internal Breakdown`}),A.internalBreakdown.length>0?A.internalBreakdown.map(e=>(0,l.jsxs)(`div`,{className:`view-summary-row view-summary-row--bullet`,children:[(0,l.jsxs)(n.Tn,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,l.jsx)(`i`,{className:`view-summary-dot view-summary-dot--internal`}),e.label]}),(0,l.jsx)(n.Tn,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:e.count})]},`internal-${e.label}`)):(0,l.jsx)(n.Tn,{color:`muted`,size:`sm`,tag:`p`,variant:`body`,weight:`regular`,children:`No internal data found`}),(0,l.jsx)(n.Tn,{className:`view-summary-subtitle`,color:`primary`,size:`md`,tag:`h3`,variant:`h4`,weight:`medium`,children:`Client Breakdown`}),A.clientBreakdown.length>0?A.clientBreakdown.map(e=>(0,l.jsxs)(`div`,{className:`view-summary-row view-summary-row--bullet`,children:[(0,l.jsxs)(n.Tn,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,l.jsx)(`i`,{className:`view-summary-dot view-summary-dot--client`}),e.label]}),(0,l.jsx)(n.Tn,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:e.count})]},`client-${e.label}`)):(0,l.jsx)(n.Tn,{color:`muted`,size:`sm`,tag:`p`,variant:`body`,weight:`regular`,children:`No client data found`}),E&&(0,l.jsx)(n.Tn,{color:`danger`,size:`xs`,tag:`p`,variant:`caption`,children:E})]})]}):(0,l.jsxs)(`section`,{className:`view-summary-breakdown`,children:[(0,l.jsxs)(`div`,{className:`view-summary-section-head`,children:[(0,l.jsxs)(n.Tn,{className:`view-summary-section-title`,color:`primary`,size:`md`,tag:`h3`,variant:`h3`,weight:`medium`,children:[`All `,i]}),P&&(0,l.jsx)(_i,{allowClear:!0,className:`view-summary-custom-range`,format:`MMM DD, YYYY`,getPopupContainer:yi,placeholder:[`Start date`,`End date`],value:v,onChange:y})]}),(0,l.jsx)(`div`,{className:`view-summary-divider`}),a.includes(`job`)&&(0,l.jsx)(n.Tn,{className:`view-summary-breakdown-title`,color:`primary`,size:`sm`,tag:`h4`,variant:`h4`,weight:`regular`,children:`Breakdown`}),(f?k:O).map(e=>(0,l.jsxs)(`div`,{className:`view-summary-row`,children:[(0,l.jsx)(n.Tn,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,children:e.label}),(0,l.jsx)(n.Tn,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,children:e.count})]},e.label)),E&&(0,l.jsx)(n.Tn,{color:`danger`,size:`xs`,tag:`p`,variant:`caption`,children:E})]})]})]}):null}function Ai(e){let[t,n]=(0,o.useState)({}),[r,i]=(0,o.useState)(new Set),a=(0,o.useRef)({}),s=(e,t)=>{i(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return{valuesByField:t,loadingFields:r,fetchValues:(0,o.useCallback)((t,r=``,i={})=>{if(!t||!e)return;a.current[t]&&clearTimeout(a.current[t]);let o=r?300:0;a.current[t]=setTimeout(async()=>{s(t,!0);try{let a=await Fn(e,t,r,i),o=Array.isArray(a)?a.map(e=>({label:String(e.label),value:e.value})):[];n(e=>({...e,[t]:o}))}catch{}finally{s(t,!1)}},o)},[e])}}var ji=[{label:`Last 7 days`,getDates:()=>[(0,u.default)().subtract(6,`day`),(0,u.default)()]},{label:`This month`,getDates:()=>[(0,u.default)().startOf(`month`),(0,u.default)()]},{label:`Overdue`,getDates:()=>[null,(0,u.default)().subtract(1,`day`)]}];function Mi({value:e,onChange:t,disabled:n}){return(0,l.jsxs)(s.Flex,{vertical:!0,gap:4,children:[(0,l.jsx)(s.DatePicker.RangePicker,{value:e,onChange:t,disabled:n,style:{width:`100%`},allowEmpty:[!0,!0],disabledDate:e=>e&&e.isAfter((0,u.default)(),`day`)}),!n&&(0,l.jsx)(s.Space,{size:4,wrap:!0,children:ji.map(({label:e,getDates:n})=>(0,l.jsx)(s.Tag,{className:`filter-date-shortcut`,onClick:()=>t?.(n()),children:e},e))})]})}var Ni=[{label:`AND`,value:`and`},{label:`OR`,value:`or`},{label:`Is Empty`,value:`isEmpty`},{label:`Not Empty`,value:`notEmpty`}],Pi=[{label:`Yes`,value:`true`},{label:`No`,value:`false`}];function Fi({value:e,onChange:t,disabled:n}){let[r,i]=Array.isArray(e)?e:[void 0,void 0];return(0,l.jsxs)(s.Flex,{gap:8,children:[(0,l.jsx)(s.InputNumber,{disabled:n,placeholder:`Min`,value:r,onChange:e=>t?.([e,i]),style:{flex:1}}),(0,l.jsx)(s.InputNumber,{disabled:n,placeholder:`Max`,value:i,onChange:e=>t?.([r,e]),style:{flex:1}})]})}var Ii={operator:`and`,field:void 0,values:[]};function Li({filterInputType:e,fieldType:t,disabled:n,loading:r,valueOptions:i,onSearch:a,onOpen:o}){let c=e||(t===`boolean`?`boolean`:null)||(t===`date`?`datepicker`:null)||(t===`number`?`number-range`:null)||`dropdown`;return c===`boolean`?(0,l.jsx)(s.Select,{allowClear:!0,disabled:n,mode:`multiple`,options:Pi,placeholder:`Select value`}):c===`text`?(0,l.jsx)(s.Input,{disabled:n,placeholder:`Type keyword...`,allowClear:!0}):c===`datepicker`?(0,l.jsx)(Mi,{disabled:n}):c===`number-range`?(0,l.jsx)(Fi,{disabled:n}):c===`checkbox`?(0,l.jsx)(s.Spin,{spinning:r,children:(0,l.jsx)(s.Checkbox.Group,{disabled:n,options:i,style:{display:`flex`,flexWrap:`wrap`,gap:`4px 16px`}})}):c===`radio`?(0,l.jsx)(s.Spin,{spinning:r,children:(0,l.jsx)(s.Radio.Group,{disabled:n,options:i,style:{display:`flex`,flexWrap:`wrap`,gap:`4px 16px`}})}):(0,l.jsx)(s.Select,{allowClear:!0,disabled:n,loading:r,mode:`multiple`,options:i,placeholder:n?`Select field first`:`Select values`,showSearch:!0,filterOption:!1,onSearch:a,onDropdownVisibleChange:o})}function Ri(e){return e.label??e.fieldLabel??e.name??e.fieldName??e.value}function zi(e){return e.value??e.field??e.fieldName??e.name??e.label}function Bi(e,t){let n=t.find(t=>t.value===e.field),r=e.filterInputType??n?.filterInputType,i=r===`datepicker`||!r&&n?.type===`date`,a=r===`text`,o=e.values??[];return a?o=e.value??``:i&&(o=[e.from?(0,u.default)(e.from):null,e.to?(0,u.default)(e.to):null]),{field:e.field,operator:e.operator??`and`,values:o,locked:n?.isDefaultFilter??!1}}function Vi({moduleName:e,open:t=!1,filters:r=[],onClose:i,onApply:a,onReset:u}){let[d]=s.Form.useForm(),f=s.Form.useWatch(`filters`,d)??[],{fields:p,loading:m,error:h}=Kn(t?e:null),g=(0,o.useMemo)(()=>(p??[]).map(e=>({label:Ri(e),value:zi(e),type:e.type,filterInputType:e.filterInputType,dataSource:e.dataSource,groupName:e.groupName,filterGroupFields:Array.isArray(e.filterGroupFields)?e.filterGroupFields:[],filterGroupSeparator:e.filterGroupSeparator??` `,lookup:e.lookup??null,isDefaultFilter:e.isDefaultFilter===1||e.isDefaultFilter===`1`||e.isDefaultFilter===!0})).filter(e=>e.label&&e.value),[p]),_=(0,o.useMemo)(()=>g.filter(e=>e.isDefaultFilter),[g]),v=(0,o.useMemo)(()=>_.map(e=>String(e.value)).sort().join(`|`),[_]),y=g,{valuesByField:b,loadingFields:x,fetchValues:S}=Ai(e);function C(e){let t=g.find(t=>t.value===e),n=t?.filterInputType;if(!(!e||n===`datepicker`||n===`number-range`||n===`text`||!n&&[`boolean`,`date`,`number`].includes(t?.type))){let n=!!t?.lookup?.collection;S(e,``,{dataSource:n?`lookup`:t?.dataSource,groupName:t?.groupName,lookup:t?.lookup,groupFields:t?.filterGroupFields,groupSeparator:t?.filterGroupSeparator})}}function w(){return _.length>0?_.map(e=>({operator:`and`,field:e.value,values:[],locked:e.isDefaultFilter})):[Ii]}function T(e=[]){let t=e.filter(e=>e?.field),n=new Set(t.map(e=>String(e.field))),r=[..._.filter(e=>!n.has(String(e.value))).map(e=>({operator:`and`,field:e.value,values:[],locked:!0})),...t].map(e=>({...e,locked:_.some(t=>String(t.value)===String(e.field))}));return r.length>0?r:[Ii]}let E=(0,o.useRef)(!1),D=(0,o.useRef)(r);(0,o.useEffect)(()=>{if(r===D.current)return;if(D.current=r,E.current){E.current=!1;return}let e=T((r??[]).filter(e=>e.field).map(e=>Bi(e,g)));d.setFieldsValue({filters:e}),e.forEach(e=>C(e.field))},[r,g]);let O=(0,o.useRef)(!1),k=(0,o.useRef)(``),A=(0,o.useRef)(e),j=(0,o.useRef)(!1);(0,o.useEffect)(()=>{e!==A.current&&(A.current=e,O.current=!1,k.current=``,j.current=!1)},[e]),(0,o.useEffect)(()=>{if(!t)return;let e=k.current!==v;if(O.current&&!e)return;let n=j.current&&!m,r=!m&&g.length>0;if(j.current=m,!n&&!r)return;let i=O.current;O.current=!0,k.current=v;let a=d.getFieldValue(`filters`)??[],o=T(i||a.length>0?a:w());d.setFieldsValue({filters:o}),o.forEach(e=>C(e.field))},[t,m,g,v]);function M(){E.current=!0;let t=w();d.setFieldsValue({filters:t}),t.forEach(e=>C(e.field)),a?.({moduleName:e,filters:[]}),u?.(),i?.()}function N(){E.current=!0;let t=(d.getFieldsValue().filters??[]).filter(e=>!P(e)).map(e=>{let t={...e};delete t.locked;let n=g.find(e=>e.value===t.field),r=n?.label??t.field,i=n?.filterInputType,a=i===`datepicker`||n?.type===`date`,o=i===`number-range`||!i&&n?.type===`number`,s=i===`text`;if(a){let[e,n]=Array.isArray(t.values)?t.values:[],a=e=>e?typeof e.format==`function`?e.format(`YYYY-MM-DD`):typeof e.toISOString==`function`||e instanceof Date?e.toISOString().substring(0,10):null:null,o=a(e),s=a(n);return{...t,values:[o,s].filter(Boolean),from:o??void 0,to:s??void 0,fieldLabel:r,filterInputType:i}}if(o){let[e,n]=Array.isArray(t.values)?t.values:[];return{...t,values:[e,n].filter(e=>e!=null),from:e==null?void 0:String(e),to:n==null?void 0:String(n),fieldLabel:r,filterInputType:i}}if(s){let e=typeof t.values==`string`?t.values.trim():``;return{...t,value:e,values:[],fieldLabel:r,filterInputType:i}}return{...t,values:t.values??[],fieldLabel:r,filterInputType:i,groupFields:n?.filterGroupFields??[]}});a?.({moduleName:e,filters:t}),i?.()}function P(e){if(!e?.field)return!0;if(e.operator===`isEmpty`||e.operator===`notEmpty`)return!1;let{values:t}=e;return typeof t==`string`?t.trim()===``:!Array.isArray(t)||t.length===0||t.every(e=>e==null||e===``)}let F=f.length===0||f.every(P);function I(e,t){let n=d.getFieldValue(`filters`)??[];d.setFieldValue(`filters`,n.map((t,n)=>n===e?{...t,values:[]}:t));let r=g.find(e=>e.value===t),i=r?.filterInputType;if(!(!t||i===`datepicker`||i===`number-range`||i===`text`||!i&&[`boolean`,`date`,`number`].includes(r?.type))){let e=!!r?.lookup?.collection;S(t,``,{dataSource:e?`lookup`:r?.dataSource,groupName:r?.groupName,lookup:r?.lookup,groupFields:r?.filterGroupFields,groupSeparator:r?.filterGroupSeparator})}}return(0,l.jsxs)(s.Drawer,{title:(0,l.jsx)(n.Tn,{variant:`card-title`,color:`primary`,children:`Filters`}),placement:`right`,width:720,open:t,onClose:i,rootClassName:`dynamic-field-filter`,maskClosable:!1,footer:(0,l.jsxs)(s.Space,{className:`dynamic-field-filter__footer`,children:[(0,l.jsx)(n.lt,{onClick:M,children:`Reset`}),(0,l.jsx)(n.lt,{variant:`primary`,onClick:N,disabled:F,children:`Apply`})]}),children:[h&&(0,l.jsx)(s.Alert,{type:`error`,message:`Could not load filter fields`,description:h,style:{marginBottom:16},showIcon:!0}),(0,l.jsx)(s.Spin,{spinning:m,tip:`Loading fields…`,children:(0,l.jsx)(s.Form,{form:d,layout:`vertical`,className:`dynamic-field-filter__form`,initialValues:{filters:[Ii]},children:(0,l.jsx)(s.Form.List,{name:`filters`,children:(e,{add:t,remove:r})=>(0,l.jsxs)(s.Space,{direction:`vertical`,className:`dynamic-field-filter__rows`,children:[e.map((t,i)=>{let a=f[i]?.field,o=f[i]?.operator,u=g.find(e=>e.value===a),d=u?.isDefaultFilter===!0,p=!a||o===`isEmpty`||o===`notEmpty`,h=u?.type??`text`,_=u?.filterInputType,v=b[a]??[],C=x.has(a),w=new Set(f.filter((e,t)=>t!==i).map(e=>e?.field).filter(Boolean).map(String)),T=d?g.filter(e=>e.value===a):y.filter(e=>!w.has(String(e.value)));return(0,l.jsxs)(s.Space,{direction:`vertical`,className:`dynamic-field-filter__row`,children:[e.length>1&&!d&&(0,l.jsx)(n.lt,{variant:`danger`,htmlType:`button`,icon:(0,l.jsx)(c.DeleteOutlined,{}),"aria-label":`Remove filter row`,className:`dynamic-field-filter__remove`,onClick:()=>r(t.name)}),i>0&&(0,l.jsx)(s.Flex,{justify:`center`,children:(0,l.jsx)(s.Form.Item,{name:[t.name,`operator`],rules:[{required:!0,message:`Select condition`}],className:`dynamic-field-filter__operator`,children:(0,l.jsx)(s.Select,{options:Ni,placeholder:`Condition`})})}),(0,l.jsxs)(s.Flex,{align:`end`,gap:`middle`,wrap:!0,children:[(0,l.jsx)(s.Form.Item,{label:(0,l.jsx)(n.Tn,{variant:`label`,color:`secondary`,children:`Field`}),style:{flex:1,minWidth:220},children:d?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.Tn,{variant:`body`,className:`dynamic-field-filter__locked-field`,children:u?.label??a}),(0,l.jsx)(s.Form.Item,{name:[t.name,`field`],noStyle:!0,children:(0,l.jsx)(s.Input,{type:`hidden`})})]}):(0,l.jsx)(s.Form.Item,{name:[t.name,`field`],rules:[{required:!0,message:`Select field`}],noStyle:!0,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,placeholder:`Select field`,options:T,optionFilterProp:`label`,loading:m,onChange:e=>I(t.name,e)})})}),(0,l.jsx)(s.Form.Item,{label:(0,l.jsx)(n.Tn,{variant:`label`,color:`secondary`,children:`Values`}),name:[t.name,`values`],style:{flex:1,minWidth:220},children:Li({filterInputType:_,fieldType:h,disabled:p,loading:C,valueOptions:v,onSearch:e=>{if(a){let t=!!u?.lookup?.collection;S(a,e,{dataSource:t?`lookup`:u?.dataSource,groupName:u?.groupName,lookup:u?.lookup,groupFields:u?.filterGroupFields,groupSeparator:u?.filterGroupSeparator})}},onOpen:e=>{if(e&&a){let e=!!u?.lookup?.collection;S(a,``,{dataSource:e?`lookup`:u?.dataSource,groupName:u?.groupName,lookup:u?.lookup,groupFields:u?.filterGroupFields,groupSeparator:u?.filterGroupSeparator})}}})})]})]},t.key)}),(0,l.jsx)(n.lt,{htmlType:`button`,variant:`soft`,icon:(0,l.jsx)(c.PlusOutlined,{}),disabled:y.length>0&&f.filter(e=>e?.field).length>=y.length,onClick:()=>t(Ii),children:`Add Row`})]})})})})]})}var Hi=`data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.00035%204.69941C4.74567%204.69941%203.72701%205.71807%203.72701%206.97275C3.72701%208.22745%204.74567%209.24609%206.00035%209.24609C7.25503%209.24609%208.2737%208.22745%208.2737%206.97275C8.2737%205.71807%207.25503%204.69941%206.00035%204.69941ZM6.00035%205.87128C6.60827%205.87128%207.10182%206.36485%207.10182%206.97275C7.10182%207.58067%206.60827%208.07422%206.00035%208.07422C5.39243%208.07422%204.89888%207.58067%204.89888%206.97275C4.89888%206.36485%205.39243%205.87128%206.00035%205.87128ZM2.06843%206.41445C2.85434%204.9331%204.16742%203.92578%206.00035%203.92578C7.83328%203.92578%209.14637%204.9331%209.93227%206.41445C10.0838%206.70013%2010.4388%206.80902%2010.7245%206.65745C11.0102%206.50587%2011.1191%206.15091%2010.9675%205.86523C9.97758%203.9994%208.30902%202.75391%206.00035%202.75391C3.69169%202.75391%202.02312%203.9994%201.03322%205.86523C0.881648%206.15091%200.990538%206.50587%201.27619%206.65745C1.56187%206.80902%201.91686%206.70013%202.06843%206.41445Z'%20fill='%23586888'/%3e%3c/svg%3e`,Ui=`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='path-1-inside-1_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-1-inside-1_8856_23533)'/%3e%3cmask%20id='path-2-inside-2_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-2-inside-2_8856_23533)'/%3e%3cline%20x1='7.375'%20y1='2.93555'%20x2='12.225'%20y2='2.93555'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='5.83398'%20x2='12.225'%20y2='5.83398'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='8.87305'%20x2='12.225'%20y2='8.87305'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='11.7227'%20x2='12.225'%20y2='11.7227'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3c/svg%3e`,{Text:Wi}=s.Typography;function Gi(e){return qi(e?.label,e?.fieldLabel,e?.name,e?.fieldName,e?.value,e?.field)}function Ki(e){return qi(e?.value,e?.field,e?.fieldName,e?.name,e?.label)}function qi(...e){return e.find(e=>e!=null&&String(e).trim()!==``)}function Ji(e){return String(e??``).replace(/\[(\-?\d+)\]/g,`.$1`).split(`.`).filter(Boolean)}function Yi(e,t){if(!(!t||typeof t!=`string`))return Ji(t).reduce((e,t)=>{if(e!=null){if(/^-?\d+$/.test(t)){if(!Array.isArray(e))return;let n=Number(t);return e[n<0?e.length+n:n]}return e?.[t]}},e)}function Xi(e,t){return t===`id`?e?.id??e?._id:e?.[t]??Yi(e,t)}function Zi(e,t){if(!Array.isArray(e)||e.length===0||!t)return;let n=e[e.length-1];if(n!=null)return typeof n==`object`?Yi(n,t):n}function Qi(e){if(Array.isArray(e))return e.some(Qi);if(e==null)return!1;let t=String(e).trim().toLowerCase();return t?![`all`,`internal`].includes(t):!1}function $i(e){let t=Object.keys(e??{}).find(e=>/^customFields\.[^.]*profiledata\./i.test(e)&&!/^customFields\.internalprofiledata\./i.test(e));if(t)return t.replace(/^customFields\./i,``).replace(/profiledata\..*$/i,``);let n=e?.customFields;if(!n||typeof n!=`object`)return``;let r=Object.keys(n).find(e=>/profiledata$/i.test(e)&&!/^internalprofiledata$/i.test(e)&&n[e]&&typeof n[e]==`object`);return r?r.replace(/profiledata$/i,``):``}function ea(e){if(typeof e?.isVisible==`boolean`&&!e.isVisible||typeof e?.isVisible==`string`&&e.isVisible.toLowerCase()===`false`)return!1;let t=Ki(e);return!t||typeof t!=`string`?!1:/^customFields\.[^.]*profiledata\./i.test(t)&&!/^customFields\.internalprofiledata\./i.test(t)}function ta(e){return[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].some(Qi)||!!$i(e)}function na(e,t){let n=Xi(e,t);return n==null||n===``?`-`:Array.isArray(n)?n.join(`, `):typeof n==`object`?Object.values(n).join(` `):n}function ra(e){let t=e?.defaultValue;return t==null?``:String(t).trim()}function ia(e){return!!e?.renderConfig?.treatZeroAsEmpty}function aa(e,t=null){return e==null||e===``||e===`-`||ia(t)&&(e===0||e===`0`)?!0:Array.isArray(e)?e.length===0:typeof e==`object`&&Object.keys(e).length===0}function oa(e,t){let n=ra(e);return n&&aa(t,e)?n:t}function sa(e){if(!e)return``;let t=e instanceof Date?e:new Date(e);if(Number.isNaN(t.getTime()))return String(e);let n=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!0}).formatToParts(t),r=e=>n.find(t=>t.type===e)?.value??``;return`${`${r(`month`)} ${r(`day`)},${r(`year`)}`} | ${`${r(`hour`)}:${r(`minute`)} ${r(`dayPeriod`)}`}`}function ca(e){return String(e||`U`).trim().charAt(0).toUpperCase()||`U`}function la(e,t){let n=t.find(t=>{let n=Xi(e,t);return n!=null&&n!==``});return n?na(e,n):``}function ua(e,t){let n=Xi(t,e.key),r=Array.isArray(n)?n:n?[n]:[],i=e.renderConfig??{},a=[i.nameField,i.labelField,`recruiterName`,`name`,`fullName`,`displayName`,`userName`,`email`,`recruiterEmail`].filter(Boolean),o=[i.metaField,i.dateField,i.assignedDateField,`assignedDateTime`,`assignedDate`,`createdAt`].filter(Boolean);return r.map((e,t)=>{let n=typeof e==`object`&&e?e:{value:e},r=la(n,a)||String(e||`User`),i=la(n,o);return{key:la(n,[`recruiterId`,`id`,`_id`,`email`,`recruiterEmail`])||`${r}-${t}`,name:r,initial:ca(r),meta:sa(i)}})}function da({item:e}){return(0,l.jsxs)(`div`,{className:`job-avatar-tooltip`,children:[(0,l.jsx)(`div`,{className:`job-avatar-tooltip-name`,children:e.name}),e.meta&&(0,l.jsx)(`div`,{className:`job-avatar-tooltip-meta`,children:e.meta})]})}function fa({items:e}){return(0,l.jsx)(`div`,{className:`job-avatar-more-tooltip`,children:e.map(e=>(0,l.jsx)(da,{item:e},e.key))})}function pa(e){return typeof e==`boolean`?e:typeof e==`string`?e.toLowerCase()===`true`:!!e}function ma(e){return e==null?``:Array.isArray(e)?e.join(`,`):typeof e==`object`?Object.values(e).join(` `):String(e)}function ha(e,t){return e?String(e).replace(/\{([^}]+)\}/g,(e,n)=>encodeURIComponent(ma(Xi(t,n)))).replace(/:([A-Za-z_][\w.]*)/g,(e,n)=>encodeURIComponent(ma(Xi(t,n)))):``}function ga(e){return/^(https?:\/\/|\/)/i.test(String(e))}function _a(e,t){let n=String(e??``).trim().toLowerCase();if(n===`blank`||n===`_blank`)return`_blank`;if(n===`self`||n===`_self`)return`_self`;if(n)return e;if(/^https?:\/\//i.test(String(t)))return`_blank`}function va(e){return/^https?:\/\//i.test(String(e))}function ya(e,t,n){let r=e.routeUrl??e.routeURL??e.linkTemplate??e.linkUrl??e.href??e.url??e.action;return r?ha(r,t):ga(n)?String(n):``}function ba(e,t){if(!t||t.length<3||!e||typeof e!=`string`||e===`-`)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0;for(;a<=e.length;){let o=n.indexOf(r,a);if(o===-1){i.push(e.slice(a));break}o>a&&i.push(e.slice(a,o)),i.push((0,l.jsx)(`mark`,{className:`search-highlight`,style:{backgroundColor:`#ffff00`,color:`inherit`,padding:0,borderRadius:2},children:e.slice(o,o+t.length)},o)),a=o+t.length}return i}function xa(e,t,n,r=``){let i=ya(e,t,n),a=_a(e.linkTarget,i),o=ba(n,r);return va(i)?(0,l.jsx)(s.Tooltip,{title:n===`-`?void 0:n,children:(0,l.jsx)(`a`,{className:`job-cell-link job-cell-value`,href:i,rel:a===`_blank`?`noreferrer`:void 0,target:a,children:o})}):(0,l.jsx)(s.Tooltip,{title:n===`-`?void 0:n,children:(0,l.jsx)(d.Link,{className:`job-cell-link job-cell-value`,target:a,to:i||`#`,children:o})})}function Sa(e){let t=[e?.props,e?.props?.format,e?.props?.display,e?.props?.dateDisplay,e?.renderConfig?.format,e?.renderConfig?.display,e?.renderConfig?.dateDisplay,e?.dateDisplay].map(e=>typeof e==`string`?e.trim().toLowerCase():``).find(Boolean);return t===`datetime`||t===`time`?t:`date`}function Ca(e,t){if(e==null||e===``)return`-`;let n=e instanceof Date?e:new Date(e);if(Number.isNaN(n.getTime()))return na({value:e},`value`);let r=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!0,timeZone:`UTC`}).formatToParts(n),i=e=>r.find(t=>t.type===e)?.value??``,a=`${i(`month`)}, ${i(`day`)}, ${i(`year`)}`,o=`${i(`hour`)}:${i(`minute`)} ${i(`dayPeriod`)}`,s=Sa(t);return s===`time`?o:s===`datetime`?`${a} | ${o}`:a}function wa(e){return/date/i.test(`${e.key??``} ${e.label??``} ${e.type??``}`)}function Ta(e){return e==null||e===``?`-`:Array.isArray(e)?e.join(`, `):typeof e==`object`?Object.values(e).join(` `):e}function Ea(e,t,n){let r=String(t??``).trim();if(!r)return`-`;let i=r.replace(/^record\./,``);if(n?.renderConfig?.lastItemField??n?.renderConfig?.arrayDisplayField){let t=Ji(i);for(let n=t.length-1;n>=1;--n){let r=Xi(e,t.slice(0,n).join(`.`));if(!Array.isArray(r))continue;let i=r[r.length-1];return i==null?`-`:Ta(Yi(i,t.slice(n).join(`.`)))}let r=n?.key,a=r?Xi(e,r):void 0;if(r&&Array.isArray(a)){let e=a[a.length-1];if(i===r)return Ta(e);let t=`${r}.`;if(i.startsWith(t))return Ta(Yi(e,i.slice(t.length)))}}return na(e,i)}function Da(e){return String(e??``).replace(/\s+/g,` `).replace(/^\s*[-–—/:|·,]+\s*/,``).replace(/\s*[-–—/:|·,]+\s*$/,``).replace(/\s*([-–—/:|·,])\s*([-–—/:|·,])\s*/g,` $2 `).replace(/\s+[-–—]\s+(?=[A-Za-z$€£₹])/g,` `).replace(/\s+/g,` `).trim()}function Oa(e,t,n){if(typeof e!=`string`||e.trim()===``)return``;let r=!1,i=e.replace(/\{\{\s*([^}]+?)\s*\}\}/g,(e,i)=>{let a=Ea(t,i,n);return aa(a,n)?``:(r=!0,String(a))});if(!r)return``;let a=i.replace(/\s+/g,` `).trim();return n?.renderConfig?.cleanEmptyTemplateSeparators?Da(a):a}function ka(e,t){let n=Xi(t,e.key),r=Oa(e.displayTemplate,t,e),i=e.renderConfig?.lastItemField??e.renderConfig?.arrayDisplayField;if(r)return r;if(i){let t=Zi(n,i);return aa(t,e)?oa(e,`-`):Array.isArray(t)?oa(e,t.join(`, `)):typeof t==`object`?oa(e,Object.values(t).join(` `)):t}return wa(e)?oa(e,Ca(n,e)):oa(e,na(t,e.key))}function Aa(e,t){if(!ra(e)||Oa(e.displayTemplate,t,e))return!1;let n=Xi(t,e.key),r=e.renderConfig?.lastItemField??e.renderConfig?.arrayDisplayField;return r?aa(Zi(n,r),e):wa(e)?aa(Ca(n,e),e):aa(na(t,e.key),e)}function ja(e){return e===`-`||typeof e!=`string`||!e.trim()?e:e.replace(/\b([A-Za-z])([A-Za-z]*)\b/g,(e,t,n)=>e.length>1&&e===e.toUpperCase()?e:`${t.toUpperCase()}${n.toLowerCase()}`)}function Ma(e){return typeof e!=`string`||!e.includes(`-`)?e:e.replace(/(^|\s)-\s*(\d+)(?=\s*[A-Za-z])/,`$10-$2`).replace(/(\d+)\s*-\s*(?=[A-Za-z])/,`$1-0 `)}function Na(e){let t=e.map((e,t)=>({field:e,index:t}));return t.some(({field:e})=>e.order!==void 0&&e.order!==null&&e.order!==``)?[...t].sort((e,t)=>{let n=Number(e.field.order),r=Number(t.field.order),i=Number.isFinite(n),a=Number.isFinite(r);return i&&a&&n!==r?n-r:i===a?e.index-t.index:i?-1:1}).map(({field:e})=>e):e}function Pa(e){return e.iconUrl??e.iconURL??e.icon??e.iconPath}function Fa(e){return Array.isArray(e)?e.map((e,t)=>({...e,key:e.key??e.name??e.label??e.routeUrl??e.type??String(t),label:e.label??e.name??e.title??e.type??`Action`,iconUrl:Pa(e)})).filter(e=>e.iconUrl):[]}function Ia(e,t,n=[],r){if(gr(e.key,t,n,r)||Array.isArray(e.conditions)&&e.conditions.length>0&&!e.conditions.every(e=>pr(e,t,r)))return!1;let i=e?.showIfField??e?.visibleWhenField;return!i||pr({field:i,operator:e?.showIfOperator||`eq`,value:e?.showIfValue??e?.visibleWhenValue??``},t,r)}function La(e,t={}){let n=rr(e);return n===`add`?t.canAdd!==!1:n===`edit`?t.canEdit!==!1:n!==`delete`||t.canDelete!==!1}function Ra(e,t,n){let r=ha(e.routeUrl??e.routeURL??e.route??e.url??e.href,t),i=no(e.type??e.actionType),a=typeof e.label==`function`?e.label(t):e.label,o=(0,l.jsx)(`img`,{src:e.iconUrl,alt:a,className:`job-field-action-icon`}),c=`job-field-action-button`,u=e.__done,f=e.__disabledReason;return u||f?(0,l.jsx)(s.Tooltip,{title:u?u.label:f,children:(0,l.jsx)(`button`,{"aria-label":u?u.label:`${a} (unavailable)`,className:`${c} job-field-action-button--done`,type:`button`,disabled:!0,children:o})},e.key):typeof e.onClick==`function`?(0,l.jsx)(s.Tooltip,{title:a,children:(0,l.jsx)(`button`,{"aria-label":a,className:c,type:`button`,onClick:n=>{n.stopPropagation(),e.onClick(t)},children:o})},e.key):(i===`popup`||i===`modal`||e.popupKey)&&r?(0,l.jsx)(s.Tooltip,{title:a,children:(0,l.jsx)(`button`,{"aria-label":a,className:c,type:`button`,onClick:i=>{i.stopPropagation(),n?.(r,t,e)},children:o})},e.key):r&&(i===`page`||r.startsWith(`/`))?(0,l.jsx)(s.Tooltip,{title:a,children:(0,l.jsx)(d.Link,{"aria-label":a,className:c,to:r,children:o})},e.key):r?(0,l.jsx)(s.Tooltip,{title:a,children:(0,l.jsx)(`a`,{"aria-label":a,className:c,href:r,rel:`noreferrer`,target:`_blank`,children:o})},e.key):(0,l.jsx)(s.Tooltip,{title:a,children:(0,l.jsx)(`button`,{"aria-label":a,className:c,type:`button`,children:o})},e.key)}function za(e){let t=Array.isArray(e.secondaryFields)?e.secondaryFields:[],n=e.secondaryField?[e.secondaryField]:[];return[...t,...n].filter((e,t,n)=>e&&n.indexOf(e)===t)}function Ba(e,t){let n=e.secondarySeparator??` `,r=za(e).map(e=>na(t,e)).filter(e=>e!==`-`);return r.length?r.join(` ${n} `):``}function Va(e){return ja(Ma(e))}function Ha(e,t){if(!Array.isArray(e.valueStyles))return null;let n=no(t);return e.valueStyles.find(e=>no(e?.value)===n||no(e?.label)===n)??null}function Ua(e){let t=e?.color,n=e?.bg??e?.background??e?.backgroundColor;return{...t?{"--job-cell-badge-color":t}:{},...n?{"--job-cell-badge-bg":n}:{}}}function Wa(e){return no(e?.varient??e?.variant).replace(/[^a-z0-9-]/g,`-`)}function Ga(e,t){let n=Ha(e,t),r=n??e.commonStyle??{},i=n?.label??t,a=(typeof i==`string`?i.trim():i)||`-`,o=Wa(r),c=[`job-cell-badge`,`job-cell-value`,o?`job-cell-badge--${o}`:``].filter(Boolean).join(` `),u=!n&&typeof a==`string`&&a.includes(`,`)?a.split(`,`).map(e=>e.trim()).filter(Boolean):null,d=u&&u.length>1?`${u.slice(0,1).join(`, `)} +${u.length-1}`:a,f=Ua(r);return(0,l.jsx)(s.Tooltip,{title:a===`-`?void 0:a,children:(0,l.jsx)(s.Tag,{className:c,style:f,children:d})})}function Ka(e,t){let n=ua(e,t),r=n.slice(0,2),i=n.slice(2);if(!n.length){let t=ra(e)||`-`;return(0,l.jsx)(Wi,{className:`job-cell-primary job-cell-value`,children:t})}return(0,l.jsxs)(`span`,{className:`job-avatar-group`,children:[r.map((e,t)=>(0,l.jsx)(s.Tooltip,{overlayClassName:`job-avatar-tooltip-overlay`,title:(0,l.jsx)(da,{item:e}),children:(0,l.jsx)(s.Avatar,{className:`job-avatar job-avatar--${t+1}`,children:e.initial})},e.key)),i.length>0&&(0,l.jsx)(s.Tooltip,{overlayClassName:`job-avatar-tooltip-overlay job-avatar-more-tooltip-overlay`,title:(0,l.jsx)(fa,{items:i}),children:(0,l.jsxs)(s.Avatar,{className:`job-avatar job-avatar--more`,children:[`+`,i.length]})})]})}function qa(e,t,n=``,r,i={},a=[],o){if(no(e.renderType)===`avatar`)return Ka(e,t);let c=Aa(e,t),u=Va(ka(e,t)),d=Fa(e.actionButtons).filter(e=>Ia(e,t,a,o)).filter(e=>La(e,i)).map(e=>({...e,__done:vr(e,t,o),__disabledReason:_r(e.key,t,a,o)})),f=Va(Ba(e,t)),p=no(e.renderType)===`badge`&&u!==`-`?Ga(e,u):!pa(e.isLink)||u===`-`||c?(0,l.jsx)(s.Tooltip,{title:u===`-`?void 0:u,children:(0,l.jsx)(Wi,{className:`job-cell-primary job-cell-value`,children:ba(u,n)})}):xa(e,t,u,n);return(0,l.jsxs)(`span`,{className:`job-cell-content`,children:[(0,l.jsxs)(`span`,{className:`job-cell-main-line`,children:[p,d.length>0&&(0,l.jsx)(`span`,{className:`job-field-actions`,children:d.filter(e=>typeof e.hiddenIf!=`function`||!e.hiddenIf(t)).map(e=>Ra(e,t,r))})]}),f&&(0,l.jsx)(s.Tooltip,{title:f,children:(0,l.jsx)(`span`,{className:`job-cell-secondary`,children:ba(f,n)})})]})}var Ja=130,Ya=230,Xa=7.2,Za=26,Qa=8,$a=44,eo=20;function to(e,t){let n=String(e.label??``).length*Qa+$a;if(no(e.renderType)===`avatar`)return Math.max(Math.round(n),120);let r=0;for(let n of t){let t=String(Va(ka(e,n))??``),i=String(Va(Ba(e,n))??``);r=Math.max(r,t.length,i.length)}let i=no(e.renderType)===`badge`?24:0,a=r*Xa+Za+i;return Math.round(Math.min(Math.max(n,a,Ja),Ya))}function no(e){return String(e??``).trim().toLowerCase()}function ro(e,t){return e?.key??e?.value??e?.id??(t===void 0?void 0:String(t))}function io(e){return no(e)}function ao(e){return[`all`,``].includes(io(e))}function oo(e,t,n,r,i){if(ao(t))return!0;let a=no(n?.filterValue??n?.status??n?.title??n?.tabTitle??n?.name??(typeof n?.label==`string`?n.label:void 0)??n?.value??n?.key??t),o=n?.field??n?.fieldName??n?.filterField??n?.dataIndex??i;if(o)return no(na(e,o))===a;let s=r.filter(e=>{let t=no(e.key),n=no(e.label);return t.includes(`status`)||n.includes(`status`)});return(s.length?s:r).some(t=>no(na(e,t.key))===a)}function so(e,t,n){return typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]:e.id??e._id??e.key??t}function co(e){return!!e?.closest?.(`a,button,input,textarea,select,label,[role="button"],[role="menuitem"],.ant-checkbox,.ant-radio,.ant-dropdown,.ant-dropdown-trigger,.ant-table-selection-column,.job-field-actions,.job-row-eye-button`)}function lo(e){return e.label??e.name??e.title??e.value}function uo(e,t){return e.key??e.value??e.route??e.name??String(t)}var fo={delete:(0,l.jsx)(c.DeleteOutlined,{}),edit:(0,l.jsx)(c.EditOutlined,{}),mail:(0,l.jsx)(c.MailOutlined,{}),shareAlt:(0,l.jsx)(c.ShareAltOutlined,{}),swap:(0,l.jsx)(c.RightOutlined,{}),thunderbolt:(0,l.jsx)(c.ThunderboltOutlined,{}),userAdd:(0,l.jsx)(c.UserAddOutlined,{}),userSwitch:(0,l.jsx)(c.UserSwitchOutlined,{})};function po(e,t){let n={key:e.key,label:t?t.label:e.label,icon:fo[e.icon]??void 0,danger:t?void 0:e.danger||void 0,disabled:!!t||void 0,title:t?t.label:void 0};return e.children?.length&&(n.children=e.children.map(e=>po(e))),n}function mo(e,t,n){return!e?.doneWhen?.field||!t?.length?null:t.every(t=>vr(e,t,n))?vr(e,t[0],n):null}function ho(e,t){return e.filter(t).map(e=>e.children?.length?{...e,children:ho(e.children,t)}:e)}function go(e){let t=[];for(let n of e)t.push(n),n.children?.length&&t.push(...go(n.children));return t}function _o(e){return Array.isArray(e)?e.map((e,t)=>{let n=lo(e),r=uo(e,t);return!n||!r?null:{...e,key:String(r),label:n,route:e.route||e.routeTemplate||(e.actionType===`modal`&&(e.popupKey||r)?`/popup/${e.popupKey||r}`:``),children:e.children?.length?_o(e.children):void 0}}).filter(Boolean):[]}function vo(e){let t=String(e?.key??``).trim().toLowerCase(),n=String(e?.label??``).trim().toLowerCase(),r=String(e?.popupKey??``).trim().toLowerCase(),i=String(e?.route??e?.routeTemplate??``).trim().toLowerCase();return t===`change-status`||t===`changestatus`||n===`change status`||r===`change-status`||i.includes(`/popup/change-status`)}function yo(e){let t=e?.clientSubmissionStatus,n=t&&typeof t==`object`?t:null;return{id:Number(n?.clientSubmissionStatusId??n?.id??n?.uniqueId??e?.clientSubmissionStatusId??e?.clientStatusId??e?.[`clientSubmissionStatus.clientSubmissionStatusId`]??0)||0,text:no(String(n?.clientSubmissionStatusText??n?.name??(typeof t==`string`?t:void 0)??e?.clientSubmissionStatusText??e?.clientStatusText??e?.clientStatus??e?.[`clientSubmissionStatus.clientSubmissionStatusText`]??``).trim())}}function bo(e,t,n){let r=yo(e);return r.id>0&&t.has(r.id)?!0:!!(r.text&&n.has(r.text))}function xo(e,t,n){return e?.length?e.some(e=>bo(e,t,n)):!1}function So(e,t){return!e.permissionKey||!t.length||t.every(t=>n.P(Yi(t,`actionPermission.${e.permissionKey}`)))}function Co(e,t){return t?e===`asc`?`desc`:e===`desc`?``:`asc`:`asc`}function wo(e){return e===`asc`?`Ascending`:e===`desc`?`Descending`:`Neutral`}function To({label:e,sortDir:t,sortable:n,onSort:r}){if(!n)return(0,l.jsx)(`span`,{className:`job-table-header-label`,children:e});let i=wo(t);return(0,l.jsxs)(`div`,{className:`job-table-header-content`,children:[(0,l.jsx)(`span`,{className:`job-table-header-label`,title:typeof e==`string`?e:void 0,children:e}),(0,l.jsx)(s.Tooltip,{title:i,mouseEnterDelay:.08,overlayClassName:`job-sort-tooltip`,children:(0,l.jsx)(`button`,{type:`button`,className:`job-table-sort-trigger${t?` job-table-sort-trigger--active`:``}`,"aria-label":`Sort ${typeof e==`string`?e:`column`}, ${i}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),r?.()},children:(0,l.jsxs)(`span`,{className:`job-table-sort-icon-stack`,children:[(0,l.jsx)(c.CaretUpOutlined,{className:`job-table-sort-icon job-table-sort-icon--up${t===`asc`?` job-table-sort-icon--active`:``}`}),(0,l.jsx)(c.CaretDownOutlined,{className:`job-table-sort-icon job-table-sort-icon--down${t===`desc`?` job-table-sort-icon--active`:``}`})]})})})]})}function Eo({moduleName:e,activeTabScope:t,pageSize:n,sort:r,sortDir:i,queryParams:a}){return[e??``,t??``,n,r??``,i??``,a?JSON.stringify(a):``].join(`|`)}function Do(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:1}function Oo(e){for(let t of e.keys()){let e=/^p(\d+)$/.exec(t);if(e)return Do(e[1])}return 1}function ko(e){[...e.keys()].forEach(t=>{(/^p\d+$/.test(t)||t===`page`)&&e.delete(t)})}var Ao=[],jo={};function Mo({record:e,fields:t,selected:n,onSelect:r,onPreview:i,onRecordClick:a,isControlled:o,selectionMode:c=`checkbox`,onPopupAction:u,permissions:d}){let f=t.find(e=>e.cardRole===`name`),p=t.find(e=>e.cardRole===`action`),m=t.find(e=>e.cardRole===`headerAction`),h=t.filter(e=>e!==f&&e!==p&&e!==m),g=f?na(e,Ki(f)):``,_=p?.render?p.render(Xi(e,Ki(p)),e):null,v=m?.render?m.render(Xi(e,Ki(m)),e):null;return(0,l.jsxs)(`div`,{className:`param-card${n?` param-card--selected`:``}`,"aria-selected":n,onClick:e=>{co(e.target)||a?.()},role:a?`button`:void 0,tabIndex:a?0:void 0,onKeyDown:e=>{!a||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),a())},children:[(0,l.jsx)(`div`,{className:`param-card__header`,children:(0,l.jsxs)(`div`,{className:`param-card__name-row`,children:[c===`checkbox`&&(0,l.jsx)(s.Checkbox,{checked:n,onChange:r,onClick:e=>e.stopPropagation(),className:`param-card__checkbox`}),i&&(0,l.jsx)(`button`,{type:`button`,className:`job-row-eye-button`,"aria-label":`Preview`,onClick:e=>{e.stopPropagation(),i()},children:(0,l.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.00035%204.69941C4.74567%204.69941%203.72701%205.71807%203.72701%206.97275C3.72701%208.22745%204.74567%209.24609%206.00035%209.24609C7.25503%209.24609%208.2737%208.22745%208.2737%206.97275C8.2737%205.71807%207.25503%204.69941%206.00035%204.69941ZM6.00035%205.87128C6.60827%205.87128%207.10182%206.36485%207.10182%206.97275C7.10182%207.58067%206.60827%208.07422%206.00035%208.07422C5.39243%208.07422%204.89888%207.58067%204.89888%206.97275C4.89888%206.36485%205.39243%205.87128%206.00035%205.87128ZM2.06843%206.41445C2.85434%204.9331%204.16742%203.92578%206.00035%203.92578C7.83328%203.92578%209.14637%204.9331%209.93227%206.41445C10.0838%206.70013%2010.4388%206.80902%2010.7245%206.65745C11.0102%206.50587%2011.1191%206.15091%2010.9675%205.86523C9.97758%203.9994%208.30902%202.75391%206.00035%202.75391C3.69169%202.75391%202.02312%203.9994%201.03322%205.86523C0.881648%206.15091%200.990538%206.50587%201.27619%206.65745C1.56187%206.80902%201.91686%206.70013%202.06843%206.41445Z'%20fill='%23586888'/%3e%3c/svg%3e`,alt:``,className:`job-row-eye-icon`})}),(0,l.jsx)(Wi,{className:`param-card__name`,children:g}),v&&(0,l.jsx)(`div`,{className:`param-card__header-actions`,children:v})]})}),h.length>0&&(0,l.jsx)(`div`,{className:`param-card__body-fields`,children:h.map(t=>{let n=Ki(t),r=Xi(e,n),i=o&&typeof t.render==`function`?t.render(r,e):qa(t,e,``,u,d);return(0,l.jsxs)(`div`,{className:`param-card__field-row`,children:[(0,l.jsx)(Wi,{className:`param-card__field-label`,children:Gi(t)}),(0,l.jsx)(`div`,{className:`param-card__field-value`,children:i})]},n)})}),(0,l.jsx)(`div`,{className:`param-card__divider`}),(0,l.jsxs)(`div`,{className:`param-card__footer`,children:[(0,l.jsx)(`div`,{className:`param-card__footer-left`}),(0,l.jsx)(`div`,{className:`param-card__footer-right`,children:_})]})]})}function No(e){return!!(e.operator===`isEmpty`||e.operator===`notEmpty`||e.value||e.from||e.to||Array.isArray(e.values)&&e.values.length>0)}function Po(e){return e.fieldLabel?e.fieldLabel:(e.field??``).replace(/([A-Z])/g,` $1`).replace(/^(.)/,e=>e.toUpperCase()).trim()}function Fo(e){if(e.operator===`isEmpty`)return`Is Empty`;if(e.operator===`notEmpty`)return`Not Empty`;if(e.value)return`"${e.value}"`;if(e.from&&e.to)return`${e.from} to ${e.to}`;if(e.from)return`from ${e.from}`;if(e.to)return`to ${e.to}`;if(Array.isArray(e.values)&&e.values.length>0){let t=e.values.slice(0,2).join(`, `);return e.values.length>2?`${t} +${e.values.length-2}`:t}return``}function Io({filters:e,onRemove:t,onClearAll:n}){let r=(e??[]).map((e,t)=>({row:e,originalIdx:t})).filter(({row:e})=>e.field&&No(e));return r.length===0?null:(0,l.jsxs)(s.Flex,{gap:6,wrap:`wrap`,align:`center`,className:`filter-chips-bar`,children:[(0,l.jsx)(Wi,{className:`filter-chips-bar__label`,children:`Filters:`}),r.map(({row:e,originalIdx:n})=>(0,l.jsxs)(s.Tag,{closable:!0,onClose:()=>t(n),className:`filter-chip`,children:[(0,l.jsx)(`span`,{className:`filter-chip__field`,children:Po(e)}),(0,l.jsx)(`span`,{className:`filter-chip__sep`,children:`: `}),(0,l.jsx)(`span`,{className:`filter-chip__value`,children:Fo(e)})]},`${e.field}-${n}`)),r.length>1&&(0,l.jsx)(s.Button,{type:`link`,size:`small`,onClick:n,className:`filter-chips-clear`,children:`Clear all`})]})}function Lo({moduleName:e,authToken:r,actions:i=[],actionRules:a=[],breadcrumbItems:u=[],dataSource:f=[],className:p=``,initialPageSize:m=10,onAction:h,onSummaryClick:g,rowKey:_,showSummaryButton:v=!1,summaryButtonLabel:y=`View Summary`,summaryRoute:b,showFieldButton:x=!0,showFilterButton:S=!0,fieldButtonLabel:C=`View Field`,fieldButtonRoute:w,tabs:T,tabTitleOverrides:E=null,tableClassName:D=`job-list-table`,fields:O=Ao,fieldOverrides:k=null,extraFields:A=Ao,listName:j=``,loading:M=!1,total:N,current:F,pageSize:I,onPageChange:L,onPageSizeChange:R,onSearch:z,toolbarExtra:B=null,showSearch:V=!0,searchPlaceholder:H=`Min 3 Chars, press Enter to search`,searchFields:U=Ao,showViewToggle:ee=!1,activeView:te=`list`,onViewChange:ne,autoCardForExternalRows:re=!0,createAction:ie,onRecordClick:ae,selectedRecordId:W,selectionMode:oe=`checkbox`,compact:se=!1,onSelectionChange:ce,selectedSource:le,onTabChange:ue,fetchData:de=On,responseMapper:fe=ri,queryParams:pe=jo,defaultVisibleColumnCount:me=6,showAdd:he=!0,lockOuterPageScroll:ge=!1}){let _e=(0,d.useNavigate)(),G=(0,d.useLocation)(),K=n.xn(e),[ve,ye]=(0,o.useState)(()=>new Set),[be,xe]=(0,o.useState)(()=>new Set);(0,o.useEffect)(()=>{if(no(K)!==`submissions`){ye(new Set),xe(new Set);return}let e=!1,n=new URLSearchParams({masterName:`clientSubmissions`,offset:`0`,limit:`100`});return t.b&&n.set(`app_id`,t.b),t.o(t.x,`/masters/dropdown?${n.toString()}`).then(t=>{if(e)return;let n=(Array.isArray(t?.data)?t.data:[]).filter(e=>e?.isTerminalStatus===!0);ye(new Set(n.map(e=>Number(e?.id??e?.uniqueId??0)).filter(e=>e>0))),xe(new Set(n.map(e=>no(e?.name)).filter(Boolean)))}).catch(()=>{e||(ye(new Set),xe(new Set))}),()=>{e=!0}},[K]);let Se=!!ge,{canView:Ce,canAdd:we,canEdit:Te,canDelete:Ee}=tr(K),De=JSON.stringify(pe??jo),Oe=(0,o.useMemo)(()=>pe??jo,[De]),[ke]=(0,d.useSearchParams)(),Ae=Oo(ke),[je,Me]=(0,o.useState)(()=>String(le??``).trim()||`all`),[Ne,Pe]=(0,o.useState)(``),[Fe,Ie]=(0,o.useState)(``),[Le,ze]=(0,o.useState)(!1),[q,J]=(0,o.useState)([]),[Y,X]=(0,o.useState)([]),[Be,Ve]=(0,o.useState)([]),[He,Ue]=(0,o.useState)(0),[We,Ge]=(0,o.useState)({current:Ae,pageSize:m}),[Ke,qe]=(0,o.useState)({sort:``,sortDir:``}),[Je,Ye]=(0,o.useState)([]),[Xe,Ze]=(0,o.useState)(!1),[Qe,$e]=(0,o.useState)([]);(0,o.useEffect)(()=>(r&&t.g(r),()=>{r&&t.r()}),[r]),(0,o.useEffect)(()=>{if(Se)return document.documentElement.classList.add(`listview-page-scroll-lock`),document.body.classList.add(`listview-page-scroll-lock`),()=>{document.documentElement.classList.remove(`listview-page-scroll-lock`),document.body.classList.remove(`listview-page-scroll-lock`)}},[Se]);let et=(0,o.useRef)(null),[tt,nt]=(0,o.useState)(0),rt=(0,o.useRef)(),it=(0,o.useRef)(``);(0,o.useEffect)(()=>{let e=et.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(e=>{let t=e[0]?.contentRect?.width;typeof t==`number`&&nt(t)});return t.observe(e),()=>t.disconnect()},[]);let at=(e,t)=>String(so(e,t,_)),ot=(e,t)=>String(at(e,t))===String(W??``),st=(e,t)=>{let n=at(e,t);n&&ae?.(e,n)},ct=(e,t)=>{X(e),Ve(t),ce?.(e,t)},[lt,ut]=(0,o.useState)(f),[dt,ft]=(0,o.useState)(f.length),[pt,mt]=(0,o.useState)([]),[ht,gt]=(0,o.useState)([]),[_t,vt]=(0,o.useState)(``),[yt,bt]=(0,o.useState)([]),[xt,St]=(0,o.useState)([]),[Ct,wt]=(0,o.useState)(!1),[Tt,Et]=(0,o.useState)(null),[Dt,Ot]=(0,o.useState)(null),[kt,At]=(0,o.useState)(!1),jt=!!(L||R||z),Mt=jt?f:lt,Nt=jt?N??0:dt,Pt=jt?O:ht,Ft=(0,o.useMemo)(()=>Mt.some(e=>ta(e)),[Mt]),It=(0,o.useMemo)(()=>Pt.some(e=>ea(e)),[Pt]),Lt=re&&(Ft||It)?`card`:te,Rt=i.length>0?i:yt,zt=a.length>0?a:xt,Bt=(0,o.useMemo)(()=>_o(Rt),[Rt]),Vt=(0,o.useMemo)(()=>new Map(go(Bt).map(e=>[e.key,e])),[Bt]),Ht=(0,o.useMemo)(()=>ho(Bt,e=>{let t=rr(e);return t===`add`&&!we||t===`edit`&&!Te||t===`delete`&&!Ee||!n.F(e.permission,K)||e.showInList===!1?!1:!e.allowedTabs||e.allowedTabs.some(e=>no(e)===no(je))}),[Bt,je,we,Te,Ee,K]),Ut=(0,o.useMemo)(()=>ho(Ht,e=>(Y.length===1||e.allowMultiple||e.danger)&&So(e,Be)&&!(no(K)===`submissions`&&vo(e)&&xo(Be,ve,be))&&!yr(e.key,Be,zt,je)),[je,K,zt,Y.length,Be,ve,be,Ht]),Wt=typeof e==`string`?e.trim().length>0:!!e,Gt=Wt?`/${K}-create${ie?`?action=${encodeURIComponent(ie)}`:``}`:``;(0,o.useEffect)(()=>{Wt&&!Ce&&_e(`/`,{replace:!0})},[Ce,Wt,_e]);let Kt=(e,{replace:t=!1}={})=>{let n=new URLSearchParams(ke);ko(n);let r=[n.toString(),e>1?`p${e}`:``].filter(Boolean).join(`&`);r!==G.search.replace(/^\?/,``)&&_e({pathname:G.pathname,search:r?`?${r}`:``},{replace:t})},qt=(e,t)=>{Ge(t=>({...t,current:e})),Kt(e,t)},Jt=()=>{qt(1,{replace:!0})},{config:Yt,loading:Xt,error:Zt}=Gn(!jt&&Wt?e:null),Qt=(0,o.useCallback)(e=>{let t=Ke.sort===e,n=Co(Ke.sortDir,t),r=n?String(e):``;qe({sort:r,sortDir:n}),typeof z==`function`&&z(r,n),Jt()},[z,Jt,Ke.sort,Ke.sortDir]);(0,o.useEffect)(()=>{Ge(e=>e.current===Ae?e:{...e,current:Ae})},[Ae]),(0,o.useEffect)(()=>{jt&&Ge(e=>{let t=Do(F??e.current),n=Number(I)>0?Number(I):e.pageSize;return e.current===t&&e.pageSize===n?e:{current:t,pageSize:n}})},[F,I,jt]);let $t=G.state?.refreshTimestamp;(0,o.useEffect)(()=>{$t&&(ct([],[]),Ue(e=>e+1))},[$t]);let en=(0,o.useMemo)(()=>{let e=[...Array.isArray(T)?T:[],...pt],t=io(je);return e.find((e,n)=>io(ro(e,n))===t)},[je,pt,T]),tn=en?.field??en?.fieldName??en?.filterField??en?.dataIndex??_t,nn=ao(je)?``:je,rn=!nn&&!ao(je)&&no(tn).length>0,an=Fe.trim().length>=3,on=an?Fe.trim():``,sn=q.some(e=>e.field),cn=Eo({moduleName:e,activeTabScope:nn,pageSize:We.pageSize,sort:Ke.sort,sortDir:Ke.sortDir,queryParams:Oe}),ln=We.current===1&&Dt?.key===cn,un=Number(Dt?.total),dn=an?Number.isFinite(un)&&un>0?un:dt:0;(0,o.useEffect)(()=>{if(jt)return;if(!Wt){ut([]),ft(0),mt([]),gt([]),vt(``),bt([]),St([]),Et(null);return}let t=io(nn);if(it.current&&it.current===t){it.current=``;return}let n=!1,r=an&&dn>We.pageSize,i=r?dn:We.pageSize,a=r?0:(We.current-1)*We.pageSize;return wt(!(!an&&!sn&&We.current===1&&ln)),Et(null),de(e,i,a,{scope:nn,sort:Ke.sort,sortDir:Ke.sortDir,search:on,filters:q,queryParams:Oe}).then(t=>{if(n)return;let{rows:r,total:i,tabs:a,fields:o,tabField:s,actions:c,actionRules:l}=fe(t,e),u=!le&&ao(je)&&Array.isArray(a)&&a.length>0&&!a.some((e,t)=>ao(ro(e,t)))?ro(a[0],0):``,d=Eo({moduleName:e,activeTabScope:u?String(u):nn,pageSize:We.pageSize,sort:Ke.sort,sortDir:Ke.sortDir,queryParams:Oe});ut(r),ft(i),mt(a),gt(o),vt(s),bt(c),St(l),u&&(it.current=io(u),Me(e=>io(e)===io(u)?e:String(u))),!an&&!sn&&We.current===1&&Ot({key:d,rows:r,total:i,tabs:a,fields:o,tabField:s,actions:c,actionRules:l})}).catch(e=>{n||(ut([]),ft(0),mt([]),gt([]),vt(``),bt([]),St([]),Et(e.message),Wt&&s.message.error(`Invalid module name or data could not be loaded.`))}).finally(()=>{n||wt(!1)}),()=>{n=!0}},[on,je,nn,q,de,sn,an,Wt,jt,e,We.current,We.pageSize,He,fe,dn,le,Ke.sort,Ke.sortDir,Oe]);let fn=(0,o.useMemo)(()=>{let e=jt&&Array.isArray(O)&&O.length,t=!jt&&Array.isArray(ht)&&ht.length,n=!Zt&&Array.isArray(Yt)&&Yt.length,r=e?O:t?ht:n?Yt:[],i=new Map(ht.map(e=>[Ki(e),e]).filter(([e])=>e)),a=r.map(e=>{let t=Ki(e),n=i.get(t)??{},r=t&&k&&typeof k==`object`?k[t]:null,a=r?.renderConfig?{...n.renderConfig??e.renderConfig??{},...r.renderConfig}:e.renderConfig??n.renderConfig??null;return{...n,...e,...r??{},...a?{renderConfig:a}:{},key:t,label:Gi(r??e)??Gi(e)??Gi(n)}}).filter(e=>e.key&&e.label),o=(Array.isArray(A)?A:[]).map((e,t)=>{let n=Ki(e);return n?{...e,key:n,label:Gi(e)??`Field ${t+1}`,isVirtual:e.isVirtual??!0,isVisible:typeof e.isVisible!=`boolean`||e.isVisible}:null}).filter(Boolean);return Na([...a,...o])},[Yt,Zt,O,A,k,jt,ht]),pn=(0,o.useMemo)(()=>fn.filter(e=>typeof e.isVisible==`boolean`?e.isVisible:typeof e.isVisible!=`string`||e.isVisible.toLowerCase()===`true`).map(e=>({key:e.key,label:e.label})),[fn]),mn=pn.map(e=>e.key),hn=Je.filter(e=>mn.includes(e)),gn=hn.length?hn:pn.slice(0,me).map(e=>e.key),_n=Math.min(me,pn.length),vn=gn.length>me,yn=(0,o.useMemo)(()=>fn.filter(e=>!e.cardHidden&&(e.tableHidden||gn.includes(e.key))),[fn,gn]),bn=(0,o.useMemo)(()=>{let e=Ne.toLowerCase(),t=Mt,n=rn?t.filter(e=>oo(e,je,en,fn,tn)):t,r=U.length?fn.filter(e=>U.includes(e.key)):fn;return!e||e.length<3?n:n.filter(t=>r.some(n=>String(na(t,n.key)).toLowerCase().includes(e)||za(n).some(n=>String(na(t,n)).toLowerCase().includes(e))))},[je,en,tn,rn,Mt,fn,Ne,U]),xn=(0,o.useMemo)(()=>{if(!an)return bn;let e=(We.current-1)*We.pageSize;return bn.slice(e,e+We.pageSize)},[bn,an,We.current,We.pageSize]),Sn=an?bn.length:Nt,Cn=Fe.trim().length>=3,wn=String(bn.length).padStart(2,`0`),Tn=Nt>0||Mt.length>0,En=Tn||Ne.trim().length>0||Fe.trim().length>0,Dn=Wt?Tt?`Invalid module name or data could not be loaded.`:Zt?`Field configuration failed to load.`:`No data found.`:`Please provide a module name to view data.`,kn=(0,o.useMemo)(()=>!E||typeof E!=`object`?null:Object.entries(E).reduce((e,[t,n])=>(n==null||(e[String(t)]=String(n)),e),{}),[E]),An=(0,o.useMemo)(()=>{let t=Array.isArray(T)?T:[],n=t.length?t:pt.length?pt:[{key:`all`,title:e??`List`,count:Sn}];return!kn||!Object.keys(kn).length?n:n.map((e,t)=>{if(!e||typeof e!=`object`)return e;let n=ro(e,t),r=kn[String(n)];return r?{...e,title:r}:e})},[e,pt,kn,Sn,T]);(0,o.useEffect)(()=>{if(!An.length||!((pt?.length??0)>0||Array.isArray(T)&&T.length>0))return;let e=io(je);if(!An.some((t,n)=>io(ro(t,n))===e)){let e=ro(An[0],0);e&&Me(String(e))}},[je,An,pt,T]),(0,o.useEffect)(()=>{if(le===void 0||!An.length)return;let e=An.find((e,t)=>io(ro(e,t))===io(le));if(!e)return;let t=String(ro(e,An.indexOf(e)));(le!==rt.current||io(je)!==io(t))&&(rt.current=le,Me(e=>io(e)===io(t)?e:t))},[je,An,le]);let jn=e=>{let t=fn.map(e=>{let t={};return Object.entries(e).forEach(([e,n])=>{typeof n!=`function`&&(t[e]=n)}),t});_e(`/popup/preview`,{state:{background:G,moduleName:K,record:e,fields:t}})},Mn=(e,t,n={})=>{let r=ha(e,t),i=r.startsWith(`/`)?r:`/${r}`,a=t?._id??t?.id;_e(i,{state:{background:G,selectedIds:a===void 0?[]:[a],selectedRecords:[t],moduleName:K,popupContext:n.popupState??{},popupAction:{key:n.key,apiMethod:n.apiMethod,apiPath:n.apiPath,defaultTemplateId:n.defaultTemplateId,requireJobId:n.requireJobId,popupKey:n.popupKey,actionType:n.actionType??n.type,popupFieldOverrides:n.popupFieldOverrides},requireJobId:n.requireJobId,...n.popupState}})},Nn=(0,o.useMemo)(()=>{let e={dataIndex:`icons`,key:`icons`,visibilityKey:`jobsGroup`,fixed:`left`,width:25,render:(e,t)=>(0,l.jsxs)(s.Space,{size:4,className:`job-row-icons`,children:[(0,l.jsx)(`button`,{type:`button`,className:`job-row-eye-button`,"aria-label":`Preview job`,onClick:()=>jn(t),children:(0,l.jsx)(`img`,{src:Hi,alt:``,className:`job-row-eye-icon`})}),t.hasLinkedIn&&(0,l.jsx)(s.Tooltip,{title:`LinkedIn`,children:(0,l.jsx)(c.LinkedinFilled,{className:`job-row-linkedin-icon`})})]})},t=fn.filter(e=>gn.includes(e.key)).map((e,t)=>{let n=Ke.sort===e.key?Ke.sortDir:``;return{title:To({label:e.label,sortDir:n,sortable:Tn,onSort:()=>Qt(e.key)}),dataIndex:e.key,key:e.key,fixed:t===0?`left`:void 0,ellipsis:{showTitle:!1},width:to(e,xn),render:(t,n)=>qa(e,n,Fe,Mn,{canAdd:we,canEdit:Te,canDelete:Ee},zt,nn)}});if(!(vn||jt)&&tt>0&&t.length>0){let n=e.width+(Tn&&oe===`checkbox`?48:0)+eo,r=t.reduce((e,t)=>e+t.width,0),i=tt-n-r;i>0&&r>0&&t.forEach(e=>{e.width=Math.floor(e.width+i*(e.width/r))})}return[e,...t]},[je,we,Ee,Te,Fe,zt,Qt,vn,Tn,jt,G,e,_e,fn,xn,oe,Ke.sort,Ke.sortDir,tt,Ht,gn]),Pn=(0,o.useCallback)(e=>{let t=An.find((t,n)=>io(ro(t,n))===io(e)),n=String(t?ro(t,An.indexOf(t)):e);if(Me(n),X([]),Ve([]),Jt(),typeof ue==`function`){let e=t?.key??t?.value??t?.id??n;rt.current=e,ue(e)}},[ue,An,Jt]);function Fn(e,n,r){let i=Vt.get(String(e));if(i&&i.actionType!==`group`){if(typeof h==`function`&&h({key:i.key,label:i.label,selectedIds:n,selectedRecords:r}),typeof i.onClick==`function`){i.onClick({action:i,selectedIds:n,selectedRecords:r});return}if(i.actionType===`copy`){let e=r.map(e=>Yi(e,i.copyField||`id`)??e?._id).filter(e=>e!=null);navigator.clipboard.writeText(e.join(`
2
- `)).then(()=>s.message.success(`Copied to clipboard`)).catch(()=>s.message.error(`Could not copy to clipboard`));return}if(i.actionType===`api`&&i.apiPath){let e=r[0]??{},a=ha(i.apiPath,e);t.o(t.x,a.startsWith(`/`)?a:`/${a}`,{method:i.apiMethod||`POST`,body:[`GET`,`DELETE`].includes(String(i.apiMethod).toUpperCase())?void 0:JSON.stringify({ids:n,records:r})}).then(()=>{s.message.success(`${i.label} completed`),Ue(e=>e+1)}).catch(e=>s.message.error(e.message||`${i.label} failed`));return}if(i.route){let e=r[0]??{},t=ha(i.route,e),a=t.startsWith(`/`)?t:`/${t}`;if(i.route.startsWith(`/popup/`)||i.route.startsWith(`popup/`)){let t=i.popupKey||i.route?.replace(/^\/popup\//i,``)||``,o=/(?:^|\/)(?:quick(?:-|_)?submit|submit)(?:$|\/)/i.test(t),s=new URLSearchParams(G.search).get(`jobId`),c=i.popupState?.jobId??i.popupState?.jobID??i.popupState?.jobId??e.jobId??e.job?.id??e.job?._id??s,l=i.popupState?.candidateId??i.popupState?.applicantId??e.id??e._id??e.applicantId??e.candidateId;if(o&&c&&l){let e=new URLSearchParams;e.set(`candidateId`,String(l)),e.set(`isFromSubmission`,`false`),_e(`/submission-create/${encodeURIComponent(String(c))}?${e.toString()}`);return}_e(a,{state:{background:G,selectedIds:n,selectedRecords:r,moduleName:K,popupContext:i.popupState??{},popupAction:{key:i.key,apiMethod:i.apiMethod,apiPath:i.apiPath,defaultTemplateId:i.defaultTemplateId,requireJobId:i.requireJobId,popupFieldOverrides:i.popupFieldOverrides},...i.popupState}});return}_e(a)}}}function In({key:e}){let t=go(Ut).find(t=>String(t.key)===String(e));t&&mo(t,Be,je)||Fn(e,Y,Be)}let Ln=gn.length===pn.length,Rn=gn.length>0&&!Ln,zn=(e,t)=>{Ye(n=>{let r=pn.slice(0,me).map(e=>e.key),i=n.length?n:r;return t?i.includes(e)?i:[...i,e]:i.length<=_n?i:i.filter(t=>t!==e)})},Bn=()=>{if(typeof g==`function`){g();return}if(b){_e(b);return}At(!0)},Vn=()=>{w&&_e(w)};(0,o.useEffect)(()=>{if(!kt)return;let e=e=>{e.key===`Escape`&&At(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[kt]);let Hn=()=>{ln&&(ut(Dt.rows),ft(Dt.total),mt(Dt.tabs),gt(Dt.fields),vt(Dt.tabField),bt(Dt.actions??[]),St(Dt.actionRules??[]),Et(null),wt(!1))},Un=e=>{let t=e.target.value,n=t.trim().length<3,r=q.some(e=>e.field);n&&(Ie(``),r||Hn()),Pe(t),Jt()},Wn=()=>{let e=Ne.trim();e.length>=3&&(Ie(e),Jt())},Kn=()=>{Hn(),J([]),ct([],[]),Jt()};(0,o.useEffect)(()=>{Lt===`card`&&($e([]),ct([],[]))},[We.current,We.pageSize,je,Lt]);let qn=e=>{$e(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e],r=xn.filter((e,t)=>n.includes(String(so(e,t,_))));return ct(n,r),n})},Jn=(0,l.jsxs)(`div`,{className:`column-visibility-menu`,onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(s.Checkbox,{checked:Ln,indeterminate:Rn,onChange:e=>{Ye(e.target.checked?pn.map(e=>e.key):pn.slice(0,me).map(e=>e.key))},children:`Select All`}),(0,l.jsx)(`div`,{className:`column-visibility-menu__list`,children:pn.map(e=>(0,l.jsx)(s.Checkbox,{checked:gn.includes(e.key),disabled:gn.includes(e.key)&&gn.length<=_n,onChange:t=>zn(e.key,t.target.checked),children:e.label},e.key))})]});return(0,l.jsxs)(`div`,{className:`antd dynamic-list-view${se?` list-view--compact`:``}${Se?` list-view--page-scroll-lock`:``} ${p}`.trim(),children:[u.length>0&&(0,l.jsx)(`div`,{className:`job-list-header`,children:(0,l.jsx)(n.t,{items:u})}),(0,l.jsx)(s.Card,{className:`job-tabs-card`,children:(0,l.jsxs)(s.Flex,{align:`center`,justify:`space-between`,children:[(0,l.jsx)(P,{activeKey:je,tabs:An,onChange:Pn}),(0,l.jsxs)(s.Flex,{align:`center`,gap:8,children:[B,En&&(0,l.jsx)(s.Input,{prefix:(0,l.jsx)(c.SearchOutlined,{className:`job-search-icon`}),placeholder:H,value:Ne,onChange:Un,onPressEnter:Wn,allowClear:!0,className:`job-search-input`}),!jt&&we&&he&&(0,l.jsx)(s.Tooltip,{title:`Add`,children:(0,l.jsx)(s.Button,{"aria-label":`Add`,className:`job-toolbar-icon-button`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>{Gt&&_e(Gt)}})}),Tn&&(0,l.jsx)(s.Tooltip,{title:`Filter`,children:(0,l.jsx)(s.Badge,{count:q.filter(e=>e.field&&No(e)).length,size:`small`,offset:[-2,2],children:(0,l.jsx)(s.Button,{"aria-label":`Filter`,className:`job-toolbar-icon-button`,icon:(0,l.jsx)(c.FilterOutlined,{}),onClick:()=>ze(!0)})})}),ee&&Tn&&(0,l.jsxs)(s.Flex,{align:`center`,gap:6,children:[(0,l.jsx)(s.Tooltip,{title:`List View`,children:(0,l.jsx)(s.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${Lt===`list`?` param-view-toggle-btn--active`:``}`,icon:(0,l.jsx)(c.UnorderedListOutlined,{}),onClick:()=>{ne?.(`list`),$e([]),ct([],[])}})}),(0,l.jsx)(s.Tooltip,{title:`Card View`,children:(0,l.jsx)(s.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${Lt===`card`?` param-view-toggle-btn--active`:``}`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),onClick:()=>{ne?.(`card`),$e([]),ct([],[])}})})]}),v&&(0,l.jsx)(s.Button,{className:`job-summary-button`,type:`primary`,onClick:Bn,children:y}),x&&w&&(0,l.jsx)(s.Button,{className:`job-summary-button`,type:`primary`,onClick:Vn,children:C})]})]})}),Tn&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(s.Card,{className:`job-toolbar-card`,children:(0,l.jsxs)(s.Flex,{className:`p-flex`,align:`center`,justify:`space-between`,children:[(0,l.jsxs)(s.Flex,{align:`center`,gap:3,children:[Lt===`card`&&(0,l.jsx)(s.Checkbox,{checked:xn.length>0&&Qe.length>=xn.length,indeterminate:Qe.length>0&&Qe.length<xn.length,className:`param-card-view__select-all`,onChange:()=>{if(Qe.length>0)$e([]),ct([],[]);else{let e=xn.map((e,t)=>String(so(e,t,_)));$e(e),ct(e,[...xn])}},children:`Select All`}),(0,l.jsx)(s.Dropdown,{open:Xe,onOpenChange:Ze,trigger:[`click`],dropdownRender:()=>Jn,placement:`bottomLeft`,overlayClassName:`column-visibility-dropdown`,children:(0,l.jsx)(s.Button,{"aria-label":`Display columns`,type:`text`,icon:(0,l.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='path-1-inside-1_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-1-inside-1_8856_23533)'/%3e%3cmask%20id='path-2-inside-2_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-2-inside-2_8856_23533)'/%3e%3cline%20x1='7.375'%20y1='2.93555'%20x2='12.225'%20y2='2.93555'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='5.83398'%20x2='12.225'%20y2='5.83398'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='8.87305'%20x2='12.225'%20y2='8.87305'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='11.7227'%20x2='12.225'%20y2='11.7227'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3c/svg%3e`,alt:``,className:`job-action-list-icon`}),size:`small`,className:`job-actions-button job-column-display-button`,children:(0,l.jsx)(c.DownOutlined,{className:`job-actions-caret`})})}),Ut.length>0&&Y.length>0&&(0,l.jsx)(s.Dropdown,{menu:{items:Ut.map(e=>po(e,mo(e,Be,je))),onClick:In},trigger:[`click`],children:(0,l.jsxs)(s.Button,{type:`text`,size:`small`,className:`job-actions-button job-actions-menu-button`,children:[(0,l.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.6279%206.78121C12.6857%206.88148%2012.7014%207.00057%2012.6715%207.11239C12.6417%207.22422%2012.5688%207.31967%2012.4688%207.37785L7.21875%2010.4403C7.15185%2010.4794%207.0758%2010.4999%206.99836%2010.4999C6.92092%2010.4999%206.84487%2010.4794%206.77797%2010.4403L1.52797%207.37785C1.42936%207.31859%201.35806%207.22289%201.32951%207.11145C1.30095%207.00001%201.31744%206.88181%201.37539%206.78244C1.43335%206.68306%201.52811%206.61052%201.63916%206.5805C1.75022%206.55048%201.86863%206.56542%201.96875%206.62207L7%209.55605L12.0312%206.62207C12.1315%206.56428%2012.2506%206.54858%2012.3624%206.57841C12.4743%206.60824%2012.5697%206.68116%2012.6279%206.78121ZM1.3125%204.37496C1.31267%204.29833%201.33297%204.22309%201.37136%204.15677C1.40975%204.09045%201.46489%204.03538%201.53125%203.99707L6.78125%200.934566C6.84815%200.895555%206.9242%200.875%207.00164%200.875C7.07908%200.875%207.15513%200.895555%207.22203%200.934566L12.472%203.99707C12.5381%204.0356%2012.5929%204.09076%2012.6309%204.15707C12.669%204.22337%2012.6891%204.2985%2012.6891%204.37496C12.6891%204.45142%2012.669%204.52654%2012.6309%204.59285C12.5929%204.65915%2012.5381%204.71432%2012.472%204.75285L7.22203%207.81535C7.15513%207.85436%207.07908%207.87491%207.00164%207.87491C6.9242%207.87491%206.84815%207.85436%206.78125%207.81535L1.53125%204.75285C1.46489%204.71453%201.40975%204.65946%201.37136%204.59314C1.33297%204.52682%201.31267%204.45159%201.3125%204.37496ZM2.61844%204.37496L7%206.93105L11.3816%204.37496L7%201.81886L2.61844%204.37496ZM7.65625%2011.7993L7%2012.1821L1.96875%209.24707C1.86913%209.19747%201.75436%209.18769%201.64779%209.21973C1.54122%209.25177%201.45087%209.32322%201.39512%209.41953C1.33937%209.51583%201.32241%209.62977%201.3477%209.73814C1.37299%209.84651%201.43863%209.94117%201.53125%2010.0028L6.78125%2013.0653C6.84815%2013.1044%206.9242%2013.1249%207.00164%2013.1249C7.07908%2013.1249%207.15513%2013.1044%207.22203%2013.0653L8.09703%2012.5551C8.14746%2012.5266%208.19171%2012.4883%208.22723%2012.4426C8.26275%2012.3968%208.28882%2012.3444%208.30394%2012.2885C8.31906%2012.2326%208.32291%2012.1742%208.31529%2012.1167C8.30766%2012.0593%208.28871%2012.004%208.25952%2011.9539C8.23033%2011.9039%208.19149%2011.8601%208.14526%2011.8252C8.09903%2011.7903%208.04632%2011.7649%207.9902%2011.7505C7.93408%2011.7361%207.87566%2011.7331%207.81833%2011.7414C7.761%2011.7498%207.70591%2011.7695%207.65625%2011.7993Z'%20fill='%236B7280'/%3e%3cpath%20d='M10.6036%2011.3825L13.4607%209.4477C13.5813%209.36599%2013.614%209.20256%2013.5341%209.08069L13.0105%208.282C12.9303%208.15966%2012.7665%208.12478%2012.6434%208.20383L9.54053%2010.1964L8.94939%2011.4054C8.84904%2011.6106%209.03632%2011.8387%209.25715%2011.7803L10.4338%2011.469C10.4561%2011.4631%2010.4776%2011.4543%2010.4977%2011.4429L10.6036%2011.3825ZM9.54053%2010.1964L10.6036%2011.3825'%20stroke='%236B7280'%20stroke-width='0.6'/%3e%3c/svg%3e`,alt:``,className:`job-actions-frame-icon`}),`Actions `,(0,l.jsx)(c.DownOutlined,{className:`job-actions-caret`})]})}),Y.length>0&&(0,l.jsxs)(Wi,{className:`job-selected-count`,children:[`Selected (`,Y.length,`)`]})]}),Cn&&(0,l.jsxs)(Wi,{className:`job-search-results-count`,children:[`Search Results (`,wn,`)`]})]})})}),sn&&(0,l.jsx)(Io,{filters:q,onRemove:e=>{let t=q.filter((t,n)=>n!==e);J(t),Jt()},onClearAll:Kn}),(0,l.jsx)(`div`,{ref:et,className:`job-table-measure`,children:(0,l.jsx)(s.Spin,{spinning:jt?M:Xt||Ct,children:Lt===`card`?xn.length===0?(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:Dn,className:`param-card-view__empty`,children:!jt&&we&&he&&Gt&&!Tt&&(0,l.jsx)(s.Button,{type:`primary`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>_e(Gt),children:`Add New`})}):(0,l.jsx)(`div`,{className:`param-card-view__grid`,children:xn.map((e,t)=>{let n=String(so(e,t,_));return(0,l.jsx)(Mo,{record:e,fields:yn,selected:oe===`checkbox`?Qe.includes(n):ot(e,t),isControlled:jt,onPreview:()=>jn(e),onSelect:()=>qn(n),onPopupAction:Mn,onRecordClick:ae?()=>st(e,t):void 0,selectionMode:oe,permissions:{canAdd:we,canEdit:Te,canDelete:Ee}},n)})}):(0,l.jsx)(s.Table,{rowSelection:Tn&&oe===`checkbox`?{type:`checkbox`,fixed:!0,columnWidth:48,selectedRowKeys:Y,onChange:(e,t)=>{ct(e,t)},columnTitle:(()=>{let e=xn.length,t=e>0&&Y.length>=e,n=Y.length>0&&!t;return(0,l.jsx)(s.Checkbox,{checked:t,indeterminate:n,onChange:()=>{if(n||t)ct([],[]);else{let e=xn.map((e,t)=>so(e,t,_));ct(e,[...xn])}}})})()}:void 0,columns:Nn,dataSource:xn,size:`middle`,tableLayout:`fixed`,scroll:{x:vn||jt?`max-content`:void 0,y:`calc(100vh - 300px)`},pagination:!1,locale:{emptyText:(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:Dn})},className:`${D} ${se?`list-view-table--compact`:``}`.trim(),onRow:ae?(e,t)=>({onClick:n=>{co(n.target)||st(e,t)},"aria-selected":ot(e,t)}):void 0,rowClassName:W==null?void 0:(e,t)=>ot(e,t)?`list-view-row--active`:``,rowKey:(e,t)=>so(e,t,_)})})}),Tn?(0,l.jsx)(Re,{current:We.current,pageSize:We.pageSize,total:Sn,onChange:(e,t)=>{if(jt&&typeof L==`function`){L(e,t??We.pageSize);return}qt(e)},onPageSizeChange:e=>{if(jt&&typeof R==`function`){R(e);return}Ge({current:1,pageSize:e}),Kt(1,{replace:!0})}}):void 0,(0,l.jsx)(Vi,{moduleName:K,open:Le,filters:q,onClose:()=>ze(!1),onApply:({filters:e})=>{J(e),Jt()},onReset:Kn}),(0,l.jsx)(ki,{moduleName:K,open:kt,rows:lt,tabs:An,total:Sn,onClose:()=>At(!1)})]})}var Ro=new Map,zo=0;function Bo(e){let t=`ph_${Date.now()}_${zo+=1}`;return Ro.set(t,e),e.finally(()=>{setTimeout(()=>Ro.delete(t),0)}).catch(()=>{}),t}function Vo(e){if(!e)return;let t=Ro.get(e);return Ro.delete(e),t}async function Ho({jobId:e,applicantId:n,timeoutMs:r=15e3}){if(!e||!n)return[];let i=new AbortController,a=setTimeout(()=>i.abort(),r);try{let r=await t.a(),a=await fetch(`${t.x}/skill-match`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${r}`},body:JSON.stringify({jobId:e,applicantId:n}),signal:i.signal});if(!a.ok)return[];let o=await a.json(),s=o?.data?.relevantSkills??o?.relevantSkills;return Array.isArray(s)?s.filter(e=>typeof e==`string`&&e.trim()):[]}catch{return[]}finally{clearTimeout(a)}}async function Uo({isFromSubmission:e,jobId:n,submissionId:r,search:i=``}={}){let a={search:i};e?a.submissionId=r:a.jobId=n;let o=await t.o(t.S,`/quicksubmit/list`,{method:`POST`,body:JSON.stringify(a)});return o.data??o}async function Wo(e){if(!e)throw Error(`Dice candidate ID is required`);let n=await t.a(),r=`${t.x}/dicemigrate/${encodeURIComponent(String(e))}`;process.env.NODE_ENV===`development`&&console.log(`[DiceMigration] Request URL:`,r);let i=await fetch(r,{method:`GET`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`}}),a=await i.json().catch(()=>null);if(!i.ok){let e=Error(a?.message??a?.error??`Failed to migrate candidate (${i.status})`);throw e.status=i.status,e}return a}function Go(e){return e&&typeof e==`object`?Go(e.value??e.key??e.id??e.label??e.name):String(e??``).trim().toLowerCase()}function Ko(e){return(Array.isArray(e)?e:[e]).flat().map(Go).filter((e,t,n)=>e&&e!==`all`&&n.indexOf(e)===t)}function qo(e,t=`internal`){let n=Ko(e);if(n.includes(`internal`))return`internal`;let r=Go(t);return n[0]?n[0]:r||(t===``?``:`internal`)}function Jo(e,t){let n={...t??{}};return(Array.isArray(e)?e:[]).flatMap(e=>Array.isArray(e?.options)?e.options:[]).forEach(e=>{let t=Go(e?.value),r=String(e?.module??``).trim();t&&r&&(n[t]=r)}),n}function Yo(e){return String(e??``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function Xo(e){return Go(Zo(e))}function Zo(e){let t=e?.key??e?.value??e?.id??e?.source??e?.name??e?.title??e?.label;return String(t??``).trim()}function Qo(e){let t=e?.count??e?.countValue,n=Number(t);return Number.isFinite(n)?n:void 0}function $o(e,t,n,r,i){let a=Number(t?.[e]);if(Number.isFinite(a))return a;if(e===r){let e=Number(i);if(Number.isFinite(e))return e}let o=n.get(e);if(o!==void 0)return o}function es({sources:e=[],activeSource:t=`internal`,activeCount:n=0,responseCounts:r={},currentTabs:i=[],backendTabs:a=[]}={}){let o=new Map((Array.isArray(i)?i:[]).map(e=>[Xo(e),Qo(e)]).filter(([e,t])=>e&&t!==void 0)),s=new Map,c=Ko(e),l=Go(t);return(c.length?c:l?[l]:[]).forEach(e=>{if(!e||s.has(e))return;let i=$o(e,r,o,t,n);s.set(e,{key:e,title:Yo(e),...i===void 0?{}:{count:i}})}),(Array.isArray(a)?a:[]).forEach(e=>{let t=Xo(e);if(!t)return;let n=s.get(t),r=Qo(e)??n?.count??o.get(t);s.set(t,{key:n?n.key:Zo(e),title:e.title??e.label??e.name??n?.title??Yo(t),...r===void 0?{}:{count:r}})}),Array.from(s.values())}function ts(e){return[e?.sourceType,e?.profileSource,e?.selectedSource,e?.source,e?.provider,e?.customFields?.sourceType,e?.customFields?.profileSource,e?.customFields?.source,e?.customFields?.provider].flat().map(Go).filter(Boolean)}function ns(e,t,n){let r=Go(t);return r?ts(e).includes(r)?!0:typeof n==`function`&&n(e):!1}var rs=[{source:`dice`,field:`__sourceAction_dice_migrate`,label:`Action`,buttonLabel:`Migrate`,completedLabel:`Migrated`,successMessage:`Candidate migrated successfully.`,errorMessage:`Failed to migrate candidate.`,isRecordFromSource:e=>!!e?.customFields?.diceProfileData,getRecordId:r.r,execute:Wo}];function is({rows:e=[],selectedSource:t=``}={}){return rs.filter(n=>Go(t)===n.source||e.some(e=>ns(e,n.source,n.isRecordFromSource)))}function as(e,t,n=``){return Go(n)===e.source||ns(t,e.source,e.isRecordFromSource)}function os(e,t){let n=e?.getRecordId?.(t);return n?`${e.source}:${e.field}:${n}`:``}async function ss(e,t){let n=e?.getRecordId?.(t);if(!n)throw Error(`${e?.buttonLabel??`Action`} ID is required`);return e.execute(n,t)}var cs=e.t({default:()=>uc}),{Text:ls}=s.Typography,{TextArea:us}=s.Input,ds=[],fs=[(0,l.jsx)(c.UserOutlined,{}),(0,l.jsx)(c.EnvironmentOutlined,{}),(0,l.jsx)(c.SolutionOutlined,{}),(0,l.jsx)(c.InfoCircleOutlined,{}),(0,l.jsx)(c.FileTextOutlined,{})],ps={email:(0,l.jsx)(c.MailOutlined,{className:`v1-input-icon`}),contactNumber:(0,l.jsx)(c.PhoneOutlined,{className:`v1-input-icon`}),phone:(0,l.jsx)(c.PhoneOutlined,{className:`v1-input-icon`}),currentLocation:(0,l.jsx)(c.EnvironmentOutlined,{className:`v1-input-icon`}),preferredLocation:(0,l.jsx)(c.EnvironmentOutlined,{className:`v1-input-icon`}),skills:(0,l.jsx)(c.TagsOutlined,{className:`v1-input-icon`}),firstName:(0,l.jsx)(c.UserOutlined,{className:`v1-input-icon`}),lastName:(0,l.jsx)(c.UserOutlined,{className:`v1-input-icon`})},ms=e=>e===!0||e===1||e===`1`,hs=(e,t)=>(e?.edit===void 0||ms(e.edit))&&(!e?.editablePermission||n.F(e.editablePermission,t));function gs(e=[]){return e.map(e=>typeof e==`string`?{label:e,value:e}:{label:e.label??e.name??e.value,value:e.value??e.id??e.name??e.label})}function _s(e){return String(e??``).split(`.`).map(e=>e.trim()).filter(Boolean)}function vs(e,t){return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),t]:[t]}function ys({form:e,field:t,absoluteName:r}){let[i,a]=(0,o.useState)(!1),[c,u]=(0,o.useState)(null),d=(0,o.useRef)(null),f=s.Form.useWatch(t.verifyResultField?vs(r,t.verifyResultField):[`__noop_verify__`],{form:e,preserve:!0}),p=s.Form.useWatch(r,e);return(0,o.useEffect)(()=>{let n=String(p??``).trim();if(f===!0&&d.current===null&&n){d.current=n;return}f===!0&&d.current!==null&&n!==d.current&&(t.verifyResultField&&e.setFieldValue(vs(r,t.verifyResultField),!1),t.verifyTimestampField&&e.setFieldValue(vs(r,t.verifyTimestampField),void 0),d.current=null)},[r,p,t.verifyResultField,t.verifyTimestampField,e,f]),t.verifyAction===`email`?f===!0?c&&!c.mailboxConfirmed&&(c.catchAll||c.result===`risky`)?(0,l.jsx)(s.Tooltip,{title:c.reason||`This domain accepts every address, so the mailbox could not be confirmed. Delivery is proven only once the account email is actually sent.`,children:(0,l.jsx)(ls,{type:`warning`,strong:!0,className:`v1-verify-field-wrap`,children:t.verifyUnconfirmedLabel||`Accepted`})}):(0,l.jsx)(ls,{type:`success`,strong:!0,className:`v1-verify-field-wrap`,children:t.verifySuccessLabel||`Valid`}):(0,l.jsx)(s.Button,{size:`small`,loading:i,onClick:async()=>{let i=String(p??``).trim();if(!i){s.message.warning(`Enter an email first`);return}a(!0);try{let a=await n._i(i);d.current=a.valid?i:null,u(a.valid?a:null),t.verifyResultField&&e.setFieldValue(vs(r,t.verifyResultField),a.valid),t.verifyTimestampField&&e.setFieldValue(vs(r,t.verifyTimestampField),a.valid?new Date().toISOString():void 0),a.valid?a.mailboxConfirmed?s.message.success(`Email verified — the mail server confirmed this mailbox`):s.message.warning(a.reason||`The domain can receive mail, but this exact mailbox could not be confirmed`):s.message.error(a.reason?`Invalid email: ${a.reason}`:`Email could not be verified`)}catch(n){d.current=null,u(null),t.verifyResultField&&e.setFieldValue(vs(r,t.verifyResultField),!1),t.verifyTimestampField&&e.setFieldValue(vs(r,t.verifyTimestampField),void 0),s.message.error(n?.message||`Could not verify email`)}finally{a(!1)}},className:`v1-verify-field-wrap`,children:f===!1?t.verifyRetryLabel||`Re Verify`:t.verifyIdleLabel||`Verify Email`}):null}function bs({form:e,field:t,siblingPrefix:r,locked:i,combined:a=!1}){let o=s.Form.useWatch(n.r(t?.labelWhen,r),e),c=n.a(t,o,a);return a?c:(0,l.jsx)(ac,{field:t,label:c,locked:i})}function xs({form:e,groups:t,action:n,disabled:r,loading:i,onFire:a}){let o=s.Form.useWatch(e=>t.some(t=>{if(!t.addRow||!t.requireValidatedField)return!1;let n=e?.[t.name]??[];return n.length===0||n.some(e=>!e?.[t.requireValidatedField])}),{form:e,preserve:!0}),c=s.Form.useWatch(n?.enabledWhen?.field,e),u=!n?.enabledWhen?.field||Ts(n.enabledWhen,c);return(0,l.jsx)(s.Button,{type:n?.tone===`primary`?`primary`:`default`,onClick:a,disabled:r||o||!u,loading:i,children:n?.label||`Submit`})}function Ss({form:e,groups:t,disabled:n,loading:r,onClick:i,children:a}){let o=s.Form.useWatch(e=>t.some(t=>{if(!t.addRow||!t.requireValidatedField)return!1;let n=e?.[t.name]??[];return n.length===0||n.some(e=>!e?.[t.requireValidatedField])}),{form:e,preserve:!0}),c=n||o,u=t.find(e=>e.submitDisabledMessage)?.submitDisabledMessage,d=t.find(e=>e.requireValidatedField)?.requireValidatedFieldMessage,f=o?d||u||`Verify every required row before submitting.`:u||`Complete all mandatory fields before submitting.`,p=(0,l.jsx)(s.Button,{type:`primary`,onClick:i,disabled:c,loading:r,children:a});return c&&!r?(0,l.jsx)(s.Tooltip,{title:f,children:(0,l.jsx)(`span`,{style:{display:`inline-flex`,cursor:`not-allowed`},children:p})}):p}function Cs({form:e,rules:t,watchPaths:r,targetPath:i,resetOnNoMatch:a=!0}){let c=s.Form.useWatch(e=>JSON.stringify(r.map(({path:t})=>t.reduce((e,t)=>e==null?e:e[t],e)??null)),{form:e,preserve:!0}),l=(0,o.useRef)(void 0),u=(0,o.useRef)(!0);return(0,o.useEffect)(()=>{let o=c?JSON.parse(c):[],s={};r.forEach(({field:e},t)=>{s[e]=o[t]});let d=u.current;u.current=!1;let f=n.G({rules:t,watched:s,current:e.getFieldValue(i),lastApplied:l.current,clearOnMismatch:a,initial:d});f.action===`set`?(e.setFieldValue(i,f.value),l.current=f.value):f.action===`clear`&&(e.setFieldValue(i,void 0),l.current=void 0)},[c]),null}function ws({form:e,config:n,watchPath:r}){let i=s.Form.useWatch(r,e),a=(0,o.useRef)(void 0);return(0,o.useEffect)(()=>{if(Is(i)||i===a.current)return;a.current=i;let r=n.endpointTemplate?`${n.endpointTemplate.replace(`{value}`,encodeURIComponent(String(i)))}`:`${n.endpoint}?${new URLSearchParams({[n.queryParam]:String(i)}).toString()}`;t.o(t.x,r).then(t=>{let r=t?.data??t;if(n.substituteTokens){(n.substituteInFields||[]).forEach(t=>{let i=_s(t),a=e.getFieldValue(i)||``;Object.entries(n.substituteTokens).forEach(([e,t])=>{let n=e.replace(/^\{\{|\}\}$/g,``).trim(),i=RegExp(`\\{\\{\\s*${n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}\\s*\\}\\}`,`gi`);a=a.replace(i,r?.[t]??``)}),e.setFieldValue(i,a)});return}Object.entries(n.mapResponseToFields).forEach(([t,i])=>{let a=_s(t);n.onlyIfEmpty&&!Is(e.getFieldValue(a))||e.setFieldValue(a,r?.[i])})}).catch(()=>{})},[i]),null}function Ts(e,t){if(!e?.field)return!0;let n=String(t??``),r=String(e.value??``),i=()=>r.split(`,`).map(e=>e.trim());switch(e.operator){case`eq`:return n===r;case`neq`:return n!==r;case`in`:return i().includes(n);case`notIn`:return!i().includes(n);case`truthy`:return ms(t);case`falsy`:return!ms(t);case`empty`:case`isEmpty`:return t==null||n.trim()===``||Array.isArray(t)&&t.length===0;case`notEmpty`:return!(t==null||n.trim()===``||Array.isArray(t)&&t.length===0);default:return!0}}function Es({form:e,showIf:t,render:n}){return Ts(t,s.Form.useWatch(t.field,e))?n():null}var Ds=(0,o.createContext)(!1);function Os({form:e,group:t,children:n,inheritParent:r=!0}){let i=(0,o.useContext)(Ds),a=t?.disabledIf?.field?_s(t.disabledIf.field):[`__noop_group_disabled__`],c=s.Form.useWatch(a,e),u=t?.disabledIf?.field?Ts(t.disabledIf,c):!1,d=r&&i||!!t?.disabled||u;return(0,l.jsx)(Ds.Provider,{value:d,children:n})}function ks(e,t){return String(t??``).split(`.`).reduce((e,t)=>e?.[t],e)}function As(e){return e==null||e===``?!1:Array.isArray(e)?e.length>0&&e.some(As):typeof e!=`object`||Object.values(e).some(As)}function js(e){return Array.isArray(e)?e:Array.isArray(e?.groups)?e.groups:Array.isArray(e?.data)?e.data:Array.isArray(e?.data?.groups)?e.data.groups:ds}function Ms(e=[],t,r,i){let a=i??new Set;return[...js(e)].filter(e=>!ms(e.hideGroup)&&!ms(e.hideGroupInForm)&&n.cn(r,e.name)).sort((e,t)=>Number(e.order??0)-Number(t.order??0)).map(e=>({...e,fields:[...e.fields??[]].map(e=>a.has(e.field)?{...e,show:1,req:1}:e).filter(i=>String(i.field??``).trim()!==``&&i.showOnAdd!==!1&&!ms(i.clientScope)&&(!i.visiblePermission||n.F(i.visiblePermission,t))&&n.on(r,e.name,i.field)).map(t=>n.sn(r,e.name,t.field)?t:{...t,disabled:!0}).sort((e,t)=>Number(e.order??0)-Number(t.order??0))})).filter(e=>e.fields.length)}function Ns(e){if(!Array.isArray(e))return null;let t={};return e.forEach(e=>{e.addRow||(e.fields??[]).forEach(e=>{!e.field||e.value===void 0||e.value===null||(t[e.field]=e.value,e.payloadKey&&e.payloadKey!==e.field&&(t[e.payloadKey]=e.value))})}),Object.keys(t).length>0?t:null}function Ps(e,t){if(!(!e||!t))for(let r of[t.prefillFrom,t.field,t.payloadKey]){if(!r)continue;let t=e[r];if(t??=n.Xt(e,r),t!=null)return t}}function Fs(e){if(Array.isArray(e))return e.flatMap(e=>Fs(e));if(!e||typeof e!=`object`)return[];let t=$t(e),n=en(e);return!t&&!n?[]:[{uid:n||t||`-1`,name:t||`file`,status:`done`,url:n,existing:!0,stored:e}]}var Is=e=>e==null||e===``,Ls=e=>String(e).replace(/<[^>]*>/g,``).replace(/&nbsp;/g,` `).replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).trim(),Rs=({label:e,message:t,value:n,compare:r,text:i})=>({validator:(a,o)=>Is(o)||r(Number(o),Number(n))?Promise.resolve():Promise.reject(Error(t??`${e} ${i} ${n}`))});function zs(e,t){return n.nt(e,t)}var Bs=({label:e,message:t,value:n,rule:r,form:i,name:a,compare:o,text:s})=>({validator:async(c,l)=>{let u=n??r.compareField??r.field;if(!u||Is(l))return Promise.resolve();let d=i.getFieldValue(zs(a,u));if(Is(d))return Promise.resolve();let f=Number(l),p=Number(d);return Number.isNaN(f)||Number.isNaN(p)||o(f,p)?Promise.resolve():Promise.reject(Error(t??`${e} ${s} ${u}`))}}),Vs={noPastDate:({label:e,message:t})=>({validator:(r,i)=>{if(Is(i))return Promise.resolve();let a=n.g(i);if(a===null)return Promise.resolve();let o=new Date;return o.setHours(0,0,0,0),a<o.getTime()?Promise.reject(Error(t??`${e} cannot be a past date`)):Promise.resolve()}}),noFutureDate:({label:e,message:t})=>({validator:(r,i)=>{if(Is(i))return Promise.resolve();let a=n.g(i);if(a===null)return Promise.resolve();let o=new Date;return o.setHours(23,59,59,999),a>o.getTime()?Promise.reject(Error(t??`${e} cannot be a future date`)):Promise.resolve()}}),minAge:({label:e,message:t,value:r})=>({validator:(e,i)=>{if(Is(i))return Promise.resolve();let a=n.g(i);if(a===null)return Promise.resolve();let o=Number(r??18),s=new Date;return s.setFullYear(s.getFullYear()-o),s.setHours(23,59,59,999),a>s.getTime()?Promise.reject(Error(t??`Must be at least ${o} years old`)):Promise.resolve()}}),dateAfterField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>n.p({type:`dateAfterField`,label:e,rule:{...i,value:r??i?.compareField??i?.field,message:t},readSibling:e=>a.getFieldValue(zs(o,e))}),dateBeforeField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>n.p({type:`dateBeforeField`,label:e,rule:{...i,value:r??i?.compareField??i?.field,message:t},readSibling:e=>a.getFieldValue(zs(o,e))}),timeAfterField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>({validator:async(s,c)=>{let l=r??i.compareField??i.field;if(!l||Is(c))return Promise.resolve();let u=a.getFieldValue(zs(o,l));if(Is(u))return Promise.resolve();let d=n._(c),f=n._(u);return d===null||f===null||d>f?Promise.resolve():Promise.reject(Error(t??`${e} must be after ${l}`))}}),timeBeforeField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>({validator:async(s,c)=>{let l=r??i.compareField??i.field;if(!l||Is(c))return Promise.resolve();let u=a.getFieldValue(zs(o,l));if(Is(u))return Promise.resolve();let d=n._(c),f=n._(u);return d===null||f===null||d<f?Promise.resolve():Promise.reject(Error(t??`${e} must be before ${l}`))}}),greaterThanField:e=>Bs({...e,compare:(e,t)=>e>=t,text:`must be greater than or equal to`}),strictGreaterThanField:e=>Bs({...e,compare:(e,t)=>e>t,text:`must be greater than`}),strictLessThanField:e=>Bs({...e,compare:(e,t)=>e<t,text:`must be less than`}),lessThanOrEqualField:e=>Bs({...e,compare:(e,t)=>e<=t,text:`must be less than or equal to`}),maxFromField:e=>n.it(e),maxFieldWithFallback:({label:e,message:t,value:r,rule:i,form:a,name:o})=>({validator:async(s,c)=>{let l=n.et(r??i.compareFields),u=n.$({input:c,compareFields:l,readValue:e=>n.tt(a,o,e)});return u.ok?Promise.resolve():Promise.reject(Error(t??`${e} must not exceed ${u.field}`))}}),required:({field:e,message:t})=>({validator:(n,r)=>{let i=r==null||r===``||Array.isArray(r)&&r.length===0;return!i&&e?.type===`text-editor`&&(i=Ls(r)===``),i?Promise.reject(Error(t??`Mandatory Field`)):Promise.resolve()}}),email:({label:e,message:t})=>n.wt(e,t),unique:({field:e,rule:t,uniqueContext:r})=>n._t({field:e,validation:t,context:r}),emailTags:({label:e,message:t})=>({validator:(r,i)=>{let a=(Array.isArray(i)?i:[]).find(e=>!n.Tt(e));return a?Promise.reject(Error(t??`${e} contains an invalid email: ${a}`)):Promise.resolve()}}),noHtml:({label:e,message:t})=>({validator:(n,r)=>r==null||r===``?Promise.resolve():/<\/?[a-z][\s\S]*>/i.test(String(r))?Promise.reject(Error(t??`${e} cannot contain HTML tags`)):Promise.resolve()}),url:({label:e,message:t})=>({type:`url`,message:t??`Enter valid ${e}`}),number:({label:e,message:t})=>({pattern:/^[0-9]+$/,message:t??`${e} must be a number`}),phone:({message:e})=>({validator:(t,r)=>{if(r==null||r===``)return Promise.resolve();let{total:i}=n.Vn();return n.Hn(r).length===i?Promise.resolve():Promise.reject(Error(e??`Phone number must contain exactly ${i} digits`))}}),minLength3:e=>Vs.min({...e,value:3}),minLength5:e=>Vs.min({...e,value:5}),len:({label:e,message:t,value:n})=>({len:Number(n),message:t??`${e} must be ${n} characters`}),pattern:({label:e,message:t,rule:n})=>({pattern:new RegExp(n.pattern??n.value,n.flags),message:t??`Enter valid ${e}`}),min:({field:e,label:t,message:n,value:r})=>e.type===`number`?Rs({label:t,message:n,value:r,compare:(e,t)=>e>=t,text:`must be at least`}):{validator:(i,a)=>{if(a==null||a===``)return Promise.resolve();let o=e.type===`text-editor`?Ls(a):String(a);return o===``||o.length>=Number(r)?Promise.resolve():Promise.reject(Error(n??`${t} must be at least ${r} characters`))}},max:({field:e,label:t,message:n,value:r})=>e.type===`number`?Rs({label:t,message:n,value:r,compare:(e,t)=>e<=t,text:`must not exceed`}):{validator:(i,a)=>{if(a==null||a===``)return Promise.resolve();let o=e.type===`text-editor`?Ls(a):String(a);return o===``||o.length<=Number(r)?Promise.resolve():Promise.reject(Error(n??`${t} must not exceed ${r} characters`))}}};function Hs(e,t,n,r,i,a){let o=typeof e==`string`?{type:e}:e,s=o.type??o.rule??o.name,c=o.value??o.length??o.min??o.max,l=t.label??t.field??`Field`,u=Vs[s];return u?u({field:t,label:l,message:o.message,rule:o,value:c,form:n,name:r,prefixFor:i,uniqueContext:a}):o}function Us(e,t){return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),t]:[t]}function Ws(e,t,n){return ms(e?.req)||(e?.validations??e?.validation??e?.rules??[]).some(e=>(typeof e==`string`?e:e?.type)===`required`)?!0:e?.requiredIfField&&t&&n?ms(t.getFieldValue(Us(n,e.requiredIfField))):!1}function Gs(e,t,r,i=!1,a=void 0,o=void 0,s=void 0){let c=e.label??e.field??`Field`,l=e.validations??e.validation??e.rules??[],u=l.some(e=>(typeof e==`string`?e:e?.type)===`required`),d=l.some(e=>(typeof e==`string`?e:e?.type)===`email`),f=[];if(s?.length&&f.push(...s),e.rowHierarchy){let i=Js(t,r);i.rows&&f.push(n.m({field:e,...i}))}!i&&!u&&ms(e.req)&&e.disabledByField?f.push({validator:(n,i)=>ms(t.getFieldValue(Us(r,e.disabledByField)))?Promise.resolve():i==null||i===``?Promise.reject(Error(`Mandatory Field`)):Promise.resolve()}):!i&&!u&&e.requiredIfField?f.push({validator:(n,i)=>ms(t.getFieldValue(Us(r,e.requiredIfField)))&&(i==null||i===``)?Promise.reject(Error(`Mandatory Field`)):Promise.resolve()}):!i&&ms(e.req)&&!u&&f.push({required:!0,message:`Mandatory Field`}),(e.type===`email`||e.formatter===`email`)&&!d&&f.push(n.wt(c)),e.type===`number`&&f.push(ms(e.decimal)?{pattern:/^\d+(\.\d+)?$/,message:`${c} must be a number`}:{pattern:/^[0-9]+$/,message:`${c} must be a number`});let p=n.in(e,r,a,n=>Hs(n,e,t,r,a,o));return n.gt([...f,...l.map(p),n.an(e)])}function Ks(e,t){let n=(e.validations??e.validation??e.rules??[]).find(e=>(typeof e==`string`?e:e?.type)===t);if(!(!n||typeof n==`string`))return n.value??n.length??n[t]}function qs(e){let t=e.len??Ks(e,`len`),n=e.min??Ks(e,`min`),r=e.max??Ks(e,`max`);return e.type===`number`?{min:n??void 0,max:r??void 0}:{minLength:n??void 0,maxLength:e.maxLength??t??r??void 0}}function Js(e,t){if(!Array.isArray(t)||t.length<3||typeof t[1]!=`number`)return{};let n=e.getFieldValue(t[0]);return Array.isArray(n)?{rows:n,rowIndex:t[1]}:{}}function Ys(e,t,r){return n.f({field:e,readSibling:e=>t.getFieldValue(zs(r,e)),...Js(t,r)})}function Xs(e){return n.h(e)}function Zs(e,t){return t?t===`phone`?n.Rn(e):t===`digits`?e.replace(/\D/g,``).slice(0,10):t===`email`||t===`noSpaces`?e.replace(/\s/g,``):t===`name`?e.replace(/\s+/g,` `).trimStart().replace(/\b\w/g,e=>e.toUpperCase()):e:e}function Qs(e=``){let t=String(e).toLowerCase();return t===`job`?`jobs`:t===`candidate`?`candidates`:t===`submissions`?`submission`:t}var $s=new Set([`selectedSource`,`source`,`sourceType`,`scope`]);function ec(e){return e==null?!1:typeof e==`string`?e.trim().length>0:typeof e==`number`?Number.isFinite(e):typeof e==`boolean`?e:u.default.isDayjs(e)?e.isValid():Array.isArray(e)?e.some(ec):typeof e==`object`?`value`in e||`label`in e||`name`in e?ec(e.value??e.label??e.name):Object.entries(e).some(([e,t])=>!$s.has(e)&&ec(t)):!1}function tc(e={}){return Object.entries(e??{}).some(([e,t])=>!$s.has(e)&&ec(t))}function nc(e,t,r={},i=``){let a=new FormData;n.Jt(e,t,{scope:`flat`,module:i}).forEach(({formKey:e,file:t})=>{a.append(e,t)});let o={...r,...n.Kt(e,t,{module:i})};return o.schemaVersion=1,a.append(`json`,JSON.stringify(o)),a}function rc({field:e,form:r,name:i,moduleName:a,value:u,checked:d,onChange:f,scopeValues:p={},onAiUpload:m,onDuplicateBlur:h,onRegionBlocked:g,onRowOrderChange:_,formDisabled:v,rowFieldKeys:y}){let b=e.type??`text`,x=!hs(e,a),[S,C]=(0,o.useState)(null),[w,T]=(0,o.useState)(!1),[E,D]=(0,o.useState)(``),[O,k]=(0,o.useState)(``),[A,j]=(0,o.useState)(``),[M,N]=(0,o.useState)(0),[P,F]=(0,o.useState)({open:!1,docs:[],index:0}),[I,L]=(0,o.useState)(null),R=(0,o.useRef)([]),z=Array.isArray(i)&&i.length>=3&&typeof i[1]==`number`,B=e.lookupFilterValueFrom?_s(e.lookupFilterValueFrom):[`__lookup_filter_${e.field}`],V=e.lookupFilterValueFrom&&z?[...i.slice(0,2),..._s(e.lookupFilterValueFrom)]:[`__noop_row_filter__`],H=s.Form.useWatch(B,r),U=s.Form.useWatch(V,r),ee=Is(U)?H:U,te=e.disabledByField?Array.isArray(i)&&i.length>1?[...i.slice(0,-1),e.disabledByField]:[e.disabledByField]:[`__noop_disabled_watch__`],ne=s.Form.useWatch(te,r),re=e.disabledIf?.field?_s(e.disabledIf.field):[`__noop_disabled_if__`],ie=e.disabledIf?.field&&z?[...i.slice(0,2),..._s(e.disabledIf.field)]:[`__noop_disabled_if_row__`],ae=s.Form.useWatch(re,r),W=s.Form.useWatch(ie,r),oe=e.disabledIf?.field?n.i(e.disabledIf,Is(W)?ae:W):!1,se=e.optionsFromField||``,ce=se?_s(se):[`__noop_options_from__`],le=se&&z&&(!y||y.has(se))?[...i.slice(0,2),..._s(se)]:[`__noop_options_from_row__`],ue=s.Form.useWatch(ce,r),de=s.Form.useWatch(le,r),fe=Is(de)?ue:de,pe=ms(e.prefillWhenExclusive)&&e.prefillWhen?.length?e.prefillWhen:null,me=s.Form.useWatch(e=>pe?JSON.stringify(n.U(pe).map(t=>{let n=t=>t.reduce((e,t)=>e==null?e:e[t],e),r=z&&(!y||y.has(t))?n([...i.slice(0,2),..._s(t)]):void 0;return(Is(r)?n(_s(t)):r)??null})):``,{form:r,preserve:!0}),he=(0,o.useMemo)(()=>{if(!pe||!me)return null;let e=JSON.parse(me),t={};return n.U(pe).forEach((n,r)=>{t[n]=e[r]}),t},[me]),ge=(0,o.useContext)(Ds),_e=e.exclusiveInGroup&&z?[i[0]]:[`__noop_exclusive_watch__`],G=s.Form.useWatch(_e,r),K=(0,o.useMemo)(()=>{if(!e.exclusiveInGroup||!z||!Array.isArray(G))return!1;let t=i[1],n=i[i.length-1];return G.some((e,r)=>r!==t&&ms(e?.[n]))},[e.exclusiveInGroup,z,G,i]),ve=e.lookupFilterValueFrom?p[e.lookupFilterValueFrom]:void 0,ye=Is(ve)?ee:ve,be=(0,o.useRef)(n.I);(0,o.useEffect)(()=>{if(!e.lookupFilterField||!e.lookupFilterValueFrom)return;let t=be.current;be.current=ye,n.L({previous:t,next:ye,currentValue:r.getFieldValue(i)})&&r.setFields([{name:i,value:void 0,errors:[]}])},[ye]);let xe=e.locationCountryFrom?_s(e.locationCountryFrom):[`__noop_loc_country__`],Se=e.locationCountryFrom&&z?[...i.slice(0,2),..._s(e.locationCountryFrom)]:[`__noop_loc_country_row__`],Ce=s.Form.useWatch(xe,r),we=s.Form.useWatch(Se,r),Te=Is(we)?Ce:we,Ee=e.locationStateFrom?_s(e.locationStateFrom):[`__noop_loc_state__`],De=e.locationStateFrom&&z?[...i.slice(0,2),..._s(e.locationStateFrom)]:[`__noop_loc_state_row__`],Oe=s.Form.useWatch(Ee,r),ke=s.Form.useWatch(De,r),Ae=Is(ke)?Oe:ke,je=e.dataSource===`locationMaster`&&(e.locationLevel===`state`&&Is(Te)||e.locationLevel===`city`&&(Is(Te)||Is(Ae))),Me=x||!!e.disabled||oe||(e.disabledByField?ms(ne):!1)||!!v||ge||K||je;(0,o.useEffect)(()=>{if(b===`location`){let n=!1;T(!0);async function r(){try{let r=new URLSearchParams({search:E,limit:String(e.limit??50),offset:`0`}),i=await t.o(t.x,`/admin/location-dropdown-values?${r}`),a=i?.data??i??[];n||C(gs(Array.isArray(a)?a:[]))}catch(t){console.error(`[AddFormV1] Failed to fetch locations for "${e.field}":`,t),n||C([])}finally{n||T(!1)}}return r(),()=>{n=!0}}let r=e.dataSource;if(![`select`,`radio`,`checkbox`].includes(b)||!r||r===`static`)return;if(r===`lookup`&&e.lookupFilterField&&Is(ye)){C([]),T(!1);return}if(r===`lookup`&&e.lookupMinSearchLength&&O.trim().length<e.lookupMinSearchLength){C([]),T(!1);return}let i=!1;T(!0);async function o(){try{let o=[];if(r===`master`||r===`module`)o=await n.vn(a,e.field,r===`master`?A:``,e.limit??50,0,{dataSource:r,masterName:e.masterName,groupName:e.groupName});else if(r===`lookup`){let r=new URLSearchParams({collection:e.lookupCollection??``,displayField:e.displayField??``,valueField:e.valueField??`_id`});e.displayField2&&r.set(`displayField2`,e.displayField2),O&&r.set(`search`,O),e.lookupFilterField&&!Is(ye)&&(r.set(`filterField`,e.lookupFilterField),r.set(`filterValue`,String(ye))),Array.isArray(e.filters)&&e.filters.length>0&&r.set(`filters`,JSON.stringify(e.filters));let i={field:e.field,extraFields:e.extraFields,optionsRequireExtraField:e.optionsRequireExtraField,optionsRequireExtraValue:e.optionsRequireExtraValue,optionsHierarchyParentField:e.optionsHierarchyParentField,optionsHierarchySelfFrom:e.optionsHierarchySelfFrom},a=n.B(i);a.length&&r.set(`extraFields`,a.join(`,`));let s=await t.o(t.x,`/admin/lookup-dropdown-values?${r}`);o=s?.data??s??[],o=n.z(o,i,{source:`AddFormV1`})}else if(r===`locationMaster`){let n=e.locationLevel||`country`;if(n===`state`&&Is(Te))o=[];else if(n===`city`&&(Is(Te)||Is(Ae)))o=[];else{let r=new URLSearchParams({level:n,limit:String(e.limit??250),offset:`0`});Is(Te)||r.set(`country`,String(Te)),Is(Ae)||r.set(`state`,String(Ae)),O&&r.set(`search`,O);let i=await t.o(t.x,`/admin/location-dropdown-values?${r}`);o=i?.data??i??[]}}else if(r===`group`){let n=(e.groupName??``).toLowerCase().trim();if(n===`users`||n===`user`){let n=await t.o(t.x,`/get-all-users?limit=500&offset=0`),r=n?.data?.users??n?.users??n?.data??[],i=String(e.groupRoleContains??``).trim().toLowerCase(),a=i?Array.isArray(r)?r.filter(e=>String(e.roleName??``).toLowerCase().includes(i)):[]:r;o=Array.isArray(a)?a.map(e=>({label:[e.firstName,e.lastName].filter(Boolean).join(` `).trim()||e.userName||e.email||String(e.userId),value:e.userId??e.id})):[]}}i||(R.current=Array.isArray(o)?o:[],C(gs(R.current)))}catch(t){console.error(`[AddFormV1] Failed to fetch options for "${e.field}":`,t),i||C([])}finally{i||T(!1)}}return o(),()=>{i=!0}},[b,e.dataSource,e.field,e.limit,e.lookupCollection,e.displayField,e.displayField2,e.valueField,e.lookupFilterField,ye,e.groupName,e.groupRoleContains,e.masterName,E,O,A,a,e.extraFields,e.optionsRequireExtraField,e.optionsRequireExtraValue,e.optionsHierarchyParentField,e.optionsHierarchySelfFrom,M,e.lookupMinSearchLength,e.locationLevel,e.locationCountryFrom,e.locationStateFrom,Te,Ae]);let Ne=gs(e.options??e.values??[]),Pe=S??Ne,[Fe,Ie]=(0,o.useState)([]),Le=n.b(u,Pe).join(`,`);(0,o.useEffect)(()=>{if(!Le||e.dataSource!==`lookup`||w)return;let t=!1;return n.v(e,Le.split(`,`)).then(e=>{t||Ie(e)}).catch(()=>{t||Ie([])}),()=>{t=!0}},[Le,e.dataSource,e.lookupCollection,e.displayField,e.displayField2,e.valueField,w]);let Re=n.y(Pe,Fe),ze=se?n.V(Re,fe):Re,q=pe?n.H(ze,pe,he??{}):ze,J=(e.multiSelect?`multiple`:e.mode??(ms(e.multiple)?`multiple`:void 0))??(n.Yt(e)===`array`?`multiple`:void 0),Y=ms(e.allowCustomValues),X=Y?`tags`:J,Be=!!e.multiSelect||ms(e.multiple)||n.Yt(e)===`array`||J===`multiple`,Ve=Y?typeof e.tokenSeparators==`string`&&e.tokenSeparators?e.tokenSeparators.split(``):[`,`]:void 0,He=[`select`,`location`].includes(b),Ue=e.hidePlaceholder?void 0:e.placeholder??`${He?`Select`:`Enter`} ${String(e.label??``).toLowerCase()}`,We=qs(e),Ge=e=>{f?.(e),setTimeout(()=>{r.validateFields([i]).catch(()=>{})},0)},Ke=n.ot({field:e,form:r,name:i,moduleName:a,scopeValues:p,ownValue:u,onDone:(t,a)=>{N(e=>e+1);let o=n.Yt(e)!==`array`&&!e.multiSelect&&!e.multiple;t===`create`&&a!=null&&o&&((e.clearGroupOnChange||e.linkedClearField)&&n.x(r,e,i,y),Ge(n.tn(e)?{value:a}:a))}}),qe=e.validator?.type?{...e.validator,title:e.validator.title||e.label||`Field`}:null,Je={...We,disabled:Me,placeholder:Ue,prefix:e.icon?null:ps[e.field],value:u??``,onChange:t=>{let r=e.formatter?Zs(t.target.value,e.formatter):t.target.value;if(qe){let{cleaned:e,error:t}=n.St(r,qe,`change`);L(t),r=e}Ge(r)},onBlur:t=>{if(qe){let{cleaned:e,error:r}=n.St(t.target.value,qe,`blur`);L(r),e!==t.target.value&&Ge(e)}e.checkDuplicateOnBlur&&String(t.target.value??``).trim()&&h?.(e)},...qe&&{onKeyPress:e=>{let t=n.Ct(qe.type);if(!t||e.which===0||e.keyCode===8||e.keyCode===13)return;let r=String.fromCharCode(e.which??e.keyCode);if(!t.test(r)){e.preventDefault();let t=`${qe.title} — invalid character.`;L(t),setTimeout(()=>L(e=>e===t?null:e),1800)}},maxLength:qe.maxLength??We.maxLength}};if(b===`tagify`)return(0,l.jsx)(s.Select,{value:u,allowClear:!0,disabled:Me,mode:`tags`,placeholder:Ue,onChange:Ge});if(b===`location`)return(0,l.jsx)(s.Select,{value:u,allowClear:!0,showSearch:!0,filterOption:!1,disabled:Me,loading:w,mode:J,options:q,placeholder:Ue,notFoundContent:w?(0,l.jsx)(s.Spin,{size:`small`}):void 0,onSearch:D,onFocus:()=>D(e=>e),onChange:Ge});if(b===`select`){let t=e.dataSource===`lookup`,a=e.dataSource===`master`,o=t||a,c=n.tn(e),d=n.en(e,u,q),f=Y&&!Be?d==null||d===``?void 0:Array.isArray(d)?d:[d]:d;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Select,{value:f,labelInValue:c||void 0,allowClear:!0,showSearch:e.showSearch!==!1,optionFilterProp:`label`,filterOption:!o&&void 0,disabled:Me,loading:w,mode:X,tokenSeparators:Ve,options:q,placeholder:Ue,notFoundContent:w?(0,l.jsx)(s.Spin,{size:`small`}):void 0,onSearch:t?k:a?j:void 0,onChange:t=>{let a=Y&&!Be&&Array.isArray(t)?t.length?t[t.length-1]:void 0:t;if(Ge(a),(e.clearGroupOnChange||e.linkedClearField)&&n.x(r,e,i,y),e.autofillFrom?.length){let t=a&&!Array.isArray(a)&&typeof a==`object`?a.value:a,n=Array.isArray(i)&&i.length>=3&&typeof i[1]==`number`;if(a==null)e.autofillFrom.forEach(({targetField:e})=>{let t=n?[...i.slice(0,2),..._s(e)]:_s(e);r.setFieldValue(t,null)});else if(R.current.length>0){let a=e.valueField??`_id`,o=R.current.find(e=>ks(e,a)===t||e._id===t||e.id===t||e.value===t);o&&e.autofillFrom.forEach(({optionKey:e,targetField:t})=>{let a=ks(o,e)??o.extraData?.[e]??null,s=n?[...i.slice(0,2),..._s(t)]:_s(t);r.setFieldValue(s,a)})}}},dropdownRender:Ke.footer?e=>(0,l.jsxs)(l.Fragment,{children:[e,Ke.footer]}):void 0}),Ke.modal]})}if(b===`radio`)return(0,l.jsx)(s.Radio.Group,{value:u,disabled:Me,options:q,onChange:e=>Ge(e.target.value)});if(b===`checkbox`)return q.length>0?(0,l.jsx)(s.Checkbox.Group,{value:u,disabled:Me,options:q,onChange:Ge}):(0,l.jsx)(s.Checkbox,{checked:!!(d??u),disabled:Me,onChange:t=>{let n=t.target.checked;if(!(n&&g?.(e))&&(Ge(n),n&&_?.(e,i),e.linkedClearField&&n)){let t=Array.isArray(i)&&i.length>1?[...i.slice(0,-1),e.linkedClearField]:[e.linkedClearField];r.setFieldValue(t,null)}},children:e.checkboxLabel??e.label});if(b===`text-editor`)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.wn,{value:u??r.getFieldValue(i)??``,disabled:Me,placeholder:Ue,onChange:e=>{if(qe){let{error:t}=n.St(e,qe,`change`);L(t)}Ge(e)}}),I&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:I})]});if(b===`textarea`)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(us,{...Je,rows:e.rows??3,className:`v1-scroll-textarea`}),I&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:I})]});if(b===`date`)return(0,l.jsx)(s.DatePicker,{disabled:Me,placeholder:Ue,style:{width:`100%`},suffixIcon:(0,l.jsx)(c.CalendarOutlined,{}),value:u??null,disabledDate:Ys(e,r,i),defaultPickerValue:Xs(e),onChange:t=>{Ge(t),_?.(e,i)}});if(b===`time`)return(0,l.jsx)(s.TimePicker,{disabled:Me,placeholder:Ue,style:{width:`100%`},value:u??null,onChange:e=>Ge(e)});if(b===`file`){let t=e.validations??e.validation??e.rules??[],r=t.find(e=>(typeof e==`string`?e:e?.type)===`fileType`),i=t.find(e=>(typeof e==`string`?e:e?.type)===`fileSize`),a=t.find(e=>(typeof e==`string`?e:e?.type)===`maxFiles`),o=n.pt(e),d=o?o.exts.map(e=>`.${e}`).join(`,`):r?.value?r.value.split(`,`).map(e=>`.${e.trim().replace(/^\./,``)}`).join(`,`):void 0,f=i?Number(i?.value??5):void 0,p=a?Number(a?.value??1):ms(e.multiple)?e.maxCount??5:1,h=Array.isArray(u)?u:[],g=h.length<p,_=e=>e?e<1048576?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(2)} MB`:``,v=e=>{let t=String(e??``).split(`.`).pop()?.toLowerCase();return t===`pdf`?(0,l.jsx)(c.FilePdfOutlined,{className:`v1-file-type-icon v1-file-icon-pdf`}):[`doc`,`docx`].includes(t)?(0,l.jsx)(c.FileWordOutlined,{className:`v1-file-type-icon v1-file-icon-word`}):[`xls`,`xlsx`,`csv`].includes(t)?(0,l.jsx)(c.FileExcelOutlined,{className:`v1-file-type-icon v1-file-icon-excel`}):[`jpg`,`jpeg`,`png`,`gif`,`svg`,`webp`].includes(t)?(0,l.jsx)(c.FileImageOutlined,{className:`v1-file-type-icon v1-file-icon-image`}):(0,l.jsx)(c.FileOutlined,{className:`v1-file-type-icon v1-file-icon-default`})},y=e=>{Ge(h.filter((t,n)=>n!==e))},b=(e,t)=>{let n=h.map(e=>{let t=e.url??e.thumbUrl??``;return!t&&e.originFileObj instanceof File&&(t=URL.createObjectURL(e.originFileObj)),{url:t,name:e.name??`file`}}).filter(e=>e.url);F({open:!0,docs:n,index:t??0})},x=p>1,S=p-h.length,C=[o?o.hint:d?d.split(`,`).map(e=>e.replace(`.`,``).toUpperCase()).join(`, `):null,f?`up to ${f} MB`:null].filter(Boolean).join(` `),w=x&&h.length>0?[C,`${S} of ${p} remaining`].filter(Boolean).join(` • `):C,T=h.length>0?`Add ${x?`more files`:`file`}`:e.buttonLabel??`Upload ${e.label??`File`}`,E=e=>{if(h.length>=p)return s.Upload.LIST_IGNORE;if(d){let t=(e.name.split(`.`).pop()??``).toLowerCase();if(!d.split(`,`).map(e=>e.replace(/^\./,``).toLowerCase()).includes(t))return s.message.error(o?o.error:r?.message??`Only ${r.value} files are allowed`),s.Upload.LIST_IGNORE}return f!==void 0&&e.size/1024/1024>f&&(s.message.error(i?.message??`File must be smaller than ${f} MB`),s.Upload.LIST_IGNORE)},D=({fileList:e})=>{let t=e.slice(0,p);if(Ge(t),m&&t.length>h.length){let e=t[t.length-1];e?.originFileObj&&m(e.originFileObj)}},O={accept:d,fileList:h,showUploadList:!1,multiple:!0,maxCount:p,beforeUpload:E,onChange:D,disabled:Me},k=h.map((e,t)=>(0,l.jsxs)(`div`,{className:`v1-file-item`,children:[(0,l.jsx)(`div`,{className:`v1-file-item-icon`,children:v(e.name)}),(0,l.jsxs)(`div`,{className:`v1-file-item-info`,children:[(0,l.jsx)(`span`,{className:`v1-file-item-name`,title:e.name,children:e.name}),(0,l.jsx)(`span`,{className:`v1-file-item-meta`,children:e.existing?`Previously uploaded`:`${_(e.size)}${e.size?` • `:``}Uploaded just now`})]}),(0,l.jsxs)(s.Space,{size:6,className:`v1-file-item-actions`,children:[(0,l.jsx)(s.Button,{size:`small`,icon:(0,l.jsx)(c.EyeOutlined,{}),onClick:()=>b(e,t),className:`v1-file-view-btn`,children:`View`}),(0,l.jsx)(s.Button,{size:`small`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>y(t),className:`v1-file-delete-btn`})]})]},e.uid??t)),A=(0,l.jsx)(n.Cn,{documents:P.docs,open:P.open,onClose:()=>F(e=>({...e,open:!1})),initialIndex:P.index});if(x){let t=h.length>0?`Upload more ${e.label??`files`}`:e.buttonLabel??`Upload ${e.label??`File`}`;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`v1-file-upload-wrapper`,children:[g&&(0,l.jsx)(s.Upload,{...O,style:{width:`100%`,display:`block`},children:(0,l.jsxs)(`div`,{className:`v1-upload-dropzone v1-upload-dropzone-center${Me?` v1-upload-dropzone-disabled`:``}`,children:[(0,l.jsxs)(`div`,{className:`v1-upload-dropzone-title-row`,children:[(0,l.jsx)(c.CloudUploadOutlined,{className:`v1-upload-cloud-icon v1-upload-cloud-icon-sm`}),(0,l.jsx)(`span`,{className:`v1-upload-dropzone-title v1-upload-dropzone-title-blue`,children:t})]}),(0,l.jsx)(`span`,{className:`v1-upload-dropzone-sub`,children:`Drag & drop or click to upload`}),C&&(0,l.jsx)(`span`,{className:`v1-upload-dropzone-sub`,children:C})]})}),h.length>0&&(0,l.jsx)(`div`,{className:`v1-file-grid`,children:k}),g&&h.length>0&&(0,l.jsx)(s.Upload,{...O,style:{display:`inline-block`},children:(0,l.jsx)(s.Button,{type:`link`,size:`small`,icon:(0,l.jsx)(c.PlusOutlined,{}),className:`v1-add-more-files-btn`,children:`Add more files`})})]}),A]})}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`v1-file-upload-wrapper`,children:[h.length>0&&(0,l.jsx)(`div`,{className:`v1-file-rows-single`,children:k}),g&&(0,l.jsx)(s.Upload,{accept:d,fileList:h,showUploadList:!1,multiple:!1,maxCount:1,beforeUpload:E,onChange:D,disabled:Me,style:{width:`100%`,display:`block`},children:(0,l.jsxs)(`div`,{className:`v1-upload-dropzone v1-upload-dropzone-single${Me?` v1-upload-dropzone-disabled`:``}`,children:[(0,l.jsx)(c.CloudUploadOutlined,{className:`v1-upload-cloud-icon`}),(0,l.jsx)(`span`,{className:`v1-upload-dropzone-title`,children:T}),w&&(0,l.jsxs)(`span`,{className:`v1-upload-dropzone-sub`,children:[`— `,w]})]})})]}),A]})}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Input,{...Je,type:b===`number`?`number`:b,...b===`number`&&ms(e.decimal)?{step:`any`}:{},...e.suffix?{suffix:e.suffix}:{}}),I&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:I})]})}function ic({icon:e,title:t}){return(0,l.jsxs)(s.Space,{size:10,align:`center`,children:[(0,l.jsx)(`div`,{className:`v1-section-icon-box`,children:e}),(0,l.jsx)(ls,{strong:!0,className:`v1-section-label`,children:t})]})}function ac({field:e,label:t,locked:r}){if(!t)return t;let i=n.R(e),a=!!i;return!a&&!r?t:(0,l.jsxs)(`span`,{className:`v1-field-label-with-info`,children:[(0,l.jsx)(`span`,{children:t}),a&&(0,l.jsx)(s.Tooltip,{title:i,children:(0,l.jsx)(c.InfoCircleOutlined,{className:`v1-field-info-icon`})}),r&&(0,l.jsx)(s.Tooltip,{title:`You don't have permission to edit this field`,children:(0,l.jsx)(c.LockOutlined,{className:`v1-field-info-icon`})})]})}function oc({group:e}){return!ms(e?.infoEnabled)||Is(e?.infoText)?null:(0,l.jsx)(ls,{type:`secondary`,className:`v1-group-info-message`,children:e.infoText})}function sc({group:e}){return!ms(e?.toggleEnabled)||Is(e?.toggleField)?null:(0,l.jsxs)(s.Space,{size:6,align:`center`,onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(ls,{type:`secondary`,className:`v1-combine-toggle-label`,children:e.toggleLabel||`Toggle`}),(0,l.jsx)(s.Form.Item,{name:e.toggleField,valuePropName:`checked`,initialValue:!!e.toggleValue,noStyle:!0,children:(0,l.jsx)(s.Switch,{size:`small`})})]})}function cc(e,t){let n=t;if(Array.isArray(n)&&(n=n[n.length-1]),n&&typeof n==`object`){let e=new Set([`timestamp`,`updatedBy`,`updatedAt`,`createdAt`,`createdBy`,`_id`]),t=Object.entries(n).filter(([t,n])=>!e.has(t)&&n!=null&&n!==``&&typeof n!=`object`).map(([,e])=>String(e).trim()).filter(Boolean);if(!t.length)return``;n=t.join(` `)}let r=String(n??``).trim();if(!r)return``;let i=String(e?.prefillHintLabel??`Last recorded: {value}`);return i.includes(`{value}`)?i.replace(`{value}`,r):`${i} ${r}`}function lc(e,t){let n=e?.helpText,r=(Array.isArray(n)?n:[n]).map(e=>e==null?``:String(e).trim()).filter(Boolean);if(t&&r.push(t),r.length)return(0,l.jsx)(`span`,{className:`v1-field-help-text`,children:r.map((e,t)=>(0,l.jsx)(ls,{type:`secondary`,className:`v1-field-help-line`,children:e},t))})}var uc=(0,o.forwardRef)(function({moduleName:e,action:r,authToken:i,clientId:u,region:f,formGroups:p,loading:m=!1,error:h=``,breadcrumbItems:g=[],formType:_=`add`,submitText:v,cancelPath:y=`/candidates`,onSubmit:b,initialRecord:x=null,prefillFromUrl:S=!1,extraPayload:C=null,presetClientId:w=null,listViewProps:T={},selectedScope:E=``,searchActionContext:D=null,embedded:O=!1,onSuccess:k=null,onCancel:A=null},j){(0,o.useEffect)(()=>(i&&t.g(i),()=>{i&&t.r()}),[i]);let M=_===`search`,N=v??(M?`Search`:`Create`),P=(0,d.useNavigate)(),F=(0,d.useLocation)(),I=(0,o.useRef)(null),L=(0,o.useRef)(null),R=(0,d.useParams)(),[z]=(0,d.useSearchParams)(),[B]=s.Form.useForm();(0,o.useImperativeHandle)(j,()=>({submit:()=>B.submit(),validate:()=>B.validateFields(),getValues:()=>B.getFieldsValue(!0),reset:()=>B.resetFields()}),[B]);let V=s.Form.useWatch([],B),[H,U]=(0,o.useState)(!1),[ee,te]=(0,o.useState)({}),[ne,re]=(0,o.useState)([]),[ie,ae]=(0,o.useState)(!!e),[W,oe]=(0,o.useState)(``),[se,ce]=(0,o.useState)(``),[le,ue]=(0,o.useState)(!1),[de,fe]=(0,o.useState)({searched:!1,rows:[],total:0,fields:[],actions:[],actionRules:[],loading:!1}),[pe,me]=(0,o.useState)({current:1,pageSize:10}),[he,ge]=(0,o.useState)({}),[_e,G]=(0,o.useState)(`internal`),[K,ve]=(0,o.useState)([]),[ye,be]=(0,o.useState)({}),[xe,Se]=(0,o.useState)([]),[Ce,we]=(0,o.useState)(u??``),[Te,Ee]=(0,o.useState)(f??``),[De,Oe]=(0,o.useState)(null),[ke,Ae]=(0,o.useState)(!1),[je,Me]=(0,o.useState)(null),[Ne,Pe]=(0,o.useState)(()=>new Set),Fe=e?ne:p??ds,Ie=e?ie:m,Le=e?W:h,[Re,ze]=(0,o.useState)(``),q=R?.jobId&&R.jobId!==`_`?R.jobId:z.get(`jobId`)||``;(0,o.useEffect)(()=>{if(u||w||!q)return;let e=!1;return(async()=>{try{let t=Ns(js(await a.r({module:`jobs`,id:q})))??{},n=t.clientId??t.client??``,r=n&&typeof n==`object`?n.id??n.value??``:n;!e&&r&&ze(String(r))}catch(e){console.error(`Client-scope resolve from job failed:`,e)}})(),()=>{e=!0}},[u,w,q]);let J=u||w||Re||Ce,Y=f||Te;(0,o.useEffect)(()=>{n.Bn()},[]),(0,o.useEffect)(()=>{let t=!1;return queueMicrotask(()=>{if(!t){if(!e){Me(null);return}n.Rr({roleId:localStorage.getItem(`roleId`)},e,{clientId:J,region:Y}).then(e=>{t||Me(Array.isArray(e)&&e.length?e:null)}).catch(()=>{t||Me(null)})}}),()=>{t=!0}},[e,J,Y]),(0,o.useEffect)(()=>{let t=!1;return queueMicrotask(()=>{if(!t){if(!e){Pe(new Set);return}n.Fr(e).then(e=>{t||Pe(new Set(Array.isArray(e)?e:[]))}).catch(()=>{t||Pe(new Set)})}}),()=>{t=!0}},[e]);let X=(0,o.useMemo)(()=>Ms(Fe,e,je,Ne),[Fe,e,je,Ne]),[Be,Ve]=(0,o.useState)(0),He=(0,o.useMemo)(()=>n.yt({checkFieldUnique:n.ht,onPendingChange:Ve}),[]),Ue=(0,o.useMemo)(()=>M?void 0:{checker:He,module:e,clientId:J||void 0,region:Y||void 0},[M,He,e,J,Y]),We=(0,o.useMemo)(()=>n.vt(X),[X]),Ge=(0,o.useMemo)(()=>n.Ht(X),[X]),Ke=(0,o.useRef)({}),qe=(0,o.useRef)(null),Je=(0,o.useMemo)(()=>X.flatMap(e=>e.formActions??[]),[X]),Ye=(0,o.useMemo)(()=>js(Fe).find(e=>e?.duplicateCheck)?.duplicateCheck??{},[Fe]),Xe=Yt({form:B,moduleName:e,config:Ye,onUseExisting:(0,o.useCallback)((t,r,i,a)=>{if(!t)return;let o=r?.editRoute||Ye?.editRoute;if(!o){console.warn(`[duplicate-check] ${e}: no editRoute configured, so the existing record was not opened. Set it in Admin → Automations → "Check for someone already on file" → "Where to open the existing record".`);return}let s=n.N(o,t,{});s&&P(s,{state:{fromDuplicate:!0,carryFiles:a?.files??null}})},[Ye,P])}),Ze=n.Ot({form:B,groups:X,module:e,onParsed:(0,o.useCallback)(async({field:e,payload:t})=>{let n=e?.field,r=n?{files:{[n]:B.getFieldValue(n)}}:null,i=await Xe.prompt({reason:`upload`,payload:t,carry:r});return i===`clear`||(n&&(B.setFieldValue(n,[]),s.message.info(i===`existing`?`Résumé moved to their record.`:`Résumé removed — nothing on this form was filled in.`)),`abort`)},[Xe,B]),onApplied:(0,o.useCallback)(async()=>{await Xe.prompt({reason:`upload`})},[Xe])}),Qe=(0,o.useCallback)(e=>{let t=n.zn().region,r=X.find(t=>(t.fields??[]).some(t=>t.field===e.field));if(!r)return!1;let i=n.A(r,t),a=i.orderBy?.inProgressField??`currentStudyingHere`;if(e.field!==a||n.w(i))return!1;let o=n.T(i);return n.Vt({tone:o?`duplicate`:`overwrite`,title:o?`This has to be completed first`:`You can add this, but they cannot be submitted`,facts:[{label:`Region`,value:t||`Common`},{label:`Entry`,value:r.label??r.name}],body:n.E(i),okText:o?`Got it`:`Keep it anyway`}),o},[X]),$e=(0,o.useCallback)((e,t)=>{let r=X.find(e=>e.name===t);if(!r)return;let i=n.A(r,n.zn().region),a=i.orderBy?.inProgressField??`currentStudyingHere`;if(e.field!==a)return;let o=n.S(i);return o?[o]:void 0},[X]),et=(0,o.useCallback)(async(e,t)=>{if(!Array.isArray(t)||t.length<3||typeof t[1]!=`number`)return;let r=t[0],i=t[1],a=X.find(e=>e.name===r);if(!a)return;let o=n.A(a,n.zn().region);if(!o.orderBy)return;await Promise.resolve();let s=B.getFieldValue(r);Array.isArray(s)&&await n.k({group:o,rows:s,rowIndex:i,move:Ke.current[r]?.move,confirm:({title:e,body:t,okText:r,cancelText:i,from:a,to:o})=>n.Bt({tone:`suggestion`,title:e,facts:[{label:`This entry is at`,value:`Row ${a+1}`},{label:`It belongs at`,value:`Row ${o+1}`}],body:t,okText:r,cancelText:i})})},[X,B]),tt=(0,o.useRef)(!1),nt=(0,o.useCallback)(async()=>{if(!tt.current){tt.current=!0;try{await Xe.prompt({reason:`blur`})}finally{tt.current=!1}}},[Xe]),[rt,it]=(0,o.useState)(`list`),at=M&&!tc(V),{hasClientScope:ot,clientGateMessage:st,clientGateResetOnChange:ct}=(0,o.useMemo)(()=>{let e=js(Fe).flatMap(e=>e.fields??[]).find(e=>ms(e.clientScope));return e?{hasClientScope:!0,clientGateMessage:e.clientGateMessage||``,clientGateResetOnChange:ms(e.clientGateResetOnChange)}:{hasClientScope:!1,clientGateMessage:``,clientGateResetOnChange:!1}},[Fe]),lt=e=>{if(ct){B.resetFields();let e=B.getFieldsValue(!0);B.setFieldsValue(Object.fromEntries(Object.keys(e).map(e=>[e,void 0]))),fe({searched:!1,rows:[],total:0,fields:[],loading:!1}),me({current:1,pageSize:10})}we(e??``)},ut=ot&&!J,dt=(0,o.useCallback)(()=>n.lr({limit:200}).then(Se).catch(()=>Se([])),[]);(0,o.useEffect)(()=>{!ot||w||Re||dt()},[ot,w,Re,dt]);let ft=n.ot({field:{field:`clientId`,quickCreate:!0,quickCreateModule:`clients`,quickCreateLabel:`Add Client`,lookupCollection:`clients`,displayField:`clientName`,quickCreateNotice:{enabled:!0,title:`New Client Created`,showCreator:!0,showRecordName:!0,recordLabel:`Client name`,creatorLabel:`Created by`}},form:B,name:`clientId`,moduleName:e,scopeValues:{},ownValue:J,onDone:(e,t)=>{dt(),e===`create`&&t!=null&&lt(String(t))}});(0,o.useEffect)(()=>{if(!e)return;let t=!1;async function i(){try{ae(!0),oe(``);let i=M?await n.xr(e,`search`,r):await a.r({module:e,action:r,clientId:J,region:Y});t||(re(js(M?i?.[0]:i)),M&&ce(i?.[0]?.label||``))}catch(n){console.error(`Failed to fetch ${e} form groups:`,n),t||oe(n?.message||`Failed to fetch form groups`)}finally{t||ae(!1)}}return i(),()=>{t=!0}},[e,r,M,J,Y]);let pt=(0,o.useMemo)(()=>{if(!S)return null;let e=z.get(`candidateId`)||``,t=z.get(`submissionId`)||``,n=String(z.get(`isFromSubmission`))===`true`,r=R.jobId&&R.jobId!==`_`?R.jobId:z.get(`jobId`)||``,i=n&&t?{module:`submissions`,id:t}:e?{module:`candidates`,id:e}:null,a={};return e&&(a.applicantId=e),r&&(a.jobId=r),{source:i,linkage:Object.keys(a).length?a:null}},[S,z,R]);(0,o.useEffect)(()=>{let e=pt?.source;if(!e)return;let t=!1;async function n(){try{Ae(!0);let n=await a.r({module:e.module,id:e.id});t||Oe(js(n))}catch(e){console.error(`Failed to fetch prefill data:`,e),t||Oe([])}finally{t||Ae(!1)}}return n(),()=>{t=!0}},[pt]);let mt=(0,o.useMemo)(()=>De?Object.fromEntries(De.filter(e=>e.addRow&&Array.isArray(e.rows)&&e.rows.length>0).map(e=>[e.payloadKey||e.name,e.rows])):{},[De]),ht=(0,o.useMemo)(()=>Ns(De),[De]),gt=(0,o.useMemo)(()=>{let e=new Set;return X.forEach(t=>(t.fields??[]).forEach(t=>{t.prefillFromModule&&e.add(Qs(t.prefillFromModule))})),[...e]},[X]),[_t,vt]=(0,o.useState)({});(0,o.useEffect)(()=>{let e=pt?.linkage;if(!e||gt.length===0)return;let t=!1;return gt.forEach(async r=>{let i=n.J(r,e);if(i)try{let e=Ns(js(await a.r({module:r,id:i})));!t&&e&&vt(t=>({...t,[r]:e}))}catch(e){console.error(`Context prefill fetch failed for ${r}:`,e)}}),()=>{t=!0}},[gt,pt]);let yt=(0,o.useMemo)(()=>{let e=x??ht;if(!e&&Object.keys(_t).length===0)return{};let t={};return X.forEach(n=>{n.addRow||(n.fields??[]).forEach(n=>{if(!n.field||!ms(n.prefillAsHint)||ms(n.addRow))return;let r=n.prefillFromModule?_t[Qs(n.prefillFromModule)]:e;if(!r)return;let i=Ps(r,n);if(i==null)return;let a=cc(n,i);a&&(t[n.field]=a)})}),t},[x,ht,_t,X]);(0,o.useEffect)(()=>{let e=x??ht;if(!e&&Object.keys(_t).length===0||Ie||X.length===0)return;let t={};X.forEach(r=>{if(r.toggleEnabled&&r.toggleField&&e){let n=Ps(e,{field:r.toggleField});n!=null&&(t[r.toggleField]=!!n)}r.addRow||(r.fields??[]).forEach(r=>{if(!r.field||ms(r.addRow))return;let i=r.prefillFromModule?_t[Qs(r.prefillFromModule)]:e;if(!i)return;let a=Ps(i,r);if(a!=null&&!ms(r.prefillAsHint)){if(r.type===`file`){let e=Fs(a);e.length>0&&n.Mt(t,r.field,e)}else n.Mt(t,r.field,n.Gt(r,a))}})}),Object.keys(t).length>0&&B.setFieldsValue(t)},[x,ht,_t,Ie,X,B]),(0,o.useEffect)(()=>{let e=F?.state?.relevantSkillsToken,t=F?.state?.relevantSkillsInputs,n=t?.jobId??pt?.linkage?.jobId??``,r=t?.applicantId??t?.candidateId??pt?.linkage?.applicantId??``;if(!(e||t)||Ie||X.length===0)return;let i=X.filter(e=>ms(e.addRow)&&e.skillMatchField);if(i.length===0)return;let a=e||`inputs:${n}:${r}`,o;if(I.current===a&&L.current?o=L.current:(o=e?Vo(e):void 0,(!o||typeof o.then!=`function`)&&n&&r&&(o=Ho({jobId:n,applicantId:r}).catch(()=>[])),I.current=a,L.current=o),!o||typeof o.then!=`function`)return;let s=!1;return o.then(e=>{if(s||!Array.isArray(e)||e.length===0)return;let t={};i.forEach(n=>{let r=B.getFieldValue(n.name),i=Array.isArray(r)?r:[],a=new Map;i.forEach(e=>{let t=String(e?.[n.skillMatchField]??``).trim().toLowerCase();t&&!a.has(t)&&a.set(t,e)}),t[n.name]=e.map(e=>a.get(String(e).trim().toLowerCase())??{[n.skillMatchField]:e})}),Object.keys(t).length>0&&B.setFieldsValue(t)}).catch(()=>{}),()=>{s=!0}},[F?.state?.relevantSkillsToken,F?.state?.relevantSkillsInputs,pt?.linkage?.jobId,pt?.linkage?.applicantId,Ie,X,B]);let bt={...ot&&J?{clientId:J}:{},...pt?.linkage??C??{}},xt=!ut&&!Ie&&(!pt?.source||De!==null&&!ke),St=e=>{let t=e.prefillFrom||e.payloadKey||e.name,r=mt[t],i=Math.max(0,Number(e.minRows??0)||0),a=n.Qt(e);if(!r||r.length===0){let t=e.initialRows===void 0?i:Math.max(i,Math.max(0,Number(e.initialRows)||0));return Array.from({length:t},()=>({...a}))}let o=r.map(t=>{let r={...a};return(e.fields??[]).forEach(e=>{if(!e.field||e.type===`file`)return;let i=Ps(t,e);i!=null&&(r[e.field]=ms(e.addRow)?n.qt(e,i):n.Gt(e,i))}),r});for(;o.length<i;)o.push({...a});return o},Ct=(0,o.useMemo)(()=>X.map(e=>`${e.name}:${+!!ms(e.allowCollapse)}${+!!ms(e.defaultCollapsed)}`).join(`|`),[X]),wt=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!X.length||wt.current===Ct)return;wt.current=Ct;let e={};X.forEach((t,n)=>{let r=t.name??t.id??String(n);ms(t.allowCollapse)&&ms(t.defaultCollapsed)&&(e[r]=!0)}),te(e)},[Ct,X]);let Tt=(0,o.useMemo)(()=>{let e={};return X.forEach(t=>{t.addRow&&(e[t.name]=St(t))}),n.Wt(Ge,e)},[X,mt,Ge]),Et=e=>te(t=>({...t,[e]:!t[e]})),Dt=()=>{B.resetFields(),te({}),G(`internal`),ve([])},Ot=(0,o.useCallback)(async(t,r,i={})=>{if(!M)return;let a=Number(i.pageSize)>0?Number(i.pageSize):pe.pageSize,o=Number(i.current),c=Number.isFinite(o)&&o>0?Math.floor(o):1;try{ge(t),me({current:c,pageSize:a}),fe(e=>({...e,loading:!0,searched:!0}));let i=Ko(t?.selectedSource),o=r?qo(r,_e):i.includes(`internal`)?`internal`:qo(t?.selectedSource,_e),s={...t,selectedSource:o};console.log(`[AddFormV1] Calling searchModuleData with scope:`,o);let l=await n.bn(e||`candidates`,s,{limit:a,offset:(c-1)*a},{scope:o});G(o),fe({searched:!0,rows:l.rows,total:l.total,fields:l.fields,actions:l.actions??[],actionRules:l.actionRules??[],loading:!1}),ve(e=>es({sources:i,activeSource:o,activeCount:l.total,responseCounts:l.counts,currentTabs:e,backendTabs:l.tabs}))}catch(e){console.error(`Search failed:`,e),s.message.error(e?.message||`Failed to search records`),fe({searched:!0,rows:[],total:0,fields:[],actions:[],actionRules:[],loading:!1})}},[M,e,_e,pe.pageSize]),kt=(0,o.useCallback)(async(e,t)=>{let n=os(e,t);be(e=>({...e,[n]:{...e[n]??{},loading:!0}}));try{let r=await ss(e,t);s.message.success(r?.message??r?.data?.message??e.successMessage??`Action completed successfully.`),be(e=>({...e,[n]:{loading:!1,completed:!0}}))}catch(t){s.message.error(t?.message||e.errorMessage||`Action failed.`),be(e=>({...e,[n]:{...e[n]??{},loading:!1}}))}finally{be(e=>({...e,[n]:{...e[n]??{},loading:!1}}))}},[]),At=(0,o.useCallback)(e=>{let t=qo(e,_e);G(t),me({current:1,pageSize:pe.pageSize}),Object.keys(he).length>0&&Ot(he,t,{current:1,pageSize:pe.pageSize})},[pe.pageSize,he,Ot,_e]),jt=(0,o.useCallback)((e,t)=>{let n=Number(t)>0?Number(t):pe.pageSize,r=Number(e)>0?Number(e):1;if(Object.keys(he).length===0){me({current:r,pageSize:n});return}Ot(he,_e,{current:r,pageSize:n})},[Ot,he,pe.pageSize,_e]),Mt=(0,o.useCallback)(e=>{let t=Number(e)>0?Number(e):pe.pageSize;if(Object.keys(he).length===0){me({current:1,pageSize:t});return}Ot(he,_e,{current:1,pageSize:t})},[Ot,he,pe.pageSize,_e]),Nt=e=>{let t=n.bt(e,{uniqueRules:We});return t.length!==0&&(B.setFields(t.map(e=>({name:e.name??e.field,errors:[e.message]}))),te({}),n.l({errorFields:t.map(e=>{let t=e.name??e.field;return{name:Array.isArray(t)?t:[t],errors:[e.message]}})},B),!0)},Pt=(0,o.useCallback)(async e=>{try{let t=n.zn().region,r=X.map(e=>n.A(e,t)),i=n.O(r,e);return i.severity===`allow`?!0:i.severity===`block`?(n.Vt({tone:`duplicate`,title:`This qualification history is incomplete`,body:i.message,okText:`Go back`}),!1):!await n.Bt({tone:`suggestion`,title:`Add the earlier qualification too?`,body:i.message,okText:`Add it now`,cancelText:`Submit anyway`})}catch(e){return console.warn(`[levelRule] check skipped:`,e),!0}},[X]),Ft=async t=>{if(M){await Ot(t);return}if(!(!O&&await Xe.prompt({reason:`submit`})!==`clear`)&&await Pt(t)){if(b){await b(t,{moduleName:e,groups:X,registerDocuments:async(r,i={})=>{let a=n.Jt(t,X,{module:i.module??e});return!a.length||!r?[]:n._n(i.module??e,r,a)},extraPayload:bt??{},payload:{...bt??{},...n.Kt(t,X,{module:e})}});return}if(!e){console.log(`Form values:`,t);return}try{ue(!0);let r=await a.n(e,nc(t,X,bt??{},e));if(r?.status===!1){if(Nt(r))return;s.message.error(n.u(X,e,`add`,r?.error||r?.message||r?.data));return}let i=n.Jt(t,X,{scope:`addRow`,indexed:!0,module:e}),o=r?.id??r?.data?.id??r?.data?._id??r?._id;if(i.length>0&&o)try{await n.hn(e,o,{...bt??{},...n.Kt(t,X,{module:e})},i)}catch(e){console.error(`Document file attach (post-create update) failed:`,e),s.message.warning(`Record created, but attaching document files failed. Edit the record to re-upload.`)}let c=n.Jt(t,X,{module:e});if(c.length>0&&o)try{await n._n(e,o,c)}catch(e){console.error(`Document registry upload failed:`,e),s.message.warning(`Record created, but saving its document records failed.`)}let l=n.d(X,e,`add`);if(l&&s.message.success(l),B.resetFields(),O&&k){k(o,t);return}let u=qe.current??n.M(X);if(!u)n.j(P,{cancelPath:y});else if(u.mode===`back`)n.j(P,{cancelPath:y});else if(u.mode===`route`||u.mode===`detail`){let e=n.N(u.target,o,t);e&&P(e)}}catch(t){if(console.error(`Failed to create ${e}:`,t),Nt(t))return;s.message.error(n.u(X,e,`add`,t?.data?.error||t?.data?.message||t?.message))}finally{ue(!1),qe.current=null}}},It=(e,t,r)=>{let i=e.validations??e.validation??e.rules??[];return[...i.filter(e=>(typeof e==`string`?e:e?.type)===`maxFromField`).map(e=>n.rt(e,t,r)).filter(Boolean),...i.filter(e=>{let t=typeof e==`string`?e:e?.type;return[`dateAfterField`,`greaterThanField`,`strictGreaterThanField`,`strictLessThanField`,`lessThanOrEqualField`,`maxFieldWithFallback`,`dateBeforeField`,`timeAfterField`,`timeBeforeField`].includes(t)}).map(e=>String(e.value??e.compareField??e.field??``).split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>zs(t,e))).flat().filter(Boolean)]},Lt=(e,t)=>typeof e==`function`?e(t):e,Rt=(e,t,n)=>{if(!e?.field)return!0;let r=Lt(n,e.field),i=t(r==null?[e.field]:[...Array.isArray(r)?r:[r],e.field]);switch(e.operator){case`eq`:return String(i??``)===String(e.value??``);case`neq`:return String(i??``)!==String(e.value??``);case`truthy`:return i!=null&&i!==``&&i!==!1;case`falsy`:return i==null||i===``||i===!1;case`notEmpty`:return Array.isArray(i)?i.length>0:!!i;case`in`:return String(e.value??``).split(`,`).map(e=>e.trim()).includes(String(i??``));case`notIn`:return!String(e.value??``).split(`,`).map(e=>e.trim()).includes(String(i??``));default:return!0}},zt=(e,t,n)=>{if(!e)return!0;let r=Array.isArray(e.conditions)?e.conditions.filter(e=>e?.field):[];if(r.length){let i=r.map(e=>Rt(e,t,n)),a=String(e.logic??`and`).toLowerCase()===`or`,o=a?i.some(Boolean):i.every(Boolean);if(e.field){let r=Rt(e,t,n);o=a?o||r:o&&r}return o}return Rt(e,t,n)},Vt=e=>!!(e?.field||e?.conditions?.some?.(e=>e?.field)),[Ht,Ut]=(0,o.useState)({}),Wt=e=>String(e?.field??``),Gt=(0,o.useMemo)(()=>t.s(),[]),Kt=(t,r,i,a={})=>{let c=typeof t.field==`string`&&t.field.includes(`.`)?t.field.split(`.`):null,u=c??t.field,d=r===void 0?u:[r,...c??[t.field]],f=i!==void 0&&r!==void 0?[...Array.isArray(i)?i:[i],...Array.isArray(d)?d:[d]]:d,p=t.type===`checkbox`&&(t.options&&t.options.length>0||t.dataSource&&t.dataSource!==`static`),m=!p&&t.type===`checkbox`?`checked`:`value`,h=!!t.editablePermission&&!n.F(t.editablePermission,e),g=i!==void 0&&r!==void 0?[...Array.isArray(i)?i:[i],r]:null,_=e=>g&&(!a.rowFieldKeys||a.rowFieldKeys.has(e))?g:null,v=n.nn(t),y=v?n.rn(t,f,_):null,b=a.inline||a.hideLabel||!p&&t.type===`checkbox`?``:(0,l.jsx)(bs,{form:B,field:t,siblingPrefix:t.labelWhen?.field?_(t.labelWhen.field):g,locked:h}),x=v&&b?(0,l.jsxs)(`span`,{className:`v1-label-with-override`,children:[b,(0,l.jsx)(n.K,{form:B,field:t,flagPath:y,fieldPath:f,disabled:h})]}):b,S=It(t,f,_),C=n.R(t),w=a.inline||t.type===`file`&&ms(t.multiple)||t.type===`text-editor`?24:t.col??12,T=Bt(t,Gt),E=r===void 0&&t.type!==`file`&&T.matched&&T.value!==void 0&&T.value!==``?T.value:r===void 0&&t.type!==`file`&&t.defaultValue!==void 0&&t.defaultValue!==``?t.defaultValue:void 0,D=(t.aiActions||[]).filter(e=>e.trigger===`click`),O=(t.aiActions||[]).find(e=>e.trigger===`upload`),k=(0,l.jsx)(s.Form.Item,{label:x,name:d,extra:lc(t,yt[t.field]),rules:Gs(t,B,f,M,_,Ue,$e(t,a.groupNameForActions)),required:Ws(t,B,f),dependencies:S,valuePropName:m,initialValue:E,getValueFromEvent:t.type===`file`?e=>Array.isArray(e)?e:e?.fileList:void 0,validateTrigger:[`onBlur`,`onChange`],children:(0,l.jsx)(rc,{field:t,form:B,name:f,rowFieldKeys:a.rowFieldKeys,moduleName:e,scopeValues:{clientId:J},onAiUpload:O?e=>Ze.runAction(a.groupNameForActions,t,O,e):void 0,onDuplicateBlur:nt,onRegionBlocked:Qe,onRowOrderChange:et,formDisabled:Ze.busy},t.refreshToken==null?void 0:`${t.field}-refresh-${t.refreshToken}`)}),A=C&&!x?(0,l.jsx)(s.Tooltip,{title:C,children:(0,l.jsx)(`span`,{className:`v1-field-tooltip-wrap`,children:k})}):k,j=D.length>0?(()=>{let e=n.Dt(D),r=r=>(0,l.jsx)(n.Et,{position:r,actions:e[r],aiActions:Ze,groupName:a.groupNameForActions,field:t},r);return(0,l.jsxs)(`div`,{className:`v1-ai-action-wrap`,children:[r(`top-left`),r(`top-center`),r(`top-right`),A,r(`bottom-left`),r(`bottom-center`),r(`bottom-right`)]})})():A,N=e=>r===void 0?e:[r,e],P=t.verifyAction?(0,l.jsxs)(l.Fragment,{children:[t.verifyResultField&&(0,l.jsx)(s.Form.Item,{name:N(t.verifyResultField),hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Input,{})}),t.verifyTimestampField&&(0,l.jsx)(s.Form.Item,{name:N(t.verifyTimestampField),hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Input,{})})]}):null,F=t.verifyAction?(0,l.jsxs)(`div`,{className:`v1-verify-field-row`,children:[j,(0,l.jsx)(ys,{form:B,field:t,absoluteName:f}),P]}):j,I=v?(0,l.jsxs)(l.Fragment,{children:[F,(0,l.jsx)(s.Form.Item,{name:r===void 0?y[y.length-1]:[r,y[y.length-1]],valuePropName:`checked`,hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Checkbox,{})})]}):F,L=a.inline?{flex:`${Number(t.combineWidth)>0?Number(t.combineWidth):1} 1 0`,maxWidth:`none`}:void 0,R=t.autoFillFromApi?(0,l.jsx)(ws,{form:B,config:t.autoFillFromApi,watchPath:f},`${t.field}-autoFillFromApi`):null,z=t.prefillWhen?.length?(0,l.jsx)(Cs,{form:B,rules:t.prefillWhen,watchPaths:n.W(t.prefillWhen,f,n.at,_),targetPath:f,resetOnNoMatch:t.prefillWhenReset!==!1},`${t.field}-prefillWhen`):null;if(t.show===0)return(0,l.jsxs)(o.Fragment,{children:[z,R,(0,l.jsx)(s.Form.Item,{name:d,hidden:!0,noStyle:!0,children:(0,l.jsx)(`input`,{type:`hidden`})})]},t.field);let V=!a.inline&&n.n(t).length>0,H=e=>V?n.s(t,w,t=>e(n.r(t,_(t.field)))):w;return Vt(t.showIf)||V?(0,l.jsxs)(o.Fragment,{children:[z,R,(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,noStyle:!0,children:({getFieldValue:e})=>!Vt(t.showIf)||zt(t.showIf,e,_)?(0,l.jsx)(s.Col,{xs:24,md:H(e),style:L,className:a.inline?`v1-combine-cell`:void 0,children:I}):null})]},t.field):(0,l.jsxs)(o.Fragment,{children:[z,R,(0,l.jsx)(s.Col,{xs:24,md:w,style:L,className:a.inline?`v1-combine-cell`:void 0,children:I})]},t.field)},qt=t=>{let r=typeof t.field==`string`&&t.field.includes(`.`)?t.field.split(`.`):[t.field],i=!!t.editablePermission&&!n.F(t.editablePermission,e),a=(0,l.jsx)(ac,{field:t,label:t.label,locked:i}),o=n.$t(t),u=Array.isArray(t.subFields)&&t.subFields.length>0,d=u?t.subFields.map(e=>({...e,show:1,edit:1})):null,f=Math.max(0,Number(t.minRows??0)||0),p=t.maxRows!==void 0&&t.maxRows!==``&&Number(t.maxRows)>0?Number(t.maxRows):0,m=Ps(x??ht??{},t),h=n.qt(t,m);return(0,l.jsx)(s.Col,{xs:24,md:24,children:(0,l.jsx)(s.Form.Item,{label:a,required:Ws(t),colon:!1,className:`v1-combine-field`,children:(0,l.jsx)(s.Form.List,{name:r,initialValue:h,rules:[{validator:async(e,n=[])=>{if(Ws(t)&&!(u?n.some(e=>As(e)):n.some(e=>e!=null&&e!==``&&!(Array.isArray(e)&&e.length===0))))throw Error(`Mandatory Field`);if(f>0&&n.length<f)throw Error(`Keep at least ${f} ${u?`row`:`value`}${f>1?`s`:``}.`)}}],children:(n,{add:i,remove:a},{errors:m})=>(0,l.jsxs)(`div`,{className:`v1-addrow-wrapper`,children:[n.map(({key:i,name:p})=>(0,l.jsxs)(`div`,{className:`v1-addrow-item`,children:[(0,l.jsx)(s.Button,{type:`text`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>a(p),disabled:n.length<=f,className:`v1-addrow-delete-btn`}),(0,l.jsx)(`div`,{className:`v1-addrow-fields`,children:u?(0,l.jsx)(s.Row,{gutter:[24,0],align:`top`,children:Zt(d,p,r[0],!1,t.field)}):(0,l.jsx)(s.Form.Item,{name:[p],noStyle:!0,valuePropName:t.type===`checkbox`&&!t.options?.length?`checked`:`value`,getValueFromEvent:t.type===`file`?e=>Array.isArray(e)?e:e?.fileList:void 0,rules:Gs(o,B,[...r,p],M),children:(0,l.jsx)(rc,{field:o,form:B,name:[...r,p],moduleName:e,scopeValues:{clientId:J},formDisabled:Ze.busy})})})]},i)),(!p||n.length<p)&&(0,l.jsx)(s.Button,{type:`link`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>i(),className:`v1-addrow-add-btn`,children:t.addLabel??`Add ${t.label??`Value`}`}),(0,l.jsx)(s.Form.ErrorList,{errors:m})]})})})},t.field)},Jt=(t,r,i)=>{let a=typeof t.field==`string`&&t.field.includes(`.`)?t.field.split(`.`):[t.field],o=!!t.editablePermission&&!n.F(t.editablePermission,e),u=(0,l.jsx)(ac,{field:t,label:t.label,locked:o}),d=n.$t(t),f=Array.isArray(t.subFields)&&t.subFields.length>0,p=f?t.subFields.map(e=>({...e,show:1,edit:1})):null,m=Math.max(0,Number(t.minRows??0)||0),h=t.maxRows!==void 0&&t.maxRows!==``&&Number(t.maxRows)>0?Number(t.maxRows):0,g=[r,...a],_=[...Array.isArray(i)?i:[i],r,...a],v=n.qt(t,void 0);return(0,l.jsx)(s.Col,{xs:24,md:f?24:t.col??24,children:(0,l.jsx)(s.Form.Item,{label:u,required:Ws(t),colon:!1,className:`v1-combine-field`,children:(0,l.jsx)(s.Form.List,{name:g,initialValue:v,rules:f?[{validator:async(e,n=[])=>{if(Ws(t)&&!n.some(e=>As(e)))throw Error(`Mandatory Field`);if(m>0&&n.length<m)throw Error(`Keep at least ${m} row${m>1?`s`:``}.`)}}]:[],children:(n,{add:r,remove:i},{errors:a})=>(0,l.jsxs)(`div`,{className:`v1-addrow-wrapper`,children:[n.map(({key:r,name:a})=>{let o=[..._,a];return(0,l.jsxs)(`div`,{className:`v1-addrow-item`,children:[(0,l.jsx)(s.Button,{type:`text`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>i(a),disabled:n.length<=m,className:`v1-addrow-delete-btn`}),(0,l.jsx)(`div`,{className:`v1-addrow-fields`,children:f?(0,l.jsx)(s.Row,{gutter:[24,0],align:`top`,children:Zt(p,a,_,!1,t.field)}):(0,l.jsx)(s.Form.Item,{name:[a],noStyle:!0,valuePropName:t.type===`checkbox`&&!t.options?.length?`checked`:`value`,getValueFromEvent:t.type===`file`?e=>Array.isArray(e)?e:e?.fileList:void 0,rules:Gs(d,B,o,M),children:(0,l.jsx)(rc,{field:d,form:B,name:o,moduleName:e,scopeValues:{clientId:J},formDisabled:Ze.busy})})})]},r)}),(!h||n.length<h)&&(0,l.jsx)(s.Button,{type:`link`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>r(),className:`v1-addrow-add-btn`,children:t.addLabel??`Add ${t.label??`Value`}`}),(0,l.jsx)(s.Form.ErrorList,{errors:a})]})})})},`${i}-${r}-${t.field}`)},Xt=(e,t)=>e.filter(e=>e.field&&e.show!==void 0&&!ms(e.show)).map(e=>{let n=String(e.field).includes(`.`)?String(e.field).split(`.`):e.field,r=t===void 0?n:[t,...Array.isArray(n)?n:[n]];return(0,l.jsx)(s.Form.Item,{name:r,hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Input,{})},`hidden-${e.field}`)}),Zt=(e,t,r,i=!1,a)=>{let o=new Set,c=[],u=new Set(e.map(e=>e.field).filter(Boolean)),d=e.filter(e=>e.show===void 0||ms(e.show)||e.show===0&&!!e.prefillWhen?.length);return c.push(...Xt(e,t)),d.forEach(e=>{if(ms(e.addRow)&&t===void 0){c.push(qt(e));return}if(ms(e.addRow)&&t!==void 0){c.push(Jt(e,t,r));return}let f=e.combineKey?.trim?.();if(!f){c.push(Kt(e,t,r,{hideLabel:i,groupNameForActions:a,rowFieldKeys:u}));return}let p=`${r??`root`}:${t??`root`}:${f}`;if(o.has(p))return;let m=d.filter(e=>e.combineKey===f);m.forEach(e=>o.add(`${r??`root`}:${t??`root`}:${e.combineKey}`));let h=m.find(e=>e.combineLabel)??e,g=r!==void 0&&t!==void 0?[...Array.isArray(r)?r:[r],t]:null,_=m.find(e=>n.nn(e))??null,v=e=>g&&(!u||u.has(e))?g:null,y=_?r!==void 0&&t!==void 0?[...Array.isArray(r)?r:[r],t,...String(_.field).includes(`.`)?String(_.field).split(`.`):[_.field]]:String(_.field).includes(`.`)?String(_.field).split(`.`):_.field:null,b=(0,l.jsx)(bs,{form:B,field:h,siblingPrefix:g,combined:!0}),x=_?(0,l.jsxs)(`span`,{className:`v1-label-with-override`,children:[b,(0,l.jsx)(n.K,{form:B,field:_,flagPath:n.rn(_,y,v),fieldPath:y})]}):b,S=m.find(e=>e.combineToggleTarget)?.combineToggleTarget,C=m.find(e=>e.combineToggleLabel)?.combineToggleLabel??`Show range`,w=p,T=m.some(e=>ms(e.combineWrap)),E=Number(m.find(e=>[12,24].includes(Number(e.combineSpan)))?.combineSpan),D=S?m.find(e=>Wt(e)===S):null,O=D?.field?.includes?.(`.`)?D.field.split(`.`):[D?.field].filter(Boolean),k=D?r!==void 0&&t!==void 0?[r,t,...O]:O.length>1?O:D.field:null,A=m.some(e=>Ws(e)),j=[12,24].includes(E)?E:m.length>=3?24:12,M=e=>g&&(!u||u.has(e))?g:null,N=m.some(e=>Vt(e.showIf)),P=e=>m.some(t=>!Vt(t.showIf)||zt(t.showIf,e,M)),F=(0,l.jsx)(s.Col,{xs:24,md:j,children:(0,l.jsx)(s.Form.Item,{label:x,required:A,colon:!1,className:`v1-combine-field`,children:(0,l.jsx)(s.Form.Item,{noStyle:!0,shouldUpdate:!0,children:({getFieldValue:e})=>{let n=k?!Is(e(k)):!1,i=Ht[w]??n,a=S&&!i?m.filter(e=>Wt(e)!==S):m;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Row,{gutter:[8,0],align:`top`,wrap:T,className:`v1-combine-row${T?` v1-combine-row-wrap`:``}`,children:a.map(e=>Kt(A?{...e,req:1}:e,t,r,{inline:!0}))}),S&&(0,l.jsxs)(`div`,{className:`v1-combine-range`,children:[(0,l.jsx)(s.Switch,{size:`small`,checked:i,onChange:e=>{!e&&k&&(B.setFieldValue(k,void 0),B.validateFields([k]).catch(()=>{})),Ut(t=>({...t,[w]:e}))}}),(0,l.jsx)(ls,{type:`secondary`,className:`v1-combine-toggle-label`,children:C})]})]})}})})},p);c.push(N?(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,noStyle:!0,children:({getFieldValue:e})=>P(e)?F:null},p):F)}),c},Qt=(0,o.useMemo)(()=>{if(de.fields?.length)return de.fields;let e=de.rows[0];return e?Object.keys(e).filter(t=>!t.startsWith(`_`)&&typeof e[t]!=`object`).map(e=>({value:e,field:e,label:e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase()),isVisible:!0})):[]},[de.fields,de.rows]),$t=e=>!Array.isArray(e)||e.length===0?`card`:e.some(e=>[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].some(e=>{if(e==null)return!1;let t=String(e).trim().toLowerCase();return t?![`all`,`internal`].includes(t):!1}))?`list`:`card`;(0,o.useMemo)(()=>$t(de.rows),[de.rows]);let en=(0,o.useMemo)(()=>{let e=is({rows:de.rows,selectedSource:_e});if(!e.length)return Qt;let t=new Set(e.map(e=>e.field));return[...Qt.filter(e=>e.cardRole!==`action`&&!t.has(e.value)),...e.map(e=>({value:e.field,field:e.field,label:e.label??`Action`,cardRole:`action`,isVisible:!0,tableHidden:!0,sorter:!1,render:(t,n)=>{if(!as(e,n,_e))return null;let r=os(e,n),i=ye[r]??{},a=!r||i.completed;return(0,l.jsx)(s.Button,{type:`primary`,size:`small`,loading:i.loading,disabled:a,onClick:()=>kt(e,n),children:i.completed?e.completedLabel:e.buttonLabel})}}))]},[kt,Qt,de.rows,_e,ye]),tn=(0,o.useMemo)(()=>{if(!D)return de.actions;let e=t=>({...t,popupState:{...D,...t.popupState},...t.children?{children:t.children.map(e)}:{}});return(de.actions??[]).map(e)},[de.actions,D]),nn=e=>{let t=e.name??e.id??``,r=n.Ut(Ge,t),i=!!r&&r.leaderName!==t,a=r?X.find(e=>e.name===r.leaderName)??e:e,o=Math.max(0,Number(a.minRows??0)||0),u=Math.max(0,Number(a.maxRows??0)||0),d=r?r.memberNames:[t],f=()=>{d.forEach(t=>{let r=X.find(e=>e.name===t)??e;Ke.current[t]?.add(n.Qt(r))})},p=e=>{d.forEach(t=>Ke.current[t]?.remove(e))};return e.addRow?(0,l.jsx)(s.Form.List,{name:t,initialValue:Tt[t]??[],rules:i?[]:[{validator:async(t,n=[])=>{if(!(ms(e.toggleEnabled)&&e.toggleField&&B.getFieldValue(e.toggleField))){if(o>0&&n.length<o)throw Error(`Keep at least ${o} row${o>1?`s`:``}.`);if(ms(e.requireOne)&&n.some(e=>!As(e)))throw Error(`Fill at least one field in each added row.`)}}}],children:(n,{add:r,remove:d,move:m},{errors:h})=>(Ke.current[t]={add:r,remove:d,move:m},(0,l.jsxs)(`div`,{className:`v1-addrow-wrapper`,children:[(0,l.jsx)(`div`,{className:`v1-addrow-topbar`,children:i?(0,l.jsxs)(ls,{type:`secondary`,className:`v1-addrow-linked-hint`,children:[`Rows added via `,a.label??a.name]}):(!u||n.length<u)&&(0,l.jsx)(s.Button,{type:`link`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:f,className:`v1-addrow-add-btn`,children:e.addLabel??`Add ${e.label??`Row`}`})}),ms(e.sharedRowLabels)&&n.length>0&&(0,l.jsx)(s.Row,{gutter:[24,0],className:`v1-addrow-header`,children:e.fields.filter(e=>e.show===void 0||ms(e.show)).map(e=>(0,l.jsx)(s.Col,{md:e.col??12,className:`v1-addrow-header-label`,children:e.label},Wt(e)))}),n.map(({key:r,name:i})=>(0,l.jsxs)(`div`,{className:`v1-addrow-item`,children:[(0,l.jsx)(s.Button,{type:`text`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>p(i),disabled:n.length<=o,className:`v1-addrow-delete-btn`}),(0,l.jsx)(`div`,{className:`v1-addrow-fields`,children:(0,l.jsx)(s.Row,{gutter:[24,0],align:`top`,children:Zt(e.fields,i,t,ms(e.sharedRowLabels),t)})})]},r)),(0,l.jsx)(s.Form.ErrorList,{errors:h})]}))}):(0,l.jsx)(s.Row,{gutter:[24,0],children:Zt(e.fields,void 0,void 0,!1,t)})},rn=e=>X.filter(t=>t!==e&&t.mergeInto&&String(t.mergeInto)===String(e.name)),an=e=>!!(e.mergeInto&&X.some(t=>t!==e&&String(t.name)===String(e.mergeInto))),on=(e,t)=>rn(e).filter(e=>String(e.mergePosition??`bottom`)===t),sn=(e,t)=>{let n=e.name??e.id??String(t),r=nn(e),i=on(e,`top`),a=on(e,`bottom`),o=e=>{let t=(0,l.jsxs)(`div`,{className:`v1-merged-group`,children:[(0,l.jsx)(`div`,{className:`v1-merged-group-title`,children:e.label??e.name}),nn(e)]},e.name),n=e.showIf?.field?(0,l.jsx)(Es,{form:B,showIf:e.showIf,render:()=>t},e.name):t;return(0,l.jsx)(Os,{form:B,group:e,inheritParent:!1,children:n},e.name)};return(0,l.jsx)(s.Card,{className:`v1-card v1-edit-card`,title:(0,l.jsx)(ic,{icon:fs[t%fs.length],title:M?se||e.label:e.label??e.name??`Details`}),extra:(0,l.jsxs)(s.Space,{size:8,align:`center`,className:`v1-group-actions`,children:[(0,l.jsx)(oc,{group:e}),(0,l.jsx)(sc,{group:e}),ms(e.allowCollapse)&&(0,l.jsx)(s.Button,{type:`text`,size:`small`,"aria-expanded":!ee[n],"aria-label":ee[n]?`Expand section`:`Collapse section`,icon:ee[n]?(0,l.jsx)(c.DownOutlined,{}):(0,l.jsx)(c.UpOutlined,{}),onClick:e=>{e.stopPropagation(),Et(n)}})]}),children:(0,l.jsx)(s.Form.Item,{noStyle:!0,shouldUpdate:!0,children:({getFieldValue:t})=>{let s=ms(e.toggleEnabled)&&e.toggleField&&!!t(e.toggleField);return(0,l.jsxs)(`div`,{style:{display:ee[n]||s?`none`:`block`},children:[i.map(o),r,a.map(o)]})}})},n)};return(0,l.jsxs)(`main`,{children:[g.length>0&&(0,l.jsx)(n.t,{items:g}),(0,l.jsxs)(`div`,{className:`v1-edit-page`,children:[ot&&!w&&!Re&&(0,l.jsx)(s.Card,{className:`v1-card v1-edit-card v1-client-gate-card`,children:(0,l.jsxs)(s.Space,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,l.jsx)(ic,{icon:(0,l.jsx)(c.UserOutlined,{}),title:`Select Client`}),st&&(0,l.jsx)(ls,{type:`secondary`,children:st}),(0,l.jsx)(s.Row,{gutter:[16,0],children:(0,l.jsxs)(s.Col,{xs:24,md:14,children:[(0,l.jsx)(s.Select,{showSearch:!0,allowClear:!0,placeholder:`Select client`,style:{width:`100%`},value:J||void 0,optionFilterProp:`label`,options:xe.map(e=>({value:e._id??e.id,label:e.clientName??e.name??e.clientRefrenceId??e._id})).filter(e=>e.value),onChange:lt,dropdownRender:ft.footer?e=>(0,l.jsxs)(l.Fragment,{children:[e,ft.footer]}):void 0}),ft.modal]})})]})}),(0,l.jsxs)(`div`,{className:`v1-page-inner`,children:[(0,l.jsx)(s.Spin,{fullscreen:!0,spinning:Ze.busy||Xe.checking,size:`large`,tip:Ze.busy?Ze.loadingText||`Reading the file…`:`Checking whether we already have this person…`}),(0,l.jsx)(s.Spin,{spinning:!xt&&!ut,description:`Loading form fields…`,children:(0,l.jsxs)(s.Form,{form:B,layout:`vertical`,colon:!1,className:`v1-form`,disabled:Ze.busy||Xe.checking,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),onFinish:Ft,onFinishFailed:e=>{te({}),n.l(e,B)},children:[xt&&X.filter(e=>!an(e)).map((e,t)=>(0,l.jsx)(Os,{form:B,group:e,children:e.showIf?.field?(0,l.jsx)(Es,{form:B,showIf:e.showIf,render:()=>sn(e,t)}):sn(e,t)},e.name??`grp-${t}`)),xt&&!Le&&X.length===0&&(0,l.jsx)(s.Alert,{type:`info`,showIcon:!0,message:M?`No search configuration found.`:`No form fields are configured.`}),xt&&M&&(0,l.jsx)(`div`,{className:`v1-search-form-actions`,children:(0,l.jsxs)(s.Space,{size:12,children:[(0,l.jsx)(s.Button,{onClick:Dt,disabled:!X.length,children:`Reset`}),(0,l.jsx)(s.Button,{onClick:()=>n.j(P,{cancelPath:y}),children:`Back`}),(0,l.jsx)(s.Button,{type:`primary`,htmlType:`submit`,disabled:le||!X.length||at,loading:le,children:N})]})})]})})]}),!M&&(0,l.jsxs)(`div`,{className:O?`v1-footer v1-footer--embedded`:`v1-footer`,children:[(0,l.jsx)(ls,{type:`secondary`,children:`All Unsaved Changes will be lost if you cancel and reload.`}),(0,l.jsxs)(s.Space,{size:12,children:[(0,l.jsx)(s.Button,{onClick:()=>O&&A?A():n.j(P,{cancelPath:y}),children:`Cancel`}),Je.map((e,t)=>(0,l.jsx)(xs,{form:B,groups:X,action:e,disabled:!xt||le||Be>0||!X.length,loading:le,onFire:()=>{qe.current=e.afterSubmit??{mode:`stay`},e.setValuesBeforeSubmit&&B.setFieldsValue(e.setValuesBeforeSubmit),B.submit()}},`${e.label??`action`}-${t}`)),(0,l.jsx)(Ss,{form:B,groups:X,onClick:()=>{qe.current=null,B.submit()},disabled:!xt||le||Be>0||!X.length,loading:le,children:N})]})]}),M&&de.searched&&(0,l.jsx)(Lo,{moduleName:e,breadcrumbItems:[],dataSource:de.rows,fields:en,total:de.total,loading:de.loading,current:pe.current,pageSize:pe.pageSize,showViewToggle:!0,activeView:rt,onViewChange:it,onPageChange:jt,onPageSizeChange:Mt,showSearch:!1,tabs:K,selectedSource:_e,onTabChange:At,actions:tn,actionRules:de.actionRules})]})]})});function dc({className:e=``,variant:t=`default`,showIcon:n=!0,...r}){return(0,l.jsx)(s.Alert,{className:`app-alert app-alert--${t} ${e}`.trim(),showIcon:n,...r})}function fc(e){let t=n.On().startOf(`day`).diff(n.Nn(e).startOf(`day`),`day`);return t<=0?`Today`:t===1?`1 Day ago`:`${t} Days ago`}function pc(e=[],t){let r=new Map;return e.forEach(e=>{let i=t(e),a=n.Nn(i);if(!a.isValid())return;let o=a.format(`YYYY-MM-DD`);r.has(o)||r.set(o,{date:new Date(a.valueOf()),items:[]}),r.get(o).items.push(e)}),[...r.values()].sort((e,t)=>t.date-e.date)}function mc(e){let t=e?.dateTimeFormat||`MMM DD, YYYY | hh:mm A`,[n]=t.split(`|`);return(n??t).trim()||t}function hc(e){let t=n.zn();return n.kn(e,mc(t),t)}function gc(e){return hc(e)}function _c(e){return n.An(e,n.zn())}function vc({row:e,last:t,getTime:n,getAuthor:r,getMeta:i,renderBody:a}){let o=n(e),s=r?.(e),c=i?.(e);return(0,l.jsxs)(`div`,{className:`znx-an-item`,children:[(0,l.jsxs)(`div`,{className:`znx-an-rail`,children:[c?(0,l.jsx)(`span`,{className:`znx-an-icon-dot znx-an-icon-dot--${c.tone}`,title:c.label,children:c.icon}):(0,l.jsx)(`span`,{className:`znx-an-dot`}),!t&&(0,l.jsx)(`span`,{className:`znx-an-line`})]}),(0,l.jsxs)(`div`,{className:`znx-an-content`,children:[a(e),(0,l.jsxs)(`div`,{className:`znx-an-meta`,children:[s&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`znx-an-author`,children:s}),(0,l.jsx)(`span`,{className:`znx-an-sep`,"aria-hidden":`true`})]}),(0,l.jsx)(`span`,{className:`znx-an-stamp`,children:_c(o)})]})]})]})}function yc({rows:e=[],getTime:t,getKey:n,getAuthor:r,getMeta:i,renderBody:a,emptyText:o=`Nothing here yet.`,grouped:c=!0}){if(!c)return e.length?(0,l.jsx)(`div`,{className:`znx-an-flat`,children:e.map((o,s)=>(0,l.jsx)(vc,{row:o,last:s===e.length-1,getTime:t,getAuthor:r,getMeta:i,renderBody:a},n(o,s)))}):(0,l.jsx)(`div`,{className:`znx-an-empty`,children:(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:o})});let u=pc(e,t);if(!u.length)return(0,l.jsx)(`div`,{className:`znx-an-empty`,children:(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:o})});let d=u.map((e,o)=>({key:String(o),label:(0,l.jsxs)(`span`,{className:`znx-an-group`,children:[(0,l.jsx)(`span`,{className:`znx-an-group-day`,children:fc(e.date)}),(0,l.jsx)(`span`,{className:`znx-an-group-date`,children:gc(e.date)}),(0,l.jsx)(`span`,{className:`znx-an-group-count`,children:e.items.length})]}),children:e.items.map((o,s)=>(0,l.jsx)(vc,{row:o,last:s===e.items.length-1,getTime:t,getAuthor:r,getMeta:i,renderBody:a},n(o,s)))}));return(0,l.jsx)(s.Collapse,{className:`znx-an-collapse`,defaultActiveKey:[`0`],ghost:!0,items:d})}var bc={add:`created`,create:`created`,created:`created`,update:`updated`,updated:`updated`,edit:`updated`,edited:`updated`,update_log:`updated`,update_proof:`updated`,notes:`note`,note:`note`,comment:`note`,assign:`assigned`,assigned:`assigned`,assignment:`assigned`,reassign:`assigned`,reassigned:`assigned`,submit:`submitted`,submitted:`submitted`,submission:`submitted`,"internal submission":`submitted`,send_for_approval:`sendForApproval`,"send for approval":`sendForApproval`,sendforapproval:`sendForApproval`,resubmit:`resubmitted`,resubmitted:`resubmitted`,resent_for_approval:`resent`,reject:`rejected`,rejected:`rejected`,reject_days:`rejected`,declined:`rejected`,decline:`rejected`,approve:`approved`,approved:`approved`,approve_days:`approved`,reopen:`reopened`,reopened:`reopened`,delete:`deleted`,deleted:`deleted`,remove:`deleted`,removed:`deleted`,status:`status`,"status change":`status`,statuschange:`status`,document:`document`,documents:`document`,upload:`document`,uploaded:`document`,attachment:`document`},xc={created:{tone:`success`,icon:(0,l.jsx)(c.PlusOutlined,{}),label:`Created`},updated:{tone:`info`,icon:(0,l.jsx)(c.EditOutlined,{}),label:`Updated`},note:{tone:`neutral`,icon:(0,l.jsx)(c.MessageOutlined,{}),label:`Note`},assigned:{tone:`purple`,icon:(0,l.jsx)(c.UserSwitchOutlined,{}),label:`Assigned`},submitted:{tone:`info`,icon:(0,l.jsx)(c.SendOutlined,{}),label:`Submitted`},sendForApproval:{tone:`info`,icon:(0,l.jsx)(c.SendOutlined,{}),label:`Send for Approval`},resubmitted:{tone:`purple`,icon:(0,l.jsx)(c.RedoOutlined,{}),label:`Re-submitted`},resent:{tone:`purple`,icon:(0,l.jsx)(c.RedoOutlined,{}),label:`Resend for Approval`},approved:{tone:`success`,icon:(0,l.jsx)(c.CheckOutlined,{}),label:`Approved`},rejected:{tone:`danger`,icon:(0,l.jsx)(c.CloseOutlined,{}),label:`Rejected`},reopened:{tone:`neutral`,icon:(0,l.jsx)(c.UndoOutlined,{}),label:`Reopened`},deleted:{tone:`danger`,icon:(0,l.jsx)(c.DeleteOutlined,{}),label:`Deleted`},status:{tone:`warning`,icon:(0,l.jsx)(c.SwapOutlined,{}),label:`Status changed`},document:{tone:`info`,icon:(0,l.jsx)(c.PaperClipOutlined,{}),label:`Document`},scheduled:{tone:`warning`,icon:(0,l.jsx)(c.ClockCircleOutlined,{}),label:`Scheduled`},default:{tone:`neutral`,icon:(0,l.jsx)(c.HistoryOutlined,{}),label:`Activity`}},Sc=[[/\b(?:submitted|sent|send)\b[\s\S]*\b(?:cfo|finance)\b[\s\S]*\bfor approval\b/i,`sendForApproval`],[/\bsend(?:ing)?\s+for\s+approval\b/i,`sendForApproval`],[/\breject/i,`rejected`],[/\bresent\b/i,`resent`],[/\bresubmit/i,`resubmitted`],[/\bapprov/i,`approved`],[/\bsubmit/i,`submitted`],[/\breassign|\bassign/i,`assigned`],[/\bdelete|\bremov/i,`deleted`],[/\breopen/i,`reopened`],[/\bstatus/i,`status`],[/\bdocument|\battach|\bupload/i,`document`],[/\bnote/i,`note`],[/\bupdat|\bchang|\bedit/i,`updated`],[/\bcreat|\badded\b/i,`created`]];function Cc(e,t){let n=String(e||``).trim().toLowerCase();if(n&&bc[n])return bc[n];let r=String(t||``);for(let[e,t]of Sc)if(e.test(r))return t;return`default`}function wc(e={},t=``){return xc[Cc(e.activityType??e.activity_type??e.type??e.action,t||e.activityComments)]??xc.default}function Tc(e=``){if(typeof document>`u`)return String(e);let t=document.createElement(`div`);return t.innerHTML=e,t.textContent||t.innerText||``}var Ec=[{id:`a1`,activityTime:new Date().toISOString(),activityComments:`Job <b>created</b> and assigned to the recruitment team.`},{id:`a2`,activityTime:new Date(Date.now()-1728e5).toISOString(),activityComments:`Status changed to <b>Active</b>.`}];function Dc({activity:e,grouped:t=!0}){let n=(0,o.useMemo)(()=>Array.isArray(e)?e:Ec,[e]);return(0,l.jsx)(`div`,{className:`znx-an-body`,children:(0,l.jsx)(`div`,{className:`znx-an-scroll`,children:(0,l.jsx)(yc,{rows:n,grouped:t,getTime:e=>e.activityTime??e.createdAt,getKey:(e,t)=>e.id??e._id??t,emptyText:`No activity here.`,getMeta:e=>wc(e,e.activityComments),renderBody:e=>{let t=wc(e,e.activityComments);return(0,l.jsxs)(`div`,{className:`znx-an-comment`,children:[(0,l.jsx)(`span`,{className:`znx-an-tag znx-an-tag--${t.tone}`,children:t.label}),Tc(e.activityComments)]})}})})})}function Oc(e){let t=e?.user_name??e?.userName??e?.username,n=`${e?.first_name??e?.firstName??``} ${e?.last_name??e?.lastName??``}`.trim(),r=e?.email??``,i=t??n.replace(/\s+/g,``)??r??String(e?.user_id??e?.id??``),a=[t,n,r].filter(Boolean).join(` - `)||String(i);return{value:String(i),label:a}}var kc=[{id:`n1`,createdAt:new Date().toISOString(),author:`You`,notes:`Shortlisted 3 candidates, sharing profiles with @Hiring Manager today.`}];function Ac(e=``){return e.split(/(\s+)/).map((e,t)=>e.startsWith(`@`)&&e.length>1?(0,l.jsx)(`span`,{className:`znx-an-mention`,children:e},t):(0,l.jsx)(`span`,{children:e},t))}function jc({notes:e,users:t=[],onAddNote:n,allowAddNote:r=!0}){let[i]=s.Form.useForm(),[a,c]=(0,o.useState)(()=>Array.isArray(e)?e:kc),[u,d]=(0,o.useState)(!1),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(!1),g=(0,o.useRef)(null),_=Array.isArray(e)?e:a,v=(0,o.useMemo)(()=>t.map(e=>({value:e.display??e.value,label:e.display??e.label})),[t]),y=f??v;return(0,l.jsxs)(`div`,{className:`znx-an-body`,children:[r&&(0,l.jsxs)(s.Form,{form:i,onFinish:async({note:e})=>{let t=(e??``).trim();if(t){d(!0);try{n?await n(t):c(e=>[{id:`local-${Date.now()}`,createdAt:new Date().toISOString(),author:`You`,notes:t},...e]),i.resetFields(),s.message.success(`Notes added successfully`)}catch{s.message.error(`Something went wrong, please try again.`)}finally{d(!1)}}},className:`znx-an-composer`,children:[(0,l.jsx)(s.Form.Item,{name:`note`,rules:[{required:!0,message:`Notes is required`}],style:{marginBottom:0},children:(0,l.jsx)(s.Mentions,{rows:3,prefix:`@`,options:y,loading:m,filterOption:!1,onSearch:e=>{clearTimeout(g.current),h(!0),g.current=setTimeout(()=>{zn(e).then(e=>{let t=Array.isArray(e)?e:e?.items??e?.list??e?.data??[];p(t.map(Oc))}).catch(()=>p([])).finally(()=>h(!1))},300)},placeholder:`Add your notes on the job, use '@' to mention`})}),(0,l.jsx)(`div`,{className:`znx-an-composer-actions`,children:(0,l.jsx)(s.Button,{type:`primary`,size:`small`,htmlType:`submit`,loading:u,children:`Post`})})]}),(0,l.jsx)(`div`,{className:`znx-an-scroll`,children:(0,l.jsx)(yc,{rows:_,getTime:e=>e.createdAt??e.activityTime,getKey:(e,t)=>e.id??e._id??t,getAuthor:e=>e.createdByName||e.author||``,emptyText:`No notes here.`,renderBody:e=>(0,l.jsx)(`div`,{className:`znx-an-comment`,children:Ac(e.notes)})})})]})}function Mc({moduleName:e,id:t,users:r=[],showActivity:i=!0,showNotes:a=!0,allowAddNote:c=!0,defaultActiveKey:u=`activity`,refreshKey:d=0,className:f=``}){let[p,m]=(0,o.useState)(null),[h,g]=(0,o.useState)(null);(0,o.useEffect)(()=>{if(!e||!t)return;let r=!1;async function o(){let[o,s]=await Promise.all([i?n.un(e,t).catch(()=>[]):Promise.resolve(null),a?n.pn(t).catch(()=>[]):Promise.resolve(null)]);r||(m(o),g(s))}return o(),()=>{r=!0}},[e,t,i,a,d]);let _=(0,o.useCallback)(async r=>{if(!t)return;await n.ln({relatedId:t,notes:r,notesFor:e});let[a,o]=await Promise.all([n.pn(t).catch(()=>[]),i?n.un(e,t).catch(()=>[]):Promise.resolve(p)]);g(a),i&&m(o)},[t,e,i,p]),v=[i&&{key:`activity`,title:`Activity`,count:Array.isArray(p)?p.length:void 0,children:(0,l.jsx)(Dc,{activity:p})},a&&{key:`notes`,title:`Notes`,count:Array.isArray(h)?h.length:void 0,children:(0,l.jsx)(jc,{notes:h,users:r,allowAddNote:c,onAddNote:t?_:void 0})}].filter(Boolean),y=v.some(e=>e.key===u)?u:v[0]?.key,[b,x]=(0,o.useState)(y);return(0,l.jsx)(s.Card,{className:[`znx-an-card`,f].filter(Boolean).join(` `),styles:{body:{padding:0}},children:(0,l.jsx)(P,{className:`znx-an-tabs`,tabs:v,activeKey:b,onChange:x})})}Mc.propTypes={moduleName:f.default.string,id:f.default.string,users:f.default.array,showActivity:f.default.bool,showNotes:f.default.bool,allowAddNote:f.default.bool,defaultActiveKey:f.default.string,refreshKey:f.default.oneOfType([f.default.number,f.default.string]),className:f.default.string};function Nc({assignees:e,extraAssignees:t}){return(0,l.jsxs)(s.Avatar.Group,{maxCount:3,size:`small`,children:[e.map((e,t)=>(0,l.jsx)(s.Tooltip,{title:e.initials,children:(0,l.jsx)(s.Avatar,{size:`small`,style:{backgroundColor:e.color,fontSize:10,fontWeight:600,cursor:`default`},children:e.initials})},t)),t>0&&(0,l.jsxs)(s.Avatar,{size:`small`,style:{backgroundColor:`#d9d9d9`,color:`#555`,fontSize:10},children:[`+`,t]})]})}var Pc=[`.xlsx`,`.xls`,`.csv`],Fc=10,Ic={".xlsx":[`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],".xls":[`application/vnd.ms-excel`],".csv":[`text/csv`,`application/csv`,`text/plain`]},Lc=[{test:(e,t)=>e===`.pdf`||t===`application/pdf`,label:`PDF`},{test:(e,t)=>t.startsWith(`image/`)||[`.jpg`,`.jpeg`,`.png`,`.gif`,`.webp`,`.heic`,`.bmp`,`.svg`].includes(e),label:`Image`},{test:e=>[`.doc`,`.docx`].includes(e),label:`Word document`},{test:e=>[`.zip`,`.rar`,`.7z`].includes(e),label:`Archive`},{test:e=>[`.txt`,`.json`,`.xml`].includes(e),label:`Plain text`}];function Rc(e=``){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t).toLowerCase()}function zc(e=0){return e<1024?`${e} B`:e<1048576?`${Math.ceil(e/1024)} KB`:`${(e/1048576).toFixed(1)} MB`}function Bc(e=Pc){let t=e.map(e=>e.toLowerCase());return t.concat(t.flatMap(e=>Ic[e]??[])).join(`,`)}function Vc(e,{accept:t=Pc,maxSizeMB:n=10}={}){if(!e)return`No file selected.`;let r=Rc(e.name),i=(e.type||``).toLowerCase(),a=t.map(e=>e.toLowerCase()),o=a.join(`, `);if(!r)return`"${e.name}" has no file extension. Only ${o} files are allowed.`;if(!a.includes(r)){let e=Lc.find(e=>e.test(r,i));return e?`${e.label} files are not supported. Only ${o} files are allowed.`:`"${r}" files are not supported. Only ${o} files are allowed.`}let s=Ic[r];return i&&s&&!s.includes(i)?`"${e.name}" is not a real ${r} file (detected ${i}). Re-save it from Excel and try again.`:e.size===0?`"${e.name}" is empty. Fill in at least one row before uploading.`:e.size>n*1024*1024?`File is ${zc(e.size)}. The limit is ${n} MB.`:null}function Hc(){return(0,l.jsxs)(`svg`,{className:`bulk-upload-art`,viewBox:`0 0 72 72`,focusable:`false`,"aria-hidden":`true`,children:[(0,l.jsx)(`rect`,{x:`12`,y:`6`,width:`36`,height:`48`,rx:`5`,className:`bulk-upload-art__sheet`}),(0,l.jsx)(`path`,{d:`M20 20h20M20 28h20M20 36h12`,className:`bulk-upload-art__lines`}),(0,l.jsx)(`circle`,{cx:`50`,cy:`48`,r:`15`,className:`bulk-upload-art__badge`}),(0,l.jsx)(`path`,{d:`M50 55V41m0 0-6 6m6-6 6 6`,className:`bulk-upload-art__arrow`})]})}function Uc({title:e,description:t,breadcrumbItems:r,backTo:i,backLabel:a=`Back`,templateLabel:u=`Download Sample Template`,templateTitle:f=`Sample template`,templateHint:p=`Pre-filled with the exact column names the importer expects. Do not rename or reorder the columns.`,instructions:m=[],accept:h=Pc,maxSizeMB:g=10,onDownloadTemplate:_,onUpload:v,renderResult:y,extraSidebar:b}){let x=(0,o.useRef)(null),[S,C]=(0,o.useState)(!1),[w,T]=(0,o.useState)(!1),[E,D]=(0,o.useState)(!1),[O,k]=(0,o.useState)(null),[A,j]=(0,o.useState)(null),[M,N]=(0,o.useState)(null),[P,F]=(0,o.useState)(0),I=(0,o.useMemo)(()=>h.map(e=>e.toLowerCase()),[h]),L=(0,o.useMemo)(()=>Bc(I),[I]),R=(0,o.useCallback)(()=>{k(null),j(null),N(null),C(!1),F(e=>e+1)},[]),z=(0,o.useCallback)(async()=>{if(_){T(!0);try{await _(),s.message.success(`Sample template downloaded.`)}catch(e){s.message.error(e?.message||`Could not download the template.`)}finally{T(!1)}}},[_]),B=(0,o.useCallback)(async e=>{if(!e||E)return;F(e=>e+1);let t=Vc(e,{accept:I,maxSizeMB:g});if(t){k(null),N(null),j(t);return}j(null),N(null),k({name:e.name,size:e.size}),D(!0);try{let t=await v(e);N(t)}catch(e){j(e?.message||`Upload failed. Please try again.`)}finally{D(!1)}},[I,g,v,E]),V=()=>{E||x.current?.click()},H=[`bulk-upload-dropzone`,S?`is-dragging`:``,E?`is-busy`:``,A?`is-error`:``,M&&!A?`is-done`:``].filter(Boolean).join(` `);return(0,l.jsxs)(`div`,{className:`bulk-upload-panel`,children:[r?.length?(0,l.jsx)(`div`,{className:`bulk-upload-breadcrumb`,children:(0,l.jsx)(n.t,{items:r})}):null,(0,l.jsxs)(`div`,{className:`bulk-upload-frame`,children:[(0,l.jsxs)(`header`,{className:`bulk-upload-header`,children:[(0,l.jsx)(`div`,{className:`bulk-upload-header__icon`,"aria-hidden":`true`,children:(0,l.jsx)(c.FileExcelOutlined,{})}),(0,l.jsxs)(`div`,{className:`bulk-upload-header__text`,children:[(0,l.jsx)(`h1`,{className:`bulk-upload-header__title`,children:e}),t?(0,l.jsx)(`p`,{className:`bulk-upload-header__desc`,children:t}):null]}),i?(0,l.jsx)(d.Link,{className:`bulk-upload-header__back`,to:i,children:(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.ArrowLeftOutlined,{}),children:a})}):null]}),(0,l.jsxs)(`div`,{className:`bulk-upload-grid`,children:[(0,l.jsxs)(`section`,{className:`bulk-upload-card bulk-upload-card--drop`,children:[(0,l.jsxs)(`div`,{className:`bulk-upload-card__head`,children:[(0,l.jsx)(`span`,{className:`bulk-upload-step`,children:`Step 2`}),(0,l.jsx)(`h2`,{className:`bulk-upload-card__title`,children:`Upload the filled file`})]}),(0,l.jsxs)(`div`,{role:`button`,tabIndex:E?-1:0,"aria-disabled":E,"aria-label":`Upload the filled file — click to browse, or drop a file here`,className:H,onClick:V,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),V())},onDragOver:e=>{e.preventDefault(),E||C(!0)},onDragLeave:()=>C(!1),onDrop:e=>{e.preventDefault(),C(!1),B(e.dataTransfer.files?.[0])},children:[(0,l.jsx)(Hc,{}),(0,l.jsx)(`p`,{className:`bulk-upload-dropzone__title`,children:S?`Drop the file to start uploading`:`Drag & drop your file here`}),(0,l.jsxs)(`p`,{className:`bulk-upload-dropzone__sub`,children:[`or `,(0,l.jsx)(`span`,{className:`bulk-upload-dropzone__link`,children:`browse from your computer`})]}),(0,l.jsxs)(`div`,{className:`bulk-upload-chips`,children:[I.map(e=>(0,l.jsx)(s.Tag,{className:`bulk-upload-chip bulk-upload-chip--ok`,children:e},e)),(0,l.jsx)(s.Tooltip,{title:`These file types are rejected before upload`,children:(0,l.jsx)(s.Tag,{className:`bulk-upload-chip bulk-upload-chip--no`,children:`.pdf .jpg .png not allowed`})})]}),(0,l.jsxs)(`p`,{className:`bulk-upload-dropzone__limit`,children:[`Maximum size `,g,` MB`]})]}),(0,l.jsx)(`input`,{ref:x,hidden:!0,type:`file`,accept:L,onChange:e=>B(e.target.files?.[0])},P),O?(0,l.jsxs)(`div`,{className:`bulk-upload-file ${A?`is-error`:``}`,children:[(0,l.jsx)(`span`,{className:`bulk-upload-file__icon`,children:E?(0,l.jsx)(c.FileExcelOutlined,{}):A?(0,l.jsx)(c.CloseCircleFilled,{}):(0,l.jsx)(c.CheckCircleFilled,{})}),(0,l.jsxs)(`span`,{className:`bulk-upload-file__meta`,children:[(0,l.jsx)(`span`,{className:`bulk-upload-file__name`,title:O.name,children:O.name}),(0,l.jsxs)(`span`,{className:`bulk-upload-file__size`,children:[zc(O.size),E?` · uploading…`:A?` · failed`:` · processed`]})]}),E?null:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:M?(0,l.jsx)(c.ReloadOutlined,{}):(0,l.jsx)(c.DeleteOutlined,{}),onClick:R,children:M?`Upload another`:`Remove`})]}):null,E?(0,l.jsx)(s.Progress,{percent:99,status:`active`,showInfo:!1,size:`small`,className:`bulk-upload-progress`}):null,A?(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,className:`bulk-upload-alert`,title:`File not accepted`,description:A}):null]}),(0,l.jsxs)(`aside`,{className:`bulk-upload-side`,children:[(0,l.jsxs)(`section`,{className:`bulk-upload-card bulk-upload-card--template`,children:[(0,l.jsxs)(`div`,{className:`bulk-upload-card__head`,children:[(0,l.jsx)(`span`,{className:`bulk-upload-step`,children:`Step 1`}),(0,l.jsx)(`h2`,{className:`bulk-upload-card__title`,children:f})]}),(0,l.jsx)(`p`,{className:`bulk-upload-side__hint`,children:p}),(0,l.jsx)(s.Button,{block:!0,icon:(0,l.jsx)(c.DownloadOutlined,{}),loading:w,onClick:z,className:`bulk-upload-template-btn`,children:u})]}),m.length?(0,l.jsxs)(`section`,{className:`bulk-upload-card bulk-upload-card--rules`,children:[(0,l.jsx)(`h2`,{className:`bulk-upload-card__title`,children:`Before you upload`}),(0,l.jsx)(`ul`,{className:`bulk-upload-rules`,children:m.map(e=>(0,l.jsx)(`li`,{children:e},e))})]}):null,b]})]}),M&&y?(0,l.jsx)(`div`,{className:`bulk-upload-result`,children:y(M,{reset:R})}):null]})]})}var Wc=e.t({getJobById:()=>Qc,getJobDetailView:()=>Gc,updateJobDescription:()=>$c});async function Gc(e){let n=await t.a(),r=new URLSearchParams({jobId:String(e)}),i=await fetch(`${t.T}/jobs?${r}`,{method:`GET`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`}});if(!i.ok)throw Error(`API ${i.status}: ${i.statusText}`);let a=await i.json();return a.data??a}var Kc={email:`zinnext@realtekconsulting.net`,user_pwd:`Admin@123*`},qc=null;async function Jc(){return qc||(qc=fetch(`${t.x}/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Kc)}).then(async e=>{if(!e.ok)throw Error(`Login failed: ${e.status}`);let t=await e.json(),n=t.token??t.access_token??t.data?.token??t.data?.access_token;if(!n)throw Error(`No token in login response`);return localStorage.setItem(`authToken`,n),n}).finally(()=>{qc=null}),qc)}async function Yc(){return(t.u()??localStorage.getItem(`authToken`))||Jc()}async function Xc(e){let n=await Yc(),r=await fetch(`${t.x}${e}`,{headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`}});if(r.status===401&&(localStorage.removeItem(`authToken`),n=await Jc(),r=await fetch(`${t.x}${e}`,{headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`}})),!r.ok)throw Error(`API ${r.status}: ${r.statusText}`);let i=await r.json();return i.data??i}async function Zc(e,n){let r=await Yc(),i=await fetch(`${t.x}${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${r}`},body:JSON.stringify(n)});if(i.status===401&&(localStorage.removeItem(`authToken`),r=await Jc(),i=await fetch(`${t.x}${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${r}`},body:JSON.stringify(n)})),!i.ok)throw Error(`API ${i.status}: ${i.statusText}`);return i.json()}async function Qc(e){return Xc(`/jobs/${e}`)}async function $c(e,t){return Zc(`/jobs/${e}`,{rawDescription:t})}var{Text:el}=s.Typography,tl=2;function nl({jobId:e,sections:t=[],meta:n=[],rawDescription:r=``,onSaved:i}){let[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(!1),[p,m]=(0,o.useState)(``),[h,g]=(0,o.useState)(!1),_=[...t].sort((e,t)=>(e.displayOrder??0)-(t.displayOrder??0)),v=a?_:_.slice(0,tl),y=_.length>tl;function b(){m(r),f(!0)}function x(){f(!1),m(``)}async function S(){if(!p.trim()){s.message.warning(`Please enter a job description`);return}g(!0);try{await $c(e,p.trim());let t=await Qc(e);i?.(t),f(!1),m(``),s.message.success(`Description updated successfully`)}catch{s.message.error(`Failed to update description`)}finally{g(!1)}}return d?(0,l.jsxs)(s.Space,{direction:`vertical`,style:{width:`100%`},size:8,children:[(0,l.jsx)(s.Input.TextArea,{rows:10,value:p,onChange:e=>m(e.target.value),placeholder:`Paste raw job description here...`}),(0,l.jsxs)(s.Space,{children:[(0,l.jsx)(s.Button,{type:`primary`,loading:h,onClick:S,children:`Save & Parse`}),(0,l.jsx)(s.Button,{onClick:x,children:`Cancel`})]})]}):(0,l.jsxs)(`div`,{className:`desc-block`,children:[(0,l.jsx)(`div`,{className:`desc-block-toolbar`,children:(0,l.jsx)(c.EditOutlined,{className:`desc-edit-icon`,onClick:b})}),!t.length&&!n.length?(0,l.jsx)(el,{type:`secondary`,children:`No description available.`}):(0,l.jsxs)(`div`,{className:`jdv-ats-desc`,children:[n.length>0&&(0,l.jsx)(`div`,{className:`jdv-ats-meta-grid`,children:n.map(({fieldKey:e,fieldLabel:t,value:n})=>(0,l.jsxs)(`div`,{className:`jdv-ats-meta-row`,children:[(0,l.jsx)(`span`,{className:`jdv-ats-meta-key`,children:t}),(0,l.jsx)(`span`,{className:`jdv-ats-meta-val`,children:n})]},e))}),(0,l.jsx)(`div`,{className:`jdv-ats-sections`,children:v.map(({sectionKey:e,sectionTitle:t,renderType:n,content:r=[]})=>n===`education`?(0,l.jsxs)(`div`,{className:`education-block`,children:[(0,l.jsxs)(`div`,{className:`education-header`,children:[(0,l.jsx)(`span`,{children:`🎓`}),(0,l.jsx)(`span`,{children:t})]}),(0,l.jsx)(`ul`,{className:`education-list`,children:r.map((e,t)=>(0,l.jsx)(`li`,{className:`education-list-item`,children:e},t))})]},e):(0,l.jsxs)(`div`,{className:`jdv-ats-section`,children:[(0,l.jsx)(`div`,{className:`jdv-ats-section-hd`,children:(0,l.jsx)(`span`,{children:t})}),n===`chips`?(0,l.jsx)(s.Space,{size:[6,6],wrap:!0,style:{marginTop:8},children:r.map((e,t)=>(0,l.jsx)(s.Tag,{className:`jdv-skill-tag`,children:e},t))}):(0,l.jsx)(`ul`,{className:`jdv-ats-bullets`,children:r.map((e,t)=>(0,l.jsx)(`li`,{className:`jdv-ats-bullet-item`,children:e},t))})]},e))}),y&&(0,l.jsx)(`span`,{className:`jdv-desc-toggle`,onClick:()=>u(e=>!e),children:a?`Show less`:`Show more (${t.length-tl} more sections)`})]})]})}function rl(){return Number(localStorage.getItem(`userId`))||0}function il(e,{id:t,moduleName:n,record:r}={}){let i=(0,o.useMemo)(()=>Array.isArray(e)?e:[],[e]),a=(0,o.useMemo)(()=>i.filter(e=>typeof e?.visibleWhen==`function`),[i]),[s,c]=(0,o.useState)({});return(0,o.useEffect)(()=>{if(!a.length)return;let e=!1,i={id:t,moduleName:n,record:r,currentUserId:rl()};return a.forEach(n=>{let r=`${t}:${n.key}`;Promise.resolve().then(()=>n.visibleWhen(i)).then(t=>{e||c(e=>({...e,[r]:t!==!1}))}).catch(()=>{e||c(e=>({...e,[r]:!0}))})}),()=>{e=!0}},[a,t,n,r]),(0,o.useMemo)(()=>i.filter(e=>typeof e?.visibleWhen!=`function`||s[`${t}:${e.key}`]===!0),[i,s,t])}var al=[{field:`baId`,label:`BA`,icon:`idcard`},{field:`clientName`,icon:`bank`,tooltip:`Client`},{field:`employerName`,icon:`team`,badgeField:`engagementType`,tooltip:`Employer`},{field:`projectName`,icon:`project`,tooltip:`Project`},{field:`batchPriority`,icon:`idcard`,tooltip:`Priority`},{field:`paymentTermsLabel`,icon:`cycle`,tooltip:`Payment Terms`},{field:`paymentDeadlineLabel`,icon:`period`,tooltip:`Payment Deadline`},{field:`batchName`,icon:`project`,tooltip:`Payment Batch`},{field:`period.label`,icon:`period`,tooltip:`Period`}],ol=e.t({billingConfig:()=>sl,default:()=>sl}),sl={module:`billing`,tabs:[],header:{variant:`finance`,title:`candidateName`,eyebrow:`designation`,statusField:`billing.status`,chips:al}},cl={USD:`$`,INR:`₹`,EUR:`€`,GBP:`£`,AUD:`$`,CAD:`$`},ll=e=>e==null||e===``||Array.isArray(e)&&e.length===0,ul=e=>!ll(e);function dl(e){let t=pl(e);return t.charAt(0).toUpperCase()+t.slice(1)}function fl(e){return e&&typeof e==`object`&&!Array.isArray(e)&&`id`in e&&`value`in e?e.id??e.value:e}function pl(e){return Array.isArray(e)?e.filter(e=>!ll(e)).map(e=>pl(e)).filter(Boolean).join(`, `):e&&typeof e==`object`&&`id`in e&&`value`in e?String(e.value??e.id??``):String(e??``)}function ml(e){return ll(e)?``:cl[String(e).toUpperCase()]??String(e)}function hl(e){return ll(e)?``:n.An(e)}function gl({start:e,end:t,sym:n=``,unit:r}={}){return ll(e)||Number(e)<=0?``:`${n}${!ll(t)&&Number(t)>0?`${e} - ${t}`:`${e}`}${ll(r)?``:`/${r}`}`}function _l(e){let t=pl(e).toLowerCase();return[`active`,`open`,`hired`,`approved`,`fulfilled`,`submitted`].includes(t)?`success`:[`inactive`,`closed`,`rejected`,`high`].includes(t)?`error`:[`hold`,`on hold`,`pending`,`unread`,`medium`].includes(t)?`warning`:`default`}var vl=e.t({candidateConfig:()=>yl,default:()=>yl}),yl={module:`candidate`,tabs:[{key:`details`,label:`Details`},{key:`jobs`,label:`Jobs`},{key:`emails`,label:`Emails`},{key:`attachments`,label:`Attachments`}],header:{title:[`firstName`,`middleName`,`lastName`],eyebrow:`source`,status:({val:e,has:t})=>t(e(`status`))?{label:dl(e(`status`)),color:_l(e(`status`))}:e(`applicantPlacedStatus`)===!0?{label:`Placed`,color:`success`}:null,ids:[{label:`Candidate ID`,field:[`applicantRefrenceId`,`applicantReferenceId`,`candidateReferenceId`]}],meta:[{icon:`designation`,field:`designation`},{icon:`location`,field:[`currentLocation`,`preferredLocation`]},{icon:`experience`,compute:bl},{icon:`employment`,field:`workAuthorisation`},{icon:`rate`,prefix:`Expected: `,compute:xl}],timestamp:{label:`Created Date`,field:[`createdAt`,`createdDate`]}}};function bl({val:e,has:t}){let n=t(e(`yearOfExperience`))?e(`yearOfExperience`):e(`experience`);if(!t(n))return``;let r=e(`monthOfExperience`);return`${n} yrs${t(r)&&Number(r)>0?` ${r} mo`:``}`}function xl({val:e}){let t=e(`expectedPayDetails`)??{};return gl({start:t.expectedPay??e(`expectedPay`),sym:t.expectedPayCurrencySymbol??ml(t.expectedPayCurrency),unit:t.expectedPayUnit})}var Sl=e.t({default:()=>Cl,employerConfig:()=>Cl}),Cl={module:`employer`,header:{title:`empCompanyName`,eyebrow:`empWebsite`,status:({val:e,has:t})=>t(e(`status`))?{label:dl(e(`status`)),color:_l(e(`status`))}:null,ids:[{label:`Federal Tax ID`,field:`empFederalTaxId`},{label:`State of Incorporation`,field:`empStateOfIncorporation`}],meta:[{icon:`location`,field:`empCompanyLocation`}],timestamp:{label:`Created Date`,field:[`createdAt`,`createdDate`]}}},wl=e=>e===!0||e===1||e===`1`;function Tl(e){return e==null||e===``?!0:Array.isArray(e)?e.length===0:typeof e==`object`&&Object.values(e).every(e=>Tl(e))}function El(e){return n.Lt(e).filter(e=>e?.location||e?.url)}function Dl(e){return El(e).length>0}function Ol(e){return wl(e?.hideWhenEmpty)||wl(e?.hideWhenEmptyInDetail)||wl(e?.renderOptions?.hideWhenEmpty)||wl(e?.renderOptions?.hideWhenEmptyInDetail)}function kl(e){return wl(e?.hideWhenZero)||wl(e?.renderOptions?.hideWhenZero)}function Al(e){if(typeof e==`number`)return e===0;if(typeof e==`string`){let t=e.trim();return t!==``&&Number.isFinite(Number(t))&&Number(t)===0}return!1}function jl(e,t){let n=kl(e);return!Ol(e)&&!n?!1:e?.type===`file`||e?.type===`document`||e?.renderType===`document`?!Dl(t):Tl(t)||n&&Al(t)}var Ml=e=>e===!0||e===1||e===`1`;function Nl(e=[]){let t={};for(let n of e??[])for(let e of n?.fields??[]){if(!e?.field||e.value===void 0)continue;let n=e.value,r=n&&typeof n==`object`&&!Array.isArray(n)&&`value`in n?n.value:n;t[e.field]=r,e.payloadKey&&t[e.payloadKey]===void 0&&(t[e.payloadKey]=r)}return t}function Pl(e,t){let r=n.c(e?.showIf);return!r.length||Ml(e?.ignoreShowIfInDetail)||!r.every(e=>Object.prototype.hasOwnProperty.call(t??{},e.field))?!0:n.o(e.showIf,e=>t[e])}function Fl(e){let t=e?.detailLabelWhen;if(Array.isArray(t)&&t.length)return t;let n=e?.labelWhen;return n?[n]:[]}function Il(e,t){let r=e?.label;if(Ml(e?.ignoreLabelWhenInDetail))return r;for(let r of Fl(e))if(!(!r?.field||!r?.label)&&Object.prototype.hasOwnProperty.call(t??{},r.field)&&n.i(r,t[r.field]))return r.label;return r}var Ll=/(currency|symbol|unit|type)/i,Rl=/(rate|budget|amount)/i,zl=e=>typeof e==`number`||typeof e==`string`&&e.trim()!==``&&!Number.isNaN(Number(e)),Bl=e=>e===!0||e===1||e===`1`;function Vl(e,t){return!e||!t||!Bl(e.appendHistory)?!1:[e.historyField,...e.historyFields??[]].includes(t)}function Hl(e,t){let n=String(t??``).trim();if(!n)return``;let r=`${e}.`;return n.startsWith(r)?n.slice(r.length):n}function Ul(e,t=[]){let n=`${e}.`,r=[];return(t??[]).forEach(t=>{Vl(t,e)&&(t.fields??[]).forEach(e=>{let t=String(e?.field??``);if(!t.startsWith(n))return;let i=t.slice(n.length);i&&!r.includes(i)&&r.push(i)})}),r}function Wl(e,t=[],n){for(let r of t??[]){if(!Vl(r,e))continue;let t=Hl(e,r?.[n]?.[e]);if(t)return t}return``}var Gl=(e,t)=>!!t&&e!=null&&Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0;function Kl(e){let t=Object.entries(e??{}).find(([e,t])=>Rl.test(e)&&!Ll.test(e)&&zl(t));return t?t[0]:``}function ql(e){let t=Object.keys(e??{});return t.find(t=>/currencysymbol/i.test(t)&&String(e[t]??``).trim()!==``)||t.find(t=>/currency/i.test(t)&&String(e[t]??``).trim()!==``)||t.find(t=>/symbol/i.test(t)&&String(e[t]??``).trim()!==``)||``}function Jl(e){return Object.keys(e??{}).find(e=>/unit/i.test(e))||``}function Yl(e,t,n=[]){let r=Ul(t,n),i=Wl(t,n,`historyAmountFields`),a=r.find(e=>!Ll.test(e)),o=Gl(e,i)&&i||Gl(e,a)&&a||Kl(e),s=Wl(t,n,`historyCurrencyFields`),c=r.find(t=>/symbol/i.test(t)&&Gl(e,t)&&String(e[t]??``).trim()!==``),l=r.find(e=>/currency/i.test(e)&&!/symbol/i.test(e)),u=Gl(e,s)&&s||c||Gl(e,l)&&l||ql(e),d=Wl(t,n,`historyUnitFields`),f=r.find(e=>/unit/i.test(e)),p=Gl(e,d)&&d||Gl(e,f)&&f||Jl(e);return{amountKey:o||``,currencyKey:u||``,unitKey:p||``}}function Xl(e,t,n=[]){let{amountKey:r,currencyKey:i,unitKey:a}=Yl(e,t,n);return{amountKey:r,currencyKey:i,unitKey:a,amount:r?e?.[r]:void 0,currency:i?e?.[i]:``,unit:a?e?.[a]:``}}var Zl={USD:`$`,INR:`₹`,GBP:`£`,EUR:`€`,CAD:`C$`,AUD:`A$`,SGD:`S$`,JPY:`¥`};function Ql(e,t=`$`){let n=String(e??``).trim();return n?Zl[n.toUpperCase()]||(/^[A-Za-z]{2,}$/.test(n)?t:n):t}var $l={hr:`Hourly`,hour:`Hourly`,hours:`Hourly`,hourly:`Hourly`,day:`Daily`,daily:`Daily`,week:`Weekly`,weekly:`Weekly`,month:`Monthly`,monthly:`Monthly`,year:`Yearly`,yearly:`Yearly`,annual:`Yearly`,annually:`Yearly`};function eu(e,t=``){let n=String(e??``).trim();return n?$l[n.toLowerCase()]??n.charAt(0).toUpperCase()+n.slice(1):t}var tu={Hourly:`hr`,Daily:`day`,Weekly:`wk`,Monthly:`mo`,Yearly:`yr`};function nu(e,t=``){let n=eu(e,``);return n?tu[n]??n.toLowerCase():t}function ru(e){if(typeof e==`number`)return Number.isFinite(e)?e:NaN;let t=String(e??``).trim().replace(/[,\s]/g,``).replace(/[^0-9eE+.\-]/g,``);if(!t)return NaN;let n=Number(t);return Number.isFinite(n)?n:NaN}function iu(e,{decimals:t}={}){let n=ru(e);return Number.isNaN(n)?String(e??``):n.toLocaleString(void 0,{minimumFractionDigits:t??0,maximumFractionDigits:t??2})}function au(e,t=`$`,n={}){let r=ru(e);if(Number.isNaN(r))return String(e??``);let i=Ql(t);return`${r<0?`−`:``}${i}${iu(Math.abs(r),n)}`}function ou(e,t=`$`,n,r={}){let i=au(e,t,r),a=eu(n,``);return a?`${i} / ${a}`:i}var su=Object.freeze({document:`No document uploaded`,documents:`No documents uploaded`,date:`Not provided`,phone:`No contact number added`,email:`No email address added`,link:`No link added`,url:`No link added`,tags:`None added`,multitag:`None added`,skills:`No skills added`,currency:`Not provided`,money:`Not provided`,number:`Not provided`,boolean:`Not specified`,default:`Not provided`}),cu=e=>{let t=e==null?``:String(e).trim();return t===``?null:t};function lu(e,t,r=n.zn()){let i=cu(e?.emptyText??e?.renderOptions?.emptyText);if(i)return i;let a=String(t??e?.renderType??e?.type??`default`).toLowerCase(),o=r?.emptyTexts??{};return cu(o[a])??cu(su[a])??cu(o.default)??cu(su.default)??cu(r?.emptyPlaceholder)??`—`}function uu(e,t=n.zn()){let r=cu(e?.emptyText);if(r)return r;let i=t?.emptyTexts??{};if(cu(i.group))return cu(i.group);let a=cu(e?.label??e?.name);return a?`No ${a.toLowerCase()} added`:cu(su.default)??`—`}var{Text:du}=s.Typography,fu=e=>e==null||e===``,pu=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}|$)/;function mu(e){return String(e).replace(/\w\S*/g,e=>e.length>1&&e===e.toUpperCase()?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())}function hu(e){return!(typeof e!=`string`||!e.trim()||!/[a-z]/i.test(e)||e.includes(`@`)||/^https?:\/\//i.test(e)||/^[a-f0-9]{24}$/i.test(e)||/<[a-z][\s\S]*>/i.test(e))}function gu(e,t){if(fu(e))return``;let n=String(e);return t===!1?n:hu(n)?mu(n):n}function _u(e,t,n){return Object.values(e).filter(e=>!fu(e)&&typeof e!=`object`).map(e=>gu(e,t)).join(n)}function vu(e,t){if(!e)return e;switch(t){case`upper`:return String(e).toUpperCase();case`lower`:return String(e).toLowerCase();case`title`:return mu(e);default:return e}}var yu=e=>e&&typeof e==`object`&&!Array.isArray(e)&&`value`in e&&`id`in e;function bu(e,t,n){return fu(e)?``:yu(e)?gu(e.value??e.id,t):Array.isArray(e)?e.map(e=>yu(e)?gu(e.value??e.id,t):e&&typeof e==`object`?_u(e,t,n):gu(e,t)).filter(Boolean).join(n):typeof e==`boolean`?e?`Yes`:`No`:typeof e==`object`?_u(e,t,n):gu(e,t)}function xu(e,t,n){if(Array.isArray(e))return e.map(e=>yu(e)?gu(e.value??e.id,t):e&&typeof e==`object`?_u(e,t,n):gu(e,t)).filter(e=>e!==``);if(typeof e==`string`)return e.split(`,`).map(e=>gu(e.trim(),t)).filter(Boolean);let r=bu(e,t,n);return r?[r]:[]}function Su({name:e}){let t=String(e||``).split(`.`).pop().toLowerCase();return t===`pdf`?(0,l.jsx)(c.FilePdfOutlined,{className:`v1-file-chip__icon`}):t===`doc`||t===`docx`?(0,l.jsx)(c.FileWordOutlined,{className:`v1-file-chip__icon`}):[`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`svg`].includes(t)?(0,l.jsx)(c.FileImageOutlined,{className:`v1-file-chip__icon`}):[`txt`,`csv`,`json`,`md`].includes(t)?(0,l.jsx)(c.FileTextOutlined,{className:`v1-file-chip__icon`}):(0,l.jsx)(c.FileOutlined,{className:`v1-file-chip__icon`})}Su.propTypes={name:f.default.string};function Cu(e){return e?.renderType&&e.renderType!==`auto`?e.renderType:e?.documentPreview===!0?`document`:e?.formatter===`phone`||e?.type===`phone`?`phone`:e?.displayAs===`tag`?`tag`:e?.displayAs===`text`?`text`:`auto`}function wu({value:e,mode:t,empty:r,style:i}){let[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(0),p=n.Lt(e);if(!p.length)return(0,l.jsx)(du,{strong:!0,className:`v1-detail-value`,style:i,children:r});let m=p.filter(e=>e.url);return t===`text`?(0,l.jsx)(du,{strong:!0,className:`v1-detail-value`,style:i,children:p.map(e=>e.name).join(`, `)}):t===`tag`?(0,l.jsx)(`span`,{className:`v1-detail-value v1-detail-tags`,children:p.map((e,t)=>(0,l.jsx)(s.Tag,{icon:(0,l.jsx)(c.PaperClipOutlined,{}),children:e.name},t))}):t===`link`||t===`download`?(0,l.jsx)(`span`,{className:`v1-detail-value v1-doc-list`,children:(0,l.jsx)(`span`,{className:`v1-file-list`,children:p.map((e,n)=>e.url?(0,l.jsxs)(`a`,{className:`v1-file-chip`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,download:t===`download`?e.name||``:void 0,title:e.name,children:[(0,l.jsx)(Su,{name:e.name}),(0,l.jsx)(`span`,{className:`v1-file-chip__name`,children:e.name}),t===`download`?(0,l.jsx)(c.DownloadOutlined,{className:`v1-file-chip__action`}):(0,l.jsx)(c.LinkOutlined,{className:`v1-file-chip__action`})]},n):(0,l.jsxs)(`span`,{className:`v1-file-chip v1-file-chip--disabled`,title:`No file location`,children:[(0,l.jsx)(Su,{name:e.name}),(0,l.jsx)(`span`,{className:`v1-file-chip__name`,children:e.name})]},n))})}):(0,l.jsxs)(`div`,{className:`v1-detail-value v1-doc-list`,children:[(0,l.jsx)(`div`,{className:`v1-file-list`,children:p.map((e,t)=>e.url?(0,l.jsxs)(`button`,{type:`button`,className:`v1-file-chip`,onClick:()=>{f(m.indexOf(e)),u(!0)},title:`Preview ${e.name}`,children:[(0,l.jsx)(Su,{name:e.name}),(0,l.jsx)(`span`,{className:`v1-file-chip__name`,children:e.name}),(0,l.jsx)(c.EyeOutlined,{className:`v1-file-chip__action`})]},t):(0,l.jsxs)(`span`,{className:`v1-file-chip v1-file-chip--disabled`,title:`No preview available for this file`,children:[(0,l.jsx)(Su,{name:e.name}),(0,l.jsx)(`span`,{className:`v1-file-chip__name`,children:e.name})]},t))}),(0,l.jsx)(n.Cn,{documents:m,open:a,onClose:()=>u(!1),initialIndex:d})]})}wu.propTypes={value:f.default.any,mode:f.default.string,empty:f.default.string,style:f.default.object};function Tu(e,t={}){return Number.isNaN(ru(e))?String(e??``):`${t.currencySymbol?Ql(t.currencySymbol,``):``}${iu(e,{decimals:t.decimals})}`}function Eu({field:e,record:t}){let{value:r,type:i,prefix:a=``,suffix:o=``,color:d=``,capitalize:f}=e??{},p=e?.renderOptions??{},m=n.zn(),h=m.separator||`, `,g=d?{color:d}:void 0,_=p.tagColor||d||void 0,v=p.textTransform&&p.textTransform!==`none`?p.textTransform:null,y=e=>`${a?`${a} `:``}${e}${o?` ${o}`:``}`,b=e=>v?vu(e,v):e,x=e=>(0,l.jsx)(du,{strong:!0,className:`v1-detail-value`,style:g,children:b(e)}),S=e=>(0,l.jsx)(du,{strong:!0,className:`v1-detail-value v1-detail-token`,style:g,children:b(e)}),C=e=>(0,l.jsx)(`span`,{className:`v1-detail-value v1-detail-tags`,children:(0,l.jsx)(s.Tag,{color:_,children:b(e)})}),w=Cu(e),T=lu(e,w,m);if(w!==`document`&&fu(r)&&!p.showEmpty)return x(T);switch(w){case`document`:return(0,l.jsx)(wu,{value:r,mode:p.documentMode||`preview`,empty:T,style:g});case`text`:return x(y(bu(r,f,h)));case`tag`:case`chip`:return C(y(bu(r,f,h)));case`badge`:{let e=b(bu(r,f,h));return(0,l.jsx)(`span`,{className:`v1-detail-value`,children:(0,l.jsx)(s.Badge,{color:_||`blue`,text:e})})}case`tags`:case`multitag`:case`skills`:{let e=xu(r,f,h);return e.length?(0,l.jsx)(`span`,{className:`v1-detail-value v1-detail-tags`,children:e.map((e,t)=>(0,l.jsx)(s.Tag,{color:_,children:b(e)},t))}):x(T)}case`link`:{let e=bu(r,!1,h),t=/^https?:\/\//i.test(e)?e:n.It(e)||e;return(0,l.jsx)(`a`,{className:`v1-detail-value v1-doc-link`,href:t,target:`_blank`,rel:`noopener noreferrer`,children:b(y(e))})}case`email`:{let e=bu(r,!1,h);return(0,l.jsxs)(`a`,{className:`v1-detail-value`,href:`mailto:${e}`,children:[(0,l.jsx)(c.MailOutlined,{}),` `,e]})}case`phone`:{let i=bu(r,!1,h),a=n.zt(e,i,t),o=a.replace(/[^0-9+]/g,``);return(0,l.jsxs)(`a`,{className:`v1-detail-value v1-detail-token v1-detail-call`,href:`tel:${o}`,"aria-label":`Call ${a}`,title:`Call ${a}`,children:[(0,l.jsx)(c.PhoneOutlined,{}),` `,b(y(a))]})}case`date`:case`datetime`:{if(w===`datetime`||p.withTime===!0)return S(y((p.dateFormat?n.kn(r,p.dateFormat,m):n.An(r,m))||bu(r,f,h)));let e=p.dateFormat||m.dateFormat;return S(y(n.kn(r,e,m)||bu(r,f,h)))}case`currency`:return S(y(Tu(r,p)));case`budget`:{let e=Tu(r,p),t=p.unit?String(p.unit):``,n=t&&p.budgetUnitMap?p.budgetUnitMap[t]??t:t;return S(`${e}${n?`/${n}`:``}`)}case`html`:return(0,l.jsx)(`span`,{className:`v1-detail-value`,style:g,dangerouslySetInnerHTML:{__html:String(r??``)}})}if(fu(r))return x(T);let E=i===`date`,D=typeof r==`string`&&pu.test(r.trim());if(E||D){let e=(0,u.default)(r);if(e.isValid())return x(y(e.format(m.dateFormat)))}if(yu(r))return x(y(gu(r.value??r.id,f)));if(Array.isArray(r)){let e=xu(r,f,h);return e.length?(0,l.jsx)(`span`,{className:`v1-detail-value v1-detail-tags`,children:e.map((e,t)=>(0,l.jsx)(s.Tag,{color:_,children:e},t))}):x(T)}return x(typeof r==`boolean`?r?m.booleanTrueLabel:m.booleanFalseLabel:typeof r==`object`?_u(r,f,h)||T:y(gu(r,f)))}Eu.propTypes={field:f.default.object,record:f.default.object};var{Text:Du}=s.Typography,Ou=[(0,l.jsx)(c.UserOutlined,{}),(0,l.jsx)(c.EnvironmentOutlined,{}),(0,l.jsx)(c.SolutionOutlined,{}),(0,l.jsx)(c.InfoCircleOutlined,{}),(0,l.jsx)(c.FileTextOutlined,{})],ku=e=>e===!0||e===1||e===`1`,Au=[`jobDescription`,`description`,`rawDescription`,`jobDescriptionText`];function ju(e=[]){for(let t of e)for(let e of t.fields??[]){let t=Au.includes(e.field),n=/description/i.test(e.label??``);if((t||n)&&typeof e.value==`string`&&e.value.trim())return{...e,key:e.field,value:e.value}}return null}function Mu(e=[]){let t=Nl(e);return[...e].filter(e=>!ku(e.hideGroup)&&!ku(e.hideGroupInDetail)).filter(e=>Pl(e,t)).sort((e,t)=>Number(e.order??0)-Number(t.order??0)).map(e=>({...e,fields:[...e.fields??[]].filter(e=>String(e.field??``).trim()!==``&&(e.show===void 0||ku(e.show))&&Pl(e,t)).map(e=>({...e,label:Il(e,t)})).sort((e,t)=>Number(e.order??0)-Number(t.order??0))})).filter(e=>e.fields.length)}function Nu(e){let t=e?.data??e;return Array.isArray(t)?t:t?.data??t?.rows??t?.records??t?.items??t?.list??[]}function Pu(e,...t){for(let n of t){let t=String(n).split(`.`).reduce((e,t)=>e?.[t],e);if(t!=null&&t!==``)return t}return``}function Fu(e){let t=String(Pu(e,`isDeleted`,`deleted`)).toLowerCase(),n=String(Pu(e,`assignmentStatus`,`status`)).toLowerCase();return t!==`true`&&t!==`1`&&![`removed`,`inactive`,`deleted`].includes(n)}function Iu(e=[],t){let n={candidateIds:new Set,engagementIds:new Set([String(t??``)].filter(Boolean))},r=e?.recordMeta;[`_id`,`id`,`workforceEngagementId`,`engagementId`].forEach(e=>{let t=r?.[e];t!=null&&t!==``&&n.engagementIds.add(String(t))}),[`candidateId`,`candidate_id`,`applicantId`].forEach(e=>{let t=r?.[e];t!=null&&t!==``&&n.candidateIds.add(String(t))});for(let t of e??[])for(let e of t.fields??[])[`candidateId`,`candidate_id`,`applicantId`].includes(e?.field)&&e.value&&n.candidateIds.add(String(e.value?.id??e.value?.value??e.value)),[`workforceEngagementId`,`engagementId`].includes(e?.field)&&e.value&&n.engagementIds.add(String(e.value?.id??e.value?.value??e.value));return n}async function Lu(e){let t=Pu(e,`batchName`,`batch_name`,`batch.name`,`batch.title`);if(t)return String(t);let r=String(Pu(e,`batchId`,`batch_id`));if(!r)return``;for(let e of[`batches`,`batch`])try{let t=Pu(Nu(await n.yn(e,500,0)).find(e=>String(Pu(e,`_id`,`id`,`batchId`,`batch_id`))===r),`batchName`,`batch_name`,`name`,`title`);if(t)return String(t)}catch{}return r}async function Ru(e,t,r){let i=String(r??``).trim().toLowerCase();if(![`candidate`,`candidates`,`onboarding`].includes(i))return e;let{candidateIds:a,engagementIds:o}=Iu(e,t);if(!a.size&&!o.size)return e;let s=Nu(await n.yn(`batchCandidates`,1e3,0)).filter(Fu).find(e=>a.has(String(Pu(e,`candidateId`,`candidate_id`)))||o.has(String(Pu(e,`workforceEngagementId`,`engagementId`))));if(!s)return e;let c=await Lu(s);return c?[...e,{id:`candidate-batch-summary`,name:`candidateBatch`,label:`Batch`,order:9999,fields:[{field:`batchName`,label:`Batch Name`,type:`text`,value:c,show:!0,order:1}]}]:e}function zu({icon:e,title:t}){return(0,l.jsxs)(s.Space,{size:10,align:`center`,children:[(0,l.jsx)(`div`,{className:`v1-section-icon-box`,children:e}),(0,l.jsx)(Du,{strong:!0,className:`v1-section-label`,children:t})]})}function Bu({value:e}){let t=String(e??``);return/<[a-z][\s\S]*>/i.test(t)?(0,l.jsx)(`div`,{className:`v1-detail-value`,style:{whiteSpace:`normal`,lineHeight:1.7},dangerouslySetInnerHTML:{__html:t}}):(0,l.jsx)(`div`,{className:`v1-detail-value`,style:{whiteSpace:`pre-wrap`,lineHeight:1.7},children:t})}function Vu({moduleName:e,id:r,refreshKey:i=0,onDescriptionSaved:a}){let[d,f]=(0,o.useState)([]),[p,m]=(0,o.useState)(!!e),[h,g]=(0,o.useState)(``),[_,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(``),[x,S]=(0,o.useState)(!1),[C,w]=(0,o.useState)([]);(0,o.useEffect)(()=>{if(!e||!r){Promise.resolve().then(()=>w([]));return}let t=!1;return n.gn(e,r).then(e=>{t||w(Array.isArray(e)?e:e?.data??[])}).catch(()=>{t||w([])}),()=>{t=!0}},[e,r,i]);let[T,E]=(0,o.useState)(null),[D,O]=(0,o.useState)({}),[k,A]=(0,o.useState)({});(0,o.useEffect)(()=>{if(!e||!r){E(null);return}let n=!1;return t.o(t.x,`/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(r)}`).then(e=>{let t=e?.data?.data??e?.data??[];n||E(Array.isArray(t)?t[0]:null)}).catch(()=>{n||E(null)}),()=>{n=!0}},[e,r,i]),(0,o.useEffect)(()=>{let e=!1;return t.o(t.x,`/module/list?module=users`).then(t=>{let r=t?.data?.data??t?.data??[];e||O(n.ct(r))}).catch(()=>{}),()=>{e=!0}},[]),(0,o.useEffect)(()=>{if(!e)return;let t=!1;async function i(){try{m(!0),g(``);let[i]=await Promise.all([Ln({module:e,id:r,view:`detail`}),n.Bn()]),a=await Ru(Array.isArray(i)?i:[],r,e);t||f(a)}catch(n){console.error(`Failed to fetch ${e} detail fields:`,n),t||g(n?.message||`Failed to fetch detail fields`)}finally{t||m(!1)}}return i(),()=>{t=!0}},[e,r,i]);let j=(0,o.useMemo)(()=>Mu(d),[d]),M=(0,o.useMemo)(()=>{let e=new Set;return d.forEach(t=>{ku(t.appendHistory)&&[t.historyField,...t.historyFields||[]].filter(Boolean).forEach(t=>e.add(t))}),e},[d]);(0,o.useEffect)(()=>{if(!T||!M.size)return;let e=new Set;if(M.forEach(t=>{let n=T[t];Array.isArray(n)&&n.forEach(t=>{let n=t?.updatedBy??t?.changedBy;if(n==null||n===``)return;let r=String(n);!D[r]&&!k[r]&&e.add(r)})}),!e.size)return;let t=!1;return Promise.all([...e].map(e=>n.st(e).then(t=>[e,t]))).then(e=>{let n=Object.fromEntries(e.filter(([,e])=>e));!t&&Object.keys(n).length&&A(e=>({...e,...n}))}).catch(()=>{}),()=>{t=!0}},[T,M,D,k]);let N={proposedRate:`Proposed Rate`,candidateBudget:`Candidate Rate`},P=(e,t,n)=>{let r=`${e}.`,i=t=>[t?.historyField,...t?.historyFields||[]].includes(e);for(let r of t??[]){if(!i(r))continue;let t=r.historyLabels?.[e];if(t)return t;let a=r.historyLabelFrom?.[e];if(a){let t=(r.fields??[]).find(e=>e?.field===a);if(t)return Il(t,n)||N[e]||e}}for(let i of t??[])for(let t of i?.fields??[])if(String(t?.field??``).startsWith(r))return Il(t,n)||N[e]||e;return N[e]||e},F=(e,t)=>{let{amount:r,currency:i,unit:a}=Xl(e,t,d),o=e?.timestamp?.$date??e?.timestamp??e?.updatedAt?.$date??e?.updatedAt??e?.changedAt?.$date??e?.changedAt,s=e?.updatedBy??e?.changedBy,c=r==null||r===``?null:Number(r);return{amount:c!=null&&!Number.isNaN(c)?`${Ql(i)}${iu(c)}`:`—`,unit:eu(a),when:o&&(0,u.default)(o).isValid()?n.An(o):``,by:s==null?``:D[String(s)]||k[String(s)]||``}},I=(0,o.useMemo)(()=>{if(!T)return[];let e=Nl(d),t=[];return M.forEach(n=>{let r=T[n];if(!Array.isArray(r)||r.length===0)return;let i=r.filter(e=>e&&(e.timestamp||e.updatedAt||e.changedAt));i.length!==0&&t.push({key:n,label:P(n,d,e),entries:[...i].reverse().map(e=>F(e,n))})}),t},[T,d,M,D,k]),L=(0,o.useMemo)(()=>{let e=new Set(I.map(e=>e.key));return e.size?j.map(t=>{if(!ku(t.appendHistory))return t;let n=[t.historyField,...t.historyFields||[]].filter(t=>t&&e.has(t));return n.length?{...t,fields:t.fields.filter(e=>!n.some(t=>String(e.field??``).startsWith(`${t}.`)))}:t}).filter(e=>e.fields.length):j},[j,I]),R=(0,o.useMemo)(()=>{let e=new Set(I.map(e=>e.key)),t=d.find(t=>ku(t.appendHistory)&&[t.historyField,...t.historyFields||[]].some(t=>t&&e.has(t)));return t?.label??t?.name??`Rate Details`},[d,I]),z=e===`job`,B=(0,o.useMemo)(()=>z?ju(d):null,[z,d]),V=()=>{v(!1),b(``)},H=async()=>{if(!y.trim()){s.message.warning(`Please enter a job description`);return}S(!0);try{await $c(r,y.trim()),v(!1),b(``),m(!0);let t=await Ln({module:e,id:r,view:`detail`});f(Array.isArray(t)?t:[]),s.message.success(`Description updated and parsed successfully`),a?.()}catch{s.message.error(`Failed to update description`)}finally{S(!1),m(!1)}},U=e=>{let t=Number(e.detailCol);if(Number.isFinite(t)&&t>0)return Math.max(1,Math.min(3,Math.round(t/8)));let n=typeof e.value==`string`?e.value:``;return e.renderType===`document`||e.type===`text-editor`||n.length>120?3:/\s(?:·|-|–|\/)\s/.test(n)&&n.length>=16?2:1},ee=e=>e.renderType===`document`||e.type===`text-editor`||(typeof e.value==`string`?e.value:``).length>60,te=(0,o.useMemo)(()=>Nl(d),[d]),ne=(e,t=``,n=te)=>{let r=e.label??e.field,i=ee(e),a=typeof e.value==`string`?e.value:void 0;return(0,l.jsx)(`div`,{className:`v1-detail-cell${i?` v1-detail-cell--wrap`:``}`,style:{"--v1-cell-span":U(e)},children:(0,l.jsxs)(`div`,{className:`v1-detail-field`,title:!i&&a?`${r}: ${a}`:void 0,children:[(0,l.jsx)(Du,{type:`secondary`,className:`v1-detail-label`,title:r,children:r}),(0,l.jsx)(Eu,{field:e,record:n})]})},`${e.field}${t}`)},re=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}|$)/,ie=(e,t,r=te)=>{if(t==null||typeof t==`object`)return``;let i=String(t).trim();if(!i)return``;if(e?.type===`date`||e?.renderType===`date`||re.test(i)){let t=(0,u.default)(i);if(t.isValid())return t.format(e?.renderOptions?.dateFormat||n.zn().dateFormat)}return(e?.formatter===`phone`||e?.type===`phone`||e?.renderType===`phone`)&&n.zt(e,i,r)||i},ae=(e,t)=>{if(e?.hidePartLabel||e?.renderOptions?.hidePartLabel)return``;let n=String(e?.label??``).trim();if(!n)return``;let r=String(t??``).toLowerCase().split(/[\s/]+/).filter(Boolean),i=n.split(/\s+/),a=0;for(;a<i.length;){let e=i[a].toLowerCase();if(!r.some(t=>t===e||t.startsWith(e)||e.startsWith(t)))break;a+=1}return i.slice(a).join(` `).trim()},W=(e,t,r,i,a=te)=>{let o=e.map(e=>({field:e,cell:r(e)})),s=o.filter(({cell:e})=>ce(e)).map(({cell:e})=>({...e,renderType:`document`})).filter(e=>Dl(e.value)),c=new Set;o.forEach(({field:e})=>{if(e?.formatter!==`phone`&&e?.type!==`phone`&&e?.renderType!==`phone`)return;let t=[e?.renderOptions?.countryCodeField??e?.countryCodeField,...n.Rt(e)].filter(Boolean);o.forEach(({field:n})=>{n!==e&&t.includes(n.field)&&c.add(n.field)})});let u=typeof t.combineLabel==`string`&&t.combineLabel.trim()?t.combineLabel:t.label??t.field,d=o.filter(({cell:e})=>!ce(e)).filter(({field:e})=>!c.has(e.field)).filter(({cell:e})=>!jl(e,e.value)).map(({field:e,cell:t})=>({key:e.field,label:ae(e,u),text:ie(e,t.value,a)})).filter(e=>e.text!==``);if(!d.length&&!s.length&&jl(t,void 0))return null;let f=d.map(e=>`${e.label?`${e.label} `:``}${e.text}`).join(` · `),p=U({detailCol:t.detailCol,value:f}),m=s.length?Math.max(p,2):p;return(0,l.jsx)(`div`,{className:`v1-detail-cell v1-detail-cell--wrap`,style:{"--v1-cell-span":m},children:(0,l.jsxs)(`div`,{className:`v1-detail-field`,children:[(0,l.jsx)(Du,{type:`secondary`,className:`v1-detail-label`,title:u,children:u}),(d.length>0||s.length===0)&&(0,l.jsx)(`div`,{className:`v1-detail-value v1-detail-parts`,children:d.length?d.map((e,t)=>(0,l.jsxs)(`span`,{className:`v1-detail-part`,children:[t>0&&(0,l.jsx)(`span`,{className:`v1-detail-part-sep`,"aria-hidden":`true`,children:`·`}),e.label&&(0,l.jsx)(`span`,{className:`v1-detail-part-label`,children:e.label}),(0,l.jsx)(`span`,{children:e.text})]},`${e.key}-part`)):`—`}),s.map(e=>(0,l.jsx)(Eu,{field:e},`${e.field}-doc`))]})},`${t.field}-merged${i}`)},oe=(e,t,n=``,r=te)=>{let i=new Set,a=[];return e.forEach(o=>{let s=o.combineKey?.trim?.();if(s){if(i.has(s))return;i.add(s);let o=e.filter(e=>e.combineKey?.trim?.()===s);if(o.length>1){let e=o.find(e=>e.combineLabel)??o[0],i=W(o,e,t,n,r);i&&a.push(i);return}}let c=t(o);jl(c,c.value)||a.push(ne(c,n,r))}),a},se=(0,o.useMemo)(()=>{let e={};for(let t of C){let n=t.fieldName||t.field||`file`;(e[n]??=[]).push({location:t.s3Key??t.location??t.uniqueName??``,name:t.fileName??t.name??``,fileUrl:t.fileUrl??t.url??``})}return e},[C]),ce=e=>e.type===`file`||e.type===`document`||e.renderType===`document`,le=e=>se[e.field]||e.fileKey&&se[e.fileKey]||null,ue=e=>String(e?.name||e?.location||``).trim().toLowerCase(),de=e=>{let[t]=n.Lt(e);return!t||!t.location&&!t.url?null:ue(t)},fe=(e,t=[])=>{let n=new Set,r=[],i=e=>{if(e==null||e===``)return;let t=de(e);t!==null&&(t&&n.has(t)||(t&&n.add(t),r.push(e)))};return t.forEach(i),(Array.isArray(e)?e:[e]).forEach(i),r},pe=e=>n.Lt(e).map(ue).filter(Boolean),me=e=>{let t=(e.validations??[]).find(e=>e?.type===`maxFiles`);return t?Math.max(1,Number(t.value??1)):ku(e.multiple)?Math.max(1,Number(e.maxCount??5)):Math.max(1,Number(e.maxCount??1))},he=(e,t,n)=>{let r=me(e);if(t.length<=r)return t;let[i]=pe(n);return(i?[...t].sort((e,t)=>Number(de(t)===i)-Number(de(e)===i)):t).slice(0,r)},ge=(e,t)=>{if(e.type===`file`||e.type===`document`)return{...e,renderType:`document`,value:t};let r=[e.field,e.payloadKey].filter(Boolean).map(e=>n.Xt(t,e)).find(e=>e!=null);return{...e,value:r}},_e=e=>{if(!ce(e))return e;let t=he(e,fe(e.value,le(e)??[]),e.value);return t.length?{...e,renderType:`document`,value:t}:e},G=(e,t,n)=>{let r=e.name??e.id??String(t),i=Array.isArray(e.rows)?e.rows:[],a=new Set(i.flatMap(e=>pe(e))),o=[],c=new Set;return n.filter(ce).forEach(e=>{(le(e)??[]).forEach(e=>{let t=ue(e);!t||a.has(t)||c.has(t)||(c.add(t),o.push(e))})}),(0,l.jsxs)(s.Card,{size:`small`,className:`v1-card v1-detail-card`,title:(0,l.jsx)(zu,{icon:Ou[t%Ou.length],title:e.label??e.name??`Details`}),children:[i.length===0&&o.length===0?(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:uu(e)}):i.map((t,r)=>(0,l.jsxs)(`div`,{className:`v1-detail-addrow-item`,children:[i.length>1&&(0,l.jsxs)(Du,{strong:!0,className:`v1-detail-addrow-index`,children:[e.label??`Record`,` `,r+1]}),(0,l.jsx)(`div`,{className:`v1-detail-grid`,children:oe(n,e=>ge(e,t),`-${r}`,t)})]},r)),o.length>0&&(0,l.jsx)(`div`,{className:`v1-detail-addrow-item`,children:(0,l.jsx)(`div`,{className:`v1-detail-grid`,children:ne({field:`${r}-files`,label:`Uploaded Files`,renderType:`document`,detailCol:24,value:o})})})]},r)},K=(e,t)=>{let n=e.name??e.id??String(t),r=B?e.fields.filter(e=>e.field!==B.key):e.fields;return r.length?e.addRow?G(e,t,r):(0,l.jsx)(s.Card,{size:`small`,className:`v1-card v1-detail-card`,title:(0,l.jsx)(zu,{icon:Ou[t%Ou.length],title:e.label??e.name??`Details`}),children:(0,l.jsx)(`div`,{className:`v1-detail-grid`,children:oe(r,_e)})},n):null},ve=()=>(0,l.jsx)(s.Card,{size:`small`,className:`v1-card v1-detail-card`,title:(0,l.jsx)(zu,{icon:(0,l.jsx)(c.HistoryOutlined,{}),title:R}),children:I.map((e,t)=>(0,l.jsxs)(`div`,{className:`v1-rh-section${t>0?` v1-rh-section--gap`:``}`,children:[(0,l.jsx)(`div`,{className:`v1-rh-section-title`,children:e.label}),(0,l.jsx)(`div`,{className:`v1-rate-history`,children:e.entries.map((e,t)=>(0,l.jsxs)(`div`,{className:`v1-rh-item${t===0?` v1-rh-latest`:``}`,children:[(0,l.jsx)(`span`,{className:`v1-rh-amount`,children:e.amount}),e.unit&&(0,l.jsxs)(`span`,{className:`v1-rh-unit`,children:[`/ `,e.unit]}),e.by&&(0,l.jsxs)(`span`,{className:`v1-rh-chip`,children:[(0,l.jsx)(c.UserOutlined,{}),` `,e.by]}),e.when&&(0,l.jsxs)(`span`,{className:`v1-rh-chip`,children:[(0,l.jsx)(c.ClockCircleOutlined,{}),` `,e.when]}),t===0&&(0,l.jsx)(`span`,{className:`v1-rh-badge`,children:`Latest`})]},t))})]},e.key))},`rate-details-history`),ye=(0,o.useMemo)(()=>{let e=d.find(e=>ku(e.appendHistory)&&e.historyAfterGroup);return String(e?.historyAfterGroup??``).trim().toLowerCase()},[d]),be=e=>ye?String(e.name??``).trim().toLowerCase()===ye:/current_employer|employer_details/i.test(e.name||``)||(e.fields||[]).some(e=>e.field===`employerId`);return(0,l.jsx)(s.Spin,{spinning:p,tip:`Loading detail fields...`,children:(0,l.jsxs)(`div`,{className:`v1-detail-left`,children:[h&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:`Unable to load detail fields`,description:h,className:`v1-detail-alert`}),!p&&!h&&L.length===0&&I.length===0&&(0,l.jsx)(s.Empty,{description:`No detail fields are configured.`}),L.flatMap((e,t)=>{let n=[K(e,t)];return be(e)&&I.length>0&&n.push(ve()),n}),I.length>0&&!L.some(be)&&ve(),z&&B?.value&&(0,l.jsx)(s.Card,{size:`small`,className:`v1-card v1-detail-card`,title:(0,l.jsx)(zu,{icon:(0,l.jsx)(c.FileTextOutlined,{}),title:`Description`}),children:_?(0,l.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,l.jsx)(`div`,{style:{background:`#ffffff`,border:`1px solid #d6e4f0`,borderRadius:8,padding:`4px`,boxShadow:`0 2px 8px rgba(0,0,0,0.04)`},children:(0,l.jsx)(s.Input.TextArea,{rows:10,value:y,onChange:e=>b(e.target.value),placeholder:B.hidePlaceholder?void 0:B.placeholder,style:{fontSize:13,lineHeight:1.65,border:`none`,boxShadow:`none`,resize:`vertical`,padding:`12px 14px`}})}),(0,l.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,l.jsx)(n.lt,{variant:`primary`,size:`small`,loading:x,onClick:H,children:`Save & Parse`}),(0,l.jsx)(n.lt,{size:`small`,onClick:V,children:`Cancel`})]})]}):(0,l.jsx)(Bu,{value:B.value})})]})})}var Hu=e.t({buildJobHeaderData:()=>Xu,default:()=>Uu,jobConfig:()=>Uu}),Uu={module:`job`,tabs:[{key:`details`,label:`Details`},{key:`candidates`,label:`Candidates`}],tabContent:{details:{render:({id:e,refreshKey:t,onDescriptionSaved:n})=>o.default.createElement(s.Row,{gutter:[16,16],align:`stretch`},o.default.createElement(s.Col,{key:`main`,xs:24,lg:16},o.default.createElement(Vu,{moduleName:`job`,id:e,refreshKey:t,onDescriptionSaved:n})),o.default.createElement(s.Col,{key:`side`,xs:24,lg:8},o.default.createElement(Mc,{moduleName:`job`,id:e})))}},header:{title:`jobTitle`,eyebrow:({val:e})=>{let t=[];return ul(Gu(e))&&t.push(pl(Gu(e))),ul(Ku(e))&&t.push(`MSP Id ${pl(Ku(e))}`),t.length?t.join(` - `):ul(e(`jobReferenceId`))?String(e(`jobReferenceId`)):``},clientName:({val:e})=>Gu(e),titleIds:[],status:{field:`jobStatus`},ids:[{label:`Zinnext Job ID`,field:`jobReferenceId`},{label:`Client Rate`,compute:Ju}],meta:[{icon:`location`,field:`jobLocation`},{icon:`experience`,compute:qu},{icon:`employment`,fields:[`employmentType`,`jobRemoteStatus`],join:` · `}],stats:[{label:`Target submissions`,field:[`targetSubmission`,`targetSubmissions`]},{label:`In Pipeline`,compute:Yu,always:!0}],timestamp:{label:`Created Date`,field:[`createdAt`,`jobCreatedDateTime`,`createdDate`]}}},Wu=(e,...t)=>t.map(t=>e(t)).find(ul),Gu=e=>Wu(e,`clientName`,`client.name`,`client`,`clientId`,`accountName`),Ku=e=>Wu(e,`mspReqId`,`mspreqId`,`msReqId`,`mspId`,`mspRequirementId`);function qu({val:e}){let t=e(`experience.experienceRequiredFrom`);if(!ul(t))return``;let n=e(`experience.experienceRequiredTo`);return`${t}${ul(n)?` - ${n}`:``} years`}function Ju({val:e}){let t=e(`jobPayDetails`)??{},n=t.clientBudgetStart??Wu(e,`clientBudgetStart`,`clientRateStart`);return ul(n)?gl({start:n,end:t.clientBudgetEnd??Wu(e,`clientBudgetEnd`,`clientRateEnd`),sym:t.clientBudgetCurrencySymbol??ml(t.clientBudgetCurrency)??``,unit:t.clientBudgetUnit??Wu(e,`clientBudgetUnit`)}):``}function Yu({val:e}){let t=e(`submissions`),n=Wu(e,`pipelineCount`,`PipelineCount`,`inPipeline`,`inPipelineCount`)??(Array.isArray(t)?t.length:void 0);return ul(n)?n:0}function Xu({val:e,has:t}){let n,r=[];t(e(`jobReferenceId`))&&(n=String(e(`jobReferenceId`)));let i=[e(`jobTitle`)].filter(t).map(pl).join(` `)||`-`,a=null;if(t(e(`jobSource`))&&(a={label:dl(e(`jobSource`)),color:`#10b981`,textColor:`#ffffff`}),t(e(`jobLocation`))&&r.push({icon:`location`,text:pl(e(`jobLocation`))}),t(e(`experience.experienceRequiredFrom`))){let n=e(`experience.experienceRequiredFrom`),i=e(`experience.experienceRequiredTo`);r.push({icon:`experience`,text:`${n}${t(i)?` - ${i}`:``} years`})}let o=[e(`employmentType`),pl(e(`jobRemoteStatus`))].filter(t).join(` - `);o&&r.push({icon:`employment`,text:o});let s=t(e(`clientId`))?fl(e(`clientId`)):null;return{eyebrow:n,title:i,status:a,meta:r,clientId:s}}var Zu=e.t({default:()=>Qu,payrollConfig:()=>Qu}),Qu={module:`payroll`,tabs:[],header:{variant:`finance`,title:`candidateName`,eyebrow:`designation`,statusField:`payroll.status`,chips:al}},$u=e.t({default:()=>ed,submissionConfig:()=>ed}),ed={module:`submission`,tabs:[],header:{title:[`firstName`,`lastName`],eyebrow:({val:e,has:t})=>[td(e),e(`jobTitle`)].filter(t).map(pl).join(` - `),clientName:({val:e})=>td(e),status:({val:e,has:t})=>{let n=e(`internalSubmissionStatus`)??{},r=n.internalSubmissionStatusText;return t(r)?{label:dl(r),color:{positive:`success`,negative:`error`,neutral:`default`}[n.internalSubmissionStatusType]??_l(r)}:null},ids:[{label:`Submission ID`,field:[`submissionId`,`clientSubmissionId`]},{label:`MS Req ID`,field:[`mspReqId`,`mspreqId`]},{label:`Client Req ID`,field:[`jobClientRefrenceId`,`jobClientReferenceId`,`clientJobReferenceId`]},{label:`Job ID`,field:[`jobRefrenceId`,`jobReferenceId`]}],meta:[{icon:`location`,field:`jobLocation`},{icon:`experience`,field:[`relevantExperienceYears`,`workExperienceYears`],suffix:` yrs`},{icon:`employment`,field:`workAuthorisation`},{icon:`rate`,prefix:`Client rate: `,compute:nd},{icon:`rate`,prefix:`Candidate rate: `,compute:rd}],timestamp:{label:`Created Date`,field:[`submittedAt`,`createdAt`,`createdDate`]}}},td=e=>e(`clientName`)??e(`client.name`);function nd({val:e}){let t=e(`clientBudget`)??e(`candidateBudget`)??{};return gl({start:t.clientBudgetStart??t.candidateBudgetStart,end:t.clientBudgetEnd??t.candidateBudgetEnd,sym:t.clientBudgetCurrencySymbol??t.candidateBudgetCurrencySymbol??ml(t.clientBudgetCurrency??t.candidateBudgetCurrency),unit:t.clientBudgetUnit??t.candidateBudgetUnit??`Hour`})}function rd({val:e}){let t=e(`candidateRate`)??{},n=e(`proposedRate`)??{};return gl({start:t.candidateAcceptedRate,sym:t.candidateAcceptedCurrencySymbol??ml(t.candidateAcceptedCurrency),unit:t.candidateAcceptedPayUnit??`Hour`})||gl({start:n.candidateProposedRate,sym:n.candidateProposedRateCurrencySymbol??ml(n.candidateProposedRateCurrency),unit:n.candidateProposedRateUnit??`Hour`})}var id=e.t({default:()=>ad,submissionJobConfig:()=>ad}),ad={module:`submissionJob`,tabs:[],buildData:Xu};function od(e,t){let n=Array.isArray(t)?t:[t];for(let t of n)if(ul(e(t)))return e(t)}function sd(e,t,n=` `){return t.map(t=>e(t)).filter(ul).map(pl).join(n)}function cd(e,t){let{val:n}=e,r;if(typeof t.compute==`function`)r=t.compute(e);else if(t.join)r=sd(n,t.fields??[],t.join);else{let e=od(n,t.field);r=ul(e)?pl(e):``}return ul(r)?`${t.prefix??``}${pl(r)}${t.suffix??``}`:``}function ld(e){return typeof e==`function`?{compute:e}:typeof e==`string`||Array.isArray(e)?{field:e}:e}function ud(e={},t){let{val:n}=t,r={};if(e.title!==void 0&&(r.title=sd(n,Array.isArray(e.title)?e.title:[e.title])||`-`),e.eyebrow!==void 0&&(r.eyebrow=cd(t,ld(e.eyebrow))||void 0),e.clientName!==void 0&&(r.clientName=cd(t,ld(e.clientName))||void 0),e.status!==void 0){if(typeof e.status==`function`)r.status=e.status(t)??null;else{let t=od(n,e.status.field);r.status=ul(t)?{label:dl(t),color:_l(t)}:null}}let i=(e=[])=>e.map(e=>{let r=typeof e.compute==`function`?e.compute(t):pl(od(n,e.field)??``);return{label:e.label,value:r}}).filter(e=>ul(e.value));if(e.ids!==void 0&&(r.ids=i(e.ids)),e.titleIds!==void 0&&(r.titleIds=i(e.titleIds)),e.meta!==void 0&&(r.meta=e.meta.map(e=>({icon:e.icon,text:cd(t,e)})).filter(e=>ul(e.text))),e.stats!==void 0&&(r.stats=e.stats.map(e=>{let r=typeof e.compute==`function`?e.compute(t):od(n,e.field),i=ul(r)?pl(r):e.always?pl(e.fallback??0):void 0;return{label:e.label,value:i}}).filter(e=>e.value!==void 0)),e.timestamp!==void 0){let t=hl(od(n,e.timestamp.field));r.timestamp=ul(t)?{label:e.timestamp.label,value:t}:null}return r}var dd=Object.assign({"./modules/billingConfig.js":ol,"./modules/candidateConfig.js":vl,"./modules/employerConfig.js":Sl,"./modules/jobConfig.js":Hu,"./modules/payrollConfig.js":Zu,"./modules/submissionConfig.js":$u,"./modules/submissionJobConfig.js":id}),fd={};Object.values(dd).forEach(e=>{let t=e.default??Object.values(e)[0];t?.module&&(fd[t.module]=t)});var pd={job:`job`,jobs:`job`,candidate:`candidate`,candidates:`candidate`,applicant:`candidate`,applicants:`candidate`,submission:`submission`,submissions:`submission`,vendor:`vendor`,vendors:`vendor`,onboarding:`onboarding`,employer:`employer`,employers:`employer`};function md(){let e=(typeof window<`u`&&window.__CORE_THEME_CONFIG__?.detailConfig)??{};return Object.keys(e).length?{...fd,...e}:fd}function hd(e=``,t=fd){let n=String(e).trim();if(t[n])return n;let r=n.toLowerCase();if(t[r])return r;let i=pd[r];if(i&&t[i])return i;let a=r.endsWith(`s`)?r.slice(0,-1):`${r}s`;return t[a]?a:i??r}function gd(e=[]){let t=new Map;return e.forEach(e=>{(e.fields??[]).forEach(e=>{t.has(e.field)||t.set(e.field,e)})}),t}function _d(e,t){for(let n of t)if(n.includes(`+`)){let t=n.split(`+`).map(t=>e(t)).filter(ul).map(pl).join(` `);if(t)return t}else if(ul(e(n)))return e(n)}function vd({val:e}){let t=_d(e,[`jobTitle`,`firstName+lastName`,`name`,`fullName`,`title`,`clientName`,`vendorCompanyName`,`companyName`])||`-`,n=_d(e,[`clientName`,`source`,`designation`,`jobReferenceId`,`applicantRefrenceId`]),r=ul(n)?pl(n):void 0,i=_d(e,[`status`,`jobStatus`,`submissionStatus`,`stage`]),a=ul(i)?{label:dl(i),color:_l(i)}:null,o=[];[[`Reference ID`,[`jobReferenceId`,`applicantRefrenceId`,`submissionId`,`referenceId`,`refId`]],[`Client Req ID`,[`clientJobReferenceId`,`jobClientRefrenceId`,`clientReqId`]],[`MS Req ID`,[`mspreqId`,`mspReqId`]]].forEach(([t,n])=>{let r=_d(e,n);ul(r)&&o.push({label:t,value:pl(r)})});let s=[],c=_d(e,[`jobLocation`,`currentLocation`,`location`]);ul(c)&&s.push({icon:`location`,text:pl(c)});let l=_d(e,[`designation`]);ul(l)&&s.push({icon:`designation`,text:pl(l)});let u=hl(_d(e,[`createdAt`,`submittedAt`,`createdDate`]));return{eyebrow:r,title:t,status:a,ids:o,meta:s,timestamp:ul(u)?{label:`Created Date`,value:u}:null}}function yd(e){let t=md();return t[hd(e,t)]??null}function bd(e,t=[],{aux:n}={}){if(!t.length)return null;let r=md(),i=r[hd(e,r)],a=gd(t),o=e=>{let n=a.get(e);return n?ll(n.value)&&[`status`,`jobStatus`,`submissionStatus`].includes(e)&&!ll(n.defaultValue)?n.defaultValue:n.value:t.recordMeta?.[e]},s=e=>a.get(e)??null,c=typeof n==`function`?n:()=>()=>void 0,l=vd({val:o,has:ul}),u=i?.buildData?i.buildData({val:o,has:ul,field:s,aux:c})??{}:i?.header?ud(i.header,{val:o,has:ul,field:s,aux:c}):{},d=(e,t)=>Array.isArray(e)?e:t??[],f=u.status===!1?null:u.status??l.status??null;return{eyebrow:u.eyebrow??l.eyebrow,title:u.title??l.title??`-`,clientName:u.clientName??null,clientId:u.clientId??null,status:f,titleIds:d(u.titleIds,l.titleIds),meta:d(u.meta,l.meta),ids:d(u.ids,l.ids),stats:u.stats??[],timestamp:u.timestamp??l.timestamp??null,tabs:i?.tabs??[]}}var xd=e=>e==null||e===``,Sd={positive:`success`,success:`success`,negative:`error`,error:`error`,warning:`warning`,info:`processing`,neutral:`default`,default:`default`};function Cd(e){return e?(Array.isArray(e)?e:[e]).filter(e=>e?.field&&e?.label):[]}function wd(e,t){let r=typeof t==`function`?t:()=>void 0;for(let t of Cd(e?.labelWhen)){let e=r(t.field);if(e!==void 0&&n.i(t,e))return t.label}return e?.label??``}function Td(e){let t=e?.valueStyles;if(!Array.isArray(t)||!t.length)return null;let n=String(e?.value??e?.text??``).trim().toLowerCase();if(!n)return null;let r=t.find(e=>String(e?.value??``).trim().toLowerCase()===n||String(e?.label??``).trim().toLowerCase()===n);return r?{color:r.color||void 0,bg:r.bg??r.background??r.backgroundColor??void 0}:null}function Ed(e,t){let n=wd(e,t),r=e?.value,i=xd(e?.text)?[n,xd(r)?``:String(r)].filter(Boolean).join(n&&!xd(r)?`: `:``):String(e.text),a=e?.variant===`pill`?`pill`:`text`;if(a!==`pill`)return{icon:e?.icon,text:i,variant:a};let o=Td(e);return{icon:e?.icon,text:i,label:n,value:xd(r)?``:String(r),variant:a,tagColor:o?.color||o?.bg?void 0:Sd[e?.tone]??`default`,tagStyle:o?.color||o?.bg?{color:o.color,backgroundColor:o.bg,borderColor:o.bg??o.color}:void 0}}function Dd(e){return!e||typeof e!=`object`?[]:Object.entries(e).map(([e,t])=>{if(!t||typeof t!=`object`)return null;let n=String(t.module??``).trim(),r=t.id==null?``:String(t.id).trim();return!e||!n||!r?null:{key:String(e),module:n,id:r}}).filter(Boolean)}function Od(e){return Dd(e).map(({key:e,module:t,id:n})=>`${e}:${t}:${n}`).sort().join(`|`)}function kd(e){let t=new Map;for(let n of e??[])for(let e of n?.fields??[])e?.field!=null&&!t.has(e.field)&&t.set(e.field,e.value);return e=>t.get(e)}function Ad(e){let t=new Map;for(let[n,r]of Object.entries(e??{}))t.set(n,kd(r));let n=()=>void 0;return e=>t.get(e)??n}var jd=e=>{let t=Number(e);return Number.isFinite(t)?t:0};function Md(e,t=`$`){let n=ru(e);return au(Number.isNaN(n)?0:n,Ql(t),{decimals:2})}function Nd(e){return`${jd(e).toFixed(2)} hrs`}function Pd(e,t=`$`,n=`hr`){let r=nu(n,``),i=Md(e,t);return r?`${i}/${r}`:i}function Fd(e){return`${parseFloat(jd(e).toFixed(2))}%`}function Id(e){let t=String(e??``).trim().split(/\s+/).filter(Boolean);return t.length?t.slice(0,2).map(e=>e[0].toUpperCase()).join(``):`·`}var Ld={TIMESHEET_APPROVED:{label:`Timesheet Approved`,icon:`check`,tone:`success`},BILLING_READY:{label:`Ready for Billing`,icon:`file`,tone:`info`},BILLING_INVOICED:{label:`Invoice Generated`,icon:`file`,tone:`info`},BILLING_PAID:{label:`Client Payment Received`,icon:`dollar`,tone:`success`},PAYROLL_PROCESSING:{label:`Payroll Processing Started`,icon:`sync`,tone:`warning`},PAYROLL_PAID:{label:`Payroll Disbursed`,icon:`dollar`,tone:`success`},PAYSLIP_GENERATED:{label:`Payslip Generated`,icon:`file`,tone:`info`}};function Rd(e){return Ld[e]||{label:String(e??``).toLowerCase().split(`_`).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1)).join(` `)||`Activity`,icon:`file`,tone:`neutral`}}function zd(e){return(Array.isArray(e)?e:[]).find(e=>e?.event===`TIMESHEET_APPROVED`)?.at??null}var Bd=e=>({enabled:!0,variant:e,disabledReason:null}),Vd=e=>({enabled:!1,variant:`default`,disabledReason:e}),Hd=[`PaymentNotReceived`,`Invoiced`,`Paid`],Ud=[`Ready`,`Processing`,`Paid`];function Wd(e){switch(e){case`PaymentNotReceived`:return{generateInvoice:Bd(`primary`),recordPayment:Vd(`Generate the invoice first`),markPaid:Vd(`Generate the invoice first`)};case`Invoiced`:return{generateInvoice:Vd(`Invoice already generated`),recordPayment:Bd(`primary`),markPaid:Bd(`default`)};case`Partially Received`:return{generateInvoice:Vd(`Invoice already generated`),recordPayment:Bd(`primary`),markPaid:Bd(`default`)};case`Received`:case`Paid`:return{generateInvoice:Vd(`Payment already received`),recordPayment:Vd(`Payment already received`),markPaid:Vd(`Payment already received`)};default:return{generateInvoice:Vd(`Unavailable in the current status`),recordPayment:Vd(`Unavailable in the current status`),markPaid:Vd(`Unavailable in the current status`)}}}function Gd(e){switch(e){case`Ready`:return{process:Bd(`primary`),generatePayslip:Vd(`Mark the payroll paid first`),markPaid:Vd(`Process the payroll first`)};case`Processing`:return{process:Vd(`Payroll is already processing`),generatePayslip:Vd(`Mark the payroll paid first`),markPaid:Bd(`primary`)};case`Paid`:return{process:Vd(`Payroll already paid`),generatePayslip:Bd(`primary`),markPaid:Vd(`Payroll already paid`)};default:return{process:Vd(`Unavailable in the current status`),generatePayslip:Vd(`Unavailable in the current status`),markPaid:Vd(`Unavailable in the current status`)}}}function Kd(e,t){if(e===`billing`){let e=Math.max(Hd.indexOf(t),0);return[{key:`approved`,label:`Timesheet Approved`,state:`done`},{key:`invoiced`,label:`Invoice Raised`,state:e>=1?`done`:`current`},{key:`paid`,label:`Payment Received`,state:e>=2?`done`:e===1?`current`:`pending`}]}let n=Math.max(Ud.indexOf(t),0);return[{key:`approved`,label:`Timesheet Approved`,state:`done`},{key:`processing`,label:`Processing`,state:n>=1?`done`:`current`},{key:`paid`,label:`Paid`,state:n>=2?`done`:n===1?`current`:`pending`}]}var qd=e=>jd(e?.leave?.CL)+jd(e?.leave?.SL),Jd=e=>jd(e?.workingHours?.ST),Yd=e=>jd(e?.workingHours?.OT);function Xd(e){let t=Array.isArray(e)?e:[],n={loggedDays:0,approvedDays:0,rejectedDays:0,pendingDays:0,leaveDays:0,holidayDays:0,weekOffDays:0,stHours:0,otHours:0,leaveHours:0,totalHours:0,avgHoursPerLoggedDay:0};return t.forEach(e=>{let t=Jd(e),r=Yd(e),i=qd(e);(e?.isLogged||t>0||r>0)&&(n.loggedDays+=1,e?.status===`approved`?n.approvedDays+=1:e?.status===`rejected`?n.rejectedDays+=1:n.pendingDays+=1),i>0&&(n.leaveDays+=1),e?.isHoliday&&(n.holidayDays+=1),e?.isWeekOff&&(n.weekOffDays+=1),n.stHours+=t,n.otHours+=r,n.leaveHours+=i,n.totalHours+=t+r}),n.avgHoursPerLoggedDay=n.loggedDays?n.totalHours/n.loggedDays:0,n}function Zd(e,t){return(Array.isArray(e)?e:[]).filter(e=>!!e?.isLogged||Jd(e)>0||Yd(e)>0||qd(e)>0||e?.isHoliday).map(e=>{let n=Jd(e),r=Yd(e),i=n+r;return{key:e.date,date:e.date,day:e.day||``,st:n,ot:r,leave:qd(e),isHoliday:!!e?.isHoliday,total:i,amount:i*jd(t),status:e?.status||`logged`,reviewer:e?.reviewedByName||``,remarks:e?.rejectionReason||e?.notes||``}})}function Qd(e){let[t,n,r]=String(e??``).split(`-`).map(Number);return!t||!n||!r?null:new Date(t,n-1,r)}var $d=e=>e.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`});function ef(e,t){let n=Array.isArray(e)?e:[],r=new Map;return n.forEach(e=>{let n=Qd(e?.date);if(!n)return;let i=Jd(e),a=Yd(e),o=qd(e);if(!e?.isLogged&&i<=0&&a<=0&&o<=0)return;let s=(n.getDay()+6)%7,c=new Date(n.getFullYear(),n.getMonth(),n.getDate()-s),l=c.getTime();if(!r.has(l)){let e=new Date(c.getFullYear(),c.getMonth(),c.getDate()+6);r.set(l,{weekStart:c,weekEnd:e,label:`${$d(c)} – ${$d(e)}`,st:0,ot:0,leaveHours:0,total:0,amount:0,days:0})}let u=r.get(l);u.st+=i,u.ot+=a,u.leaveHours+=o,u.total+=i+a,u.amount+=(i+a)*jd(t),(e?.isLogged||i>0||a>0)&&(u.days+=1)}),[...r.values()].sort((e,t)=>e.weekStart-t.weekStart)}function tf(e,{high:t=25,low:n=10}={}){let r=jd(e);return r>=t?`high`:r<n?`low`:`mid`}function nf(e){let t=e==null?``:String(e);return/[",\n\r]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t}function rf(e,t){return[t.map(e=>nf(e.label)).join(`,`),...(e??[]).map(e=>t.map(t=>nf(t.format?t.format(e[t.key],e):e[t.key])).join(`,`))].join(`\r
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-Chgba0Kb.cjs"),t=require("./authApi-0pIx1vUD.cjs"),n=require("./Breadcrumb-D4uJH_Jv.cjs"),r=require("./diceCandidateMapper-BjMhHno3.cjs"),i=require("./formGroupsCache-Bbz-28ws.cjs"),a=require("./addFormApi-DhugyuLa.cjs");let o=require("react");o=e.n(o,1);let s=require("antd"),c=require("@ant-design/icons"),l=require("react/jsx-runtime"),u=require("dayjs");u=e.n(u,1);let d=require("react-router-dom"),f=require("prop-types");f=e.n(f,1);async function p(e,{method:n=`POST`,params:r={},body:i={}}={}){let a={"Content-Type":`application/json`,Authorization:`Bearer ${await t.a()}`},o=new URLSearchParams({moduleName:e});Object.entries(r).forEach(([e,t])=>{t!=null&&t!==``&&o.append(e,String(t))});let s={method:n,headers:a};(n===`POST`||n===`PUT`)&&(s.body=JSON.stringify(i??{}));let c=await fetch(`${t.x}/dashboard/cards?${o.toString()}`,s);if(!c.ok)throw Error(`API ${c.status}: ${c.statusText}`);return c.json()}async function m(e={}){let n=await t.a(),r=await fetch(`${t.x}/dynamic-common-count`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`},body:JSON.stringify(e)});if(!r.ok)throw Error(`API ${r.status}: ${r.statusText}`);return r.json()}async function h(e={}){let n=await t.a(),r=await fetch(`${t.x}/dashboard-calendar`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`},body:JSON.stringify(e)});if(!r.ok)throw Error(`API ${r.status}: ${r.statusText}`);return r.json()}async function g(){return t.t(t.x,`/users/hierarchy-tree`)}var{Title:_,Text:v}=s.Typography,y=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],b=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],x=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],S={green:`#22c55e`,red:`#ef4444`,orange:`#f97316`,blue:`#3b82f6`};function C(e){return S[e]||e||`#586888`}function w(e){return String(e).padStart(2,`0`)}function T(e,t,n=`Sun`){let r=new Date(e,t,1).getDay(),i=n===`Mon`?r===0?6:r-1:r,a=new Date(e,t+1,0).getDate(),o=[];for(let e=0;e<i;e++)o.push({day:null,cur:!1});for(let e=1;e<=a;e++)o.push({day:e,cur:!0});for(;o.length%7!=0;)o.push({day:null,cur:!1});return o}function E(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function D(e){if(!e)return{text:``,author:null};let t=e.match(/\n\s*-\s*([^\n]+)\s*$/);return t?{text:e.slice(0,t.index).trim(),author:t[1].trim()}:{text:e.trim(),author:null}}function O(e=[]){let t={};return e.forEach(e=>{t[e.date]=(e.events||[]).map(e=>{let{text:t,author:n}=D(e.description);return{color:e.color,label:e.label,title:e.title,text:t,author:n}})}),t}function k({events:e}){return(0,l.jsx)(`div`,{style:{maxWidth:280,maxHeight:260,overflowY:`auto`},children:e.map((t,n)=>(0,l.jsxs)(`div`,{style:{display:`flex`,gap:8,padding:`6px 0`,borderBottom:n<e.length-1?`1px solid #f0f0f0`:`none`},children:[(0,l.jsx)(`span`,{className:`calendar-dot`,style:{background:C(t.color),marginTop:6,flexShrink:0}}),(0,l.jsxs)(`div`,{style:{minWidth:0},children:[(0,l.jsx)(v,{strong:!0,style:{fontSize:13,display:`block`},children:t.title||t.label}),t.text&&(0,l.jsx)(v,{style:{fontSize:12,color:`#555`,whiteSpace:`pre-line`,wordBreak:`break-word`},children:t.text}),t.author&&(0,l.jsxs)(v,{style:{fontSize:11,color:`#999`,display:`block`,marginTop:2},children:[`— `,t.author]})]})]},n))})}function A({userIds:e=[],days:t=void 0,startDay:n=`Sun`,renderDayContent:r=void 0,onDayClick:i=void 0,headerExtra:a=void 0,legend:u=void 0,readonly:d=!1,className:f=``,monthLabel:p=void 0,year:m=void 0,month:g=void 0,onPrevMonth:S=void 0,onNextMonth:D=void 0,prevDisabled:A=!1,nextDisabled:j=!1}){let M=t!==void 0||r!==void 0||i!==void 0,N=new Date,[P,F]=(0,o.useState)({year:N.getFullYear(),month:N.getMonth()}),I=m!=null&&g!=null?{year:Number(m),month:Number(g)-1}:P,[L,R]=(0,o.useState)({}),[z,B]=(0,o.useState)([]),[V,H]=(0,o.useState)(!1),[U,ee]=(0,o.useState)(null),te=JSON.stringify(e),ne=n===`Mon`?b:y,re=(0,o.useCallback)(async()=>{H(!0);try{let t=await h({userIds:e});t?.status&&t?.data?(B(t.data.legend||[]),R(O(t.data.days||[]))):(B([]),R({}))}catch(e){console.error(`CalendarCard fetch error:`,e)}finally{H(!1)}},[te]);(0,o.useEffect)(()=>{M||re()},[M,re]),(0,o.useEffect)(()=>(window.addEventListener(`dashboard-calendar:refresh`,re),()=>window.removeEventListener(`dashboard-calendar:refresh`,re)),[re]);let ie=S??(()=>F(e=>e.month===0?{year:e.year-1,month:11}:{...e,month:e.month-1})),ae=D??(()=>F(e=>e.month===11?{year:e.year+1,month:0}:{...e,month:e.month+1})),W=E(T(I.year,I.month,n),7),oe={};t!==void 0&&(t||[]).forEach(e=>{e?.date&&(oe[e.date]=e)});let se=u??z,ce=p??`${x[I.month]} ${I.year}`;return(0,l.jsx)(s.Card,{className:`calendar-card${f?` ${f}`:``}`,title:(0,l.jsxs)(`div`,{className:`calendar-header-title`,children:[(0,l.jsx)(c.CalendarOutlined,{}),(0,l.jsx)(_,{level:5,style:{margin:0},children:ce}),a]}),extra:(0,l.jsxs)(`div`,{className:`calendar-nav`,style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,l.jsx)(s.Tooltip,{title:`Previous month`,children:(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.LeftOutlined,{}),size:`small`,onClick:ie,disabled:A})}),(0,l.jsx)(s.Tooltip,{title:`Next month`,children:(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.RightOutlined,{}),size:`small`,onClick:ae,disabled:j})})]}),children:(0,l.jsxs)(s.Spin,{spinning:V,children:[(0,l.jsx)(s.Row,{gutter:[6,0],className:`calendar-day-names`,children:ne.map(e=>(0,l.jsx)(s.Col,{flex:`1`,className:`calendar-day-name`,children:e},e))}),(0,l.jsx)(`div`,{className:`calendar-weeks`,children:W.map((e,t)=>(0,l.jsx)(s.Row,{gutter:[6,6],align:`top`,className:`calendar-week-row`,children:e.map((e,t)=>{if(!e.cur||e.day===null)return(0,l.jsx)(s.Col,{flex:`1`,children:(0,l.jsx)(`div`,{className:`calendar-cell calendar-cell--filler`})},t);let n=`${I.year}-${w(I.month+1)}-${w(e.day)}`,a=e.day===N.getDate()&&I.month===N.getMonth()&&I.year===N.getFullYear();if(M){let o=oe[n]??null;return r?(0,l.jsx)(s.Col,{flex:`1`,children:r(n,o,{isToday:a,readonly:d})},t):(0,l.jsx)(s.Col,{flex:`1`,children:(0,l.jsx)(`div`,{className:[`calendar-cell`,a?`today`:``,d?`calendar-cell--readonly`:``].filter(Boolean).join(` `),onClick:()=>!d&&i?.(n,o),style:{cursor:d?`default`:`pointer`},children:(0,l.jsx)(`div`,{className:`calendar-cell-inner`,children:(0,l.jsx)(v,{className:`calendar-cell-number`,children:e.day})})})},t)}let o=L[n]||[],c=[...new Set(o.map(e=>e.color))].slice(0,3);return(0,l.jsx)(s.Col,{flex:`1`,children:(0,l.jsx)(`div`,{className:`calendar-cell${a?` today`:``}`,children:(0,l.jsxs)(`div`,{className:`calendar-cell-inner`,children:[(0,l.jsx)(v,{className:`calendar-cell-number`,children:e.day}),o.length>0&&(0,l.jsx)(s.Popover,{open:U===n,trigger:`click`,content:(0,l.jsx)(k,{events:o}),placement:`topRight`,destroyTooltipOnHide:!0,onOpenChange:e=>ee(e?n:null),children:(0,l.jsx)(`div`,{className:`calendar-cell-dots`,children:c.map((e,t)=>(0,l.jsx)(`span`,{className:`calendar-dot`,style:{background:C(e)}},t))})})]})})},t)})},t))}),se.length>0&&(0,l.jsx)(`div`,{className:`calendar-legend`,children:se.map(({label:e,color:t,icon:n})=>(0,l.jsxs)(`div`,{className:`calendar-legend-item`,children:[n?(0,l.jsx)(`span`,{className:`calendar-legend-badge`,style:{background:C(t)},children:n}):(0,l.jsx)(`span`,{className:`calendar-legend-dot`,style:{background:C(t)}}),(0,l.jsx)(v,{children:e})]},e))})]})})}function j(e){return e!=null}function M(e){let t=String(e);return t.charAt(0).toUpperCase()+t.slice(1)}function N(e,t){if(!e||typeof e!=`object`)return null;let n=e.key??e.value??e.id??String(t),r=e.title??e.tabTitle??e.label??e.name,i=e.count??e.countValue;return!n||!r?null:{...e,key:String(n),label:(0,l.jsxs)(s.Space,{size:6,children:[(0,l.jsx)(`span`,{children:M(r)}),j(i)&&(0,l.jsx)(s.Badge,{className:`dynamic-tabs-count`,count:i,showZero:!0,overflowCount:2**53-1})]})}}function P({tabs:e=[],activeKey:t,onChange:n,className:r,extra:i}){let a=e.map(N).filter(Boolean);if(!a.length)return null;let o=a.some(e=>e.key===t)?t:a[0].key;return(0,l.jsx)(s.Tabs,{activeKey:o,className:r,items:a,onChange:n,tabBarExtraContent:i})}function F(){return{tenantId:localStorage.getItem(`tenantId`)||``,businessId:localStorage.getItem(`businessId`)||``,businessUnitId:localStorage.getItem(`businessUnitId`)||``}}function I(){return Number(localStorage.getItem(`userId`))||0}var L=e=>e?.data??e,R=new Map;function z(e){return e?.recruiterId??e?.legacyUserId??e?.user_id??e?.userId??e?.USER_ID??e?.id??e?._id}function B(e){return!e||typeof e!=`object`?``:[e.first_name??e.firstName??e.FIRST_NAME,e.last_name??e.lastName??e.LAST_NAME].filter(Boolean).join(` `).trim()||e.recruiterName||e.name||e.user_name||e.userName||e.USER_NAME||e.email||``}async function V(e){let n=String(e??``).trim();return n?(R.has(n)||R.set(n,t.o(t.x,`/get-detailed-view?userId=${encodeURIComponent(n)}`).then(e=>B(e?.data??e??null)).catch(()=>``)),R.get(n)):``}var H=null;function U(e){let t=new Map;return(Array.isArray(e)?e:[]).forEach(e=>{let n={name:B(e),role_name:e?.roleName??e?.role_name??``,reporting_name:e?.reportingName??e?.reporting_name??``};[e?.userId,e?.user_id,e?.legacyUserId,e?.id,e?._id].forEach(e=>{let r=String(e??``).trim();r&&t.set(r,n)})}),t}function ee(){return H||=t.o(t.x,`/get-all-users?limit=500&offset=0`).then(e=>{let t=e?.data??e??{};return U(t.users??t??[])}).catch(()=>new Map),H}async function te(e){let t=z(e),n=(await ee()).get(String(t??``).trim())??{},r=n.name||await V(t)||B(e);return{...e,name:r,role_name:n.role_name||e?.role_name||e?.roleName||``,reporting_name:n.reporting_name||e?.reporting_name||e?.reportingName||``}}async function ne(e,n,r){return L(await t.o(t.x,`/module-data-update`,{method:`PUT`,body:JSON.stringify({module:e,ids:n,updates:{status:r}})}))}async function re(e,n){let r=Array.isArray(n)?n:[n],i=await Promise.all(r.filter(Boolean).map(n=>t.o(t.x,`/module/delete/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`,{method:`DELETE`})));return i[i.length-1]??{}}async function ie(e){return L(await t.o(t.T,`/joblist`,{method:`POST`,body:JSON.stringify({...F(),searchQuery:e,userId:I()})}))}async function ae(e=``){let n=e?`?search=${encodeURIComponent(e)}`:``;return t.t(t.T,`/users/any${n}`)}async function W({relatedIds:e,module:n,title:r,targetDate:i,notes:a}){return t.o(t.T,`/notes`,{method:`POST`,body:JSON.stringify({schemaVersion:1,...F(),title:r,notes:a,notesFor:n||`general`,notesRelatedId:Array.isArray(e)&&e.length?e:null,reminder:i?{type:`single`,time:i,interval:``}:null,targetDate:i||null})})}async function oe(e,{title:n,targetDate:r,notes:i}){return t.o(t.T,`/notes/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify({title:n,notes:i,reminder:r?{type:`single`,time:r,interval:``}:null,targetDate:r||null})})}async function se(e){return t.o(t.T,`/notes/${encodeURIComponent(e)}/resolve`,{method:`PUT`})}async function ce({jobId:e,candidateIds:n,hiringStage:r}){return t.o(t.T,`/source/hiringStgUpdate`,{method:`PUT`,body:JSON.stringify({...F(),multiJobId:Array.isArray(e)?e:[e],applicantId:Array.isArray(n)?n:[n],updateStatus:String(r??``).toLowerCase(),updateStatusType:`call`,responseType:`responded`,hiriringStatusChangeType:`tagToJobs`,comments:``,userId:I()})})}async function le(){return L(await t.o(t.x,`/masters/dropdown?masterName=candidateGroups&offset=0&limit=50`))}async function ue({candidateIds:e,groupId:n,groupName:r}){return L(await t.o(t.S,`/actions/update-group`,{method:`PUT`,body:JSON.stringify({candidateIds:e,groupId:n,groupName:r})}))}async function de({jobIds:e,rate:n,priority:r}){return t.o(t.T,`/assign?type=self`,{method:`PUT`,body:JSON.stringify({multiJobId:Array.isArray(e)?e:[e],userId:I(),schemaVersion:1,...F(),priority:r==null?`false`:String(r),priorityFrom:null,recruitersData:[]})})}async function fe(e){if(!e)return{assignedUsers:[],totalSubmissions:0,targetSubmissions:0,message:``};let n=await t.o(t.T,`/self-assign?jobId=${encodeURIComponent(e)}`),r=n?.data,i=n?.message??``;return Array.isArray(r)?{assignedUsers:await Promise.all(r.map(te)),totalSubmissions:0,targetSubmissions:0,message:i}:!r||typeof r!=`object`?{assignedUsers:[],totalSubmissions:0,targetSubmissions:0,message:i}:{assignedUsers:await Promise.all((Array.isArray(r.assignedUsers)?r.assignedUsers:[]).map(te)),totalSubmissions:r.totalSubmissions??0,targetSubmissions:r.targetSubmissions??0,message:i}}function pe(e){let t=e?.user_id??e?.userId??e?.USER_ID??e?.legacyUserId??e?.id??e?._id,n=t==null?``:String(t).trim();if(!n)return null;let r=[e?.first_name??e?.firstName,e?.last_name??e?.lastName].filter(Boolean).join(` `).trim(),i=e?.name||e?.user_name||e?.userName||e?.USER_NAME||r||e?.email||n;return{...e,label:String(i),value:n}}async function me(){let e=await t.t(t.T,`/users/manager`);return(Array.isArray(e)?e:e?[e]:[]).map(pe).filter(Boolean)}async function he(e){if(!e)return{recruitersData:[]};let n=await t.t(t.T,`/pay-details/${encodeURIComponent(e)}`),r=n&&typeof n==`object`&&Array.isArray(n.recruiters)?n.recruiters:[],i=(await Promise.all(r.map(async e=>{let t=e?.recruiterId??e?.user_id??e?.userId??e?.id;if(t==null||t===``)return null;let n=await te({...e,recruiterId:t});return{recruiterId:t,id:t,user_id:t,name:n.name,role_name:n.role_name??n.roleName??``,reporting_name:n.reporting_name??n.reportingName??``}}))).filter(Boolean);return{...n&&typeof n==`object`?n:{},recruitersData:i}}function ge(e){let t=typeof e==`object`?e?.recruiterId??e?.user_id??e?.userId??e?.id:e,n=Number(t);return Number.isInteger(n)&&n>0?n:null}function _e({jobIds:e,userId:t,rate:n,priority:r,removedIds:i,existingRecruiters:a}){let o=new Set((i??[]).map(String)),s=(a??[]).map(ge).filter(e=>e!==null&&!o.has(String(e))),c=(Array.isArray(t)?t:[t]).map(ge).filter(e=>e!==null);if(c.length===0)throw Error(`A valid user must be selected before assigning the job`);let l=Array.from(new Set([...s,...c]));return{multiJobId:Array.isArray(e)?e:[e],userId:c[0],schemaVersion:1,...F(),priority:String(r??!1),priorityFrom:``,recruitersData:l}}async function G(e,n){let r=new Set((n??[]).map(String));r.size&&await Promise.all((e??[]).map(async e=>{let n=await t.o(t.x,`/module/list?module=jobs&id=${encodeURIComponent(e)}`),i=n?.data?.data??n?.data??n,a=Array.isArray(i)?i[0]:i,o=Array.isArray(a?.recruiters)?a.recruiters:[],s=o.filter(e=>!r.has(String(ge(e)??``)));s.length!==o.length&&await t.o(t.x,`/module/update/${encodeURIComponent(e)}?module=jobs`,{method:`PATCH`,body:JSON.stringify({recruiters:s})})}))}async function K(e){let n=Array.isArray(e?.jobIds)?e.jobIds:[e?.jobIds].filter(Boolean),r=e?.removedIds??[],i=(Array.isArray(e?.userId)?e.userId:[e?.userId]).map(ge).filter(e=>e!==null),a;return i.length>0&&(a=await t.o(t.T,`/assign?type=other`,{method:`PUT`,body:JSON.stringify(_e(e))})),await G(n,r),a}async function ve({submissionId:e,isMail:n=!1}){return L(await t.o(t.x,`/submissions/move-to-onboarding`,{method:`POST`,body:JSON.stringify({submissionId:e,isMail:!!n})}))}async function ye(e,n){return L(await t.o(t.x,`/submissions/approve`,{method:`POST`,body:JSON.stringify({submissionId:e,...n})}))}async function be(e){return L(await t.o(t.x,`/submissions/vms-approve?submissionId=${encodeURIComponent(e)}`))}async function xe(e,{submissionId:n=``,billRate:r,payRate:i,currency:a=`$`,rateUnit:o=`hr`,referralId:s,referralRate:c,referralType:l,referralEnabled:u,vmsPercent:d=0,documentIds:f=[],remarks:p=null}={}){let m=e?`/workforce-engagements/${encodeURIComponent(e)}/cfo-approval/send`:`/submissions/${encodeURIComponent(n)}/cfo-approval/send`;if(!e&&!n)throw Error(`Submission is required to send for approval.`);let h=typeof window<`u`?window.location.origin:``,g=e||n;return L(await t.o(t.D,m,{method:`POST`,body:JSON.stringify({proposedRate:{candidateProposedRate:Number(r)||0,candidateProposedRateCurrency:a,candidateProposedRateCurrencySymbol:``,candidateProposedRateUnit:o},candidateRate:{candidateAcceptedRate:Number(i)||0,candidateAcceptedCurrency:a,candidateAcceptedCurrencySymbol:``,candidateAcceptedPayUnit:o,candidateAcceptedRateNegotiable:!1},...s!=null&&s!==``?{referralId:s}:{},...c==null?{}:{referralRate:Number(c)||0},...l!=null&&l!==``?{referralType:l}:{},...u==null?{}:{referralEnabled:!!u},vmsPercent:Number(d)||0,documentIds:f,remarks:p,approvalUrl:`${h}/cfo-approval/${encodeURIComponent(g)}`})}))}async function Se({submissionId:e,rejectReasonId:n,rejectReason:r,rejectReasonComments:i}){return L(await t.o(t.x,`/submissions/reject`,{method:`POST`,body:JSON.stringify({submissionId:e,rejectReasonId:n,rejectReason:r,rejectReasonComments:i})}))}async function Ce({jobId:e,applicantId:n}){let r=new URLSearchParams({jobId:String(e??``),applicantId:String(n??``)});return L(await t.o(t.x,`/submissions/exists?${r.toString()}`))??{exists:!1}}async function we({searchQuery:e,candidateId:n}){let r=L(await t.o(t.x,`/quick-submit/job-search`,{method:`POST`,body:JSON.stringify({searchQuery:e??``,candidateId:n?String(n):``})}));return Array.isArray(r)?r:[]}async function Te({search:e,jobId:n}){let r=L(await t.o(t.x,`/quick-submit/candidate-search`,{method:`POST`,body:JSON.stringify({search:e??``,jobId:n?String(n):``})}));return Array.isArray(r)?r:[]}async function Ee({jobId:e,applicantId:n,jobIds:r,applicantIds:i}){let a=!!e,o={};if(e&&(o.jobId=String(e)),n&&(o.applicantId=String(n)),Array.isArray(r)&&(o.jobIds=r.filter(Boolean).map(String)),Array.isArray(i)&&(o.applicantIds=i.filter(Boolean).map(String)),!(a?o.applicantIds:o.jobIds)?.length)return new Map;let s=L(await t.o(t.x,`/submissions/exists-bulk`,{method:`POST`,body:JSON.stringify(o)}))?.pairs??[];return new Map(s.map(e=>[String(a?e.applicantId:e.jobId),{submissionId:e.submissionId??``,submittedAt:e.submittedAt??null}]))}async function De({jobId:e,candidateIds:n}){return t.o(t.T,`/source/hiringStgUpdate`,{method:`PUT`,body:JSON.stringify({...F(),multiJobId:Array.isArray(e)?e:[e],applicantId:Array.isArray(n)?n:[n],updateStatus:`pipeline`,updateStatusType:`call`,responseType:`responded`,hiriringStatusChangeType:`tagToJobs`,comments:``,userId:I()})})}var Oe={jobsCount:[`total`,`Total Jobs`,`active`,`Active Jobs`,`myAssignedCount`,`My Jobs`],submissionCount:[`Selected`,`Submitted to client`,`Submitted to Client`,`Not Submitted`,`Approved`]};function ke(e){return Oe[e]??null}var Ae={stickyNotes:{title:`Sticky Notes`,variant:`sticky`,request:{method:`GET`,params:{limit:20,offset:0}},listPath:`data.data`,maxCount:4,viewAllUrl:`/viewall-sticky`,refreshEvent:`sticky-notes:refresh`,pillKey:`status`,headingKey:`title`,bodyKey:`notes`,bodyLines:3,footerLeftKey:`createdByName`,footerRightKey:`createdAt`,dateKey:`reminder.time`,colorBy:`status`,colorMap:{Note:`green`,Tagged:`red`},color:`auto`},jobsCount:{variant:`counts`,dynamicCommonCount:{module:`jobs`,keys:[`jobRecruitmentStatus`,`jobStatus`]},listPath:``,layout:`4x2`,groupSeparator:``,labelMap:{total:`Total Jobs`,active:`Active Jobs`,myAssignedCount:`My Jobs`},color:`#f1f3f8`,show:ke(`jobsCount`),hide:[`inactive`,`submitted`,`noSubmissions`]},submissionCount:{title:`Total Client Submission`,tooltipText:`Includes all submissions that are pending and submitted to the client.`,variant:`submission`,dynamicCommonCount:{module:`submissions`,keys:[`clientSubmissionStatus.clientSubmissionStatusText`]},listPath:``,totalKey:`total`,labelMap:{Selected:`Selected`,"Submitted to client":`Submitted to Client`,"Not Submitted":`Not Submitted`,Approved:`Approved`},colorMap:{Selected:`rgb(234, 175, 12)`,"Submitted to client":`green`,"Not Submitted":`red`,Approved:`#1d4ed8`},show:ke(`submissionCount`)},leadAptitude:{title:`Aptitude Test Results`,variant:`assessment`,request:{method:`GET`,params:{}},listPath:`data`,totalKey:`totalScore`,maxKey:`maximumScore`,statusKey:`status`,attemptDateKey:`attemptDate`,timeTakenKey:`timeTaken`,rankKey:`rank`,labelMap:{logicalReasoning:`Logical Reasoning`,quantitativeAptitude:`Quantitative Aptitude`,verbalAbility:`Verbal Ability`},colorMap:{logicalReasoning:`#7c3aed`,quantitativeAptitude:`#0891b2`,verbalAbility:`#16a34a`},hide:[`status`,`attemptDate`,`timeTaken`,`rank`,`maximumScore`]},onboardingCount:{variant:`counts`,dynamicCommonCount:{module:`onboarding`,keys:[`onboardingObStage`]},listPath:``,frame:!0,frameTitle:`Onboarding`,frameClassName:`onboarding-card`,viewAll:!0,footer:!0,columns:4,valueMap:{inProgress:`Under Review`,hired:`Onboarded`,projectCompleted:`Project cycle closed`,archive:`No longer active`},labelMap:{inProgress:`In Progress`,hired:`Hired`,projectCompleted:`Project Completed`,archive:`Archive`},aggregateMap:{inProgress:[`inProgress`,`In Progress`],hired:[`hired`,`Hired`,`Active`],projectCompleted:[`projectCompleted`,`Project Completed`,`Completed`],archive:[`archive`,`Archive`,`Not Hired`,`Candidate Backout`]},show:ke(`onboardingCount`),hide:[`total`,`totalGrossMargin`,`totalNetMargin`]},timesheetMonthlySummary:{variant:`metrics`,title:`Monthly Summary`,valueSuffix:` hrs`,rows:[{key:`unapprovedPayableHours`,label:`Unapproved Payable hours`,sublabel:`(S + O)`},{key:`nonPayableHours`,label:`Non-payable hours`,sublabel:`(Leave/Holidays)`},{key:`approvedPayableHours`,label:`Approved Payable hours`,valueColor:`#15803d`}]},timesheetWeeklyTotals:{variant:`metrics`,title:`Weekly Totals (S + O)`,plainHeader:!0,valueSuffix:` hrs`,listRows:{itemValueKey:`weeklyTotals.payable`,itemLabel:(e,t)=>{let n=e.weekStart?(0,u.default)(e.weekStart).format(`MMM D`):``,r=e.weekEnd?(0,u.default)(e.weekEnd).format(`MMM D`):``,i=`Week ${e.weekNumber??t+1}`;return n&&r?`${i} (${n} - ${r})`:i}}},timesheetHourBreakdown:{variant:`bars`,valueSuffix:` hrs`,rows:[{key:`totalSTHours`,label:`Standard`,color:`#1d4ed8`,bg:`#D0E6FF`},{key:`totalOTHours`,label:`Overtime`,color:`#15803d`,bg:`#d9f7e3`},{key:`leaveHours`,label:`Leaves`,color:`#b45309`,bg:`#FFECBA`},{key:`holidayHours`,label:`Holidays`,color:`#6d28d9`,bg:`#ede9fe`,fallback:0}]},financeKpiRow:{variant:`kpi`}},je=[`blue`,`green`,`purple`,`peach`,`red`,`gray`],Me=[`purple`,`peach`,`green`],Ne=[`#1d4ed8`,`#ef4444`,`#16a34a`,`#9333ea`,`#f59e0b`,`#0891b2`],Pe={blue:`#1d4ed8`,green:`#16a34a`,purple:`#9333ea`,peach:`#f97316`,red:`#ef4444`,gray:`#6b7280`};function Fe(){let e=(typeof window<`u`&&window.__CORE_THEME_CONFIG__?.cardConfig)??{};return{...Ae,...e}}var Ie={timesheet:{currentLabel:`Standard`,currentColor:`blue`,pastLabel:`Supplementary`,pastColor:`gold`,thresholdMonths:0}};function Le(e){let t=(typeof window<`u`&&window.__CORE_THEME_CONFIG__?.periodBadgeConfig)??{};return{...Ie[e],...t[e]}}function Re({current:e,pageSize:t,total:r,onChange:i,onPageSizeChange:a}){let o=Math.min((e-1)*t+1,r),c=Math.min(e*t,r);return(0,l.jsxs)(s.Flex,{align:`center`,justify:`space-between`,className:`custom-pagination`,style:{color:n.En.textSecondary},children:[(0,l.jsxs)(s.Space,{size:5,align:`center`,children:[(0,l.jsx)(n.Tn,{variant:`body`,color:`secondary`,children:`Show`}),(0,l.jsx)(s.Select,{value:t,size:`small`,style:{width:72},popupMatchSelectWidth:72,onChange:e=>{a(e),i(1)},options:[{value:10,label:`10`},{value:12,label:`12`},{value:25,label:`25`},{value:50,label:`50`},{value:100,label:`100`}]}),(0,l.jsx)(n.Tn,{variant:`body`,color:`secondary`,children:`/ page`})]}),(0,l.jsxs)(s.Space,{size:16,align:`center`,children:[(0,l.jsx)(n.Tn,{variant:`body`,color:`secondary`,children:`Showing ${o} - ${c} of ${r}`}),(0,l.jsx)(s.Pagination,{current:e,pageSize:t,total:r,showSizeChanger:!1,showQuickJumper:!1,showLessItems:!0,onChange:i})]})]})}var{Title:ze,Text:q}=s.Typography;function J(e,t){return Array.isArray(t)?t.map(t=>J(e,t)).filter(Y).join(` `):typeof t==`string`&&t.includes(`.`)?t.split(`.`).reduce((e,t)=>e==null?e:e[t],e):e[t]}var Y=e=>e!=null&&e!==``;function X(e,t,n={}){return{...n,...e.styles?.[t]||{}}}function Be(e){return Y(e.title)?(0,l.jsx)(ze,{level:5,style:X(e,`headerTitle`),children:e.title}):void 0}function Ve(e,t){return Y(e.title)?t:void 0}function He(e){return[`blue`,`green`,`purple`,`peach`,`red`,`gray`].includes(nt(e))}function Ue(e,t){let n=t||``,r=X(e,`card`);return Y(n)?He(n)?{className:n,style:r}:{className:``,style:{...r,background:n,borderColor:e.styles?.card?.borderColor||n}}:{className:``,style:r}}function We(e,t){return t?t.split(`.`).reduce((e,t)=>e==null?e:e[t],e):e}function Ge(e){return String(e).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function Ke(e){if(!Y(e))return null;let t=new Date(e);return isNaN(t)||t.getFullYear()<=1?null:n.kn(t,n.zn().dateFormat)}function qe(e){let t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function Je(e){return String(e??``).replace(/(?:\s*\(\d+[\d,]*\))+\s*$/,``).trim()}function Ye(e,t){let n=[e?.data?.total,e?.data?.count,e?.data?.totalCount,e?.data?.pagination?.total,e?.data?.data?.total,e?.data?.data?.count,e?.data?.data?.totalCount,e?.total,e?.count,e?.totalCount,e?.pagination?.total],r=[e?.data?.todoCount,e?.data?.toDoCount,e?.data?.pendingCount,e?.data?.data?.todoCount,e?.data?.data?.toDoCount,e?.todoCount,e?.toDoCount,e?.pendingCount],i=[e?.data?.resolvedCount,e?.data?.data?.resolvedCount,e?.resolvedCount],a=r.map(qe).find(e=>e!==null),o=i.map(qe).find(e=>e!==null),s=n.map(qe).find(e=>e!==null),c=a!==null&&o!==null?a+o:null,l=Array.isArray(t)?t.length:null;return{totalCount:s??c??l,todoCount:a,resolvedCount:o}}function Xe(e,t){let n=RegExp(`^${t}\\d+$`);return Object.keys(e).filter(e=>e===t||n.test(e)).map(n=>({field:e[n],n:n===t?1:Number(n.slice(t.length))})).sort((e,t)=>t.n-e.n).map(e=>e.field)}function Ze(e){return Math.max(1,Math.floor(24/(e||4)))}function Qe(e){if(typeof e!=`string`)return{};let t=e.toLowerCase().replace(/\s/g,``).match(/^(\d+)x(\d+)$/);if(!t)return{};let n=Number(t[1]);return{columns:n,maxCount:n*Number(t[2])}}function $e(e,t){let n=Qe(e.layout),r=e.columns??n.columns??t,i=e.maxCount??n.maxCount;return{columns:r,span:Ze(r),maxCount:i}}function et(e,t){return t?e.slice(0,t):e}function tt(e,t){return e.color?e.color===`auto`?je[t%je.length]:e.color:``}var nt=e=>String(e??``).trim().toLowerCase();function rt(e,t){return(Array.isArray(t)?t:[t]).some(t=>Y(t)&&nt(t)===nt(e))}function it(e,t){if(!e.colorMap)return null;let n=Object.keys(e.colorMap).find(e=>rt(e,t));return n?e.colorMap[n]:null}function at(e,t,n){if(!e.labelMap)return n;let r=Object.keys(e.labelMap).find(e=>rt(e,t));return r?e.labelMap[r]:n}function ot(e,t){if(!e.valueMap)return null;let n=Object.keys(e.valueMap).find(e=>rt(e,t));return n?e.valueMap[n]:null}function st(e,t){return!Array.isArray(e.show)||e.show.length===0||e.show.some(e=>rt(e,t))}function ct(e,t,n){return st(e,t)?Array.isArray(e.hide)?e.hide.some(e=>typeof e==`number`?e===n:rt(e,t)):!1:!0}function lt(e,t){for(let n of Xe(e,`titleKey`)){let e=J(t,n);if(Y(e))return e}return null}function ut(e){return!e||typeof e!=`object`||Array.isArray(e)?[]:Object.entries(e).filter(([,e])=>typeof e==`number`||typeof e==`string`&&e!==``&&!isNaN(e)).map(([e,t])=>({key:e,label:Ge(e),value:Number(t)}))}function dt(e,t){let n=e?.data??e,r=Array.isArray(n?.fields)?n.fields:null,i=t.dynamicCommonCount?.keys?.[0],a=r?[...r.find(e=>e.key===i)?[r.find(e=>e.key===i)]:[],...r.filter(e=>e.key!==i)]:[n];return a.some(e=>Array.isArray(e?.counts))?a.reduce((e,t)=>!t||!Array.isArray(t.counts)?e:(e.total=Math.max(Number(e.total)||0,Number(t.total)||0),t.counts.forEach(({key:t,count:n})=>{e[t]=Number(n)||0}),e),{total:0}):n}function ft(e,t){let n=ut(e),r=t.totalKey,i=r?J(e||{},r):void 0,a=r&&Y(i)&&!isNaN(i),o=n.map((e,t)=>({...e,_i:t})).filter(e=>!(a&&rt(r,[e.key,e.label]))).filter(e=>!ct(t,[e.key,e.label],e._i)).map((e,n)=>{let r=it(t,[e.key,e.label]),i=r?Pe[nt(r)]||r:Ne[e._i%Ne.length];return{label:at(t,[e.key,e.label],e.label),value:e.value,barColor:i,accentColor:n===0?`#f97316`:null,showInfo:n===0}});return{total:a?Number(i):o.reduce((e,t)=>e+t.value,0),rows:et(o,$e(t,1).maxCount)}}function pt({item:e,group:t,color:n}){let r=n=>Xe(t,n).map(t=>J(e,t)).filter(Y),i=r(`titleKey`),a=r(`countKey`),o=r(`nameKey`),c=r(`valueKey`),u=Ue(t,n);return(0,l.jsxs)(s.Card,{className:`dyn-card-item ${u.className}`.trim(),style:u.style,bordered:!0,children:[i.map((e,n)=>(0,l.jsx)(q,{className:`dyn-card-title`,style:X(t,`cardTitle`),children:e},`t${n}`)),a.map((e,n)=>(0,l.jsx)(s.Statistic,{value:e,className:`dyn-card-stat`,valueStyle:X(t,`cardValue`)},`c${n}`)),o.map((e,n)=>(0,l.jsx)(q,{className:`dyn-card-name`,style:X(t,`cardName`),children:e},`n${n}`)),c.length>0&&(0,l.jsx)(`div`,{className:`dyn-card-footer`,style:X(t,`cardFooter`),children:c.map((e,n)=>(0,l.jsx)(q,{className:`dyn-card-sub`,style:X(t,`cardSub`),children:e},`v${n}`))})]})}function mt({group:e}){let{span:t,maxCount:n}=$e(e,4),r=et((Array.isArray(e.list)?e.list:[]).map((t,n)=>({item:t,name:lt(e,t),_i:n})).filter(t=>!ct(e,t.name,t._i)),n);return(0,l.jsx)(s.Card,{className:`dyn-card-section`,style:X(e,`section`),title:Be(e),extra:Ve(e,(0,l.jsxs)(q,{type:`secondary`,style:X(e,`headerExtra`),children:[r.length,` cards`]})),children:(0,l.jsx)(s.Row,{gutter:[16,16],children:r.map(n=>{let r=it(e,n.name)||tt(e,n._i);return(0,l.jsx)(s.Col,{xs:24,sm:12,md:t>=12?12:t*2,lg:t,xl:t,children:(0,l.jsx)(pt,{item:n.item,group:e,color:r})},n._i)})})})}function ht({group:e,items:t}){let{span:n,maxCount:r}=$e(e,4),i=et(t.map((e,t)=>({...e,_i:t})).filter(t=>!ct(e,[t.key,t.label],t._i)),r);return(0,l.jsx)(s.Card,{className:`dyn-card-section`,style:X(e,`section`),title:Be(e),extra:Ve(e,(0,l.jsxs)(q,{type:`secondary`,style:X(e,`headerExtra`),children:[i.length,` cards`]})),children:(0,l.jsx)(s.Row,{gutter:[16,16],children:i.map(t=>{let r=Ue(e,it(e,[t.key,t.label])||tt(e,t._i));return(0,l.jsx)(s.Col,{xs:24,sm:12,md:n>=12?12:n*2,lg:n,xl:n,children:(0,l.jsxs)(s.Card,{className:`dyn-card-item ${r.className}`.trim(),style:r.style,bordered:!0,children:[(0,l.jsx)(q,{className:`dyn-card-title`,style:X(e,`cardTitle`),children:at(e,[t.key,t.label],t.label)}),(0,l.jsx)(s.Statistic,{value:t.value,groupSeparator:e.groupSeparator??`,`,className:`dyn-card-stat`,valueStyle:X(e,`cardValue`)}),Y(ot(e,[t.key,t.label]))&&(0,l.jsx)(q,{className:`dyn-card-sub`,style:X(e,`cardSub`),children:ot(e,[t.key,t.label])})]})},t._i)})})})}function gt({group:e,data:t}){let{total:n,rows:r}=ft(t,e),i=e.tooltipText;return(0,l.jsxs)(s.Card,{className:`submission-card`,style:X(e,`card`),children:[Y(e.title)&&(0,l.jsxs)(s.Row,{justify:`space-between`,align:`middle`,className:`submission-header`,style:X(e,`submissionHeader`),children:[(0,l.jsx)(s.Col,{children:(0,l.jsxs)(q,{className:`submission-title`,style:X(e,`submissionTitle`),children:[e.title,` `,i&&(0,l.jsx)(s.Tooltip,{title:i,children:(0,l.jsx)(c.InfoCircleOutlined,{className:`submission-info-icon`,style:X(e,`infoIcon`)})})]})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{className:`submission-total`,style:X(e,`submissionTotal`),children:Number(n||0).toLocaleString()})})]}),(0,l.jsx)(`div`,{className:`submission-rows`,style:X(e,`submissionRows`),children:r.map((t,r)=>(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(s.Row,{justify:`space-between`,align:`middle`,className:`submission-row-header`,style:X(e,`submissionRowHeader`),children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Row,{align:`middle`,gutter:6,children:(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{className:`submission-row-label`,style:X(e,`submissionRowLabel`),children:t.label})})})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{className:`submission-row-value`,style:X(e,`submissionRowValue`),children:t.value})})]}),(0,l.jsx)(`div`,{className:`submission-bar-track`,style:X(e,`submissionBarTrack`),children:(0,l.jsx)(`div`,{className:`submission-bar-fill`,style:{width:`${t.value/(n||1)*100}%`,background:t.barColor}})})]},`${t.label}-${r}`))})]})}function _t(e){if(!Y(e))return`-`;let t=new Date(e);return!Number.isNaN(t.getTime())&&/date|time/i.test(String(e))?n.An(t):String(e)}function vt({group:e,data:t}){let n=e.totalKey??`totalScore`,r=e.maxKey??`maximumScore`,i=e.statusKey??`status`,a=e.attemptDateKey??`attemptDate`,o=e.timeTakenKey??`timeTaken`,c=e.rankKey??`rank`,u=Number(J(t||{},n)??0),d=Number(J(t||{},r)??100)||100,f=Math.max(0,Math.min(100,Math.round(u/d*100))),p=ft(t,{...e,totalKey:n,hide:[...Array.isArray(e.hide)?e.hide:[],r,i,a,o,c]}).rows,m=[{key:i,label:e.statusLabel??`Status`},{key:a,label:e.attemptDateLabel??`Attempt Date`},{key:o,label:e.timeTakenLabel??`Time Taken`},{key:c,label:e.rankLabel??`Rank`}].filter(e=>Y(J(t||{},e.key)));return(0,l.jsxs)(s.Card,{className:`assessment-card`,style:X(e,`card`),title:Be(e),children:[(0,l.jsxs)(`div`,{className:`assessment-card__top`,children:[(0,l.jsx)(s.Progress,{type:`circle`,percent:f,format:()=>`${Number(u||0).toLocaleString()}/${d.toLocaleString()}`,strokeColor:e.scoreColor??`#6d4aff`,trailColor:e.trailColor??`#edf0f5`}),(0,l.jsx)(`dl`,{className:`assessment-card__meta`,children:m.map(e=>(0,l.jsxs)(`div`,{className:`assessment-card__meta-row`,children:[(0,l.jsx)(`dt`,{children:e.label}),(0,l.jsx)(`dd`,{children:_t(J(t||{},e.key))})]},e.key))})]}),(0,l.jsx)(`div`,{className:`submission-rows assessment-card__rows`,style:X(e,`submissionRows`),children:p.map(t=>(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(s.Row,{justify:`space-between`,align:`middle`,className:`submission-row-header`,style:X(e,`submissionRowHeader`),children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{className:`submission-row-label`,style:X(e,`submissionRowLabel`),children:t.label})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{className:`submission-row-value`,style:X(e,`submissionRowValue`),children:t.value})})]}),(0,l.jsx)(`div`,{className:`submission-bar-track`,style:X(e,`submissionBarTrack`),children:(0,l.jsx)(`div`,{className:`submission-bar-fill`,style:{width:`${Math.max(0,Math.min(100,Number(t.value)/d*100))}%`,background:t.barColor}})})]},t.label))})]})}function yt(e,t={},n={}){let r=Y(e)?e:t.fallback;if(!Y(r))return`-`;let i=Number(r);if(!Number.isFinite(i))return String(r);let a=t.suffix??n.valueSuffix??``;return`${i.toFixed(1).replace(/\.0$/,``)}${a}`}function bt({group:e,data:t}){let n=Array.isArray(t);return(0,l.jsxs)(s.Card,{className:`timesheet-summary-card`,size:`small`,children:[Y(e.title)&&(e.plainHeader?(0,l.jsx)(q,{type:`secondary`,style:{fontSize:12,fontWeight:600},children:e.title}):(0,l.jsxs)(`div`,{className:`timesheet-summary-card__head`,children:[(0,l.jsx)(ze,{level:5,style:{margin:0},children:e.title}),e.headerExtra]})),!n&&(0,l.jsx)(`div`,{className:`timesheet-summary-card__metrics`,children:(e.rows??[]).map(n=>(0,l.jsxs)(`div`,{className:`timesheet-summary-card__metric-row`,children:[(0,l.jsxs)(q,{type:`secondary`,style:{fontSize:12},children:[n.label,` `,n.sublabel&&(0,l.jsx)(`span`,{style:{fontSize:11},children:n.sublabel})]}),(0,l.jsx)(q,{strong:!0,style:{fontSize:13,whiteSpace:`nowrap`,color:n.valueColor},children:yt(J(t??{},n.key),n,e)})]},n.key))}),n&&t.length>0&&(0,l.jsx)(`div`,{className:`timesheet-summary-card__weekly`,children:t.map((t,n)=>(0,l.jsxs)(`div`,{className:`timesheet-summary-card__week-row`,children:[(0,l.jsx)(q,{type:`secondary`,style:{fontSize:12},children:e.listRows?.itemLabel?e.listRows.itemLabel(t,n):`Row ${n+1}`}),(0,l.jsx)(q,{strong:!0,style:{fontSize:12},children:yt(J(t,e.listRows?.itemValueKey),e.listRows,e)})]},n))})]})}function xt({group:e,data:t}){return(0,l.jsxs)(s.Card,{className:`timesheet-summary-card`,size:`small`,children:[(Y(e.title)||e.headerExtra)&&(0,l.jsxs)(`div`,{className:`timesheet-summary-card__head`,children:[Y(e.title)&&(0,l.jsx)(ze,{level:5,style:{margin:0},children:e.title}),e.headerExtra]}),(0,l.jsx)(`div`,{className:`timesheet-summary-card__bars`,children:(e.rows??[]).map(n=>(0,l.jsxs)(`div`,{className:`timesheet-summary-card__bar`,style:{background:n.bg},children:[(0,l.jsx)(q,{style:{fontSize:12,color:n.color,fontWeight:500},children:n.label}),(0,l.jsx)(q,{strong:!0,style:{fontSize:13,color:n.color},children:yt(J(t??{},n.key),n,e)})]},n.key))})]})}function St({group:e,data:t}){let n=Array.isArray(t)?t:[],r=`finance-kpi-row${e.compact?` finance-kpi-row--compact`:``}`;if(e.loading){let e=n.length||4;return(0,l.jsx)(`div`,{className:r,children:Array.from({length:e},(e,t)=>(0,l.jsxs)(`div`,{className:`finance-kpi fin-kpi--skeleton`,children:[(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--label`}),(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--value`})]},t))})}return(0,l.jsx)(`div`,{className:r,children:n.map(e=>(0,l.jsxs)(`div`,{className:`finance-kpi fin-kpi--${e.tone??`neutral`}`,children:[e.icon?(0,l.jsx)(`span`,{className:`fin-kpi__icon`,children:e.icon}):null,(0,l.jsxs)(`span`,{className:`fin-kpi__body`,children:[(0,l.jsx)(`span`,{className:`finance-kpi__label`,children:e.label}),(0,l.jsx)(`strong`,{className:`finance-kpi__value`,children:e.value}),e.sub??e.hint?(0,l.jsx)(`span`,{className:`finance-kpi__hint`,children:e.sub??e.hint}):null]})]},e.key??e.label))})}function Ct(e,t){return nt(J(t,e.pillKey||`status`))===`resolved`}function wt(e,t){return Y(e.dateKey?Ke(J(t,e.dateKey)):null)}function Tt(e,t){let n=nt(J(t,e.pillKey||`status`));if(n===`tagged`||n===`tag user`||n===`tagged user`)return!0;let r=t?.receiver??t?.receivers??t?.receiverId??t?.receiverName??t?.taggedUser;if(Array.isArray(r))return r.length>0;if(r&&typeof r==`object`)return Object.keys(r).length>0;if(Y(r))return!0;let i=`${J(t,e.headingKey||`title`)??``} ${J(t,e.bodyKey||`notes`)??``}`;return/(^|\s)@[^\s]+/.test(i)}function Et(e,t,n){return Ct(e,t)?`gray`:Tt(e,t)?`blue`:wt(e,t)?`peach`:it(e,e.colorBy?J(t,e.colorBy):null)||(e.color&&e.color!==`auto`?e.color:Me[n%Me.length])}function Dt(e,t){let{start:n,end:r}=e.dateRange||{};if(!n||!r)return!0;let i=J(t,e.footerRightKey||`createdAt`);if(!Y(i))return!0;let a=new Date(i);return isNaN(a)?!0:a>=n&&a<=r}function Ot(e,t,n){let r=t.dateKey?Ke(J(e,t.dateKey)):null;return{type:Et(t,e,n),pill:t.pillKey?J(e,t.pillKey):null,heading:t.headingKey?J(e,t.headingKey):null,body:t.bodyKey?J(e,t.bodyKey):null,footerLeft:t.footerLeftKey?J(e,t.footerLeftKey):null,footerRight:t.footerRightKey?Ke(J(e,t.footerRightKey)):null,dot:r?`#f97316`:null,date:r}}function kt({text:e,lines:t,style:n}){let r=(0,o.useRef)(null),[i,a]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=r.current;if(!e)return;let t=0,n=()=>{t=requestAnimationFrame(()=>{let t=e.scrollHeight-e.clientHeight>1;a(e=>e===t?e:t)})};n();let i=new ResizeObserver(n);return i.observe(e),()=>{cancelAnimationFrame(t),i.disconnect()}},[e,t]);let c=`sticky-note-body${t?` clamp-${t}`:``}`;return(0,l.jsx)(s.Popover,{trigger:`hover`,placement:`topLeft`,overlayClassName:`sticky-note-popover`,content:i?(0,l.jsx)(`div`,{className:`sticky-note-popover-content`,children:e}):null,open:i?void 0:!1,children:(0,l.jsx)(`div`,{ref:r,className:c,style:n,children:e})})}function At({group:e}){let t=(0,d.useNavigate)(),n=(0,d.useLocation)(),r=()=>t(`/popup/sticky-notes`,{state:{background:n,selectedIds:[],selectedRecords:[],moduleName:`general`,popupContext:{}}}),i=e=>t(`/popup/sticky-notes`,{state:{background:n,selectedIds:[],selectedRecords:[],moduleName:`general`,popupContext:{editingNoteId:e._id??e.id,editingHeading:e.title,editingComments:e.notes,editingTargetDate:e.reminder?.time||void 0}}}),[a,u]=(0,o.useState)(new Set),f=async e=>{let t=e._id??e.id;u(e=>new Set(e).add(t));try{await se(t),s.message.success(`Note resolved`)}catch{s.message.error(`Failed to resolve note`),u(e=>{let n=new Set(e);return n.delete(t),n})}},{span:p,maxCount:m}=$e(e,2),h=t=>e.colorBy?J(t,e.colorBy):e.headingKey?J(t,e.headingKey):null,g=(Array.isArray(e.list)?e.list:[]).filter(e=>!a.has(e._id??e.id)).map((e,t)=>({item:e,_i:t})).filter(({item:t,_i:n})=>!ct(e,h(t),n)).filter(({item:t})=>Dt(e,t)),[_,v]=(0,o.useState)(`todo`),y=g.filter(({item:t})=>!Ct(e,t)),b=g.filter(({item:t})=>Ct(e,t)),x=e.showTabs,S=x?_===`resolved`?b:y:g,[C,w]=(0,o.useState)(e.pageSize||12),[T,E]=(0,o.useState)(1);(0,o.useEffect)(()=>{E(1)},[_,e.dateRange]);let D=Math.max(1,Math.ceil(S.length/C));(0,o.useEffect)(()=>{E(e=>Math.min(e,D))},[D]);let O=x?S.slice((T-1)*C,T*C):et(g,m);return(0,l.jsxs)(s.Card,{className:`sticky-card`,style:X(e,`section`),title:Be(e),extra:Ve(e,(0,l.jsxs)(`div`,{className:`sticky-card-actions`,children:[e.headerExtra,(0,l.jsx)(s.Tooltip,{title:`Add note`,children:(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.PlusOutlined,{}),size:`small`,onClick:r})}),Y(e.viewAllUrl)&&(0,l.jsx)(s.Button,{type:`link`,size:`small`,onClick:()=>t(e.viewAllUrl,{state:{moduleName:e.moduleName,title:e.title,request:e.request}}),children:`View all`})]})),children:[x&&(0,l.jsx)(P,{activeKey:_,onChange:v,tabs:[{key:`todo`,title:`To-do`,count:y.length},{key:`resolved`,title:`Resolved Notes`,count:b.length}]}),O.length===0?(0,l.jsx)(s.Empty,{description:`No notes found`}):(0,l.jsx)(`div`,{className:x?`sticky-notes-scroll`:void 0,children:(0,l.jsx)(s.Row,{gutter:[12,12],children:O.map(({item:t,_i:n})=>{let r=Ot(t,e,n),a=Ue(e,r.type);return(0,l.jsx)(s.Col,{xs:24,sm:24,md:p>=12?12:p*2,lg:p,xl:p,children:(0,l.jsxs)(`div`,{className:`sticky-note ${a.className}`.trim(),style:a.style,children:[(0,l.jsxs)(s.Space,{size:4,className:`sticky-note-hover-actions`,children:[(0,l.jsx)(s.Tooltip,{title:`Edit`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.EditOutlined,{}),onClick:()=>i(t)})}),(0,l.jsx)(s.Tooltip,{title:`Resolve`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.CheckCircleOutlined,{}),onClick:()=>f(t)})})]}),(0,l.jsxs)(s.Space,{size:8,align:`center`,className:`sticky-note-pill-row`,children:[Y(r.pill)&&(0,l.jsxs)(s.Tag,{style:X(e,`stickyPill`),children:[r.dot&&(0,l.jsx)(`span`,{className:`sticky-note-dot`,style:{background:r.dot}}),r.pill]}),r.date&&(0,l.jsx)(q,{className:`sticky-note-date`,style:X(e,`stickyDate`),children:r.date})]}),Y(r.heading)&&(0,l.jsx)(q,{strong:!0,className:`sticky-note-heading`,style:X(e,`stickyHeading`),children:r.heading}),Y(r.body)&&(0,l.jsx)(kt,{text:r.body,lines:e.bodyLines,style:X(e,`stickyBody`)}),(0,l.jsxs)(s.Row,{justify:`space-between`,align:`middle`,className:`sticky-note-footer`,style:X(e,`stickyFooter`),children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{style:X(e,`stickyFooterText`),children:r.footerLeft})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(q,{style:X(e,`stickyFooterText`),children:r.footerRight})})]})]})},n)})})}),x&&S.length>0&&(0,l.jsx)(`div`,{className:`sticky-notes-pagination`,children:(0,l.jsx)(Re,{current:T,pageSize:C,total:S.length,onChange:E,onPageSizeChange:w})})]})}function jt({group:e,children:t}){let n=e.frameClassName||`dyn-frame`,r=e.viewAll?(0,l.jsx)(`a`,{className:`dyn-frame-view-all`,children:typeof e.viewAll==`string`?e.viewAll:`View all`}):void 0;return(0,l.jsxs)(s.Card,{className:n,title:e.frameTitle,extra:r,children:[t,e.footer&&(0,l.jsx)(`div`,{className:`${n}-footer`})]})}function Mt({group:e,data:t}){let n=e.variant===`sticky`?Je(e.title):e.title,r=e.variant===`sticky`&&Y(e.totalCount)?`${n} (${Number(e.totalCount).toLocaleString()})`:n,i=r===e.title?e:{...e,title:r},a=i.frame?{...i,title:void 0}:i,o=a.variant===`sticky`?(0,l.jsx)(At,{group:{...a,list:Array.isArray(t)?t:[]}}):a.variant===`counts`?(0,l.jsx)(ht,{group:a,items:ut(t)}):a.variant===`submission`?(0,l.jsx)(gt,{group:a,data:t}):a.variant===`assessment`?(0,l.jsx)(vt,{group:a,data:t}):a.variant===`metrics`?(0,l.jsx)(bt,{group:a,data:t}):a.variant===`bars`?(0,l.jsx)(xt,{group:a,data:t}):a.variant===`kpi`?(0,l.jsx)(St,{group:a,data:t}):(0,l.jsx)(mt,{group:{...a,list:Array.isArray(t)?t:[]}});return i.frame?(0,l.jsx)(jt,{group:i,children:o}):o}function Nt({moduleName:e,title:t,maxCount:n,layout:r,columns:i,request:a,viewAll:c=!0,staticData:u,showTabs:d,dateRange:f,headerExtra:h,rows:g,loading:_}){let v=Fe()[e],y=a?JSON.stringify(a):``,b=g?JSON.stringify(g):``,x=(0,o.useMemo)(()=>{if(!v)return v;let o={title:t,maxCount:n,layout:r,columns:i,showTabs:d,dateRange:f,headerExtra:h,rows:g,loading:_},s={...v,moduleName:e};for(let e in o)Y(o[e])&&(s[e]=o[e]);return a&&(s.request={...v.request,...a,params:{...v.request?.params,...a.params},body:{...v.request?.body,...a.body}}),c||(s.viewAllUrl=void 0),s},[v,t,n,r,i,y,c,d,f,h,b,_]),[S,C]=(0,o.useState)({moduleName:null,resp:null,error:null}),[w,T]=(0,o.useState)(0);(0,o.useEffect)(()=>{if(!x?.refreshEvent)return;let e=()=>T(e=>e+1);return window.addEventListener(x.refreshEvent,e),()=>window.removeEventListener(x.refreshEvent,e)},[x?.refreshEvent]),(0,o.useEffect)(()=>{if(!x)return;if(u!==void 0){let t=dt(u,x);C({moduleName:e,resp:t,error:null});return}if(x.dynamicCommonCount){let t=!0;return m(x.dynamicCommonCount).then(n=>{t&&C({moduleName:e,resp:dt(n,x),error:null})}).catch(n=>{t&&C({moduleName:e,resp:null,error:n})}),()=>{t=!1}}if(!x.request)return;let t=!0;return p(e,x.request).then(n=>{t&&C({moduleName:e,resp:n,error:null})}).catch(n=>{t&&C({moduleName:e,resp:null,error:n})}),()=>{t=!1}},[e,x,u,w]);let E=S.moduleName!==e,D=E?null:S.error,O=E?null:S.resp;if(!x)return(0,l.jsx)(s.Empty,{description:`Unknown dashboard module: ${e}`});if(E)return(0,l.jsx)(s.Card,{className:`dyn-card-section`,style:X(x,`section`),title:Be(x),children:(0,l.jsx)(`div`,{style:{textAlign:`center`,padding:24},children:(0,l.jsx)(s.Spin,{})})});if(D)return(0,l.jsx)(s.Card,{className:`dyn-card-section`,style:X(x,`section`),title:Be(x),children:(0,l.jsx)(s.Empty,{description:`Failed to load: ${D.message}`})});let k=We(O,x.listPath),A=x.variant===`sticky`?Ye(O,k):null,j=x.variant===`sticky`?{...x,...A}:x;return(0,l.jsx)(Mt,{group:j,data:k})}function Pt({moduleName:e,title:t,layout:n,columns:r,maxCount:i,request:a,viewAll:o,staticData:c,showTabs:u,dateRange:d,headerExtra:f,rows:p,loading:m}){return e?(0,l.jsx)(`div`,{className:`dyn-cards`,children:(0,l.jsx)(Nt,{moduleName:e,title:t,layout:n,columns:r,maxCount:i,request:a,viewAll:o,staticData:c,showTabs:u,dateRange:d,headerExtra:f,rows:p,loading:m})}):(0,l.jsx)(s.Empty,{description:`DynamicCards: a moduleName prop is required`})}var{Text:Ft}=s.Typography;function It(e){return(e??[]).map(e=>({key:e.userId,title:e.isSelf?`${e.name} (You)`:e.name,searchText:`${e.name} ${e.email??``}`.toLowerCase(),children:It(e.children)}))}function Lt(e,t){let n=[];for(let r of e){let e=Lt(r.children??[],t);(r.searchText.includes(t)||e.length>0)&&n.push({...r,children:e})}return n}function Rt(e,t=[]){for(let n of e)t.push(n.key),Rt(n.children??[],t);return t}function zt({value:e=[],onChange:t}){let[n,r]=(0,o.useState)(null),[i,a]=(0,o.useState)(!0),[u,d]=(0,o.useState)(null),[f,p]=(0,o.useState)(``),[m,h]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=!0;return g().then(t=>{e&&r(It(t?.users))}).catch(t=>{e&&d(t)}).finally(()=>{e&&a(!1)}),()=>{e=!1}},[]);let _=f.trim().toLowerCase(),v=(0,o.useMemo)(()=>_&&n?Lt(n,_):n,[n,_]),y=_?{expandedKeys:Rt(v??[])}:{},b=(0,l.jsxs)(`div`,{style:{width:280},children:[(0,l.jsx)(s.Input.Search,{placeholder:`Search users`,allowClear:!0,value:f,onChange:e=>p(e.target.value),style:{marginBottom:8}}),i&&(0,l.jsx)(`div`,{style:{padding:24,textAlign:`center`},children:(0,l.jsx)(s.Spin,{size:`small`})}),u&&(0,l.jsx)(s.Empty,{description:`Could not load users`}),!i&&!u&&(v?.length?(0,l.jsx)(`div`,{style:{maxHeight:280,overflow:`auto`},children:(0,l.jsx)(s.Tree,{checkable:!0,selectable:!1,defaultExpandAll:!0,treeData:v,checkedKeys:e,onCheck:(e,n)=>t(n.checkedNodes.map(e=>e.key)),...y})}):(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:`No users`})),e.length>0&&(0,l.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginTop:8,paddingTop:8,borderTop:`1px solid #f0f0f0`},children:[(0,l.jsxs)(Ft,{type:`secondary`,children:[e.length,` selected`]}),(0,l.jsx)(s.Button,{type:`link`,size:`small`,onClick:()=>t([]),children:`Clear`})]})]});return(0,l.jsx)(s.Popover,{content:b,trigger:`click`,placement:`bottomRight`,open:m,onOpenChange:h,children:(0,l.jsx)(s.Badge,{count:e.length,size:`small`,offset:[-4,4],children:(0,l.jsxs)(s.Button,{icon:(0,l.jsx)(c.FilterOutlined,{}),children:[`Filter by `,(0,l.jsx)(c.DownOutlined,{style:{fontSize:10}})]})})})}function Bt(e,t={}){let n=Array.isArray(e?.autoValueRules)?e.autoValueRules:[];for(let e of n){let n=Array.isArray(e?.whenRoleId)?e.whenRoleId.map(Number):[],r=Array.isArray(e?.whenUserId)?e.whenUserId.map(Number):[],i=t.roleId!==void 0&&n.includes(t.roleId),a=t.userId!==void 0&&r.includes(t.userId);if(i||a)return{matched:!0,value:e.value}}return{matched:!1,value:void 0}}function Vt(e){if(e==null||e===``)return``;let t=Number(e);if(!Number.isFinite(t)||t<0)return``;if(t===0)return`today`;if(t===1)return`yesterday`;if(t<30)return`${t} days ago`;if(t<60)return`about a month ago`;if(t<365)return`about ${Math.round(t/30)} months ago`;let n=Math.floor(t/365);return n===1?`over a year ago`:`over ${n} years ago`}function Ht(e,t){return(Array.isArray(t)&&t.length?t:Object.keys(e??{})).map(t=>e?.[t]).map(e=>e==null?``:String(e).trim()).filter(Boolean).join(` · `)}function Ut(e,t={}){return e?String(e).replace(/\{(\w+)\}/g,(e,n)=>t[n]===void 0?e:String(t[n])):``}function Wt(e,t){let n=Ht(e?.record,t),r=Vt(e?.updatedDaysAgo);return{name:n||`an existing record`,age:r||`previously`,days:Number.isFinite(Number(e?.updatedDaysAgo))?String(e.updatedDaysAgo):``,updatedOn:e?.updatedAt?String(e.updatedAt).slice(0,10):``,stage:e?.stage??``,weight:e?.weight??``}}function Gt(e,t={}){let n=Wt(e,t.displayFields),r=(e?.policy??t.policy)===`block`;return Ut(e?.message||t.message||(r?`We already have {name} on file — last updated {age}. Please open that record and update it, rather than adding a second copy.`:`We already have {name} on file — last updated {age}. You can carry on and update that record with what you’ve just entered, or go back and check first.`),n)}function Kt(e,t={}){return e?.duplicate?(e.policy??t.policy??`prompt`)===`block`:!1}function qt(e,t){let n=e?.record??{},r=(Array.isArray(t)&&t.length?t:Object.keys(n)).map(e=>({label:Jt(e),value:n[e]})).filter(e=>e.label&&e.value!==void 0&&e.value!==null&&String(e.value).trim()!==``),i=Vt(e?.updatedDaysAgo);return i&&r.push({label:`Last updated`,value:i}),r}function Jt(e){let t=String(e??``).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_\-.]+/g,` `).trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):``}function Yt({form:e,moduleName:t,recordId:r,config:i={},onUseExisting:a}={}){let[s,c]=(0,o.useState)(!1),l=(0,o.useRef)(null),u=(0,o.useCallback)(async i=>{if(!t)return{duplicate:!1};c(!0);try{return await n.mt({module:t,payload:i??e.getFieldsValue(!0)??{},excludeId:r})}finally{c(!1)}},[e,t,r]);return{prompt:(0,o.useCallback)(async({reason:e,payload:t,carry:r}={})=>{let o=await u(t);if(!o?.duplicate)return l.current=null,`clear`;if(l.current&&l.current===o.id)return`existing`;let s=Gt(o,i),c=qt(o,i.displayFields),d=o.weight===`weak`?`This might be someone you already have`:`You already have this person on file`;return Kt(o,i)?(await n.Vt({tone:`duplicate`,title:d,facts:c,body:s}),`blocked`):await n.Bt({tone:`duplicate`,title:d,facts:c,body:s,okText:`Open their record`,cancelText:`Let me check first`,footnote:r?.files?`We’ll take you to their record with the résumé you just uploaded already attached — save there to keep it. The one already on file is kept too, as an earlier version. Nothing on this form has been filled in.`:`Everything already on their record is kept. Nothing on this form has been filled in.`})?(l.current=o.id??!0,a?.(o.id,o,e,r),`existing`):`blocked`},[u,i,a]),check:u,checking:s,acknowledgedId:l}}var Xt=[[`uploadname`,`uploadedfilename`,`originalname`,`filename`],[`uniquename`]],Zt=`copyuniquename`;function Qt(e,t,{excludeSanitised:n=!1}={}){let r=String(e).toLowerCase();return n&&r.endsWith(Zt)?!1:t.some(e=>r.endsWith(e))}function $t(e){if(!e||typeof e!=`object`)return``;let t=e.uploadedFileName??e.name;if(typeof t==`string`&&t.trim())return t.trim();let n=Object.entries(e).filter(([,e])=>typeof e==`string`&&e.trim());for(let e of Xt){let t=n.find(([t])=>Qt(t,e,{excludeSanitised:!0}));if(t)return t[1].trim()}let r=n.find(([e])=>String(e).toLowerCase().endsWith(Zt));return r?r[1].trim():``}function en(e){if(!e||typeof e!=`object`)return``;let t=e.location??e.url;if(typeof t==`string`&&t.trim())return t.trim();let n=Object.entries(e).find(([e,t])=>typeof t==`string`&&t.trim()&&String(e).toLowerCase().endsWith(`copylocation`));return n?n[1].trim():``}var tn=`authToken`,nn=`authUser`,rn=`authLoginSession`,an=[`access_token`,`refresh_token`,`id_token`,`token_type`,`expires_in`,`refresh_expires_in`,`menu`,`footermenu`,`menuPermission`,`default_values`,`roleId`,`companyName`,`preferred_Username`,`user_Email`,`userName`,`userId`,`tenantId`,`businessId`,`businessUnitId`,`activeKey`,`ct_project_id`,`ct_project_name`],on=`test-flows`,sn=[{value:`module`,label:`Module`,isVisible:!0,type:`text`},{value:`flow`,label:`Flow`,isVisible:!0,type:`text`},{value:`step_order`,label:`Step Order`,isVisible:!0,type:`number`},{value:`keyword`,label:`Action`,isVisible:!0,type:`text`},{value:`description`,label:`Description`,isVisible:!0,type:`text`},{value:`target`,label:`Key`,isVisible:!0,type:`text`},{value:`tags`,label:`Tags`,isVisible:!0,type:`text`},{value:`value`,label:`Value`,isVisible:!0,type:`text`},{value:`expected`,label:`Expected`,isVisible:!0,type:`text`}],cn=`lms-flows`,ln=[{value:`module`,label:`Module`,isVisible:!0,type:`text`},{value:`flow`,label:`Flow`,isVisible:!0,type:`text`},{value:`step_order`,label:`Step Order`,isVisible:!0,type:`number`},{value:`keyword`,label:`Action`,isVisible:!0,type:`text`},{value:`description`,label:`Description`,isVisible:!0,type:`text`},{value:`target`,label:`Key`,isVisible:!0,type:`text`},{value:`tags`,label:`Tags`,isVisible:!0,type:`text`},{value:`value`,label:`Value`,isVisible:!0,type:`text`},{value:`expected`,label:`Expected`,isVisible:!0,type:`text`}];function un(){let e=localStorage.getItem(tn),t=sessionStorage.getItem(rn)===`1`;return e&&t?e:null}async function dn({jobId:e,limit:n=10,offset:r=0,sortBy:i=`new`,type:a=`myVendor`}){return await bn(t.T,`/vendor/hotlist`,{method:`POST`,body:JSON.stringify({jobId:e,limit:n,offset:r,sortBy:i,type:a})})}async function fn(e){let n=await bn(t.S,`/get-bulkmail-details?jobId=${encodeURIComponent(e)}`);return n.data??n}async function pn(e,n=``){let r=String(e??``).trim();if(!r)return``;let i=await bn(t.E,`/format-mail-content`,{method:`POST`,body:JSON.stringify({contents:r,subject:String(n??``)})});if(i?.status===!1)throw Error(i?.error||`Unable to format mail content`);return String(i?.html??i?.contents??i?.data?.html??i?.data?.contents??``).trim()}async function mn({jobId:e,toMail:n,ccMail:r,bccMail:i,subject:a,contents:o,attachments:s=[]}){let c=localStorage.getItem(`tenantId`)||`93c782a4aa626175e5d11afa`,l=localStorage.getItem(`businessId`)||`83c782a4aa626175e5d11afa`,u=localStorage.getItem(`businessUnitId`)||`63b57588fd768a839dbc0f63`,d=new FormData;d.append(`json`,JSON.stringify({schemaVersion:1,tenantId:c,businessId:l,businessUnitId:u,jobId:e,toMail:n,ccMail:r,bccMail:i,contents:o,subject:a})),(s??[]).forEach(e=>{e instanceof File&&d.append(`attachments`,e,e.name)});let{"Content-Type":f,...p}=await yn(),m=await fetch(`${t.S}/send-bulkmail`,{method:`POST`,headers:p,body:d});if(m.status===401&&hn(),!m.ok)throw Error(`API ${m.status}: ${m.statusText}`);let h=await m.text();return h?JSON.parse(h):{}}function hn(){localStorage.removeItem(tn),localStorage.removeItem(nn),an.forEach(e=>localStorage.removeItem(e)),sessionStorage.removeItem(rn),window.dispatchEvent(new Event(`auth:logout`))}function gn(e=``){let t=String(e??``).trim();return t===`myJobs`||t===`allJobs`||t===`fulfilled`?t:``}function _n(e){let t=String(n.xn(e)??``).trim().toLowerCase();return t===`job`||t===`jobs`}async function vn(){let e=un();if(e)return e;let t=Error(`Authentication required`);throw t.status=401,t}async function yn(){return{"Content-Type":`application/json`,Authorization:`Bearer ${await vn()}`}}async function bn(e,t,n={}){let r=await yn(),i={...n,headers:{...r,...n.headers}},a=await fetch(`${e}${t}`,i);if(a.status===401&&hn(),!a.ok){let e=Error(`API ${a.status}: ${a.statusText}`);throw e.status=a.status,e}return a.json()}async function xn(e,t){let n=await bn(e,t);return n.data??n}async function Sn(e){return xn(t.D,e)}async function Cn(e){return xn(t.x,e)}async function wn(e){return e===on?sn:e===cn?ln:Sn(`/filter-dropdown-fields?module=${encodeURIComponent(n.xn(e))}`)}async function Tn(e,{configType:t,userId:r,roleId:i}={}){if(e===on)return sn;if(e===cn)return ln;let a=new URLSearchParams({module:n.xn(e)});return t&&a.set(`configType`,t),r!=null&&a.set(`userId`,String(r)),i!=null&&a.set(`roleId`,String(i)),Cn(`/admin/field-config?${a}`)}async function En({limit:e=10,offset:t=0,search:n=``,module:r=``,keyword:i=``,tags:a=``,active:o}={}){let s=new URLSearchParams({limit:String(e),offset:String(t)});return n&&s.append(`search`,n),r&&s.append(`module`,r),i&&s.append(`keyword`,i),a&&s.append(`tags`,a),o!=null&&o!==``&&s.append(`active`,String(o)),Cn(`/test-flows?${s.toString()}`)}async function Dn({limit:e=10,offset:t=0,search:n=``,module:r=``,keyword:i=``,tags:a=``,active:o}={}){let s=new URLSearchParams({limit:String(e),offset:String(t)});return n&&s.append(`search`,n),r&&s.append(`module`,r),i&&s.append(`keyword`,i),a&&s.append(`tags`,a),o!=null&&o!==``&&s.append(`active`,String(o)),Cn(`/lms-flows?${s.toString()}`)}async function On(e,r=10,i=0,a={}){let{scope:o=``,sort:s=``,sortDir:c=``,search:l=``,filters:u=[],queryParams:d={}}=a;if(e===on){let e=await En({limit:r,offset:i}),t=Array.isArray(e?.items)?e.items:[],n=Number(e?.total)||0;return{items:t,total:n,limit:r,offset:i,tabs:[{key:`all`,title:`Test Cases`,count:n}]}}if(e===cn){let e=await Dn({limit:r,offset:i}),t=Array.isArray(e?.items)?e.items:[],n=Number(e?.total)||0;return{items:t,total:n,limit:r,offset:i,tabs:[{key:`all`,title:`LMS Cases`,count:n}]}}let f=new URLSearchParams({module:n.xn(e),limit:String(r),offset:String(i)}),p=_n(e)?gn(o):String(o??``).trim();p&&f.set(`scope`,p),s&&f.set(`sort`,s),c&&f.set(`sortDir`,c),String(l??``).trim()&&f.set(`search`,String(l).trim());let m=Pn(u.filter(e=>e?.field));m.length&&f.set(`filters`,JSON.stringify(m)),Object.entries(d??{}).forEach(([e,t])=>{t!=null&&String(t).trim()!==``&&f.set(e,String(t))});let h=await bn(t.x,`/module-data-list?${f.toString()}`),g=kn(h),_=g.some(e=>Mn(e)),v=g.some(e=>Nn(e));if(_||v)try{let{transformDiceResponseToInternalFormat:e}=await Promise.resolve().then(()=>require("./diceCandidateMapper-BjMhHno3.cjs")).then(e=>e.t),t=e(h,h),n=t?.data?.data??[];return{items:n,total:jn(h,p)||jn(t,p)||n.length,limit:r,offset:i,tabs:t?.data?.tabs??h?.tabs??h?.data?.tabs??[],fields:t?.data?.fields??h?.fields??h?.data?.fields??[],tabField:t?.data?.tabField??h?.tabField??h?.data?.tabField??``,actionRules:t?.data?.actionRules??h?.data?.actionRules??[],actions:t?.data?.actions??h?.data?.actions??[],columnActions:t?.data?.columnActions??h?.data?.columnActions??[]}}catch(e){console.error(`[getModuleDataList] Dice transformation failed:`,e)}return h}function kn(e){let t=e?.data??e,n=Array.isArray(t)?t:t?.rows??t?.records??t?.items??t?.list??t?.data??e?.items??e?.records??[];return Array.isArray(n)?n:[]}function An(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function jn(e,t=``){let n=e?.data??e,r=kn(e),i=e?.count,a=n?.count,o=String(t??``).trim().toLowerCase();if(i&&typeof i==`object`){let e=An(o?i[o]:void 0,i.total,i.searchCount,i.count);if(e!==void 0)return e}if(a&&typeof a==`object`){let e=An(o?a[o]:void 0,a.total,a.searchCount,a.count);if(e!==void 0)return e}return An(e?.total,typeof i==`object`?void 0:i,e?.totalCount,n?.total,typeof a==`object`?void 0:a,n?.totalCount,r.length)??0}function Mn(e){let t=e?.skills??e?.technicalSkills??e?.primarySkills;return!Array.isArray(t)||t.length===0?!1:t.some(e=>e&&typeof e==`object`&&(`skill`in e||`lastUsed`in e))}function Nn(e){return[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].flat().some(e=>String(e??``).trim().toLowerCase()===`dice`)||!!e?.customFields?.diceProfileData}function Pn(e){let t=[];for(let n of e){if(!n.field)continue;let e=n.operator===`or`?`or`:`and`;if(n.operator===`isEmpty`){t.push({field:n.field,op:`isEmpty`,operator:`and`});continue}if(n.operator===`notEmpty`){t.push({field:n.field,op:`notEmpty`,operator:`and`});continue}if(n.filterInputType===`text`){let r=typeof n.value==`string`?n.value.trim():``;r&&t.push({field:n.field,op:`contains`,value:r,operator:e});continue}if(n.from||n.to){n.from&&t.push({field:n.field,op:`gte`,value:String(n.from),operator:e}),n.to&&t.push({field:n.field,op:`lte`,value:String(n.to),operator:`and`});continue}Array.isArray(n.values)&&n.values.length>0&&t.push({field:n.field,op:`in`,values:n.values.map(String),operator:e,...Array.isArray(n.groupFields)&&n.groupFields.length>1?{groupFields:n.groupFields}:{}})}return t}async function Fn(e,t,r=``,i={}){let{limit:a=50,offset:o=0,dataSource:s,groupName:c,lookup:l,groupFields:u=[],groupSeparator:d=` `}=i,f=new URLSearchParams({module:n.xn(e),field:t,value:r,limit:String(a),offset:String(o)});return s&&f.set(`dataSource`,s),Array.isArray(u)&&u.length>1&&(f.set(`groupFields`,u.join(`,`)),f.set(`groupSeparator`,d??` `)),s===`group`&&c&&f.set(`groupName`,c),s===`lookup`&&l?.collection&&(f.set(`lookupCollection`,l.collection),l.displayField&&f.set(`lookupField`,l.displayField)),Sn(`/filter-dropdown-values?${f}`)}function In(e){let t=e?.data??e,n=Array.isArray(t)?t:Array.isArray(t?.groups)?t.groups:Array.isArray(e?.groups)?e.groups:[],r=t?.recordMeta??e?.recordMeta;return r&&typeof r==`object`&&(n.recordMeta=r),n}async function Ln({module:e,id:n,view:r}={}){if(!e)throw Error(`module is required to fetch form groups`);let a=await yn(),o=new URLSearchParams({module:e});n&&o.set(`id`,String(n)),r&&o.set(`view`,String(r));let s=`${t.x}/admin/form-groups?${o.toString()}`;return In(await i.t(s,async()=>{let e=await fetch(s,{method:`GET`,headers:a});if(!e.ok)throw Error(`API ${e.status}: ${e.statusText}`);return e.json()}))}async function Rn({searchQuery:e,candidateId:n}){let r=localStorage.getItem(`tenantId`)||`93c782a4aa626175e5d11afa`,i=localStorage.getItem(`businessId`)||`83c782a4aa626175e5d11afa`,a=localStorage.getItem(`businessUnitId`)||`63b57588fd768a839dbc0f63`,o=Number(localStorage.getItem(`userId`))||1;return bn(t.T,`/joblist`,{method:`POST`,body:JSON.stringify({tenantId:r,businessId:i,businessUnitId:a,searchQuery:e,userId:o,candidateId:Array.isArray(n)?n:[n]})})}async function zn(e=``){let n=e?`?search=${encodeURIComponent(e)}`:``;return xn(t.T,`/users/any${n}`)}function Bn(e){if(!e||typeof e!=`string`)return null;try{let t=e.split(`.`)[1];if(!t)return null;let n=t.replace(/-/g,`+`).replace(/_/g,`/`),r=n.padEnd(Math.ceil(n.length/4)*4,`=`);return JSON.parse(atob(r))}catch{return null}}function Vn(){return Bn(localStorage.getItem(`access_token`)||localStorage.getItem(`authToken`))??{}}function Hn(){let e=Vn();return{userId:e.userId??e.user_id??e.USER_ID,roleId:e.roleId??e.role_id??e.ROLE_ID}}function Un(){let e=Hn();return{userId:e.userId??localStorage.getItem(`userId`)??void 0,roleId:e.roleId??localStorage.getItem(`roleId`)??void 0}}function Wn(e){let[t,n]=(0,o.useState)([]),[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(null);return(0,o.useEffect)(()=>{if(!e)return;let t=!1;return i(!0),s(null),wn(e).then(e=>{t||n(Array.isArray(e)?e:[])}).catch(e=>{t||s(e.message)}).finally(()=>{t||i(!1)}),()=>{t=!0}},[e]),{fields:t,loading:r,error:a}}function Gn(e){let[t,n]=(0,o.useState)(null),[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(null);return(0,o.useEffect)(()=>{if(!e)return;let t=!1;return i(!0),s(null),Tn(e).then(e=>{t||n(Array.isArray(e)?e:null)}).catch(e=>{t||s(e.message)}).finally(()=>{t||i(!1)}),()=>{t=!0}},[e]),{config:t,loading:r,error:a}}function Kn(e){let[t,n]=(0,o.useState)([]),[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(null);return(0,o.useEffect)(()=>{if(!e)return;let t=!1;i(!0),s(null);let{userId:r,roleId:a}=Un(),o=e=>{let t=e?.isVisible??e?.is_visible??e?.visible;return t==null?!0:typeof t==`boolean`?t:typeof t==`string`?![`false`,`0`,`no`,`hide`,`hidden`].includes(t.toLowerCase()):!!t};return Tn(e,{configType:`filter`,userId:r,roleId:a}).then(async t=>{let n=(Array.isArray(t)?t:t?.visibleFields??[]).filter(o);if(n.length>0)return n;let r=await wn(e);return Array.isArray(r)?r.filter(o):[]}).then(e=>{t||n(Array.isArray(e)?e:[])}).catch(e=>{t||s(e.message)}).finally(()=>{t||i(!1)}),()=>{t=!0}},[e]),{fields:t,loading:r,error:a}}var qn={campaign:`campaingns`,campaigns:`campaingns`};function Jn(e,t){return e===t||`${e}s`===t||`${t}s`===e}function Yn(e){try{let t=localStorage.getItem(`menu`);if(!t)return null;let n=JSON.parse(t);if(!Array.isArray(n))return null;let r=n.find(t=>{let n=String(t?.key??``).trim().toLowerCase();return n&&Jn(e,n)});return r?String(r.key).trim().toLowerCase():null}catch{return null}}function Xn(e){try{let t=localStorage.getItem(`menuPermission`);if(!t||!e)return{};let n=JSON.parse(t);if(!n||typeof n!=`object`)return{};let r=String(e).trim().toLowerCase(),i=qn[r]??Yn(r)??r,a=Object.keys(n),o=e=>e.trim().toLowerCase(),s=a.find(e=>o(e)===i)??a.find(e=>Jn(i,o(e)))??a.find(e=>Jn(r,o(e)));return(s?n[s]:null)??{}}catch{return{}}}function Zn(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`value`)?e.value:e}function Qn(e){let t=Zn(e);return t==null||Number(t)!==0&&t!==!1&&t!==`0`}function $n(e){let t=Zn(e);return t==null?!1:t===!0||t===1||t===`1`}function er(e,t){if(!e||typeof e!=`object`)return;if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=String(t).trim().toLowerCase(),r=Object.keys(e).find(e=>String(e).trim().toLowerCase()===n);return r?e[r]:void 0}function tr(e){return(0,o.useMemo)(()=>{let t=Xn(e);return{canView:Qn(er(t,`view`)),canAdd:Qn(er(t,`add`)),canEdit:Qn(er(t,`edit`)),canDelete:Qn(er(t,`delete`)),canApprove:Qn(er(t,`approve`)),canReject:Qn(er(t,`reject`)),canReApprove:$n(er(t,`reApprove`)),canSendApprove:$n(er(t,`sendApprove`))}},[e])}function nr(e){return[e?.key,e?.label,e?.name].filter(Boolean).join(` `).trim().toLowerCase()}function rr(e){let t=String(e?.permissionKey??``).trim().toLowerCase();if([`add`,`edit`,`delete`].includes(t))return t;if(e?.danger)return`delete`;let n=nr(e);return/(^|[\s_-])edit([\s_-]|$)/.test(n)?`edit`:/(^|[\s_-])(add|create)([\s_-]|$)/.test(n)?`add`:null}function ir(e,t){if(e!=null)return t.length===0?e:Array.isArray(e)?e.map(e=>ir(e,t)).filter(e=>e!=null).flat():ir(e[t[0]],t.slice(1))}function ar(e,t){if(!t||typeof t!=`string`||!e)return;if(t in e)return e[t];let n=ir(e,t.split(`.`));if(n!==void 0&&!(Array.isArray(n)&&n.length===0))return n;let r=t.split(`.`).pop();return r===t?void 0:e[r]}function or(){try{return typeof localStorage<`u`?localStorage.getItem(`userId`)??``:``}catch{return``}}var sr={"{currentuserid}":or,"{currentuser}":or,"{me}":or};function cr(e){let t=sr[String(e??``).trim().toLowerCase()];return t?t():e}function lr(e){return String(e??``).trim().toLowerCase()}function ur(e){return lr(e).replace(/[^a-z0-9]/g,``)}function dr(e,t){return e===t||ur(e)===ur(t)}function fr(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function pr(e,t,n){let r=e?.operator,i=r===`scope`?n:ar(t,e?.field),a=cr(e?.value),o=lr(i),s=lr(a);if(r===`eq`||r===`scope`)return dr(o,s);if(r===`ne`)return!dr(o,s);if(r===`isEmpty`)return fr(i);if(r===`notEmpty`)return!fr(i);if(r===`fieldEq`)return dr(o,lr(ar(t,e?.compareField)));if(r===`includes`||r===`notIncludes`){let e=(Array.isArray(i)?i:[i]).some(e=>dr(lr(e),s))&&s!==``;return r===`includes`?e:!e}return r===`contains`?Array.isArray(i)?i.some(e=>lr(e).includes(s)):o.includes(s):!1}function mr(e,t,n){if(!e||e.isActive===!1)return!1;let r=e.conditions??[];return r.length?r.every(e=>pr(e,t,n)):!1}function hr(e){let t=e?.allowedActions;return!Array.isArray(t)||t.length===0?null:t.map(String)}function gr(e,t,n,r){let i=Array.isArray(n)?n:[];if(!i.length)return!1;let a=String(e);return i.some(e=>{if(!mr(e,t,r))return!1;let n=hr(e);return n&&!n.some(e=>dr(e,a))?!0:(e?.blockedActions??[]).map(String).includes(a)})}function _r(e,t,n,r){let i=(Array.isArray(n)?n:[]).find(n=>(n?.disabledActions??[]).map(String).includes(String(e))&&mr(n,t,r));return i?i.description||`${e} is temporarily unavailable`:null}function vr(e,t,n){let r=e?.doneWhen;return!r||!r.field||!pr(r,t,n)?null:{label:e.doneLabel||e.label,tone:e.doneTone||`success`}}function yr(e,t,n,r){let i=Array.isArray(t)?t:[];return i.length?i.some(t=>gr(e,t,n,r)):!1}var br=e.t({actionRules:()=>Er,actions:()=>Dr,columnActions:()=>Or,default:()=>kr,fields:()=>wr,rows:()=>xr,synthesizeFieldsFromRows:()=>!0,tabField:()=>Tr,tabs:()=>Cr,total:()=>Sr,visibilityFlag:()=>null}),xr={sources:[`payload`],paths:[`rows`,`records`,`items`,`list`,`data`]},Sr={sources:[`response`,`payload`],paths:[`total`,`count`,`totalCount`]},Cr={sources:[`response`,`payload`],paths:[`tabs`,`tabList`]},wr={sources:[`response`,`payload`],paths:[`fields`,`fieldConfig`]},Tr={sources:[`payload`],paths:[`tabField`]},Er={sources:[`payload`],paths:[`actionRules`]},Dr={sources:[`payload`],paths:[`actions`]},Or={sources:[`payload`],paths:[`columnActions`]},kr={rows:xr,total:Sr,tabs:Cr,fields:wr,tabField:Tr,actionRules:Er,actions:Dr,columnActions:Or,synthesizeFieldsFromRows:!0,visibilityFlag:null},Ar=Object.assign({"../../config/responseMappings/default.json":br});function jr(e){if(!e)return null;for(let t of Object.keys(Ar))if(t.split(`/`).pop().replace(/\.json$/,``)===e){let e=Ar[t];return e.default??e}return null}function Mr(e){let t=jr(e);return t?{...kr,...t}:kr}function Nr(e,t){return String(t).split(`.`).reduce((e,t)=>e?.[t],e)}function Pr(e,t,n){if(!n)return;let r={response:e,payload:t};for(let e of n.sources)for(let t of n.paths){let n=Nr(r[e],t);if(n!==void 0)return n}}function Fr(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function Ir(e){return e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase())}var Lr=/token|password|passwd|secret|apikey|api_key|auth|credential|salary|ssn|ein\b/i;function Rr(e){return Lr.test(e)}function zr(e){let t=e[0];return t?Object.keys(t).filter(e=>!e.startsWith(`_`)&&!Rr(e)&&typeof t[e]!=`object`).map(e=>({value:e,field:e,label:Ir(e),isVisible:!0})):[]}function Br(e,t){return t?e.filter(e=>e[t]===1||e[t]===!0||e[t]===void 0).map(e=>({...e,isVisible:!0})):e}var Vr=5e3,Hr=300,Ur=100,Wr=100,Gr=300,Kr=100;function qr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Jr(e,t){return Array.isArray(e)?e.slice(0,t):[]}function Yr(e,t){return Jr(e,t).filter(qr)}function Xr(e,t){return Yr(e,t).filter(e=>typeof e.value==`string`||typeof e.field==`string`)}var Zr=/^\s*(javascript|data|vbscript|file):/i,Qr=[`url`,`href`,`routeUrl`,`routeURL`];function $r(e){let t={...e};for(let e of Qr)typeof t[e]==`string`&&Zr.test(t[e])&&delete t[e];return t}function ei(e,t){return Yr(e,t).map($r)}function ti(e,t){return e.flatMap(e=>{let n=Nr(e,t);return n==null?[]:(Array.isArray(n)?n:[n]).filter(e=>e!=null).map(e=>qr(e)?e:{value:e})})}function ni(e,t){if(!Array.isArray(t)||Array.isArray(e)||!qr(e))return;let n=[`actions`,`actionRules`,`columnActions`,`tabField`].filter(t=>e[t]!==void 0);n.length!==0&&console.warn(`[mapListResponse] response.data is an array, so ${n.join(`, `)} cannot be resolved from it. Send rows under "items" instead of "data", or pass the full envelope rather than the unwrapped payload.`)}function ri(e,t){let{baseModule:r,nestedPath:i}=n.Sn(t),a=Mr(r),o=e?.data??e;ni(e,o);let s=Jr(Array.isArray(o)?o:Pr(e,o,a.rows),Vr);i&&(s=Jr(ti(s,i),Vr),console.log(`[mapListResponse] module "${r}" → nested path "${i}": ${s.length} row(s)`));let c=Pr(e,o,a.total),l=qr(c)?Fr(c.total,c.searchCount,c.count):c,u=Number(l??s.length)||0,d=Yr(Pr(e,o,a.tabs),Ur),f=i?[]:Pr(e,o,a.fields),p=Array.isArray(f)?f:[];p.length===0&&(i||a.synthesizeFieldsFromRows)&&(p=zr(s)),p=Xr(p,Hr),a.visibilityFlag&&(p=Br(p,a.visibilityFlag));let m=Pr(e,o,a.tabField);return{rows:s,total:u,tabs:d,fields:p,tabField:typeof m==`string`?m:``,actionRules:ei(Pr(e,o,a.actionRules),Gr),actions:ei(Pr(e,o,a.actions),Wr),columnActions:ei(Pr(e,o,a.columnActions),Kr)}}var ii={jobs:{module:`jobs`,keys:[`jobRecruitmentStatus`,`jobStatus`],dateField:`createdAt`},candidates:{module:`candidates`,keys:[`candidateSummary`],items:[{key:`created`,label:`Created`,collection:`candidates`,countType:`documents`,dateField:`createdAt`},{key:`submitted`,label:`Submitted`,collection:`submissions`,countType:`distinct`,distinctField:`applicantId`,dateField:`submittedAt`},{key:`onboarded`,label:`Onboarded`,collection:`onboarding`,countType:`distinct`,distinctField:`candidateId`,dateField:`onboardingActivity.activityTime`,filters:{onboardingObStage:[`Completed`]}}]},submissions:{module:`submission`,keys:[`internalSubmissionStatus.internalSubmissionStatusText`,`clientSubmissionStatus.clientSubmissionStatusText`],dateField:`createdAt`}},ai={jobSummary:[{label:`Open`,field:`jobStatus`,keys:[`open`,`active`]},{label:`Partially Fulfilled`,field:`jobRecruitmentStatus`,keys:[`partially fulfilled`,`partiallyFulfilled`]},{label:`Fulfilled`,field:`jobRecruitmentStatus`,keys:[`fulfilled`]},{label:`In-active / Closed`,field:`jobStatus`,keys:[`closed`,`inactive`,`in-active`]}]};function oi(e){return String(e??``).trim().toLowerCase()}function si(e,t){return{label:e,count:Number.isFinite(Number(t))?Number(t):0}}function ci(e){return Array.isArray(e?.counts)?e.counts:[]}function li(e,t){return e?.key===t?e:(Array.isArray(e?.fields)?e.fields:[]).find(e=>e?.key===t)??{}}function ui(e,t){let n=Array.isArray(t)?t:[t],r=Array.isArray(e?.counts)?e.counts:[],i=n.filter(Boolean).map(oi),a=r.find(e=>[e?.key,e?.label].map(oi).some(e=>i.includes(e)));if(a)return Number(a.count)||0;for(let t of n){let n=e?.[t];if(Number.isFinite(Number(n)))return Number(n)}return 0}function di(e,t){let n=(Array.isArray(t)?t:[t].filter(Boolean)).map(oi);return ci(e).reduce((e,t)=>{let r=oi(t?.key??t?.label);return n.includes(r)?e+(Number(t?.count)||0):e},0)}function fi(e){let t=oi(e);return t.includes(`candidate`)?ii.candidates:t.includes(`submission`)?ii.submissions:t.includes(`job`)?ii.jobs:null}function pi(e){return ai[e]??null}function mi(e){return Array.isArray(e?.counts)||e?.openCount!==void 0||e?.myAssignedCount!==void 0?[si(`Open`,ui(e,[`openCount`,`open`])),si(`Partially Fulfilled`,ui(e,[`partiallyFulfilledCount`,`partially fulfilled`])),si(`Fulfilled`,ui(e,[`fulfilledCount`,`fulfilled`])),si(`In-active / Closed`,ui(e,[`closedCount`,`closed`,`inactive`,`in active`]))]:(pi(`jobSummary`)??[]).map(t=>{let n=li(e,t.field);return si(t.label,di(n,t.keys??[]))})}function hi(e){return ci(e).map(({label:e,key:t,count:n})=>si(e||t,n))}function gi(e){let t=Array.isArray(e?.fields)?e.fields:[],n=t.find(e=>e.key===`clientSubmissionStatus.clientSubmissionStatusText`)??{},r=t.find(e=>e.key===`internalSubmissionStatus.internalSubmissionStatusText`)??{},i=e=>Array.isArray(e.counts)?e.counts.map(({label:e,count:t})=>si(e,t)):[],a=Number(n.total)||0,o=Number(r.total)||0;return{total:a+o,clientCount:a,internalCount:o,clientBreakdown:i(n),internalBreakdown:i(r)}}var{RangePicker:_i}=s.DatePicker,vi=[{value:`today`,label:`Today`},{value:`yesterday`,label:`Yesterday`},{value:`last-7-days`,label:`Last 7 Days`},{value:`last-30-days`,label:`Last 30 Days`},{value:`this-month`,label:`This Month`},{value:`last-month`,label:`Last Month`},{value:`custom-range`,label:`Custom Range`}];function yi(e){return e.closest(`.view-summary-card`)??document.body}function bi(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function xi(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function Si(e){let t=new Date,n=new Date(t.getFullYear(),t.getMonth(),1),r=new Date(t.getFullYear(),t.getMonth()-1,1),i=new Date(t.getFullYear(),t.getMonth(),0);if(e===`today`)return{startDate:t,endDate:t};if(e===`yesterday`){let e=xi(t,-1);return{startDate:e,endDate:e}}return e===`last-30-days`?{startDate:xi(t,-29),endDate:t}:e===`this-month`?{startDate:n,endDate:t}:e===`last-month`?{startDate:r,endDate:i}:{startDate:xi(t,-6),endDate:t}}function Ci(e,t){if(e===`custom-range`){let[e,n]=t??[];return!e||!n?null:{startDate:e.format(`YYYY-MM-DD`),endDate:n.format(`YYYY-MM-DD`)}}let n=Si(e);return{startDate:bi(n.startDate),endDate:bi(n.endDate)}}function wi(e){return String(e??``).trim().toLowerCase()}function Ti(e){return String(e??``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function Ei(e){let t=wi(e);return t.includes(`candidate`)?`Candidate`:t.includes(`submission`)?`Submission`:t.includes(`job`)?`Job`:Ti(e||`List`)}function Di(e){return e?.data??e}function Oi(e,t){let n={module:e.module,dateRange:{startDate:t.startDate,endDate:t.endDate}};return e.summary&&(n.summary=e.summary),Array.isArray(e.items)&&e.items.length>0&&(n.items=e.items),Array.isArray(e.keys)&&e.keys.length>0&&(n.keys=e.keys),e.dateField&&(n.dateRange.key=e.dateField),n}function ki({moduleName:e,open:t,onClose:r}){let i=Ei(e),a=wi(e),u=a.includes(`submission`),d=a.includes(`job`),f=a.includes(`candidate`),p=fi(e),h=u?`last-30-days`:`last-7-days`,[g,_]=(0,o.useState)(h),[v,y]=(0,o.useState)(null),[b,x]=(0,o.useState)(null),[S,C]=(0,o.useState)(null),[w,T]=(0,o.useState)(null),[E,D]=(0,o.useState)(``),O=mi(b),k=hi(S),A=gi(w),j=Math.max(A.total,1),M=Math.round(A.internalCount/j*100),N=Math.max(0,100-M),P=g===`custom-range`;return(0,o.useEffect)(()=>{t&&(_(h),y(null))},[h,t]),(0,o.useEffect)(()=>{if(!t||!p)return;let e=Ci(g,v);if(!e)return;let n=!1;return D(``),m(Oi(p,e)).then(e=>{if(n)return;let t=Di(e);if(d){x(t),C(null),T(null);return}if(f){C(t),x(null),T(null);return}T(t),x(null),C(null)}).catch(e=>{n||(x(null),C(null),T(null),D(e.message||`Could not load summary`))}),()=>{n=!0}},[v,f,d,u,t,g,p]),t?(0,l.jsxs)(`div`,{className:`view-summary-layer`,role:`presentation`,children:[(0,l.jsx)(`div`,{className:`view-summary-scrim`}),(0,l.jsxs)(s.Card,{"aria-label":`${i} summary`,bordered:!1,className:`view-summary-card view-summary-card--${u?`submission`:`simple`}`,children:[(0,l.jsx)(s.Button,{"aria-label":`Close summary`,className:`view-summary-close`,icon:(0,l.jsx)(c.CloseOutlined,{}),type:`text`,onClick:r}),(0,l.jsxs)(`header`,{className:`view-summary-header`,children:[(0,l.jsxs)(n.Tn,{className:`view-summary-title`,color:`primary`,size:`md`,tag:`h2`,variant:`h2`,weight:`medium`,children:[i,` Summary`]}),(0,l.jsx)(s.Select,{"aria-label":`Summary date range`,className:`view-summary-range`,popupClassName:`view-summary-range-dropdown`,getPopupContainer:yi,popupMatchSelectWidth:!1,value:g,options:vi,onChange:e=>{_(e),e!==`custom-range`&&y(null)}})]}),u?(0,l.jsxs)(l.Fragment,{children:[P&&(0,l.jsx)(_i,{allowClear:!0,className:`view-summary-custom-range view-summary-custom-range--full`,format:`MMM DD, YYYY`,getPopupContainer:yi,placeholder:[`Start date`,`End date`],value:v,onChange:y}),(0,l.jsxs)(`section`,{className:`view-summary-submission-top`,"aria-label":`Submission totals`,children:[(0,l.jsxs)(`div`,{className:`view-summary-donut`,style:{"--summary-internal":`${M}%`,"--summary-client":`${N}%`},children:[(0,l.jsx)(n.Tn,{color:`success`,size:`2xl`,tag:`span`,variant:`metric`,weight:`semibold`,children:A.total}),(0,l.jsx)(n.Tn,{color:`success`,size:`xs`,tag:`span`,variant:`caption`,weight:`semibold`,children:`Total`})]}),(0,l.jsxs)(`div`,{className:`view-summary-legend`,children:[(0,l.jsxs)(n.Tn,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,l.jsx)(`i`,{className:`view-summary-dot view-summary-dot--internal`}),`Internal`,(0,l.jsx)(n.Tn,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:A.internalCount})]}),(0,l.jsxs)(n.Tn,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,l.jsx)(`i`,{className:`view-summary-dot view-summary-dot--client`}),`Client`,(0,l.jsx)(n.Tn,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:A.clientCount})]})]})]}),(0,l.jsx)(`div`,{className:`view-summary-divider`}),(0,l.jsxs)(`section`,{className:`view-summary-breakdown`,children:[(0,l.jsx)(n.Tn,{className:`view-summary-subtitle`,color:`primary`,size:`md`,tag:`h3`,variant:`h4`,weight:`medium`,children:`Internal Breakdown`}),A.internalBreakdown.length>0?A.internalBreakdown.map(e=>(0,l.jsxs)(`div`,{className:`view-summary-row view-summary-row--bullet`,children:[(0,l.jsxs)(n.Tn,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,l.jsx)(`i`,{className:`view-summary-dot view-summary-dot--internal`}),e.label]}),(0,l.jsx)(n.Tn,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:e.count})]},`internal-${e.label}`)):(0,l.jsx)(n.Tn,{color:`muted`,size:`sm`,tag:`p`,variant:`body`,weight:`regular`,children:`No internal data found`}),(0,l.jsx)(n.Tn,{className:`view-summary-subtitle`,color:`primary`,size:`md`,tag:`h3`,variant:`h4`,weight:`medium`,children:`Client Breakdown`}),A.clientBreakdown.length>0?A.clientBreakdown.map(e=>(0,l.jsxs)(`div`,{className:`view-summary-row view-summary-row--bullet`,children:[(0,l.jsxs)(n.Tn,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,l.jsx)(`i`,{className:`view-summary-dot view-summary-dot--client`}),e.label]}),(0,l.jsx)(n.Tn,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:e.count})]},`client-${e.label}`)):(0,l.jsx)(n.Tn,{color:`muted`,size:`sm`,tag:`p`,variant:`body`,weight:`regular`,children:`No client data found`}),E&&(0,l.jsx)(n.Tn,{color:`danger`,size:`xs`,tag:`p`,variant:`caption`,children:E})]})]}):(0,l.jsxs)(`section`,{className:`view-summary-breakdown`,children:[(0,l.jsxs)(`div`,{className:`view-summary-section-head`,children:[(0,l.jsxs)(n.Tn,{className:`view-summary-section-title`,color:`primary`,size:`md`,tag:`h3`,variant:`h3`,weight:`medium`,children:[`All `,i]}),P&&(0,l.jsx)(_i,{allowClear:!0,className:`view-summary-custom-range`,format:`MMM DD, YYYY`,getPopupContainer:yi,placeholder:[`Start date`,`End date`],value:v,onChange:y})]}),(0,l.jsx)(`div`,{className:`view-summary-divider`}),a.includes(`job`)&&(0,l.jsx)(n.Tn,{className:`view-summary-breakdown-title`,color:`primary`,size:`sm`,tag:`h4`,variant:`h4`,weight:`regular`,children:`Breakdown`}),(f?k:O).map(e=>(0,l.jsxs)(`div`,{className:`view-summary-row`,children:[(0,l.jsx)(n.Tn,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,children:e.label}),(0,l.jsx)(n.Tn,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,children:e.count})]},e.label)),E&&(0,l.jsx)(n.Tn,{color:`danger`,size:`xs`,tag:`p`,variant:`caption`,children:E})]})]})]}):null}function Ai(e){let[t,n]=(0,o.useState)({}),[r,i]=(0,o.useState)(new Set),a=(0,o.useRef)({}),s=(e,t)=>{i(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return{valuesByField:t,loadingFields:r,fetchValues:(0,o.useCallback)((t,r=``,i={})=>{if(!t||!e)return;a.current[t]&&clearTimeout(a.current[t]);let o=r?300:0;a.current[t]=setTimeout(async()=>{s(t,!0);try{let a=await Fn(e,t,r,i),o=Array.isArray(a)?a.map(e=>({label:String(e.label),value:e.value})):[];n(e=>({...e,[t]:o}))}catch{}finally{s(t,!1)}},o)},[e])}}var ji=[{label:`Last 7 days`,getDates:()=>[(0,u.default)().subtract(6,`day`),(0,u.default)()]},{label:`This month`,getDates:()=>[(0,u.default)().startOf(`month`),(0,u.default)()]},{label:`Overdue`,getDates:()=>[null,(0,u.default)().subtract(1,`day`)]}];function Mi({value:e,onChange:t,disabled:n}){return(0,l.jsxs)(s.Flex,{vertical:!0,gap:4,children:[(0,l.jsx)(s.DatePicker.RangePicker,{value:e,onChange:t,disabled:n,style:{width:`100%`},allowEmpty:[!0,!0],disabledDate:e=>e&&e.isAfter((0,u.default)(),`day`)}),!n&&(0,l.jsx)(s.Space,{size:4,wrap:!0,children:ji.map(({label:e,getDates:n})=>(0,l.jsx)(s.Tag,{className:`filter-date-shortcut`,onClick:()=>t?.(n()),children:e},e))})]})}var Ni=[{label:`AND`,value:`and`},{label:`OR`,value:`or`},{label:`Is Empty`,value:`isEmpty`},{label:`Not Empty`,value:`notEmpty`}],Pi=[{label:`Yes`,value:`true`},{label:`No`,value:`false`}];function Fi({value:e,onChange:t,disabled:n}){let[r,i]=Array.isArray(e)?e:[void 0,void 0];return(0,l.jsxs)(s.Flex,{gap:8,children:[(0,l.jsx)(s.InputNumber,{disabled:n,placeholder:`Min`,value:r,onChange:e=>t?.([e,i]),style:{flex:1}}),(0,l.jsx)(s.InputNumber,{disabled:n,placeholder:`Max`,value:i,onChange:e=>t?.([r,e]),style:{flex:1}})]})}var Ii={operator:`and`,field:void 0,values:[]};function Li({filterInputType:e,fieldType:t,disabled:n,loading:r,valueOptions:i,onSearch:a,onOpen:o}){let c=e||(t===`boolean`?`boolean`:null)||(t===`date`?`datepicker`:null)||(t===`number`?`number-range`:null)||`dropdown`;return c===`boolean`?(0,l.jsx)(s.Select,{allowClear:!0,disabled:n,mode:`multiple`,options:Pi,placeholder:`Select value`}):c===`text`?(0,l.jsx)(s.Input,{disabled:n,placeholder:`Type keyword...`,allowClear:!0}):c===`datepicker`?(0,l.jsx)(Mi,{disabled:n}):c===`number-range`?(0,l.jsx)(Fi,{disabled:n}):c===`checkbox`?(0,l.jsx)(s.Spin,{spinning:r,children:(0,l.jsx)(s.Checkbox.Group,{disabled:n,options:i,style:{display:`flex`,flexWrap:`wrap`,gap:`4px 16px`}})}):c===`radio`?(0,l.jsx)(s.Spin,{spinning:r,children:(0,l.jsx)(s.Radio.Group,{disabled:n,options:i,style:{display:`flex`,flexWrap:`wrap`,gap:`4px 16px`}})}):(0,l.jsx)(s.Select,{allowClear:!0,disabled:n,loading:r,mode:`multiple`,options:i,placeholder:n?`Select field first`:`Select values`,showSearch:!0,filterOption:!1,onSearch:a,onDropdownVisibleChange:o})}function Ri(e){return e.label??e.fieldLabel??e.name??e.fieldName??e.value}function zi(e){return e.value??e.field??e.fieldName??e.name??e.label}function Bi(e,t){let n=t.find(t=>t.value===e.field),r=e.filterInputType??n?.filterInputType,i=r===`datepicker`||!r&&n?.type===`date`,a=r===`text`,o=e.values??[];return a?o=e.value??``:i&&(o=[e.from?(0,u.default)(e.from):null,e.to?(0,u.default)(e.to):null]),{field:e.field,operator:e.operator??`and`,values:o,locked:n?.isDefaultFilter??!1}}function Vi({moduleName:e,open:t=!1,filters:r=[],onClose:i,onApply:a,onReset:u}){let[d]=s.Form.useForm(),f=s.Form.useWatch(`filters`,d)??[],{fields:p,loading:m,error:h}=Kn(t?e:null),g=(0,o.useMemo)(()=>(p??[]).map(e=>({label:Ri(e),value:zi(e),type:e.type,filterInputType:e.filterInputType,dataSource:e.dataSource,groupName:e.groupName,filterGroupFields:Array.isArray(e.filterGroupFields)?e.filterGroupFields:[],filterGroupSeparator:e.filterGroupSeparator??` `,lookup:e.lookup??null,isDefaultFilter:e.isDefaultFilter===1||e.isDefaultFilter===`1`||e.isDefaultFilter===!0})).filter(e=>e.label&&e.value),[p]),_=(0,o.useMemo)(()=>g.filter(e=>e.isDefaultFilter),[g]),v=(0,o.useMemo)(()=>_.map(e=>String(e.value)).sort().join(`|`),[_]),y=g,{valuesByField:b,loadingFields:x,fetchValues:S}=Ai(e);function C(e){let t=g.find(t=>t.value===e),n=t?.filterInputType;if(!(!e||n===`datepicker`||n===`number-range`||n===`text`||!n&&[`boolean`,`date`,`number`].includes(t?.type))){let n=!!t?.lookup?.collection;S(e,``,{dataSource:n?`lookup`:t?.dataSource,groupName:t?.groupName,lookup:t?.lookup,groupFields:t?.filterGroupFields,groupSeparator:t?.filterGroupSeparator})}}function w(){return _.length>0?_.map(e=>({operator:`and`,field:e.value,values:[],locked:e.isDefaultFilter})):[Ii]}function T(e=[]){let t=e.filter(e=>e?.field),n=new Set(t.map(e=>String(e.field))),r=[..._.filter(e=>!n.has(String(e.value))).map(e=>({operator:`and`,field:e.value,values:[],locked:!0})),...t].map(e=>({...e,locked:_.some(t=>String(t.value)===String(e.field))}));return r.length>0?r:[Ii]}let E=(0,o.useRef)(!1),D=(0,o.useRef)(r);(0,o.useEffect)(()=>{if(r===D.current)return;if(D.current=r,E.current){E.current=!1;return}let e=T((r??[]).filter(e=>e.field).map(e=>Bi(e,g)));d.setFieldsValue({filters:e}),e.forEach(e=>C(e.field))},[r,g]);let O=(0,o.useRef)(!1),k=(0,o.useRef)(``),A=(0,o.useRef)(e),j=(0,o.useRef)(!1);(0,o.useEffect)(()=>{e!==A.current&&(A.current=e,O.current=!1,k.current=``,j.current=!1)},[e]),(0,o.useEffect)(()=>{if(!t)return;let e=k.current!==v;if(O.current&&!e)return;let n=j.current&&!m,r=!m&&g.length>0;if(j.current=m,!n&&!r)return;let i=O.current;O.current=!0,k.current=v;let a=d.getFieldValue(`filters`)??[],o=T(i||a.length>0?a:w());d.setFieldsValue({filters:o}),o.forEach(e=>C(e.field))},[t,m,g,v]);function M(){E.current=!0;let t=w();d.setFieldsValue({filters:t}),t.forEach(e=>C(e.field)),a?.({moduleName:e,filters:[]}),u?.(),i?.()}function N(){E.current=!0;let t=(d.getFieldsValue().filters??[]).filter(e=>!P(e)).map(e=>{let t={...e};delete t.locked;let n=g.find(e=>e.value===t.field),r=n?.label??t.field,i=n?.filterInputType,a=i===`datepicker`||n?.type===`date`,o=i===`number-range`||!i&&n?.type===`number`,s=i===`text`;if(a){let[e,n]=Array.isArray(t.values)?t.values:[],a=e=>e?typeof e.format==`function`?e.format(`YYYY-MM-DD`):typeof e.toISOString==`function`||e instanceof Date?e.toISOString().substring(0,10):null:null,o=a(e),s=a(n);return{...t,values:[o,s].filter(Boolean),from:o??void 0,to:s??void 0,fieldLabel:r,filterInputType:i}}if(o){let[e,n]=Array.isArray(t.values)?t.values:[];return{...t,values:[e,n].filter(e=>e!=null),from:e==null?void 0:String(e),to:n==null?void 0:String(n),fieldLabel:r,filterInputType:i}}if(s){let e=typeof t.values==`string`?t.values.trim():``;return{...t,value:e,values:[],fieldLabel:r,filterInputType:i}}return{...t,values:t.values??[],fieldLabel:r,filterInputType:i,groupFields:n?.filterGroupFields??[]}});a?.({moduleName:e,filters:t}),i?.()}function P(e){if(!e?.field)return!0;if(e.operator===`isEmpty`||e.operator===`notEmpty`)return!1;let{values:t}=e;return typeof t==`string`?t.trim()===``:!Array.isArray(t)||t.length===0||t.every(e=>e==null||e===``)}let F=f.length===0||f.every(P);function I(e,t){let n=d.getFieldValue(`filters`)??[];d.setFieldValue(`filters`,n.map((t,n)=>n===e?{...t,values:[]}:t));let r=g.find(e=>e.value===t),i=r?.filterInputType;if(!(!t||i===`datepicker`||i===`number-range`||i===`text`||!i&&[`boolean`,`date`,`number`].includes(r?.type))){let e=!!r?.lookup?.collection;S(t,``,{dataSource:e?`lookup`:r?.dataSource,groupName:r?.groupName,lookup:r?.lookup,groupFields:r?.filterGroupFields,groupSeparator:r?.filterGroupSeparator})}}return(0,l.jsxs)(s.Drawer,{title:(0,l.jsx)(n.Tn,{variant:`card-title`,color:`primary`,children:`Filters`}),placement:`right`,width:720,open:t,onClose:i,rootClassName:`dynamic-field-filter`,maskClosable:!1,footer:(0,l.jsxs)(s.Space,{className:`dynamic-field-filter__footer`,children:[(0,l.jsx)(n.lt,{onClick:M,children:`Reset`}),(0,l.jsx)(n.lt,{variant:`primary`,onClick:N,disabled:F,children:`Apply`})]}),children:[h&&(0,l.jsx)(s.Alert,{type:`error`,message:`Could not load filter fields`,description:h,style:{marginBottom:16},showIcon:!0}),(0,l.jsx)(s.Spin,{spinning:m,tip:`Loading fields…`,children:(0,l.jsx)(s.Form,{form:d,layout:`vertical`,className:`dynamic-field-filter__form`,initialValues:{filters:[Ii]},children:(0,l.jsx)(s.Form.List,{name:`filters`,children:(e,{add:t,remove:r})=>(0,l.jsxs)(s.Space,{direction:`vertical`,className:`dynamic-field-filter__rows`,children:[e.map((t,i)=>{let a=f[i]?.field,o=f[i]?.operator,u=g.find(e=>e.value===a),d=u?.isDefaultFilter===!0,p=!a||o===`isEmpty`||o===`notEmpty`,h=u?.type??`text`,_=u?.filterInputType,v=b[a]??[],C=x.has(a),w=new Set(f.filter((e,t)=>t!==i).map(e=>e?.field).filter(Boolean).map(String)),T=d?g.filter(e=>e.value===a):y.filter(e=>!w.has(String(e.value)));return(0,l.jsxs)(s.Space,{direction:`vertical`,className:`dynamic-field-filter__row`,children:[e.length>1&&!d&&(0,l.jsx)(n.lt,{variant:`danger`,htmlType:`button`,icon:(0,l.jsx)(c.DeleteOutlined,{}),"aria-label":`Remove filter row`,className:`dynamic-field-filter__remove`,onClick:()=>r(t.name)}),i>0&&(0,l.jsx)(s.Flex,{justify:`center`,children:(0,l.jsx)(s.Form.Item,{name:[t.name,`operator`],rules:[{required:!0,message:`Select condition`}],className:`dynamic-field-filter__operator`,children:(0,l.jsx)(s.Select,{options:Ni,placeholder:`Condition`})})}),(0,l.jsxs)(s.Flex,{align:`end`,gap:`middle`,wrap:!0,children:[(0,l.jsx)(s.Form.Item,{label:(0,l.jsx)(n.Tn,{variant:`label`,color:`secondary`,children:`Field`}),style:{flex:1,minWidth:220},children:d?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.Tn,{variant:`body`,className:`dynamic-field-filter__locked-field`,children:u?.label??a}),(0,l.jsx)(s.Form.Item,{name:[t.name,`field`],noStyle:!0,children:(0,l.jsx)(s.Input,{type:`hidden`})})]}):(0,l.jsx)(s.Form.Item,{name:[t.name,`field`],rules:[{required:!0,message:`Select field`}],noStyle:!0,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,placeholder:`Select field`,options:T,optionFilterProp:`label`,loading:m,onChange:e=>I(t.name,e)})})}),(0,l.jsx)(s.Form.Item,{label:(0,l.jsx)(n.Tn,{variant:`label`,color:`secondary`,children:`Values`}),name:[t.name,`values`],style:{flex:1,minWidth:220},children:Li({filterInputType:_,fieldType:h,disabled:p,loading:C,valueOptions:v,onSearch:e=>{if(a){let t=!!u?.lookup?.collection;S(a,e,{dataSource:t?`lookup`:u?.dataSource,groupName:u?.groupName,lookup:u?.lookup,groupFields:u?.filterGroupFields,groupSeparator:u?.filterGroupSeparator})}},onOpen:e=>{if(e&&a){let e=!!u?.lookup?.collection;S(a,``,{dataSource:e?`lookup`:u?.dataSource,groupName:u?.groupName,lookup:u?.lookup,groupFields:u?.filterGroupFields,groupSeparator:u?.filterGroupSeparator})}}})})]})]},t.key)}),(0,l.jsx)(n.lt,{htmlType:`button`,variant:`soft`,icon:(0,l.jsx)(c.PlusOutlined,{}),disabled:y.length>0&&f.filter(e=>e?.field).length>=y.length,onClick:()=>t(Ii),children:`Add Row`})]})})})})]})}var Hi=`data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.00035%204.69941C4.74567%204.69941%203.72701%205.71807%203.72701%206.97275C3.72701%208.22745%204.74567%209.24609%206.00035%209.24609C7.25503%209.24609%208.2737%208.22745%208.2737%206.97275C8.2737%205.71807%207.25503%204.69941%206.00035%204.69941ZM6.00035%205.87128C6.60827%205.87128%207.10182%206.36485%207.10182%206.97275C7.10182%207.58067%206.60827%208.07422%206.00035%208.07422C5.39243%208.07422%204.89888%207.58067%204.89888%206.97275C4.89888%206.36485%205.39243%205.87128%206.00035%205.87128ZM2.06843%206.41445C2.85434%204.9331%204.16742%203.92578%206.00035%203.92578C7.83328%203.92578%209.14637%204.9331%209.93227%206.41445C10.0838%206.70013%2010.4388%206.80902%2010.7245%206.65745C11.0102%206.50587%2011.1191%206.15091%2010.9675%205.86523C9.97758%203.9994%208.30902%202.75391%206.00035%202.75391C3.69169%202.75391%202.02312%203.9994%201.03322%205.86523C0.881648%206.15091%200.990538%206.50587%201.27619%206.65745C1.56187%206.80902%201.91686%206.70013%202.06843%206.41445Z'%20fill='%23586888'/%3e%3c/svg%3e`,Ui=`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='path-1-inside-1_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-1-inside-1_8856_23533)'/%3e%3cmask%20id='path-2-inside-2_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-2-inside-2_8856_23533)'/%3e%3cline%20x1='7.375'%20y1='2.93555'%20x2='12.225'%20y2='2.93555'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='5.83398'%20x2='12.225'%20y2='5.83398'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='8.87305'%20x2='12.225'%20y2='8.87305'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='11.7227'%20x2='12.225'%20y2='11.7227'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3c/svg%3e`,{Text:Wi}=s.Typography;function Gi(e){return qi(e?.label,e?.fieldLabel,e?.name,e?.fieldName,e?.value,e?.field)}function Ki(e){return qi(e?.value,e?.field,e?.fieldName,e?.name,e?.label)}function qi(...e){return e.find(e=>e!=null&&String(e).trim()!==``)}function Ji(e){return String(e??``).replace(/\[(\-?\d+)\]/g,`.$1`).split(`.`).filter(Boolean)}function Yi(e,t){if(!(!t||typeof t!=`string`))return Ji(t).reduce((e,t)=>{if(e!=null){if(/^-?\d+$/.test(t)){if(!Array.isArray(e))return;let n=Number(t);return e[n<0?e.length+n:n]}return e?.[t]}},e)}function Xi(e,t){return t===`id`?e?.id??e?._id:e?.[t]??Yi(e,t)}function Zi(e,t){if(!Array.isArray(e)||e.length===0||!t)return;let n=e[e.length-1];if(n!=null)return typeof n==`object`?Yi(n,t):n}function Qi(e){if(Array.isArray(e))return e.some(Qi);if(e==null)return!1;let t=String(e).trim().toLowerCase();return t?![`all`,`internal`].includes(t):!1}function $i(e){let t=Object.keys(e??{}).find(e=>/^customFields\.[^.]*profiledata\./i.test(e)&&!/^customFields\.internalprofiledata\./i.test(e));if(t)return t.replace(/^customFields\./i,``).replace(/profiledata\..*$/i,``);let n=e?.customFields;if(!n||typeof n!=`object`)return``;let r=Object.keys(n).find(e=>/profiledata$/i.test(e)&&!/^internalprofiledata$/i.test(e)&&n[e]&&typeof n[e]==`object`);return r?r.replace(/profiledata$/i,``):``}function ea(e){if(typeof e?.isVisible==`boolean`&&!e.isVisible||typeof e?.isVisible==`string`&&e.isVisible.toLowerCase()===`false`)return!1;let t=Ki(e);return!t||typeof t!=`string`?!1:/^customFields\.[^.]*profiledata\./i.test(t)&&!/^customFields\.internalprofiledata\./i.test(t)}function ta(e){return[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].some(Qi)||!!$i(e)}function na(e,t){let n=Xi(e,t);return n==null||n===``?`-`:Array.isArray(n)?n.join(`, `):typeof n==`object`?Object.values(n).join(` `):n}function ra(e){let t=e?.defaultValue;return t==null?``:String(t).trim()}function ia(e){return!!e?.renderConfig?.treatZeroAsEmpty}function aa(e,t=null){return e==null||e===``||e===`-`||ia(t)&&(e===0||e===`0`)?!0:Array.isArray(e)?e.length===0:typeof e==`object`&&Object.keys(e).length===0}function oa(e,t){let n=ra(e);return n&&aa(t,e)?n:t}function sa(e){if(!e)return``;let t=e instanceof Date?e:new Date(e);if(Number.isNaN(t.getTime()))return String(e);let n=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!0}).formatToParts(t),r=e=>n.find(t=>t.type===e)?.value??``;return`${`${r(`month`)} ${r(`day`)},${r(`year`)}`} | ${`${r(`hour`)}:${r(`minute`)} ${r(`dayPeriod`)}`}`}function ca(e){return String(e||`U`).trim().charAt(0).toUpperCase()||`U`}function la(e,t){let n=t.find(t=>{let n=Xi(e,t);return n!=null&&n!==``});return n?na(e,n):``}function ua(e,t){let n=Xi(t,e.key),r=Array.isArray(n)?n:n?[n]:[],i=e.renderConfig??{},a=[i.nameField,i.labelField,`recruiterName`,`name`,`fullName`,`displayName`,`userName`,`email`,`recruiterEmail`].filter(Boolean),o=[i.metaField,i.dateField,i.assignedDateField,`assignedDateTime`,`assignedDate`,`createdAt`].filter(Boolean);return r.map((e,t)=>{let n=typeof e==`object`&&e?e:{value:e},r=la(n,a)||String(e||`User`),i=la(n,o);return{key:la(n,[`recruiterId`,`id`,`_id`,`email`,`recruiterEmail`])||`${r}-${t}`,name:r,initial:ca(r),meta:sa(i)}})}function da({item:e}){return(0,l.jsxs)(`div`,{className:`job-avatar-tooltip`,children:[(0,l.jsx)(`div`,{className:`job-avatar-tooltip-name`,children:e.name}),e.meta&&(0,l.jsx)(`div`,{className:`job-avatar-tooltip-meta`,children:e.meta})]})}function fa({items:e}){return(0,l.jsx)(`div`,{className:`job-avatar-more-tooltip`,children:e.map(e=>(0,l.jsx)(da,{item:e},e.key))})}function pa(e){return typeof e==`boolean`?e:typeof e==`string`?e.toLowerCase()===`true`:!!e}function ma(e){return e==null?``:Array.isArray(e)?e.join(`,`):typeof e==`object`?Object.values(e).join(` `):String(e)}function ha(e,t){return e?String(e).replace(/\{([^}]+)\}/g,(e,n)=>encodeURIComponent(ma(Xi(t,n)))).replace(/:([A-Za-z_][\w.]*)/g,(e,n)=>encodeURIComponent(ma(Xi(t,n)))):``}function ga(e){return/^(https?:\/\/|\/)/i.test(String(e))}function _a(e,t){let n=String(e??``).trim().toLowerCase();if(n===`blank`||n===`_blank`)return`_blank`;if(n===`self`||n===`_self`)return`_self`;if(n)return e;if(/^https?:\/\//i.test(String(t)))return`_blank`}function va(e){return/^https?:\/\//i.test(String(e))}function ya(e,t,n){let r=e.routeUrl??e.routeURL??e.linkTemplate??e.linkUrl??e.href??e.url??e.action;return r?ha(r,t):ga(n)?String(n):``}function ba(e,t){if(!t||t.length<3||!e||typeof e!=`string`||e===`-`)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0;for(;a<=e.length;){let o=n.indexOf(r,a);if(o===-1){i.push(e.slice(a));break}o>a&&i.push(e.slice(a,o)),i.push((0,l.jsx)(`mark`,{className:`search-highlight`,style:{backgroundColor:`#ffff00`,color:`inherit`,padding:0,borderRadius:2},children:e.slice(o,o+t.length)},o)),a=o+t.length}return i}function xa(e,t,n,r=``){let i=ya(e,t,n),a=_a(e.linkTarget,i),o=ba(n,r);return va(i)?(0,l.jsx)(s.Tooltip,{title:n===`-`?void 0:n,children:(0,l.jsx)(`a`,{className:`job-cell-link job-cell-value`,href:i,rel:a===`_blank`?`noreferrer`:void 0,target:a,children:o})}):(0,l.jsx)(s.Tooltip,{title:n===`-`?void 0:n,children:(0,l.jsx)(d.Link,{className:`job-cell-link job-cell-value`,target:a,to:i||`#`,children:o})})}function Sa(e){let t=[e?.props,e?.props?.format,e?.props?.display,e?.props?.dateDisplay,e?.renderConfig?.format,e?.renderConfig?.display,e?.renderConfig?.dateDisplay,e?.dateDisplay].map(e=>typeof e==`string`?e.trim().toLowerCase():``).find(Boolean);return t===`datetime`||t===`time`?t:`date`}function Ca(e,t){if(e==null||e===``)return`-`;let n=e instanceof Date?e:new Date(e);if(Number.isNaN(n.getTime()))return na({value:e},`value`);let r=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!0,timeZone:`UTC`}).formatToParts(n),i=e=>r.find(t=>t.type===e)?.value??``,a=`${i(`month`)}, ${i(`day`)}, ${i(`year`)}`,o=`${i(`hour`)}:${i(`minute`)} ${i(`dayPeriod`)}`,s=Sa(t);return s===`time`?o:s===`datetime`?`${a} | ${o}`:a}function wa(e){return/date/i.test(`${e.key??``} ${e.label??``} ${e.type??``}`)}function Ta(e){return e==null||e===``?`-`:Array.isArray(e)?e.join(`, `):typeof e==`object`?Object.values(e).join(` `):e}function Ea(e,t,n){let r=String(t??``).trim();if(!r)return`-`;let i=r.replace(/^record\./,``);if(n?.renderConfig?.lastItemField??n?.renderConfig?.arrayDisplayField){let t=Ji(i);for(let n=t.length-1;n>=1;--n){let r=Xi(e,t.slice(0,n).join(`.`));if(!Array.isArray(r))continue;let i=r[r.length-1];return i==null?`-`:Ta(Yi(i,t.slice(n).join(`.`)))}let r=n?.key,a=r?Xi(e,r):void 0;if(r&&Array.isArray(a)){let e=a[a.length-1];if(i===r)return Ta(e);let t=`${r}.`;if(i.startsWith(t))return Ta(Yi(e,i.slice(t.length)))}}return na(e,i)}function Da(e){return String(e??``).replace(/\s+/g,` `).replace(/^\s*[-–—/:|·,]+\s*/,``).replace(/\s*[-–—/:|·,]+\s*$/,``).replace(/\s*([-–—/:|·,])\s*([-–—/:|·,])\s*/g,` $2 `).replace(/\s+[-–—]\s+(?=[A-Za-z$€£₹])/g,` `).replace(/\s+/g,` `).trim()}function Oa(e,t,n){if(typeof e!=`string`||e.trim()===``)return``;let r=!1,i=e.replace(/\{\{\s*([^}]+?)\s*\}\}/g,(e,i)=>{let a=Ea(t,i,n);return aa(a,n)?``:(r=!0,String(a))});if(!r)return``;let a=i.replace(/\s+/g,` `).trim();return n?.renderConfig?.cleanEmptyTemplateSeparators?Da(a):a}function ka(e,t){let n=Xi(t,e.key),r=Oa(e.displayTemplate,t,e),i=e.renderConfig?.lastItemField??e.renderConfig?.arrayDisplayField;if(r)return r;if(i){let t=Zi(n,i);return aa(t,e)?oa(e,`-`):Array.isArray(t)?oa(e,t.join(`, `)):typeof t==`object`?oa(e,Object.values(t).join(` `)):t}return wa(e)?oa(e,Ca(n,e)):oa(e,na(t,e.key))}function Aa(e,t){if(!ra(e)||Oa(e.displayTemplate,t,e))return!1;let n=Xi(t,e.key),r=e.renderConfig?.lastItemField??e.renderConfig?.arrayDisplayField;return r?aa(Zi(n,r),e):wa(e)?aa(Ca(n,e),e):aa(na(t,e.key),e)}function ja(e){return e===`-`||typeof e!=`string`||!e.trim()?e:e.replace(/\b([A-Za-z])([A-Za-z]*)\b/g,(e,t,n)=>e.length>1&&e===e.toUpperCase()?e:`${t.toUpperCase()}${n.toLowerCase()}`)}function Ma(e){return typeof e!=`string`||!e.includes(`-`)?e:e.replace(/(^|\s)-\s*(\d+)(?=\s*[A-Za-z])/,`$10-$2`).replace(/(\d+)\s*-\s*(?=[A-Za-z])/,`$1-0 `)}function Na(e){let t=e.map((e,t)=>({field:e,index:t}));return t.some(({field:e})=>e.order!==void 0&&e.order!==null&&e.order!==``)?[...t].sort((e,t)=>{let n=Number(e.field.order),r=Number(t.field.order),i=Number.isFinite(n),a=Number.isFinite(r);return i&&a&&n!==r?n-r:i===a?e.index-t.index:i?-1:1}).map(({field:e})=>e):e}function Pa(e){return e.iconUrl??e.iconURL??e.icon??e.iconPath}function Fa(e){return Array.isArray(e)?e.map((e,t)=>({...e,key:e.key??e.name??e.label??e.routeUrl??e.type??String(t),label:e.label??e.name??e.title??e.type??`Action`,iconUrl:Pa(e)})).filter(e=>e.iconUrl):[]}function Ia(e,t,n=[],r){if(gr(e.key,t,n,r)||Array.isArray(e.conditions)&&e.conditions.length>0&&!e.conditions.every(e=>pr(e,t,r)))return!1;let i=e?.showIfField??e?.visibleWhenField;return!i||pr({field:i,operator:e?.showIfOperator||`eq`,value:e?.showIfValue??e?.visibleWhenValue??``},t,r)}function La(e,t={}){let n=rr(e);return n===`add`?t.canAdd!==!1:n===`edit`?t.canEdit!==!1:n!==`delete`||t.canDelete!==!1}function Ra(e,t,n){let r=ha(e.routeUrl??e.routeURL??e.route??e.url??e.href,t),i=no(e.type??e.actionType),a=typeof e.label==`function`?e.label(t):e.label,o=(0,l.jsx)(`img`,{src:e.iconUrl,alt:a,className:`job-field-action-icon`}),c=`job-field-action-button`,u=e.__done,f=e.__disabledReason;return u||f?(0,l.jsx)(s.Tooltip,{title:u?u.label:f,children:(0,l.jsx)(`button`,{"aria-label":u?u.label:`${a} (unavailable)`,className:`${c} job-field-action-button--done`,type:`button`,disabled:!0,children:o})},e.key):typeof e.onClick==`function`?(0,l.jsx)(s.Tooltip,{title:a,children:(0,l.jsx)(`button`,{"aria-label":a,className:c,type:`button`,onClick:n=>{n.stopPropagation(),e.onClick(t)},children:o})},e.key):(i===`popup`||i===`modal`||e.popupKey)&&r?(0,l.jsx)(s.Tooltip,{title:a,children:(0,l.jsx)(`button`,{"aria-label":a,className:c,type:`button`,onClick:i=>{i.stopPropagation(),n?.(r,t,e)},children:o})},e.key):r&&(i===`page`||r.startsWith(`/`))?(0,l.jsx)(s.Tooltip,{title:a,children:(0,l.jsx)(d.Link,{"aria-label":a,className:c,to:r,children:o})},e.key):r?(0,l.jsx)(s.Tooltip,{title:a,children:(0,l.jsx)(`a`,{"aria-label":a,className:c,href:r,rel:`noreferrer`,target:`_blank`,children:o})},e.key):(0,l.jsx)(s.Tooltip,{title:a,children:(0,l.jsx)(`button`,{"aria-label":a,className:c,type:`button`,children:o})},e.key)}function za(e){let t=Array.isArray(e.secondaryFields)?e.secondaryFields:[],n=e.secondaryField?[e.secondaryField]:[];return[...t,...n].filter((e,t,n)=>e&&n.indexOf(e)===t)}function Ba(e,t){let n=e.secondarySeparator??` `,r=za(e).map(e=>na(t,e)).filter(e=>e!==`-`);return r.length?r.join(` ${n} `):``}function Va(e){return ja(Ma(e))}function Ha(e,t){if(!Array.isArray(e.valueStyles))return null;let n=no(t);return e.valueStyles.find(e=>no(e?.value)===n||no(e?.label)===n)??null}function Ua(e){let t=e?.color,n=e?.bg??e?.background??e?.backgroundColor;return{...t?{"--job-cell-badge-color":t}:{},...n?{"--job-cell-badge-bg":n}:{}}}function Wa(e){return no(e?.varient??e?.variant).replace(/[^a-z0-9-]/g,`-`)}function Ga(e,t){let n=Ha(e,t),r=n??e.commonStyle??{},i=n?.label??t,a=(typeof i==`string`?i.trim():i)||`-`,o=Wa(r),c=[`job-cell-badge`,`job-cell-value`,o?`job-cell-badge--${o}`:``].filter(Boolean).join(` `),u=!n&&typeof a==`string`&&a.includes(`,`)?a.split(`,`).map(e=>e.trim()).filter(Boolean):null,d=u&&u.length>1?`${u.slice(0,1).join(`, `)} +${u.length-1}`:a,f=Ua(r);return(0,l.jsx)(s.Tooltip,{title:a===`-`?void 0:a,children:(0,l.jsx)(s.Tag,{className:c,style:f,children:d})})}function Ka(e,t){let n=ua(e,t),r=n.slice(0,2),i=n.slice(2);if(!n.length){let t=ra(e)||`-`;return(0,l.jsx)(Wi,{className:`job-cell-primary job-cell-value`,children:t})}return(0,l.jsxs)(`span`,{className:`job-avatar-group`,children:[r.map((e,t)=>(0,l.jsx)(s.Tooltip,{overlayClassName:`job-avatar-tooltip-overlay`,title:(0,l.jsx)(da,{item:e}),children:(0,l.jsx)(s.Avatar,{className:`job-avatar job-avatar--${t+1}`,children:e.initial})},e.key)),i.length>0&&(0,l.jsx)(s.Tooltip,{overlayClassName:`job-avatar-tooltip-overlay job-avatar-more-tooltip-overlay`,title:(0,l.jsx)(fa,{items:i}),children:(0,l.jsxs)(s.Avatar,{className:`job-avatar job-avatar--more`,children:[`+`,i.length]})})]})}function qa(e,t,n=``,r,i={},a=[],o){if(no(e.renderType)===`avatar`)return Ka(e,t);let c=Aa(e,t),u=Va(ka(e,t)),d=Fa(e.actionButtons).filter(e=>Ia(e,t,a,o)).filter(e=>La(e,i)).map(e=>({...e,__done:vr(e,t,o),__disabledReason:_r(e.key,t,a,o)})),f=Va(Ba(e,t)),p=no(e.renderType)===`badge`&&u!==`-`?Ga(e,u):!pa(e.isLink)||u===`-`||c?(0,l.jsx)(s.Tooltip,{title:u===`-`?void 0:u,children:(0,l.jsx)(Wi,{className:`job-cell-primary job-cell-value`,children:ba(u,n)})}):xa(e,t,u,n);return(0,l.jsxs)(`span`,{className:`job-cell-content`,children:[(0,l.jsxs)(`span`,{className:`job-cell-main-line`,children:[p,d.length>0&&(0,l.jsx)(`span`,{className:`job-field-actions`,children:d.filter(e=>typeof e.hiddenIf!=`function`||!e.hiddenIf(t)).map(e=>Ra(e,t,r))})]}),f&&(0,l.jsx)(s.Tooltip,{title:f,children:(0,l.jsx)(`span`,{className:`job-cell-secondary`,children:ba(f,n)})})]})}var Ja=130,Ya=230,Xa=7.2,Za=26,Qa=8,$a=44,eo=20;function to(e,t){let n=String(e.label??``).length*Qa+$a;if(no(e.renderType)===`avatar`)return Math.max(Math.round(n),120);let r=0;for(let n of t){let t=String(Va(ka(e,n))??``),i=String(Va(Ba(e,n))??``);r=Math.max(r,t.length,i.length)}let i=no(e.renderType)===`badge`?24:0,a=r*Xa+Za+i;return Math.round(Math.min(Math.max(n,a,Ja),Ya))}function no(e){return String(e??``).trim().toLowerCase()}function ro(e,t){return e?.key??e?.value??e?.id??(t===void 0?void 0:String(t))}function io(e){return no(e)}function ao(e){return[`all`,``].includes(io(e))}function oo(e,t,n,r,i){if(ao(t))return!0;let a=no(n?.filterValue??n?.status??n?.title??n?.tabTitle??n?.name??(typeof n?.label==`string`?n.label:void 0)??n?.value??n?.key??t),o=n?.field??n?.fieldName??n?.filterField??n?.dataIndex??i;if(o)return no(na(e,o))===a;let s=r.filter(e=>{let t=no(e.key),n=no(e.label);return t.includes(`status`)||n.includes(`status`)});return(s.length?s:r).some(t=>no(na(e,t.key))===a)}function so(e,t,n){return typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]:e.id??e._id??e.key??t}function co(e){return!!e?.closest?.(`a,button,input,textarea,select,label,[role="button"],[role="menuitem"],.ant-checkbox,.ant-radio,.ant-dropdown,.ant-dropdown-trigger,.ant-table-selection-column,.job-field-actions,.job-row-eye-button`)}function lo(e){return e.label??e.name??e.title??e.value}function uo(e,t){return e.key??e.value??e.route??e.name??String(t)}var fo={delete:(0,l.jsx)(c.DeleteOutlined,{}),edit:(0,l.jsx)(c.EditOutlined,{}),mail:(0,l.jsx)(c.MailOutlined,{}),shareAlt:(0,l.jsx)(c.ShareAltOutlined,{}),swap:(0,l.jsx)(c.RightOutlined,{}),thunderbolt:(0,l.jsx)(c.ThunderboltOutlined,{}),userAdd:(0,l.jsx)(c.UserAddOutlined,{}),userSwitch:(0,l.jsx)(c.UserSwitchOutlined,{})};function po(e,t){let n={key:e.key,label:t?t.label:e.label,icon:fo[e.icon]??void 0,danger:t?void 0:e.danger||void 0,disabled:!!t||void 0,title:t?t.label:void 0};return e.children?.length&&(n.children=e.children.map(e=>po(e))),n}function mo(e,t,n){return!e?.doneWhen?.field||!t?.length?null:t.every(t=>vr(e,t,n))?vr(e,t[0],n):null}function ho(e,t){return e.filter(t).map(e=>e.children?.length?{...e,children:ho(e.children,t)}:e)}function go(e){let t=[];for(let n of e)t.push(n),n.children?.length&&t.push(...go(n.children));return t}function _o(e){return Array.isArray(e)?e.map((e,t)=>{let n=lo(e),r=uo(e,t);return!n||!r?null:{...e,key:String(r),label:n,route:e.route||e.routeTemplate||(e.actionType===`modal`&&(e.popupKey||r)?`/popup/${e.popupKey||r}`:``),children:e.children?.length?_o(e.children):void 0}}).filter(Boolean):[]}function vo(e){let t=String(e?.key??``).trim().toLowerCase(),n=String(e?.label??``).trim().toLowerCase(),r=String(e?.popupKey??``).trim().toLowerCase(),i=String(e?.route??e?.routeTemplate??``).trim().toLowerCase();return t===`change-status`||t===`changestatus`||n===`change status`||r===`change-status`||i.includes(`/popup/change-status`)}function yo(e){let t=e?.clientSubmissionStatus,n=t&&typeof t==`object`?t:null;return{id:Number(n?.clientSubmissionStatusId??n?.id??n?.uniqueId??e?.clientSubmissionStatusId??e?.clientStatusId??e?.[`clientSubmissionStatus.clientSubmissionStatusId`]??0)||0,text:no(String(n?.clientSubmissionStatusText??n?.name??(typeof t==`string`?t:void 0)??e?.clientSubmissionStatusText??e?.clientStatusText??e?.clientStatus??e?.[`clientSubmissionStatus.clientSubmissionStatusText`]??``).trim())}}function bo(e,t,n){let r=yo(e);return r.id>0&&t.has(r.id)?!0:!!(r.text&&n.has(r.text))}function xo(e,t,n){return e?.length?e.some(e=>bo(e,t,n)):!1}function So(e,t){return!e.permissionKey||!t.length||t.every(t=>n.P(Yi(t,`actionPermission.${e.permissionKey}`)))}function Co(e,t){return t?e===`asc`?`desc`:e===`desc`?``:`asc`:`asc`}function wo(e){return e===`asc`?`Ascending`:e===`desc`?`Descending`:`Neutral`}function To({label:e,sortDir:t,sortable:n,onSort:r}){if(!n)return(0,l.jsx)(`span`,{className:`job-table-header-label`,children:e});let i=wo(t);return(0,l.jsxs)(`div`,{className:`job-table-header-content`,children:[(0,l.jsx)(`span`,{className:`job-table-header-label`,title:typeof e==`string`?e:void 0,children:e}),(0,l.jsx)(s.Tooltip,{title:i,mouseEnterDelay:.08,overlayClassName:`job-sort-tooltip`,children:(0,l.jsx)(`button`,{type:`button`,className:`job-table-sort-trigger${t?` job-table-sort-trigger--active`:``}`,"aria-label":`Sort ${typeof e==`string`?e:`column`}, ${i}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),r?.()},children:(0,l.jsxs)(`span`,{className:`job-table-sort-icon-stack`,children:[(0,l.jsx)(c.CaretUpOutlined,{className:`job-table-sort-icon job-table-sort-icon--up${t===`asc`?` job-table-sort-icon--active`:``}`}),(0,l.jsx)(c.CaretDownOutlined,{className:`job-table-sort-icon job-table-sort-icon--down${t===`desc`?` job-table-sort-icon--active`:``}`})]})})})]})}function Eo({moduleName:e,activeTabScope:t,pageSize:n,sort:r,sortDir:i,queryParams:a}){return[e??``,t??``,n,r??``,i??``,a?JSON.stringify(a):``].join(`|`)}function Do(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:1}function Oo(e){for(let t of e.keys()){let e=/^p(\d+)$/.exec(t);if(e)return Do(e[1])}return 1}function ko(e){[...e.keys()].forEach(t=>{(/^p\d+$/.test(t)||t===`page`)&&e.delete(t)})}var Ao=[],jo={};function Mo({record:e,fields:t,selected:n,onSelect:r,onPreview:i,onRecordClick:a,isControlled:o,selectionMode:c=`checkbox`,onPopupAction:u,permissions:d}){let f=t.find(e=>e.cardRole===`name`),p=t.find(e=>e.cardRole===`action`),m=t.find(e=>e.cardRole===`headerAction`),h=t.filter(e=>e!==f&&e!==p&&e!==m),g=f?na(e,Ki(f)):``,_=p?.render?p.render(Xi(e,Ki(p)),e):null,v=m?.render?m.render(Xi(e,Ki(m)),e):null;return(0,l.jsxs)(`div`,{className:`param-card${n?` param-card--selected`:``}`,"aria-selected":n,onClick:e=>{co(e.target)||a?.()},role:a?`button`:void 0,tabIndex:a?0:void 0,onKeyDown:e=>{!a||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),a())},children:[(0,l.jsx)(`div`,{className:`param-card__header`,children:(0,l.jsxs)(`div`,{className:`param-card__name-row`,children:[c===`checkbox`&&(0,l.jsx)(s.Checkbox,{checked:n,onChange:r,onClick:e=>e.stopPropagation(),className:`param-card__checkbox`}),i&&(0,l.jsx)(`button`,{type:`button`,className:`job-row-eye-button`,"aria-label":`Preview`,onClick:e=>{e.stopPropagation(),i()},children:(0,l.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.00035%204.69941C4.74567%204.69941%203.72701%205.71807%203.72701%206.97275C3.72701%208.22745%204.74567%209.24609%206.00035%209.24609C7.25503%209.24609%208.2737%208.22745%208.2737%206.97275C8.2737%205.71807%207.25503%204.69941%206.00035%204.69941ZM6.00035%205.87128C6.60827%205.87128%207.10182%206.36485%207.10182%206.97275C7.10182%207.58067%206.60827%208.07422%206.00035%208.07422C5.39243%208.07422%204.89888%207.58067%204.89888%206.97275C4.89888%206.36485%205.39243%205.87128%206.00035%205.87128ZM2.06843%206.41445C2.85434%204.9331%204.16742%203.92578%206.00035%203.92578C7.83328%203.92578%209.14637%204.9331%209.93227%206.41445C10.0838%206.70013%2010.4388%206.80902%2010.7245%206.65745C11.0102%206.50587%2011.1191%206.15091%2010.9675%205.86523C9.97758%203.9994%208.30902%202.75391%206.00035%202.75391C3.69169%202.75391%202.02312%203.9994%201.03322%205.86523C0.881648%206.15091%200.990538%206.50587%201.27619%206.65745C1.56187%206.80902%201.91686%206.70013%202.06843%206.41445Z'%20fill='%23586888'/%3e%3c/svg%3e`,alt:``,className:`job-row-eye-icon`})}),(0,l.jsx)(Wi,{className:`param-card__name`,children:g}),v&&(0,l.jsx)(`div`,{className:`param-card__header-actions`,children:v})]})}),h.length>0&&(0,l.jsx)(`div`,{className:`param-card__body-fields`,children:h.map(t=>{let n=Ki(t),r=Xi(e,n),i=o&&typeof t.render==`function`?t.render(r,e):qa(t,e,``,u,d);return(0,l.jsxs)(`div`,{className:`param-card__field-row`,children:[(0,l.jsx)(Wi,{className:`param-card__field-label`,children:Gi(t)}),(0,l.jsx)(`div`,{className:`param-card__field-value`,children:i})]},n)})}),(0,l.jsx)(`div`,{className:`param-card__divider`}),(0,l.jsxs)(`div`,{className:`param-card__footer`,children:[(0,l.jsx)(`div`,{className:`param-card__footer-left`}),(0,l.jsx)(`div`,{className:`param-card__footer-right`,children:_})]})]})}function No(e){return!!(e.operator===`isEmpty`||e.operator===`notEmpty`||e.value||e.from||e.to||Array.isArray(e.values)&&e.values.length>0)}function Po(e){return e.fieldLabel?e.fieldLabel:(e.field??``).replace(/([A-Z])/g,` $1`).replace(/^(.)/,e=>e.toUpperCase()).trim()}function Fo(e){if(e.operator===`isEmpty`)return`Is Empty`;if(e.operator===`notEmpty`)return`Not Empty`;if(e.value)return`"${e.value}"`;if(e.from&&e.to)return`${e.from} to ${e.to}`;if(e.from)return`from ${e.from}`;if(e.to)return`to ${e.to}`;if(Array.isArray(e.values)&&e.values.length>0){let t=e.values.slice(0,2).join(`, `);return e.values.length>2?`${t} +${e.values.length-2}`:t}return``}function Io({filters:e,onRemove:t,onClearAll:n}){let r=(e??[]).map((e,t)=>({row:e,originalIdx:t})).filter(({row:e})=>e.field&&No(e));return r.length===0?null:(0,l.jsxs)(s.Flex,{gap:6,wrap:`wrap`,align:`center`,className:`filter-chips-bar`,children:[(0,l.jsx)(Wi,{className:`filter-chips-bar__label`,children:`Filters:`}),r.map(({row:e,originalIdx:n})=>(0,l.jsxs)(s.Tag,{closable:!0,onClose:()=>t(n),className:`filter-chip`,children:[(0,l.jsx)(`span`,{className:`filter-chip__field`,children:Po(e)}),(0,l.jsx)(`span`,{className:`filter-chip__sep`,children:`: `}),(0,l.jsx)(`span`,{className:`filter-chip__value`,children:Fo(e)})]},`${e.field}-${n}`)),r.length>1&&(0,l.jsx)(s.Button,{type:`link`,size:`small`,onClick:n,className:`filter-chips-clear`,children:`Clear all`})]})}function Lo({moduleName:e,authToken:r,actions:i=[],actionRules:a=[],breadcrumbItems:u=[],dataSource:f=[],className:p=``,initialPageSize:m=10,onAction:h,onSummaryClick:g,rowKey:_,showSummaryButton:v=!1,summaryButtonLabel:y=`View Summary`,summaryRoute:b,showFieldButton:x=!0,showFilterButton:S=!0,fieldButtonLabel:C=`View Field`,fieldButtonRoute:w,tabs:T,tabTitleOverrides:E=null,tableClassName:D=`job-list-table`,fields:O=Ao,fieldOverrides:k=null,extraFields:A=Ao,listName:j=``,loading:M=!1,total:N,current:F,pageSize:I,onPageChange:L,onPageSizeChange:R,onSearch:z,toolbarExtra:B=null,showSearch:V=!0,searchPlaceholder:H=`Min 3 Chars, press Enter to search`,searchFields:U=Ao,showViewToggle:ee=!1,activeView:te=`list`,onViewChange:ne,autoCardForExternalRows:re=!0,createAction:ie,onRecordClick:ae,selectedRecordId:W,selectionMode:oe=`checkbox`,compact:se=!1,onSelectionChange:ce,selectedSource:le,onTabChange:ue,fetchData:de=On,responseMapper:fe=ri,queryParams:pe=jo,defaultVisibleColumnCount:me=6,showAdd:he=!0,lockOuterPageScroll:ge=!1}){let _e=(0,d.useNavigate)(),G=(0,d.useLocation)(),K=n.xn(e),[ve,ye]=(0,o.useState)(()=>new Set),[be,xe]=(0,o.useState)(()=>new Set);(0,o.useEffect)(()=>{if(no(K)!==`submissions`){ye(new Set),xe(new Set);return}let e=!1,n=new URLSearchParams({masterName:`clientSubmissions`,offset:`0`,limit:`100`});return t.b&&n.set(`app_id`,t.b),t.o(t.x,`/masters/dropdown?${n.toString()}`).then(t=>{if(e)return;let n=(Array.isArray(t?.data)?t.data:[]).filter(e=>e?.isTerminalStatus===!0);ye(new Set(n.map(e=>Number(e?.id??e?.uniqueId??0)).filter(e=>e>0))),xe(new Set(n.map(e=>no(e?.name)).filter(Boolean)))}).catch(()=>{e||(ye(new Set),xe(new Set))}),()=>{e=!0}},[K]);let Se=!!ge,{canView:Ce,canAdd:we,canEdit:Te,canDelete:Ee}=tr(K),De=JSON.stringify(pe??jo),Oe=(0,o.useMemo)(()=>pe??jo,[De]),[ke]=(0,d.useSearchParams)(),Ae=Oo(ke),[je,Me]=(0,o.useState)(()=>String(le??``).trim()||`all`),[Ne,Pe]=(0,o.useState)(``),[Fe,Ie]=(0,o.useState)(``),[Le,ze]=(0,o.useState)(!1),[q,J]=(0,o.useState)([]),[Y,X]=(0,o.useState)([]),[Be,Ve]=(0,o.useState)([]),[He,Ue]=(0,o.useState)(0),[We,Ge]=(0,o.useState)({current:Ae,pageSize:m}),[Ke,qe]=(0,o.useState)({sort:``,sortDir:``}),[Je,Ye]=(0,o.useState)([]),[Xe,Ze]=(0,o.useState)(!1),[Qe,$e]=(0,o.useState)([]);(0,o.useEffect)(()=>(r&&t.g(r),()=>{r&&t.r()}),[r]),(0,o.useEffect)(()=>{if(Se)return document.documentElement.classList.add(`listview-page-scroll-lock`),document.body.classList.add(`listview-page-scroll-lock`),()=>{document.documentElement.classList.remove(`listview-page-scroll-lock`),document.body.classList.remove(`listview-page-scroll-lock`)}},[Se]);let et=(0,o.useRef)(null),[tt,nt]=(0,o.useState)(0),rt=(0,o.useRef)(),it=(0,o.useRef)(``);(0,o.useEffect)(()=>{let e=et.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(e=>{let t=e[0]?.contentRect?.width;typeof t==`number`&&nt(t)});return t.observe(e),()=>t.disconnect()},[]);let at=(e,t)=>String(so(e,t,_)),ot=(e,t)=>String(at(e,t))===String(W??``),st=(e,t)=>{let n=at(e,t);n&&ae?.(e,n)},ct=(e,t)=>{X(e),Ve(t),ce?.(e,t)},[lt,ut]=(0,o.useState)(f),[dt,ft]=(0,o.useState)(f.length),[pt,mt]=(0,o.useState)([]),[ht,gt]=(0,o.useState)([]),[_t,vt]=(0,o.useState)(``),[yt,bt]=(0,o.useState)([]),[xt,St]=(0,o.useState)([]),[Ct,wt]=(0,o.useState)(!1),[Tt,Et]=(0,o.useState)(!1),[Dt,Ot]=(0,o.useState)(null),[kt,At]=(0,o.useState)(null),[jt,Mt]=(0,o.useState)(!1),Nt=!!(L||R||z),Pt=Nt?f:lt,Ft=Nt?N??0:dt,It=Nt?O:ht,Lt=(0,o.useMemo)(()=>Pt.some(e=>ta(e)),[Pt]),Rt=(0,o.useMemo)(()=>It.some(e=>ea(e)),[It]),zt=re&&(Lt||Rt)?`card`:te,Bt=i.length>0?i:yt,Vt=a.length>0?a:xt,Ht=(0,o.useMemo)(()=>_o(Bt),[Bt]),Ut=(0,o.useMemo)(()=>new Map(go(Ht).map(e=>[e.key,e])),[Ht]),Wt=(0,o.useMemo)(()=>ho(Ht,e=>{let t=rr(e);return t===`add`&&!we||t===`edit`&&!Te||t===`delete`&&!Ee||!n.F(e.permission,K)||e.showInList===!1?!1:!e.allowedTabs||e.allowedTabs.some(e=>no(e)===no(je))}),[Ht,je,we,Te,Ee,K]),Gt=(0,o.useMemo)(()=>ho(Wt,e=>(Y.length===1||e.allowMultiple||e.danger)&&So(e,Be)&&!(no(K)===`submissions`&&vo(e)&&xo(Be,ve,be))&&!yr(e.key,Be,Vt,je)),[je,K,Vt,Y.length,Be,ve,be,Wt]),Kt=typeof e==`string`?e.trim().length>0:!!e,qt=Kt?`/${K}-create${ie?`?action=${encodeURIComponent(ie)}`:``}`:``;(0,o.useEffect)(()=>{Kt&&!Ce&&_e(`/`,{replace:!0})},[Ce,Kt,_e]);let Jt=(e,{replace:t=!1}={})=>{let n=new URLSearchParams(ke);ko(n);let r=[n.toString(),e>1?`p${e}`:``].filter(Boolean).join(`&`);r!==G.search.replace(/^\?/,``)&&_e({pathname:G.pathname,search:r?`?${r}`:``},{replace:t})},Yt=(e,t)=>{Ge(t=>({...t,current:e})),Jt(e,t)},Xt=()=>{Yt(1,{replace:!0})},{config:Zt,loading:Qt,error:$t}=Gn(!Nt&&Kt?e:null),en=(0,o.useCallback)(e=>{let t=Ke.sort===e,n=Co(Ke.sortDir,t),r=n?String(e):``;qe({sort:r,sortDir:n}),typeof z==`function`&&z(r,n),Xt()},[z,Xt,Ke.sort,Ke.sortDir]);(0,o.useEffect)(()=>{Ge(e=>e.current===Ae?e:{...e,current:Ae})},[Ae]),(0,o.useEffect)(()=>{Nt&&Ge(e=>{let t=Do(F??e.current),n=Number(I)>0?Number(I):e.pageSize;return e.current===t&&e.pageSize===n?e:{current:t,pageSize:n}})},[F,I,Nt]);let tn=G.state?.refreshTimestamp;(0,o.useEffect)(()=>{tn&&(ct([],[]),Ue(e=>e+1))},[tn]);let nn=(0,o.useMemo)(()=>{let e=[...Array.isArray(T)?T:[],...pt],t=io(je);return e.find((e,n)=>io(ro(e,n))===t)},[je,pt,T]),rn=nn?.field??nn?.fieldName??nn?.filterField??nn?.dataIndex??_t,an=ao(je)?``:je,on=!an&&!ao(je)&&no(rn).length>0,sn=Fe.trim().length>=3,cn=sn?Fe.trim():``,ln=q.some(e=>e.field),un=Eo({moduleName:e,activeTabScope:an,pageSize:We.pageSize,sort:Ke.sort,sortDir:Ke.sortDir,queryParams:Oe}),dn=We.current===1&&kt?.key===un,fn=Number(kt?.total),pn=sn?Number.isFinite(fn)&&fn>0?fn:dt:0;(0,o.useEffect)(()=>{if(Nt)return;if(!Kt){ut([]),ft(0),mt([]),gt([]),vt(``),bt([]),St([]),Ot(null);return}let t=io(an);if(it.current&&it.current===t){it.current=``;return}let n=!1,r=sn&&pn>We.pageSize,i=r?pn:We.pageSize,a=r?0:(We.current-1)*We.pageSize;return wt(!(!sn&&!ln&&We.current===1&&dn)),Ot(null),de(e,i,a,{scope:an,sort:Ke.sort,sortDir:Ke.sortDir,search:cn,filters:q,queryParams:Oe}).then(t=>{if(n)return;let{rows:r,total:i,tabs:a,fields:o,tabField:s,actions:c,actionRules:l}=fe(t,e),u=!le&&ao(je)&&Array.isArray(a)&&a.length>0&&!a.some((e,t)=>ao(ro(e,t)))?ro(a[0],0):``,d=Eo({moduleName:e,activeTabScope:u?String(u):an,pageSize:We.pageSize,sort:Ke.sort,sortDir:Ke.sortDir,queryParams:Oe});ut(r),ft(i),mt(a),gt(o),vt(s),bt(c),St(l),u&&(it.current=io(u),Me(e=>io(e)===io(u)?e:String(u))),!sn&&!ln&&We.current===1&&At({key:d,rows:r,total:i,tabs:a,fields:o,tabField:s,actions:c,actionRules:l})}).catch(e=>{n||(ut([]),ft(0),mt([]),gt([]),vt(``),bt([]),St([]),Ot(e.message),Kt&&s.message.error(`Invalid module name or data could not be loaded.`))}).finally(()=>{n||(wt(!1),Et(!0))}),()=>{n=!0}},[cn,je,an,q,de,ln,sn,Kt,Nt,e,We.current,We.pageSize,He,fe,pn,le,Ke.sort,Ke.sortDir,Oe]);let mn=(0,o.useMemo)(()=>{let e=Nt&&Array.isArray(O)&&O.length,t=!Nt&&Array.isArray(ht)&&ht.length,n=!$t&&Array.isArray(Zt)&&Zt.length,r=e?O:t?ht:n?Zt:[],i=new Map(ht.map(e=>[Ki(e),e]).filter(([e])=>e)),a=r.map(e=>{let t=Ki(e),n=i.get(t)??{},r=t&&k&&typeof k==`object`?k[t]:null,a=r?.renderConfig?{...n.renderConfig??e.renderConfig??{},...r.renderConfig}:e.renderConfig??n.renderConfig??null;return{...n,...e,...r??{},...a?{renderConfig:a}:{},key:t,label:Gi(r??e)??Gi(e)??Gi(n)}}).filter(e=>e.key&&e.label),o=(Array.isArray(A)?A:[]).map((e,t)=>{let n=Ki(e);return n?{...e,key:n,label:Gi(e)??`Field ${t+1}`,isVirtual:e.isVirtual??!0,isVisible:typeof e.isVisible!=`boolean`||e.isVisible}:null}).filter(Boolean);return Na([...a,...o])},[Zt,$t,O,A,k,Nt,ht]),hn=(0,o.useMemo)(()=>mn.filter(e=>typeof e.isVisible==`boolean`?e.isVisible:typeof e.isVisible!=`string`||e.isVisible.toLowerCase()===`true`).map(e=>({key:e.key,label:e.label})),[mn]),gn=hn.map(e=>e.key),_n=Je.filter(e=>gn.includes(e)),vn=_n.length?_n:hn.slice(0,me).map(e=>e.key),yn=Math.min(me,hn.length),bn=vn.length>me,xn=(0,o.useMemo)(()=>mn.filter(e=>!e.cardHidden&&(e.tableHidden||vn.includes(e.key))),[mn,vn]),Sn=(0,o.useMemo)(()=>{let e=Ne.toLowerCase(),t=Pt,n=on?t.filter(e=>oo(e,je,nn,mn,rn)):t,r=U.length?mn.filter(e=>U.includes(e.key)):mn;return!e||e.length<3?n:n.filter(t=>r.some(n=>String(na(t,n.key)).toLowerCase().includes(e)||za(n).some(n=>String(na(t,n)).toLowerCase().includes(e))))},[je,nn,rn,on,Pt,mn,Ne,U]),Cn=(0,o.useMemo)(()=>{if(!sn)return Sn;let e=(We.current-1)*We.pageSize;return Sn.slice(e,e+We.pageSize)},[Sn,sn,We.current,We.pageSize]),wn=sn?Sn.length:Ft,Tn=Fe.trim().length>=3,En=String(Sn.length).padStart(2,`0`),Dn=Ft>0||Pt.length>0,kn=Dn||Ne.trim().length>0||Fe.trim().length>0,An=Kt?Dt?`Invalid module name or data could not be loaded.`:$t?`Field configuration failed to load.`:`No data found.`:`Please provide a module name to view data.`,jn=(0,o.useMemo)(()=>!E||typeof E!=`object`?null:Object.entries(E).reduce((e,[t,n])=>(n==null||(e[String(t)]=String(n)),e),{}),[E]),Mn=(0,o.useMemo)(()=>{let t=Array.isArray(T)?T:[],n=!t.length,r=t.length?t:pt.length?pt:[{key:`all`,title:e??`List`,count:wn}],i=!!(jn&&Object.keys(jn).length);return!n&&!i?r:r.map((e,t)=>{if(!e||typeof e!=`object`)return e;let r=i?jn[String(ro(e,t))]:void 0;if(!r&&!n)return e;let a={...e};if(r&&(a.title=r),n){if(Tt){let t=Number(e.count??e.countValue);a.count=Number.isFinite(t)?t:0}else delete a.count,delete a.countValue}return a})},[Tt,e,pt,jn,wn,T]);(0,o.useEffect)(()=>{if(!Mn.length||!((pt?.length??0)>0||Array.isArray(T)&&T.length>0))return;let e=io(je);if(!Mn.some((t,n)=>io(ro(t,n))===e)){let e=ro(Mn[0],0);e&&Me(String(e))}},[je,Mn,pt,T]),(0,o.useEffect)(()=>{if(le===void 0||!Mn.length)return;let e=Mn.find((e,t)=>io(ro(e,t))===io(le));if(!e)return;let t=String(ro(e,Mn.indexOf(e)));(le!==rt.current||io(je)!==io(t))&&(rt.current=le,Me(e=>io(e)===io(t)?e:t))},[je,Mn,le]);let Nn=e=>{let t=mn.map(e=>{let t={};return Object.entries(e).forEach(([e,n])=>{typeof n!=`function`&&(t[e]=n)}),t});_e(`/popup/preview`,{state:{background:G,moduleName:K,record:e,fields:t}})},Pn=(e,t,n={})=>{let r=ha(e,t),i=r.startsWith(`/`)?r:`/${r}`,a=t?._id??t?.id;_e(i,{state:{background:G,selectedIds:a===void 0?[]:[a],selectedRecords:[t],moduleName:K,popupContext:n.popupState??{},popupAction:{key:n.key,apiMethod:n.apiMethod,apiPath:n.apiPath,defaultTemplateId:n.defaultTemplateId,requireJobId:n.requireJobId,popupKey:n.popupKey,actionType:n.actionType??n.type,popupFieldOverrides:n.popupFieldOverrides},requireJobId:n.requireJobId,...n.popupState}})},Fn=(0,o.useMemo)(()=>{let e={dataIndex:`icons`,key:`icons`,visibilityKey:`jobsGroup`,fixed:`left`,width:25,render:(e,t)=>(0,l.jsxs)(s.Space,{size:4,className:`job-row-icons`,children:[(0,l.jsx)(`button`,{type:`button`,className:`job-row-eye-button`,"aria-label":`Preview job`,onClick:()=>Nn(t),children:(0,l.jsx)(`img`,{src:Hi,alt:``,className:`job-row-eye-icon`})}),t.hasLinkedIn&&(0,l.jsx)(s.Tooltip,{title:`LinkedIn`,children:(0,l.jsx)(c.LinkedinFilled,{className:`job-row-linkedin-icon`})})]})},t=mn.filter(e=>vn.includes(e.key)).map((e,t)=>{let n=Ke.sort===e.key?Ke.sortDir:``;return{title:To({label:e.label,sortDir:n,sortable:Dn,onSort:()=>en(e.key)}),dataIndex:e.key,key:e.key,fixed:t===0?`left`:void 0,ellipsis:{showTitle:!1},width:to(e,Cn),render:(t,n)=>qa(e,n,Fe,Pn,{canAdd:we,canEdit:Te,canDelete:Ee},Vt,an)}});if(!(bn||Nt)&&tt>0&&t.length>0){let n=e.width+(Dn&&oe===`checkbox`?48:0)+eo,r=t.reduce((e,t)=>e+t.width,0),i=tt-n-r;i>0&&r>0&&t.forEach(e=>{e.width=Math.floor(e.width+i*(e.width/r))})}return[e,...t]},[je,we,Ee,Te,Fe,Vt,en,bn,Dn,Nt,G,e,_e,mn,Cn,oe,Ke.sort,Ke.sortDir,tt,Wt,vn]),In=(0,o.useCallback)(e=>{let t=Mn.find((t,n)=>io(ro(t,n))===io(e)),n=String(t?ro(t,Mn.indexOf(t)):e);if(Me(n),X([]),Ve([]),Xt(),typeof ue==`function`){let e=t?.key??t?.value??t?.id??n;rt.current=e,ue(e)}},[ue,Mn,Xt]);function Ln(e,n,r){let i=Ut.get(String(e));if(i&&i.actionType!==`group`){if(typeof h==`function`&&h({key:i.key,label:i.label,selectedIds:n,selectedRecords:r}),typeof i.onClick==`function`){i.onClick({action:i,selectedIds:n,selectedRecords:r});return}if(i.actionType===`copy`){let e=r.map(e=>Yi(e,i.copyField||`id`)??e?._id).filter(e=>e!=null);navigator.clipboard.writeText(e.join(`
2
+ `)).then(()=>s.message.success(`Copied to clipboard`)).catch(()=>s.message.error(`Could not copy to clipboard`));return}if(i.actionType===`api`&&i.apiPath){let e=r[0]??{},a=ha(i.apiPath,e);t.o(t.x,a.startsWith(`/`)?a:`/${a}`,{method:i.apiMethod||`POST`,body:[`GET`,`DELETE`].includes(String(i.apiMethod).toUpperCase())?void 0:JSON.stringify({ids:n,records:r})}).then(()=>{s.message.success(`${i.label} completed`),Ue(e=>e+1)}).catch(e=>s.message.error(e.message||`${i.label} failed`));return}if(i.route){let e=r[0]??{},t=ha(i.route,e),a=t.startsWith(`/`)?t:`/${t}`;if(i.route.startsWith(`/popup/`)||i.route.startsWith(`popup/`)){let t=i.popupKey||i.route?.replace(/^\/popup\//i,``)||``,o=/(?:^|\/)(?:quick(?:-|_)?submit|submit)(?:$|\/)/i.test(t),s=new URLSearchParams(G.search).get(`jobId`),c=i.popupState?.jobId??i.popupState?.jobID??i.popupState?.jobId??e.jobId??e.job?.id??e.job?._id??s,l=i.popupState?.candidateId??i.popupState?.applicantId??e.id??e._id??e.applicantId??e.candidateId;if(o&&c&&l){let e=new URLSearchParams;e.set(`candidateId`,String(l)),e.set(`isFromSubmission`,`false`),_e(`/submission-create/${encodeURIComponent(String(c))}?${e.toString()}`);return}_e(a,{state:{background:G,selectedIds:n,selectedRecords:r,moduleName:K,popupContext:i.popupState??{},popupAction:{key:i.key,apiMethod:i.apiMethod,apiPath:i.apiPath,defaultTemplateId:i.defaultTemplateId,requireJobId:i.requireJobId,popupFieldOverrides:i.popupFieldOverrides},...i.popupState}});return}_e(a)}}}function Rn({key:e}){let t=go(Gt).find(t=>String(t.key)===String(e));t&&mo(t,Be,je)||Ln(e,Y,Be)}let zn=vn.length===hn.length,Bn=vn.length>0&&!zn,Vn=(e,t)=>{Ye(n=>{let r=hn.slice(0,me).map(e=>e.key),i=n.length?n:r;return t?i.includes(e)?i:[...i,e]:i.length<=yn?i:i.filter(t=>t!==e)})},Hn=()=>{if(typeof g==`function`){g();return}if(b){_e(b);return}Mt(!0)},Un=()=>{w&&_e(w)};(0,o.useEffect)(()=>{if(!jt)return;let e=e=>{e.key===`Escape`&&Mt(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[jt]);let Wn=()=>{dn&&(ut(kt.rows),ft(kt.total),mt(kt.tabs),gt(kt.fields),vt(kt.tabField),bt(kt.actions??[]),St(kt.actionRules??[]),Ot(null),wt(!1))},Kn=e=>{let t=e.target.value,n=t.trim().length<3,r=q.some(e=>e.field);n&&(Ie(``),r||Wn()),Pe(t),Xt()},qn=()=>{let e=Ne.trim();e.length>=3&&(Ie(e),Xt())},Jn=()=>{Wn(),J([]),ct([],[]),Xt()};(0,o.useEffect)(()=>{zt===`card`&&($e([]),ct([],[]))},[We.current,We.pageSize,je,zt]);let Yn=e=>{$e(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e],r=Cn.filter((e,t)=>n.includes(String(so(e,t,_))));return ct(n,r),n})},Xn=(0,l.jsxs)(`div`,{className:`column-visibility-menu`,onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(s.Checkbox,{checked:zn,indeterminate:Bn,onChange:e=>{Ye(e.target.checked?hn.map(e=>e.key):hn.slice(0,me).map(e=>e.key))},children:`Select All`}),(0,l.jsx)(`div`,{className:`column-visibility-menu__list`,children:hn.map(e=>(0,l.jsx)(s.Checkbox,{checked:vn.includes(e.key),disabled:vn.includes(e.key)&&vn.length<=yn,onChange:t=>Vn(e.key,t.target.checked),children:e.label},e.key))})]});return(0,l.jsxs)(`div`,{className:`antd dynamic-list-view${se?` list-view--compact`:``}${Se?` list-view--page-scroll-lock`:``} ${p}`.trim(),children:[u.length>0&&(0,l.jsx)(`div`,{className:`job-list-header`,children:(0,l.jsx)(n.t,{items:u})}),(0,l.jsx)(s.Card,{className:`job-tabs-card`,children:(0,l.jsxs)(s.Flex,{align:`center`,justify:`space-between`,children:[(0,l.jsx)(P,{activeKey:je,tabs:Mn,onChange:In}),(0,l.jsxs)(s.Flex,{align:`center`,gap:8,children:[B,kn&&(0,l.jsx)(s.Input,{prefix:(0,l.jsx)(c.SearchOutlined,{className:`job-search-icon`}),placeholder:H,value:Ne,onChange:Kn,onPressEnter:qn,allowClear:!0,className:`job-search-input`}),!Nt&&we&&he&&(0,l.jsx)(s.Tooltip,{title:`Add`,children:(0,l.jsx)(s.Button,{"aria-label":`Add`,className:`job-toolbar-icon-button`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>{qt&&_e(qt)}})}),Dn&&(0,l.jsx)(s.Tooltip,{title:`Filter`,children:(0,l.jsx)(s.Badge,{count:q.filter(e=>e.field&&No(e)).length,size:`small`,offset:[-2,2],children:(0,l.jsx)(s.Button,{"aria-label":`Filter`,className:`job-toolbar-icon-button`,icon:(0,l.jsx)(c.FilterOutlined,{}),onClick:()=>ze(!0)})})}),ee&&Dn&&(0,l.jsxs)(s.Flex,{align:`center`,gap:6,children:[(0,l.jsx)(s.Tooltip,{title:`List View`,children:(0,l.jsx)(s.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${zt===`list`?` param-view-toggle-btn--active`:``}`,icon:(0,l.jsx)(c.UnorderedListOutlined,{}),onClick:()=>{ne?.(`list`),$e([]),ct([],[])}})}),(0,l.jsx)(s.Tooltip,{title:`Card View`,children:(0,l.jsx)(s.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${zt===`card`?` param-view-toggle-btn--active`:``}`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),onClick:()=>{ne?.(`card`),$e([]),ct([],[])}})})]}),v&&(0,l.jsx)(s.Button,{className:`job-summary-button`,type:`primary`,onClick:Hn,children:y}),x&&w&&(0,l.jsx)(s.Button,{className:`job-summary-button`,type:`primary`,onClick:Un,children:C})]})]})}),Dn&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(s.Card,{className:`job-toolbar-card`,children:(0,l.jsxs)(s.Flex,{className:`p-flex`,align:`center`,justify:`space-between`,children:[(0,l.jsxs)(s.Flex,{align:`center`,gap:3,children:[zt===`card`&&(0,l.jsx)(s.Checkbox,{checked:Cn.length>0&&Qe.length>=Cn.length,indeterminate:Qe.length>0&&Qe.length<Cn.length,className:`param-card-view__select-all`,onChange:()=>{if(Qe.length>0)$e([]),ct([],[]);else{let e=Cn.map((e,t)=>String(so(e,t,_)));$e(e),ct(e,[...Cn])}},children:`Select All`}),(0,l.jsx)(s.Dropdown,{open:Xe,onOpenChange:Ze,trigger:[`click`],dropdownRender:()=>Xn,placement:`bottomLeft`,overlayClassName:`column-visibility-dropdown`,children:(0,l.jsx)(s.Button,{"aria-label":`Display columns`,type:`text`,icon:(0,l.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='path-1-inside-1_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-1-inside-1_8856_23533)'/%3e%3cmask%20id='path-2-inside-2_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-2-inside-2_8856_23533)'/%3e%3cline%20x1='7.375'%20y1='2.93555'%20x2='12.225'%20y2='2.93555'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='5.83398'%20x2='12.225'%20y2='5.83398'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='8.87305'%20x2='12.225'%20y2='8.87305'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='11.7227'%20x2='12.225'%20y2='11.7227'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3c/svg%3e`,alt:``,className:`job-action-list-icon`}),size:`small`,className:`job-actions-button job-column-display-button`,children:(0,l.jsx)(c.DownOutlined,{className:`job-actions-caret`})})}),Gt.length>0&&Y.length>0&&(0,l.jsx)(s.Dropdown,{menu:{items:Gt.map(e=>po(e,mo(e,Be,je))),onClick:Rn},trigger:[`click`],children:(0,l.jsxs)(s.Button,{type:`text`,size:`small`,className:`job-actions-button job-actions-menu-button`,children:[(0,l.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.6279%206.78121C12.6857%206.88148%2012.7014%207.00057%2012.6715%207.11239C12.6417%207.22422%2012.5688%207.31967%2012.4688%207.37785L7.21875%2010.4403C7.15185%2010.4794%207.0758%2010.4999%206.99836%2010.4999C6.92092%2010.4999%206.84487%2010.4794%206.77797%2010.4403L1.52797%207.37785C1.42936%207.31859%201.35806%207.22289%201.32951%207.11145C1.30095%207.00001%201.31744%206.88181%201.37539%206.78244C1.43335%206.68306%201.52811%206.61052%201.63916%206.5805C1.75022%206.55048%201.86863%206.56542%201.96875%206.62207L7%209.55605L12.0312%206.62207C12.1315%206.56428%2012.2506%206.54858%2012.3624%206.57841C12.4743%206.60824%2012.5697%206.68116%2012.6279%206.78121ZM1.3125%204.37496C1.31267%204.29833%201.33297%204.22309%201.37136%204.15677C1.40975%204.09045%201.46489%204.03538%201.53125%203.99707L6.78125%200.934566C6.84815%200.895555%206.9242%200.875%207.00164%200.875C7.07908%200.875%207.15513%200.895555%207.22203%200.934566L12.472%203.99707C12.5381%204.0356%2012.5929%204.09076%2012.6309%204.15707C12.669%204.22337%2012.6891%204.2985%2012.6891%204.37496C12.6891%204.45142%2012.669%204.52654%2012.6309%204.59285C12.5929%204.65915%2012.5381%204.71432%2012.472%204.75285L7.22203%207.81535C7.15513%207.85436%207.07908%207.87491%207.00164%207.87491C6.9242%207.87491%206.84815%207.85436%206.78125%207.81535L1.53125%204.75285C1.46489%204.71453%201.40975%204.65946%201.37136%204.59314C1.33297%204.52682%201.31267%204.45159%201.3125%204.37496ZM2.61844%204.37496L7%206.93105L11.3816%204.37496L7%201.81886L2.61844%204.37496ZM7.65625%2011.7993L7%2012.1821L1.96875%209.24707C1.86913%209.19747%201.75436%209.18769%201.64779%209.21973C1.54122%209.25177%201.45087%209.32322%201.39512%209.41953C1.33937%209.51583%201.32241%209.62977%201.3477%209.73814C1.37299%209.84651%201.43863%209.94117%201.53125%2010.0028L6.78125%2013.0653C6.84815%2013.1044%206.9242%2013.1249%207.00164%2013.1249C7.07908%2013.1249%207.15513%2013.1044%207.22203%2013.0653L8.09703%2012.5551C8.14746%2012.5266%208.19171%2012.4883%208.22723%2012.4426C8.26275%2012.3968%208.28882%2012.3444%208.30394%2012.2885C8.31906%2012.2326%208.32291%2012.1742%208.31529%2012.1167C8.30766%2012.0593%208.28871%2012.004%208.25952%2011.9539C8.23033%2011.9039%208.19149%2011.8601%208.14526%2011.8252C8.09903%2011.7903%208.04632%2011.7649%207.9902%2011.7505C7.93408%2011.7361%207.87566%2011.7331%207.81833%2011.7414C7.761%2011.7498%207.70591%2011.7695%207.65625%2011.7993Z'%20fill='%236B7280'/%3e%3cpath%20d='M10.6036%2011.3825L13.4607%209.4477C13.5813%209.36599%2013.614%209.20256%2013.5341%209.08069L13.0105%208.282C12.9303%208.15966%2012.7665%208.12478%2012.6434%208.20383L9.54053%2010.1964L8.94939%2011.4054C8.84904%2011.6106%209.03632%2011.8387%209.25715%2011.7803L10.4338%2011.469C10.4561%2011.4631%2010.4776%2011.4543%2010.4977%2011.4429L10.6036%2011.3825ZM9.54053%2010.1964L10.6036%2011.3825'%20stroke='%236B7280'%20stroke-width='0.6'/%3e%3c/svg%3e`,alt:``,className:`job-actions-frame-icon`}),`Actions `,(0,l.jsx)(c.DownOutlined,{className:`job-actions-caret`})]})}),Y.length>0&&(0,l.jsxs)(Wi,{className:`job-selected-count`,children:[`Selected (`,Y.length,`)`]})]}),Tn&&(0,l.jsxs)(Wi,{className:`job-search-results-count`,children:[`Search Results (`,En,`)`]})]})})}),ln&&(0,l.jsx)(Io,{filters:q,onRemove:e=>{let t=q.filter((t,n)=>n!==e);J(t),Xt()},onClearAll:Jn}),(0,l.jsx)(`div`,{ref:et,className:`job-table-measure`,children:(0,l.jsx)(s.Spin,{spinning:Nt?M:Qt||Ct,children:zt===`card`?Cn.length===0?(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:An,className:`param-card-view__empty`,children:!Nt&&we&&he&&qt&&!Dt&&(0,l.jsx)(s.Button,{type:`primary`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>_e(qt),children:`Add New`})}):(0,l.jsx)(`div`,{className:`param-card-view__grid`,children:Cn.map((e,t)=>{let n=String(so(e,t,_));return(0,l.jsx)(Mo,{record:e,fields:xn,selected:oe===`checkbox`?Qe.includes(n):ot(e,t),isControlled:Nt,onPreview:()=>Nn(e),onSelect:()=>Yn(n),onPopupAction:Pn,onRecordClick:ae?()=>st(e,t):void 0,selectionMode:oe,permissions:{canAdd:we,canEdit:Te,canDelete:Ee}},n)})}):(0,l.jsx)(s.Table,{rowSelection:Dn&&oe===`checkbox`?{type:`checkbox`,fixed:!0,columnWidth:48,selectedRowKeys:Y,onChange:(e,t)=>{ct(e,t)},columnTitle:(()=>{let e=Cn.length,t=e>0&&Y.length>=e,n=Y.length>0&&!t;return(0,l.jsx)(s.Checkbox,{checked:t,indeterminate:n,onChange:()=>{if(n||t)ct([],[]);else{let e=Cn.map((e,t)=>so(e,t,_));ct(e,[...Cn])}}})})()}:void 0,columns:Fn,dataSource:Cn,size:`middle`,tableLayout:`fixed`,scroll:{x:bn||Nt?`max-content`:void 0,y:`calc(100vh - 300px)`},pagination:!1,locale:{emptyText:(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:An})},className:`${D} ${se?`list-view-table--compact`:``}`.trim(),onRow:ae?(e,t)=>({onClick:n=>{co(n.target)||st(e,t)},"aria-selected":ot(e,t)}):void 0,rowClassName:W==null?void 0:(e,t)=>ot(e,t)?`list-view-row--active`:``,rowKey:(e,t)=>so(e,t,_)})})}),Dn?(0,l.jsx)(Re,{current:We.current,pageSize:We.pageSize,total:wn,onChange:(e,t)=>{if(Nt&&typeof L==`function`){L(e,t??We.pageSize);return}Yt(e)},onPageSizeChange:e=>{if(Nt&&typeof R==`function`){R(e);return}Ge({current:1,pageSize:e}),Jt(1,{replace:!0})}}):void 0,(0,l.jsx)(Vi,{moduleName:K,open:Le,filters:q,onClose:()=>ze(!1),onApply:({filters:e})=>{J(e),Xt()},onReset:Jn}),(0,l.jsx)(ki,{moduleName:K,open:jt,rows:lt,tabs:Mn,total:wn,onClose:()=>Mt(!1)})]})}var Ro=new Map,zo=0;function Bo(e){let t=`ph_${Date.now()}_${zo+=1}`;return Ro.set(t,e),e.finally(()=>{setTimeout(()=>Ro.delete(t),0)}).catch(()=>{}),t}function Vo(e){if(!e)return;let t=Ro.get(e);return Ro.delete(e),t}async function Ho({jobId:e,applicantId:n,timeoutMs:r=15e3}){if(!e||!n)return[];let i=new AbortController,a=setTimeout(()=>i.abort(),r);try{let r=await t.a(),a=await fetch(`${t.x}/skill-match`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${r}`},body:JSON.stringify({jobId:e,applicantId:n}),signal:i.signal});if(!a.ok)return[];let o=await a.json(),s=o?.data?.relevantSkills??o?.relevantSkills;return Array.isArray(s)?s.filter(e=>typeof e==`string`&&e.trim()):[]}catch{return[]}finally{clearTimeout(a)}}async function Uo({isFromSubmission:e,jobId:n,submissionId:r,search:i=``}={}){let a={search:i};e?a.submissionId=r:a.jobId=n;let o=await t.o(t.S,`/quicksubmit/list`,{method:`POST`,body:JSON.stringify(a)});return o.data??o}async function Wo(e){if(!e)throw Error(`Dice candidate ID is required`);let n=await t.a(),r=`${t.x}/dicemigrate/${encodeURIComponent(String(e))}`;process.env.NODE_ENV===`development`&&console.log(`[DiceMigration] Request URL:`,r);let i=await fetch(r,{method:`GET`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`}}),a=await i.json().catch(()=>null);if(!i.ok){let e=Error(a?.message??a?.error??`Failed to migrate candidate (${i.status})`);throw e.status=i.status,e}return a}function Go(e){return e&&typeof e==`object`?Go(e.value??e.key??e.id??e.label??e.name):String(e??``).trim().toLowerCase()}function Ko(e){return(Array.isArray(e)?e:[e]).flat().map(Go).filter((e,t,n)=>e&&e!==`all`&&n.indexOf(e)===t)}function qo(e,t=`internal`){let n=Ko(e);if(n.includes(`internal`))return`internal`;let r=Go(t);return n[0]?n[0]:r||(t===``?``:`internal`)}function Jo(e,t){let n={...t??{}};return(Array.isArray(e)?e:[]).flatMap(e=>Array.isArray(e?.options)?e.options:[]).forEach(e=>{let t=Go(e?.value),r=String(e?.module??``).trim();t&&r&&(n[t]=r)}),n}function Yo(e){return String(e??``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function Xo(e){return Go(Zo(e))}function Zo(e){let t=e?.key??e?.value??e?.id??e?.source??e?.name??e?.title??e?.label;return String(t??``).trim()}function Qo(e){let t=e?.count??e?.countValue,n=Number(t);return Number.isFinite(n)?n:void 0}function $o(e,t,n,r,i){let a=Number(t?.[e]);if(Number.isFinite(a))return a;if(e===r){let e=Number(i);if(Number.isFinite(e))return e}let o=n.get(e);if(o!==void 0)return o}function es({sources:e=[],activeSource:t=`internal`,activeCount:n=0,responseCounts:r={},currentTabs:i=[],backendTabs:a=[]}={}){let o=new Map((Array.isArray(i)?i:[]).map(e=>[Xo(e),Qo(e)]).filter(([e,t])=>e&&t!==void 0)),s=new Map,c=Ko(e),l=Go(t);return(c.length?c:l?[l]:[]).forEach(e=>{if(!e||s.has(e))return;let i=$o(e,r,o,t,n);s.set(e,{key:e,title:Yo(e),...i===void 0?{}:{count:i}})}),(Array.isArray(a)?a:[]).forEach(e=>{let t=Xo(e);if(!t)return;let n=s.get(t),r=Qo(e)??n?.count??o.get(t);s.set(t,{key:n?n.key:Zo(e),title:e.title??e.label??e.name??n?.title??Yo(t),...r===void 0?{}:{count:r}})}),Array.from(s.values())}function ts(e){return[e?.sourceType,e?.profileSource,e?.selectedSource,e?.source,e?.provider,e?.customFields?.sourceType,e?.customFields?.profileSource,e?.customFields?.source,e?.customFields?.provider].flat().map(Go).filter(Boolean)}function ns(e,t,n){let r=Go(t);return r?ts(e).includes(r)?!0:typeof n==`function`&&n(e):!1}var rs=[{source:`dice`,field:`__sourceAction_dice_migrate`,label:`Action`,buttonLabel:`Migrate`,completedLabel:`Migrated`,successMessage:`Candidate migrated successfully.`,errorMessage:`Failed to migrate candidate.`,isRecordFromSource:e=>!!e?.customFields?.diceProfileData,getRecordId:r.r,execute:Wo}];function is({rows:e=[],selectedSource:t=``}={}){return rs.filter(n=>Go(t)===n.source||e.some(e=>ns(e,n.source,n.isRecordFromSource)))}function as(e,t,n=``){return Go(n)===e.source||ns(t,e.source,e.isRecordFromSource)}function os(e,t){let n=e?.getRecordId?.(t);return n?`${e.source}:${e.field}:${n}`:``}async function ss(e,t){let n=e?.getRecordId?.(t);if(!n)throw Error(`${e?.buttonLabel??`Action`} ID is required`);return e.execute(n,t)}var cs=e.t({default:()=>uc}),{Text:ls}=s.Typography,{TextArea:us}=s.Input,ds=[],fs=[(0,l.jsx)(c.UserOutlined,{}),(0,l.jsx)(c.EnvironmentOutlined,{}),(0,l.jsx)(c.SolutionOutlined,{}),(0,l.jsx)(c.InfoCircleOutlined,{}),(0,l.jsx)(c.FileTextOutlined,{})],ps={email:(0,l.jsx)(c.MailOutlined,{className:`v1-input-icon`}),contactNumber:(0,l.jsx)(c.PhoneOutlined,{className:`v1-input-icon`}),phone:(0,l.jsx)(c.PhoneOutlined,{className:`v1-input-icon`}),currentLocation:(0,l.jsx)(c.EnvironmentOutlined,{className:`v1-input-icon`}),preferredLocation:(0,l.jsx)(c.EnvironmentOutlined,{className:`v1-input-icon`}),skills:(0,l.jsx)(c.TagsOutlined,{className:`v1-input-icon`}),firstName:(0,l.jsx)(c.UserOutlined,{className:`v1-input-icon`}),lastName:(0,l.jsx)(c.UserOutlined,{className:`v1-input-icon`})},ms=e=>e===!0||e===1||e===`1`,hs=(e,t)=>(e?.edit===void 0||ms(e.edit))&&(!e?.editablePermission||n.F(e.editablePermission,t));function gs(e=[]){return e.map(e=>typeof e==`string`?{label:e,value:e}:{label:e.label??e.name??e.value,value:e.value??e.id??e.name??e.label})}function _s(e){return String(e??``).split(`.`).map(e=>e.trim()).filter(Boolean)}function vs(e,t){return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),t]:[t]}function ys({form:e,field:t,absoluteName:r}){let[i,a]=(0,o.useState)(!1),[c,u]=(0,o.useState)(null),d=(0,o.useRef)(null),f=s.Form.useWatch(t.verifyResultField?vs(r,t.verifyResultField):[`__noop_verify__`],{form:e,preserve:!0}),p=s.Form.useWatch(r,e);return(0,o.useEffect)(()=>{let n=String(p??``).trim();if(f===!0&&d.current===null&&n){d.current=n;return}f===!0&&d.current!==null&&n!==d.current&&(t.verifyResultField&&e.setFieldValue(vs(r,t.verifyResultField),!1),t.verifyTimestampField&&e.setFieldValue(vs(r,t.verifyTimestampField),void 0),d.current=null)},[r,p,t.verifyResultField,t.verifyTimestampField,e,f]),t.verifyAction===`email`?f===!0?c&&!c.mailboxConfirmed&&(c.catchAll||c.result===`risky`)?(0,l.jsx)(s.Tooltip,{title:c.reason||`This domain accepts every address, so the mailbox could not be confirmed. Delivery is proven only once the account email is actually sent.`,children:(0,l.jsx)(ls,{type:`warning`,strong:!0,className:`v1-verify-field-wrap`,children:t.verifyUnconfirmedLabel||`Accepted`})}):(0,l.jsx)(ls,{type:`success`,strong:!0,className:`v1-verify-field-wrap`,children:t.verifySuccessLabel||`Valid`}):(0,l.jsx)(s.Button,{size:`small`,loading:i,onClick:async()=>{let i=String(p??``).trim();if(!i){s.message.warning(`Enter an email first`);return}a(!0);try{let a=await n._i(i);d.current=a.valid?i:null,u(a.valid?a:null),t.verifyResultField&&e.setFieldValue(vs(r,t.verifyResultField),a.valid),t.verifyTimestampField&&e.setFieldValue(vs(r,t.verifyTimestampField),a.valid?new Date().toISOString():void 0),a.valid?a.mailboxConfirmed?s.message.success(`Email verified — the mail server confirmed this mailbox`):s.message.warning(a.reason||`The domain can receive mail, but this exact mailbox could not be confirmed`):s.message.error(a.reason?`Invalid email: ${a.reason}`:`Email could not be verified`)}catch(n){d.current=null,u(null),t.verifyResultField&&e.setFieldValue(vs(r,t.verifyResultField),!1),t.verifyTimestampField&&e.setFieldValue(vs(r,t.verifyTimestampField),void 0),s.message.error(n?.message||`Could not verify email`)}finally{a(!1)}},className:`v1-verify-field-wrap`,children:f===!1?t.verifyRetryLabel||`Re Verify`:t.verifyIdleLabel||`Verify Email`}):null}function bs({form:e,field:t,siblingPrefix:r,locked:i,combined:a=!1}){let o=s.Form.useWatch(n.r(t?.labelWhen,r),e),c=n.a(t,o,a);return a?c:(0,l.jsx)(ac,{field:t,label:c,locked:i})}function xs({form:e,groups:t,action:n,disabled:r,loading:i,onFire:a}){let o=s.Form.useWatch(e=>t.some(t=>{if(!t.addRow||!t.requireValidatedField)return!1;let n=e?.[t.name]??[];return n.length===0||n.some(e=>!e?.[t.requireValidatedField])}),{form:e,preserve:!0}),c=s.Form.useWatch(n?.enabledWhen?.field,e),u=!n?.enabledWhen?.field||Ts(n.enabledWhen,c);return(0,l.jsx)(s.Button,{type:n?.tone===`primary`?`primary`:`default`,onClick:a,disabled:r||o||!u,loading:i,children:n?.label||`Submit`})}function Ss({form:e,groups:t,disabled:n,loading:r,onClick:i,children:a}){let o=s.Form.useWatch(e=>t.some(t=>{if(!t.addRow||!t.requireValidatedField)return!1;let n=e?.[t.name]??[];return n.length===0||n.some(e=>!e?.[t.requireValidatedField])}),{form:e,preserve:!0}),c=n||o,u=t.find(e=>e.submitDisabledMessage)?.submitDisabledMessage,d=t.find(e=>e.requireValidatedField)?.requireValidatedFieldMessage,f=o?d||u||`Verify every required row before submitting.`:u||`Complete all mandatory fields before submitting.`,p=(0,l.jsx)(s.Button,{type:`primary`,onClick:i,disabled:c,loading:r,children:a});return c&&!r?(0,l.jsx)(s.Tooltip,{title:f,children:(0,l.jsx)(`span`,{style:{display:`inline-flex`,cursor:`not-allowed`},children:p})}):p}function Cs({form:e,rules:t,watchPaths:r,targetPath:i,resetOnNoMatch:a=!0}){let c=s.Form.useWatch(e=>JSON.stringify(r.map(({path:t})=>t.reduce((e,t)=>e==null?e:e[t],e)??null)),{form:e,preserve:!0}),l=(0,o.useRef)(void 0),u=(0,o.useRef)(!0);return(0,o.useEffect)(()=>{let o=c?JSON.parse(c):[],s={};r.forEach(({field:e},t)=>{s[e]=o[t]});let d=u.current;u.current=!1;let f=n.G({rules:t,watched:s,current:e.getFieldValue(i),lastApplied:l.current,clearOnMismatch:a,initial:d});f.action===`set`?(e.setFieldValue(i,f.value),l.current=f.value):f.action===`clear`&&(e.setFieldValue(i,void 0),l.current=void 0)},[c]),null}function ws({form:e,config:n,watchPath:r}){let i=s.Form.useWatch(r,e),a=(0,o.useRef)(void 0);return(0,o.useEffect)(()=>{if(Is(i)||i===a.current)return;a.current=i;let r=n.endpointTemplate?`${n.endpointTemplate.replace(`{value}`,encodeURIComponent(String(i)))}`:`${n.endpoint}?${new URLSearchParams({[n.queryParam]:String(i)}).toString()}`;t.o(t.x,r).then(t=>{let r=t?.data??t;if(n.substituteTokens){(n.substituteInFields||[]).forEach(t=>{let i=_s(t),a=e.getFieldValue(i)||``;Object.entries(n.substituteTokens).forEach(([e,t])=>{let n=e.replace(/^\{\{|\}\}$/g,``).trim(),i=RegExp(`\\{\\{\\s*${n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}\\s*\\}\\}`,`gi`);a=a.replace(i,r?.[t]??``)}),e.setFieldValue(i,a)});return}Object.entries(n.mapResponseToFields).forEach(([t,i])=>{let a=_s(t);n.onlyIfEmpty&&!Is(e.getFieldValue(a))||e.setFieldValue(a,r?.[i])})}).catch(()=>{})},[i]),null}function Ts(e,t){if(!e?.field)return!0;let n=String(t??``),r=String(e.value??``),i=()=>r.split(`,`).map(e=>e.trim());switch(e.operator){case`eq`:return n===r;case`neq`:return n!==r;case`in`:return i().includes(n);case`notIn`:return!i().includes(n);case`truthy`:return ms(t);case`falsy`:return!ms(t);case`empty`:case`isEmpty`:return t==null||n.trim()===``||Array.isArray(t)&&t.length===0;case`notEmpty`:return!(t==null||n.trim()===``||Array.isArray(t)&&t.length===0);default:return!0}}function Es({form:e,showIf:t,render:n}){return Ts(t,s.Form.useWatch(t.field,e))?n():null}var Ds=(0,o.createContext)(!1);function Os({form:e,group:t,children:n,inheritParent:r=!0}){let i=(0,o.useContext)(Ds),a=t?.disabledIf?.field?_s(t.disabledIf.field):[`__noop_group_disabled__`],c=s.Form.useWatch(a,e),u=t?.disabledIf?.field?Ts(t.disabledIf,c):!1,d=r&&i||!!t?.disabled||u;return(0,l.jsx)(Ds.Provider,{value:d,children:n})}function ks(e,t){return String(t??``).split(`.`).reduce((e,t)=>e?.[t],e)}function As(e){return e==null||e===``?!1:Array.isArray(e)?e.length>0&&e.some(As):typeof e!=`object`||Object.values(e).some(As)}function js(e){return Array.isArray(e)?e:Array.isArray(e?.groups)?e.groups:Array.isArray(e?.data)?e.data:Array.isArray(e?.data?.groups)?e.data.groups:ds}function Ms(e=[],t,r,i){let a=i??new Set;return[...js(e)].filter(e=>!ms(e.hideGroup)&&!ms(e.hideGroupInForm)&&n.cn(r,e.name)).sort((e,t)=>Number(e.order??0)-Number(t.order??0)).map(e=>({...e,fields:[...e.fields??[]].map(e=>a.has(e.field)?{...e,show:1,req:1}:e).filter(i=>String(i.field??``).trim()!==``&&i.showOnAdd!==!1&&!ms(i.clientScope)&&(!i.visiblePermission||n.F(i.visiblePermission,t))&&n.on(r,e.name,i.field)).map(t=>n.sn(r,e.name,t.field)?t:{...t,disabled:!0}).sort((e,t)=>Number(e.order??0)-Number(t.order??0))})).filter(e=>e.fields.length)}function Ns(e){if(!Array.isArray(e))return null;let t={};return e.forEach(e=>{e.addRow||(e.fields??[]).forEach(e=>{!e.field||e.value===void 0||e.value===null||(t[e.field]=e.value,e.payloadKey&&e.payloadKey!==e.field&&(t[e.payloadKey]=e.value))})}),Object.keys(t).length>0?t:null}function Ps(e,t){if(!(!e||!t))for(let r of[t.prefillFrom,t.field,t.payloadKey]){if(!r)continue;let t=e[r];if(t??=n.Xt(e,r),t!=null)return t}}function Fs(e){if(Array.isArray(e))return e.flatMap(e=>Fs(e));if(!e||typeof e!=`object`)return[];let t=$t(e),n=en(e);return!t&&!n?[]:[{uid:n||t||`-1`,name:t||`file`,status:`done`,url:n,existing:!0,stored:e}]}var Is=e=>e==null||e===``,Ls=e=>String(e).replace(/<[^>]*>/g,``).replace(/&nbsp;/g,` `).replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).trim(),Rs=({label:e,message:t,value:n,compare:r,text:i})=>({validator:(a,o)=>Is(o)||r(Number(o),Number(n))?Promise.resolve():Promise.reject(Error(t??`${e} ${i} ${n}`))});function zs(e,t){return n.nt(e,t)}var Bs=({label:e,message:t,value:n,rule:r,form:i,name:a,compare:o,text:s})=>({validator:async(c,l)=>{let u=n??r.compareField??r.field;if(!u||Is(l))return Promise.resolve();let d=i.getFieldValue(zs(a,u));if(Is(d))return Promise.resolve();let f=Number(l),p=Number(d);return Number.isNaN(f)||Number.isNaN(p)||o(f,p)?Promise.resolve():Promise.reject(Error(t??`${e} ${s} ${u}`))}}),Vs={noPastDate:({label:e,message:t})=>({validator:(r,i)=>{if(Is(i))return Promise.resolve();let a=n.g(i);if(a===null)return Promise.resolve();let o=new Date;return o.setHours(0,0,0,0),a<o.getTime()?Promise.reject(Error(t??`${e} cannot be a past date`)):Promise.resolve()}}),noFutureDate:({label:e,message:t})=>({validator:(r,i)=>{if(Is(i))return Promise.resolve();let a=n.g(i);if(a===null)return Promise.resolve();let o=new Date;return o.setHours(23,59,59,999),a>o.getTime()?Promise.reject(Error(t??`${e} cannot be a future date`)):Promise.resolve()}}),minAge:({label:e,message:t,value:r})=>({validator:(e,i)=>{if(Is(i))return Promise.resolve();let a=n.g(i);if(a===null)return Promise.resolve();let o=Number(r??18),s=new Date;return s.setFullYear(s.getFullYear()-o),s.setHours(23,59,59,999),a>s.getTime()?Promise.reject(Error(t??`Must be at least ${o} years old`)):Promise.resolve()}}),dateAfterField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>n.p({type:`dateAfterField`,label:e,rule:{...i,value:r??i?.compareField??i?.field,message:t},readSibling:e=>a.getFieldValue(zs(o,e))}),dateBeforeField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>n.p({type:`dateBeforeField`,label:e,rule:{...i,value:r??i?.compareField??i?.field,message:t},readSibling:e=>a.getFieldValue(zs(o,e))}),timeAfterField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>({validator:async(s,c)=>{let l=r??i.compareField??i.field;if(!l||Is(c))return Promise.resolve();let u=a.getFieldValue(zs(o,l));if(Is(u))return Promise.resolve();let d=n._(c),f=n._(u);return d===null||f===null||d>f?Promise.resolve():Promise.reject(Error(t??`${e} must be after ${l}`))}}),timeBeforeField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>({validator:async(s,c)=>{let l=r??i.compareField??i.field;if(!l||Is(c))return Promise.resolve();let u=a.getFieldValue(zs(o,l));if(Is(u))return Promise.resolve();let d=n._(c),f=n._(u);return d===null||f===null||d<f?Promise.resolve():Promise.reject(Error(t??`${e} must be before ${l}`))}}),greaterThanField:e=>Bs({...e,compare:(e,t)=>e>=t,text:`must be greater than or equal to`}),strictGreaterThanField:e=>Bs({...e,compare:(e,t)=>e>t,text:`must be greater than`}),strictLessThanField:e=>Bs({...e,compare:(e,t)=>e<t,text:`must be less than`}),lessThanOrEqualField:e=>Bs({...e,compare:(e,t)=>e<=t,text:`must be less than or equal to`}),maxFromField:e=>n.it(e),maxFieldWithFallback:({label:e,message:t,value:r,rule:i,form:a,name:o})=>({validator:async(s,c)=>{let l=n.et(r??i.compareFields),u=n.$({input:c,compareFields:l,readValue:e=>n.tt(a,o,e)});return u.ok?Promise.resolve():Promise.reject(Error(t??`${e} must not exceed ${u.field}`))}}),required:({field:e,message:t})=>({validator:(n,r)=>{let i=r==null||r===``||Array.isArray(r)&&r.length===0;return!i&&e?.type===`text-editor`&&(i=Ls(r)===``),i?Promise.reject(Error(t??`Mandatory Field`)):Promise.resolve()}}),email:({label:e,message:t})=>n.wt(e,t),unique:({field:e,rule:t,uniqueContext:r})=>n._t({field:e,validation:t,context:r}),emailTags:({label:e,message:t})=>({validator:(r,i)=>{let a=(Array.isArray(i)?i:[]).find(e=>!n.Tt(e));return a?Promise.reject(Error(t??`${e} contains an invalid email: ${a}`)):Promise.resolve()}}),noHtml:({label:e,message:t})=>({validator:(n,r)=>r==null||r===``?Promise.resolve():/<\/?[a-z][\s\S]*>/i.test(String(r))?Promise.reject(Error(t??`${e} cannot contain HTML tags`)):Promise.resolve()}),url:({label:e,message:t})=>({type:`url`,message:t??`Enter valid ${e}`}),number:({label:e,message:t})=>({pattern:/^[0-9]+$/,message:t??`${e} must be a number`}),phone:({message:e})=>({validator:(t,r)=>{if(r==null||r===``)return Promise.resolve();let{total:i}=n.Vn();return n.Hn(r).length===i?Promise.resolve():Promise.reject(Error(e??`Phone number must contain exactly ${i} digits`))}}),minLength3:e=>Vs.min({...e,value:3}),minLength5:e=>Vs.min({...e,value:5}),len:({label:e,message:t,value:n})=>({len:Number(n),message:t??`${e} must be ${n} characters`}),pattern:({label:e,message:t,rule:n})=>({pattern:new RegExp(n.pattern??n.value,n.flags),message:t??`Enter valid ${e}`}),min:({field:e,label:t,message:n,value:r})=>e.type===`number`?Rs({label:t,message:n,value:r,compare:(e,t)=>e>=t,text:`must be at least`}):{validator:(i,a)=>{if(a==null||a===``)return Promise.resolve();let o=e.type===`text-editor`?Ls(a):String(a);return o===``||o.length>=Number(r)?Promise.resolve():Promise.reject(Error(n??`${t} must be at least ${r} characters`))}},max:({field:e,label:t,message:n,value:r})=>e.type===`number`?Rs({label:t,message:n,value:r,compare:(e,t)=>e<=t,text:`must not exceed`}):{validator:(i,a)=>{if(a==null||a===``)return Promise.resolve();let o=e.type===`text-editor`?Ls(a):String(a);return o===``||o.length<=Number(r)?Promise.resolve():Promise.reject(Error(n??`${t} must not exceed ${r} characters`))}}};function Hs(e,t,n,r,i,a){let o=typeof e==`string`?{type:e}:e,s=o.type??o.rule??o.name,c=o.value??o.length??o.min??o.max,l=t.label??t.field??`Field`,u=Vs[s];return u?u({field:t,label:l,message:o.message,rule:o,value:c,form:n,name:r,prefixFor:i,uniqueContext:a}):o}function Us(e,t){return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),t]:[t]}function Ws(e,t,n){return ms(e?.req)||(e?.validations??e?.validation??e?.rules??[]).some(e=>(typeof e==`string`?e:e?.type)===`required`)?!0:e?.requiredIfField&&t&&n?ms(t.getFieldValue(Us(n,e.requiredIfField))):!1}function Gs(e,t,r,i=!1,a=void 0,o=void 0,s=void 0){let c=e.label??e.field??`Field`,l=e.validations??e.validation??e.rules??[],u=l.some(e=>(typeof e==`string`?e:e?.type)===`required`),d=l.some(e=>(typeof e==`string`?e:e?.type)===`email`),f=[];if(s?.length&&f.push(...s),e.rowHierarchy){let i=Js(t,r);i.rows&&f.push(n.m({field:e,...i}))}!i&&!u&&ms(e.req)&&e.disabledByField?f.push({validator:(n,i)=>ms(t.getFieldValue(Us(r,e.disabledByField)))?Promise.resolve():i==null||i===``?Promise.reject(Error(`Mandatory Field`)):Promise.resolve()}):!i&&!u&&e.requiredIfField?f.push({validator:(n,i)=>ms(t.getFieldValue(Us(r,e.requiredIfField)))&&(i==null||i===``)?Promise.reject(Error(`Mandatory Field`)):Promise.resolve()}):!i&&ms(e.req)&&!u&&f.push({required:!0,message:`Mandatory Field`}),(e.type===`email`||e.formatter===`email`)&&!d&&f.push(n.wt(c)),e.type===`number`&&f.push(ms(e.decimal)?{pattern:/^\d+(\.\d+)?$/,message:`${c} must be a number`}:{pattern:/^[0-9]+$/,message:`${c} must be a number`});let p=n.in(e,r,a,n=>Hs(n,e,t,r,a,o));return n.gt([...f,...l.map(p),n.an(e)])}function Ks(e,t){let n=(e.validations??e.validation??e.rules??[]).find(e=>(typeof e==`string`?e:e?.type)===t);if(!(!n||typeof n==`string`))return n.value??n.length??n[t]}function qs(e){let t=e.len??Ks(e,`len`),n=e.min??Ks(e,`min`),r=e.max??Ks(e,`max`);return e.type===`number`?{min:n??void 0,max:r??void 0}:{minLength:n??void 0,maxLength:e.maxLength??t??r??void 0}}function Js(e,t){if(!Array.isArray(t)||t.length<3||typeof t[1]!=`number`)return{};let n=e.getFieldValue(t[0]);return Array.isArray(n)?{rows:n,rowIndex:t[1]}:{}}function Ys(e,t,r){return n.f({field:e,readSibling:e=>t.getFieldValue(zs(r,e)),...Js(t,r)})}function Xs(e){return n.h(e)}function Zs(e,t){return t?t===`phone`?n.Rn(e):t===`digits`?e.replace(/\D/g,``).slice(0,10):t===`email`||t===`noSpaces`?e.replace(/\s/g,``):t===`name`?e.replace(/\s+/g,` `).trimStart().replace(/\b\w/g,e=>e.toUpperCase()):e:e}function Qs(e=``){let t=String(e).toLowerCase();return t===`job`?`jobs`:t===`candidate`?`candidates`:t===`submissions`?`submission`:t}var $s=new Set([`selectedSource`,`source`,`sourceType`,`scope`]);function ec(e){return e==null?!1:typeof e==`string`?e.trim().length>0:typeof e==`number`?Number.isFinite(e):typeof e==`boolean`?e:u.default.isDayjs(e)?e.isValid():Array.isArray(e)?e.some(ec):typeof e==`object`?`value`in e||`label`in e||`name`in e?ec(e.value??e.label??e.name):Object.entries(e).some(([e,t])=>!$s.has(e)&&ec(t)):!1}function tc(e={}){return Object.entries(e??{}).some(([e,t])=>!$s.has(e)&&ec(t))}function nc(e,t,r={},i=``){let a=new FormData;n.Jt(e,t,{scope:`flat`,module:i}).forEach(({formKey:e,file:t})=>{a.append(e,t)});let o={...r,...n.Kt(e,t,{module:i})};return o.schemaVersion=1,a.append(`json`,JSON.stringify(o)),a}function rc({field:e,form:r,name:i,moduleName:a,value:u,checked:d,onChange:f,scopeValues:p={},onAiUpload:m,onDuplicateBlur:h,onRegionBlocked:g,onRowOrderChange:_,formDisabled:v,rowFieldKeys:y}){let b=e.type??`text`,x=!hs(e,a),[S,C]=(0,o.useState)(null),[w,T]=(0,o.useState)(!1),[E,D]=(0,o.useState)(``),[O,k]=(0,o.useState)(``),[A,j]=(0,o.useState)(``),[M,N]=(0,o.useState)(0),[P,F]=(0,o.useState)({open:!1,docs:[],index:0}),[I,L]=(0,o.useState)(null),R=(0,o.useRef)([]),z=Array.isArray(i)&&i.length>=3&&typeof i[1]==`number`,B=e.lookupFilterValueFrom?_s(e.lookupFilterValueFrom):[`__lookup_filter_${e.field}`],V=e.lookupFilterValueFrom&&z?[...i.slice(0,2),..._s(e.lookupFilterValueFrom)]:[`__noop_row_filter__`],H=s.Form.useWatch(B,r),U=s.Form.useWatch(V,r),ee=Is(U)?H:U,te=e.disabledByField?Array.isArray(i)&&i.length>1?[...i.slice(0,-1),e.disabledByField]:[e.disabledByField]:[`__noop_disabled_watch__`],ne=s.Form.useWatch(te,r),re=e.disabledIf?.field?_s(e.disabledIf.field):[`__noop_disabled_if__`],ie=e.disabledIf?.field&&z?[...i.slice(0,2),..._s(e.disabledIf.field)]:[`__noop_disabled_if_row__`],ae=s.Form.useWatch(re,r),W=s.Form.useWatch(ie,r),oe=e.disabledIf?.field?n.i(e.disabledIf,Is(W)?ae:W):!1,se=e.optionsFromField||``,ce=se?_s(se):[`__noop_options_from__`],le=se&&z&&(!y||y.has(se))?[...i.slice(0,2),..._s(se)]:[`__noop_options_from_row__`],ue=s.Form.useWatch(ce,r),de=s.Form.useWatch(le,r),fe=Is(de)?ue:de,pe=ms(e.prefillWhenExclusive)&&e.prefillWhen?.length?e.prefillWhen:null,me=s.Form.useWatch(e=>pe?JSON.stringify(n.U(pe).map(t=>{let n=t=>t.reduce((e,t)=>e==null?e:e[t],e),r=z&&(!y||y.has(t))?n([...i.slice(0,2),..._s(t)]):void 0;return(Is(r)?n(_s(t)):r)??null})):``,{form:r,preserve:!0}),he=(0,o.useMemo)(()=>{if(!pe||!me)return null;let e=JSON.parse(me),t={};return n.U(pe).forEach((n,r)=>{t[n]=e[r]}),t},[me]),ge=(0,o.useContext)(Ds),_e=e.exclusiveInGroup&&z?[i[0]]:[`__noop_exclusive_watch__`],G=s.Form.useWatch(_e,r),K=(0,o.useMemo)(()=>{if(!e.exclusiveInGroup||!z||!Array.isArray(G))return!1;let t=i[1],n=i[i.length-1];return G.some((e,r)=>r!==t&&ms(e?.[n]))},[e.exclusiveInGroup,z,G,i]),ve=e.lookupFilterValueFrom?p[e.lookupFilterValueFrom]:void 0,ye=Is(ve)?ee:ve,be=(0,o.useRef)(n.I);(0,o.useEffect)(()=>{if(!e.lookupFilterField||!e.lookupFilterValueFrom)return;let t=be.current;be.current=ye,n.L({previous:t,next:ye,currentValue:r.getFieldValue(i)})&&r.setFields([{name:i,value:void 0,errors:[]}])},[ye]);let xe=e.locationCountryFrom?_s(e.locationCountryFrom):[`__noop_loc_country__`],Se=e.locationCountryFrom&&z?[...i.slice(0,2),..._s(e.locationCountryFrom)]:[`__noop_loc_country_row__`],Ce=s.Form.useWatch(xe,r),we=s.Form.useWatch(Se,r),Te=Is(we)?Ce:we,Ee=e.locationStateFrom?_s(e.locationStateFrom):[`__noop_loc_state__`],De=e.locationStateFrom&&z?[...i.slice(0,2),..._s(e.locationStateFrom)]:[`__noop_loc_state_row__`],Oe=s.Form.useWatch(Ee,r),ke=s.Form.useWatch(De,r),Ae=Is(ke)?Oe:ke,je=e.dataSource===`locationMaster`&&(e.locationLevel===`state`&&Is(Te)||e.locationLevel===`city`&&(Is(Te)||Is(Ae))),Me=x||!!e.disabled||oe||(e.disabledByField?ms(ne):!1)||!!v||ge||K||je;(0,o.useEffect)(()=>{if(b===`location`){let n=!1;T(!0);async function r(){try{let r=new URLSearchParams({search:E,limit:String(e.limit??50),offset:`0`}),i=await t.o(t.x,`/admin/location-dropdown-values?${r}`),a=i?.data??i??[];n||C(gs(Array.isArray(a)?a:[]))}catch(t){console.error(`[AddFormV1] Failed to fetch locations for "${e.field}":`,t),n||C([])}finally{n||T(!1)}}return r(),()=>{n=!0}}let r=e.dataSource;if(![`select`,`radio`,`checkbox`].includes(b)||!r||r===`static`)return;if(r===`lookup`&&e.lookupFilterField&&Is(ye)){C([]),T(!1);return}if(r===`lookup`&&e.lookupMinSearchLength&&O.trim().length<e.lookupMinSearchLength){C([]),T(!1);return}let i=!1;T(!0);async function o(){try{let o=[];if(r===`master`||r===`module`)o=await n.vn(a,e.field,r===`master`?A:``,e.limit??50,0,{dataSource:r,masterName:e.masterName,groupName:e.groupName});else if(r===`lookup`){let r=new URLSearchParams({collection:e.lookupCollection??``,displayField:e.displayField??``,valueField:e.valueField??`_id`});e.displayField2&&r.set(`displayField2`,e.displayField2),O&&r.set(`search`,O),e.lookupFilterField&&!Is(ye)&&(r.set(`filterField`,e.lookupFilterField),r.set(`filterValue`,String(ye))),Array.isArray(e.filters)&&e.filters.length>0&&r.set(`filters`,JSON.stringify(e.filters));let i={field:e.field,extraFields:e.extraFields,optionsRequireExtraField:e.optionsRequireExtraField,optionsRequireExtraValue:e.optionsRequireExtraValue,optionsHierarchyParentField:e.optionsHierarchyParentField,optionsHierarchySelfFrom:e.optionsHierarchySelfFrom},a=n.B(i);a.length&&r.set(`extraFields`,a.join(`,`));let s=await t.o(t.x,`/admin/lookup-dropdown-values?${r}`);o=s?.data??s??[],o=n.z(o,i,{source:`AddFormV1`})}else if(r===`locationMaster`){let n=e.locationLevel||`country`;if(n===`state`&&Is(Te))o=[];else if(n===`city`&&(Is(Te)||Is(Ae)))o=[];else{let r=new URLSearchParams({level:n,limit:String(e.limit??250),offset:`0`});Is(Te)||r.set(`country`,String(Te)),Is(Ae)||r.set(`state`,String(Ae)),O&&r.set(`search`,O);let i=await t.o(t.x,`/admin/location-dropdown-values?${r}`);o=i?.data??i??[]}}else if(r===`group`){let n=(e.groupName??``).toLowerCase().trim();if(n===`users`||n===`user`){let n=await t.o(t.x,`/get-all-users?limit=500&offset=0`),r=n?.data?.users??n?.users??n?.data??[],i=String(e.groupRoleContains??``).trim().toLowerCase(),a=i?Array.isArray(r)?r.filter(e=>String(e.roleName??``).toLowerCase().includes(i)):[]:r;o=Array.isArray(a)?a.map(e=>({label:[e.firstName,e.lastName].filter(Boolean).join(` `).trim()||e.userName||e.email||String(e.userId),value:e.userId??e.id})):[]}}i||(R.current=Array.isArray(o)?o:[],C(gs(R.current)))}catch(t){console.error(`[AddFormV1] Failed to fetch options for "${e.field}":`,t),i||C([])}finally{i||T(!1)}}return o(),()=>{i=!0}},[b,e.dataSource,e.field,e.limit,e.lookupCollection,e.displayField,e.displayField2,e.valueField,e.lookupFilterField,ye,e.groupName,e.groupRoleContains,e.masterName,E,O,A,a,e.extraFields,e.optionsRequireExtraField,e.optionsRequireExtraValue,e.optionsHierarchyParentField,e.optionsHierarchySelfFrom,M,e.lookupMinSearchLength,e.locationLevel,e.locationCountryFrom,e.locationStateFrom,Te,Ae]);let Ne=gs(e.options??e.values??[]),Pe=S??Ne,[Fe,Ie]=(0,o.useState)([]),Le=n.b(u,Pe).join(`,`);(0,o.useEffect)(()=>{if(!Le||e.dataSource!==`lookup`||w)return;let t=!1;return n.v(e,Le.split(`,`)).then(e=>{t||Ie(e)}).catch(()=>{t||Ie([])}),()=>{t=!0}},[Le,e.dataSource,e.lookupCollection,e.displayField,e.displayField2,e.valueField,w]);let Re=n.y(Pe,Fe),ze=se?n.V(Re,fe):Re,q=pe?n.H(ze,pe,he??{}):ze,J=(e.multiSelect?`multiple`:e.mode??(ms(e.multiple)?`multiple`:void 0))??(n.Yt(e)===`array`?`multiple`:void 0),Y=ms(e.allowCustomValues),X=Y?`tags`:J,Be=!!e.multiSelect||ms(e.multiple)||n.Yt(e)===`array`||J===`multiple`,Ve=Y?typeof e.tokenSeparators==`string`&&e.tokenSeparators?e.tokenSeparators.split(``):[`,`]:void 0,He=[`select`,`location`].includes(b),Ue=e.hidePlaceholder?void 0:e.placeholder??`${He?`Select`:`Enter`} ${String(e.label??``).toLowerCase()}`,We=qs(e),Ge=e=>{f?.(e),setTimeout(()=>{r.validateFields([i]).catch(()=>{})},0)},Ke=n.ot({field:e,form:r,name:i,moduleName:a,scopeValues:p,ownValue:u,onDone:(t,a)=>{N(e=>e+1);let o=n.Yt(e)!==`array`&&!e.multiSelect&&!e.multiple;t===`create`&&a!=null&&o&&((e.clearGroupOnChange||e.linkedClearField)&&n.x(r,e,i,y),Ge(n.tn(e)?{value:a}:a))}}),qe=e.validator?.type?{...e.validator,title:e.validator.title||e.label||`Field`}:null,Je={...We,disabled:Me,placeholder:Ue,prefix:e.icon?null:ps[e.field],value:u??``,onChange:t=>{let r=e.formatter?Zs(t.target.value,e.formatter):t.target.value;if(qe){let{cleaned:e,error:t}=n.St(r,qe,`change`);L(t),r=e}Ge(r)},onBlur:t=>{if(qe){let{cleaned:e,error:r}=n.St(t.target.value,qe,`blur`);L(r),e!==t.target.value&&Ge(e)}e.checkDuplicateOnBlur&&String(t.target.value??``).trim()&&h?.(e)},...qe&&{onKeyPress:e=>{let t=n.Ct(qe.type);if(!t||e.which===0||e.keyCode===8||e.keyCode===13)return;let r=String.fromCharCode(e.which??e.keyCode);if(!t.test(r)){e.preventDefault();let t=`${qe.title} — invalid character.`;L(t),setTimeout(()=>L(e=>e===t?null:e),1800)}},maxLength:qe.maxLength??We.maxLength}};if(b===`tagify`)return(0,l.jsx)(s.Select,{value:u,allowClear:!0,disabled:Me,mode:`tags`,placeholder:Ue,onChange:Ge});if(b===`location`)return(0,l.jsx)(s.Select,{value:u,allowClear:!0,showSearch:!0,filterOption:!1,disabled:Me,loading:w,mode:J,options:q,placeholder:Ue,notFoundContent:w?(0,l.jsx)(s.Spin,{size:`small`}):void 0,onSearch:D,onFocus:()=>D(e=>e),onChange:Ge});if(b===`select`){let t=e.dataSource===`lookup`,a=e.dataSource===`master`,o=t||a,c=n.tn(e),d=n.en(e,u,q),f=Y&&!Be?d==null||d===``?void 0:Array.isArray(d)?d:[d]:d;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Select,{value:f,labelInValue:c||void 0,allowClear:!0,showSearch:e.showSearch!==!1,optionFilterProp:`label`,filterOption:!o&&void 0,disabled:Me,loading:w,mode:X,tokenSeparators:Ve,options:q,placeholder:Ue,notFoundContent:w?(0,l.jsx)(s.Spin,{size:`small`}):void 0,onSearch:t?k:a?j:void 0,onChange:t=>{let a=Y&&!Be&&Array.isArray(t)?t.length?t[t.length-1]:void 0:t;if(Ge(a),(e.clearGroupOnChange||e.linkedClearField)&&n.x(r,e,i,y),e.autofillFrom?.length){let t=a&&!Array.isArray(a)&&typeof a==`object`?a.value:a,n=Array.isArray(i)&&i.length>=3&&typeof i[1]==`number`;if(a==null)e.autofillFrom.forEach(({targetField:e})=>{let t=n?[...i.slice(0,2),..._s(e)]:_s(e);r.setFieldValue(t,null)});else if(R.current.length>0){let a=e.valueField??`_id`,o=R.current.find(e=>ks(e,a)===t||e._id===t||e.id===t||e.value===t);o&&e.autofillFrom.forEach(({optionKey:e,targetField:t})=>{let a=ks(o,e)??o.extraData?.[e]??null,s=n?[...i.slice(0,2),..._s(t)]:_s(t);r.setFieldValue(s,a)})}}},dropdownRender:Ke.footer?e=>(0,l.jsxs)(l.Fragment,{children:[e,Ke.footer]}):void 0}),Ke.modal]})}if(b===`radio`)return(0,l.jsx)(s.Radio.Group,{value:u,disabled:Me,options:q,onChange:e=>Ge(e.target.value)});if(b===`checkbox`)return q.length>0?(0,l.jsx)(s.Checkbox.Group,{value:u,disabled:Me,options:q,onChange:Ge}):(0,l.jsx)(s.Checkbox,{checked:!!(d??u),disabled:Me,onChange:t=>{let n=t.target.checked;if(!(n&&g?.(e))&&(Ge(n),n&&_?.(e,i),e.linkedClearField&&n)){let t=Array.isArray(i)&&i.length>1?[...i.slice(0,-1),e.linkedClearField]:[e.linkedClearField];r.setFieldValue(t,null)}},children:e.checkboxLabel??e.label});if(b===`text-editor`)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.wn,{value:u??r.getFieldValue(i)??``,disabled:Me,placeholder:Ue,onChange:e=>{if(qe){let{error:t}=n.St(e,qe,`change`);L(t)}Ge(e)}}),I&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:I})]});if(b===`textarea`)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(us,{...Je,rows:e.rows??3,className:`v1-scroll-textarea`}),I&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:I})]});if(b===`date`)return(0,l.jsx)(s.DatePicker,{disabled:Me,placeholder:Ue,style:{width:`100%`},suffixIcon:(0,l.jsx)(c.CalendarOutlined,{}),value:u??null,disabledDate:Ys(e,r,i),defaultPickerValue:Xs(e),onChange:t=>{Ge(t),_?.(e,i)}});if(b===`time`)return(0,l.jsx)(s.TimePicker,{disabled:Me,placeholder:Ue,style:{width:`100%`},value:u??null,onChange:e=>Ge(e)});if(b===`file`){let t=e.validations??e.validation??e.rules??[],r=t.find(e=>(typeof e==`string`?e:e?.type)===`fileType`),i=t.find(e=>(typeof e==`string`?e:e?.type)===`fileSize`),a=t.find(e=>(typeof e==`string`?e:e?.type)===`maxFiles`),o=n.pt(e),d=o?o.exts.map(e=>`.${e}`).join(`,`):r?.value?r.value.split(`,`).map(e=>`.${e.trim().replace(/^\./,``)}`).join(`,`):void 0,f=i?Number(i?.value??5):void 0,p=a?Number(a?.value??1):ms(e.multiple)?e.maxCount??5:1,h=Array.isArray(u)?u:[],g=h.length<p,_=e=>e?e<1048576?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(2)} MB`:``,v=e=>{let t=String(e??``).split(`.`).pop()?.toLowerCase();return t===`pdf`?(0,l.jsx)(c.FilePdfOutlined,{className:`v1-file-type-icon v1-file-icon-pdf`}):[`doc`,`docx`].includes(t)?(0,l.jsx)(c.FileWordOutlined,{className:`v1-file-type-icon v1-file-icon-word`}):[`xls`,`xlsx`,`csv`].includes(t)?(0,l.jsx)(c.FileExcelOutlined,{className:`v1-file-type-icon v1-file-icon-excel`}):[`jpg`,`jpeg`,`png`,`gif`,`svg`,`webp`].includes(t)?(0,l.jsx)(c.FileImageOutlined,{className:`v1-file-type-icon v1-file-icon-image`}):(0,l.jsx)(c.FileOutlined,{className:`v1-file-type-icon v1-file-icon-default`})},y=e=>{Ge(h.filter((t,n)=>n!==e))},b=(e,t)=>{let n=h.map(e=>{let t=e.url??e.thumbUrl??``;return!t&&e.originFileObj instanceof File&&(t=URL.createObjectURL(e.originFileObj)),{url:t,name:e.name??`file`}}).filter(e=>e.url);F({open:!0,docs:n,index:t??0})},x=p>1,S=p-h.length,C=[o?o.hint:d?d.split(`,`).map(e=>e.replace(`.`,``).toUpperCase()).join(`, `):null,f?`up to ${f} MB`:null].filter(Boolean).join(` `),w=x&&h.length>0?[C,`${S} of ${p} remaining`].filter(Boolean).join(` • `):C,T=h.length>0?`Add ${x?`more files`:`file`}`:e.buttonLabel??`Upload ${e.label??`File`}`,E=e=>{if(h.length>=p)return s.Upload.LIST_IGNORE;if(d){let t=(e.name.split(`.`).pop()??``).toLowerCase();if(!d.split(`,`).map(e=>e.replace(/^\./,``).toLowerCase()).includes(t))return s.message.error(o?o.error:r?.message??`Only ${r.value} files are allowed`),s.Upload.LIST_IGNORE}return f!==void 0&&e.size/1024/1024>f&&(s.message.error(i?.message??`File must be smaller than ${f} MB`),s.Upload.LIST_IGNORE)},D=({fileList:e})=>{let t=e.slice(0,p);if(Ge(t),m&&t.length>h.length){let e=t[t.length-1];e?.originFileObj&&m(e.originFileObj)}},O={accept:d,fileList:h,showUploadList:!1,multiple:!0,maxCount:p,beforeUpload:E,onChange:D,disabled:Me},k=h.map((e,t)=>(0,l.jsxs)(`div`,{className:`v1-file-item`,children:[(0,l.jsx)(`div`,{className:`v1-file-item-icon`,children:v(e.name)}),(0,l.jsxs)(`div`,{className:`v1-file-item-info`,children:[(0,l.jsx)(`span`,{className:`v1-file-item-name`,title:e.name,children:e.name}),(0,l.jsx)(`span`,{className:`v1-file-item-meta`,children:e.existing?`Previously uploaded`:`${_(e.size)}${e.size?` • `:``}Uploaded just now`})]}),(0,l.jsxs)(s.Space,{size:6,className:`v1-file-item-actions`,children:[(0,l.jsx)(s.Button,{size:`small`,icon:(0,l.jsx)(c.EyeOutlined,{}),onClick:()=>b(e,t),className:`v1-file-view-btn`,children:`View`}),(0,l.jsx)(s.Button,{size:`small`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>y(t),className:`v1-file-delete-btn`})]})]},e.uid??t)),A=(0,l.jsx)(n.Cn,{documents:P.docs,open:P.open,onClose:()=>F(e=>({...e,open:!1})),initialIndex:P.index});if(x){let t=h.length>0?`Upload more ${e.label??`files`}`:e.buttonLabel??`Upload ${e.label??`File`}`;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`v1-file-upload-wrapper`,children:[g&&(0,l.jsx)(s.Upload,{...O,style:{width:`100%`,display:`block`},children:(0,l.jsxs)(`div`,{className:`v1-upload-dropzone v1-upload-dropzone-center${Me?` v1-upload-dropzone-disabled`:``}`,children:[(0,l.jsxs)(`div`,{className:`v1-upload-dropzone-title-row`,children:[(0,l.jsx)(c.CloudUploadOutlined,{className:`v1-upload-cloud-icon v1-upload-cloud-icon-sm`}),(0,l.jsx)(`span`,{className:`v1-upload-dropzone-title v1-upload-dropzone-title-blue`,children:t})]}),(0,l.jsx)(`span`,{className:`v1-upload-dropzone-sub`,children:`Drag & drop or click to upload`}),C&&(0,l.jsx)(`span`,{className:`v1-upload-dropzone-sub`,children:C})]})}),h.length>0&&(0,l.jsx)(`div`,{className:`v1-file-grid`,children:k}),g&&h.length>0&&(0,l.jsx)(s.Upload,{...O,style:{display:`inline-block`},children:(0,l.jsx)(s.Button,{type:`link`,size:`small`,icon:(0,l.jsx)(c.PlusOutlined,{}),className:`v1-add-more-files-btn`,children:`Add more files`})})]}),A]})}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`v1-file-upload-wrapper`,children:[h.length>0&&(0,l.jsx)(`div`,{className:`v1-file-rows-single`,children:k}),g&&(0,l.jsx)(s.Upload,{accept:d,fileList:h,showUploadList:!1,multiple:!1,maxCount:1,beforeUpload:E,onChange:D,disabled:Me,style:{width:`100%`,display:`block`},children:(0,l.jsxs)(`div`,{className:`v1-upload-dropzone v1-upload-dropzone-single${Me?` v1-upload-dropzone-disabled`:``}`,children:[(0,l.jsx)(c.CloudUploadOutlined,{className:`v1-upload-cloud-icon`}),(0,l.jsx)(`span`,{className:`v1-upload-dropzone-title`,children:T}),w&&(0,l.jsxs)(`span`,{className:`v1-upload-dropzone-sub`,children:[`— `,w]})]})})]}),A]})}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Input,{...Je,type:b===`number`?`number`:b,...b===`number`&&ms(e.decimal)?{step:`any`}:{},...e.suffix?{suffix:e.suffix}:{}}),I&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:I})]})}function ic({icon:e,title:t}){return(0,l.jsxs)(s.Space,{size:10,align:`center`,children:[(0,l.jsx)(`div`,{className:`v1-section-icon-box`,children:e}),(0,l.jsx)(ls,{strong:!0,className:`v1-section-label`,children:t})]})}function ac({field:e,label:t,locked:r}){if(!t)return t;let i=n.R(e),a=!!i;return!a&&!r?t:(0,l.jsxs)(`span`,{className:`v1-field-label-with-info`,children:[(0,l.jsx)(`span`,{children:t}),a&&(0,l.jsx)(s.Tooltip,{title:i,children:(0,l.jsx)(c.InfoCircleOutlined,{className:`v1-field-info-icon`})}),r&&(0,l.jsx)(s.Tooltip,{title:`You don't have permission to edit this field`,children:(0,l.jsx)(c.LockOutlined,{className:`v1-field-info-icon`})})]})}function oc({group:e}){return!ms(e?.infoEnabled)||Is(e?.infoText)?null:(0,l.jsx)(ls,{type:`secondary`,className:`v1-group-info-message`,children:e.infoText})}function sc({group:e}){return!ms(e?.toggleEnabled)||Is(e?.toggleField)?null:(0,l.jsxs)(s.Space,{size:6,align:`center`,onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(ls,{type:`secondary`,className:`v1-combine-toggle-label`,children:e.toggleLabel||`Toggle`}),(0,l.jsx)(s.Form.Item,{name:e.toggleField,valuePropName:`checked`,initialValue:!!e.toggleValue,noStyle:!0,children:(0,l.jsx)(s.Switch,{size:`small`})})]})}function cc(e,t){let n=t;if(Array.isArray(n)&&(n=n[n.length-1]),n&&typeof n==`object`){let e=new Set([`timestamp`,`updatedBy`,`updatedAt`,`createdAt`,`createdBy`,`_id`]),t=Object.entries(n).filter(([t,n])=>!e.has(t)&&n!=null&&n!==``&&typeof n!=`object`).map(([,e])=>String(e).trim()).filter(Boolean);if(!t.length)return``;n=t.join(` `)}let r=String(n??``).trim();if(!r)return``;let i=String(e?.prefillHintLabel??`Last recorded: {value}`);return i.includes(`{value}`)?i.replace(`{value}`,r):`${i} ${r}`}function lc(e,t){let n=e?.helpText,r=(Array.isArray(n)?n:[n]).map(e=>e==null?``:String(e).trim()).filter(Boolean);if(t&&r.push(t),r.length)return(0,l.jsx)(`span`,{className:`v1-field-help-text`,children:r.map((e,t)=>(0,l.jsx)(ls,{type:`secondary`,className:`v1-field-help-line`,children:e},t))})}var uc=(0,o.forwardRef)(function({moduleName:e,action:r,authToken:i,clientId:u,region:f,formGroups:p,loading:m=!1,error:h=``,breadcrumbItems:g=[],formType:_=`add`,submitText:v,cancelPath:y=`/candidates`,onSubmit:b,initialRecord:x=null,prefillFromUrl:S=!1,extraPayload:C=null,presetClientId:w=null,listViewProps:T={},selectedScope:E=``,searchActionContext:D=null,embedded:O=!1,onSuccess:k=null,onCancel:A=null},j){(0,o.useEffect)(()=>(i&&t.g(i),()=>{i&&t.r()}),[i]);let M=_===`search`,N=v??(M?`Search`:`Create`),P=(0,d.useNavigate)(),F=(0,d.useLocation)(),I=(0,o.useRef)(null),L=(0,o.useRef)(null),R=(0,d.useParams)(),[z]=(0,d.useSearchParams)(),[B]=s.Form.useForm();(0,o.useImperativeHandle)(j,()=>({submit:()=>B.submit(),validate:()=>B.validateFields(),getValues:()=>B.getFieldsValue(!0),reset:()=>B.resetFields()}),[B]);let V=s.Form.useWatch([],B),[H,U]=(0,o.useState)(!1),[ee,te]=(0,o.useState)({}),[ne,re]=(0,o.useState)([]),[ie,ae]=(0,o.useState)(!!e),[W,oe]=(0,o.useState)(``),[se,ce]=(0,o.useState)(``),[le,ue]=(0,o.useState)(!1),[de,fe]=(0,o.useState)({searched:!1,rows:[],total:0,fields:[],actions:[],actionRules:[],loading:!1}),[pe,me]=(0,o.useState)({current:1,pageSize:10}),[he,ge]=(0,o.useState)({}),[_e,G]=(0,o.useState)(`internal`),[K,ve]=(0,o.useState)([]),[ye,be]=(0,o.useState)({}),[xe,Se]=(0,o.useState)([]),[Ce,we]=(0,o.useState)(u??``),[Te,Ee]=(0,o.useState)(f??``),[De,Oe]=(0,o.useState)(null),[ke,Ae]=(0,o.useState)(!1),[je,Me]=(0,o.useState)(null),[Ne,Pe]=(0,o.useState)(()=>new Set),Fe=e?ne:p??ds,Ie=e?ie:m,Le=e?W:h,[Re,ze]=(0,o.useState)(``),q=R?.jobId&&R.jobId!==`_`?R.jobId:z.get(`jobId`)||``;(0,o.useEffect)(()=>{if(u||w||!q)return;let e=!1;return(async()=>{try{let t=Ns(js(await a.r({module:`jobs`,id:q})))??{},n=t.clientId??t.client??``,r=n&&typeof n==`object`?n.id??n.value??``:n;!e&&r&&ze(String(r))}catch(e){console.error(`Client-scope resolve from job failed:`,e)}})(),()=>{e=!0}},[u,w,q]);let J=u||w||Re||Ce,Y=f||Te;(0,o.useEffect)(()=>{n.Bn()},[]),(0,o.useEffect)(()=>{let t=!1;return queueMicrotask(()=>{if(!t){if(!e){Me(null);return}n.Rr({roleId:localStorage.getItem(`roleId`)},e,{clientId:J,region:Y}).then(e=>{t||Me(Array.isArray(e)&&e.length?e:null)}).catch(()=>{t||Me(null)})}}),()=>{t=!0}},[e,J,Y]),(0,o.useEffect)(()=>{let t=!1;return queueMicrotask(()=>{if(!t){if(!e){Pe(new Set);return}n.Fr(e).then(e=>{t||Pe(new Set(Array.isArray(e)?e:[]))}).catch(()=>{t||Pe(new Set)})}}),()=>{t=!0}},[e]);let X=(0,o.useMemo)(()=>Ms(Fe,e,je,Ne),[Fe,e,je,Ne]),[Be,Ve]=(0,o.useState)(0),He=(0,o.useMemo)(()=>n.yt({checkFieldUnique:n.ht,onPendingChange:Ve}),[]),Ue=(0,o.useMemo)(()=>M?void 0:{checker:He,module:e,clientId:J||void 0,region:Y||void 0},[M,He,e,J,Y]),We=(0,o.useMemo)(()=>n.vt(X),[X]),Ge=(0,o.useMemo)(()=>n.Ht(X),[X]),Ke=(0,o.useRef)({}),qe=(0,o.useRef)(null),Je=(0,o.useMemo)(()=>X.flatMap(e=>e.formActions??[]),[X]),Ye=(0,o.useMemo)(()=>js(Fe).find(e=>e?.duplicateCheck)?.duplicateCheck??{},[Fe]),Xe=Yt({form:B,moduleName:e,config:Ye,onUseExisting:(0,o.useCallback)((t,r,i,a)=>{if(!t)return;let o=r?.editRoute||Ye?.editRoute;if(!o){console.warn(`[duplicate-check] ${e}: no editRoute configured, so the existing record was not opened. Set it in Admin → Automations → "Check for someone already on file" → "Where to open the existing record".`);return}let s=n.N(o,t,{});s&&P(s,{state:{fromDuplicate:!0,carryFiles:a?.files??null}})},[Ye,P])}),Ze=n.Ot({form:B,groups:X,module:e,onParsed:(0,o.useCallback)(async({field:e,payload:t})=>{let n=e?.field,r=n?{files:{[n]:B.getFieldValue(n)}}:null,i=await Xe.prompt({reason:`upload`,payload:t,carry:r});return i===`clear`||(n&&(B.setFieldValue(n,[]),s.message.info(i===`existing`?`Résumé moved to their record.`:`Résumé removed — nothing on this form was filled in.`)),`abort`)},[Xe,B]),onApplied:(0,o.useCallback)(async()=>{await Xe.prompt({reason:`upload`})},[Xe])}),Qe=(0,o.useCallback)(e=>{let t=n.zn().region,r=X.find(t=>(t.fields??[]).some(t=>t.field===e.field));if(!r)return!1;let i=n.A(r,t),a=i.orderBy?.inProgressField??`currentStudyingHere`;if(e.field!==a||n.w(i))return!1;let o=n.T(i);return n.Vt({tone:o?`duplicate`:`overwrite`,title:o?`This has to be completed first`:`You can add this, but they cannot be submitted`,facts:[{label:`Region`,value:t||`Common`},{label:`Entry`,value:r.label??r.name}],body:n.E(i),okText:o?`Got it`:`Keep it anyway`}),o},[X]),$e=(0,o.useCallback)((e,t)=>{let r=X.find(e=>e.name===t);if(!r)return;let i=n.A(r,n.zn().region),a=i.orderBy?.inProgressField??`currentStudyingHere`;if(e.field!==a)return;let o=n.S(i);return o?[o]:void 0},[X]),et=(0,o.useCallback)(async(e,t)=>{if(!Array.isArray(t)||t.length<3||typeof t[1]!=`number`)return;let r=t[0],i=t[1],a=X.find(e=>e.name===r);if(!a)return;let o=n.A(a,n.zn().region);if(!o.orderBy)return;await Promise.resolve();let s=B.getFieldValue(r);Array.isArray(s)&&await n.k({group:o,rows:s,rowIndex:i,move:Ke.current[r]?.move,confirm:({title:e,body:t,okText:r,cancelText:i,from:a,to:o})=>n.Bt({tone:`suggestion`,title:e,facts:[{label:`This entry is at`,value:`Row ${a+1}`},{label:`It belongs at`,value:`Row ${o+1}`}],body:t,okText:r,cancelText:i})})},[X,B]),tt=(0,o.useRef)(!1),nt=(0,o.useCallback)(async()=>{if(!tt.current){tt.current=!0;try{await Xe.prompt({reason:`blur`})}finally{tt.current=!1}}},[Xe]),[rt,it]=(0,o.useState)(`list`),at=M&&!tc(V),{hasClientScope:ot,clientGateMessage:st,clientGateResetOnChange:ct}=(0,o.useMemo)(()=>{let e=js(Fe).flatMap(e=>e.fields??[]).find(e=>ms(e.clientScope));return e?{hasClientScope:!0,clientGateMessage:e.clientGateMessage||``,clientGateResetOnChange:ms(e.clientGateResetOnChange)}:{hasClientScope:!1,clientGateMessage:``,clientGateResetOnChange:!1}},[Fe]),lt=e=>{if(ct){B.resetFields();let e=B.getFieldsValue(!0);B.setFieldsValue(Object.fromEntries(Object.keys(e).map(e=>[e,void 0]))),fe({searched:!1,rows:[],total:0,fields:[],loading:!1}),me({current:1,pageSize:10})}we(e??``)},ut=ot&&!J,dt=(0,o.useCallback)(()=>n.lr({limit:200}).then(Se).catch(()=>Se([])),[]);(0,o.useEffect)(()=>{!ot||w||Re||dt()},[ot,w,Re,dt]);let ft=n.ot({field:{field:`clientId`,quickCreate:!0,quickCreateModule:`clients`,quickCreateLabel:`Add Client`,lookupCollection:`clients`,displayField:`clientName`,quickCreateNotice:{enabled:!0,title:`New Client Created`,showCreator:!0,showRecordName:!0,recordLabel:`Client name`,creatorLabel:`Created by`}},form:B,name:`clientId`,moduleName:e,scopeValues:{},ownValue:J,onDone:(e,t)=>{dt(),e===`create`&&t!=null&&lt(String(t))}});(0,o.useEffect)(()=>{if(!e)return;let t=!1;async function i(){try{ae(!0),oe(``);let i=M?await n.xr(e,`search`,r):await a.r({module:e,action:r,clientId:J,region:Y});t||(re(js(M?i?.[0]:i)),M&&ce(i?.[0]?.label||``))}catch(n){console.error(`Failed to fetch ${e} form groups:`,n),t||oe(n?.message||`Failed to fetch form groups`)}finally{t||ae(!1)}}return i(),()=>{t=!0}},[e,r,M,J,Y]);let pt=(0,o.useMemo)(()=>{if(!S)return null;let e=z.get(`candidateId`)||``,t=z.get(`submissionId`)||``,n=String(z.get(`isFromSubmission`))===`true`,r=R.jobId&&R.jobId!==`_`?R.jobId:z.get(`jobId`)||``,i=n&&t?{module:`submissions`,id:t}:e?{module:`candidates`,id:e}:null,a={};return e&&(a.applicantId=e),r&&(a.jobId=r),{source:i,linkage:Object.keys(a).length?a:null}},[S,z,R]);(0,o.useEffect)(()=>{let e=pt?.source;if(!e)return;let t=!1;async function n(){try{Ae(!0);let n=await a.r({module:e.module,id:e.id});t||Oe(js(n))}catch(e){console.error(`Failed to fetch prefill data:`,e),t||Oe([])}finally{t||Ae(!1)}}return n(),()=>{t=!0}},[pt]);let mt=(0,o.useMemo)(()=>De?Object.fromEntries(De.filter(e=>e.addRow&&Array.isArray(e.rows)&&e.rows.length>0).map(e=>[e.payloadKey||e.name,e.rows])):{},[De]),ht=(0,o.useMemo)(()=>Ns(De),[De]),gt=(0,o.useMemo)(()=>{let e=new Set;return X.forEach(t=>(t.fields??[]).forEach(t=>{t.prefillFromModule&&e.add(Qs(t.prefillFromModule))})),[...e]},[X]),[_t,vt]=(0,o.useState)({});(0,o.useEffect)(()=>{let e=pt?.linkage;if(!e||gt.length===0)return;let t=!1;return gt.forEach(async r=>{let i=n.J(r,e);if(i)try{let e=Ns(js(await a.r({module:r,id:i})));!t&&e&&vt(t=>({...t,[r]:e}))}catch(e){console.error(`Context prefill fetch failed for ${r}:`,e)}}),()=>{t=!0}},[gt,pt]);let yt=(0,o.useMemo)(()=>{let e=x??ht;if(!e&&Object.keys(_t).length===0)return{};let t={};return X.forEach(n=>{n.addRow||(n.fields??[]).forEach(n=>{if(!n.field||!ms(n.prefillAsHint)||ms(n.addRow))return;let r=n.prefillFromModule?_t[Qs(n.prefillFromModule)]:e;if(!r)return;let i=Ps(r,n);if(i==null)return;let a=cc(n,i);a&&(t[n.field]=a)})}),t},[x,ht,_t,X]);(0,o.useEffect)(()=>{let e=x??ht;if(!e&&Object.keys(_t).length===0||Ie||X.length===0)return;let t={};X.forEach(r=>{if(r.toggleEnabled&&r.toggleField&&e){let n=Ps(e,{field:r.toggleField});n!=null&&(t[r.toggleField]=!!n)}r.addRow||(r.fields??[]).forEach(r=>{if(!r.field||ms(r.addRow))return;let i=r.prefillFromModule?_t[Qs(r.prefillFromModule)]:e;if(!i)return;let a=Ps(i,r);if(a!=null&&!ms(r.prefillAsHint)){if(r.type===`file`){let e=Fs(a);e.length>0&&n.Mt(t,r.field,e)}else n.Mt(t,r.field,n.Gt(r,a))}})}),Object.keys(t).length>0&&B.setFieldsValue(t)},[x,ht,_t,Ie,X,B]),(0,o.useEffect)(()=>{let e=F?.state?.relevantSkillsToken,t=F?.state?.relevantSkillsInputs,n=t?.jobId??pt?.linkage?.jobId??``,r=t?.applicantId??t?.candidateId??pt?.linkage?.applicantId??``;if(!(e||t)||Ie||X.length===0)return;let i=X.filter(e=>ms(e.addRow)&&e.skillMatchField);if(i.length===0)return;let a=e||`inputs:${n}:${r}`,o;if(I.current===a&&L.current?o=L.current:(o=e?Vo(e):void 0,(!o||typeof o.then!=`function`)&&n&&r&&(o=Ho({jobId:n,applicantId:r}).catch(()=>[])),I.current=a,L.current=o),!o||typeof o.then!=`function`)return;let s=!1;return o.then(e=>{if(s||!Array.isArray(e)||e.length===0)return;let t={};i.forEach(n=>{let r=B.getFieldValue(n.name),i=Array.isArray(r)?r:[],a=new Map;i.forEach(e=>{let t=String(e?.[n.skillMatchField]??``).trim().toLowerCase();t&&!a.has(t)&&a.set(t,e)}),t[n.name]=e.map(e=>a.get(String(e).trim().toLowerCase())??{[n.skillMatchField]:e})}),Object.keys(t).length>0&&B.setFieldsValue(t)}).catch(()=>{}),()=>{s=!0}},[F?.state?.relevantSkillsToken,F?.state?.relevantSkillsInputs,pt?.linkage?.jobId,pt?.linkage?.applicantId,Ie,X,B]);let bt={...ot&&J?{clientId:J}:{},...pt?.linkage??C??{}},xt=!ut&&!Ie&&(!pt?.source||De!==null&&!ke),St=e=>{let t=e.prefillFrom||e.payloadKey||e.name,r=mt[t],i=Math.max(0,Number(e.minRows??0)||0),a=n.Qt(e);if(!r||r.length===0){let t=e.initialRows===void 0?i:Math.max(i,Math.max(0,Number(e.initialRows)||0));return Array.from({length:t},()=>({...a}))}let o=r.map(t=>{let r={...a};return(e.fields??[]).forEach(e=>{if(!e.field||e.type===`file`)return;let i=Ps(t,e);i!=null&&(r[e.field]=ms(e.addRow)?n.qt(e,i):n.Gt(e,i))}),r});for(;o.length<i;)o.push({...a});return o},Ct=(0,o.useMemo)(()=>X.map(e=>`${e.name}:${+!!ms(e.allowCollapse)}${+!!ms(e.defaultCollapsed)}`).join(`|`),[X]),wt=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!X.length||wt.current===Ct)return;wt.current=Ct;let e={};X.forEach((t,n)=>{let r=t.name??t.id??String(n);ms(t.allowCollapse)&&ms(t.defaultCollapsed)&&(e[r]=!0)}),te(e)},[Ct,X]);let Tt=(0,o.useMemo)(()=>{let e={};return X.forEach(t=>{t.addRow&&(e[t.name]=St(t))}),n.Wt(Ge,e)},[X,mt,Ge]),Et=e=>te(t=>({...t,[e]:!t[e]})),Dt=()=>{B.resetFields(),te({}),G(`internal`),ve([])},Ot=(0,o.useCallback)(async(t,r,i={})=>{if(!M)return;let a=Number(i.pageSize)>0?Number(i.pageSize):pe.pageSize,o=Number(i.current),c=Number.isFinite(o)&&o>0?Math.floor(o):1;try{ge(t),me({current:c,pageSize:a}),fe(e=>({...e,loading:!0,searched:!0}));let i=Ko(t?.selectedSource),o=r?qo(r,_e):i.includes(`internal`)?`internal`:qo(t?.selectedSource,_e),s={...t,selectedSource:o};console.log(`[AddFormV1] Calling searchModuleData with scope:`,o);let l=await n.bn(e||`candidates`,s,{limit:a,offset:(c-1)*a},{scope:o});G(o),fe({searched:!0,rows:l.rows,total:l.total,fields:l.fields,actions:l.actions??[],actionRules:l.actionRules??[],loading:!1}),ve(e=>es({sources:i,activeSource:o,activeCount:l.total,responseCounts:l.counts,currentTabs:e,backendTabs:l.tabs}))}catch(e){console.error(`Search failed:`,e),s.message.error(e?.message||`Failed to search records`),fe({searched:!0,rows:[],total:0,fields:[],actions:[],actionRules:[],loading:!1})}},[M,e,_e,pe.pageSize]),kt=(0,o.useCallback)(async(e,t)=>{let n=os(e,t);be(e=>({...e,[n]:{...e[n]??{},loading:!0}}));try{let r=await ss(e,t);s.message.success(r?.message??r?.data?.message??e.successMessage??`Action completed successfully.`),be(e=>({...e,[n]:{loading:!1,completed:!0}}))}catch(t){s.message.error(t?.message||e.errorMessage||`Action failed.`),be(e=>({...e,[n]:{...e[n]??{},loading:!1}}))}finally{be(e=>({...e,[n]:{...e[n]??{},loading:!1}}))}},[]),At=(0,o.useCallback)(e=>{let t=qo(e,_e);G(t),me({current:1,pageSize:pe.pageSize}),Object.keys(he).length>0&&Ot(he,t,{current:1,pageSize:pe.pageSize})},[pe.pageSize,he,Ot,_e]),jt=(0,o.useCallback)((e,t)=>{let n=Number(t)>0?Number(t):pe.pageSize,r=Number(e)>0?Number(e):1;if(Object.keys(he).length===0){me({current:r,pageSize:n});return}Ot(he,_e,{current:r,pageSize:n})},[Ot,he,pe.pageSize,_e]),Mt=(0,o.useCallback)(e=>{let t=Number(e)>0?Number(e):pe.pageSize;if(Object.keys(he).length===0){me({current:1,pageSize:t});return}Ot(he,_e,{current:1,pageSize:t})},[Ot,he,pe.pageSize,_e]),Nt=e=>{let t=n.bt(e,{uniqueRules:We});return t.length!==0&&(B.setFields(t.map(e=>({name:e.name??e.field,errors:[e.message]}))),te({}),n.l({errorFields:t.map(e=>{let t=e.name??e.field;return{name:Array.isArray(t)?t:[t],errors:[e.message]}})},B),!0)},Pt=(0,o.useCallback)(async e=>{try{let t=n.zn().region,r=X.map(e=>n.A(e,t)),i=n.O(r,e);return i.severity===`allow`?!0:i.severity===`block`?(n.Vt({tone:`duplicate`,title:`This qualification history is incomplete`,body:i.message,okText:`Go back`}),!1):!await n.Bt({tone:`suggestion`,title:`Add the earlier qualification too?`,body:i.message,okText:`Add it now`,cancelText:`Submit anyway`})}catch(e){return console.warn(`[levelRule] check skipped:`,e),!0}},[X]),Ft=async t=>{if(M){await Ot(t);return}if(!(!O&&await Xe.prompt({reason:`submit`})!==`clear`)&&await Pt(t)){if(b){await b(t,{moduleName:e,groups:X,registerDocuments:async(r,i={})=>{let a=n.Jt(t,X,{module:i.module??e});return!a.length||!r?[]:n._n(i.module??e,r,a)},extraPayload:bt??{},payload:{...bt??{},...n.Kt(t,X,{module:e})}});return}if(!e){console.log(`Form values:`,t);return}try{ue(!0);let r=await a.n(e,nc(t,X,bt??{},e));if(r?.status===!1){if(Nt(r))return;s.message.error(n.u(X,e,`add`,r?.error||r?.message||r?.data));return}let i=n.Jt(t,X,{scope:`addRow`,indexed:!0,module:e}),o=r?.id??r?.data?.id??r?.data?._id??r?._id;if(i.length>0&&o)try{await n.hn(e,o,{...bt??{},...n.Kt(t,X,{module:e})},i)}catch(e){console.error(`Document file attach (post-create update) failed:`,e),s.message.warning(`Record created, but attaching document files failed. Edit the record to re-upload.`)}let c=n.Jt(t,X,{module:e});if(c.length>0&&o)try{await n._n(e,o,c)}catch(e){console.error(`Document registry upload failed:`,e),s.message.warning(`Record created, but saving its document records failed.`)}let l=n.d(X,e,`add`);if(l&&s.message.success(l),B.resetFields(),O&&k){k(o,t);return}let u=qe.current??n.M(X);if(!u)n.j(P,{cancelPath:y});else if(u.mode===`back`)n.j(P,{cancelPath:y});else if(u.mode===`route`||u.mode===`detail`){let e=n.N(u.target,o,t);e&&P(e)}}catch(t){if(console.error(`Failed to create ${e}:`,t),Nt(t))return;s.message.error(n.u(X,e,`add`,t?.data?.error||t?.data?.message||t?.message))}finally{ue(!1),qe.current=null}}},It=(e,t,r)=>{let i=e.validations??e.validation??e.rules??[];return[...i.filter(e=>(typeof e==`string`?e:e?.type)===`maxFromField`).map(e=>n.rt(e,t,r)).filter(Boolean),...i.filter(e=>{let t=typeof e==`string`?e:e?.type;return[`dateAfterField`,`greaterThanField`,`strictGreaterThanField`,`strictLessThanField`,`lessThanOrEqualField`,`maxFieldWithFallback`,`dateBeforeField`,`timeAfterField`,`timeBeforeField`].includes(t)}).map(e=>String(e.value??e.compareField??e.field??``).split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>zs(t,e))).flat().filter(Boolean)]},Lt=(e,t)=>typeof e==`function`?e(t):e,Rt=(e,t,n)=>{if(!e?.field)return!0;let r=Lt(n,e.field),i=t(r==null?[e.field]:[...Array.isArray(r)?r:[r],e.field]);switch(e.operator){case`eq`:return String(i??``)===String(e.value??``);case`neq`:return String(i??``)!==String(e.value??``);case`truthy`:return i!=null&&i!==``&&i!==!1;case`falsy`:return i==null||i===``||i===!1;case`notEmpty`:return Array.isArray(i)?i.length>0:!!i;case`in`:return String(e.value??``).split(`,`).map(e=>e.trim()).includes(String(i??``));case`notIn`:return!String(e.value??``).split(`,`).map(e=>e.trim()).includes(String(i??``));default:return!0}},zt=(e,t,n)=>{if(!e)return!0;let r=Array.isArray(e.conditions)?e.conditions.filter(e=>e?.field):[];if(r.length){let i=r.map(e=>Rt(e,t,n)),a=String(e.logic??`and`).toLowerCase()===`or`,o=a?i.some(Boolean):i.every(Boolean);if(e.field){let r=Rt(e,t,n);o=a?o||r:o&&r}return o}return Rt(e,t,n)},Vt=e=>!!(e?.field||e?.conditions?.some?.(e=>e?.field)),[Ht,Ut]=(0,o.useState)({}),Wt=e=>String(e?.field??``),Gt=(0,o.useMemo)(()=>t.s(),[]),Kt=(t,r,i,a={})=>{let c=typeof t.field==`string`&&t.field.includes(`.`)?t.field.split(`.`):null,u=c??t.field,d=r===void 0?u:[r,...c??[t.field]],f=i!==void 0&&r!==void 0?[...Array.isArray(i)?i:[i],...Array.isArray(d)?d:[d]]:d,p=t.type===`checkbox`&&(t.options&&t.options.length>0||t.dataSource&&t.dataSource!==`static`),m=!p&&t.type===`checkbox`?`checked`:`value`,h=!!t.editablePermission&&!n.F(t.editablePermission,e),g=i!==void 0&&r!==void 0?[...Array.isArray(i)?i:[i],r]:null,_=e=>g&&(!a.rowFieldKeys||a.rowFieldKeys.has(e))?g:null,v=n.nn(t),y=v?n.rn(t,f,_):null,b=a.inline||a.hideLabel||!p&&t.type===`checkbox`?``:(0,l.jsx)(bs,{form:B,field:t,siblingPrefix:t.labelWhen?.field?_(t.labelWhen.field):g,locked:h}),x=v&&b?(0,l.jsxs)(`span`,{className:`v1-label-with-override`,children:[b,(0,l.jsx)(n.K,{form:B,field:t,flagPath:y,fieldPath:f,disabled:h})]}):b,S=It(t,f,_),C=n.R(t),w=a.inline||t.type===`file`&&ms(t.multiple)||t.type===`text-editor`?24:t.col??12,T=Bt(t,Gt),E=r===void 0&&t.type!==`file`&&T.matched&&T.value!==void 0&&T.value!==``?T.value:r===void 0&&t.type!==`file`&&t.defaultValue!==void 0&&t.defaultValue!==``?t.defaultValue:void 0,D=(t.aiActions||[]).filter(e=>e.trigger===`click`),O=(t.aiActions||[]).find(e=>e.trigger===`upload`),k=(0,l.jsx)(s.Form.Item,{label:x,name:d,extra:lc(t,yt[t.field]),rules:Gs(t,B,f,M,_,Ue,$e(t,a.groupNameForActions)),required:Ws(t,B,f),dependencies:S,valuePropName:m,initialValue:E,getValueFromEvent:t.type===`file`?e=>Array.isArray(e)?e:e?.fileList:void 0,validateTrigger:[`onBlur`,`onChange`],children:(0,l.jsx)(rc,{field:t,form:B,name:f,rowFieldKeys:a.rowFieldKeys,moduleName:e,scopeValues:{clientId:J},onAiUpload:O?e=>Ze.runAction(a.groupNameForActions,t,O,e):void 0,onDuplicateBlur:nt,onRegionBlocked:Qe,onRowOrderChange:et,formDisabled:Ze.busy},t.refreshToken==null?void 0:`${t.field}-refresh-${t.refreshToken}`)}),A=C&&!x?(0,l.jsx)(s.Tooltip,{title:C,children:(0,l.jsx)(`span`,{className:`v1-field-tooltip-wrap`,children:k})}):k,j=D.length>0?(()=>{let e=n.Dt(D),r=r=>(0,l.jsx)(n.Et,{position:r,actions:e[r],aiActions:Ze,groupName:a.groupNameForActions,field:t},r);return(0,l.jsxs)(`div`,{className:`v1-ai-action-wrap`,children:[r(`top-left`),r(`top-center`),r(`top-right`),A,r(`bottom-left`),r(`bottom-center`),r(`bottom-right`)]})})():A,N=e=>r===void 0?e:[r,e],P=t.verifyAction?(0,l.jsxs)(l.Fragment,{children:[t.verifyResultField&&(0,l.jsx)(s.Form.Item,{name:N(t.verifyResultField),hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Input,{})}),t.verifyTimestampField&&(0,l.jsx)(s.Form.Item,{name:N(t.verifyTimestampField),hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Input,{})})]}):null,F=t.verifyAction?(0,l.jsxs)(`div`,{className:`v1-verify-field-row`,children:[j,(0,l.jsx)(ys,{form:B,field:t,absoluteName:f}),P]}):j,I=v?(0,l.jsxs)(l.Fragment,{children:[F,(0,l.jsx)(s.Form.Item,{name:r===void 0?y[y.length-1]:[r,y[y.length-1]],valuePropName:`checked`,hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Checkbox,{})})]}):F,L=a.inline?{flex:`${Number(t.combineWidth)>0?Number(t.combineWidth):1} 1 0`,maxWidth:`none`}:void 0,R=t.autoFillFromApi?(0,l.jsx)(ws,{form:B,config:t.autoFillFromApi,watchPath:f},`${t.field}-autoFillFromApi`):null,z=t.prefillWhen?.length?(0,l.jsx)(Cs,{form:B,rules:t.prefillWhen,watchPaths:n.W(t.prefillWhen,f,n.at,_),targetPath:f,resetOnNoMatch:t.prefillWhenReset!==!1},`${t.field}-prefillWhen`):null;if(t.show===0)return(0,l.jsxs)(o.Fragment,{children:[z,R,(0,l.jsx)(s.Form.Item,{name:d,hidden:!0,noStyle:!0,children:(0,l.jsx)(`input`,{type:`hidden`})})]},t.field);let V=!a.inline&&n.n(t).length>0,H=e=>V?n.s(t,w,t=>e(n.r(t,_(t.field)))):w;return Vt(t.showIf)||V?(0,l.jsxs)(o.Fragment,{children:[z,R,(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,noStyle:!0,children:({getFieldValue:e})=>!Vt(t.showIf)||zt(t.showIf,e,_)?(0,l.jsx)(s.Col,{xs:24,md:H(e),style:L,className:a.inline?`v1-combine-cell`:void 0,children:I}):null})]},t.field):(0,l.jsxs)(o.Fragment,{children:[z,R,(0,l.jsx)(s.Col,{xs:24,md:w,style:L,className:a.inline?`v1-combine-cell`:void 0,children:I})]},t.field)},qt=t=>{let r=typeof t.field==`string`&&t.field.includes(`.`)?t.field.split(`.`):[t.field],i=!!t.editablePermission&&!n.F(t.editablePermission,e),a=(0,l.jsx)(ac,{field:t,label:t.label,locked:i}),o=n.$t(t),u=Array.isArray(t.subFields)&&t.subFields.length>0,d=u?t.subFields.map(e=>({...e,show:1,edit:1})):null,f=Math.max(0,Number(t.minRows??0)||0),p=t.maxRows!==void 0&&t.maxRows!==``&&Number(t.maxRows)>0?Number(t.maxRows):0,m=Ps(x??ht??{},t),h=n.qt(t,m);return(0,l.jsx)(s.Col,{xs:24,md:24,children:(0,l.jsx)(s.Form.Item,{label:a,required:Ws(t),colon:!1,className:`v1-combine-field`,children:(0,l.jsx)(s.Form.List,{name:r,initialValue:h,rules:[{validator:async(e,n=[])=>{if(Ws(t)&&!(u?n.some(e=>As(e)):n.some(e=>e!=null&&e!==``&&!(Array.isArray(e)&&e.length===0))))throw Error(`Mandatory Field`);if(f>0&&n.length<f)throw Error(`Keep at least ${f} ${u?`row`:`value`}${f>1?`s`:``}.`)}}],children:(n,{add:i,remove:a},{errors:m})=>(0,l.jsxs)(`div`,{className:`v1-addrow-wrapper`,children:[n.map(({key:i,name:p})=>(0,l.jsxs)(`div`,{className:`v1-addrow-item`,children:[(0,l.jsx)(s.Button,{type:`text`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>a(p),disabled:n.length<=f,className:`v1-addrow-delete-btn`}),(0,l.jsx)(`div`,{className:`v1-addrow-fields`,children:u?(0,l.jsx)(s.Row,{gutter:[24,0],align:`top`,children:Zt(d,p,r[0],!1,t.field)}):(0,l.jsx)(s.Form.Item,{name:[p],noStyle:!0,valuePropName:t.type===`checkbox`&&!t.options?.length?`checked`:`value`,getValueFromEvent:t.type===`file`?e=>Array.isArray(e)?e:e?.fileList:void 0,rules:Gs(o,B,[...r,p],M),children:(0,l.jsx)(rc,{field:o,form:B,name:[...r,p],moduleName:e,scopeValues:{clientId:J},formDisabled:Ze.busy})})})]},i)),(!p||n.length<p)&&(0,l.jsx)(s.Button,{type:`link`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>i(),className:`v1-addrow-add-btn`,children:t.addLabel??`Add ${t.label??`Value`}`}),(0,l.jsx)(s.Form.ErrorList,{errors:m})]})})})},t.field)},Jt=(t,r,i)=>{let a=typeof t.field==`string`&&t.field.includes(`.`)?t.field.split(`.`):[t.field],o=!!t.editablePermission&&!n.F(t.editablePermission,e),u=(0,l.jsx)(ac,{field:t,label:t.label,locked:o}),d=n.$t(t),f=Array.isArray(t.subFields)&&t.subFields.length>0,p=f?t.subFields.map(e=>({...e,show:1,edit:1})):null,m=Math.max(0,Number(t.minRows??0)||0),h=t.maxRows!==void 0&&t.maxRows!==``&&Number(t.maxRows)>0?Number(t.maxRows):0,g=[r,...a],_=[...Array.isArray(i)?i:[i],r,...a],v=n.qt(t,void 0);return(0,l.jsx)(s.Col,{xs:24,md:f?24:t.col??24,children:(0,l.jsx)(s.Form.Item,{label:u,required:Ws(t),colon:!1,className:`v1-combine-field`,children:(0,l.jsx)(s.Form.List,{name:g,initialValue:v,rules:f?[{validator:async(e,n=[])=>{if(Ws(t)&&!n.some(e=>As(e)))throw Error(`Mandatory Field`);if(m>0&&n.length<m)throw Error(`Keep at least ${m} row${m>1?`s`:``}.`)}}]:[],children:(n,{add:r,remove:i},{errors:a})=>(0,l.jsxs)(`div`,{className:`v1-addrow-wrapper`,children:[n.map(({key:r,name:a})=>{let o=[..._,a];return(0,l.jsxs)(`div`,{className:`v1-addrow-item`,children:[(0,l.jsx)(s.Button,{type:`text`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>i(a),disabled:n.length<=m,className:`v1-addrow-delete-btn`}),(0,l.jsx)(`div`,{className:`v1-addrow-fields`,children:f?(0,l.jsx)(s.Row,{gutter:[24,0],align:`top`,children:Zt(p,a,_,!1,t.field)}):(0,l.jsx)(s.Form.Item,{name:[a],noStyle:!0,valuePropName:t.type===`checkbox`&&!t.options?.length?`checked`:`value`,getValueFromEvent:t.type===`file`?e=>Array.isArray(e)?e:e?.fileList:void 0,rules:Gs(d,B,o,M),children:(0,l.jsx)(rc,{field:d,form:B,name:o,moduleName:e,scopeValues:{clientId:J},formDisabled:Ze.busy})})})]},r)}),(!h||n.length<h)&&(0,l.jsx)(s.Button,{type:`link`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>r(),className:`v1-addrow-add-btn`,children:t.addLabel??`Add ${t.label??`Value`}`}),(0,l.jsx)(s.Form.ErrorList,{errors:a})]})})})},`${i}-${r}-${t.field}`)},Xt=(e,t)=>e.filter(e=>e.field&&e.show!==void 0&&!ms(e.show)).map(e=>{let n=String(e.field).includes(`.`)?String(e.field).split(`.`):e.field,r=t===void 0?n:[t,...Array.isArray(n)?n:[n]];return(0,l.jsx)(s.Form.Item,{name:r,hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Input,{})},`hidden-${e.field}`)}),Zt=(e,t,r,i=!1,a)=>{let o=new Set,c=[],u=new Set(e.map(e=>e.field).filter(Boolean)),d=e.filter(e=>e.show===void 0||ms(e.show)||e.show===0&&!!e.prefillWhen?.length);return c.push(...Xt(e,t)),d.forEach(e=>{if(ms(e.addRow)&&t===void 0){c.push(qt(e));return}if(ms(e.addRow)&&t!==void 0){c.push(Jt(e,t,r));return}let f=e.combineKey?.trim?.();if(!f){c.push(Kt(e,t,r,{hideLabel:i,groupNameForActions:a,rowFieldKeys:u}));return}let p=`${r??`root`}:${t??`root`}:${f}`;if(o.has(p))return;let m=d.filter(e=>e.combineKey===f);m.forEach(e=>o.add(`${r??`root`}:${t??`root`}:${e.combineKey}`));let h=m.find(e=>e.combineLabel)??e,g=r!==void 0&&t!==void 0?[...Array.isArray(r)?r:[r],t]:null,_=m.find(e=>n.nn(e))??null,v=e=>g&&(!u||u.has(e))?g:null,y=_?r!==void 0&&t!==void 0?[...Array.isArray(r)?r:[r],t,...String(_.field).includes(`.`)?String(_.field).split(`.`):[_.field]]:String(_.field).includes(`.`)?String(_.field).split(`.`):_.field:null,b=(0,l.jsx)(bs,{form:B,field:h,siblingPrefix:g,combined:!0}),x=_?(0,l.jsxs)(`span`,{className:`v1-label-with-override`,children:[b,(0,l.jsx)(n.K,{form:B,field:_,flagPath:n.rn(_,y,v),fieldPath:y})]}):b,S=m.find(e=>e.combineToggleTarget)?.combineToggleTarget,C=m.find(e=>e.combineToggleLabel)?.combineToggleLabel??`Show range`,w=p,T=m.some(e=>ms(e.combineWrap)),E=Number(m.find(e=>[12,24].includes(Number(e.combineSpan)))?.combineSpan),D=S?m.find(e=>Wt(e)===S):null,O=D?.field?.includes?.(`.`)?D.field.split(`.`):[D?.field].filter(Boolean),k=D?r!==void 0&&t!==void 0?[r,t,...O]:O.length>1?O:D.field:null,A=m.some(e=>Ws(e)),j=[12,24].includes(E)?E:m.length>=3?24:12,M=e=>g&&(!u||u.has(e))?g:null,N=m.some(e=>Vt(e.showIf)),P=e=>m.some(t=>!Vt(t.showIf)||zt(t.showIf,e,M)),F=(0,l.jsx)(s.Col,{xs:24,md:j,children:(0,l.jsx)(s.Form.Item,{label:x,required:A,colon:!1,className:`v1-combine-field`,children:(0,l.jsx)(s.Form.Item,{noStyle:!0,shouldUpdate:!0,children:({getFieldValue:e})=>{let n=k?!Is(e(k)):!1,i=Ht[w]??n,a=S&&!i?m.filter(e=>Wt(e)!==S):m;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Row,{gutter:[8,0],align:`top`,wrap:T,className:`v1-combine-row${T?` v1-combine-row-wrap`:``}`,children:a.map(e=>Kt(A?{...e,req:1}:e,t,r,{inline:!0}))}),S&&(0,l.jsxs)(`div`,{className:`v1-combine-range`,children:[(0,l.jsx)(s.Switch,{size:`small`,checked:i,onChange:e=>{!e&&k&&(B.setFieldValue(k,void 0),B.validateFields([k]).catch(()=>{})),Ut(t=>({...t,[w]:e}))}}),(0,l.jsx)(ls,{type:`secondary`,className:`v1-combine-toggle-label`,children:C})]})]})}})})},p);c.push(N?(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,noStyle:!0,children:({getFieldValue:e})=>P(e)?F:null},p):F)}),c},Qt=(0,o.useMemo)(()=>{if(de.fields?.length)return de.fields;let e=de.rows[0];return e?Object.keys(e).filter(t=>!t.startsWith(`_`)&&typeof e[t]!=`object`).map(e=>({value:e,field:e,label:e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase()),isVisible:!0})):[]},[de.fields,de.rows]),$t=e=>!Array.isArray(e)||e.length===0?`card`:e.some(e=>[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].some(e=>{if(e==null)return!1;let t=String(e).trim().toLowerCase();return t?![`all`,`internal`].includes(t):!1}))?`list`:`card`;(0,o.useMemo)(()=>$t(de.rows),[de.rows]);let en=(0,o.useMemo)(()=>{let e=is({rows:de.rows,selectedSource:_e});if(!e.length)return Qt;let t=new Set(e.map(e=>e.field));return[...Qt.filter(e=>e.cardRole!==`action`&&!t.has(e.value)),...e.map(e=>({value:e.field,field:e.field,label:e.label??`Action`,cardRole:`action`,isVisible:!0,tableHidden:!0,sorter:!1,render:(t,n)=>{if(!as(e,n,_e))return null;let r=os(e,n),i=ye[r]??{},a=!r||i.completed;return(0,l.jsx)(s.Button,{type:`primary`,size:`small`,loading:i.loading,disabled:a,onClick:()=>kt(e,n),children:i.completed?e.completedLabel:e.buttonLabel})}}))]},[kt,Qt,de.rows,_e,ye]),tn=(0,o.useMemo)(()=>{if(!D)return de.actions;let e=t=>({...t,popupState:{...D,...t.popupState},...t.children?{children:t.children.map(e)}:{}});return(de.actions??[]).map(e)},[de.actions,D]),nn=e=>{let t=e.name??e.id??``,r=n.Ut(Ge,t),i=!!r&&r.leaderName!==t,a=r?X.find(e=>e.name===r.leaderName)??e:e,o=Math.max(0,Number(a.minRows??0)||0),u=Math.max(0,Number(a.maxRows??0)||0),d=r?r.memberNames:[t],f=()=>{d.forEach(t=>{let r=X.find(e=>e.name===t)??e;Ke.current[t]?.add(n.Qt(r))})},p=e=>{d.forEach(t=>Ke.current[t]?.remove(e))};return e.addRow?(0,l.jsx)(s.Form.List,{name:t,initialValue:Tt[t]??[],rules:i?[]:[{validator:async(t,n=[])=>{if(!(ms(e.toggleEnabled)&&e.toggleField&&B.getFieldValue(e.toggleField))){if(o>0&&n.length<o)throw Error(`Keep at least ${o} row${o>1?`s`:``}.`);if(ms(e.requireOne)&&n.some(e=>!As(e)))throw Error(`Fill at least one field in each added row.`)}}}],children:(n,{add:r,remove:d,move:m},{errors:h})=>(Ke.current[t]={add:r,remove:d,move:m},(0,l.jsxs)(`div`,{className:`v1-addrow-wrapper`,children:[(0,l.jsx)(`div`,{className:`v1-addrow-topbar`,children:i?(0,l.jsxs)(ls,{type:`secondary`,className:`v1-addrow-linked-hint`,children:[`Rows added via `,a.label??a.name]}):(!u||n.length<u)&&(0,l.jsx)(s.Button,{type:`link`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:f,className:`v1-addrow-add-btn`,children:e.addLabel??`Add ${e.label??`Row`}`})}),ms(e.sharedRowLabels)&&n.length>0&&(0,l.jsx)(s.Row,{gutter:[24,0],className:`v1-addrow-header`,children:e.fields.filter(e=>e.show===void 0||ms(e.show)).map(e=>(0,l.jsx)(s.Col,{md:e.col??12,className:`v1-addrow-header-label`,children:e.label},Wt(e)))}),n.map(({key:r,name:i})=>(0,l.jsxs)(`div`,{className:`v1-addrow-item`,children:[(0,l.jsx)(s.Button,{type:`text`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>p(i),disabled:n.length<=o,className:`v1-addrow-delete-btn`}),(0,l.jsx)(`div`,{className:`v1-addrow-fields`,children:(0,l.jsx)(s.Row,{gutter:[24,0],align:`top`,children:Zt(e.fields,i,t,ms(e.sharedRowLabels),t)})})]},r)),(0,l.jsx)(s.Form.ErrorList,{errors:h})]}))}):(0,l.jsx)(s.Row,{gutter:[24,0],children:Zt(e.fields,void 0,void 0,!1,t)})},rn=e=>X.filter(t=>t!==e&&t.mergeInto&&String(t.mergeInto)===String(e.name)),an=e=>!!(e.mergeInto&&X.some(t=>t!==e&&String(t.name)===String(e.mergeInto))),on=(e,t)=>rn(e).filter(e=>String(e.mergePosition??`bottom`)===t),sn=(e,t)=>{let n=e.name??e.id??String(t),r=nn(e),i=on(e,`top`),a=on(e,`bottom`),o=e=>{let t=(0,l.jsxs)(`div`,{className:`v1-merged-group`,children:[(0,l.jsx)(`div`,{className:`v1-merged-group-title`,children:e.label??e.name}),nn(e)]},e.name),n=e.showIf?.field?(0,l.jsx)(Es,{form:B,showIf:e.showIf,render:()=>t},e.name):t;return(0,l.jsx)(Os,{form:B,group:e,inheritParent:!1,children:n},e.name)};return(0,l.jsx)(s.Card,{className:`v1-card v1-edit-card`,title:(0,l.jsx)(ic,{icon:fs[t%fs.length],title:M?se||e.label:e.label??e.name??`Details`}),extra:(0,l.jsxs)(s.Space,{size:8,align:`center`,className:`v1-group-actions`,children:[(0,l.jsx)(oc,{group:e}),(0,l.jsx)(sc,{group:e}),ms(e.allowCollapse)&&(0,l.jsx)(s.Button,{type:`text`,size:`small`,"aria-expanded":!ee[n],"aria-label":ee[n]?`Expand section`:`Collapse section`,icon:ee[n]?(0,l.jsx)(c.DownOutlined,{}):(0,l.jsx)(c.UpOutlined,{}),onClick:e=>{e.stopPropagation(),Et(n)}})]}),children:(0,l.jsx)(s.Form.Item,{noStyle:!0,shouldUpdate:!0,children:({getFieldValue:t})=>{let s=ms(e.toggleEnabled)&&e.toggleField&&!!t(e.toggleField);return(0,l.jsxs)(`div`,{style:{display:ee[n]||s?`none`:`block`},children:[i.map(o),r,a.map(o)]})}})},n)};return(0,l.jsxs)(`main`,{children:[g.length>0&&(0,l.jsx)(n.t,{items:g}),(0,l.jsxs)(`div`,{className:`v1-edit-page`,children:[ot&&!w&&!Re&&(0,l.jsx)(s.Card,{className:`v1-card v1-edit-card v1-client-gate-card`,children:(0,l.jsxs)(s.Space,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,l.jsx)(ic,{icon:(0,l.jsx)(c.UserOutlined,{}),title:`Select Client`}),st&&(0,l.jsx)(ls,{type:`secondary`,children:st}),(0,l.jsx)(s.Row,{gutter:[16,0],children:(0,l.jsxs)(s.Col,{xs:24,md:14,children:[(0,l.jsx)(s.Select,{showSearch:!0,allowClear:!0,placeholder:`Select client`,style:{width:`100%`},value:J||void 0,optionFilterProp:`label`,options:xe.map(e=>({value:e._id??e.id,label:e.clientName??e.name??e.clientRefrenceId??e._id})).filter(e=>e.value),onChange:lt,dropdownRender:ft.footer?e=>(0,l.jsxs)(l.Fragment,{children:[e,ft.footer]}):void 0}),ft.modal]})})]})}),(0,l.jsxs)(`div`,{className:`v1-page-inner`,children:[(0,l.jsx)(s.Spin,{fullscreen:!0,spinning:Ze.busy||Xe.checking,size:`large`,tip:Ze.busy?Ze.loadingText||`Reading the file…`:`Checking whether we already have this person…`}),(0,l.jsx)(s.Spin,{spinning:!xt&&!ut,description:`Loading form fields…`,children:(0,l.jsxs)(s.Form,{form:B,layout:`vertical`,colon:!1,className:`v1-form`,disabled:Ze.busy||Xe.checking,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),onFinish:Ft,onFinishFailed:e=>{te({}),n.l(e,B)},children:[xt&&X.filter(e=>!an(e)).map((e,t)=>(0,l.jsx)(Os,{form:B,group:e,children:e.showIf?.field?(0,l.jsx)(Es,{form:B,showIf:e.showIf,render:()=>sn(e,t)}):sn(e,t)},e.name??`grp-${t}`)),xt&&!Le&&X.length===0&&(0,l.jsx)(s.Alert,{type:`info`,showIcon:!0,message:M?`No search configuration found.`:`No form fields are configured.`}),xt&&M&&(0,l.jsx)(`div`,{className:`v1-search-form-actions`,children:(0,l.jsxs)(s.Space,{size:12,children:[(0,l.jsx)(s.Button,{onClick:Dt,disabled:!X.length,children:`Reset`}),(0,l.jsx)(s.Button,{onClick:()=>n.j(P,{cancelPath:y}),children:`Back`}),(0,l.jsx)(s.Button,{type:`primary`,htmlType:`submit`,disabled:le||!X.length||at,loading:le,children:N})]})})]})})]}),!M&&(0,l.jsxs)(`div`,{className:O?`v1-footer v1-footer--embedded`:`v1-footer`,children:[(0,l.jsx)(ls,{type:`secondary`,children:`All Unsaved Changes will be lost if you cancel and reload.`}),(0,l.jsxs)(s.Space,{size:12,children:[(0,l.jsx)(s.Button,{onClick:()=>O&&A?A():n.j(P,{cancelPath:y}),children:`Cancel`}),Je.map((e,t)=>(0,l.jsx)(xs,{form:B,groups:X,action:e,disabled:!xt||le||Be>0||!X.length,loading:le,onFire:()=>{qe.current=e.afterSubmit??{mode:`stay`},e.setValuesBeforeSubmit&&B.setFieldsValue(e.setValuesBeforeSubmit),B.submit()}},`${e.label??`action`}-${t}`)),(0,l.jsx)(Ss,{form:B,groups:X,onClick:()=>{qe.current=null,B.submit()},disabled:!xt||le||Be>0||!X.length,loading:le,children:N})]})]}),M&&de.searched&&(0,l.jsx)(Lo,{moduleName:e,breadcrumbItems:[],dataSource:de.rows,fields:en,total:de.total,loading:de.loading,current:pe.current,pageSize:pe.pageSize,showViewToggle:!0,activeView:rt,onViewChange:it,onPageChange:jt,onPageSizeChange:Mt,showSearch:!1,tabs:K,selectedSource:_e,onTabChange:At,actions:tn,actionRules:de.actionRules})]})]})});function dc({className:e=``,variant:t=`default`,showIcon:n=!0,...r}){return(0,l.jsx)(s.Alert,{className:`app-alert app-alert--${t} ${e}`.trim(),showIcon:n,...r})}function fc(e){let t=n.On().startOf(`day`).diff(n.Nn(e).startOf(`day`),`day`);return t<=0?`Today`:t===1?`1 Day ago`:`${t} Days ago`}function pc(e=[],t){let r=new Map;return e.forEach(e=>{let i=t(e),a=n.Nn(i);if(!a.isValid())return;let o=a.format(`YYYY-MM-DD`);r.has(o)||r.set(o,{date:new Date(a.valueOf()),items:[]}),r.get(o).items.push(e)}),[...r.values()].sort((e,t)=>t.date-e.date)}function mc(e){let t=e?.dateTimeFormat||`MMM DD, YYYY | hh:mm A`,[n]=t.split(`|`);return(n??t).trim()||t}function hc(e){let t=n.zn();return n.kn(e,mc(t),t)}function gc(e){return hc(e)}function _c(e){return n.An(e,n.zn())}function vc({row:e,last:t,getTime:n,getAuthor:r,getMeta:i,renderBody:a}){let o=n(e),s=r?.(e),c=i?.(e);return(0,l.jsxs)(`div`,{className:`znx-an-item`,children:[(0,l.jsxs)(`div`,{className:`znx-an-rail`,children:[c?(0,l.jsx)(`span`,{className:`znx-an-icon-dot znx-an-icon-dot--${c.tone}`,title:c.label,children:c.icon}):(0,l.jsx)(`span`,{className:`znx-an-dot`}),!t&&(0,l.jsx)(`span`,{className:`znx-an-line`})]}),(0,l.jsxs)(`div`,{className:`znx-an-content`,children:[a(e),(0,l.jsxs)(`div`,{className:`znx-an-meta`,children:[s&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`znx-an-author`,children:s}),(0,l.jsx)(`span`,{className:`znx-an-sep`,"aria-hidden":`true`})]}),(0,l.jsx)(`span`,{className:`znx-an-stamp`,children:_c(o)})]})]})]})}function yc({rows:e=[],getTime:t,getKey:n,getAuthor:r,getMeta:i,renderBody:a,emptyText:o=`Nothing here yet.`,grouped:c=!0}){if(!c)return e.length?(0,l.jsx)(`div`,{className:`znx-an-flat`,children:e.map((o,s)=>(0,l.jsx)(vc,{row:o,last:s===e.length-1,getTime:t,getAuthor:r,getMeta:i,renderBody:a},n(o,s)))}):(0,l.jsx)(`div`,{className:`znx-an-empty`,children:(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:o})});let u=pc(e,t);if(!u.length)return(0,l.jsx)(`div`,{className:`znx-an-empty`,children:(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:o})});let d=u.map((e,o)=>({key:String(o),label:(0,l.jsxs)(`span`,{className:`znx-an-group`,children:[(0,l.jsx)(`span`,{className:`znx-an-group-day`,children:fc(e.date)}),(0,l.jsx)(`span`,{className:`znx-an-group-date`,children:gc(e.date)}),(0,l.jsx)(`span`,{className:`znx-an-group-count`,children:e.items.length})]}),children:e.items.map((o,s)=>(0,l.jsx)(vc,{row:o,last:s===e.items.length-1,getTime:t,getAuthor:r,getMeta:i,renderBody:a},n(o,s)))}));return(0,l.jsx)(s.Collapse,{className:`znx-an-collapse`,defaultActiveKey:[`0`],ghost:!0,items:d})}var bc={add:`created`,create:`created`,created:`created`,update:`updated`,updated:`updated`,edit:`updated`,edited:`updated`,update_log:`updated`,update_proof:`updated`,notes:`note`,note:`note`,comment:`note`,assign:`assigned`,assigned:`assigned`,assignment:`assigned`,reassign:`assigned`,reassigned:`assigned`,submit:`submitted`,submitted:`submitted`,submission:`submitted`,"internal submission":`submitted`,send_for_approval:`sendForApproval`,"send for approval":`sendForApproval`,sendforapproval:`sendForApproval`,resubmit:`resubmitted`,resubmitted:`resubmitted`,resent_for_approval:`resent`,reject:`rejected`,rejected:`rejected`,reject_days:`rejected`,declined:`rejected`,decline:`rejected`,approve:`approved`,approved:`approved`,approve_days:`approved`,reopen:`reopened`,reopened:`reopened`,delete:`deleted`,deleted:`deleted`,remove:`deleted`,removed:`deleted`,status:`status`,"status change":`status`,statuschange:`status`,document:`document`,documents:`document`,upload:`document`,uploaded:`document`,attachment:`document`},xc={created:{tone:`success`,icon:(0,l.jsx)(c.PlusOutlined,{}),label:`Created`},updated:{tone:`info`,icon:(0,l.jsx)(c.EditOutlined,{}),label:`Updated`},note:{tone:`neutral`,icon:(0,l.jsx)(c.MessageOutlined,{}),label:`Note`},assigned:{tone:`purple`,icon:(0,l.jsx)(c.UserSwitchOutlined,{}),label:`Assigned`},submitted:{tone:`info`,icon:(0,l.jsx)(c.SendOutlined,{}),label:`Submitted`},sendForApproval:{tone:`info`,icon:(0,l.jsx)(c.SendOutlined,{}),label:`Send for Approval`},resubmitted:{tone:`purple`,icon:(0,l.jsx)(c.RedoOutlined,{}),label:`Re-submitted`},resent:{tone:`purple`,icon:(0,l.jsx)(c.RedoOutlined,{}),label:`Resend for Approval`},approved:{tone:`success`,icon:(0,l.jsx)(c.CheckOutlined,{}),label:`Approved`},rejected:{tone:`danger`,icon:(0,l.jsx)(c.CloseOutlined,{}),label:`Rejected`},reopened:{tone:`neutral`,icon:(0,l.jsx)(c.UndoOutlined,{}),label:`Reopened`},deleted:{tone:`danger`,icon:(0,l.jsx)(c.DeleteOutlined,{}),label:`Deleted`},status:{tone:`warning`,icon:(0,l.jsx)(c.SwapOutlined,{}),label:`Status changed`},document:{tone:`info`,icon:(0,l.jsx)(c.PaperClipOutlined,{}),label:`Document`},scheduled:{tone:`warning`,icon:(0,l.jsx)(c.ClockCircleOutlined,{}),label:`Scheduled`},default:{tone:`neutral`,icon:(0,l.jsx)(c.HistoryOutlined,{}),label:`Activity`}},Sc=[[/\b(?:submitted|sent|send)\b[\s\S]*\b(?:cfo|finance)\b[\s\S]*\bfor approval\b/i,`sendForApproval`],[/\bsend(?:ing)?\s+for\s+approval\b/i,`sendForApproval`],[/\breject/i,`rejected`],[/\bresent\b/i,`resent`],[/\bresubmit/i,`resubmitted`],[/\bapprov/i,`approved`],[/\bsubmit/i,`submitted`],[/\breassign|\bassign/i,`assigned`],[/\bdelete|\bremov/i,`deleted`],[/\breopen/i,`reopened`],[/\bstatus/i,`status`],[/\bdocument|\battach|\bupload/i,`document`],[/\bnote/i,`note`],[/\bupdat|\bchang|\bedit/i,`updated`],[/\bcreat|\badded\b/i,`created`]];function Cc(e,t){let n=String(e||``).trim().toLowerCase();if(n&&bc[n])return bc[n];let r=String(t||``);for(let[e,t]of Sc)if(e.test(r))return t;return`default`}function wc(e={},t=``){return xc[Cc(e.activityType??e.activity_type??e.type??e.action,t||e.activityComments)]??xc.default}function Tc(e=``){if(typeof document>`u`)return String(e);let t=document.createElement(`div`);return t.innerHTML=e,t.textContent||t.innerText||``}var Ec=[{id:`a1`,activityTime:new Date().toISOString(),activityComments:`Job <b>created</b> and assigned to the recruitment team.`},{id:`a2`,activityTime:new Date(Date.now()-1728e5).toISOString(),activityComments:`Status changed to <b>Active</b>.`}];function Dc({activity:e,grouped:t=!0}){let n=(0,o.useMemo)(()=>Array.isArray(e)?e:Ec,[e]);return(0,l.jsx)(`div`,{className:`znx-an-body`,children:(0,l.jsx)(`div`,{className:`znx-an-scroll`,children:(0,l.jsx)(yc,{rows:n,grouped:t,getTime:e=>e.activityTime??e.createdAt,getKey:(e,t)=>e.id??e._id??t,emptyText:`No activity here.`,getMeta:e=>wc(e,e.activityComments),renderBody:e=>{let t=wc(e,e.activityComments);return(0,l.jsxs)(`div`,{className:`znx-an-comment`,children:[(0,l.jsx)(`span`,{className:`znx-an-tag znx-an-tag--${t.tone}`,children:t.label}),Tc(e.activityComments)]})}})})})}function Oc(e){let t=e?.user_name??e?.userName??e?.username,n=`${e?.first_name??e?.firstName??``} ${e?.last_name??e?.lastName??``}`.trim(),r=e?.email??``,i=t??n.replace(/\s+/g,``)??r??String(e?.user_id??e?.id??``),a=[t,n,r].filter(Boolean).join(` - `)||String(i);return{value:String(i),label:a}}var kc=[{id:`n1`,createdAt:new Date().toISOString(),author:`You`,notes:`Shortlisted 3 candidates, sharing profiles with @Hiring Manager today.`}];function Ac(e=``){return e.split(/(\s+)/).map((e,t)=>e.startsWith(`@`)&&e.length>1?(0,l.jsx)(`span`,{className:`znx-an-mention`,children:e},t):(0,l.jsx)(`span`,{children:e},t))}function jc({notes:e,users:t=[],onAddNote:n,allowAddNote:r=!0}){let[i]=s.Form.useForm(),[a,c]=(0,o.useState)(()=>Array.isArray(e)?e:kc),[u,d]=(0,o.useState)(!1),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(!1),g=(0,o.useRef)(null),_=Array.isArray(e)?e:a,v=(0,o.useMemo)(()=>t.map(e=>({value:e.display??e.value,label:e.display??e.label})),[t]),y=f??v;return(0,l.jsxs)(`div`,{className:`znx-an-body`,children:[r&&(0,l.jsxs)(s.Form,{form:i,onFinish:async({note:e})=>{let t=(e??``).trim();if(t){d(!0);try{n?await n(t):c(e=>[{id:`local-${Date.now()}`,createdAt:new Date().toISOString(),author:`You`,notes:t},...e]),i.resetFields(),s.message.success(`Notes added successfully`)}catch{s.message.error(`Something went wrong, please try again.`)}finally{d(!1)}}},className:`znx-an-composer`,children:[(0,l.jsx)(s.Form.Item,{name:`note`,rules:[{required:!0,message:`Notes is required`}],style:{marginBottom:0},children:(0,l.jsx)(s.Mentions,{rows:3,prefix:`@`,options:y,loading:m,filterOption:!1,onSearch:e=>{clearTimeout(g.current),h(!0),g.current=setTimeout(()=>{zn(e).then(e=>{let t=Array.isArray(e)?e:e?.items??e?.list??e?.data??[];p(t.map(Oc))}).catch(()=>p([])).finally(()=>h(!1))},300)},placeholder:`Add your notes on the job, use '@' to mention`})}),(0,l.jsx)(`div`,{className:`znx-an-composer-actions`,children:(0,l.jsx)(s.Button,{type:`primary`,size:`small`,htmlType:`submit`,loading:u,children:`Post`})})]}),(0,l.jsx)(`div`,{className:`znx-an-scroll`,children:(0,l.jsx)(yc,{rows:_,getTime:e=>e.createdAt??e.activityTime,getKey:(e,t)=>e.id??e._id??t,getAuthor:e=>e.createdByName||e.author||``,emptyText:`No notes here.`,renderBody:e=>(0,l.jsx)(`div`,{className:`znx-an-comment`,children:Ac(e.notes)})})})]})}function Mc({moduleName:e,id:t,users:r=[],showActivity:i=!0,showNotes:a=!0,allowAddNote:c=!0,defaultActiveKey:u=`activity`,refreshKey:d=0,className:f=``}){let[p,m]=(0,o.useState)(null),[h,g]=(0,o.useState)(null);(0,o.useEffect)(()=>{if(!e||!t)return;let r=!1;async function o(){let[o,s]=await Promise.all([i?n.un(e,t).catch(()=>[]):Promise.resolve(null),a?n.pn(t).catch(()=>[]):Promise.resolve(null)]);r||(m(o),g(s))}return o(),()=>{r=!0}},[e,t,i,a,d]);let _=(0,o.useCallback)(async r=>{if(!t)return;await n.ln({relatedId:t,notes:r,notesFor:e});let[a,o]=await Promise.all([n.pn(t).catch(()=>[]),i?n.un(e,t).catch(()=>[]):Promise.resolve(p)]);g(a),i&&m(o)},[t,e,i,p]),v=[i&&{key:`activity`,title:`Activity`,count:Array.isArray(p)?p.length:void 0,children:(0,l.jsx)(Dc,{activity:p})},a&&{key:`notes`,title:`Notes`,count:Array.isArray(h)?h.length:void 0,children:(0,l.jsx)(jc,{notes:h,users:r,allowAddNote:c,onAddNote:t?_:void 0})}].filter(Boolean),y=v.some(e=>e.key===u)?u:v[0]?.key,[b,x]=(0,o.useState)(y);return(0,l.jsx)(s.Card,{className:[`znx-an-card`,f].filter(Boolean).join(` `),styles:{body:{padding:0}},children:(0,l.jsx)(P,{className:`znx-an-tabs`,tabs:v,activeKey:b,onChange:x})})}Mc.propTypes={moduleName:f.default.string,id:f.default.string,users:f.default.array,showActivity:f.default.bool,showNotes:f.default.bool,allowAddNote:f.default.bool,defaultActiveKey:f.default.string,refreshKey:f.default.oneOfType([f.default.number,f.default.string]),className:f.default.string};function Nc({assignees:e,extraAssignees:t}){return(0,l.jsxs)(s.Avatar.Group,{maxCount:3,size:`small`,children:[e.map((e,t)=>(0,l.jsx)(s.Tooltip,{title:e.initials,children:(0,l.jsx)(s.Avatar,{size:`small`,style:{backgroundColor:e.color,fontSize:10,fontWeight:600,cursor:`default`},children:e.initials})},t)),t>0&&(0,l.jsxs)(s.Avatar,{size:`small`,style:{backgroundColor:`#d9d9d9`,color:`#555`,fontSize:10},children:[`+`,t]})]})}var Pc=[`.xlsx`,`.xls`,`.csv`],Fc=10,Ic={".xlsx":[`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],".xls":[`application/vnd.ms-excel`],".csv":[`text/csv`,`application/csv`,`text/plain`]},Lc=[{test:(e,t)=>e===`.pdf`||t===`application/pdf`,label:`PDF`},{test:(e,t)=>t.startsWith(`image/`)||[`.jpg`,`.jpeg`,`.png`,`.gif`,`.webp`,`.heic`,`.bmp`,`.svg`].includes(e),label:`Image`},{test:e=>[`.doc`,`.docx`].includes(e),label:`Word document`},{test:e=>[`.zip`,`.rar`,`.7z`].includes(e),label:`Archive`},{test:e=>[`.txt`,`.json`,`.xml`].includes(e),label:`Plain text`}];function Rc(e=``){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t).toLowerCase()}function zc(e=0){return e<1024?`${e} B`:e<1048576?`${Math.ceil(e/1024)} KB`:`${(e/1048576).toFixed(1)} MB`}function Bc(e=Pc){let t=e.map(e=>e.toLowerCase());return t.concat(t.flatMap(e=>Ic[e]??[])).join(`,`)}function Vc(e,{accept:t=Pc,maxSizeMB:n=10}={}){if(!e)return`No file selected.`;let r=Rc(e.name),i=(e.type||``).toLowerCase(),a=t.map(e=>e.toLowerCase()),o=a.join(`, `);if(!r)return`"${e.name}" has no file extension. Only ${o} files are allowed.`;if(!a.includes(r)){let e=Lc.find(e=>e.test(r,i));return e?`${e.label} files are not supported. Only ${o} files are allowed.`:`"${r}" files are not supported. Only ${o} files are allowed.`}let s=Ic[r];return i&&s&&!s.includes(i)?`"${e.name}" is not a real ${r} file (detected ${i}). Re-save it from Excel and try again.`:e.size===0?`"${e.name}" is empty. Fill in at least one row before uploading.`:e.size>n*1024*1024?`File is ${zc(e.size)}. The limit is ${n} MB.`:null}function Hc(){return(0,l.jsxs)(`svg`,{className:`bulk-upload-art`,viewBox:`0 0 72 72`,focusable:`false`,"aria-hidden":`true`,children:[(0,l.jsx)(`rect`,{x:`12`,y:`6`,width:`36`,height:`48`,rx:`5`,className:`bulk-upload-art__sheet`}),(0,l.jsx)(`path`,{d:`M20 20h20M20 28h20M20 36h12`,className:`bulk-upload-art__lines`}),(0,l.jsx)(`circle`,{cx:`50`,cy:`48`,r:`15`,className:`bulk-upload-art__badge`}),(0,l.jsx)(`path`,{d:`M50 55V41m0 0-6 6m6-6 6 6`,className:`bulk-upload-art__arrow`})]})}function Uc({title:e,description:t,breadcrumbItems:r,backTo:i,backLabel:a=`Back`,templateLabel:u=`Download Sample Template`,templateTitle:f=`Sample template`,templateHint:p=`Pre-filled with the exact column names the importer expects. Do not rename or reorder the columns.`,instructions:m=[],accept:h=Pc,maxSizeMB:g=10,onDownloadTemplate:_,onUpload:v,renderResult:y,extraSidebar:b}){let x=(0,o.useRef)(null),[S,C]=(0,o.useState)(!1),[w,T]=(0,o.useState)(!1),[E,D]=(0,o.useState)(!1),[O,k]=(0,o.useState)(null),[A,j]=(0,o.useState)(null),[M,N]=(0,o.useState)(null),[P,F]=(0,o.useState)(0),I=(0,o.useMemo)(()=>h.map(e=>e.toLowerCase()),[h]),L=(0,o.useMemo)(()=>Bc(I),[I]),R=(0,o.useCallback)(()=>{k(null),j(null),N(null),C(!1),F(e=>e+1)},[]),z=(0,o.useCallback)(async()=>{if(_){T(!0);try{await _(),s.message.success(`Sample template downloaded.`)}catch(e){s.message.error(e?.message||`Could not download the template.`)}finally{T(!1)}}},[_]),B=(0,o.useCallback)(async e=>{if(!e||E)return;F(e=>e+1);let t=Vc(e,{accept:I,maxSizeMB:g});if(t){k(null),N(null),j(t);return}j(null),N(null),k({name:e.name,size:e.size}),D(!0);try{let t=await v(e);N(t)}catch(e){j(e?.message||`Upload failed. Please try again.`)}finally{D(!1)}},[I,g,v,E]),V=()=>{E||x.current?.click()},H=[`bulk-upload-dropzone`,S?`is-dragging`:``,E?`is-busy`:``,A?`is-error`:``,M&&!A?`is-done`:``].filter(Boolean).join(` `);return(0,l.jsxs)(`div`,{className:`bulk-upload-panel`,children:[r?.length?(0,l.jsx)(`div`,{className:`bulk-upload-breadcrumb`,children:(0,l.jsx)(n.t,{items:r})}):null,(0,l.jsxs)(`div`,{className:`bulk-upload-frame`,children:[(0,l.jsxs)(`header`,{className:`bulk-upload-header`,children:[(0,l.jsx)(`div`,{className:`bulk-upload-header__icon`,"aria-hidden":`true`,children:(0,l.jsx)(c.FileExcelOutlined,{})}),(0,l.jsxs)(`div`,{className:`bulk-upload-header__text`,children:[(0,l.jsx)(`h1`,{className:`bulk-upload-header__title`,children:e}),t?(0,l.jsx)(`p`,{className:`bulk-upload-header__desc`,children:t}):null]}),i?(0,l.jsx)(d.Link,{className:`bulk-upload-header__back`,to:i,children:(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.ArrowLeftOutlined,{}),children:a})}):null]}),(0,l.jsxs)(`div`,{className:`bulk-upload-grid`,children:[(0,l.jsxs)(`section`,{className:`bulk-upload-card bulk-upload-card--drop`,children:[(0,l.jsxs)(`div`,{className:`bulk-upload-card__head`,children:[(0,l.jsx)(`span`,{className:`bulk-upload-step`,children:`Step 2`}),(0,l.jsx)(`h2`,{className:`bulk-upload-card__title`,children:`Upload the filled file`})]}),(0,l.jsxs)(`div`,{role:`button`,tabIndex:E?-1:0,"aria-disabled":E,"aria-label":`Upload the filled file — click to browse, or drop a file here`,className:H,onClick:V,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),V())},onDragOver:e=>{e.preventDefault(),E||C(!0)},onDragLeave:()=>C(!1),onDrop:e=>{e.preventDefault(),C(!1),B(e.dataTransfer.files?.[0])},children:[(0,l.jsx)(Hc,{}),(0,l.jsx)(`p`,{className:`bulk-upload-dropzone__title`,children:S?`Drop the file to start uploading`:`Drag & drop your file here`}),(0,l.jsxs)(`p`,{className:`bulk-upload-dropzone__sub`,children:[`or `,(0,l.jsx)(`span`,{className:`bulk-upload-dropzone__link`,children:`browse from your computer`})]}),(0,l.jsxs)(`div`,{className:`bulk-upload-chips`,children:[I.map(e=>(0,l.jsx)(s.Tag,{className:`bulk-upload-chip bulk-upload-chip--ok`,children:e},e)),(0,l.jsx)(s.Tooltip,{title:`These file types are rejected before upload`,children:(0,l.jsx)(s.Tag,{className:`bulk-upload-chip bulk-upload-chip--no`,children:`.pdf .jpg .png not allowed`})})]}),(0,l.jsxs)(`p`,{className:`bulk-upload-dropzone__limit`,children:[`Maximum size `,g,` MB`]})]}),(0,l.jsx)(`input`,{ref:x,hidden:!0,type:`file`,accept:L,onChange:e=>B(e.target.files?.[0])},P),O?(0,l.jsxs)(`div`,{className:`bulk-upload-file ${A?`is-error`:``}`,children:[(0,l.jsx)(`span`,{className:`bulk-upload-file__icon`,children:E?(0,l.jsx)(c.FileExcelOutlined,{}):A?(0,l.jsx)(c.CloseCircleFilled,{}):(0,l.jsx)(c.CheckCircleFilled,{})}),(0,l.jsxs)(`span`,{className:`bulk-upload-file__meta`,children:[(0,l.jsx)(`span`,{className:`bulk-upload-file__name`,title:O.name,children:O.name}),(0,l.jsxs)(`span`,{className:`bulk-upload-file__size`,children:[zc(O.size),E?` · uploading…`:A?` · failed`:` · processed`]})]}),E?null:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:M?(0,l.jsx)(c.ReloadOutlined,{}):(0,l.jsx)(c.DeleteOutlined,{}),onClick:R,children:M?`Upload another`:`Remove`})]}):null,E?(0,l.jsx)(s.Progress,{percent:99,status:`active`,showInfo:!1,size:`small`,className:`bulk-upload-progress`}):null,A?(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,className:`bulk-upload-alert`,title:`File not accepted`,description:A}):null]}),(0,l.jsxs)(`aside`,{className:`bulk-upload-side`,children:[(0,l.jsxs)(`section`,{className:`bulk-upload-card bulk-upload-card--template`,children:[(0,l.jsxs)(`div`,{className:`bulk-upload-card__head`,children:[(0,l.jsx)(`span`,{className:`bulk-upload-step`,children:`Step 1`}),(0,l.jsx)(`h2`,{className:`bulk-upload-card__title`,children:f})]}),(0,l.jsx)(`p`,{className:`bulk-upload-side__hint`,children:p}),(0,l.jsx)(s.Button,{block:!0,icon:(0,l.jsx)(c.DownloadOutlined,{}),loading:w,onClick:z,className:`bulk-upload-template-btn`,children:u})]}),m.length?(0,l.jsxs)(`section`,{className:`bulk-upload-card bulk-upload-card--rules`,children:[(0,l.jsx)(`h2`,{className:`bulk-upload-card__title`,children:`Before you upload`}),(0,l.jsx)(`ul`,{className:`bulk-upload-rules`,children:m.map(e=>(0,l.jsx)(`li`,{children:e},e))})]}):null,b]})]}),M&&y?(0,l.jsx)(`div`,{className:`bulk-upload-result`,children:y(M,{reset:R})}):null]})]})}var Wc=e.t({getJobById:()=>Qc,getJobDetailView:()=>Gc,updateJobDescription:()=>$c});async function Gc(e){let n=await t.a(),r=new URLSearchParams({jobId:String(e)}),i=await fetch(`${t.T}/jobs?${r}`,{method:`GET`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`}});if(!i.ok)throw Error(`API ${i.status}: ${i.statusText}`);let a=await i.json();return a.data??a}var Kc={email:`zinnext@realtekconsulting.net`,user_pwd:`Admin@123*`},qc=null;async function Jc(){return qc||(qc=fetch(`${t.x}/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Kc)}).then(async e=>{if(!e.ok)throw Error(`Login failed: ${e.status}`);let t=await e.json(),n=t.token??t.access_token??t.data?.token??t.data?.access_token;if(!n)throw Error(`No token in login response`);return localStorage.setItem(`authToken`,n),n}).finally(()=>{qc=null}),qc)}async function Yc(){return(t.u()??localStorage.getItem(`authToken`))||Jc()}async function Xc(e){let n=await Yc(),r=await fetch(`${t.x}${e}`,{headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`}});if(r.status===401&&(localStorage.removeItem(`authToken`),n=await Jc(),r=await fetch(`${t.x}${e}`,{headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`}})),!r.ok)throw Error(`API ${r.status}: ${r.statusText}`);let i=await r.json();return i.data??i}async function Zc(e,n){let r=await Yc(),i=await fetch(`${t.x}${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${r}`},body:JSON.stringify(n)});if(i.status===401&&(localStorage.removeItem(`authToken`),r=await Jc(),i=await fetch(`${t.x}${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${r}`},body:JSON.stringify(n)})),!i.ok)throw Error(`API ${i.status}: ${i.statusText}`);return i.json()}async function Qc(e){return Xc(`/jobs/${e}`)}async function $c(e,t){return Zc(`/jobs/${e}`,{rawDescription:t})}var{Text:el}=s.Typography,tl=2;function nl({jobId:e,sections:t=[],meta:n=[],rawDescription:r=``,onSaved:i}){let[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(!1),[p,m]=(0,o.useState)(``),[h,g]=(0,o.useState)(!1),_=[...t].sort((e,t)=>(e.displayOrder??0)-(t.displayOrder??0)),v=a?_:_.slice(0,tl),y=_.length>tl;function b(){m(r),f(!0)}function x(){f(!1),m(``)}async function S(){if(!p.trim()){s.message.warning(`Please enter a job description`);return}g(!0);try{await $c(e,p.trim());let t=await Qc(e);i?.(t),f(!1),m(``),s.message.success(`Description updated successfully`)}catch{s.message.error(`Failed to update description`)}finally{g(!1)}}return d?(0,l.jsxs)(s.Space,{direction:`vertical`,style:{width:`100%`},size:8,children:[(0,l.jsx)(s.Input.TextArea,{rows:10,value:p,onChange:e=>m(e.target.value),placeholder:`Paste raw job description here...`}),(0,l.jsxs)(s.Space,{children:[(0,l.jsx)(s.Button,{type:`primary`,loading:h,onClick:S,children:`Save & Parse`}),(0,l.jsx)(s.Button,{onClick:x,children:`Cancel`})]})]}):(0,l.jsxs)(`div`,{className:`desc-block`,children:[(0,l.jsx)(`div`,{className:`desc-block-toolbar`,children:(0,l.jsx)(c.EditOutlined,{className:`desc-edit-icon`,onClick:b})}),!t.length&&!n.length?(0,l.jsx)(el,{type:`secondary`,children:`No description available.`}):(0,l.jsxs)(`div`,{className:`jdv-ats-desc`,children:[n.length>0&&(0,l.jsx)(`div`,{className:`jdv-ats-meta-grid`,children:n.map(({fieldKey:e,fieldLabel:t,value:n})=>(0,l.jsxs)(`div`,{className:`jdv-ats-meta-row`,children:[(0,l.jsx)(`span`,{className:`jdv-ats-meta-key`,children:t}),(0,l.jsx)(`span`,{className:`jdv-ats-meta-val`,children:n})]},e))}),(0,l.jsx)(`div`,{className:`jdv-ats-sections`,children:v.map(({sectionKey:e,sectionTitle:t,renderType:n,content:r=[]})=>n===`education`?(0,l.jsxs)(`div`,{className:`education-block`,children:[(0,l.jsxs)(`div`,{className:`education-header`,children:[(0,l.jsx)(`span`,{children:`🎓`}),(0,l.jsx)(`span`,{children:t})]}),(0,l.jsx)(`ul`,{className:`education-list`,children:r.map((e,t)=>(0,l.jsx)(`li`,{className:`education-list-item`,children:e},t))})]},e):(0,l.jsxs)(`div`,{className:`jdv-ats-section`,children:[(0,l.jsx)(`div`,{className:`jdv-ats-section-hd`,children:(0,l.jsx)(`span`,{children:t})}),n===`chips`?(0,l.jsx)(s.Space,{size:[6,6],wrap:!0,style:{marginTop:8},children:r.map((e,t)=>(0,l.jsx)(s.Tag,{className:`jdv-skill-tag`,children:e},t))}):(0,l.jsx)(`ul`,{className:`jdv-ats-bullets`,children:r.map((e,t)=>(0,l.jsx)(`li`,{className:`jdv-ats-bullet-item`,children:e},t))})]},e))}),y&&(0,l.jsx)(`span`,{className:`jdv-desc-toggle`,onClick:()=>u(e=>!e),children:a?`Show less`:`Show more (${t.length-tl} more sections)`})]})]})}function rl(){return Number(localStorage.getItem(`userId`))||0}function il(e,{id:t,moduleName:n,record:r}={}){let i=(0,o.useMemo)(()=>Array.isArray(e)?e:[],[e]),a=(0,o.useMemo)(()=>i.filter(e=>typeof e?.visibleWhen==`function`),[i]),[s,c]=(0,o.useState)({});return(0,o.useEffect)(()=>{if(!a.length)return;let e=!1,i={id:t,moduleName:n,record:r,currentUserId:rl()};return a.forEach(n=>{let r=`${t}:${n.key}`;Promise.resolve().then(()=>n.visibleWhen(i)).then(t=>{e||c(e=>({...e,[r]:t!==!1}))}).catch(()=>{e||c(e=>({...e,[r]:!0}))})}),()=>{e=!0}},[a,t,n,r]),(0,o.useMemo)(()=>i.filter(e=>typeof e?.visibleWhen!=`function`||s[`${t}:${e.key}`]===!0),[i,s,t])}var al=[{field:`baId`,label:`BA`,icon:`idcard`},{field:`clientName`,icon:`bank`,tooltip:`Client`},{field:`employerName`,icon:`team`,badgeField:`engagementType`,tooltip:`Employer`},{field:`projectName`,icon:`project`,tooltip:`Project`},{field:`batchPriority`,icon:`idcard`,tooltip:`Priority`},{field:`paymentTermsLabel`,icon:`cycle`,tooltip:`Payment Terms`},{field:`paymentDeadlineLabel`,icon:`period`,tooltip:`Payment Deadline`},{field:`batchName`,icon:`project`,tooltip:`Payment Batch`},{field:`period.label`,icon:`period`,tooltip:`Period`}],ol=e.t({billingConfig:()=>sl,default:()=>sl}),sl={module:`billing`,tabs:[],header:{variant:`finance`,title:`candidateName`,eyebrow:`designation`,statusField:`billing.status`,chips:al}},cl={USD:`$`,INR:`₹`,EUR:`€`,GBP:`£`,AUD:`$`,CAD:`$`},ll=e=>e==null||e===``||Array.isArray(e)&&e.length===0,ul=e=>!ll(e);function dl(e){let t=pl(e);return t.charAt(0).toUpperCase()+t.slice(1)}function fl(e){return e&&typeof e==`object`&&!Array.isArray(e)&&`id`in e&&`value`in e?e.id??e.value:e}function pl(e){return Array.isArray(e)?e.filter(e=>!ll(e)).map(e=>pl(e)).filter(Boolean).join(`, `):e&&typeof e==`object`&&`id`in e&&`value`in e?String(e.value??e.id??``):String(e??``)}function ml(e){return ll(e)?``:cl[String(e).toUpperCase()]??String(e)}function hl(e){return ll(e)?``:n.An(e)}function gl({start:e,end:t,sym:n=``,unit:r}={}){return ll(e)||Number(e)<=0?``:`${n}${!ll(t)&&Number(t)>0?`${e} - ${t}`:`${e}`}${ll(r)?``:`/${r}`}`}function _l(e){let t=pl(e).toLowerCase();return[`active`,`open`,`hired`,`approved`,`fulfilled`,`submitted`].includes(t)?`success`:[`inactive`,`closed`,`rejected`,`high`].includes(t)?`error`:[`hold`,`on hold`,`pending`,`unread`,`medium`].includes(t)?`warning`:`default`}var vl=e.t({candidateConfig:()=>yl,default:()=>yl}),yl={module:`candidate`,tabs:[{key:`details`,label:`Details`},{key:`jobs`,label:`Jobs`},{key:`emails`,label:`Emails`},{key:`attachments`,label:`Attachments`}],header:{title:[`firstName`,`middleName`,`lastName`],eyebrow:`source`,status:({val:e,has:t})=>t(e(`status`))?{label:dl(e(`status`)),color:_l(e(`status`))}:e(`applicantPlacedStatus`)===!0?{label:`Placed`,color:`success`}:null,ids:[{label:`Candidate ID`,field:[`applicantRefrenceId`,`applicantReferenceId`,`candidateReferenceId`]}],meta:[{icon:`designation`,field:`designation`},{icon:`location`,field:[`currentLocation`,`preferredLocation`]},{icon:`experience`,compute:bl},{icon:`employment`,field:`workAuthorisation`},{icon:`rate`,prefix:`Expected: `,compute:xl}],timestamp:{label:`Created Date`,field:[`createdAt`,`createdDate`]}}};function bl({val:e,has:t}){let n=t(e(`yearOfExperience`))?e(`yearOfExperience`):e(`experience`);if(!t(n))return``;let r=e(`monthOfExperience`);return`${n} yrs${t(r)&&Number(r)>0?` ${r} mo`:``}`}function xl({val:e}){let t=e(`expectedPayDetails`)??{};return gl({start:t.expectedPay??e(`expectedPay`),sym:t.expectedPayCurrencySymbol??ml(t.expectedPayCurrency),unit:t.expectedPayUnit})}var Sl=e.t({default:()=>Cl,employerConfig:()=>Cl}),Cl={module:`employer`,header:{title:`empCompanyName`,eyebrow:`empWebsite`,status:({val:e,has:t})=>t(e(`status`))?{label:dl(e(`status`)),color:_l(e(`status`))}:null,ids:[{label:`Federal Tax ID`,field:`empFederalTaxId`},{label:`State of Incorporation`,field:`empStateOfIncorporation`}],meta:[{icon:`location`,field:`empCompanyLocation`}],timestamp:{label:`Created Date`,field:[`createdAt`,`createdDate`]}}},wl=e=>e===!0||e===1||e===`1`;function Tl(e){return e==null||e===``?!0:Array.isArray(e)?e.length===0:typeof e==`object`&&Object.values(e).every(e=>Tl(e))}function El(e){return n.Lt(e).filter(e=>e?.location||e?.url)}function Dl(e){return El(e).length>0}function Ol(e){return wl(e?.hideWhenEmpty)||wl(e?.hideWhenEmptyInDetail)||wl(e?.renderOptions?.hideWhenEmpty)||wl(e?.renderOptions?.hideWhenEmptyInDetail)}function kl(e){return wl(e?.hideWhenZero)||wl(e?.renderOptions?.hideWhenZero)}function Al(e){if(typeof e==`number`)return e===0;if(typeof e==`string`){let t=e.trim();return t!==``&&Number.isFinite(Number(t))&&Number(t)===0}return!1}function jl(e,t){let n=kl(e);return!Ol(e)&&!n?!1:e?.type===`file`||e?.type===`document`||e?.renderType===`document`?!Dl(t):Tl(t)||n&&Al(t)}var Ml=e=>e===!0||e===1||e===`1`;function Nl(e=[]){let t={};for(let n of e??[])for(let e of n?.fields??[]){if(!e?.field||e.value===void 0)continue;let n=e.value,r=n&&typeof n==`object`&&!Array.isArray(n)&&`value`in n?n.value:n;t[e.field]=r,e.payloadKey&&t[e.payloadKey]===void 0&&(t[e.payloadKey]=r)}return t}function Pl(e,t){let r=n.c(e?.showIf);return!r.length||Ml(e?.ignoreShowIfInDetail)||!r.every(e=>Object.prototype.hasOwnProperty.call(t??{},e.field))?!0:n.o(e.showIf,e=>t[e])}function Fl(e){let t=e?.detailLabelWhen;if(Array.isArray(t)&&t.length)return t;let n=e?.labelWhen;return n?[n]:[]}function Il(e,t){let r=e?.label;if(Ml(e?.ignoreLabelWhenInDetail))return r;for(let r of Fl(e))if(!(!r?.field||!r?.label)&&Object.prototype.hasOwnProperty.call(t??{},r.field)&&n.i(r,t[r.field]))return r.label;return r}var Ll=/(currency|symbol|unit|type)/i,Rl=/(rate|budget|amount)/i,zl=e=>typeof e==`number`||typeof e==`string`&&e.trim()!==``&&!Number.isNaN(Number(e)),Bl=e=>e===!0||e===1||e===`1`;function Vl(e,t){return!e||!t||!Bl(e.appendHistory)?!1:[e.historyField,...e.historyFields??[]].includes(t)}function Hl(e,t){let n=String(t??``).trim();if(!n)return``;let r=`${e}.`;return n.startsWith(r)?n.slice(r.length):n}function Ul(e,t=[]){let n=`${e}.`,r=[];return(t??[]).forEach(t=>{Vl(t,e)&&(t.fields??[]).forEach(e=>{let t=String(e?.field??``);if(!t.startsWith(n))return;let i=t.slice(n.length);i&&!r.includes(i)&&r.push(i)})}),r}function Wl(e,t=[],n){for(let r of t??[]){if(!Vl(r,e))continue;let t=Hl(e,r?.[n]?.[e]);if(t)return t}return``}var Gl=(e,t)=>!!t&&e!=null&&Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0;function Kl(e){let t=Object.entries(e??{}).find(([e,t])=>Rl.test(e)&&!Ll.test(e)&&zl(t));return t?t[0]:``}function ql(e){let t=Object.keys(e??{});return t.find(t=>/currencysymbol/i.test(t)&&String(e[t]??``).trim()!==``)||t.find(t=>/currency/i.test(t)&&String(e[t]??``).trim()!==``)||t.find(t=>/symbol/i.test(t)&&String(e[t]??``).trim()!==``)||``}function Jl(e){return Object.keys(e??{}).find(e=>/unit/i.test(e))||``}function Yl(e,t,n=[]){let r=Ul(t,n),i=Wl(t,n,`historyAmountFields`),a=r.find(e=>!Ll.test(e)),o=Gl(e,i)&&i||Gl(e,a)&&a||Kl(e),s=Wl(t,n,`historyCurrencyFields`),c=r.find(t=>/symbol/i.test(t)&&Gl(e,t)&&String(e[t]??``).trim()!==``),l=r.find(e=>/currency/i.test(e)&&!/symbol/i.test(e)),u=Gl(e,s)&&s||c||Gl(e,l)&&l||ql(e),d=Wl(t,n,`historyUnitFields`),f=r.find(e=>/unit/i.test(e)),p=Gl(e,d)&&d||Gl(e,f)&&f||Jl(e);return{amountKey:o||``,currencyKey:u||``,unitKey:p||``}}function Xl(e,t,n=[]){let{amountKey:r,currencyKey:i,unitKey:a}=Yl(e,t,n);return{amountKey:r,currencyKey:i,unitKey:a,amount:r?e?.[r]:void 0,currency:i?e?.[i]:``,unit:a?e?.[a]:``}}var Zl={USD:`$`,INR:`₹`,GBP:`£`,EUR:`€`,CAD:`C$`,AUD:`A$`,SGD:`S$`,JPY:`¥`};function Ql(e,t=`$`){let n=String(e??``).trim();return n?Zl[n.toUpperCase()]||(/^[A-Za-z]{2,}$/.test(n)?t:n):t}var $l={hr:`Hourly`,hour:`Hourly`,hours:`Hourly`,hourly:`Hourly`,day:`Daily`,daily:`Daily`,week:`Weekly`,weekly:`Weekly`,month:`Monthly`,monthly:`Monthly`,year:`Yearly`,yearly:`Yearly`,annual:`Yearly`,annually:`Yearly`};function eu(e,t=``){let n=String(e??``).trim();return n?$l[n.toLowerCase()]??n.charAt(0).toUpperCase()+n.slice(1):t}var tu={Hourly:`hr`,Daily:`day`,Weekly:`wk`,Monthly:`mo`,Yearly:`yr`};function nu(e,t=``){let n=eu(e,``);return n?tu[n]??n.toLowerCase():t}function ru(e){if(typeof e==`number`)return Number.isFinite(e)?e:NaN;let t=String(e??``).trim().replace(/[,\s]/g,``).replace(/[^0-9eE+.\-]/g,``);if(!t)return NaN;let n=Number(t);return Number.isFinite(n)?n:NaN}function iu(e,{decimals:t}={}){let n=ru(e);return Number.isNaN(n)?String(e??``):n.toLocaleString(void 0,{minimumFractionDigits:t??0,maximumFractionDigits:t??2})}function au(e,t=`$`,n={}){let r=ru(e);if(Number.isNaN(r))return String(e??``);let i=Ql(t);return`${r<0?`−`:``}${i}${iu(Math.abs(r),n)}`}function ou(e,t=`$`,n,r={}){let i=au(e,t,r),a=eu(n,``);return a?`${i} / ${a}`:i}var su=Object.freeze({document:`No document uploaded`,documents:`No documents uploaded`,date:`Not provided`,phone:`No contact number added`,email:`No email address added`,link:`No link added`,url:`No link added`,tags:`None added`,multitag:`None added`,skills:`No skills added`,currency:`Not provided`,money:`Not provided`,number:`Not provided`,boolean:`Not specified`,default:`Not provided`}),cu=e=>{let t=e==null?``:String(e).trim();return t===``?null:t};function lu(e,t,r=n.zn()){let i=cu(e?.emptyText??e?.renderOptions?.emptyText);if(i)return i;let a=String(t??e?.renderType??e?.type??`default`).toLowerCase(),o=r?.emptyTexts??{};return cu(o[a])??cu(su[a])??cu(o.default)??cu(su.default)??cu(r?.emptyPlaceholder)??`—`}function uu(e,t=n.zn()){let r=cu(e?.emptyText);if(r)return r;let i=t?.emptyTexts??{};if(cu(i.group))return cu(i.group);let a=cu(e?.label??e?.name);return a?`No ${a.toLowerCase()} added`:cu(su.default)??`—`}var{Text:du}=s.Typography,fu=e=>e==null||e===``,pu=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}|$)/;function mu(e){return String(e).replace(/\w\S*/g,e=>e.length>1&&e===e.toUpperCase()?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())}function hu(e){return!(typeof e!=`string`||!e.trim()||!/[a-z]/i.test(e)||e.includes(`@`)||/^https?:\/\//i.test(e)||/^[a-f0-9]{24}$/i.test(e)||/<[a-z][\s\S]*>/i.test(e))}function gu(e,t){if(fu(e))return``;let n=String(e);return t===!1?n:hu(n)?mu(n):n}function _u(e,t,n){return Object.values(e).filter(e=>!fu(e)&&typeof e!=`object`).map(e=>gu(e,t)).join(n)}function vu(e,t){if(!e)return e;switch(t){case`upper`:return String(e).toUpperCase();case`lower`:return String(e).toLowerCase();case`title`:return mu(e);default:return e}}var yu=e=>e&&typeof e==`object`&&!Array.isArray(e)&&`value`in e&&`id`in e;function bu(e,t,n){return fu(e)?``:yu(e)?gu(e.value??e.id,t):Array.isArray(e)?e.map(e=>yu(e)?gu(e.value??e.id,t):e&&typeof e==`object`?_u(e,t,n):gu(e,t)).filter(Boolean).join(n):typeof e==`boolean`?e?`Yes`:`No`:typeof e==`object`?_u(e,t,n):gu(e,t)}function xu(e,t,n){if(Array.isArray(e))return e.map(e=>yu(e)?gu(e.value??e.id,t):e&&typeof e==`object`?_u(e,t,n):gu(e,t)).filter(e=>e!==``);if(typeof e==`string`)return e.split(`,`).map(e=>gu(e.trim(),t)).filter(Boolean);let r=bu(e,t,n);return r?[r]:[]}function Su({name:e}){let t=String(e||``).split(`.`).pop().toLowerCase();return t===`pdf`?(0,l.jsx)(c.FilePdfOutlined,{className:`v1-file-chip__icon`}):t===`doc`||t===`docx`?(0,l.jsx)(c.FileWordOutlined,{className:`v1-file-chip__icon`}):[`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`svg`].includes(t)?(0,l.jsx)(c.FileImageOutlined,{className:`v1-file-chip__icon`}):[`txt`,`csv`,`json`,`md`].includes(t)?(0,l.jsx)(c.FileTextOutlined,{className:`v1-file-chip__icon`}):(0,l.jsx)(c.FileOutlined,{className:`v1-file-chip__icon`})}Su.propTypes={name:f.default.string};function Cu(e){return e?.renderType&&e.renderType!==`auto`?e.renderType:e?.documentPreview===!0?`document`:e?.formatter===`phone`||e?.type===`phone`?`phone`:e?.displayAs===`tag`?`tag`:e?.displayAs===`text`?`text`:`auto`}function wu({value:e,mode:t,empty:r,style:i}){let[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(0),p=n.Lt(e);if(!p.length)return(0,l.jsx)(du,{strong:!0,className:`v1-detail-value`,style:i,children:r});let m=p.filter(e=>e.url);return t===`text`?(0,l.jsx)(du,{strong:!0,className:`v1-detail-value`,style:i,children:p.map(e=>e.name).join(`, `)}):t===`tag`?(0,l.jsx)(`span`,{className:`v1-detail-value v1-detail-tags`,children:p.map((e,t)=>(0,l.jsx)(s.Tag,{icon:(0,l.jsx)(c.PaperClipOutlined,{}),children:e.name},t))}):t===`link`||t===`download`?(0,l.jsx)(`span`,{className:`v1-detail-value v1-doc-list`,children:(0,l.jsx)(`span`,{className:`v1-file-list`,children:p.map((e,n)=>e.url?(0,l.jsxs)(`a`,{className:`v1-file-chip`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,download:t===`download`?e.name||``:void 0,title:e.name,children:[(0,l.jsx)(Su,{name:e.name}),(0,l.jsx)(`span`,{className:`v1-file-chip__name`,children:e.name}),t===`download`?(0,l.jsx)(c.DownloadOutlined,{className:`v1-file-chip__action`}):(0,l.jsx)(c.LinkOutlined,{className:`v1-file-chip__action`})]},n):(0,l.jsxs)(`span`,{className:`v1-file-chip v1-file-chip--disabled`,title:`No file location`,children:[(0,l.jsx)(Su,{name:e.name}),(0,l.jsx)(`span`,{className:`v1-file-chip__name`,children:e.name})]},n))})}):(0,l.jsxs)(`div`,{className:`v1-detail-value v1-doc-list`,children:[(0,l.jsx)(`div`,{className:`v1-file-list`,children:p.map((e,t)=>e.url?(0,l.jsxs)(`button`,{type:`button`,className:`v1-file-chip`,onClick:()=>{f(m.indexOf(e)),u(!0)},title:`Preview ${e.name}`,children:[(0,l.jsx)(Su,{name:e.name}),(0,l.jsx)(`span`,{className:`v1-file-chip__name`,children:e.name}),(0,l.jsx)(c.EyeOutlined,{className:`v1-file-chip__action`})]},t):(0,l.jsxs)(`span`,{className:`v1-file-chip v1-file-chip--disabled`,title:`No preview available for this file`,children:[(0,l.jsx)(Su,{name:e.name}),(0,l.jsx)(`span`,{className:`v1-file-chip__name`,children:e.name})]},t))}),(0,l.jsx)(n.Cn,{documents:m,open:a,onClose:()=>u(!1),initialIndex:d})]})}wu.propTypes={value:f.default.any,mode:f.default.string,empty:f.default.string,style:f.default.object};function Tu(e,t={}){return Number.isNaN(ru(e))?String(e??``):`${t.currencySymbol?Ql(t.currencySymbol,``):``}${iu(e,{decimals:t.decimals})}`}function Eu({field:e,record:t}){let{value:r,type:i,prefix:a=``,suffix:o=``,color:d=``,capitalize:f}=e??{},p=e?.renderOptions??{},m=n.zn(),h=m.separator||`, `,g=d?{color:d}:void 0,_=p.tagColor||d||void 0,v=p.textTransform&&p.textTransform!==`none`?p.textTransform:null,y=e=>`${a?`${a} `:``}${e}${o?` ${o}`:``}`,b=e=>v?vu(e,v):e,x=e=>(0,l.jsx)(du,{strong:!0,className:`v1-detail-value`,style:g,children:b(e)}),S=e=>(0,l.jsx)(du,{strong:!0,className:`v1-detail-value v1-detail-token`,style:g,children:b(e)}),C=e=>(0,l.jsx)(`span`,{className:`v1-detail-value v1-detail-tags`,children:(0,l.jsx)(s.Tag,{color:_,children:b(e)})}),w=Cu(e),T=lu(e,w,m);if(w!==`document`&&fu(r)&&!p.showEmpty)return x(T);switch(w){case`document`:return(0,l.jsx)(wu,{value:r,mode:p.documentMode||`preview`,empty:T,style:g});case`text`:return x(y(bu(r,f,h)));case`tag`:case`chip`:return C(y(bu(r,f,h)));case`badge`:{let e=b(bu(r,f,h));return(0,l.jsx)(`span`,{className:`v1-detail-value`,children:(0,l.jsx)(s.Badge,{color:_||`blue`,text:e})})}case`tags`:case`multitag`:case`skills`:{let e=xu(r,f,h);return e.length?(0,l.jsx)(`span`,{className:`v1-detail-value v1-detail-tags`,children:e.map((e,t)=>(0,l.jsx)(s.Tag,{color:_,children:b(e)},t))}):x(T)}case`link`:{let e=bu(r,!1,h),t=/^https?:\/\//i.test(e)?e:n.It(e)||e;return(0,l.jsx)(`a`,{className:`v1-detail-value v1-doc-link`,href:t,target:`_blank`,rel:`noopener noreferrer`,children:b(y(e))})}case`email`:{let e=bu(r,!1,h);return(0,l.jsxs)(`a`,{className:`v1-detail-value`,href:`mailto:${e}`,children:[(0,l.jsx)(c.MailOutlined,{}),` `,e]})}case`phone`:{let i=bu(r,!1,h),a=n.zt(e,i,t),o=a.replace(/[^0-9+]/g,``);return(0,l.jsxs)(`a`,{className:`v1-detail-value v1-detail-token v1-detail-call`,href:`tel:${o}`,"aria-label":`Call ${a}`,title:`Call ${a}`,children:[(0,l.jsx)(c.PhoneOutlined,{}),` `,b(y(a))]})}case`date`:case`datetime`:{if(w===`datetime`||p.withTime===!0)return S(y((p.dateFormat?n.kn(r,p.dateFormat,m):n.An(r,m))||bu(r,f,h)));let e=p.dateFormat||m.dateFormat;return S(y(n.kn(r,e,m)||bu(r,f,h)))}case`currency`:return S(y(Tu(r,p)));case`budget`:{let e=Tu(r,p),t=p.unit?String(p.unit):``,n=t&&p.budgetUnitMap?p.budgetUnitMap[t]??t:t;return S(`${e}${n?`/${n}`:``}`)}case`html`:return(0,l.jsx)(`span`,{className:`v1-detail-value`,style:g,dangerouslySetInnerHTML:{__html:String(r??``)}})}if(fu(r))return x(T);let E=i===`date`,D=typeof r==`string`&&pu.test(r.trim());if(E||D){let e=(0,u.default)(r);if(e.isValid())return x(y(e.format(m.dateFormat)))}if(yu(r))return x(y(gu(r.value??r.id,f)));if(Array.isArray(r)){let e=xu(r,f,h);return e.length?(0,l.jsx)(`span`,{className:`v1-detail-value v1-detail-tags`,children:e.map((e,t)=>(0,l.jsx)(s.Tag,{color:_,children:e},t))}):x(T)}return x(typeof r==`boolean`?r?m.booleanTrueLabel:m.booleanFalseLabel:typeof r==`object`?_u(r,f,h)||T:y(gu(r,f)))}Eu.propTypes={field:f.default.object,record:f.default.object};var{Text:Du}=s.Typography,Ou=[(0,l.jsx)(c.UserOutlined,{}),(0,l.jsx)(c.EnvironmentOutlined,{}),(0,l.jsx)(c.SolutionOutlined,{}),(0,l.jsx)(c.InfoCircleOutlined,{}),(0,l.jsx)(c.FileTextOutlined,{})],ku=e=>e===!0||e===1||e===`1`,Au=[`jobDescription`,`description`,`rawDescription`,`jobDescriptionText`];function ju(e=[]){for(let t of e)for(let e of t.fields??[]){let t=Au.includes(e.field),n=/description/i.test(e.label??``);if((t||n)&&typeof e.value==`string`&&e.value.trim())return{...e,key:e.field,value:e.value}}return null}function Mu(e=[]){let t=Nl(e);return[...e].filter(e=>!ku(e.hideGroup)&&!ku(e.hideGroupInDetail)).filter(e=>Pl(e,t)).sort((e,t)=>Number(e.order??0)-Number(t.order??0)).map(e=>({...e,fields:[...e.fields??[]].filter(e=>String(e.field??``).trim()!==``&&(e.show===void 0||ku(e.show))&&Pl(e,t)).map(e=>({...e,label:Il(e,t)})).sort((e,t)=>Number(e.order??0)-Number(t.order??0))})).filter(e=>e.fields.length)}function Nu(e){let t=e?.data??e;return Array.isArray(t)?t:t?.data??t?.rows??t?.records??t?.items??t?.list??[]}function Pu(e,...t){for(let n of t){let t=String(n).split(`.`).reduce((e,t)=>e?.[t],e);if(t!=null&&t!==``)return t}return``}function Fu(e){let t=String(Pu(e,`isDeleted`,`deleted`)).toLowerCase(),n=String(Pu(e,`assignmentStatus`,`status`)).toLowerCase();return t!==`true`&&t!==`1`&&![`removed`,`inactive`,`deleted`].includes(n)}function Iu(e=[],t){let n={candidateIds:new Set,engagementIds:new Set([String(t??``)].filter(Boolean))},r=e?.recordMeta;[`_id`,`id`,`workforceEngagementId`,`engagementId`].forEach(e=>{let t=r?.[e];t!=null&&t!==``&&n.engagementIds.add(String(t))}),[`candidateId`,`candidate_id`,`applicantId`].forEach(e=>{let t=r?.[e];t!=null&&t!==``&&n.candidateIds.add(String(t))});for(let t of e??[])for(let e of t.fields??[])[`candidateId`,`candidate_id`,`applicantId`].includes(e?.field)&&e.value&&n.candidateIds.add(String(e.value?.id??e.value?.value??e.value)),[`workforceEngagementId`,`engagementId`].includes(e?.field)&&e.value&&n.engagementIds.add(String(e.value?.id??e.value?.value??e.value));return n}async function Lu(e){let t=Pu(e,`batchName`,`batch_name`,`batch.name`,`batch.title`);if(t)return String(t);let r=String(Pu(e,`batchId`,`batch_id`));if(!r)return``;for(let e of[`batches`,`batch`])try{let t=Pu(Nu(await n.yn(e,500,0)).find(e=>String(Pu(e,`_id`,`id`,`batchId`,`batch_id`))===r),`batchName`,`batch_name`,`name`,`title`);if(t)return String(t)}catch{}return r}async function Ru(e,t,r){let i=String(r??``).trim().toLowerCase();if(![`candidate`,`candidates`,`onboarding`].includes(i))return e;let{candidateIds:a,engagementIds:o}=Iu(e,t);if(!a.size&&!o.size)return e;let s=Nu(await n.yn(`batchCandidates`,1e3,0)).filter(Fu).find(e=>a.has(String(Pu(e,`candidateId`,`candidate_id`)))||o.has(String(Pu(e,`workforceEngagementId`,`engagementId`))));if(!s)return e;let c=await Lu(s);return c?[...e,{id:`candidate-batch-summary`,name:`candidateBatch`,label:`Batch`,order:9999,fields:[{field:`batchName`,label:`Batch Name`,type:`text`,value:c,show:!0,order:1}]}]:e}function zu({icon:e,title:t}){return(0,l.jsxs)(s.Space,{size:10,align:`center`,children:[(0,l.jsx)(`div`,{className:`v1-section-icon-box`,children:e}),(0,l.jsx)(Du,{strong:!0,className:`v1-section-label`,children:t})]})}function Bu({value:e}){let t=String(e??``);return/<[a-z][\s\S]*>/i.test(t)?(0,l.jsx)(`div`,{className:`v1-detail-value`,style:{whiteSpace:`normal`,lineHeight:1.7},dangerouslySetInnerHTML:{__html:t}}):(0,l.jsx)(`div`,{className:`v1-detail-value`,style:{whiteSpace:`pre-wrap`,lineHeight:1.7},children:t})}function Vu({moduleName:e,id:r,refreshKey:i=0,onDescriptionSaved:a}){let[d,f]=(0,o.useState)([]),[p,m]=(0,o.useState)(!!e),[h,g]=(0,o.useState)(``),[_,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(``),[x,S]=(0,o.useState)(!1),[C,w]=(0,o.useState)([]);(0,o.useEffect)(()=>{if(!e||!r){Promise.resolve().then(()=>w([]));return}let t=!1;return n.gn(e,r).then(e=>{t||w(Array.isArray(e)?e:e?.data??[])}).catch(()=>{t||w([])}),()=>{t=!0}},[e,r,i]);let[T,E]=(0,o.useState)(null),[D,O]=(0,o.useState)({}),[k,A]=(0,o.useState)({});(0,o.useEffect)(()=>{if(!e||!r){E(null);return}let n=!1;return t.o(t.x,`/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(r)}`).then(e=>{let t=e?.data?.data??e?.data??[];n||E(Array.isArray(t)?t[0]:null)}).catch(()=>{n||E(null)}),()=>{n=!0}},[e,r,i]),(0,o.useEffect)(()=>{let e=!1;return t.o(t.x,`/module/list?module=users`).then(t=>{let r=t?.data?.data??t?.data??[];e||O(n.ct(r))}).catch(()=>{}),()=>{e=!0}},[]),(0,o.useEffect)(()=>{if(!e)return;let t=!1;async function i(){try{m(!0),g(``);let[i]=await Promise.all([Ln({module:e,id:r,view:`detail`}),n.Bn()]),a=await Ru(Array.isArray(i)?i:[],r,e);t||f(a)}catch(n){console.error(`Failed to fetch ${e} detail fields:`,n),t||g(n?.message||`Failed to fetch detail fields`)}finally{t||m(!1)}}return i(),()=>{t=!0}},[e,r,i]);let j=(0,o.useMemo)(()=>Mu(d),[d]),M=(0,o.useMemo)(()=>{let e=new Set;return d.forEach(t=>{ku(t.appendHistory)&&[t.historyField,...t.historyFields||[]].filter(Boolean).forEach(t=>e.add(t))}),e},[d]);(0,o.useEffect)(()=>{if(!T||!M.size)return;let e=new Set;if(M.forEach(t=>{let n=T[t];Array.isArray(n)&&n.forEach(t=>{let n=t?.updatedBy??t?.changedBy;if(n==null||n===``)return;let r=String(n);!D[r]&&!k[r]&&e.add(r)})}),!e.size)return;let t=!1;return Promise.all([...e].map(e=>n.st(e).then(t=>[e,t]))).then(e=>{let n=Object.fromEntries(e.filter(([,e])=>e));!t&&Object.keys(n).length&&A(e=>({...e,...n}))}).catch(()=>{}),()=>{t=!0}},[T,M,D,k]);let N={proposedRate:`Proposed Rate`,candidateBudget:`Candidate Rate`},P=(e,t,n)=>{let r=`${e}.`,i=t=>[t?.historyField,...t?.historyFields||[]].includes(e);for(let r of t??[]){if(!i(r))continue;let t=r.historyLabels?.[e];if(t)return t;let a=r.historyLabelFrom?.[e];if(a){let t=(r.fields??[]).find(e=>e?.field===a);if(t)return Il(t,n)||N[e]||e}}for(let i of t??[])for(let t of i?.fields??[])if(String(t?.field??``).startsWith(r))return Il(t,n)||N[e]||e;return N[e]||e},F=(e,t)=>{let{amount:r,currency:i,unit:a}=Xl(e,t,d),o=e?.timestamp?.$date??e?.timestamp??e?.updatedAt?.$date??e?.updatedAt??e?.changedAt?.$date??e?.changedAt,s=e?.updatedBy??e?.changedBy,c=r==null||r===``?null:Number(r);return{amount:c!=null&&!Number.isNaN(c)?`${Ql(i)}${iu(c)}`:`—`,unit:eu(a),when:o&&(0,u.default)(o).isValid()?n.An(o):``,by:s==null?``:D[String(s)]||k[String(s)]||``}},I=(0,o.useMemo)(()=>{if(!T)return[];let e=Nl(d),t=[];return M.forEach(n=>{let r=T[n];if(!Array.isArray(r)||r.length===0)return;let i=r.filter(e=>e&&(e.timestamp||e.updatedAt||e.changedAt));i.length!==0&&t.push({key:n,label:P(n,d,e),entries:[...i].reverse().map(e=>F(e,n))})}),t},[T,d,M,D,k]),L=(0,o.useMemo)(()=>{let e=new Set(I.map(e=>e.key));return e.size?j.map(t=>{if(!ku(t.appendHistory))return t;let n=[t.historyField,...t.historyFields||[]].filter(t=>t&&e.has(t));return n.length?{...t,fields:t.fields.filter(e=>!n.some(t=>String(e.field??``).startsWith(`${t}.`)))}:t}).filter(e=>e.fields.length):j},[j,I]),R=(0,o.useMemo)(()=>{let e=new Set(I.map(e=>e.key)),t=d.find(t=>ku(t.appendHistory)&&[t.historyField,...t.historyFields||[]].some(t=>t&&e.has(t)));return t?.label??t?.name??`Rate Details`},[d,I]),z=e===`job`,B=(0,o.useMemo)(()=>z?ju(d):null,[z,d]),V=()=>{v(!1),b(``)},H=async()=>{if(!y.trim()){s.message.warning(`Please enter a job description`);return}S(!0);try{await $c(r,y.trim()),v(!1),b(``),m(!0);let t=await Ln({module:e,id:r,view:`detail`});f(Array.isArray(t)?t:[]),s.message.success(`Description updated and parsed successfully`),a?.()}catch{s.message.error(`Failed to update description`)}finally{S(!1),m(!1)}},U=e=>{let t=Number(e.detailCol);if(Number.isFinite(t)&&t>0)return Math.max(1,Math.min(3,Math.round(t/8)));let n=typeof e.value==`string`?e.value:``;return e.renderType===`document`||e.type===`text-editor`||n.length>120?3:/\s(?:·|-|–|\/)\s/.test(n)&&n.length>=16?2:1},ee=e=>e.renderType===`document`||e.type===`text-editor`||(typeof e.value==`string`?e.value:``).length>60,te=(0,o.useMemo)(()=>Nl(d),[d]),ne=(e,t=``,n=te)=>{let r=e.label??e.field,i=ee(e),a=typeof e.value==`string`?e.value:void 0;return(0,l.jsx)(`div`,{className:`v1-detail-cell${i?` v1-detail-cell--wrap`:``}`,style:{"--v1-cell-span":U(e)},children:(0,l.jsxs)(`div`,{className:`v1-detail-field`,title:!i&&a?`${r}: ${a}`:void 0,children:[(0,l.jsx)(Du,{type:`secondary`,className:`v1-detail-label`,title:r,children:r}),(0,l.jsx)(Eu,{field:e,record:n})]})},`${e.field}${t}`)},re=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}|$)/,ie=(e,t,r=te)=>{if(t==null||typeof t==`object`)return``;let i=String(t).trim();if(!i)return``;if(e?.type===`date`||e?.renderType===`date`||re.test(i)){let t=(0,u.default)(i);if(t.isValid())return t.format(e?.renderOptions?.dateFormat||n.zn().dateFormat)}return(e?.formatter===`phone`||e?.type===`phone`||e?.renderType===`phone`)&&n.zt(e,i,r)||i},ae=(e,t)=>{if(e?.hidePartLabel||e?.renderOptions?.hidePartLabel)return``;let n=String(e?.label??``).trim();if(!n)return``;let r=String(t??``).toLowerCase().split(/[\s/]+/).filter(Boolean),i=n.split(/\s+/),a=0;for(;a<i.length;){let e=i[a].toLowerCase();if(!r.some(t=>t===e||t.startsWith(e)||e.startsWith(t)))break;a+=1}return i.slice(a).join(` `).trim()},W=(e,t,r,i,a=te)=>{let o=e.map(e=>({field:e,cell:r(e)})),s=o.filter(({cell:e})=>ce(e)).map(({cell:e})=>({...e,renderType:`document`})).filter(e=>Dl(e.value)),c=new Set;o.forEach(({field:e})=>{if(e?.formatter!==`phone`&&e?.type!==`phone`&&e?.renderType!==`phone`)return;let t=[e?.renderOptions?.countryCodeField??e?.countryCodeField,...n.Rt(e)].filter(Boolean);o.forEach(({field:n})=>{n!==e&&t.includes(n.field)&&c.add(n.field)})});let u=typeof t.combineLabel==`string`&&t.combineLabel.trim()?t.combineLabel:t.label??t.field,d=o.filter(({cell:e})=>!ce(e)).filter(({field:e})=>!c.has(e.field)).filter(({cell:e})=>!jl(e,e.value)).map(({field:e,cell:t})=>({key:e.field,label:ae(e,u),text:ie(e,t.value,a)})).filter(e=>e.text!==``);if(!d.length&&!s.length&&jl(t,void 0))return null;let f=d.map(e=>`${e.label?`${e.label} `:``}${e.text}`).join(` · `),p=U({detailCol:t.detailCol,value:f}),m=s.length?Math.max(p,2):p;return(0,l.jsx)(`div`,{className:`v1-detail-cell v1-detail-cell--wrap`,style:{"--v1-cell-span":m},children:(0,l.jsxs)(`div`,{className:`v1-detail-field`,children:[(0,l.jsx)(Du,{type:`secondary`,className:`v1-detail-label`,title:u,children:u}),(d.length>0||s.length===0)&&(0,l.jsx)(`div`,{className:`v1-detail-value v1-detail-parts`,children:d.length?d.map((e,t)=>(0,l.jsxs)(`span`,{className:`v1-detail-part`,children:[t>0&&(0,l.jsx)(`span`,{className:`v1-detail-part-sep`,"aria-hidden":`true`,children:`·`}),e.label&&(0,l.jsx)(`span`,{className:`v1-detail-part-label`,children:e.label}),(0,l.jsx)(`span`,{children:e.text})]},`${e.key}-part`)):`—`}),s.map(e=>(0,l.jsx)(Eu,{field:e},`${e.field}-doc`))]})},`${t.field}-merged${i}`)},oe=(e,t,n=``,r=te)=>{let i=new Set,a=[];return e.forEach(o=>{let s=o.combineKey?.trim?.();if(s){if(i.has(s))return;i.add(s);let o=e.filter(e=>e.combineKey?.trim?.()===s);if(o.length>1){let e=o.find(e=>e.combineLabel)??o[0],i=W(o,e,t,n,r);i&&a.push(i);return}}let c=t(o);jl(c,c.value)||a.push(ne(c,n,r))}),a},se=(0,o.useMemo)(()=>{let e={};for(let t of C){let n=t.fieldName||t.field||`file`;(e[n]??=[]).push({location:t.s3Key??t.location??t.uniqueName??``,name:t.fileName??t.name??``,fileUrl:t.fileUrl??t.url??``})}return e},[C]),ce=e=>e.type===`file`||e.type===`document`||e.renderType===`document`,le=e=>se[e.field]||e.fileKey&&se[e.fileKey]||null,ue=e=>String(e?.name||e?.location||``).trim().toLowerCase(),de=e=>{let[t]=n.Lt(e);return!t||!t.location&&!t.url?null:ue(t)},fe=(e,t=[])=>{let n=new Set,r=[],i=e=>{if(e==null||e===``)return;let t=de(e);t!==null&&(t&&n.has(t)||(t&&n.add(t),r.push(e)))};return t.forEach(i),(Array.isArray(e)?e:[e]).forEach(i),r},pe=e=>n.Lt(e).map(ue).filter(Boolean),me=e=>{let t=(e.validations??[]).find(e=>e?.type===`maxFiles`);return t?Math.max(1,Number(t.value??1)):ku(e.multiple)?Math.max(1,Number(e.maxCount??5)):Math.max(1,Number(e.maxCount??1))},he=(e,t,n)=>{let r=me(e);if(t.length<=r)return t;let[i]=pe(n);return(i?[...t].sort((e,t)=>Number(de(t)===i)-Number(de(e)===i)):t).slice(0,r)},ge=(e,t)=>{if(e.type===`file`||e.type===`document`)return{...e,renderType:`document`,value:t};let r=[e.field,e.payloadKey].filter(Boolean).map(e=>n.Xt(t,e)).find(e=>e!=null);return{...e,value:r}},_e=e=>{if(!ce(e))return e;let t=he(e,fe(e.value,le(e)??[]),e.value);return t.length?{...e,renderType:`document`,value:t}:e},G=(e,t,n)=>{let r=e.name??e.id??String(t),i=Array.isArray(e.rows)?e.rows:[],a=new Set(i.flatMap(e=>pe(e))),o=[],c=new Set;return n.filter(ce).forEach(e=>{(le(e)??[]).forEach(e=>{let t=ue(e);!t||a.has(t)||c.has(t)||(c.add(t),o.push(e))})}),(0,l.jsxs)(s.Card,{size:`small`,className:`v1-card v1-detail-card`,title:(0,l.jsx)(zu,{icon:Ou[t%Ou.length],title:e.label??e.name??`Details`}),children:[i.length===0&&o.length===0?(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:uu(e)}):i.map((t,r)=>(0,l.jsxs)(`div`,{className:`v1-detail-addrow-item`,children:[i.length>1&&(0,l.jsxs)(Du,{strong:!0,className:`v1-detail-addrow-index`,children:[e.label??`Record`,` `,r+1]}),(0,l.jsx)(`div`,{className:`v1-detail-grid`,children:oe(n,e=>ge(e,t),`-${r}`,t)})]},r)),o.length>0&&(0,l.jsx)(`div`,{className:`v1-detail-addrow-item`,children:(0,l.jsx)(`div`,{className:`v1-detail-grid`,children:ne({field:`${r}-files`,label:`Uploaded Files`,renderType:`document`,detailCol:24,value:o})})})]},r)},K=(e,t)=>{let n=e.name??e.id??String(t),r=B?e.fields.filter(e=>e.field!==B.key):e.fields;return r.length?e.addRow?G(e,t,r):(0,l.jsx)(s.Card,{size:`small`,className:`v1-card v1-detail-card`,title:(0,l.jsx)(zu,{icon:Ou[t%Ou.length],title:e.label??e.name??`Details`}),children:(0,l.jsx)(`div`,{className:`v1-detail-grid`,children:oe(r,_e)})},n):null},ve=()=>(0,l.jsx)(s.Card,{size:`small`,className:`v1-card v1-detail-card`,title:(0,l.jsx)(zu,{icon:(0,l.jsx)(c.HistoryOutlined,{}),title:R}),children:I.map((e,t)=>(0,l.jsxs)(`div`,{className:`v1-rh-section${t>0?` v1-rh-section--gap`:``}`,children:[(0,l.jsx)(`div`,{className:`v1-rh-section-title`,children:e.label}),(0,l.jsx)(`div`,{className:`v1-rate-history`,children:e.entries.map((e,t)=>(0,l.jsxs)(`div`,{className:`v1-rh-item${t===0?` v1-rh-latest`:``}`,children:[(0,l.jsx)(`span`,{className:`v1-rh-amount`,children:e.amount}),e.unit&&(0,l.jsxs)(`span`,{className:`v1-rh-unit`,children:[`/ `,e.unit]}),e.by&&(0,l.jsxs)(`span`,{className:`v1-rh-chip`,children:[(0,l.jsx)(c.UserOutlined,{}),` `,e.by]}),e.when&&(0,l.jsxs)(`span`,{className:`v1-rh-chip`,children:[(0,l.jsx)(c.ClockCircleOutlined,{}),` `,e.when]}),t===0&&(0,l.jsx)(`span`,{className:`v1-rh-badge`,children:`Latest`})]},t))})]},e.key))},`rate-details-history`),ye=(0,o.useMemo)(()=>{let e=d.find(e=>ku(e.appendHistory)&&e.historyAfterGroup);return String(e?.historyAfterGroup??``).trim().toLowerCase()},[d]),be=e=>ye?String(e.name??``).trim().toLowerCase()===ye:/current_employer|employer_details/i.test(e.name||``)||(e.fields||[]).some(e=>e.field===`employerId`);return(0,l.jsx)(s.Spin,{spinning:p,tip:`Loading detail fields...`,children:(0,l.jsxs)(`div`,{className:`v1-detail-left`,children:[h&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:`Unable to load detail fields`,description:h,className:`v1-detail-alert`}),!p&&!h&&L.length===0&&I.length===0&&(0,l.jsx)(s.Empty,{description:`No detail fields are configured.`}),L.flatMap((e,t)=>{let n=[K(e,t)];return be(e)&&I.length>0&&n.push(ve()),n}),I.length>0&&!L.some(be)&&ve(),z&&B?.value&&(0,l.jsx)(s.Card,{size:`small`,className:`v1-card v1-detail-card`,title:(0,l.jsx)(zu,{icon:(0,l.jsx)(c.FileTextOutlined,{}),title:`Description`}),children:_?(0,l.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,l.jsx)(`div`,{style:{background:`#ffffff`,border:`1px solid #d6e4f0`,borderRadius:8,padding:`4px`,boxShadow:`0 2px 8px rgba(0,0,0,0.04)`},children:(0,l.jsx)(s.Input.TextArea,{rows:10,value:y,onChange:e=>b(e.target.value),placeholder:B.hidePlaceholder?void 0:B.placeholder,style:{fontSize:13,lineHeight:1.65,border:`none`,boxShadow:`none`,resize:`vertical`,padding:`12px 14px`}})}),(0,l.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,l.jsx)(n.lt,{variant:`primary`,size:`small`,loading:x,onClick:H,children:`Save & Parse`}),(0,l.jsx)(n.lt,{size:`small`,onClick:V,children:`Cancel`})]})]}):(0,l.jsx)(Bu,{value:B.value})})]})})}var Hu=e.t({buildJobHeaderData:()=>Xu,default:()=>Uu,jobConfig:()=>Uu}),Uu={module:`job`,tabs:[{key:`details`,label:`Details`},{key:`candidates`,label:`Candidates`}],tabContent:{details:{render:({id:e,refreshKey:t,onDescriptionSaved:n})=>o.default.createElement(s.Row,{gutter:[16,16],align:`stretch`},o.default.createElement(s.Col,{key:`main`,xs:24,lg:16},o.default.createElement(Vu,{moduleName:`job`,id:e,refreshKey:t,onDescriptionSaved:n})),o.default.createElement(s.Col,{key:`side`,xs:24,lg:8},o.default.createElement(Mc,{moduleName:`job`,id:e})))}},header:{title:`jobTitle`,eyebrow:({val:e})=>{let t=[];return ul(Gu(e))&&t.push(pl(Gu(e))),ul(Ku(e))&&t.push(`MSP Id ${pl(Ku(e))}`),t.length?t.join(` - `):ul(e(`jobReferenceId`))?String(e(`jobReferenceId`)):``},clientName:({val:e})=>Gu(e),titleIds:[],status:{field:`jobStatus`},ids:[{label:`Zinnext Job ID`,field:`jobReferenceId`},{label:`Client Rate`,compute:Ju}],meta:[{icon:`location`,field:`jobLocation`},{icon:`experience`,compute:qu},{icon:`employment`,fields:[`employmentType`,`jobRemoteStatus`],join:` · `}],stats:[{label:`Target submissions`,field:[`targetSubmission`,`targetSubmissions`]},{label:`In Pipeline`,compute:Yu,always:!0}],timestamp:{label:`Created Date`,field:[`createdAt`,`jobCreatedDateTime`,`createdDate`]}}},Wu=(e,...t)=>t.map(t=>e(t)).find(ul),Gu=e=>Wu(e,`clientName`,`client.name`,`client`,`clientId`,`accountName`),Ku=e=>Wu(e,`mspReqId`,`mspreqId`,`msReqId`,`mspId`,`mspRequirementId`);function qu({val:e}){let t=e(`experience.experienceRequiredFrom`);if(!ul(t))return``;let n=e(`experience.experienceRequiredTo`);return`${t}${ul(n)?` - ${n}`:``} years`}function Ju({val:e}){let t=e(`jobPayDetails`)??{},n=t.clientBudgetStart??Wu(e,`clientBudgetStart`,`clientRateStart`);return ul(n)?gl({start:n,end:t.clientBudgetEnd??Wu(e,`clientBudgetEnd`,`clientRateEnd`),sym:t.clientBudgetCurrencySymbol??ml(t.clientBudgetCurrency)??``,unit:t.clientBudgetUnit??Wu(e,`clientBudgetUnit`)}):``}function Yu({val:e}){let t=e(`submissions`),n=Wu(e,`pipelineCount`,`PipelineCount`,`inPipeline`,`inPipelineCount`)??(Array.isArray(t)?t.length:void 0);return ul(n)?n:0}function Xu({val:e,has:t}){let n,r=[];t(e(`jobReferenceId`))&&(n=String(e(`jobReferenceId`)));let i=[e(`jobTitle`)].filter(t).map(pl).join(` `)||`-`,a=null;if(t(e(`jobSource`))&&(a={label:dl(e(`jobSource`)),color:`#10b981`,textColor:`#ffffff`}),t(e(`jobLocation`))&&r.push({icon:`location`,text:pl(e(`jobLocation`))}),t(e(`experience.experienceRequiredFrom`))){let n=e(`experience.experienceRequiredFrom`),i=e(`experience.experienceRequiredTo`);r.push({icon:`experience`,text:`${n}${t(i)?` - ${i}`:``} years`})}let o=[e(`employmentType`),pl(e(`jobRemoteStatus`))].filter(t).join(` - `);o&&r.push({icon:`employment`,text:o});let s=t(e(`clientId`))?fl(e(`clientId`)):null;return{eyebrow:n,title:i,status:a,meta:r,clientId:s}}var Zu=e.t({default:()=>Qu,payrollConfig:()=>Qu}),Qu={module:`payroll`,tabs:[],header:{variant:`finance`,title:`candidateName`,eyebrow:`designation`,statusField:`payroll.status`,chips:al}},$u=e.t({default:()=>ed,submissionConfig:()=>ed}),ed={module:`submission`,tabs:[],header:{title:[`firstName`,`lastName`],eyebrow:({val:e,has:t})=>[td(e),e(`jobTitle`)].filter(t).map(pl).join(` - `),clientName:({val:e})=>td(e),status:({val:e,has:t})=>{let n=e(`internalSubmissionStatus`)??{},r=n.internalSubmissionStatusText;return t(r)?{label:dl(r),color:{positive:`success`,negative:`error`,neutral:`default`}[n.internalSubmissionStatusType]??_l(r)}:null},ids:[{label:`Submission ID`,field:[`submissionId`,`clientSubmissionId`]},{label:`MS Req ID`,field:[`mspReqId`,`mspreqId`]},{label:`Client Req ID`,field:[`jobClientRefrenceId`,`jobClientReferenceId`,`clientJobReferenceId`]},{label:`Job ID`,field:[`jobRefrenceId`,`jobReferenceId`]}],meta:[{icon:`location`,field:`jobLocation`},{icon:`experience`,field:[`relevantExperienceYears`,`workExperienceYears`],suffix:` yrs`},{icon:`employment`,field:`workAuthorisation`},{icon:`rate`,prefix:`Client rate: `,compute:nd},{icon:`rate`,prefix:`Candidate rate: `,compute:rd}],timestamp:{label:`Created Date`,field:[`submittedAt`,`createdAt`,`createdDate`]}}},td=e=>e(`clientName`)??e(`client.name`);function nd({val:e}){let t=e(`clientBudget`)??e(`candidateBudget`)??{};return gl({start:t.clientBudgetStart??t.candidateBudgetStart,end:t.clientBudgetEnd??t.candidateBudgetEnd,sym:t.clientBudgetCurrencySymbol??t.candidateBudgetCurrencySymbol??ml(t.clientBudgetCurrency??t.candidateBudgetCurrency),unit:t.clientBudgetUnit??t.candidateBudgetUnit??`Hour`})}function rd({val:e}){let t=e(`candidateRate`)??{},n=e(`proposedRate`)??{};return gl({start:t.candidateAcceptedRate,sym:t.candidateAcceptedCurrencySymbol??ml(t.candidateAcceptedCurrency),unit:t.candidateAcceptedPayUnit??`Hour`})||gl({start:n.candidateProposedRate,sym:n.candidateProposedRateCurrencySymbol??ml(n.candidateProposedRateCurrency),unit:n.candidateProposedRateUnit??`Hour`})}var id=e.t({default:()=>ad,submissionJobConfig:()=>ad}),ad={module:`submissionJob`,tabs:[],buildData:Xu};function od(e,t){let n=Array.isArray(t)?t:[t];for(let t of n)if(ul(e(t)))return e(t)}function sd(e,t,n=` `){return t.map(t=>e(t)).filter(ul).map(pl).join(n)}function cd(e,t){let{val:n}=e,r;if(typeof t.compute==`function`)r=t.compute(e);else if(t.join)r=sd(n,t.fields??[],t.join);else{let e=od(n,t.field);r=ul(e)?pl(e):``}return ul(r)?`${t.prefix??``}${pl(r)}${t.suffix??``}`:``}function ld(e){return typeof e==`function`?{compute:e}:typeof e==`string`||Array.isArray(e)?{field:e}:e}function ud(e={},t){let{val:n}=t,r={};if(e.title!==void 0&&(r.title=sd(n,Array.isArray(e.title)?e.title:[e.title])||`-`),e.eyebrow!==void 0&&(r.eyebrow=cd(t,ld(e.eyebrow))||void 0),e.clientName!==void 0&&(r.clientName=cd(t,ld(e.clientName))||void 0),e.status!==void 0){if(typeof e.status==`function`)r.status=e.status(t)??null;else{let t=od(n,e.status.field);r.status=ul(t)?{label:dl(t),color:_l(t)}:null}}let i=(e=[])=>e.map(e=>{let r=typeof e.compute==`function`?e.compute(t):pl(od(n,e.field)??``);return{label:e.label,value:r}}).filter(e=>ul(e.value));if(e.ids!==void 0&&(r.ids=i(e.ids)),e.titleIds!==void 0&&(r.titleIds=i(e.titleIds)),e.meta!==void 0&&(r.meta=e.meta.map(e=>({icon:e.icon,text:cd(t,e)})).filter(e=>ul(e.text))),e.stats!==void 0&&(r.stats=e.stats.map(e=>{let r=typeof e.compute==`function`?e.compute(t):od(n,e.field),i=ul(r)?pl(r):e.always?pl(e.fallback??0):void 0;return{label:e.label,value:i}}).filter(e=>e.value!==void 0)),e.timestamp!==void 0){let t=hl(od(n,e.timestamp.field));r.timestamp=ul(t)?{label:e.timestamp.label,value:t}:null}return r}var dd=Object.assign({"./modules/billingConfig.js":ol,"./modules/candidateConfig.js":vl,"./modules/employerConfig.js":Sl,"./modules/jobConfig.js":Hu,"./modules/payrollConfig.js":Zu,"./modules/submissionConfig.js":$u,"./modules/submissionJobConfig.js":id}),fd={};Object.values(dd).forEach(e=>{let t=e.default??Object.values(e)[0];t?.module&&(fd[t.module]=t)});var pd={job:`job`,jobs:`job`,candidate:`candidate`,candidates:`candidate`,applicant:`candidate`,applicants:`candidate`,submission:`submission`,submissions:`submission`,vendor:`vendor`,vendors:`vendor`,onboarding:`onboarding`,employer:`employer`,employers:`employer`};function md(){let e=(typeof window<`u`&&window.__CORE_THEME_CONFIG__?.detailConfig)??{};return Object.keys(e).length?{...fd,...e}:fd}function hd(e=``,t=fd){let n=String(e).trim();if(t[n])return n;let r=n.toLowerCase();if(t[r])return r;let i=pd[r];if(i&&t[i])return i;let a=r.endsWith(`s`)?r.slice(0,-1):`${r}s`;return t[a]?a:i??r}function gd(e=[]){let t=new Map;return e.forEach(e=>{(e.fields??[]).forEach(e=>{t.has(e.field)||t.set(e.field,e)})}),t}function _d(e,t){for(let n of t)if(n.includes(`+`)){let t=n.split(`+`).map(t=>e(t)).filter(ul).map(pl).join(` `);if(t)return t}else if(ul(e(n)))return e(n)}function vd({val:e}){let t=_d(e,[`jobTitle`,`firstName+lastName`,`name`,`fullName`,`title`,`clientName`,`vendorCompanyName`,`companyName`])||`-`,n=_d(e,[`clientName`,`source`,`designation`,`jobReferenceId`,`applicantRefrenceId`]),r=ul(n)?pl(n):void 0,i=_d(e,[`status`,`jobStatus`,`submissionStatus`,`stage`]),a=ul(i)?{label:dl(i),color:_l(i)}:null,o=[];[[`Reference ID`,[`jobReferenceId`,`applicantRefrenceId`,`submissionId`,`referenceId`,`refId`]],[`Client Req ID`,[`clientJobReferenceId`,`jobClientRefrenceId`,`clientReqId`]],[`MS Req ID`,[`mspreqId`,`mspReqId`]]].forEach(([t,n])=>{let r=_d(e,n);ul(r)&&o.push({label:t,value:pl(r)})});let s=[],c=_d(e,[`jobLocation`,`currentLocation`,`location`]);ul(c)&&s.push({icon:`location`,text:pl(c)});let l=_d(e,[`designation`]);ul(l)&&s.push({icon:`designation`,text:pl(l)});let u=hl(_d(e,[`createdAt`,`submittedAt`,`createdDate`]));return{eyebrow:r,title:t,status:a,ids:o,meta:s,timestamp:ul(u)?{label:`Created Date`,value:u}:null}}function yd(e){let t=md();return t[hd(e,t)]??null}function bd(e,t=[],{aux:n}={}){if(!t.length)return null;let r=md(),i=r[hd(e,r)],a=gd(t),o=e=>{let n=a.get(e);return n?ll(n.value)&&[`status`,`jobStatus`,`submissionStatus`].includes(e)&&!ll(n.defaultValue)?n.defaultValue:n.value:t.recordMeta?.[e]},s=e=>a.get(e)??null,c=typeof n==`function`?n:()=>()=>void 0,l=vd({val:o,has:ul}),u=i?.buildData?i.buildData({val:o,has:ul,field:s,aux:c})??{}:i?.header?ud(i.header,{val:o,has:ul,field:s,aux:c}):{},d=(e,t)=>Array.isArray(e)?e:t??[],f=u.status===!1?null:u.status??l.status??null;return{eyebrow:u.eyebrow??l.eyebrow,title:u.title??l.title??`-`,clientName:u.clientName??null,clientId:u.clientId??null,status:f,titleIds:d(u.titleIds,l.titleIds),meta:d(u.meta,l.meta),ids:d(u.ids,l.ids),stats:u.stats??[],timestamp:u.timestamp??l.timestamp??null,tabs:i?.tabs??[]}}var xd=e=>e==null||e===``,Sd={positive:`success`,success:`success`,negative:`error`,error:`error`,warning:`warning`,info:`processing`,neutral:`default`,default:`default`};function Cd(e){return e?(Array.isArray(e)?e:[e]).filter(e=>e?.field&&e?.label):[]}function wd(e,t){let r=typeof t==`function`?t:()=>void 0;for(let t of Cd(e?.labelWhen)){let e=r(t.field);if(e!==void 0&&n.i(t,e))return t.label}return e?.label??``}function Td(e){let t=e?.valueStyles;if(!Array.isArray(t)||!t.length)return null;let n=String(e?.value??e?.text??``).trim().toLowerCase();if(!n)return null;let r=t.find(e=>String(e?.value??``).trim().toLowerCase()===n||String(e?.label??``).trim().toLowerCase()===n);return r?{color:r.color||void 0,bg:r.bg??r.background??r.backgroundColor??void 0}:null}function Ed(e,t){let n=wd(e,t),r=e?.value,i=xd(e?.text)?[n,xd(r)?``:String(r)].filter(Boolean).join(n&&!xd(r)?`: `:``):String(e.text),a=e?.variant===`pill`?`pill`:`text`;if(a!==`pill`)return{icon:e?.icon,text:i,variant:a};let o=Td(e);return{icon:e?.icon,text:i,label:n,value:xd(r)?``:String(r),variant:a,tagColor:o?.color||o?.bg?void 0:Sd[e?.tone]??`default`,tagStyle:o?.color||o?.bg?{color:o.color,backgroundColor:o.bg,borderColor:o.bg??o.color}:void 0}}function Dd(e){return!e||typeof e!=`object`?[]:Object.entries(e).map(([e,t])=>{if(!t||typeof t!=`object`)return null;let n=String(t.module??``).trim(),r=t.id==null?``:String(t.id).trim();return!e||!n||!r?null:{key:String(e),module:n,id:r}}).filter(Boolean)}function Od(e){return Dd(e).map(({key:e,module:t,id:n})=>`${e}:${t}:${n}`).sort().join(`|`)}function kd(e){let t=new Map;for(let n of e??[])for(let e of n?.fields??[])e?.field!=null&&!t.has(e.field)&&t.set(e.field,e.value);return e=>t.get(e)}function Ad(e){let t=new Map;for(let[n,r]of Object.entries(e??{}))t.set(n,kd(r));let n=()=>void 0;return e=>t.get(e)??n}var jd=e=>{let t=Number(e);return Number.isFinite(t)?t:0};function Md(e,t=`$`){let n=ru(e);return au(Number.isNaN(n)?0:n,Ql(t),{decimals:2})}function Nd(e){return`${jd(e).toFixed(2)} hrs`}function Pd(e,t=`$`,n=`hr`){let r=nu(n,``),i=Md(e,t);return r?`${i}/${r}`:i}function Fd(e){return`${parseFloat(jd(e).toFixed(2))}%`}function Id(e){let t=String(e??``).trim().split(/\s+/).filter(Boolean);return t.length?t.slice(0,2).map(e=>e[0].toUpperCase()).join(``):`·`}var Ld={TIMESHEET_APPROVED:{label:`Timesheet Approved`,icon:`check`,tone:`success`},BILLING_READY:{label:`Ready for Billing`,icon:`file`,tone:`info`},BILLING_INVOICED:{label:`Invoice Generated`,icon:`file`,tone:`info`},BILLING_PAID:{label:`Client Payment Received`,icon:`dollar`,tone:`success`},PAYROLL_PROCESSING:{label:`Payroll Processing Started`,icon:`sync`,tone:`warning`},PAYROLL_PAID:{label:`Payroll Disbursed`,icon:`dollar`,tone:`success`},PAYSLIP_GENERATED:{label:`Payslip Generated`,icon:`file`,tone:`info`}};function Rd(e){return Ld[e]||{label:String(e??``).toLowerCase().split(`_`).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1)).join(` `)||`Activity`,icon:`file`,tone:`neutral`}}function zd(e){return(Array.isArray(e)?e:[]).find(e=>e?.event===`TIMESHEET_APPROVED`)?.at??null}var Bd=e=>({enabled:!0,variant:e,disabledReason:null}),Vd=e=>({enabled:!1,variant:`default`,disabledReason:e}),Hd=[`PaymentNotReceived`,`Invoiced`,`Paid`],Ud=[`Ready`,`Processing`,`Paid`];function Wd(e){switch(e){case`PaymentNotReceived`:return{generateInvoice:Bd(`primary`),recordPayment:Vd(`Generate the invoice first`),markPaid:Vd(`Generate the invoice first`)};case`Invoiced`:return{generateInvoice:Vd(`Invoice already generated`),recordPayment:Bd(`primary`),markPaid:Bd(`default`)};case`Partially Received`:return{generateInvoice:Vd(`Invoice already generated`),recordPayment:Bd(`primary`),markPaid:Bd(`default`)};case`Received`:case`Paid`:return{generateInvoice:Vd(`Payment already received`),recordPayment:Vd(`Payment already received`),markPaid:Vd(`Payment already received`)};default:return{generateInvoice:Vd(`Unavailable in the current status`),recordPayment:Vd(`Unavailable in the current status`),markPaid:Vd(`Unavailable in the current status`)}}}function Gd(e){switch(e){case`Ready`:return{process:Bd(`primary`),generatePayslip:Vd(`Mark the payroll paid first`),markPaid:Vd(`Process the payroll first`)};case`Processing`:return{process:Vd(`Payroll is already processing`),generatePayslip:Vd(`Mark the payroll paid first`),markPaid:Bd(`primary`)};case`Paid`:return{process:Vd(`Payroll already paid`),generatePayslip:Bd(`primary`),markPaid:Vd(`Payroll already paid`)};default:return{process:Vd(`Unavailable in the current status`),generatePayslip:Vd(`Unavailable in the current status`),markPaid:Vd(`Unavailable in the current status`)}}}function Kd(e,t){if(e===`billing`){let e=Math.max(Hd.indexOf(t),0);return[{key:`approved`,label:`Timesheet Approved`,state:`done`},{key:`invoiced`,label:`Invoice Raised`,state:e>=1?`done`:`current`},{key:`paid`,label:`Payment Received`,state:e>=2?`done`:e===1?`current`:`pending`}]}let n=Math.max(Ud.indexOf(t),0);return[{key:`approved`,label:`Timesheet Approved`,state:`done`},{key:`processing`,label:`Processing`,state:n>=1?`done`:`current`},{key:`paid`,label:`Paid`,state:n>=2?`done`:n===1?`current`:`pending`}]}var qd=e=>jd(e?.leave?.CL)+jd(e?.leave?.SL),Jd=e=>jd(e?.workingHours?.ST),Yd=e=>jd(e?.workingHours?.OT);function Xd(e){let t=Array.isArray(e)?e:[],n={loggedDays:0,approvedDays:0,rejectedDays:0,pendingDays:0,leaveDays:0,holidayDays:0,weekOffDays:0,stHours:0,otHours:0,leaveHours:0,totalHours:0,avgHoursPerLoggedDay:0};return t.forEach(e=>{let t=Jd(e),r=Yd(e),i=qd(e);(e?.isLogged||t>0||r>0)&&(n.loggedDays+=1,e?.status===`approved`?n.approvedDays+=1:e?.status===`rejected`?n.rejectedDays+=1:n.pendingDays+=1),i>0&&(n.leaveDays+=1),e?.isHoliday&&(n.holidayDays+=1),e?.isWeekOff&&(n.weekOffDays+=1),n.stHours+=t,n.otHours+=r,n.leaveHours+=i,n.totalHours+=t+r}),n.avgHoursPerLoggedDay=n.loggedDays?n.totalHours/n.loggedDays:0,n}function Zd(e,t){return(Array.isArray(e)?e:[]).filter(e=>!!e?.isLogged||Jd(e)>0||Yd(e)>0||qd(e)>0||e?.isHoliday).map(e=>{let n=Jd(e),r=Yd(e),i=n+r;return{key:e.date,date:e.date,day:e.day||``,st:n,ot:r,leave:qd(e),isHoliday:!!e?.isHoliday,total:i,amount:i*jd(t),status:e?.status||`logged`,reviewer:e?.reviewedByName||``,remarks:e?.rejectionReason||e?.notes||``}})}function Qd(e){let[t,n,r]=String(e??``).split(`-`).map(Number);return!t||!n||!r?null:new Date(t,n-1,r)}var $d=e=>e.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`});function ef(e,t){let n=Array.isArray(e)?e:[],r=new Map;return n.forEach(e=>{let n=Qd(e?.date);if(!n)return;let i=Jd(e),a=Yd(e),o=qd(e);if(!e?.isLogged&&i<=0&&a<=0&&o<=0)return;let s=(n.getDay()+6)%7,c=new Date(n.getFullYear(),n.getMonth(),n.getDate()-s),l=c.getTime();if(!r.has(l)){let e=new Date(c.getFullYear(),c.getMonth(),c.getDate()+6);r.set(l,{weekStart:c,weekEnd:e,label:`${$d(c)} – ${$d(e)}`,st:0,ot:0,leaveHours:0,total:0,amount:0,days:0})}let u=r.get(l);u.st+=i,u.ot+=a,u.leaveHours+=o,u.total+=i+a,u.amount+=(i+a)*jd(t),(e?.isLogged||i>0||a>0)&&(u.days+=1)}),[...r.values()].sort((e,t)=>e.weekStart-t.weekStart)}function tf(e,{high:t=25,low:n=10}={}){let r=jd(e);return r>=t?`high`:r<n?`low`:`mid`}function nf(e){let t=e==null?``:String(e);return/[",\n\r]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t}function rf(e,t){return[t.map(e=>nf(e.label)).join(`,`),...(e??[]).map(e=>t.map(t=>nf(t.format?t.format(e[t.key],e):e[t.key])).join(`,`))].join(`\r
3
3
  `)}function af(e){let t=new Map;return(Array.isArray(e)?e:[]).forEach(e=>{let n=e?.field??e?.key??e?.value;n&&t.set(n,e)}),t}function of(e,t,n){return(e instanceof Map?e:af(e)).get(t)?.label||n}function sf(e,t,n){let r=(e instanceof Map?e:af(e)).get(t)?.valueStyles;if(!Array.isArray(r)||!r.length||n==null)return null;let i=String(n).toLowerCase(),a=r.find(e=>String(e.value??``).toLowerCase()===i||String(e.label??``).toLowerCase()===i);return a?{color:a.color,bg:a.bg??a.background??a.backgroundColor,label:a.label}:null}function cf(e,t){let n=new Blob([``,t],{type:`text/csv;charset=utf-8;`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}var lf={Draft:{label:`Draft`,tone:`neutral`},Ready:{label:`Ready`,tone:`gold`},Invoiced:{label:`Invoiced`,tone:`info`},Processing:{label:`Processing`,tone:`info`,pulse:!0},Paid:{label:`Paid`,tone:`success`},Overdue:{label:`Overdue`,tone:`danger`},PaymentNotReceived:{label:`Not Received`,tone:`warning`,full:`Payment Not Received`},"Partially Received":{label:`Partially Received`,tone:`gold`},Received:{label:`Received`,tone:`success`},"Ready to Pay":{label:`Ready to Pay`,tone:`info`,pulse:!0},PartiallyPaid:{label:`Partially Paid`,tone:`gold`},approved:{label:`Approved`,tone:`success`},rejected:{label:`Rejected`,tone:`danger`},logged:{label:`Pending`,tone:`gold`}};function uf({status:e=`Ready`,size:t,styleOverride:n}){let r=lf[e]??{label:String(e),tone:`neutral`},i=n?.label??r.label,a=n?{color:n.color,background:n.bg,borderColor:n.color}:void 0,o=(0,l.jsxs)(`span`,{className:`fin-pill${n?``:` fin-pill--${r.tone}`}${t===`sm`?` fin-pill--sm`:``}`,style:a,children:[(0,l.jsx)(`span`,{className:`fin-pill__dot${r.pulse?` fin-pill__dot--pulse`:``}`}),i]});return r.full?(0,l.jsx)(s.Tooltip,{title:r.full,children:o}):o}function df({items:e=[],loading:t=!1,compact:n=!1}){let r=`finance-kpi-row${n?` finance-kpi-row--compact`:``}`;if(t){let t=e.length||4;return(0,l.jsx)(`div`,{className:r,children:Array.from({length:t},(e,t)=>(0,l.jsxs)(`div`,{className:`finance-kpi fin-kpi--skeleton`,children:[(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--label`}),(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--value`})]},t))})}return(0,l.jsx)(`div`,{className:r,children:e.map(e=>(0,l.jsxs)(`div`,{className:`finance-kpi fin-kpi--${e.tone??`neutral`}`,children:[e.icon?(0,l.jsx)(`span`,{className:`fin-kpi__icon`,children:e.icon}):null,(0,l.jsxs)(`span`,{className:`fin-kpi__body`,children:[(0,l.jsx)(`span`,{className:`finance-kpi__label`,children:e.label}),(0,l.jsx)(`strong`,{className:`finance-kpi__value`,children:e.value}),e.sub??e.hint?(0,l.jsx)(`span`,{className:`finance-kpi__hint`,children:e.sub??e.hint}):null]})]},e.key??e.label))})}function ff({days:e=[]}){return(0,l.jsx)(`div`,{className:`finance-hours-grid`,children:e.map(e=>(0,l.jsxs)(`div`,{className:`finance-hours-grid__day`,children:[(0,l.jsx)(`span`,{children:e.date}),(0,l.jsx)(`strong`,{children:Number(e?.workingHours?.ST??0)+Number(e?.workingHours?.OT??0)})]},e.date))})}function pf({icon:e,title:t,description:n,action:r,compact:i=!1}){return(0,l.jsxs)(`div`,{className:`fin-empty${i?` fin-empty--compact`:``}`,children:[(0,l.jsx)(`span`,{className:`fin-empty__icon`,children:e??(0,l.jsx)(c.InboxOutlined,{})}),(0,l.jsx)(`strong`,{className:`fin-empty__title`,children:t}),n?(0,l.jsx)(`span`,{className:`fin-empty__desc`,children:n}):null,r?(0,l.jsx)(`span`,{className:`fin-empty__action`,children:r}):null]})}function mf({title:e,extra:t,children:n,empty:r,className:i=``,span:a}){return(0,l.jsxs)(`section`,{className:`fin-section${a?` fin-section--span`:``}${i?` ${i}`:``}`,children:[e?(0,l.jsxs)(`header`,{className:`fin-section__head`,children:[(0,l.jsx)(`h4`,{className:`fin-section__title`,children:e}),t?(0,l.jsx)(`span`,{className:`fin-section__extra`,children:t}):null]}):null,(0,l.jsx)(`div`,{className:`fin-section__body`,children:r?(0,l.jsx)(pf,{compact:!0,...r}):n})]})}function hf({label:e,value:t,hint:n,strong:r,accent:i,negative:a}){let o=[`fin-line`,r?`fin-line--strong`:``,i?`fin-line--accent`:``,a?`fin-line--negative`:``].filter(Boolean).join(` `);return(0,l.jsxs)(`div`,{className:o,children:[(0,l.jsxs)(`span`,{className:`fin-line__label`,children:[e,n!=null&&n!==``?(0,l.jsx)(`span`,{className:`fin-line__hint`,children:n}):null]}),(0,l.jsx)(`span`,{className:`fin-line__value`,children:t})]})}function gf(){return(0,l.jsx)(`div`,{className:`fin-divider`})}function _f({terms:e=[]}){return(0,l.jsx)(`div`,{className:`fin-equation`,children:e.map((e,t)=>e.op?(0,l.jsx)(`span`,{className:`fin-eq__op`,children:e.op},`op-${t}`):(0,l.jsxs)(`span`,{className:`fin-eq__term${e.tone?` fin-eq__term--${e.tone}`:``}`,children:[(0,l.jsx)(`span`,{className:`fin-eq__num`,children:e.value}),(0,l.jsx)(`span`,{className:`fin-eq__lbl`,children:e.label})]},e.label??t))})}function vf({steps:e=[]}){return(0,l.jsx)(`div`,{className:`fin-steps`,children:e.map((e,t)=>(0,l.jsxs)(`div`,{className:`fin-step fin-step--${e.state}`,children:[t>0?(0,l.jsx)(`span`,{className:`fin-step__line`}):null,(0,l.jsx)(`span`,{className:`fin-step__dot`,children:e.state===`done`?(0,l.jsx)(c.CheckOutlined,{}):null}),(0,l.jsx)(`span`,{className:`fin-step__label`,children:e.label})]},e.key??e.label))})}var yf={check:(0,l.jsx)(c.CheckCircleFilled,{}),dollar:(0,l.jsx)(c.DollarCircleFilled,{}),sync:(0,l.jsx)(c.SyncOutlined,{}),file:(0,l.jsx)(c.FileTextFilled,{})};function bf(e){if(!e)return``;let t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t)||t<0)return``;let n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);if(i<30)return`${i}d ago`;let a=Math.floor(i/30);return a<12?`${a}mo ago`:`${Math.floor(a/12)}y ago`}function xf({events:e=[],emptyState:t}){let r=(Array.isArray(e)?[...e]:[]).reverse();return r.length?(0,l.jsx)(`div`,{className:`fin-tl`,children:r.map((e,t)=>{let i=Rd(e?.event);return(0,l.jsxs)(`div`,{className:`fin-tl__item`,children:[(0,l.jsxs)(`div`,{className:`fin-tl__rail`,children:[(0,l.jsx)(`span`,{className:`fin-tl__icon fin-tl__icon--${i.tone}`,children:yf[i.icon]??yf.file}),t<r.length-1?(0,l.jsx)(`span`,{className:`fin-tl__line`}):null]}),(0,l.jsxs)(`div`,{className:`fin-tl__body`,children:[(0,l.jsxs)(`div`,{className:`fin-tl__head`,children:[(0,l.jsx)(`strong`,{className:`fin-tl__label`,children:i.label}),e?.by?(0,l.jsx)(`span`,{className:`fin-tl__actor`,children:e.by}):null]}),(0,l.jsxs)(`div`,{className:`fin-tl__meta`,children:[e?.at?(0,l.jsx)(`span`,{children:n.An(e.at)}):null,e?.at?(0,l.jsx)(`span`,{className:`fin-tl__rel`,children:bf(e.at)}):null]})]})]},`${e?.event}-${e?.at}-${t}`)})}):(0,l.jsx)(pf,{icon:(0,l.jsx)(c.ClockCircleOutlined,{}),title:`No activity yet`,description:`Workflow events will appear here as this record moves through its lifecycle.`,...t??{}})}var Sf=[`blue`,`indigo`,`purple`,`green`];function Cf(e){let t=String(e??``),n=0;for(let e=0;e<t.length;e++)n=n*31+t.charCodeAt(e)|0;return Sf[Math.abs(n)%Sf.length]}function wf({name:e,size:t=`md`}){return(0,l.jsx)(`span`,{className:`fin-avatar fin-avatar--${Cf(e)} fin-avatar--${t}`,children:Id(e)})}function Tf({name:e,secondary:t,link:n=!1}){return(0,l.jsxs)(`div`,{className:`fin-cell-employee`,children:[(0,l.jsx)(wf,{name:e}),(0,l.jsxs)(`span`,{className:`fin-cell-employee__text`,children:[(0,l.jsx)(`strong`,{className:`fin-cell__primary${n?` fin-cell__primary--link`:``}`,children:e||`—`}),t?(0,l.jsx)(`span`,{className:`fin-cell__secondary`,children:t}):null]})]})}function Ef({primary:e,secondary:t,link:n=!1}){return(0,l.jsxs)(`div`,{className:`fin-cell-text`,children:[(0,l.jsx)(`span`,{className:`fin-cell__primary${n?` fin-cell__primary--link`:``}`,children:e||`—`}),t?(0,l.jsx)(`span`,{className:`fin-cell__secondary`,children:t}):null]})}function Df({value:e,sub:t,strong:n=!1}){return(0,l.jsxs)(`div`,{className:`fin-cell-money`,children:[(0,l.jsx)(`span`,{className:`fin-cell-money__value${n?` fin-cell-money__value--strong`:``}`,children:typeof e==`number`?Md(e):e??`—`}),t?(0,l.jsx)(`span`,{className:`fin-cell__secondary`,children:t}):null]})}function Of({children:e,tone:t=`neutral`,title:n}){return(0,l.jsx)(`span`,{className:`fin-badge fin-badge--${t}`,title:n,children:e})}function kf({margin:e,marginPercent:t}){let n=tf(t);return(0,l.jsxs)(`div`,{className:`fin-cell-margin`,children:[(0,l.jsxs)(Of,{tone:n===`high`?`success`:n===`low`?`danger`:`neutral`,children:[Number(t??0).toFixed(1),`%`]}),e==null?null:(0,l.jsx)(`span`,{className:`fin-cell__secondary`,children:Md(e)})]})}function Af(){return(0,l.jsx)(c.RightOutlined,{className:`fin-table__chevron`})}function jf({rows:e=8}){return(0,l.jsx)(`div`,{className:`fin-table-skeleton`,children:Array.from({length:e},(e,t)=>(0,l.jsxs)(`div`,{className:`fin-table-skeleton__row`,children:[(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--avatar`}),(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--lg`}),(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--md`}),(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--md`}),(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--sm`}),(0,l.jsx)(`span`,{className:`fin-skeleton fin-skeleton--pill`})]},t))})}function Mf({columns:e,rows:t=[],rowKey:n=`timesheetId`,loading:r=!1,onRowClick:i,page:a,limit:o,total:c=0,onPageChange:u,onLimitChange:d,emptyState:f,scrollX:p=1100}){return r&&!t.length?(0,l.jsx)(jf,{}):!r&&!t.length?(0,l.jsx)(`div`,{className:`fin-table-card`,children:(0,l.jsx)(pf,{title:`No records found`,description:`Try widening the month filter or clearing quick filters — finance records live in their timesheet's month.`,...f??{}})}):(0,l.jsxs)(`div`,{className:`fin-table-card`,children:[(0,l.jsx)(s.Table,{className:`fin-table`,size:`small`,columns:e,dataSource:t,rowKey:n,loading:r,pagination:!1,sticky:!0,scroll:{x:p},onRow:e=>({onClick:t=>{t.target.closest(`button, a, input, .fin-copy`)||i?.(e)}}),rowClassName:()=>i?`fin-table__row fin-table__row--clickable`:`fin-table__row`}),c>0&&a!=null?(0,l.jsx)(`div`,{className:`fin-table__pagination`,children:(0,l.jsx)(Re,{current:a,pageSize:o,total:c,onChange:e=>u?.(e),onPageSizeChange:e=>d?.(e)})}):null]})}var Nf={location:(0,l.jsx)(c.EnvironmentOutlined,{}),designation:(0,l.jsx)(c.SolutionOutlined,{}),experience:(0,l.jsx)(c.ClockCircleOutlined,{}),employment:(0,l.jsx)(c.LaptopOutlined,{}),rate:(0,l.jsx)(c.DollarOutlined,{}),source:(0,l.jsx)(c.AimOutlined,{}),resume:(0,l.jsx)(c.FileTextOutlined,{}),edit:(0,l.jsx)(c.EditOutlined,{}),approve:(0,l.jsx)(c.CheckCircleOutlined,{}),reject:(0,l.jsx)(c.CloseCircleOutlined,{}),export:(0,l.jsx)(c.ExportOutlined,{}),openJd:(0,l.jsx)(c.ExportOutlined,{}),link:(0,l.jsx)(c.LinkOutlined,{}),shareAlt:(0,l.jsx)(c.ShareAltOutlined,{}),idcard:(0,l.jsx)(c.IdcardOutlined,{}),bank:(0,l.jsx)(c.BankOutlined,{}),team:(0,l.jsx)(c.TeamOutlined,{}),project:(0,l.jsx)(c.ProjectOutlined,{}),cycle:(0,l.jsx)(c.SyncOutlined,{}),period:(0,l.jsx)(c.CalendarOutlined,{}),PlayCircleOutlined:(0,l.jsx)(c.PlayCircleOutlined,{}),DollarOutlined:(0,l.jsx)(c.DollarOutlined,{}),FileTextOutlined:(0,l.jsx)(c.FileTextOutlined,{}),FileDoneOutlined:(0,l.jsx)(c.FileDoneOutlined,{})};function Pf({chip:e}){let t=e.icon?(0,l.jsx)(`span`,{className:`fin-meta-chip__icon`,children:e.icon}):null;return(0,l.jsxs)(`span`,{className:`fin-meta-chip`,children:[e.tooltip&&t?(0,l.jsx)(s.Tooltip,{title:e.tooltip,children:t}):t,e.label?(0,l.jsx)(`span`,{className:`fin-meta-chip__label`,children:e.label}):null,(0,l.jsx)(`span`,{className:`fin-meta-chip__value`,children:e.value??`—`}),e.badge?(0,l.jsx)(`span`,{className:`fin-badge fin-badge--brand`,children:e.badge}):null]})}function Ff(e){return Array.isArray(e)?e.map(Ff):e&&typeof e==`object`&&`id`in e&&`value`in e?e.id??e.value:e}function If(e,t){let n={_id:t,id:t},r=e?.recordMeta;if(r&&typeof r==`object`)for(let[e,t]of Object.entries(r))e in n||(n[e]=t);for(let t of e??[])for(let e of t.fields??[])e?.field!=null&&e.value!==void 0&&(n[e.field]=Ff(e.value));return n}function Lf(e){return e==null?``:Array.isArray(e)?e.join(`,`):String(typeof e==`object`?e.id??e.value??``:e)}function Rf(e,t){return String(e).replace(/\{([^}]+)\}/g,(e,n)=>encodeURIComponent(Lf(t?.[n]))).replace(/:([A-Za-z_][\w]*)/g,(e,n)=>encodeURIComponent(Lf(t?.[n])))}function zf(e,t){return String(t||``).split(`.`).reduce((e,t)=>e?.[t],e)}function Bf(e){return String(e??``).trim().toLowerCase()}function Vf(e,t,n,r){return gr(e.key,t,n,r)}function Hf(e,t,n,r){return _r(e.key,t,n,r)}function Uf(e){let t=String(e.key??``);return{...e,key:t,label:e.label||t,route:e.route||e.routeTemplate||(e.actionType===`modal`&&(e.popupKey||t)?`/popup/${e.popupKey||t}`:``)}}function Wf(e,t){let r=(e??[]).flatMap(e=>e.fields??[]),i=!t||/resume|cv/i.test(t),a=r.find(e=>e.field===t)??(i?r.find(e=>/resume|cv/i.test(`${e.field??``} ${e.label??``}`)):void 0);if(!a)return[];let o=String(a.type??``).trim().toLowerCase();if(o!==`file`&&o!==`document`&&o!==`upload`&&typeof a.value==`string`&&a.value.trim()){let e=o===`text-editor`||/<[^>]+>/.test(a.value);return[{name:a.label||t||`Document`,type:e?`html`:`text`,content:a.value}]}let s=n.Lt(a.value).filter(e=>e.url);if(s.length)return s;if(typeof a.value==`string`&&a.value.trim()){let e=o===`text-editor`||/<[^>]+>/.test(a.value);return[{name:a.label||t||`Document`,type:e?`html`:`text`,content:a.value}]}return[]}function Gf({moduleName:e,id:r,customConfigName:i,auxRecords:a,authToken:u,onAction:f,onTabChange:p,onHeaderData:m,hideActions:h=!1,defaultTab:g,refreshKey:_=0}){let v=(0,d.useNavigate)(),y=(0,d.useLocation)(),[b,x]=(0,o.useState)([]),[S,C]=(0,o.useState)([]),[w,T]=(0,o.useState)([]),[E,D]=(0,o.useState)(!1),[O,k]=(0,o.useState)([]),[A,j]=(0,o.useState)(0),M=i||e;(0,o.useEffect)(()=>(u&&t.g(u),()=>{u&&t.r()}),[u]),(0,o.useEffect)(()=>{if(!e)return;let t=!1;async function i(){try{let[i,a]=await Promise.all([Ln({module:e,id:r,view:`detail`}),n.dn(M).catch(()=>({actions:[],actionRules:[]})),n.Bn()]);t||(x(Array.isArray(i)?i:[]),C(a.actions??[]),T(a.actionRules??[]))}catch(n){console.error(`Failed to fetch ${e} header fields:`,n),t||(x([]),C([]),T([]))}}return i(),()=>{t=!0}},[e,M,r,_,A]);let[N,P]=(0,o.useState)({signature:``,groups:{}}),F=Od(a);(0,o.useEffect)(()=>{let e=Dd(a);if(!e.length)return;let t=!1;return Promise.all(e.map(async e=>{let t=await Ln({module:e.module,id:e.id,view:`detail`}).catch(()=>[]);return[e.key,Array.isArray(t)?t:[]]})).then(e=>{t||P({signature:F,groups:Object.fromEntries(e)})}).catch(()=>{t||P({signature:F,groups:{}})}),()=>{t=!0}},[F,_]);let I=(0,o.useMemo)(()=>Ad(N.signature===F?N.groups:{}),[N,F]),L=(0,o.useMemo)(()=>bd(M,b,{aux:I}),[M,b,I]);(0,o.useEffect)(()=>{L&&m&&m(L)},[L]);let{eyebrow:R,title:z=`-`,status:B,titleIds:V=[],meta:H=[],ids:U=[],tabs:ee=[],stats:te=[],timestamp:ne=null}=L??{},{canAdd:re,canEdit:ie,canDelete:ae}=tr(e),W=(0,o.useMemo)(()=>If(b,r),[b,r]),oe=il(ee,{id:r,moduleName:e,record:W}),se=yd(M)?.resolveScope,[ce,le]=(0,o.useState)(void 0);(0,o.useEffect)(()=>{if(typeof se!=`function`||!r)return;let t=!1,n=Number(localStorage.getItem(`userId`))||0;return Promise.resolve().then(()=>se({id:r,moduleName:e,record:W,currentUserId:n})).then(e=>{t||le(e??null)}).catch(()=>{t||le(null)}),()=>{t=!0}},[se,r,e,b]);let ue=typeof se!=`function`||ce!==void 0,de=(0,o.useMemo)(()=>ue?S.filter(e=>e.showInDetail??e.showInList).map(Uf).filter(e=>!Vf(e,W,w,ce??void 0)):[],[w,S,W,ce,ue]);function fe(e){let t=rr(e);if(t===`add`&&!re||t===`edit`&&!ie||t===`delete`&&!ae||!n.F(e.permission,M))return!1;if(e.permissionKey){let t=zf(W,`actionPermission.${e.permissionKey}`);if(t===!1||t===0||t===`0`)return!1}return!0}let[pe,me]=(0,o.useState)({sourceDefaultTab:g,selectedTab:g}),he=pe.sourceDefaultTab===g?pe.selectedTab:g,ge=oe.some(e=>e.key===he)?he:oe[0]?.key,_e=new Set(oe.map(e=>Bf(e.key))),G=e=>{let t=e.allowedTabs??[];return!t.length||t.some(e=>Bf(e)===Bf(ge))||ce&&t.some(e=>Bf(e)===Bf(ce))?!0:!t.some(e=>_e.has(Bf(e)))&&!ce},K=de.filter(e=>e.detailPlacement===`primary`&&fe(e)&&G(e)),ve=de.filter(e=>e.detailPlacement!==`primary`&&fe(e)&&G(e));if(!L)return null;let ye=i=>{let a=[...K,...ve].find(e=>e.key===i);if(a?.actionType===`document`&&a.documentField){let t=Wf(b,a.documentField);if(t.length){k(t),D(!0);return}let i=a.documentModule||e,o=a.documentIdField?zf(W,a.documentIdField):r;n.gn(i,o,a.documentField).then(e=>{let t=(e?.data??[]).map(e=>({name:e.fileName||e.name||e.uploadedFileName||a.documentField,url:e.fileUrl||e.url||``,type:`file`})).filter(e=>e.url);t.length?(k(t),D(!0)):s.message.warning(`No ${(a.label||`document`).toLowerCase()} available`)}).catch(()=>s.message.warning(`No ${(a.label||`document`).toLowerCase()} available`));return}if(a?.actionType===`copy`){let e=zf(W,a.copyField||`id`);navigator.clipboard.writeText(Lf(e)).then(()=>s.message.success(`Copied to clipboard`)).catch(()=>s.message.error(`Could not copy to clipboard`));return}if(a?.actionType===`api`&&a.apiPath){let n=Rf(a.apiPath,W),o=String(a.apiMethod||`POST`).toUpperCase();t.o(t.x,n.startsWith(`/`)?n:`/${n}`,{method:o,body:[`GET`,`DELETE`].includes(o)?void 0:JSON.stringify({ids:[r],record:W})}).then(()=>{s.message.success(`${a.label} completed`),j(e=>e+1),f?.(i,{moduleName:e,id:r,action:a,refreshed:!0})}).catch(e=>s.message.error(e.message||`${a.label} failed`));return}if(a?.route){let t=typeof a.route==`function`?a.route(r):Rf(a.route,If(b,r));if(a.linkTarget===`_blank`){window.open(t,`_blank`,`noopener`);return}t.startsWith(`/popup/`)?v(t,{state:{background:y,moduleName:e,selectedIds:[r],selectedRecords:[W],popupContext:a.popupState??{},popupAction:{key:a.key,apiMethod:a.apiMethod,apiPath:a.apiPath,defaultTemplateId:a.defaultTemplateId},...a.popupState}}):v(t);return}f?.(i,{moduleName:e,id:r,action:a})},be=t=>{me({sourceDefaultTab:g,selectedTab:t}),p?.(t,{moduleName:e,id:r})},xe=ve.map(e=>{let t=vr(e,W,ce??void 0),n=!t&&Hf(e,W,w,ce??void 0);return{key:e.key,label:t?t.label:e.label,danger:e.danger,disabled:!!t||!!n,title:n||void 0,onClick:t||n?void 0:()=>ye(e.key)}}),Se=yd(M)?.header;if(Se?.variant===`finance`){let t=e=>e==null?``:Array.isArray(e)?e.map(t).filter(Boolean).join(`, `):String(typeof e==`object`?e.value??e.label??e.name??e.id??``:e),r={};for(let e of b??[])for(let t of e.fields??[])t?.field!=null&&(r[t.field]=t.value);let i=e=>t(r[e]),a=i(Se.statusField),o=(Se.chips??[]).map(e=>({key:e.field,icon:e.icon?Nf[e.icon]:void 0,label:e.label,value:i(e.field)||`—`,badge:e.badgeField&&i(e.badgeField)||void 0,tooltip:e.tooltip})),c=h?[]:K.map(e=>{let t=vr(e,W,ce??void 0),n=!t&&Hf(e,W,w,ce??void 0);return{key:e.key,label:t?t.label:e.label,icon:e.icon?Nf[e.icon]:void 0,enabled:!t&&!n,variant:e.tone,disabledReason:n||void 0,onClick:t||n?void 0:()=>ye(e.key)}}),u=a?Kd(e,a):[];return(0,l.jsxs)(`div`,{className:`fin-detail-header`,children:[(0,l.jsxs)(`div`,{className:`fin-dh__top`,children:[(0,l.jsxs)(`div`,{className:`fin-dh__identity`,children:[(0,l.jsx)(wf,{name:z,size:`lg`}),(0,l.jsxs)(`div`,{className:`fin-dh__who`,children:[(0,l.jsxs)(`div`,{className:`fin-dh__name-row`,children:[(0,l.jsx)(`h2`,{className:`fin-dh__name`,children:z||`Details`}),a?(0,l.jsx)(uf,{status:a}):null]}),R?(0,l.jsx)(`span`,{className:`fin-dh__designation`,children:R}):null]})]}),c.length?(0,l.jsx)(`div`,{className:`fin-dh__actions`,children:c.map(e=>{let t=(0,l.jsx)(n.lt,{variant:e.enabled?e.variant??`default`:`default`,icon:e.icon,disabled:!e.enabled,onClick:e.onClick,children:e.label},e.key??e.label);return e.enabled||!e.disabledReason?t:(0,l.jsx)(s.Tooltip,{title:e.disabledReason,children:(0,l.jsx)(`span`,{className:`fin-dh__action-wrap`,children:t})},e.key??e.label)})}):null]}),o.length?(0,l.jsx)(`div`,{className:`fin-dh__chips`,children:o.map(e=>(0,l.jsx)(Pf,{chip:e},e.key??e.label))}):null,u.length?(0,l.jsx)(vf,{steps:u}):null]})}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s.Card,{className:`znx-dh-card`,children:[(0,l.jsxs)(`div`,{className:`znx-dh-top`,children:[(0,l.jsxs)(`div`,{className:`znx-dh-left`,children:[R&&(0,l.jsx)(`div`,{className:`znx-dh-eyebrow`,children:R}),(0,l.jsxs)(`div`,{className:`znx-dh-titlerow`,children:[(0,l.jsx)(`span`,{className:`znx-dh-title`,children:z}),V.map(e=>(0,l.jsxs)(`span`,{className:`znx-dh-titleid`,children:[(0,l.jsxs)(`span`,{className:`znx-dh-id-label`,children:[e.label,`:`]}),` `,e.value]},e.label)),B&&(0,l.jsx)(s.Tag,{color:B.color,className:`znx-dh-status`,style:{backgroundColor:B.backgroundColor??B.color,borderColor:B.backgroundColor??B.color,color:B.textColor},children:B.label})]}),U.length>0&&(0,l.jsx)(`div`,{className:`znx-dh-ids`,children:U.map(e=>(0,l.jsxs)(`span`,{className:`znx-dh-id`,children:[(0,l.jsxs)(`span`,{className:`znx-dh-id-label`,children:[e.label,`:`]}),` `,e.value]},e.label))}),H.length>0&&(0,l.jsx)(`div`,{className:`znx-dh-meta`,children:H.map((e,t)=>{let n=Ed(e,e=>zf(W,e)??W?.[e]);return(0,l.jsxs)(`span`,{className:`znx-dh-meta-item`,children:[n.icon&&Nf[n.icon]&&(0,l.jsx)(`span`,{className:`znx-dh-meta-icon`,children:Nf[n.icon]}),n.variant===`pill`?(0,l.jsxs)(l.Fragment,{children:[n.label&&(0,l.jsxs)(`span`,{className:`znx-dh-meta-label`,children:[n.label,`:`]}),(0,l.jsx)(s.Tag,{className:`znx-dh-meta-pill`,color:n.tagColor,style:n.tagStyle,children:n.value||n.text})]}):(0,l.jsx)(`span`,{children:n.text})]},t)})})]}),!h&&(0,l.jsxs)(`div`,{className:`znx-dh-actions-col`,children:[(0,l.jsxs)(`div`,{className:`znx-dh-actions`,children:[K.map(e=>{let t=vr(e,W,ce??void 0),n=!t&&Hf(e,W,w,ce??void 0),r=(0,l.jsx)(s.Button,{type:`text`,disabled:!!t||!!n,className:`znx-dh-btn znx-dh-btn--${t?t.tone:e.tone??`primary`}${t?` znx-dh-btn--done`:``}`,icon:t?(0,l.jsx)(c.CheckCircleOutlined,{}):e.icon?Nf[e.icon]:void 0,onClick:t||n?void 0:()=>ye(e.key),children:t?t.label:e.label},e.key);return n?(0,l.jsx)(s.Tooltip,{title:n,children:(0,l.jsx)(`span`,{children:r})},e.key):r}),ve.length>0&&(0,l.jsx)(s.Dropdown,{trigger:[`click`],placement:`bottomRight`,menu:{items:xe},children:(0,l.jsx)(s.Button,{type:`text`,className:`znx-dh-more`,icon:(0,l.jsx)(c.MoreOutlined,{})})})]}),te.length>0&&(0,l.jsx)(`div`,{className:`znx-dh-stats`,children:te.map(e=>(0,l.jsxs)(`div`,{className:`znx-dh-stat`,children:[(0,l.jsx)(`span`,{className:`znx-dh-stat-value`,children:e.value}),(0,l.jsx)(`span`,{className:`znx-dh-stat-label`,children:e.label})]},e.label))}),ne?.value&&(0,l.jsxs)(`div`,{className:`znx-dh-created`,children:[`Created on `,ne.value]})]})]}),oe.length>0&&(0,l.jsx)(`div`,{className:`znx-dh-tabs`,children:oe.map(e=>(0,l.jsx)(`button`,{type:`button`,className:`znx-dh-tab${ge===e.key?` is-active`:``}`,onClick:()=>be(e.key),children:e.label},e.key))})]}),(0,l.jsx)(n.Cn,{documents:O,open:E,onClose:()=>D(!1)})]})}var Kf={};function qf(){let e=(typeof window<`u`&&window.__CORE_THEME_CONFIG__?.tabContentRegistry)??{};if(!Object.keys(e).length)return Kf;let t={...Kf};return Object.entries(e).forEach(([e,n])=>{t[e]={...t[e]??{},...n}}),t}function Jf(e,t){return!t||t===`details`?null:qf()[e]?.[t]??null}function Yf(){let e=(0,d.useLocation)();return e.state?.refreshTimestamp??e.state?.__refreshedAt??0}function Xf({component:e,id:t,moduleName:n,onDescriptionSaved:r}){return e?(0,l.jsx)(e,{id:t,moduleName:n,onDescriptionSaved:r}):null}var{Text:Zf}=s.Typography;function Qf({moduleName:e,id:t,backPath:n=``,showFooter:r=!0,users:i=[],showActivity:a=!0,showNotes:c=!0,onHeaderAction:u,onHeaderTabChange:f,onHeaderData:p}){let m=(0,d.useNavigate)(),h=(0,d.useParams)(),[g,_]=(0,d.useSearchParams)(),v=(0,d.useLocation)(),y=t||h.id||g.get(`jobId`)||g.get(`id`)||v.state?.record?._id||v.state?.record?.id,b=g.get(`tab`)||`details`,[x,S]=(0,o.useState)(0),C=Yf(),w=(e,t)=>{let n=new URLSearchParams(g);n.set(`tab`,e),_(n,{replace:!0}),f?.(e,t)},T=()=>S(e=>e+1),E=(e,t)=>{u?.(e,t)},D=(0,o.useMemo)(()=>yd(e)?.tabs??[],[e]),O=il(D,{id:y,moduleName:e}),k=b===`details`||!D.some(e=>e.key===b&&typeof e.visibleWhen==`function`)||O.some(e=>e.key===b),A=(0,o.useMemo)(()=>k?Jf(e,b):null,[e,b,k]);return(0,l.jsxs)(`div`,{className:`v1-page v1-detail-page`,children:[(0,l.jsxs)(`div`,{className:`v1-page-inner`,children:[(0,l.jsx)(Gf,{moduleName:e,id:y,defaultTab:b,onAction:E,onTabChange:w,onHeaderData:p,refreshKey:C}),A?(0,l.jsx)(Xf,{component:A,id:y,moduleName:e,onDescriptionSaved:T}):(0,l.jsxs)(s.Row,{gutter:[16,16],align:`stretch`,children:[(0,l.jsx)(s.Col,{xs:24,lg:16,children:(0,l.jsx)(Vu,{moduleName:e,id:y,refreshKey:x+C,onDescriptionSaved:T})}),(0,l.jsx)(s.Col,{xs:24,lg:8,children:(0,l.jsx)(Mc,{moduleName:e,id:y,users:i,showActivity:a,showNotes:c,refreshKey:C})})]})]}),n&&r&&(0,l.jsxs)(`div`,{className:`v1-footer`,children:[(0,l.jsx)(Zf,{type:`secondary`,children:y?`Record ID: ${y}`:`Detail view`}),(0,l.jsx)(s.Button,{onClick:()=>m(n),children:`Back`})]})]})}Qf.propTypes={moduleName:f.default.string,id:f.default.string,backPath:f.default.string,showFooter:f.default.bool,users:f.default.array,showActivity:f.default.bool,showNotes:f.default.bool,onHeaderAction:f.default.func,onHeaderTabChange:f.default.func,onHeaderData:f.default.func};var $f={jobRemoteStatus:[`On-Site`,`Remote`,`Hybrid`],jobRecruitmentStatus:[`unread`,`partially fulfilled`,`fulfilled`],"experience.experienceRequiredUnit":[`Years`,`Months`],"contractDuration.unit":[`Days`,`Weeks`,`Months`,`Years`],noticePeriodUnit:[`Days`,`Weeks`,`Months`],"jobPayDetails.clientBudgetCurrency":[`$`,`USD`,`INR`],"jobPayDetails.clientBudgetUnit":[`Hour`,`Daily`,`Monthly`,`Yearly`],workAuthorisation:[`US Citizen`,`Green Card`,`H1B`,`OPT`,`CPT`,`L2 EAD`,`H4 EAD`,`Other`],source:[`LinkedIn`,`Referral`,`Dice`,`Indeed`,`Monster`,`Vendor`,`Other`]};function ep(e={}){return $f[e.field]??[]}var tp=new Set([``,`false`,`0`,`no`,`null`,`undefined`]);function np(e){return e==null||e===!1?!1:typeof e==`number`?e!==0&&!Number.isNaN(e):typeof e==`string`?!tp.has(e.trim().toLowerCase()):!Array.isArray(e)||e.length>0}function rp(e){return Array.isArray(e)?e.map(e=>String(e??``).trim()).filter(Boolean):String(e??``).split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function ip({lockKeys:e=[],resultValue:t,hasResultField:n=!0,readSibling:r}){return!e.length||typeof r!=`function`||n&&!np(t)?!1:e.every(e=>np(r(e)))}function ap(e,t=[]){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}var op=e.t({default:()=>Xp}),{Text:sp}=s.Typography,{TextArea:cp}=s.Input;function lp(e,t){return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),t]:[t]}function up({form:e,field:t,absoluteName:r}){let[i,a]=(0,o.useState)(!1),[c,u]=(0,o.useState)(null),d=(0,o.useRef)(null),f=s.Form.useWatch(t.verifyResultField?lp(r,t.verifyResultField):[`__noop_verify__`],{form:e,preserve:!0}),p=s.Form.useWatch(r,e),m=(0,o.useMemo)(()=>rp(t.verifyLockedWhenFields),[t.verifyLockedWhenFields]),h=s.Form.useWatch(e=>ip({lockKeys:m,resultValue:ap(e,lp(r,t.verifyResultField)),hasResultField:!!t.verifyResultField,readSibling:t=>ap(e,lp(r,t))}),{form:e,preserve:!0});return(0,o.useEffect)(()=>{let n=String(p??``).trim();if(f===!0&&d.current===null&&n){d.current=n;return}f===!0&&d.current!==null&&n!==d.current&&(t.verifyResultField&&e.setFieldValue(lp(r,t.verifyResultField),!1),t.verifyTimestampField&&e.setFieldValue(lp(r,t.verifyTimestampField),void 0),d.current=null)},[r,p,t.verifyResultField,t.verifyTimestampField,e,f]),t.verifyAction===`email`?h?(0,l.jsx)(sp,{type:`success`,strong:!0,className:`v1-verify-field-wrap`,children:t.verifyLockedLabel||`Verified`}):f===!0?c&&!c.mailboxConfirmed&&(c.catchAll||c.result===`risky`)?(0,l.jsx)(s.Tooltip,{title:c.reason||`This domain accepts every address, so the mailbox could not be confirmed. Delivery is proven only once the account email is actually sent.`,children:(0,l.jsx)(sp,{type:`warning`,strong:!0,className:`v1-verify-field-wrap`,children:t.verifyUnconfirmedLabel||`Accepted`})}):(0,l.jsx)(sp,{type:`success`,strong:!0,className:`v1-verify-field-wrap`,children:t.verifySuccessLabel||`Valid`}):(0,l.jsx)(s.Button,{size:`small`,loading:i,onClick:async()=>{let i=String(p??``).trim();if(!i){s.message.warning(`Enter an email first`);return}a(!0);try{let a=await n._i(i);d.current=a.valid?i:null,u(a.valid?a:null),t.verifyResultField&&e.setFieldValue(lp(r,t.verifyResultField),a.valid),t.verifyTimestampField&&e.setFieldValue(lp(r,t.verifyTimestampField),a.valid?new Date().toISOString():void 0),a.valid?a.mailboxConfirmed?s.message.success(`Email verified — the mail server confirmed this mailbox`):s.message.warning(a.reason||`The domain can receive mail, but this exact mailbox could not be confirmed`):s.message.error(a.reason?`Invalid email: ${a.reason}`:`Email could not be verified`)}catch(n){d.current=null,u(null),t.verifyResultField&&e.setFieldValue(lp(r,t.verifyResultField),!1),t.verifyTimestampField&&e.setFieldValue(lp(r,t.verifyTimestampField),void 0),s.message.error(n?.message||`Could not verify email`)}finally{a(!1)}},className:`v1-verify-field-wrap`,children:f===!1?t.verifyRetryLabel||`Re Verify`:t.verifyIdleLabel||`Verify Email`}):null}function dp({form:e,field:t,siblingPrefix:r,locked:i,combined:a=!1}){let o=s.Form.useWatch(n.r(t?.labelWhen,r),e),c=n.a(t,o,a);return a?c:(0,l.jsx)(Dp,{field:t,label:c,locked:i})}function fp({form:e,groups:t,disabled:n,loading:r,onClick:i,children:a}){let o=s.Form.useWatch(e=>t.some(t=>{if(!t.addRow||!t.requireValidatedField)return!1;let n=e?.[t.name]??[];return n.length===0||n.some(e=>!e?.[t.requireValidatedField])}),{form:e,preserve:!0}),c=n||o,u=t.find(e=>e.submitDisabledMessage)?.submitDisabledMessage,d=t.find(e=>e.requireValidatedField)?.requireValidatedFieldMessage,f=o?d||u||`Verify every required row before submitting.`:u||`Complete all mandatory fields before submitting.`,p=(0,l.jsx)(s.Button,{type:`primary`,onClick:i,disabled:c,loading:r,children:a});return c&&!r?(0,l.jsx)(s.Tooltip,{title:f,children:(0,l.jsx)(`span`,{style:{display:`inline-flex`,cursor:`not-allowed`},children:p})}):p}function pp({form:e,rules:t,watchPaths:r,targetPath:i,resetOnNoMatch:a=!0}){let c=s.Form.useWatch(e=>JSON.stringify(r.map(({path:t})=>t.reduce((e,t)=>e==null?e:e[t],e)??null)),{form:e,preserve:!0}),l=(0,o.useRef)(void 0),u=(0,o.useRef)(!0);return(0,o.useEffect)(()=>{let o=c?JSON.parse(c):[],s={};r.forEach(({field:e},t)=>{s[e]=o[t]});let d=u.current;u.current=!1;let f=n.G({rules:t,watched:s,current:e.getFieldValue(i),lastApplied:l.current,clearOnMismatch:a,initial:d});f.action===`set`?(e.setFieldValue(i,f.value),l.current=f.value):f.action===`clear`&&(e.setFieldValue(i,void 0),l.current=void 0)},[c]),null}var mp=[(0,l.jsx)(c.UserOutlined,{}),(0,l.jsx)(c.EnvironmentOutlined,{}),(0,l.jsx)(c.SolutionOutlined,{}),(0,l.jsx)(c.InfoCircleOutlined,{}),(0,l.jsx)(c.FileTextOutlined,{})],hp={email:(0,l.jsx)(c.MailOutlined,{className:`v1-input-icon`}),contactNumber:(0,l.jsx)(c.PhoneOutlined,{className:`v1-input-icon`}),phone:(0,l.jsx)(c.PhoneOutlined,{className:`v1-input-icon`}),currentLocation:(0,l.jsx)(c.EnvironmentOutlined,{className:`v1-input-icon`}),preferredLocation:(0,l.jsx)(c.EnvironmentOutlined,{className:`v1-input-icon`}),designation:(0,l.jsx)(c.SolutionOutlined,{className:`v1-input-icon`}),skills:(0,l.jsx)(c.TagsOutlined,{className:`v1-input-icon`}),firstName:(0,l.jsx)(c.UserOutlined,{className:`v1-input-icon`}),lastName:(0,l.jsx)(c.UserOutlined,{className:`v1-input-icon`}),jobTitle:(0,l.jsx)(c.SolutionOutlined,{className:`v1-input-icon`}),jobLocation:(0,l.jsx)(c.EnvironmentOutlined,{className:`v1-input-icon`}),vendorEmail:(0,l.jsx)(c.MailOutlined,{className:`v1-input-icon`})},gp=e=>e===!0||e===1||e===`1`,_p=(e,t)=>(e?.edit===void 0||gp(e.edit))&&(!e?.editablePermission||n.F(e.editablePermission,t)),vp=e=>e==null||e===``;function yp(e){return e==null||e===``?!1:Array.isArray(e)?e.length>0&&e.some(yp):typeof e!=`object`||Object.values(e).some(yp)}function bp(e=``){let t=String(e).toLowerCase();return t===`job`?`jobs`:t===`candidate`?`candidates`:t===`submissions`?`submission`:t}function xp(e=[]){return e.map(e=>typeof e==`string`?{label:e,value:e}:{label:e.label??e.name??e.value??e.userName??e.email,value:e.value??e.id??e.userId??e._id??e.name??e.label})}function Sp(e,t){if(!e?.field)return!0;let n=String(t??``),r=String(e.value??``),i=()=>r.split(`,`).map(e=>e.trim());switch(e.operator){case`eq`:return n===r;case`neq`:return n!==r;case`in`:return i().includes(n);case`notIn`:return!i().includes(n);case`truthy`:return gp(t);case`falsy`:return!gp(t);case`empty`:case`isEmpty`:return t==null||n.trim()===``||Array.isArray(t)&&t.length===0;case`notEmpty`:return!(t==null||n.trim()===``||Array.isArray(t)&&t.length===0);default:return!0}}var Cp=o.default.createContext(!1);function wp({form:e,group:t,children:r,inheritParent:i=!0}){let a=o.default.useContext(Cp),c=t?.disabledIf?.field?n.jt(t.disabledIf.field):[`__noop_group_disabled__`],u=s.Form.useWatch(c,e),d=t?.disabledIf?.field?Sp(t.disabledIf,u):!1,f=i&&a||!!t?.disabled||d;return(0,l.jsx)(Cp.Provider,{value:f,children:r})}function Tp({form:e,showIf:t,render:n}){return Sp(t,s.Form.useWatch(t.field,e))?n():null}function Ep(e,t){return String(t??``).split(`.`).reduce((e,t)=>e?.[t],e)}function Dp({field:e,label:t,locked:r}){if(!t)return t;let i=n.R(e),a=!!i;return!a&&!r?t:(0,l.jsxs)(`span`,{className:`v1-field-label-with-info`,children:[(0,l.jsx)(`span`,{children:t}),a&&(0,l.jsx)(s.Tooltip,{title:i,children:(0,l.jsx)(c.InfoCircleOutlined,{className:`v1-field-info-icon`})}),r&&(0,l.jsx)(s.Tooltip,{title:`You don't have permission to edit this field`,children:(0,l.jsx)(c.LockOutlined,{className:`v1-field-info-icon`})})]})}function Op({group:e}){return!gp(e?.infoEnabled)||vp(e?.infoText)?null:(0,l.jsx)(sp,{type:`secondary`,className:`v1-group-info-message`,children:e.infoText})}function kp({group:e}){return!gp(e?.toggleEnabled)||vp(e?.toggleField)?null:(0,l.jsxs)(s.Space,{size:6,align:`center`,onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(sp,{type:`secondary`,className:`v1-combine-toggle-label`,children:e.toggleLabel||`Toggle`}),(0,l.jsx)(s.Form.Item,{name:e.toggleField,valuePropName:`checked`,initialValue:!!e.toggleValue,noStyle:!0,children:(0,l.jsx)(s.Switch,{size:`small`})})]})}function Ap(e=[],t,r,i){let a=i??new Set;return[...e].filter(e=>!gp(e.hideGroup)&&!gp(e.hideGroupInForm)&&n.cn(r,e.name)).sort((e,t)=>Number(e.order??0)-Number(t.order??0)).map(e=>({...e,fields:[...e.fields??[]].map(e=>a.has(e.field)?{...e,show:1,req:1}:e).filter(i=>String(i.field??``).trim()!==``&&(!i.visiblePermission||n.F(i.visiblePermission,t))&&n.on(r,e.name,i.field)).map(t=>n.sn(r,e.name,t.field)?t:{...t,disabled:!0}).sort((e,t)=>Number(e.order??0)-Number(t.order??0))})).filter(e=>e.fields.length)}function jp(e){return String(e??``).replace(/<[^>]*>/g,``).replace(/&nbsp;/g,` `).replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).trim()}function Mp(e,t){let n=(e.validations??e.validation??e.rules??[]).find(e=>(typeof e==`string`?e:e?.type)===t);if(!(!n||typeof n==`string`))return n.value??n.length??n[t]}var Np=({label:e,message:t,value:n,compare:r,text:i})=>({validator:(a,o)=>vp(o)||r(Number(o),Number(n))?Promise.resolve():Promise.reject(Error(t??`${e} ${i} ${n}`))});function Pp(e,t){return n.nt(e,t)}var Fp=({label:e,message:t,value:n,rule:r,form:i,name:a,compare:o,text:s})=>({validator:async(c,l)=>{let u=n??r.compareField??r.field;if(!u||vp(l))return Promise.resolve();let d=i.getFieldValue(Pp(a,u));if(vp(d))return Promise.resolve();let f=Number(l),p=Number(d);return Number.isNaN(f)||Number.isNaN(p)||o(f,p)?Promise.resolve():Promise.reject(Error(t??`${e} ${s} ${u}`))}}),Ip={minLength3:e=>Ip.min({...e,value:3}),minLength5:e=>Ip.min({...e,value:5}),noPastDate:({label:e,message:t})=>({validator:(r,i)=>{if(vp(i))return Promise.resolve();let a=new Date;return a.setHours(0,0,0,0),n.g(i)<a.getTime()?Promise.reject(Error(t??`${e} cannot be a past date`)):Promise.resolve()}}),noFutureDate:({label:e,message:t})=>({validator:(r,i)=>{if(vp(i))return Promise.resolve();let a=new Date;return a.setHours(23,59,59,999),n.g(i)>a.getTime()?Promise.reject(Error(t??`${e} cannot be a future date`)):Promise.resolve()}}),minAge:({message:e,value:t})=>({validator:(r,i)=>{if(vp(i))return Promise.resolve();let a=Number(t??18),o=new Date;return o.setFullYear(o.getFullYear()-a),o.setHours(23,59,59,999),n.g(i)>o.getTime()?Promise.reject(Error(e??`Must be at least ${a} years old`)):Promise.resolve()}}),dateAfterField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>n.p({type:`dateAfterField`,label:e,rule:{...i,value:r??i?.compareField??i?.field,message:t},readSibling:e=>a.getFieldValue(Pp(o,e))}),dateBeforeField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>n.p({type:`dateBeforeField`,label:e,rule:{...i,value:r??i?.compareField??i?.field,message:t},readSibling:e=>a.getFieldValue(Pp(o,e))}),timeAfterField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>({validator:async(s,c)=>{let l=r??i.compareField??i.field;if(!l||vp(c))return Promise.resolve();let u=a.getFieldValue(Pp(o,l));if(vp(u))return Promise.resolve();let d=n._(c),f=n._(u);return d===null||f===null||d>f?Promise.resolve():Promise.reject(Error(t??`${e} must be after ${l}`))}}),timeBeforeField:({label:e,message:t,value:r,rule:i,form:a,name:o})=>({validator:async(s,c)=>{let l=r??i.compareField??i.field;if(!l||vp(c))return Promise.resolve();let u=a.getFieldValue(Pp(o,l));if(vp(u))return Promise.resolve();let d=n._(c),f=n._(u);return d===null||f===null||d<f?Promise.resolve():Promise.reject(Error(t??`${e} must be before ${l}`))}}),greaterThanField:e=>Fp({...e,compare:(e,t)=>e>=t,text:`must be greater than or equal to`}),strictGreaterThanField:e=>Fp({...e,compare:(e,t)=>e>t,text:`must be greater than`}),strictLessThanField:e=>Fp({...e,compare:(e,t)=>e<t,text:`must be less than`}),lessThanOrEqualField:e=>Fp({...e,compare:(e,t)=>e<=t,text:`must be less than or equal to`}),maxFromField:e=>n.it(e),maxFieldWithFallback:({label:e,message:t,value:r,rule:i,form:a,name:o})=>({validator:async(s,c)=>{let l=n.$({input:c,compareFields:n.et(r??i.compareFields),readValue:e=>n.tt(a,o,e)});return l.ok?Promise.resolve():Promise.reject(Error(t??`${e} must not exceed ${l.field}`))}}),required:({field:e,message:t,form:n,name:r})=>({validator:(i,a)=>{if(e?.disabledByField&&n&&r&&gp(n.getFieldValue(Rp(r,e.disabledByField)))||e?.requiredIfField&&n&&!gp(n.getFieldValue(Rp(r,e.requiredIfField))))return Promise.resolve();let o=a==null||a===``||Array.isArray(a)&&a.length===0;return!o&&e?.type===`text-editor`&&(o=jp(a)===``),o?Promise.reject(Error(t??`Mandatory Field`)):Promise.resolve()}}),email:({label:e,message:t})=>n.wt(e,t),unique:({field:e,rule:t,uniqueContext:r})=>n._t({field:e,validation:t,context:r}),url:({label:e,message:t})=>({type:`url`,message:t??`Enter valid ${e}`}),number:({label:e,message:t})=>({pattern:/^[0-9]+$/,message:t??`${e} must be a number`}),phone:({message:e})=>({validator:(t,r)=>{if(r==null||r===``)return Promise.resolve();let{total:i}=n.Vn();return n.Hn(r).length===i?Promise.resolve():Promise.reject(Error(e??`Phone number must contain exactly ${i} digits`))}}),len:({label:e,message:t,value:n})=>({len:Number(n),message:t??`${e} must be ${n} characters`}),pattern:({label:e,message:t,rule:n})=>({pattern:new RegExp(n.pattern??n.value,n.flags),message:t??`Enter valid ${e}`}),min:({field:e,label:t,message:n,value:r})=>e.type===`number`?Np({label:t,message:n,value:r,compare:(e,t)=>e>=t,text:`must be at least`}):{validator:(i,a)=>{if(a==null||a===``)return Promise.resolve();let o=e.type===`text-editor`?jp(a):String(a);return o===``||o.length>=Number(r)?Promise.resolve():Promise.reject(Error(n??`${t} must be at least ${r} characters`))}},max:({field:e,label:t,message:n,value:r})=>e.type===`number`?Np({label:t,message:n,value:r,compare:(e,t)=>e<=t,text:`must not exceed`}):{validator:(i,a)=>{if(a==null||a===``)return Promise.resolve();let o=e.type===`text-editor`?jp(a):String(a);return o===``||o.length<=Number(r)?Promise.resolve():Promise.reject(Error(n??`${t} must not exceed ${r} characters`))}}};function Lp(e,t,n,r,i,a){let o=typeof e==`string`?{type:e}:e,s=o.type??o.rule??o.name,c=o.value??o.length??o.min??o.max,l=t.label??t.field??`Field`,u=Ip[s];return u?u({field:t,label:l,message:o.message,rule:o,value:c,form:n,name:r,prefixFor:i,uniqueContext:a}):o}function Rp(e,t){return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),t]:[t]}function zp(e){return gp(e?.req)?!0:(e?.validations??e?.validation??e?.rules??[]).some(e=>(typeof e==`string`?e:e?.type)===`required`)}function Bp(e,t,r,i=!1,a=void 0,o=void 0,s=void 0){let c=e.label??e.field??`Field`,l=e.validations??e.validation??e.rules??[],u=l.some(e=>(typeof e==`string`?e:e?.type)===`required`),d=l.some(e=>(typeof e==`string`?e:e?.type)===`email`),f=[];if(s?.length&&f.push(...s),e.rowHierarchy){let i=Up(t,r);i.rows&&f.push(n.m({field:e,...i}))}!i&&!u&&(gp(e.req)||e.requiredIfField)&&f.push(Ip.required({field:e,message:`Mandatory Field`,form:t,name:r})),(e.type===`email`||e.formatter===`email`)&&!d&&f.push(n.wt(c)),e.type===`number`&&f.push(gp(e.decimal)?{pattern:/^\d+(\.\d+)?$/,message:`${c} must be a number`}:{pattern:/^[0-9]+$/,message:`${c} must be a number`});let p=n.in(e,r,a,n=>Lp(n,e,t,r,a,o));return n.gt([...f,...l.map(p),n.an(e)])}function Vp(e,t,r){let i=new Set([`greaterThanField`,`strictGreaterThanField`,`strictLessThanField`,`lessThanOrEqualField`,`maxFieldWithFallback`,`dateAfterField`,`dateBeforeField`,`timeAfterField`,`timeBeforeField`]);return[...(e.validations??e.validation??e.rules??[]).filter(e=>(typeof e==`string`?e:e?.type)===`maxFromField`).map(e=>n.rt(e,t,r)).filter(Boolean),...(e.validations??e.validation??e.rules??[]).filter(e=>i.has(typeof e==`string`?e:e?.type)).flatMap(e=>String(e.value??e.compareField??e.field??``).split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>Pp(t,e)))]}function Hp(e){let t=e.len??Mp(e,`len`),n=e.min??Mp(e,`min`),r=e.max??Mp(e,`max`);return e.type===`number`?{min:n??void 0,max:r??void 0}:{minLength:n??void 0,maxLength:e.maxLength??t??r??void 0}}function Up(e,t){if(!Array.isArray(t)||t.length<3||typeof t[1]!=`number`)return{};let n=e.getFieldValue(t[0]);return Array.isArray(n)?{rows:n,rowIndex:t[1]}:{}}function Wp(e,t,r){return n.f({field:e,readSibling:e=>t.getFieldValue(Pp(r,e)),...Up(t,r)})}function Gp(e){return n.h(e)}function Kp(e,t){return t?t===`phone`?n.Rn(e):t===`digits`?e.replace(/\D/g,``).slice(0,10):t===`email`||t===`noSpaces`?e.replace(/\s/g,``):t===`name`?e.replace(/\s+/g,` `).trimStart().replace(/\b\w/g,e=>e.toUpperCase()):e:e}function qp({field:e,form:r,name:i,value:a,checked:u,fileList:d,moduleName:f,recordId:p,initialValue:m,scopeValues:h={},onAiUpload:g,onRegionBlocked:_,onRowOrderChange:v,formDisabled:y,rowFieldKeys:b}){let x=e.type??`text`,S=!_p(e,f),[C,w]=(0,o.useState)(null),[T,E]=(0,o.useState)(!1),[D,O]=(0,o.useState)(``),[k,A]=(0,o.useState)(``),[j,M]=(0,o.useState)(``),[N,P]=(0,o.useState)({open:!1,docs:[],index:0}),[F,I]=(0,o.useState)(null),[L,R]=(0,o.useState)(0),z=(0,o.useRef)([]),B=Array.isArray(i)&&i.length>=3&&typeof i[1]==`number`,V=e.lookupFilterValueFrom?n.jt(e.lookupFilterValueFrom):[`__lookup_filter_${e.field}`],H=e.lookupFilterValueFrom&&B?[...i.slice(0,2),...n.jt(e.lookupFilterValueFrom)]:[`__noop_row_filter__`],U=s.Form.useWatch(V,r),ee=s.Form.useWatch(H,r),te=vp(ee)?U:ee,ne=e.lookupFilterValueFrom?h[e.lookupFilterValueFrom]:void 0,re=vp(ne)?te:ne,ie=(0,o.useRef)(n.I);(0,o.useEffect)(()=>{if(!e.lookupFilterField||!e.lookupFilterValueFrom)return;let t=ie.current;ie.current=re,n.L({previous:t,next:re,currentValue:r.getFieldValue(i)})&&r.setFields([{name:i,value:void 0,errors:[]}])},[re]);let ae=e.disabledByField?Array.isArray(i)&&i.length>1?[...i.slice(0,-1),e.disabledByField]:[e.disabledByField]:[`__noop_disabled_watch__`],W=s.Form.useWatch(ae,r),oe=e.disabledIf?.field?n.jt(e.disabledIf.field):[`__noop_disabled_if__`],se=e.disabledIf?.field&&B?[...i.slice(0,2),...n.jt(e.disabledIf.field)]:[`__noop_disabled_if_row__`],ce=s.Form.useWatch(oe,r),le=s.Form.useWatch(se,r),ue=e.disabledIf?.field?n.i(e.disabledIf,vp(le)?ce:le):!1,de=e.optionsFromField||``,fe=de?n.jt(de):[`__noop_options_from__`],pe=de&&B&&(!b||b.has(de))?[...i.slice(0,2),...n.jt(de)]:[`__noop_options_from_row__`],me=s.Form.useWatch(fe,r),he=s.Form.useWatch(pe,r),ge=vp(he)?me:he,_e=gp(e.prefillWhenExclusive)&&e.prefillWhen?.length?e.prefillWhen:null,G=s.Form.useWatch(e=>_e?JSON.stringify(n.U(_e).map(t=>{let r=t=>t.reduce((e,t)=>e==null?e:e[t],e),a=B&&(!b||b.has(t))?r([...i.slice(0,2),...n.jt(t)]):void 0;return(vp(a)?r(n.jt(t)):a)??null})):``,{form:r,preserve:!0}),K=(0,o.useMemo)(()=>{if(!_e||!G)return null;let e=JSON.parse(G),t={};return n.U(_e).forEach((n,r)=>{t[n]=e[r]}),t},[G]),ve=o.default.useContext(Cp),ye=e.exclusiveInGroup&&B?[i[0]]:[`__noop_exclusive_watch__`],be=s.Form.useWatch(ye,r),xe=(0,o.useMemo)(()=>{if(!e.exclusiveInGroup||!B||!Array.isArray(be))return!1;let t=i[1],n=i[i.length-1];return be.some((e,r)=>r!==t&&gp(e?.[n]))},[e.exclusiveInGroup,B,be,i]),Se=e.locationCountryFrom?n.jt(e.locationCountryFrom):[`__noop_loc_country__`],Ce=e.locationCountryFrom&&B?[...i.slice(0,2),...n.jt(e.locationCountryFrom)]:[`__noop_loc_country_row__`],we=s.Form.useWatch(Se,r),Te=s.Form.useWatch(Ce,r),Ee=vp(Te)?we:Te,De=e.locationStateFrom?n.jt(e.locationStateFrom):[`__noop_loc_state__`],Oe=e.locationStateFrom&&B?[...i.slice(0,2),...n.jt(e.locationStateFrom)]:[`__noop_loc_state_row__`],ke=s.Form.useWatch(De,r),Ae=s.Form.useWatch(Oe,r),je=vp(Ae)?ke:Ae,Me=e.dataSource===`locationMaster`&&(e.locationLevel===`state`&&vp(Ee)||e.locationLevel===`city`&&(vp(Ee)||vp(je))),Ne=S||!!e.disabled||ue||(e.disabledByField?gp(W):!1)||!!y||ve||xe||Me;(0,o.useEffect)(()=>{if(x===`location`){let n=!1;async function r(){try{E(!0);let r=new URLSearchParams({search:D,limit:String(e.limit??50),offset:`0`}),i=await t.o(t.x,`/admin/location-dropdown-values?${r}`),a=i?.data??i??[];n||w(xp(Array.isArray(a)?a:[]))}catch(t){console.error(`[EditFormV1] Failed to fetch locations for "${e.field}":`,t),n||w([])}finally{n||E(!1)}}return r(),()=>{n=!0}}let r=e.dataSource;if(![`select`,`radio`,`checkbox`].includes(x)||!r||r===`static`)return;if(r===`lookup`&&e.lookupFilterField&&vp(re)){w([]),E(!1);return}let i=!1;async function a(){try{E(!0);let a=[];if(r===`master`||r===`module`)a=await n.vn(f,e.field,r===`master`?j:``,e.limit??50,0,{dataSource:r,masterName:e.masterName,groupName:e.groupName});else if(r===`lookup`){let r=new URLSearchParams({collection:e.lookupCollection??``,displayField:e.displayField??``,valueField:e.valueField??`_id`});e.displayField2&&r.set(`displayField2`,e.displayField2),k&&r.set(`search`,k),e.lookupFilterField&&!vp(re)&&(r.set(`filterField`,e.lookupFilterField),r.set(`filterValue`,String(re)));let i={field:e.field,extraFields:e.extraFields,optionsRequireExtraField:e.optionsRequireExtraField,optionsRequireExtraValue:e.optionsRequireExtraValue,optionsHierarchyParentField:e.optionsHierarchyParentField,optionsHierarchySelfFrom:e.optionsHierarchySelfFrom},o=n.B(i);o.length&&r.set(`extraFields`,o.join(`,`));let s=await t.o(t.x,`/admin/lookup-dropdown-values?${r}`);a=s?.data??s??[],a=n.z(a,i,{source:`EditFormV1`})}else if(r===`locationMaster`){let n=e.locationLevel||`country`;if(n===`state`&&vp(Ee))a=[];else if(n===`city`&&(vp(Ee)||vp(je)))a=[];else{let r=new URLSearchParams({level:n,limit:String(e.limit??250),offset:`0`});vp(Ee)||r.set(`country`,String(Ee)),vp(je)||r.set(`state`,String(je)),k&&r.set(`search`,k);let i=await t.o(t.x,`/admin/location-dropdown-values?${r}`);a=i?.data??i??[]}}else if(r===`group`){let n=String(e.groupName??``).toLowerCase().trim();if(n===`users`||n===`user`){let n=await t.o(t.x,`/get-all-users?limit=500&offset=0`),r=n?.data?.users??n?.users??n?.data??[],i=String(e.groupRoleContains??``).trim().toLowerCase(),o=i?Array.isArray(r)?r.filter(e=>String(e.roleName??``).toLowerCase().includes(i)):[]:r;a=Array.isArray(o)?o.map(e=>({label:[e.firstName,e.lastName].filter(Boolean).join(` `).trim()||e.userName||e.email||String(e.userId??e.id),value:e.userId??e.id})):[]}}i||(z.current=Array.isArray(a)?a:[],w(xp(z.current)))}catch(t){console.error(`[EditFormV1] Failed to fetch options for "${e.field}":`,t),i||w([])}finally{i||E(!1)}}return a(),()=>{i=!0}},[x,e.dataSource,e.field,e.lookupCollection,e.displayField,e.displayField2,e.valueField,e.lookupFilterField,re,e.groupName,e.groupRoleContains,e.masterName,e.limit,D,k,j,f,e.extraFields,e.optionsRequireExtraField,e.optionsRequireExtraValue,e.optionsHierarchyParentField,e.optionsHierarchySelfFrom,L,e.locationLevel,e.locationCountryFrom,e.locationStateFrom,Ee,je]);let Pe=xp([e.options,e.values].find(e=>Array.isArray(e)&&e.length>0)??(x===`checkbox`?[]:ep(e))),Fe=C??Pe,[Ie,Le]=(0,o.useState)([]),Re=n.b(a,Fe).join(`,`);(0,o.useEffect)(()=>{if(!Re||e.dataSource!==`lookup`||T)return;let t=!1;return n.v(e,Re.split(`,`)).then(e=>{t||Le(e)}).catch(()=>{t||Le([])}),()=>{t=!0}},[Re,e.dataSource,e.lookupCollection,e.displayField,e.displayField2,e.valueField,T]);let ze=n.y(Fe,Ie),q=de?n.V(ze,ge):ze,J=_e?n.H(q,_e,K??{}):q,Y=(e.multiSelect?`multiple`:e.mode??(gp(e.multiple)?`multiple`:void 0))??(n.Yt(e)===`array`?`multiple`:void 0),X=gp(e.allowCustomValues),Be=X?`tags`:Y,Ve=!!e.multiSelect||gp(e.multiple)||n.Yt(e)===`array`||Y===`multiple`,He=X?typeof e.tokenSeparators==`string`&&e.tokenSeparators?e.tokenSeparators.split(``):[`,`]:void 0,Ue=[`select`,`location`].includes(x),We=e.hidePlaceholder?void 0:e.placeholder??`${Ue?`Select`:`Enter`} ${String(e.label??``).toLowerCase()}`,Ge=Hp(e),Ke=()=>{setTimeout(()=>{r.validateFields([i]).catch(()=>{})})},qe=e=>{r.setFieldValue(i,e),Ke()},Je=n.ot({field:e,form:r,name:i,moduleName:f,scopeValues:h,ownValue:a,onDone:(t,a)=>{R(e=>e+1);let o=n.Yt(e)!==`array`&&!e.multiSelect&&!e.multiple;t===`create`&&a!=null&&o&&((e.clearGroupOnChange||e.linkedClearField)&&n.x(r,e,i,b),qe(n.tn(e)?{value:a}:a))}}),Ye=e.validator?.type?{...e.validator,title:e.validator.title||e.label||`Field`}:null,Xe={...Ge,value:a,disabled:Ne,placeholder:We,prefix:e.icon?null:hp[e.field],onChange:t=>{let r=e.formatter?Kp(t.target.value,e.formatter):t.target.value;if(Ye){let{cleaned:e,error:t}=n.St(r,Ye,`change`);I(t),r=e}qe(r)},...Ye&&{onBlur:e=>{let{cleaned:t,error:r}=n.St(e.target.value,Ye,`blur`);I(r),t!==e.target.value&&qe(t)},onKeyPress:e=>{let t=n.Ct(Ye.type);if(!t||e.which===0||e.keyCode===8||e.keyCode===13)return;let r=String.fromCharCode(e.which??e.keyCode);if(!t.test(r)){e.preventDefault();let t=`${Ye.title} — invalid character.`;I(t),setTimeout(()=>I(e=>e===t?null:e),1800)}},maxLength:Ye.maxLength??Ge.maxLength}};if(x===`tagify`)return(0,l.jsx)(s.Select,{value:a,allowClear:!0,disabled:Ne,mode:`tags`,placeholder:We,onChange:qe});if(x===`location`)return(0,l.jsx)(s.Select,{value:a,allowClear:!0,showSearch:!0,filterOption:!1,disabled:Ne,loading:T,mode:Y,options:J,placeholder:We,notFoundContent:T?(0,l.jsx)(s.Spin,{size:`small`}):void 0,onSearch:O,onFocus:()=>O(e=>e),onChange:qe});if(x===`select`){let t=e.dataSource===`lookup`,o=e.dataSource===`master`,c=t||o,u=n.tn(e),d=n.en(e,a,J),f=X&&!Ve?d==null||d===``?void 0:Array.isArray(d)?d:[d]:d;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Select,{value:f,allowClear:!0,disabled:Ne,loading:T,labelInValue:u||void 0,showSearch:e.showSearch!==!1,optionFilterProp:`label`,filterOption:!c&&void 0,mode:Be,tokenSeparators:He,options:J,placeholder:We,notFoundContent:T?(0,l.jsx)(s.Spin,{size:`small`}):void 0,onSearch:t?A:o?M:void 0,onChange:t=>{let a=X&&!Ve&&Array.isArray(t)?t.length?t[t.length-1]:void 0:t;if(qe(a),(e.clearGroupOnChange||e.linkedClearField)&&n.x(r,e,i,b),e.autofillFrom?.length){let t=a&&!Array.isArray(a)&&typeof a==`object`?a.value:a,o=Array.isArray(i)&&i.length>=3&&typeof i[1]==`number`;if(a==null)e.autofillFrom.forEach(({targetField:e})=>{let t=o?[...i.slice(0,2),...n.jt(e)]:n.jt(e);r.setFieldValue(t,null)});else if(z.current.length>0){let a=e.valueField??`_id`,s=z.current.find(e=>Ep(e,a)===t||e._id===t||e.id===t||e.value===t);s&&e.autofillFrom.forEach(({optionKey:e,targetField:t})=>{let a=Ep(s,e)??s.extraData?.[e]??null,c=o?[...i.slice(0,2),...n.jt(t)]:n.jt(t);r.setFieldValue(c,a)})}}},dropdownRender:Je.footer?e=>(0,l.jsxs)(l.Fragment,{children:[e,Je.footer]}):void 0}),Je.modal]})}if(x===`radio`)return(0,l.jsx)(s.Radio.Group,{value:a,disabled:Ne,options:J,onChange:e=>qe(e.target.value)});if(x===`checkbox`)return J.length>0?(0,l.jsx)(s.Checkbox.Group,{value:a,disabled:Ne,options:J,onChange:qe}):(0,l.jsx)(s.Checkbox,{checked:u,disabled:Ne,onChange:t=>{let n=t.target.checked;if(!(n&&_?.(e))&&(qe(n),n&&v?.(e,i),e.linkedClearField&&n)){let t=Array.isArray(i)&&i.length>1?[...i.slice(0,-1),e.linkedClearField]:[e.linkedClearField];r.setFieldValue(t,null)}},children:e.checkboxLabel??e.label});if(x===`text-editor`)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.wn,{value:a??m??``,disabled:Ne,placeholder:We,onChange:e=>{if(Ye){let{error:t}=n.St(e,Ye,`change`);I(t)}qe(e)}}),F&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:F})]});if(x===`textarea`)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(cp,{...Xe,rows:e.rows??3,className:`v1-scroll-textarea`}),F&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:F})]});if(x===`date`)return(0,l.jsx)(s.DatePicker,{value:a,disabled:Ne,placeholder:We,style:{width:`100%`},suffixIcon:(0,l.jsx)(c.CalendarOutlined,{}),disabledDate:Wp(e,r,i),defaultPickerValue:Gp(e),onChange:t=>{qe(t),v?.(e,i)}});if(x===`time`)return(0,l.jsx)(s.TimePicker,{value:a,disabled:Ne,placeholder:We,style:{width:`100%`},onChange:e=>qe(e)});if(x===`file`){let t=e.validations??e.validation??e.rules??[],r=t.find(e=>(typeof e==`string`?e:e?.type)===`fileType`),i=t.find(e=>(typeof e==`string`?e:e?.type)===`fileSize`),o=t.find(e=>(typeof e==`string`?e:e?.type)===`maxFiles`),u=n.pt(e),d=u?u.exts.map(e=>`.${e}`).join(`,`):r?.value?r.value.split(`,`).map(e=>`.${e.trim().replace(/^\./,``)}`).join(`,`):void 0,m=i?Number(i?.value??5):void 0,h=o?Number(o?.value??1):gp(e.multiple)?e.maxCount??5:1,_=Array.isArray(a)?a:[],v=_.length<h,y=e=>e?e<1048576?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(2)} MB`:``,b=e=>{let t=String(e??``).split(`.`).pop()?.toLowerCase();return t===`pdf`?(0,l.jsx)(c.FilePdfOutlined,{className:`v1-file-type-icon v1-file-icon-pdf`}):[`doc`,`docx`].includes(t)?(0,l.jsx)(c.FileWordOutlined,{className:`v1-file-type-icon v1-file-icon-word`}):[`xls`,`xlsx`,`csv`].includes(t)?(0,l.jsx)(c.FileExcelOutlined,{className:`v1-file-type-icon v1-file-icon-excel`}):[`jpg`,`jpeg`,`png`,`gif`,`svg`,`webp`].includes(t)?(0,l.jsx)(c.FileImageOutlined,{className:`v1-file-type-icon v1-file-icon-image`}):(0,l.jsx)(c.FileOutlined,{className:`v1-file-type-icon v1-file-icon-default`})},x=e=>{qe(_.filter((t,n)=>n!==e))},S=async(t,r)=>{let i=[];if(_.some(e=>!(e?.originFileObj instanceof File))&&f&&p&&e?.field)try{let t=await n.gn(f,p,e.field);i=Array.isArray(t?.data)?t.data:[]}catch(e){console.warn(`Unable to resolve presigned document URL:`,e)}let a=e=>String(e??``).split(`?`)[0].split(`#`)[0].split(`/`).pop()?.toLowerCase()??``,o=_.map((e,t)=>{if(e?.originFileObj instanceof File)return{url:URL.createObjectURL(e.originFileObj),name:e.name??e.originFileObj.name??`file`,type:e.originFileObj.type||void 0};let r=a(e?.name??e?.fileName??e?.originalName??e?.url??e?.location),o=i.find(e=>{let t=a(e?.fileName??e?.name??e?.uploadedFileName??e?.originalName??e?.fileUrl??e?.url);return r&&t&&r===t})??i[t]??(_.length===1?i[0]:null),s=o?.fileUrl??o?.downloadUrl??o?.signedUrl??o?.url??e?.fileUrl??e?.downloadUrl??e?.signedUrl??e?.url??e?.thumbUrl??``;return s&&!s.startsWith(`http`)&&!s.startsWith(`blob:`)&&(s=n.It(s)),{url:s,name:o?.fileName??o?.name??e?.name??`file`,type:o?.mimeType??o?.contentType??e?.type??void 0}}).filter(e=>e.url);if(!o.length){s.message.error(`Unable to resolve a preview URL for this document.`);return}let c=Math.min(r??0,o.length-1);P({open:!0,docs:o,index:c})},C=h>1,w=h-_.length,T=[u?u.hint:d?d.split(`,`).map(e=>e.replace(`.`,``).toUpperCase()).join(`, `):null,m?`up to ${m} MB`:null].filter(Boolean).join(` `),E=C&&_.length>0?[T,`${w} of ${h} remaining`].filter(Boolean).join(` • `):T,D=_.length>0?`Add ${C?`more files`:`file`}`:e.buttonLabel??`Upload ${e.label??`File`}`,O=e=>{if(_.length>=h)return s.Upload.LIST_IGNORE;if(d){let t=(e.name.split(`.`).pop()??``).toLowerCase();if(!d.split(`,`).map(e=>e.replace(/^\./,``).toLowerCase()).includes(t))return s.message.error(u?u.error:r?.message??`Only ${r.value} files are allowed`),s.Upload.LIST_IGNORE}return m!==void 0&&e.size/1024/1024>m&&(s.message.error(i?.message??`File must be smaller than ${m} MB`),s.Upload.LIST_IGNORE)},k=({fileList:e})=>{let t=e.slice(0,h);if(qe(t),g&&t.length>_.length){let e=t[t.length-1];e?.originFileObj&&g(e.originFileObj)}},A={accept:d,fileList:_,showUploadList:!1,multiple:!0,maxCount:h,beforeUpload:O,onChange:k,disabled:Ne},j=_.map((e,t)=>(0,l.jsxs)(`div`,{className:`v1-file-item`,children:[(0,l.jsx)(`div`,{className:`v1-file-item-icon`,children:b(e.name)}),(0,l.jsxs)(`div`,{className:`v1-file-item-info`,children:[(0,l.jsx)(`span`,{className:`v1-file-item-name`,title:e.name,children:e.name}),(0,l.jsx)(`span`,{className:`v1-file-item-meta`,children:e.existing?`Previously uploaded`:`${y(e.size)}${e.size?` • `:``}Uploaded just now`})]}),(0,l.jsxs)(s.Space,{size:6,className:`v1-file-item-actions`,children:[(0,l.jsx)(s.Button,{size:`small`,icon:(0,l.jsx)(c.EyeOutlined,{}),onClick:()=>S(e,t),className:`v1-file-view-btn`,children:`View`}),(0,l.jsx)(s.Button,{size:`small`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>x(t),className:`v1-file-delete-btn`})]})]},e.uid??t)),M=(0,l.jsx)(n.Cn,{documents:N.docs,open:N.open,onClose:()=>P(e=>({...e,open:!1})),initialIndex:N.index});if(C){let t=_.length>0?`Upload more ${e.label??`files`}`:e.buttonLabel??`Upload ${e.label??`File`}`;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`v1-file-upload-wrapper`,children:[v&&(0,l.jsx)(s.Upload,{...A,style:{width:`100%`,display:`block`},children:(0,l.jsxs)(`div`,{className:`v1-upload-dropzone v1-upload-dropzone-center${Ne?` v1-upload-dropzone-disabled`:``}`,children:[(0,l.jsxs)(`div`,{className:`v1-upload-dropzone-title-row`,children:[(0,l.jsx)(c.CloudUploadOutlined,{className:`v1-upload-cloud-icon v1-upload-cloud-icon-sm`}),(0,l.jsx)(`span`,{className:`v1-upload-dropzone-title v1-upload-dropzone-title-blue`,children:t})]}),(0,l.jsx)(`span`,{className:`v1-upload-dropzone-sub`,children:`Drag & drop or click to upload`}),T&&(0,l.jsx)(`span`,{className:`v1-upload-dropzone-sub`,children:T})]})}),_.length>0&&(0,l.jsx)(`div`,{className:`v1-file-grid`,children:j}),v&&_.length>0&&(0,l.jsx)(s.Upload,{...A,style:{display:`inline-block`},children:(0,l.jsx)(s.Button,{type:`link`,size:`small`,icon:(0,l.jsx)(c.PlusOutlined,{}),className:`v1-add-more-files-btn`,children:`Add more files`})})]}),M]})}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`v1-file-upload-wrapper`,children:[_.length>0&&(0,l.jsx)(`div`,{className:`v1-file-rows-single`,children:j}),v&&(0,l.jsx)(s.Upload,{accept:d,fileList:_,showUploadList:!1,multiple:!1,maxCount:1,beforeUpload:O,onChange:k,disabled:Ne,style:{width:`100%`,display:`block`},children:(0,l.jsxs)(`div`,{className:`v1-upload-dropzone v1-upload-dropzone-single${Ne?` v1-upload-dropzone-disabled`:``}`,children:[(0,l.jsx)(c.CloudUploadOutlined,{className:`v1-upload-cloud-icon`}),(0,l.jsx)(`span`,{className:`v1-upload-dropzone-title`,children:D}),E&&(0,l.jsxs)(`span`,{className:`v1-upload-dropzone-sub`,children:[`— `,E]})]})})]}),M]})}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Input,{...Xe,type:x===`number`?`number`:x,...x===`number`&&gp(e.decimal)?{step:`any`}:{},...e.suffix?{suffix:e.suffix}:{}}),F&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:F})]})}function Jp({icon:e,title:t}){return(0,l.jsxs)(s.Space,{size:10,align:`center`,children:[(0,l.jsx)(`div`,{className:`v1-section-icon-box`,children:e}),(0,l.jsx)(sp,{strong:!0,className:`v1-section-label`,children:t})]})}function Yp(e){let t=e?.helpText,n=(Array.isArray(t)?t:[t]).map(e=>e==null?``:String(e).trim()).filter(Boolean);if(n.length)return(0,l.jsx)(`span`,{className:`v1-field-help-text`,children:n.map((e,t)=>(0,l.jsx)(sp,{type:`secondary`,className:`v1-field-help-line`,children:e},t))})}function Xp({moduleName:e,groupName:r,recordId:i,authToken:u,clientId:f,region:p,breadcrumbItems:m=[],submitText:h=`Update`,cancelPath:g,onSuccess:_,fieldNameMap:v={},onFileUpload:y=null,onBeforeSubmit:b=null,extraPayload:x=null,embedded:S=!1,onCancel:C=null}){let w=(0,d.useNavigate)(),T=(0,d.useLocation)(),[E]=s.Form.useForm();(0,o.useEffect)(()=>(u&&t.g(u),()=>{u&&t.r()}),[u]);let[D,O]=(0,o.useState)({}),[k,A]=(0,o.useState)([]),[j,M]=(0,o.useState)([]);(0,o.useEffect)(()=>{if(!e||!i){M([]);return}let t=!1;return n.gn(e,i).then(e=>{t||M(Array.isArray(e)?e:e?.data??[])}).catch(()=>{t||M([])}),()=>{t=!0}},[e,i]);let[N,P]=(0,o.useState)(!1),[F,I]=(0,o.useState)(``),[L,R]=(0,o.useState)(!1),[z,B]=(0,o.useState)(``),[V,H]=(0,o.useState)(null),[U,ee]=(0,o.useState)(()=>new Set),[te,ne]=(0,o.useState)(``),re=f||te,[ie,ae]=(0,o.useState)({});(0,o.useEffect)(()=>{n.Bn()},[]),(0,o.useEffect)(()=>{let t=!1;return queueMicrotask(()=>{if(!t){if(!e){H(null);return}n.Rr({roleId:localStorage.getItem(`roleId`)},e,{clientId:re,region:p}).then(e=>{t||H(Array.isArray(e)&&e.length?e:null)}).catch(()=>{t||H(null)})}}),()=>{t=!0}},[e,re,p]),(0,o.useEffect)(()=>{let t=!1;return queueMicrotask(()=>{if(!t){if(!e){ee(new Set);return}n.Fr(e).then(e=>{t||ee(new Set(Array.isArray(e)?e:[]))}).catch(()=>{t||ee(new Set)})}}),()=>{t=!0}},[e]);let W=(0,o.useMemo)(()=>Ap(k,e,V,U),[k,e,V,U]),oe=(0,o.useCallback)(async(e,t)=>{if(!Array.isArray(t)||t.length<3||typeof t[1]!=`number`)return;let r=t[0],i=t[1],a=W.find(e=>e.name===r);if(!a)return;let o=n.A(a,n.zn().region);if(!o.orderBy)return;await Promise.resolve();let s=E.getFieldValue(r);Array.isArray(s)&&await n.k({group:o,rows:s,rowIndex:i,move:he.current[r]?.move,confirm:({title:e,body:t,okText:r,cancelText:i,from:a,to:o})=>n.Bt({tone:`suggestion`,title:e,facts:[{label:`This entry is at`,value:`Row ${a+1}`},{label:`It belongs at`,value:`Row ${o+1}`}],body:t,okText:r,cancelText:i})})},[W,E]),se=(0,o.useCallback)(e=>{let t=n.zn().region,r=W.find(t=>(t.fields??[]).some(t=>t.field===e.field));if(!r)return!1;let i=n.A(r,t),a=i.orderBy?.inProgressField??`currentStudyingHere`;if(e.field!==a||n.w(i))return!1;let o=n.T(i);return n.Vt({tone:o?`duplicate`:`overwrite`,title:o?`This has to be completed first`:`You can add this, but they cannot be submitted`,facts:[{label:`Region`,value:t||`Common`},{label:`Entry`,value:r.label??r.name}],body:n.E(i),okText:o?`Got it`:`Keep it anyway`}),o},[W]),ce=(0,o.useCallback)((e,t)=>{let r=W.find(e=>e.name===t);if(!r)return;let i=n.A(r,n.zn().region),a=i.orderBy?.inProgressField??`currentStudyingHere`;if(e.field!==a)return;let o=n.S(i);return o?[o]:void 0},[W]),[le,ue]=(0,o.useState)(0),de=(0,o.useMemo)(()=>n.yt({checkFieldUnique:n.ht,onPendingChange:ue}),[]),fe=(0,o.useMemo)(()=>({checker:de,module:e,recordId:i,clientId:re||void 0,region:p||void 0}),[de,e,i,re,p]),pe=(0,o.useMemo)(()=>n.vt(W),[W]),me=(0,o.useMemo)(()=>n.Ht(W),[W]),he=(0,o.useRef)({}),ge=n.Ot({form:E,groups:W,module:e}),_e=(0,o.useMemo)(()=>{let e={};return W.forEach(t=>{t.addRow&&(e[t.name]=n.At(t))}),n.Wt(me,e)},[W,me]),G={jobs:{list:`Jobs`,path:`/jobs`,edit:`Edit Job`},candidates:{list:`Candidates`,path:`/candidates`,edit:`Edit Candidate`},submissions:{list:`Submissions`,path:`/submissions`,edit:`Edit Submission`}},K=S?[]:m.length>0?m:(()=>{let t=G[bp(e)];return t?[{label:`Home`,href:`/`},{label:t.list,href:t.path},{label:t.edit}]:[]})();(0,o.useEffect)(()=>{if(!e||!i)return;let t=!1;async function n(){try{P(!0),I(``),B(``);let n=await a.r({module:e,id:i,clientId:re,region:p,group:r});if(t)return;if(A(Array.isArray(n)?n:[]),ae(n?.recordMeta??{}),!f){let e=n?.recordMeta??{},r=e=>e&&typeof e==`object`?e.id??e.value??``:e??``,i=String(r(e.clientId)||``),o=String(r(e.jobId)||``);if(!i&&o)try{let e=await a.r({module:`jobs`,id:o});i=String(r(e?.recordMeta?.clientId)||``)}catch{}!t&&i&&i!==te&&ne(i)}}catch(n){console.error(`Failed to fetch ${e} edit data:`,n),t||I(n?.message||`Failed to load record`)}finally{t||P(!1)}}return n(),()=>{t=!0}},[e,r,i,f,re,te,p]),(0,o.useEffect)(()=>{N||W.length===0||n.kt(E,W)},[N,W,E]),(0,o.useEffect)(()=>{if(N||W.length===0||j.length===0)return;let e=new Map;j.forEach(t=>{let n=t?.fieldName||t?.field;n&&(e.has(n)||e.set(n,[]),e.get(n).push(t))});let t={},r=!1;W.forEach(i=>{gp(i.addRow)||(i.fields??[]).forEach(i=>{if(!i?.field||!n.Zt(i))return;let a=E.getFieldValue(n.jt(i.field));if(Array.isArray(a)?a.length>0:!vp(a))return;let o=e.get(i.field)??(i.fileKey?e.get(i.fileKey):null);if(!o?.length)return;let s=gp(i.multiple)?Number(i.maxCount??5):1;n.Mt(t,i.field,o.slice(0,s).map(e=>({uid:String(e._id??e.s3Key??e.fileName),name:e.fileName??e.uniqueName??`file`,status:`done`,url:e.fileUrl??e.s3Key??``,existing:!0,stored:e}))),r=!0})}),r&&E.setFieldsValue(t)},[N,W,j,E]);let ve=T.state?.carryFiles;(0,o.useEffect)(()=>{if(N||!ve)return;let e=Object.entries(ve).filter(([,e])=>Array.isArray(e)&&e.length>0);e.length&&(E.setFieldsValue(Object.fromEntries(e)),s.message.info(`The résumé you uploaded has been attached here — save to keep it.`),w(T.pathname+T.search,{replace:!0,state:{...T.state??{},carryFiles:null}}))},[N,ve,E,w,T.pathname,T.search,T.state]);let ye=(0,o.useMemo)(()=>n.q(W.map(e=>({...e,fields:(e.fields??[]).filter(n.Z)})),bp),[W]),[be,xe]=(0,o.useState)({});(0,o.useEffect)(()=>{if(ye.length===0)return;let e=!1;return ye.forEach(async t=>{let r=n.J(t,ie);if(r)try{let i=await a.r({module:t,id:r}),o=n.X(n.Y(i));!e&&Object.keys(o).length>0&&xe(e=>({...e,[t]:o}))}catch(e){console.error(`Carrier prefill fetch failed for ${t}:`,e)}}),()=>{e=!0}},[ye,ie]),(0,o.useEffect)(()=>{if(N||W.length===0||Object.keys(be).length===0)return;let e={},t=!1;W.forEach(r=>(r.fields??[]).forEach(r=>{if(!r.field||!r.prefillFromModule||!n.Z(r))return;let i=be[bp(r.prefillFromModule)],a=n.Q(i,r);a!=null&&(n.Mt(e,r.field,a),t=!0)})),t&&E.setFieldsValue(e)},[be,N,W,E]);let Se=e=>{O(t=>({...t,[e]:!t[e]}))},Ce=(0,o.useMemo)(()=>W.map(e=>`${e.name}:${+!!gp(e.allowCollapse)}${+!!gp(e.defaultCollapsed)}`).join(`|`),[W]),we=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!W.length||we.current===Ce)return;we.current=Ce;let e={};W.forEach((t,n)=>{let r=t.name??t.id??String(n);gp(t.allowCollapse)&&gp(t.defaultCollapsed)&&(e[r]=!0)}),O(e)},[Ce,W]);function Te(t){let r=n.Kt(t,W,{module:e});return Object.entries(v).forEach(([e,t])=>{r[e]!==void 0&&(r[t]=r[e],delete r[e])}),r}async function Ee(t){if(!(b&&await Promise.resolve().then(()=>b(t)).catch(()=>!1)===!1))try{R(!0),B(``);let r=n.Jt(t,W,{indexed:!0,module:e});if(y&&y.useLegacyUpload){let e=W.flatMap(e=>e.fields??[]).filter(n.Zt);for(let n of e){let e=t[n.field];if(!Array.isArray(e))continue;let r=e.filter(e=>e.originFileObj instanceof File);try{await Promise.all(r.map(e=>y(n.field,e.originFileObj,i)))}catch(e){console.warn(`File upload failed — continuing with save:`,e)}}}await n.hn(e,i,{...Te(t),...x??{}},y?.useLegacyUpload?[]:r);let a=n.Jt(t,W,{module:e});if(!y?.useLegacyUpload&&a.length>0)try{await n._n(e,i,a)}catch(e){console.error(`Document registry upload failed during edit:`,e),s.message.warning(`Changes saved, but saving document records failed.`)}let o=n.d(W,e,`edit`);if(o&&s.message.success(o),_)_(i,t);else{let e=n.M(W);if(!e)n.j(w,{cancelPath:g});else if(e.mode===`back`)n.j(w,{cancelPath:g});else if(e.mode===`route`||e.mode===`detail`){let r=n.N(e.target,i,t);r?w(r):n.j(w,{cancelPath:g})}}}catch(t){if(console.error(`Failed to update ${e}:`,t),De(t))return;let r=n.u(W,e,`edit`,t?.message);B(r),s.message.error(r)}finally{R(!1)}}function De(e){let t=n.bt(e,{uniqueRules:pe});return t.length!==0&&(E.setFields(t.map(e=>({name:e.name??e.field,errors:[e.message]}))),O({}),n.l({errorFields:t.map(e=>{let t=e.name??e.field;return{name:Array.isArray(t)?t:[t],errors:[e.message]}})},E),!0)}let Oe=e=>{O({}),n.l(e,E)},[ke,Ae]=(0,o.useState)({}),je=e=>String(e?.field??``),Me=(e,t)=>typeof e==`function`?e(t):e,Ne=(e,t,n)=>{if(!e?.field)return!0;let r=Me(n,e.field),i=t(r==null?[e.field]:[...Array.isArray(r)?r:[r],e.field]);switch(e.operator){case`eq`:return String(i??``)===String(e.value??``);case`neq`:return String(i??``)!==String(e.value??``);case`truthy`:return i!=null&&i!==``&&i!==!1;case`falsy`:return i==null||i===``||i===!1;case`notEmpty`:return Array.isArray(i)?i.length>0:!!i;case`in`:return String(e.value??``).split(`,`).map(e=>e.trim()).includes(String(i??``));case`notIn`:return!String(e.value??``).split(`,`).map(e=>e.trim()).includes(String(i??``));default:return!0}},Pe=(e,t,n)=>{if(!e)return!0;let r=Array.isArray(e.conditions)?e.conditions.filter(e=>e?.field):[];if(r.length){let i=r.map(e=>Ne(e,t,n)),a=String(e.logic??`and`).toLowerCase()===`or`,o=a?i.some(Boolean):i.every(Boolean);if(e.field){let r=Ne(e,t,n);o=a?o||r:o&&r}return o}return Ne(e,t,n)},Fe=e=>!!(e?.field||e?.conditions?.some?.(e=>e?.field)),Ie=(t,r,a,c={})=>{let u=typeof t.field==`string`&&t.field.includes(`.`)?t.field.split(`.`):null,d=u??t.field,p=r===void 0?d:[r,...u??[t.field]],m=a!==void 0&&r!==void 0?[...Array.isArray(a)?a:[a],...Array.isArray(p)?p:[p]]:p,h=t.type===`checkbox`&&(t.options&&t.options.length>0||t.dataSource&&t.dataSource!==`static`),g=!h&&t.type===`checkbox`?`checked`:`value`,_=!!t.editablePermission&&!n.F(t.editablePermission,e),v=a!==void 0&&r!==void 0?[...Array.isArray(a)?a:[a],r]:null,y=e=>v&&(!c.rowFieldKeys||c.rowFieldKeys.has(e))?v:null,b=n.nn(t),x=b?n.rn(t,m,y):null,S=c.inline||c.hideLabel||!h&&t.type===`checkbox`?``:(0,l.jsx)(dp,{form:E,field:t,siblingPrefix:t.labelWhen?.field?y(t.labelWhen.field):v,locked:_}),C=b&&S?(0,l.jsxs)(`span`,{className:`v1-label-with-override`,children:[S,(0,l.jsx)(n.K,{form:E,field:t,flagPath:x,fieldPath:m,disabled:_})]}):S,w=c.inline||t.type===`text-editor`||t.type===`file`&&gp(t.multiple)?24:t.col??12,T=Vp(t,m,y),D=n.R(t),O=c.inline?{flex:`${Number(t.combineWidth)>0?Number(t.combineWidth):1} 1 0`,maxWidth:`none`}:void 0,k=(t.aiActions||[]).filter(e=>e.trigger===`click`),A=(t.aiActions||[]).find(e=>e.trigger===`upload`),j=(0,l.jsx)(s.Form.Item,{label:C,name:p,extra:Yp(t),required:zp(t),rules:Bp(t,E,m,!1,y,fe,ce(t,c.groupNameForActions)),dependencies:T,valuePropName:g,getValueFromEvent:t.type===`file`?e=>Array.isArray(e)?e:e?.fileList:void 0,validateTrigger:[`onBlur`,`onChange`],children:(0,l.jsx)(qp,{field:t,form:E,name:m,rowFieldKeys:c.rowFieldKeys,moduleName:e,recordId:i,initialValue:t.value,scopeValues:{clientId:f},onAiUpload:A?e=>ge.runAction(c.groupNameForActions,t,A,e):void 0,formDisabled:ge.busy,onRegionBlocked:se,onRowOrderChange:oe})}),M=D&&!C?(0,l.jsx)(s.Tooltip,{title:D,children:(0,l.jsx)(`span`,{className:`v1-field-tooltip-wrap`,children:j})}):j,N=k.length>0?(()=>{let e=n.Dt(k),r=r=>(0,l.jsx)(n.Et,{position:r,actions:e[r],aiActions:ge,groupName:c.groupNameForActions,field:t},r);return(0,l.jsxs)(`div`,{className:`v1-ai-action-wrap`,children:[r(`top-left`),r(`top-center`),r(`top-right`),M,r(`bottom-left`),r(`bottom-center`),r(`bottom-right`)]})})():M,P=e=>r===void 0?e:[r,e],F=t.verifyAction?(0,l.jsxs)(l.Fragment,{children:[t.verifyResultField&&(0,l.jsx)(s.Form.Item,{name:P(t.verifyResultField),hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Input,{})}),t.verifyTimestampField&&(0,l.jsx)(s.Form.Item,{name:P(t.verifyTimestampField),hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Input,{})})]}):null,I=t.verifyAction?(0,l.jsxs)(`div`,{className:`v1-verify-field-row`,children:[N,(0,l.jsx)(up,{form:E,field:t,absoluteName:m}),F]}):N,L=b?(0,l.jsxs)(l.Fragment,{children:[I,(0,l.jsx)(s.Form.Item,{name:r===void 0?x[x.length-1]:[r,x[x.length-1]],valuePropName:`checked`,hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Checkbox,{})})]}):I,R=t.prefillWhen?.length?(0,l.jsx)(pp,{form:E,rules:t.prefillWhen,watchPaths:n.W(t.prefillWhen,m,n.at,y),targetPath:m,resetOnNoMatch:t.prefillWhenReset!==!1},`${t.field}-prefillWhen`):null,z=!c.inline&&n.n(t).length>0,B=e=>z?n.s(t,w,t=>e(n.r(t,y(t.field)))):w;return Fe(t.showIf)||z?(0,l.jsxs)(o.default.Fragment,{children:[R,(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,noStyle:!0,children:({getFieldValue:e})=>!Fe(t.showIf)||Pe(t.showIf,e,y)?(0,l.jsx)(s.Col,{xs:24,md:B(e),style:O,className:c.inline?`v1-combine-cell`:void 0,children:L}):null})]},t.field):(0,l.jsxs)(o.default.Fragment,{children:[R,(0,l.jsx)(s.Col,{xs:24,md:w,style:O,className:c.inline?`v1-combine-cell`:void 0,children:L})]},t.field)},Le=t=>{let r=typeof t.field==`string`&&t.field.includes(`.`)?t.field.split(`.`):[t.field],a=!!t.editablePermission&&!n.F(t.editablePermission,e),o=(0,l.jsx)(Dp,{field:t,label:t.label,locked:a}),u=n.$t(t),d=Array.isArray(t.subFields)&&t.subFields.length>0,p=d?t.subFields.map(e=>({...e,show:1,edit:1})):null,m=Math.max(0,Number(t.minRows??0)||0),h=t.maxRows!==void 0&&t.maxRows!==``&&Number(t.maxRows)>0?Number(t.maxRows):0,g=n.qt(t,t.value);return(0,l.jsx)(s.Col,{xs:24,md:24,children:(0,l.jsx)(s.Form.Item,{label:o,required:zp(t),colon:!1,className:`v1-combine-field`,children:(0,l.jsx)(s.Form.List,{name:r,initialValue:g,rules:[{validator:async(e,n=[])=>{if(zp(t)&&!(d?n.some(e=>yp(e)):n.some(e=>e!=null&&e!==``&&!(Array.isArray(e)&&e.length===0))))throw Error(`Mandatory Field`);if(m>0&&n.length<m)throw Error(`Keep at least ${m} ${d?`row`:`value`}${m>1?`s`:``}.`)}}],children:(n,{add:a,remove:o},{errors:g})=>(0,l.jsxs)(`div`,{className:`v1-addrow-wrapper`,children:[n.map(({key:a,name:h})=>(0,l.jsxs)(`div`,{className:`v1-addrow-item`,children:[(0,l.jsx)(s.Button,{type:`text`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>o(h),disabled:n.length<=m,className:`v1-addrow-delete-btn`}),(0,l.jsx)(`div`,{className:`v1-addrow-fields`,children:d?(0,l.jsx)(s.Row,{gutter:[24,0],align:`top`,children:q(p,h,r[0],!1,t.field)}):(0,l.jsx)(s.Form.Item,{name:[h],noStyle:!0,valuePropName:t.type===`checkbox`&&!t.options?.length?`checked`:`value`,getValueFromEvent:t.type===`file`?e=>Array.isArray(e)?e:e?.fileList:void 0,rules:Bp(u,E,[...r,h],!1),children:(0,l.jsx)(qp,{field:u,form:E,name:[...r,h],moduleName:e,recordId:i,scopeValues:{clientId:f},formDisabled:ge.busy,onRegionBlocked:se,onRowOrderChange:oe})})})]},a)),(!h||n.length<h)&&(0,l.jsx)(s.Button,{type:`link`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>a(),className:`v1-addrow-add-btn`,children:t.addLabel??`Add ${t.label??`Value`}`}),(0,l.jsx)(s.Form.ErrorList,{errors:g})]})})})},t.field)},Re=(t,r,a)=>{let o=typeof t.field==`string`&&t.field.includes(`.`)?t.field.split(`.`):[t.field],u=!!t.editablePermission&&!n.F(t.editablePermission,e),d=(0,l.jsx)(Dp,{field:t,label:t.label,locked:u}),p=n.$t(t),m=Array.isArray(t.subFields)&&t.subFields.length>0,h=m?t.subFields.map(e=>({...e,show:1,edit:1})):null,g=Math.max(0,Number(t.minRows??0)||0),_=t.maxRows!==void 0&&t.maxRows!==``&&Number(t.maxRows)>0?Number(t.maxRows):0,v=[r,...o],y=[...Array.isArray(a)?a:[a],r,...o],b=n.qt(t,void 0);return(0,l.jsx)(s.Col,{xs:24,md:m?24:t.col??24,children:(0,l.jsx)(s.Form.Item,{label:d,required:zp(t),colon:!1,className:`v1-combine-field`,children:(0,l.jsx)(s.Form.List,{name:v,initialValue:b,rules:m?[{validator:async(e,n=[])=>{if(zp(t)&&!n.some(e=>yp(e)))throw Error(`Mandatory Field`);if(g>0&&n.length<g)throw Error(`Keep at least ${g} row${g>1?`s`:``}.`)}}]:[],children:(n,{add:r,remove:a},{errors:o})=>(0,l.jsxs)(`div`,{className:`v1-addrow-wrapper`,children:[n.map(({key:r,name:o})=>{let u=[...y,o];return(0,l.jsxs)(`div`,{className:`v1-addrow-item`,children:[(0,l.jsx)(s.Button,{type:`text`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),onClick:()=>a(o),disabled:n.length<=g,className:`v1-addrow-delete-btn`}),(0,l.jsx)(`div`,{className:`v1-addrow-fields`,children:m?(0,l.jsx)(s.Row,{gutter:[24,0],align:`top`,children:q(h,o,y,!1,t.field)}):(0,l.jsx)(s.Form.Item,{name:[o],noStyle:!0,valuePropName:t.type===`checkbox`&&!t.options?.length?`checked`:`value`,getValueFromEvent:t.type===`file`?e=>Array.isArray(e)?e:e?.fileList:void 0,rules:Bp(p,E,u,!1),children:(0,l.jsx)(qp,{field:p,form:E,name:u,moduleName:e,recordId:i,scopeValues:{clientId:f},formDisabled:ge.busy,onRegionBlocked:se,onRowOrderChange:oe})})})]},r)}),(!_||n.length<_)&&(0,l.jsx)(s.Button,{type:`link`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>r(),className:`v1-addrow-add-btn`,children:t.addLabel??`Add ${t.label??`Value`}`}),(0,l.jsx)(s.Form.ErrorList,{errors:o})]})})})},`${a}-${r}-${t.field}`)},ze=(e,t)=>e.filter(e=>e.field&&e.show!==void 0&&!gp(e.show)).map(e=>{let n=String(e.field).includes(`.`)?String(e.field).split(`.`):e.field,r=t===void 0?n:[t,...Array.isArray(n)?n:[n]];return(0,l.jsx)(s.Form.Item,{name:r,hidden:!0,noStyle:!0,children:(0,l.jsx)(s.Input,{})},`hidden-${e.field}`)}),q=(e,t,r,i=!1,a)=>{let o=new Set,c=[],u=new Set(e.map(e=>e.field).filter(Boolean)),d=e.filter(e=>e.show===void 0||gp(e.show));return c.push(...ze(e,t)),d.forEach(e=>{if(gp(e.addRow)&&t===void 0){c.push(Le(e));return}if(gp(e.addRow)&&t!==void 0){c.push(Re(e,t,r));return}let f=e.combineKey?.trim?.();if(!f){c.push(Ie(e,t,r,{hideLabel:i,groupNameForActions:a,rowFieldKeys:u}));return}let p=`${r??`root`}:${t??`root`}:${f}`;if(o.has(p))return;let m=d.filter(e=>e.combineKey===f);m.forEach(e=>o.add(`${r??`root`}:${t??`root`}:${e.combineKey}`));let h=m.find(e=>e.combineLabel)??e,g=r!==void 0&&t!==void 0?[...Array.isArray(r)?r:[r],t]:null,_=m.find(e=>n.nn(e))??null,v=e=>g&&(!u||u.has(e))?g:null,y=_?r!==void 0&&t!==void 0?[...Array.isArray(r)?r:[r],t,...String(_.field).includes(`.`)?String(_.field).split(`.`):[_.field]]:String(_.field).includes(`.`)?String(_.field).split(`.`):_.field:null,b=(0,l.jsx)(dp,{form:E,field:h,siblingPrefix:g,combined:!0}),x=_?(0,l.jsxs)(`span`,{className:`v1-label-with-override`,children:[b,(0,l.jsx)(n.K,{form:E,field:_,flagPath:n.rn(_,y,v),fieldPath:y})]}):b,S=m.find(e=>e.combineToggleTarget)?.combineToggleTarget,C=m.find(e=>e.combineToggleLabel)?.combineToggleLabel??`Show range`,w=m.some(e=>gp(e.combineWrap)),T=Number(m.find(e=>[12,24].includes(Number(e.combineSpan)))?.combineSpan),D=S?m.find(e=>je(e)===S):null,O=D?.field?.includes?.(`.`)?D.field.split(`.`):[D?.field].filter(Boolean),k=D?r!==void 0&&t!==void 0?[r,t,...O]:O.length>1?O:D.field:null,A=m.some(e=>zp(e)),j=[12,24].includes(T)?T:m.length>=3?24:12,M=e=>g&&(!u||u.has(e))?g:null,N=m.some(e=>Fe(e.showIf)),P=e=>m.some(t=>!Fe(t.showIf)||Pe(t.showIf,e,M)),F=(0,l.jsx)(s.Col,{xs:24,md:j,children:(0,l.jsx)(s.Form.Item,{label:x,required:A,colon:!1,className:`v1-combine-field`,children:(0,l.jsx)(s.Form.Item,{noStyle:!0,shouldUpdate:!0,children:({getFieldValue:e})=>{let n=k?!vp(e(k)):!1,i=ke[p]??n,a=S&&!i?m.filter(e=>je(e)!==S):m;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Row,{gutter:[8,0],align:`top`,wrap:w,className:`v1-combine-row${w?` v1-combine-row-wrap`:``}`,children:a.map(e=>Ie(A?{...e,req:1}:e,t,r,{inline:!0}))}),S&&(0,l.jsxs)(`div`,{className:`v1-combine-range`,children:[(0,l.jsx)(s.Switch,{size:`small`,checked:i,onChange:e=>{!e&&k&&(E.setFieldValue(k,void 0),E.validateFields([k]).catch(()=>{})),Ae(t=>({...t,[p]:e}))}}),(0,l.jsx)(sp,{type:`secondary`,className:`v1-combine-toggle-label`,children:C})]})]})}})})},p);c.push(N?(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,noStyle:!0,children:({getFieldValue:e})=>P(e)?F:null},p):F)}),c},J=e=>{let t=e.name??e.id??``,r=n.Ut(me,t),i=!!r&&r.leaderName!==t,a=r?W.find(e=>e.name===r.leaderName)??e:e,o=Math.max(0,Number(a.minRows??0)||0),u=Math.max(0,Number(a.maxRows??0)||0),d=r?r.memberNames:[t],f=()=>{d.forEach(t=>{let r=W.find(e=>e.name===t)??e;he.current[t]?.add(n.Qt(r,{editing:!0}))})},p=e=>{d.forEach(t=>he.current[t]?.remove(e))};return e.addRow?(0,l.jsx)(s.Form.List,{name:t,initialValue:_e[e.name]??[],rules:i?[]:[{validator:async(t,n=[])=>{if(!(gp(e.toggleEnabled)&&e.toggleField&&E.getFieldValue(e.toggleField))){if(o>0&&n.length<o)throw Error(`Keep at least ${o} row${o>1?`s`:``}.`);if(gp(e.requireOne)&&n.some(e=>!yp(e)))throw Error(`Fill at least one field in each added row.`)}}}],children:(n,{add:r,remove:d,move:m},{errors:h})=>(he.current[t]={add:r,remove:d,move:m},(0,l.jsxs)(`div`,{className:`v1-addrow-wrapper`,children:[(0,l.jsx)(`div`,{className:`v1-addrow-topbar`,children:i?(0,l.jsxs)(sp,{type:`secondary`,className:`v1-addrow-linked-hint`,children:[`Rows added via `,a.label??a.name]}):(!u||n.length<u)&&(0,l.jsx)(s.Button,{type:`link`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:f,className:`v1-addrow-add-btn`,children:e.addLabel??`Add ${e.label??`Row`}`})}),gp(e.sharedRowLabels)&&n.length>0&&(0,l.jsx)(s.Row,{gutter:[24,0],className:`v1-addrow-header`,children:e.fields.filter(e=>e.show===void 0||gp(e.show)).map(e=>(0,l.jsx)(s.Col,{md:e.col??12,className:`v1-addrow-header-label`,children:e.label},je(e)))}),n.map(({key:r,name:i})=>(0,l.jsxs)(`div`,{className:`v1-addrow-item`,children:[(0,l.jsx)(s.Button,{type:`text`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),disabled:n.length<=o,onClick:()=>p(i),className:`v1-addrow-delete-btn`}),(0,l.jsx)(`div`,{className:`v1-addrow-fields`,children:(0,l.jsx)(s.Row,{gutter:[24,0],align:`top`,children:q(e.fields,i,t,gp(e.sharedRowLabels),t)})})]},r)),(0,l.jsx)(s.Form.ErrorList,{errors:h})]}))}):(0,l.jsx)(s.Row,{gutter:[24,0],children:q(e.fields,void 0,void 0,!1,t)})},Y=e=>W.filter(t=>t!==e&&t.mergeInto&&String(t.mergeInto)===String(e.name)),X=e=>!!(e.mergeInto&&W.some(t=>t!==e&&String(t.name)===String(e.mergeInto))),Be=(e,t)=>Y(e).filter(e=>String(e.mergePosition??`bottom`)===t),Ve=(e,t)=>{let n=e.name??e.id??String(t),r=J(e),i=Be(e,`top`),a=Be(e,`bottom`),o=e=>{let t=(0,l.jsxs)(`div`,{className:`v1-merged-group`,children:[(0,l.jsx)(`div`,{className:`v1-merged-group-title`,children:e.label??e.name}),J(e)]},e.name),n=e.showIf?.field?(0,l.jsx)(Tp,{form:E,showIf:e.showIf,render:()=>t},e.name):t;return(0,l.jsx)(wp,{form:E,group:e,inheritParent:!1,children:n},e.name)};return(0,l.jsx)(s.Card,{className:`v1-card v1-edit-card`,title:(0,l.jsx)(Jp,{icon:mp[t%mp.length],title:e.label??e.name??`Details`}),extra:(0,l.jsxs)(s.Space,{size:8,align:`center`,className:`v1-group-actions`,children:[(0,l.jsx)(Op,{group:e}),(0,l.jsx)(kp,{group:e}),gp(e.allowCollapse)&&(0,l.jsx)(s.Button,{type:`text`,size:`small`,"aria-expanded":!D[n],"aria-label":D[n]?`Expand section`:`Collapse section`,icon:D[n]?(0,l.jsx)(c.DownOutlined,{}):(0,l.jsx)(c.UpOutlined,{}),onClick:e=>{e.stopPropagation(),Se(n)}})]}),children:(0,l.jsx)(s.Form.Item,{noStyle:!0,shouldUpdate:!0,children:({getFieldValue:t})=>{let s=gp(e.toggleEnabled)&&e.toggleField&&!!t(e.toggleField);return(0,l.jsxs)(`div`,{style:{display:D[n]||s?`none`:`block`},children:[i.map(o),r,a.map(o)]})}})},n)};return(0,l.jsxs)(`main`,{children:[K.length>0&&(0,l.jsx)(n.t,{items:K}),(0,l.jsxs)(`div`,{className:`v1-edit-page`,children:[(0,l.jsxs)(`div`,{className:`v1-page-inner`,children:[(0,l.jsx)(s.Spin,{fullscreen:!0,spinning:ge.busy,size:`large`,tip:ge.loadingText||`Reading the file…`}),(0,l.jsxs)(s.Spin,{spinning:N,tip:`Loading form fields…`,children:[F&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:F,style:{marginBottom:16}}),z&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:z,style:{marginBottom:16}}),(0,l.jsxs)(s.Form,{form:E,layout:`vertical`,colon:!1,className:`v1-form`,disabled:ge.busy,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),onFinish:Ee,onFinishFailed:Oe,children:[W.filter(e=>!X(e)).map((e,t)=>(0,l.jsx)(wp,{form:E,group:e,children:e.showIf?.field?(0,l.jsx)(Tp,{form:E,showIf:e.showIf,render:()=>Ve(e,t)}):Ve(e,t)},e.name??`grp-${t}`)),!N&&!F&&W.length===0&&(0,l.jsx)(s.Alert,{type:`info`,showIcon:!0,message:`No form fields are configured.`})]})]})]}),(0,l.jsxs)(`div`,{className:S?`v1-footer v1-footer--embedded`:`v1-footer`,children:[(0,l.jsx)(sp,{type:`secondary`,children:`All unsaved changes will be lost if you cancel and reload.`}),(0,l.jsxs)(s.Space,{size:12,children:[(0,l.jsx)(s.Button,{onClick:()=>S&&C?C():n.j(w,{cancelPath:g}),children:`Cancel`}),(0,l.jsx)(fp,{form:E,groups:W,onClick:()=>E.submit(),disabled:N||L||le>0,loading:L,children:h})]})]})]})]})}var Zp=new Map;function Qp(e){let[t,r]=(0,o.useState)({actions:[],actionRules:[]});return(0,o.useEffect)(()=>{if(!e)return;let t=!1;return Zp.has(e)||Zp.set(e,n.dn(e).catch(()=>(Zp.delete(e),{actions:[],actionRules:[]}))),Zp.get(e).then(e=>{t||r(e)}),()=>{t=!0}},[e]),t}var $p={delete:(0,l.jsx)(c.DeleteOutlined,{}),edit:(0,l.jsx)(c.EditOutlined,{}),mail:(0,l.jsx)(c.MailOutlined,{}),shareAlt:(0,l.jsx)(c.ShareAltOutlined,{}),swap:(0,l.jsx)(c.RightOutlined,{}),thunderbolt:(0,l.jsx)(c.ThunderboltOutlined,{}),userAdd:(0,l.jsx)(c.UserAddOutlined,{}),userSwitch:(0,l.jsx)(c.UserSwitchOutlined,{})};function em(e){return e==null?``:Array.isArray(e)?e.join(`,`):String(typeof e==`object`?e.id??e.value??``:e)}function tm(e,t){return String(e).replace(/\{([^}]+)\}/g,(e,n)=>encodeURIComponent(em(t?.[n]))).replace(/:([A-Za-z_][\w]*)/g,(e,n)=>encodeURIComponent(em(t?.[n]??(n===`_id`?t?.id:n===`id`?t?._id:void 0))))}function nm(e,t){return String(t||``).split(`.`).reduce((e,t)=>e?.[t],e)}function rm(e,t,n,r){let i=vr(e,t,r),a=_r(e.key,t,n,r),o={key:e.key,label:i?i.label:e.label||e.key,icon:$p[e.icon]??void 0,danger:e.danger||void 0,disabled:!!i||!!a,title:i?i.label:a||void 0};return e.children?.length&&(o.children=e.children.map(e=>rm(e,t,n,r))),o}function im(e){let t=[];for(let n of e)t.push(n),n.children?.length&&t.push(...im(n.children));return t}function am({module:e,record:r,scope:i,onDone:a,fallback:o=null}){let u=(0,d.useNavigate)(),f=(0,d.useLocation)(),{actions:p,actionRules:m}=Qp(e),h=t=>!(t.showInList===!1||!n.F(t.permission,e)||t.permissionKey&&!n.P(nm(r,`actionPermission.${t.permissionKey}`))||gr(t.key,r,m,i)||t.allowedTabs?.length&&i&&!t.allowedTabs.some(e=>String(e).toLowerCase()===String(i).toLowerCase())),g=(p??[]).filter(h).map(e=>e.children?.length?{...e,children:e.children.filter(h)}:e);if(!g.length)return o;let _=n=>{if(n.actionType===`copy`){let e=nm(r,n.copyField||`id`)??r?._id;navigator.clipboard.writeText(em(e)).then(()=>s.message.success(`Copied to clipboard`)).catch(()=>s.message.error(`Could not copy to clipboard`));return}if(n.actionType===`api`&&n.apiPath){let e=()=>{let e=tm(n.apiPath,r),i=String(n.apiMethod||`POST`).toUpperCase();t.o(t.x,e.startsWith(`/`)?e:`/${e}`,{method:i,body:[`GET`,`DELETE`].includes(i)?void 0:JSON.stringify({ids:[r?._id??r?.id],records:[r]})}).then(()=>{s.message.success(`${n.label} completed`),a?.(n)}).catch(e=>s.message.error(e.message||`${n.label} failed`))};n.danger?s.Modal.confirm({title:`${n.label}?`,content:`This cannot be undone.`,okText:n.label,okButtonProps:{danger:!0},onOk:e}):e();return}if(n.actionType===`modal`){let t=n.popupKey||n.key;u(`/popup/${t}`,{state:{background:f,selectedIds:[r?._id??r?.id],selectedRecords:[r],moduleName:e,popupContext:n.popupState??{},popupAction:{key:n.key,apiMethod:n.apiMethod,apiPath:n.apiPath,defaultTemplateId:n.defaultTemplateId,requireJobId:n.requireJobId,popupFieldOverrides:n.popupFieldOverrides},...n.popupState}});return}let i=n.routeTemplate||n.route;if(i){let e=tm(i,r),t=e.startsWith(`/`)?e:`/${e}`;if(n.linkTarget===`_blank`){window.open(t,`_blank`,`noopener`);return}u(t)}},v=new Map(im(g).map(e=>[String(e.key),e]));return(0,l.jsx)(s.Dropdown,{trigger:[`click`],menu:{items:g.map(e=>rm(e,r,m,i)),onClick:({key:e,domEvent:t})=>{t?.stopPropagation?.();let n=v.get(String(e));n&&n.actionType!==`group`&&!vr(n,r,i)&&_(n)}},children:(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.MoreOutlined,{}),onClick:e=>e.stopPropagation(),"aria-label":`Row actions`})})}var{Text:om}=s.Typography;function sm(e){return e.label??e.fieldLabel??e.name??e.fieldName??e.value}function cm(e){return e.value??e.fieldName??e.name??e.label}function lm(e,t){let n=e?.[t];return n==null?`-`:Array.isArray(n)?n.join(`, `):typeof n==`object`?Object.values(n).join(` `):n}var um=[{key:`name`,label:`Name`},{key:`designation`,label:`Designation`},{key:`locationExp`,label:`Location / Exp`},{key:`skills`,label:`Skills`},{key:`createdOn`,label:`Created On`}];function dm({record:e,fields:t,selected:n,onSelect:r}){let i=(0,d.useNavigate)(),a=(0,d.useLocation)(),o=t.find(e=>e.cardRole===`name`),u=t.find(e=>e.cardRole===`subtitle`),f=t.find(e=>e.cardRole===`location`),p=t.find(e=>e.cardRole===`skills`),m=t.find(e=>e.cardRole===`exp`),h=t.find(e=>e.cardRole===`date`),g=t.find(e=>e.cardRole===`action`),_=o?lm(e,o.key):`-`,v=u?lm(e,u.key):``,y=f?lm(e,f.key):``,b=m?lm(e,m.key):``,x=h?lm(e,h.key):``,S=p?e[p.key]:[],C=Array.isArray(S)?S:[],w=C.slice(0,3),T=C.slice(3),E=g?.render?g.render(lm(e,g.key),e):null;function D(){i(`/popup/preview`,{state:{background:a,moduleName:`candidate`,record:e,fields:um}})}function O(){i(`/popup/mail`,{state:{background:a}})}return(0,l.jsxs)(`div`,{className:`param-card${n?` param-card--selected`:``}`,children:[(0,l.jsxs)(`div`,{className:`param-card__header`,children:[(0,l.jsxs)(`div`,{className:`param-card__header-left`,children:[(0,l.jsxs)(`div`,{className:`param-card__name-row`,children:[(0,l.jsx)(s.Checkbox,{checked:n,onChange:r,onClick:e=>e.stopPropagation(),className:`param-card__checkbox`}),(0,l.jsx)(c.EyeOutlined,{className:`param-card__eye-icon`,onClick:D}),(0,l.jsxs)(`span`,{className:`param-card__name-block`,children:[(0,l.jsx)(om,{className:`param-card__name`,children:_}),v&&v!==`-`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`param-card__sep`,children:`·`}),(0,l.jsx)(om,{className:`param-card__subtitle`,children:v})]})]})]}),y&&y!==`-`&&(0,l.jsxs)(`div`,{className:`param-card__location`,children:[(0,l.jsx)(c.EnvironmentOutlined,{className:`param-card__location-icon`}),(0,l.jsx)(om,{className:`param-card__location-text`,children:y})]})]}),(0,l.jsx)(`div`,{className:`param-card__header-right`,children:(0,l.jsxs)(`span`,{className:`param-card__exp-badge`,children:[`Exp: `,b&&b!==`-`?b:`-`]})})]}),(0,l.jsxs)(`div`,{className:`param-card__body`,children:[(0,l.jsxs)(`div`,{className:`param-card__body-left`,children:[(0,l.jsx)(om,{className:`param-card__section-label`,children:`Skills`}),(0,l.jsxs)(`div`,{className:`param-card__skills-row`,children:[w.length>0?w.map(e=>(0,l.jsx)(s.Tag,{className:`sourcing-skill-tag`,children:e},e)):(0,l.jsx)(om,{className:`param-card__empty`,children:`-`}),T.length>0&&(0,l.jsx)(s.Popover,{trigger:`click`,placement:`bottomLeft`,overlayClassName:`sourcing-skills-popover`,content:(0,l.jsx)(`div`,{className:`sourcing-skills-popup`,children:T.map(e=>(0,l.jsx)(s.Tag,{className:`sourcing-skill-tag`,children:e},e))}),children:(0,l.jsxs)(`span`,{className:`sourcing-more-skills`,children:[`+`,T.length]})})]})]}),x&&x!==`-`&&(0,l.jsxs)(`div`,{className:`param-card__body-right`,children:[(0,l.jsx)(om,{className:`param-card__section-label param-card__section-label--right`,children:`Created on`}),(0,l.jsx)(om,{className:`param-card__date-value`,children:x})]})]}),(0,l.jsx)(`div`,{className:`param-card__divider`}),(0,l.jsxs)(`div`,{className:`param-card__footer`,children:[(0,l.jsxs)(`div`,{className:`param-card__footer-left`,children:[(0,l.jsx)(s.Tooltip,{title:`Resume`,children:(0,l.jsx)(`button`,{type:`button`,className:`param-card__icon-btn`,"aria-label":`Resume`,children:(0,l.jsx)(c.FileTextOutlined,{})})}),(0,l.jsx)(s.Tooltip,{title:`Call`,children:(0,l.jsx)(`button`,{type:`button`,className:`param-card__icon-btn`,"aria-label":`Call`,children:(0,l.jsx)(c.PhoneOutlined,{})})}),(0,l.jsx)(s.Tooltip,{title:`Email`,children:(0,l.jsx)(`button`,{type:`button`,className:`param-card__icon-btn`,"aria-label":`Email`,onClick:O,children:(0,l.jsx)(c.MailOutlined,{})})})]}),(0,l.jsx)(`div`,{className:`param-card__footer-right`,children:E})]})]})}function fm({listName:e=`List`,moduleName:t=``,actions:n=[],fields:r=[],dataSource:i=[],loading:a=!1,total:u,current:f,pageSize:p,onPageChange:m,onPageSizeChange:h,className:g=``,activeView:_=`card`,onViewChange:v}){let y=(0,d.useNavigate)(),b=(0,d.useLocation)(),[x,S]=(0,o.useState)(``),[C,w]=(0,o.useState)({current:1,pageSize:12}),[T,E]=(0,o.useState)([]),[D,O]=(0,o.useState)([]),k=typeof f==`number`&&typeof p==`number`,A=k?{current:f,pageSize:p}:C,j=e=>{let t=e.id??e._id;E(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]),O(n=>n.some(e=>(e.id??e._id)===t)?n.filter(e=>(e.id??e._id)!==t):[...n,e])},M=n.filter(e=>!e.maxSelect||T.length<=e.maxSelect).map(e=>({key:e.key??e.name,label:e.label??e.name,danger:e.danger??!1,disabled:T.length===0,onClick:()=>{if(T.length!==0){if(typeof e.onSelect==`function`){e.onSelect({selectedIds:T,selectedRecords:D});return}e.route&&y(e.route,{state:{background:b,selectedIds:T,selectedRecords:D,moduleName:t,...e.popupState??{}}})}}})),N=(0,o.useMemo)(()=>r.map(e=>({...e,key:cm(e),label:sm(e)})).filter(e=>e.key&&e.label),[r]),P=typeof u==`number`?u:i.length,F=(0,o.useMemo)(()=>{let e=x.toLowerCase();return!e||e.length<3?i:i.filter(t=>N.some(n=>String(lm(t,n.key)).toLowerCase().includes(e)))},[i,N,x]),I=(0,o.useMemo)(()=>{if(k)return F;let e=(A.current-1)*A.pageSize;return F.slice(e,e+A.pageSize)},[A.current,A.pageSize,F,k]);return(0,l.jsxs)(`div`,{className:`antd param-card-view ${g}`.trim(),children:[(0,l.jsx)(s.Card,{children:(0,l.jsxs)(s.Flex,{align:`center`,justify:`space-between`,children:[(0,l.jsxs)(s.Flex,{align:`center`,gap:6,children:[(0,l.jsx)(om,{className:`param-card-view__tab-label`,children:e}),(0,l.jsx)(`span`,{className:`param-card-view__count`,children:P}),T.length>0&&n.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Dropdown,{menu:{items:M},trigger:[`click`],children:(0,l.jsxs)(s.Button,{type:`text`,size:`small`,className:`job-actions-button job-actions-menu-button`,children:[`Actions `,(0,l.jsx)(c.DownOutlined,{className:`job-actions-caret`})]})}),(0,l.jsxs)(om,{className:`job-selected-count`,children:[`Selected (`,T.length,`)`]})]})]}),(0,l.jsxs)(s.Flex,{align:`center`,gap:8,children:[(0,l.jsx)(s.Input,{prefix:(0,l.jsx)(c.SearchOutlined,{className:`job-search-icon`}),placeholder:`Search by name, location, skills`,value:x,onChange:e=>{S(e.target.value),k?m?.(1):w(e=>({...e,current:1}))},allowClear:!0,className:`job-search-input`}),(0,l.jsx)(s.Tooltip,{title:`Filter`,children:(0,l.jsx)(s.Button,{className:`job-toolbar-icon-button`,icon:(0,l.jsx)(c.FilterOutlined,{})})}),(0,l.jsx)(s.Tooltip,{title:`Card view`,children:(0,l.jsx)(s.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${_===`card`?` param-view-toggle-btn--active`:``}`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),onClick:()=>v?.(`card`)})}),(0,l.jsx)(s.Tooltip,{title:`List view`,children:(0,l.jsx)(s.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${_===`list`?` param-view-toggle-btn--active`:``}`,icon:(0,l.jsx)(c.UnorderedListOutlined,{}),onClick:()=>v?.(`list`)})})]})]})}),(0,l.jsx)(s.Spin,{spinning:a,children:I.length>0?(0,l.jsx)(`div`,{className:`param-card-view__grid`,children:I.map((e,t)=>(0,l.jsx)(dm,{record:e,fields:N,selected:T.includes(e.id??e._id),onSelect:()=>j(e)},e.id??e.key??t))}):!a&&(0,l.jsx)(`div`,{className:`param-card-view__empty`,children:`No results found`})}),(0,l.jsx)(Re,{current:A.current,pageSize:A.pageSize,total:P,onChange:e=>{k?m?.(e):w(t=>({...t,current:e}))},onPageSizeChange:e=>{k?h?.(e):w({current:1,pageSize:e})}})]})}var{Text:pm}=s.Typography;function mm(e){return e.label??e.fieldLabel??e.name??e.fieldName??e.value}function hm(e){return e.value??e.fieldName??e.name??e.label}function gm(e,t){let n=e?.[t];return n==null?`-`:Array.isArray(n)?n.join(`, `):typeof n==`object`?Object.values(n).join(` `):n}function _m(e,t){return(0,l.jsxs)(s.Space,{size:6,children:[(0,l.jsx)(`span`,{children:e}),(0,l.jsx)(s.Badge,{count:t,overflowCount:9999})]})}function vm({listName:e=`List`,fields:t=[],actions:n=[],dataSource:r=[],loading:i=!1,total:a,current:u,pageSize:f,onPageChange:p,onPageSizeChange:m,onSearch:h,rowSelection:g=!0,className:_=``,tableClassName:v=`job-list-table`,activeView:y=`list`,onViewChange:b}){let x=(0,d.useNavigate)(),S=(0,d.useLocation)(),[C,w]=(0,o.useState)(`all`),[T,E]=(0,o.useState)(``),[D,O]=(0,o.useState)([]),[k,A]=(0,o.useState)([]),[j,M]=(0,o.useState)({current:1,pageSize:10}),[N,P]=(0,o.useState)([]),[F,I]=(0,o.useState)(!1),L=(0,o.useRef)(null),R=n.filter(e=>!e.maxSelect||D.length<=e.maxSelect).map(e=>({key:e.key??e.name,label:e.label??e.name,danger:e.danger??!1,disabled:D.length===0,onClick:()=>{if(D.length!==0){if(typeof e.onSelect==`function`){e.onSelect({selectedIds:D,selectedRecords:k});return}e.route&&x(e.route,{state:{background:S,selectedIds:D,selectedRecords:k,...e.popupState??{}}})}}})),z=typeof u==`number`&&typeof f==`number`,B=z?{current:u,pageSize:f}:j,V=(0,o.useMemo)(()=>t.map(e=>({...e,key:hm(e),label:mm(e)})).filter(e=>e.key&&e.label&&!e.tableHidden),[t]),H=N.length?N:V.map(e=>e.key),U=(0,o.useMemo)(()=>{if(h)return r;let e=T.toLowerCase();return!e||e.length<3?r:r.filter(t=>V.some(n=>String(gm(t,n.key)).toLowerCase().includes(e)))},[r,V,h,T]),ee=typeof a==`number`?a:T.trim()?U.length:r.length,te=(0,o.useMemo)(()=>{if(z)return U;let e=(B.current-1)*B.pageSize;return U.slice(e,e+B.pageSize)},[B.current,B.pageSize,U,z]),ne=(0,o.useMemo)(()=>V.filter(e=>H.includes(e.key)).map(e=>({title:e.label,dataIndex:e.key,key:e.key,sorter:e.sorter===!1?!1:e.sorter??((t,n)=>String(gm(t,e.key)).localeCompare(String(gm(n,e.key)))),width:e.width??180,fixed:e.fixed,ellipsis:e.ellipsis??!0,className:e.className,render:(t,n,r)=>e.render?e.render(t,n,r):(0,l.jsx)(pm,{className:`job-cell-primary`,children:gm(n,e.key)})})),[V,H]),re=H.length===V.length,ie=H.length>0&&!re,ae=(e,t)=>{P(n=>{let r=n.length?n:V.map(e=>e.key);return t?r.includes(e)?r:[...r,e]:r.filter(t=>t!==e)})},W=(0,l.jsxs)(`div`,{className:`column-visibility-menu`,onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(s.Checkbox,{checked:re,indeterminate:ie,onChange:e=>{P(e.target.checked?V.map(e=>e.key):[])},children:`Select All`}),V.map(e=>(0,l.jsx)(s.Checkbox,{checked:H.includes(e.key),onChange:t=>ae(e.key,t.target.checked),children:e.label},e.key))]});return(0,l.jsxs)(`div`,{className:`antd dynamic-list-view ${_}`.trim(),children:[(0,l.jsx)(s.Card,{children:(0,l.jsxs)(s.Flex,{align:`center`,justify:`space-between`,children:[(0,l.jsx)(s.Tabs,{activeKey:C,items:[{key:`all`,label:_m(e,ee)}],onChange:e=>{w(e),M({...j,current:1})}}),(0,l.jsxs)(s.Flex,{align:`center`,gap:8,children:[(0,l.jsx)(s.Input,{prefix:(0,l.jsx)(c.SearchOutlined,{className:`job-search-icon`}),placeholder:`Min 3 Chars to search`,value:T,onChange:e=>{let t=e.target.value;E(t),h?(clearTimeout(L.current),L.current=setTimeout(()=>{h(t),p?.(1)},350)):z?p?.(1):M({...j,current:1})},allowClear:!0,className:`job-search-input`}),(0,l.jsx)(s.Tooltip,{title:`Filter`,children:(0,l.jsx)(s.Button,{className:`job-toolbar-icon-button`,icon:(0,l.jsx)(c.FilterOutlined,{})})}),(0,l.jsx)(s.Tooltip,{title:`Card view`,children:(0,l.jsx)(s.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${y===`card`?` param-view-toggle-btn--active`:``}`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),onClick:()=>b?.(`card`)})}),(0,l.jsx)(s.Tooltip,{title:`List view`,children:(0,l.jsx)(s.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${y===`list`?` param-view-toggle-btn--active`:``}`,icon:(0,l.jsx)(c.UnorderedListOutlined,{}),onClick:()=>b?.(`list`)})})]})]})}),(0,l.jsx)(s.Card,{children:(0,l.jsxs)(s.Flex,{align:`center`,gap:3,children:[(0,l.jsx)(s.Dropdown,{open:F,onOpenChange:I,trigger:[`click`],dropdownRender:()=>W,placement:`bottomLeft`,overlayClassName:`column-visibility-dropdown`,children:(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(`img`,{src:Ui,alt:``,className:`job-action-list-icon`}),size:`small`,className:`job-actions-button`})}),D.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Dropdown,{menu:{items:R},trigger:[`click`],children:(0,l.jsxs)(s.Button,{type:`text`,size:`small`,className:`job-actions-button job-actions-menu-button`,children:[(0,l.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.6279%206.78121C12.6857%206.88148%2012.7014%207.00057%2012.6715%207.11239C12.6417%207.22422%2012.5688%207.31967%2012.4688%207.37785L7.21875%2010.4403C7.15185%2010.4794%207.0758%2010.4999%206.99836%2010.4999C6.92092%2010.4999%206.84487%2010.4794%206.77797%2010.4403L1.52797%207.37785C1.42936%207.31859%201.35806%207.22289%201.32951%207.11145C1.30095%207.00001%201.31744%206.88181%201.37539%206.78244C1.43335%206.68306%201.52811%206.61052%201.63916%206.5805C1.75022%206.55048%201.86863%206.56542%201.96875%206.62207L7%209.55605L12.0312%206.62207C12.1315%206.56428%2012.2506%206.54858%2012.3624%206.57841C12.4743%206.60824%2012.5697%206.68116%2012.6279%206.78121ZM1.3125%204.37496C1.31267%204.29833%201.33297%204.22309%201.37136%204.15677C1.40975%204.09045%201.46489%204.03538%201.53125%203.99707L6.78125%200.934566C6.84815%200.895555%206.9242%200.875%207.00164%200.875C7.07908%200.875%207.15513%200.895555%207.22203%200.934566L12.472%203.99707C12.5381%204.0356%2012.5929%204.09076%2012.6309%204.15707C12.669%204.22337%2012.6891%204.2985%2012.6891%204.37496C12.6891%204.45142%2012.669%204.52654%2012.6309%204.59285C12.5929%204.65915%2012.5381%204.71432%2012.472%204.75285L7.22203%207.81535C7.15513%207.85436%207.07908%207.87491%207.00164%207.87491C6.9242%207.87491%206.84815%207.85436%206.78125%207.81535L1.53125%204.75285C1.46489%204.71453%201.40975%204.65946%201.37136%204.59314C1.33297%204.52682%201.31267%204.45159%201.3125%204.37496ZM2.61844%204.37496L7%206.93105L11.3816%204.37496L7%201.81886L2.61844%204.37496ZM7.65625%2011.7993L7%2012.1821L1.96875%209.24707C1.86913%209.19747%201.75436%209.18769%201.64779%209.21973C1.54122%209.25177%201.45087%209.32322%201.39512%209.41953C1.33937%209.51583%201.32241%209.62977%201.3477%209.73814C1.37299%209.84651%201.43863%209.94117%201.53125%2010.0028L6.78125%2013.0653C6.84815%2013.1044%206.9242%2013.1249%207.00164%2013.1249C7.07908%2013.1249%207.15513%2013.1044%207.22203%2013.0653L8.09703%2012.5551C8.14746%2012.5266%208.19171%2012.4883%208.22723%2012.4426C8.26275%2012.3968%208.28882%2012.3444%208.30394%2012.2885C8.31906%2012.2326%208.32291%2012.1742%208.31529%2012.1167C8.30766%2012.0593%208.28871%2012.004%208.25952%2011.9539C8.23033%2011.9039%208.19149%2011.8601%208.14526%2011.8252C8.09903%2011.7903%208.04632%2011.7649%207.9902%2011.7505C7.93408%2011.7361%207.87566%2011.7331%207.81833%2011.7414C7.761%2011.7498%207.70591%2011.7695%207.65625%2011.7993Z'%20fill='%236B7280'/%3e%3cpath%20d='M10.6036%2011.3825L13.4607%209.4477C13.5813%209.36599%2013.614%209.20256%2013.5341%209.08069L13.0105%208.282C12.9303%208.15966%2012.7665%208.12478%2012.6434%208.20383L9.54053%2010.1964L8.94939%2011.4054C8.84904%2011.6106%209.03632%2011.8387%209.25715%2011.7803L10.4338%2011.469C10.4561%2011.4631%2010.4776%2011.4543%2010.4977%2011.4429L10.6036%2011.3825ZM9.54053%2010.1964L10.6036%2011.3825'%20stroke='%236B7280'%20stroke-width='0.6'/%3e%3c/svg%3e`,alt:``,className:`job-actions-frame-icon`}),`Actions `,(0,l.jsx)(c.DownOutlined,{className:`job-actions-caret`})]})}),(0,l.jsxs)(pm,{className:`job-selected-count`,children:[`Selected (`,D.length,`)`]})]})]})}),(0,l.jsx)(s.Spin,{spinning:i,children:(0,l.jsx)(s.Table,{rowSelection:g?{type:`checkbox`,selectedRowKeys:D,onChange:(e,t)=>{O(e),A(t)}}:void 0,columns:ne,dataSource:te,size:`middle`,scroll:{x:`max-content`},showSorterTooltip:!1,tableLayout:`auto`,pagination:!1,className:v,rowKey:e=>e.id??e.key})}),(0,l.jsx)(Re,{current:B.current,pageSize:B.pageSize,total:ee,onChange:e=>{z?p?.(e):M(t=>({...t,current:e}))},onPageSizeChange:e=>{z?m?.(e):M({current:1,pageSize:e})}})]})}var ym=[`both`,`slider`,`inputs`];function bm({field:e,value:t,onChange:n,disabled:r}){let i=Number(e.min??0),a=Number(e.max??30),o=ym.includes(e.display)?e.display:`both`,[c,u]=Array.isArray(t)&&t.length===2?t:[void 0,void 0],d=e.fromLabel??`From`,f=e.toLabel??`To`,p=e.unit??``,m=String(e.minLabel??``).trim()||String(i),h=String(e.maxLabel??``).trim()||String(a),g=e.marks??{[i]:m,[a]:h},_=(e,t)=>t?.userTyping?t.input:e==null||e===``?``:Number(e)===i?m:Number(e)===a?h:String(e),v=e=>{let t=String(e??``).trim();return t===``?``:t===h?String(a):t===m?String(i):t.replace(/[^0-9.-]/g,``)},y=e=>{let t=e[0]===null||e[0]===void 0||e[0]===``?void 0:Number(e[0]),r=e[1]===null||e[1]===void 0||e[1]===``?void 0:Number(e[1]);if(t===void 0&&r===void 0){n(void 0);return}if(t!==void 0&&r!==void 0){n([Math.min(t,r),Math.max(t,r)]);return}n([t,r])};return(0,l.jsxs)(`div`,{className:`sbv1-range`,children:[o!==`inputs`&&(0,l.jsx)(s.Slider,{range:!0,min:i,max:a,marks:g,disabled:r,value:[c??i,u??a],onChange:y}),o!==`slider`&&(0,l.jsxs)(s.Space,{size:8,className:`sbv1-range-inputs`,children:[(0,l.jsx)(`span`,{className:`sbv1-range-label`,children:d}),(0,l.jsx)(s.InputNumber,{size:`small`,min:i,max:a,disabled:r,value:c??i,"aria-label":d,formatter:_,parser:v,onChange:e=>y([e,u])}),(0,l.jsx)(`span`,{className:`sbv1-range-label`,children:f}),(0,l.jsx)(s.InputNumber,{size:`small`,min:i,max:a,disabled:r,value:u??a,"aria-label":f,formatter:_,parser:v,onChange:e=>y([c,e])}),p&&(0,l.jsx)(`span`,{className:`sbv1-range-label`,children:p})]})]})}bm.propTypes={field:f.default.object.isRequired,value:f.default.array,onChange:f.default.func.isRequired,disabled:f.default.bool};var xm=[{key:`today`,label:`Today`},{key:`yesterday`,label:`Yesterday`},{key:`last7`,label:`Last 7 Days`},{key:`last30`,label:`Last 30 Days`},{key:`last3Months`,label:`Last 3 Months`},{key:`last6Months`,label:`Last 6 Months`},{key:`thisMonth`,label:`This Month`},{key:`lastMonth`,label:`Last Month`},{key:`custom`,label:`Custom Range`}];function Sm(e){let t=(0,u.default)();switch(e){case`today`:return[t.startOf(`day`),t.endOf(`day`)];case`yesterday`:{let e=t.subtract(1,`day`);return[e.startOf(`day`),e.endOf(`day`)]}case`last7`:return[t.subtract(6,`day`).startOf(`day`),t.endOf(`day`)];case`last30`:return[t.subtract(29,`day`).startOf(`day`),t.endOf(`day`)];case`last3Months`:return[t.subtract(3,`month`).startOf(`day`),t.endOf(`day`)];case`last6Months`:return[t.subtract(6,`month`).startOf(`day`),t.endOf(`day`)];case`thisMonth`:return[t.startOf(`month`),t.endOf(`day`)];case`lastMonth`:{let e=t.subtract(1,`month`);return[e.startOf(`month`),e.endOf(`month`)]}default:return[null,null]}}function Cm(e){return e?(0,u.default)(e).endOf(`day`).toISOString():null}function wm(e){return e?(0,u.default)(e).startOf(`day`).toISOString():null}var{RangePicker:Tm}=s.DatePicker;function Em({field:e,value:t,onChange:n,disabled:r}){let i=t&&typeof t==`object`?t:{},a=i.preset,o=e=>{if(e===`custom`){n({preset:e,from:null,to:null});return}let[t,r]=Sm(e);n({preset:e,from:wm(t),to:Cm(r)})},c=e=>{let[t,r]=Array.isArray(e)?e:[null,null];n({preset:`custom`,from:wm(t),to:Cm(r)})},d=a===`custom`&&(i.from||i.to)?[i.from?(0,u.default)(i.from):null,i.to?(0,u.default)(i.to):null]:null;return(0,l.jsxs)(`div`,{className:`sbv1-date-range-preset`,children:[(0,l.jsx)(s.Select,{value:a,disabled:r,allowClear:!0,placeholder:e.placeholder??`Select date`,options:xm.map(({key:e,label:t})=>({value:e,label:t})),onChange:o,onClear:()=>n(void 0)}),a===`custom`&&(0,l.jsx)(Tm,{style:{width:`100%`,marginTop:8},disabled:r,value:d,disabledDate:e=>e&&e.isAfter((0,u.default)(),`day`),onChange:c})]})}Em.propTypes={field:f.default.object.isRequired,value:f.default.object,onChange:f.default.func.isRequired,disabled:f.default.bool};var Dm=new Set([`AND`,`OR`]),Om=new Set([`AND`,`OR`,`NOT`]);function km(e){let t=String(e??``),n=[],r=0;for(;r<t.length;){let e=t[r];if(/\s/.test(e)){r+=1;continue}if(e===`(`||e===`)`){n.push({type:e===`(`?`lparen`:`rparen`,value:e}),r+=1;continue}if(e===`"`){let e=t.indexOf(`"`,r+1);if(e===-1){n.push({type:`unterminated`,value:t.slice(r)});break}n.push({type:`term`,value:t.slice(r+1,e),quoted:!0}),r=e+1;continue}let i=r;for(;i<t.length&&!/[\s()"]/.test(t[i]);)i+=1;let a=t.slice(r,i),o=a.toUpperCase();n.push(Om.has(o)?{type:`operator`,value:o}:{type:`term`,value:a}),r=i}return n}var Am=[{pattern:/&&/,message:`Use AND instead of &&.`},{pattern:/\|\|/,message:`Use OR instead of ||.`},{pattern:/(?:^|\s)!(?=\S)/,message:`Use NOT instead of !.`}],jm=4,Mm=12,Nm=[`query`],Pm=new Set(Nm);function Fm(e){return Array.isArray(e)?e.length===1&&Pm.has(e[0]):Pm.has(e)}function Im(e){let t=[],n=[],r=String(e??``).trim();if(!r)return{valid:!0,errors:t,warnings:n};Am.forEach(({pattern:e,message:n})=>{e.test(r)&&t.push(n)});let i=km(r);i.some(e=>e.type===`unterminated`)&&t.push(`Unclosed quote — every " needs a closing ".`);let a=0,o=0,s=!1;i.forEach(e=>{e.type===`lparen`?(a+=1,o=Math.max(o,a)):e.type===`rparen`&&(--a,a<0&&(s=!0,a=0))}),(s||a>0)&&t.push(`Unbalanced parentheses.`);let c=i.filter(e=>e.type!==`unterminated`),l=[];return c.forEach((e,r)=>{let i=c[r-1],a=c[r+1];if(e.type===`operator`){let n=Dm.has(e.value),r=!i||i.type===`lparen`||i.type===`operator`&&Dm.has(i.value);n&&r&&t.push(`"${e.value}" needs a term before it.`),(!a||a.type===`rparen`)&&t.push(`"${e.value}" needs a term after it.`)}e.type===`lparen`&&a?.type===`rparen`&&t.push(`Empty parentheses.`),e.type===`term`&&(l.push({token:e,index:r}),!e.quoted&&e.value.length===1&&n.push(`"${e.value}" is a single character and will match very broadly.`),/[*?]/.test(e.value)&&n.push(`"${e.value}" — * and ? are matched as literal characters here, not wildcards.`))}),t.length===0&&l.length>0&&l.every(({index:e})=>{for(let t=e-1;t>=0;--t){let e=c[t];if(e.type!==`lparen`)return e.type===`operator`&&e.value===`NOT`}return!1})&&n.push(`This query is only exclusions and will match nearly everyone.`),o>jm&&n.push(`Nested ${o} levels deep — consider simplifying so it stays easy to verify.`),l.length>Mm&&n.push(`${l.length} terms in one query — consider narrowing it.`),{valid:t.length===0,errors:[...new Set(t)],warnings:[...new Set(n)]}}function Lm(e,t,n,r){let i=String(e??``),a=Math.max(0,Math.min(t??i.length,i.length)),o=Math.max(a,Math.min(n??a,i.length)),s=i.slice(0,a),c=i.slice(a,o),l=i.slice(o);if(r===`()`||r===`""`){let[e,t]=r===`()`?[`(`,`)`]:[`"`,`"`];return{value:`${s}${e}${c}${t}${l}`,cursor:c?a+c.length+2:a+1}}let u=s+c,d=u.length>0&&!/\s$/.test(u)?` `:``,f=/^\s/.test(l)?``:` `,p=`${d}${r}${f}`,m=!f&&/^\s/.test(l)?1:0;return{value:`${u}${p}${l}`,cursor:u.length+p.length+m}}var Rm=`keywords`;function zm(e){return e===!0||e===1||e===`1`}function Bm(e){if(e==null)return null;if(typeof e==`string`||typeof e==`number`){let t=String(e).trim();return t?{value:t,mandatory:!1}:null}if(typeof e==`object`){let t=String(e.value??e.label??e.name??``).trim();return t?{value:t,mandatory:!!e.mandatory}:null}return null}var Vm={terms:[],mandatoryAll:!1,expression:``,generatedExpression:``};function Hm(e){return Array.isArray(e)?{...Vm,terms:e.map(Bm).filter(Boolean)}:e&&typeof e==`object`?{terms:Array.isArray(e.terms)?e.terms.map(Bm).filter(Boolean):[],mandatoryAll:!!e.mandatoryAll,expression:typeof e.expression==`string`?e.expression:``,generatedExpression:typeof e.generatedExpression==`string`?e.generatedExpression:``}:typeof e==`string`&&e.trim()?{...Vm,terms:[{value:e.trim(),mandatory:!1}]}:{...Vm}}function Um(e){return e?.type===Rm}function Wm(e){return Um(e)&&zm(e.isPrimaryKeyword)}function Gm(e){return String(e?.keywordRole??`include`).toLowerCase()===`exclude`}function Km(e){return zm(e?.showMandatoryOption)&&!Gm(e)}function qm(e){return String(e?.keywordGroup??``).trim()||String(e?.field??``)}function Jm(e){let t=e?.keywordFields;return(Array.isArray(t)?t:t?[t]:[]).map(e=>String(e??``).trim()).filter(Boolean)}function Ym(e){let t=Number(e?.maxKeywords);return Number.isFinite(t)&&t>0?Math.floor(t):50}function Xm(e){let t=new Set,n=[];return e.forEach(e=>{let r=e.toLowerCase();t.has(r)||(t.add(r),n.push(e))}),n}function Zm(e,{booleanMode:t=!1,isPrimary:n=!1}={}){let r=Hm(e);return t&&n?r.expression.trim()!==``:r.terms.length>0}function Qm(e){return Xm(String(e??``).split(`,`).map(e=>e.trim()).filter(Boolean))}var $m={mandatory:[],optional:[],exclude:[]};function eh(e,t){return e?.type===`operator`&&e.value===t}function th(e){if(!e.length)return null;let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(n%2==0){if(r.type!==`term`||!String(r.value).trim())return null;t.push(String(r.value).trim())}else if(!eh(r,`OR`))return null}return e.length%2==1?t:null}function nh(e){let t=[],n=[],r=0,i=()=>{n.length&&t.push(n),n=[]};for(let t of e){if(t.type===`lparen`){if(r+=1,r>1)return null}else if(t.type===`rparen`&&(--r,r<0))return null;if(r===0&&eh(t,`AND`)){i();continue}if(r===0&&eh(t,`NOT`)){i(),n.push(t);continue}n.push(t)}return r===0?(i(),t):null}function rh(e){return e.length>=2&&e[0].type===`lparen`&&e[e.length-1].type===`rparen`?{inner:e.slice(1,-1),wrapped:!0}:{inner:e,wrapped:!1}}function ih(e){let t=String(e??``).trim();if(!t||Im(t).errors.length)return null;let n=km(t);if(!n.length)return null;let r=n.some(e=>e.type===`operator`),i=n.some(e=>e.type===`lparen`||e.type===`rparen`);if(!r&&!i){let e=Qm(t);return e.length?{...$m,optional:e}:null}let a=nh(n);if(!a||!a.length)return null;let o=[],s=[],c=null;for(let e of a){if(eh(e[0],`NOT`)){let{inner:t}=rh(e.slice(1)),n=th(t);if(!n)return null;s.push(...n);continue}let{inner:t,wrapped:n}=rh(e);if(n){let e=th(t);if(!e||c)return null;c=e;continue}if(e.length===1&&e[0].type===`term`){o.push(String(e[0].value).trim());continue}if(a.length===1){let t=th(e);if(!t)return null;c=t;continue}return null}if(o.length===1&&!c&&!s.length)return{mandatory:[],optional:Xm(o),exclude:[]};let l={mandatory:Xm(o),optional:Xm(c??[]),exclude:Xm(s)};return l.mandatory.length+l.optional.length+l.exclude.length?l:null}function ah(e){let t=Hm(e),n=t.expression.trim();if(n!==``&&n!==t.generatedExpression.trim())return t;let r=t.terms.map(e=>e.value).join(`, `);return{...t,expression:r,generatedExpression:r}}function oh(e,{starsEnabled:t=!0}={}){let n=Hm(e),r=ih(n.expression);if(!r)return{model:n,exclude:null,converted:!1};let i=new Map(n.terms.map(e=>[e.value.toLowerCase(),e.mandatory])),a=r.mandatory.length===0&&r.exclude.length===0&&!/[()"]/.test(n.expression)&&!km(n.expression).some(e=>e.type===`operator`),o=(e,n)=>t?a?!!i.get(e.toLowerCase()):n:!1,s=[...r.mandatory.map(e=>({value:e,mandatory:o(e,!0)})),...r.optional.map(e=>({value:e,mandatory:o(e,!1)}))];return{model:{...n,terms:s,mandatoryAll:s.length>0&&s.every(e=>e.mandatory),generatedExpression:n.expression},exclude:r.exclude,converted:!0}}function sh(e=[],t={},{booleanMode:n=!1}={}){let r=new Map;e.forEach(e=>{if(!Um(e)||n&&Wm(e))return;let i=Hm(t[e.field]);if(!i.terms.length)return;let a=qm(e);if(!a)return;r.has(a)||r.set(a,{id:a,fields:Jm(e),mandatory:[],optional:[],exclude:[]});let o=r.get(a);if(o.fields.length||(o.fields=Jm(e)),Gm(e)){i.terms.forEach(e=>o.exclude.push(e.value));return}let s=Km(e);i.terms.forEach(e=>{s&&e.mandatory?o.mandatory.push(e.value):o.optional.push(e.value)})});let i=[];return r.forEach(e=>{let t={id:e.id,fields:e.fields,mandatory:Xm(e.mandatory),optional:Xm(e.optional),exclude:Xm(e.exclude)};!t.mandatory.length&&!t.optional.length&&!t.exclude.length||i.push(t)}),i.length?i:null}var{TextArea:ch}=s.Input,{Text:lh}=s.Typography,uh=`(Java OR J2EE) AND "Spring Boot" NOT Hibernate`;function dh({field:e,value:t,onChange:n,disabled:r,placeholder:i,booleanEnabled:a,booleanMode:u,onBooleanModeChange:d,serverError:f}){let p=Hm(t),m=Wm(e),h=Km(e),g=Gm(e),_=Ym(e),v=m&&a&&u,[y,b]=(0,o.useState)(``),[x,S]=(0,o.useState)(``),C=(0,o.useRef)(null),w=e=>n({...p,...e}),T=e=>w({terms:e,mandatoryAll:e.length>0?e.every(e=>e.mandatory):p.mandatoryAll}),E=e=>{let t=String(e??``).split(`,`).map(e=>e.trim()).filter(Boolean);if(!t.length){b(``);return}let n=[...p.terms],r=new Set(n.map(e=>e.value.toLowerCase())),i=!1;t.forEach(e=>{let t=e.toLowerCase();if(!r.has(t)){if(n.length>=_){i=!0;return}r.add(t),n.push({value:e,mandatory:h&&p.mandatoryAll})}}),S(i?`At most ${_} keywords.`:``),b(``),n.length!==p.terms.length&&T(n)},D=e=>{S(``),T(p.terms.filter((t,n)=>n!==e))},O=e=>{T(p.terms.map((t,n)=>n===e?{...t,mandatory:!t.mandatory}:t))},k=e=>{n({...p,mandatoryAll:e,terms:p.terms.map(t=>({...t,mandatory:e}))})},A=e=>{if(e.key===`Enter`){e.preventDefault(),E(y);return}e.key===`Backspace`&&y===``&&p.terms.length&&D(p.terms.length-1)},j=()=>{S(``),b(``),n({...p,terms:[],mandatoryAll:!1})},M=m&&(0,l.jsxs)(`div`,{className:`sbv1-keywords-header`,children:[(0,l.jsx)(lh,{strong:!0,className:`sbv1-keywords-title`,children:e.label??`Keywords`}),a&&(0,l.jsxs)(`span`,{className:`sbv1-keywords-toggle`,children:[(0,l.jsx)(s.Switch,{size:`small`,checked:!!u,disabled:r,onChange:d}),(0,l.jsx)(lh,{type:`secondary`,children:u?`Boolean on`:`Boolean off`})]})]});return v?(0,l.jsxs)(`div`,{className:`sbv1-keywords`,children:[M,(0,l.jsx)(ch,{autoSize:{minRows:e.rows??3,maxRows:12},value:p.expression,disabled:r,status:f?`error`:void 0,placeholder:e.booleanPlaceholder??uh,onChange:e=>w({expression:e.target.value})}),f&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:f})]}):(0,l.jsxs)(`div`,{className:`sbv1-keywords`,children:[M,(0,l.jsxs)(`div`,{className:`sbv1-keywords-row`,children:[(0,l.jsxs)(`div`,{className:`sbv1-keywords-box${r?` sbv1-keywords-box-disabled`:``}`,onClick:()=>C.current?.focus(),role:`presentation`,children:[p.terms.map((e,t)=>(0,l.jsxs)(s.Tag,{className:`sbv1-keywords-chip`,closable:!r,onClose:e=>{e.preventDefault(),D(t)},children:[h&&(0,l.jsx)(`button`,{type:`button`,className:`sbv1-keywords-star`,"aria-pressed":e.mandatory,"aria-label":e.mandatory?`${e.value} is mandatory`:`Mark ${e.value} as mandatory`,disabled:r,onClick:e=>{e.stopPropagation(),O(t)},children:e.mandatory?(0,l.jsx)(c.StarFilled,{}):(0,l.jsx)(c.StarOutlined,{})}),(0,l.jsx)(`span`,{className:`sbv1-keywords-chip-text`,children:e.value})]},e.value)),(0,l.jsx)(`input`,{ref:C,className:`sbv1-keywords-input`,value:y,disabled:r,placeholder:p.terms.length?e.placeholder??i??`Type another keyword`:i??e.placeholder??`Type another keyword`,onChange:e=>b(e.target.value),onKeyDown:A,onBlur:()=>E(y)})]}),p.terms.length>0&&!r&&(0,l.jsx)(s.Button,{type:`link`,size:`small`,className:`sbv1-keywords-clear`,onClick:j,children:`Clear all`})]}),x&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:x}),h&&!g&&(0,l.jsx)(s.Checkbox,{className:`sbv1-keywords-mandatory`,checked:p.terms.length?p.terms.every(e=>e.mandatory):p.mandatoryAll,disabled:r,onChange:e=>k(e.target.checked),children:`Mark all keywords as mandatory`})]})}dh.propTypes={field:f.default.object.isRequired,value:f.default.any,onChange:f.default.func.isRequired,disabled:f.default.bool,placeholder:f.default.string,booleanEnabled:f.default.bool,booleanMode:f.default.bool,onBooleanModeChange:f.default.func,serverError:f.default.string};var{TextArea:fh}=s.Input,{RangePicker:ph}=s.DatePicker,mh={};function hh(e,t){if(!e||typeof t?.render!=`function`)throw Error(`registerFieldType(type, { render }) requires a type name and a render function`);return mh[e]={booleanEligible:!1,needsOptions:!1,multiValue:!1,...t},mh[e]}function gh(e){return mh[e]??mh.text}function _h(e){return!!gh(e).booleanEligible}function vh(e){let t=gh(e?.type??`text`).ownsLabel;return typeof t==`function`?!!t(e):!!t}function yh(e,t,n){let r=gh(e?.type??`text`).hasValue;if(typeof r==`function`)return!!r(t,n)}function bh(){return Object.entries(mh).filter(([,e])=>e.booleanEligible).map(([e])=>e)}function xh(e){return`Enter ${String(e.label??e.field??``).toLowerCase()}`}function Sh(e){return`Select ${String(e.label??e.field??``).toLowerCase()}`}hh(`text`,{booleanEligible:!1,render:({field:e,value:t,onChange:n,disabled:r,placeholder:i})=>(0,l.jsx)(s.Input,{value:t??``,disabled:r,placeholder:i??xh(e),allowClear:!0,onChange:e=>n(e.target.value)})}),hh(`email`,{booleanEligible:!1,render:({field:e,value:t,onChange:n,disabled:r,placeholder:i})=>(0,l.jsx)(s.Input,{type:`email`,value:t??``,disabled:r,placeholder:i??xh(e),allowClear:!0,onChange:e=>n(e.target.value)})}),hh(`textarea`,{booleanEligible:!1,render:({field:e,value:t,onChange:n,disabled:r,placeholder:i})=>(0,l.jsx)(fh,{rows:e.rows??3,value:t??``,disabled:r,placeholder:i??xh(e),onChange:e=>n(e.target.value)})}),hh(`number`,{render:({field:e,value:t,onChange:n,disabled:r,placeholder:i})=>(0,l.jsx)(s.InputNumber,{style:{width:`100%`},value:t??null,disabled:r,min:e.min,max:e.max,placeholder:i??xh(e),onChange:n})}),hh(`select`,{booleanEligible:!1,needsOptions:!0,render:({field:e,value:t,onChange:n,options:r,optionsLoading:i,disabled:a,placeholder:o})=>(0,l.jsx)(s.Select,{mode:e.multiSelect||e.mode===`multiple`?`multiple`:void 0,value:t??void 0,disabled:a,options:r,loading:i,allowClear:!0,showSearch:!0,optionFilterProp:`label`,placeholder:o??Sh(e),notFoundContent:i?(0,l.jsx)(s.Spin,{size:`small`}):void 0,onChange:n})}),hh(`multiselect`,{booleanEligible:!1,needsOptions:!0,multiValue:!0,render:({field:e,value:t,onChange:n,options:r,optionsLoading:i,disabled:a,placeholder:o})=>(0,l.jsx)(s.Select,{mode:`multiple`,value:t??void 0,disabled:a,options:r,loading:i,allowClear:!0,showSearch:!0,optionFilterProp:`label`,placeholder:o??Sh(e),notFoundContent:i?(0,l.jsx)(s.Spin,{size:`small`}):void 0,onChange:n})}),hh(`location`,{needsOptions:!0,defaultDataSource:`locationMaster`,render:({field:e,value:t,onChange:n,options:r,optionsLoading:i,disabled:a,placeholder:o})=>(0,l.jsx)(s.Select,{value:t??void 0,disabled:a,options:r,loading:i,allowClear:!0,showSearch:!0,optionFilterProp:`label`,placeholder:o??Sh(e),notFoundContent:i?(0,l.jsx)(s.Spin,{size:`small`}):void 0,onChange:n})}),hh(`tagify`,{booleanEligible:!1,multiValue:!0,render:({field:e,value:t,onChange:n,disabled:r,placeholder:i})=>(0,l.jsx)(s.Select,{mode:`tags`,value:t??void 0,disabled:r,open:!1,suffixIcon:null,allowClear:!0,tokenSeparators:[`,`],placeholder:i??xh(e),onChange:n})}),hh(`radio`,{needsOptions:!0,render:({value:e,onChange:t,options:n,disabled:r})=>{let i=n.find(e=>e.locked);return(0,l.jsx)(s.Radio.Group,{value:i?i.value:e,disabled:r||!!i,options:n,onChange:e=>t(e.target.value)})}}),hh(`checkbox`,{needsOptions:!0,multiValue:!0,render:({field:e,value:t,onChange:n,options:r,disabled:i})=>{if(r.length===0)return(0,l.jsx)(s.Checkbox,{checked:!!t,disabled:i,onChange:e=>n(e.target.checked),children:e.checkboxLabel??e.label});let a=r.filter(e=>e.locked).map(e=>e.value),o=r.map(e=>e.value),c=Array.isArray(t)?t:[],u=e=>{let t=new Set(e);return o.filter(e=>t.has(e))},d=u([...c,...a]),f=r.map(e=>e.locked?{...e,disabled:!0}:e),p=e=>{n(u([...e,...a]))},m=e.hideSelectAll!==!0&&r.length>1,h=m&&o.every(e=>d.includes(e));return(0,l.jsxs)(s.Space,{direction:`vertical`,size:4,className:`sbv1-checkbox-with-select-all`,children:[m&&(0,l.jsx)(s.Checkbox,{checked:h,disabled:i,onChange:e=>{n(e.target.checked?u(o):u(a))},children:`All`}),(0,l.jsx)(s.Checkbox.Group,{value:d,disabled:i,options:f,onChange:p})]})}}),hh(`date`,{render:({value:e,onChange:t,disabled:n,placeholder:r})=>(0,l.jsx)(s.DatePicker,{style:{width:`100%`},value:e??null,disabled:n,placeholder:r??`Select date`,onChange:t})}),hh(`daterange`,{multiValue:!0,render:({value:e,onChange:t,disabled:n})=>(0,l.jsx)(ph,{style:{width:`100%`},value:e??null,disabled:n,onChange:t})}),hh(`range`,{multiValue:!0,render:e=>(0,l.jsx)(bm,{...e})}),hh(`daterangePreset`,{multiValue:!0,render:e=>(0,l.jsx)(Em,{...e})}),hh(`keywords`,{booleanEligible:!0,multiValue:!0,ownsLabel:e=>Wm(e),hasValue:Zm,render:e=>(0,l.jsx)(dh,{...e})});function Ch(e=[]){return Array.isArray(e)?e.map(e=>{if(e==null)return null;if(typeof e==`string`||typeof e==`number`)return{label:String(e),value:e};let t=e.label??e.name??e.value??e.id,n=e.value??e.id??e.name??e.label;return n===void 0?null:{label:String(t??n),value:n,locked:!!e.locked}}).filter(Boolean):[]}function wh({field:e,moduleName:t,value:r,onChange:i,disabled:a,extraProps:s}){let c=gh(e.type??`text`),l=e.dataSource??c.defaultDataSource??`static`,u=!!c.needsOptions&&l!==`static`,d=(0,o.useMemo)(()=>Ch(e.options??e.values??[]),[e.options,e.values]),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(u);return(0,o.useEffect)(()=>{if(!u)return;let r=!1;return(async()=>{try{let i=await n.vn(t,e.field,``,200,0,{dataSource:l,masterName:e.masterName,groupName:e.groupName}),a=Array.isArray(i)?i:i?.data??i?.values??[];r||p(Ch(a))}catch(t){console.error(`[SearchBuilderV1] Failed to load options for "${e.field}":`,t),r||p([])}finally{r||h(!1)}})(),()=>{r=!0}},[u,l,e.field,e.masterName,e.groupName,t]),c.render({field:e,value:r,onChange:i??(()=>{}),options:f??d,optionsLoading:m,disabled:a,placeholder:e.placeholder,moduleName:t,...s??{}})}wh.propTypes={field:f.default.object.isRequired,moduleName:f.default.string,value:f.default.any,onChange:f.default.func,disabled:f.default.bool,extraProps:f.default.object};var{TextArea:Th}=s.Input;function Eh({field:e,value:t,onChange:n,disabled:r,serverError:i}){return(0,l.jsxs)(`div`,{className:`sbv1-boolean-field`,children:[(0,l.jsx)(Th,{rows:e.rows??3,value:t??``,disabled:r,status:i?`error`:void 0,placeholder:e.booleanPlaceholder??`(Java OR J2EE) AND "Spring Boot" NOT Hibernate`,onChange:e=>n(e.target.value)}),i&&(0,l.jsx)(`div`,{className:`v1-input-validator-hint`,children:i})]})}Eh.propTypes={field:f.default.object.isRequired,value:f.default.string,onChange:f.default.func.isRequired,disabled:f.default.bool,serverError:f.default.string};var Dh=[`query`,`skills`,`jobTitle`,`designation`,`currentLocation`,`experience.from`,`experience.to`,`workExperienceYears`,`sourceType`,`createdFrom`,`createdTo`],Oh=new Set([`experience.from`,`experience.to`,`workExperienceYears`]);function kh(e,t,n){if(!t.includes(`.`)){e[t]=n;return}let[r,i]=t.split(`.`);e[r]={...e[r]??{},[i]:n}}function Ah(e){return e&&typeof e==`object`&&!Array.isArray(e)?e.value??e.label??e.name??``:e}function jh(e,t){let n=Ah(t);if(Oh.has(e)){if(n===``||n==null)return;let e=Number(n);return Number.isFinite(e)?e:void 0}if(Array.isArray(n)){let t=n.map(Ah).filter(e=>e!=null&&String(e).trim()!==``);return t.length?e===`sourceType`?t.join(`,`):t.join(` OR `):void 0}let r=String(n??``).trim();return r===``?void 0:r}function Mh(e={},t=[],n={}){let r={},i=!!n.booleanMode;t.forEach(t=>{let n=t.booleanApiKey;if(!n)return;let a=e[t.field];if(Um(t)){let e=Hm(a);if(Wm(t)){if(!i)return;let t=e.expression.trim();t&&kh(r,Array.isArray(n)?n[0]:n,t);return}a=e.terms.map(e=>e.value)}if(a==null||a===``)return;if(Array.isArray(n)){let e;e=Array.isArray(a)?a:a&&typeof a==`object`&&(`from`in a||`to`in a)?[a.from,a.to]:[a],n.forEach((t,n)=>{let i=jh(t,e[n]);i!==void 0&&kh(r,t,i)});return}let o=jh(n,a);o!==void 0&&kh(r,n,o)}),!r.sourceType&&n.defaultSourceType&&(r.sourceType=n.defaultSourceType);let a=sh(t,e,{booleanMode:i});return a&&(r.keywordGroups=a),n.module&&(r.module=String(n.module)),r}function Nh(e){return Array.isArray(e.rangeKeys)&&e.rangeKeys.length===2?e.rangeKeys:[`${e.field}From`,`${e.field}To`]}function Ph(e={},t=[]){let n={...e};return t.forEach(t=>{let r=t.type??`text`;if(r===`daterangePreset`){delete n[t.field];return}if(r===`keywords`){let r=Hm(e[t.field]).terms.map(e=>e.value);r.length?n[t.field]=r:delete n[t.field];return}if(!gh(r).multiValue||r!==`range`&&r!==`daterange`)return;let i=e[t.field];if(!Array.isArray(i))return;let[a,o]=Nh(t);delete n[t.field];let[s,c]=i;s!=null&&s!==``&&(n[a]=s),c!=null&&c!==``&&(n[o]=c)}),n}function Fh(e={},t=[]){let n=[];return t.forEach(t=>{if(t.type!==`daterangePreset`)return;let r=e[t.field],i=r?.from,a=r?.to;if(!i&&!a)return;let o=t.filterField||t.field;i&&n.push({field:o,op:`gte`,value:i,operator:`and`}),a&&n.push({field:o,op:`lte`,value:a,operator:`and`})}),n}async function Ih(e,n={},{limit:r=10,offset:i=0}={}){if(!e)throw Error(`No boolean search endpoint is configured for this form.`);let a;try{a=await t.o(t.x,e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...n,limit:r,offset:i})})}catch(e){let t=e?.response?.error;throw t&&(e.code=t.code,e.details=t.details,e.response?.message&&(e.message=e.response.message)),e}if(a?.status===!1){let e=Error(a?.message||`Boolean search failed`);throw e.code=a?.error?.code,e.details=a?.error?.details,e}let o=a?.data??a??{},s=Array.isArray(o.items)?o.items:[],c=o.count??{},l=Number(c.total),u={};return Number.isFinite(Number(c.internal))&&(u.internal=Number(c.internal)),Number.isFinite(Number(c.dice))&&(u.dice=Number(c.dice)),{rows:s,total:Number.isFinite(l)?l:s.length,counts:u,sources:Array.isArray(o.sources)?o.sources:[]}}function Lh({moduleName:e,criteria:t={},searchMode:n=`traditional`,sources:r=[],sourceModules:i,scope:a=``,sort:o=``,sortDir:s=``}){let c=String(a??``).trim().toLowerCase(),l=Ko(r);return{...t,module:c&&i?.[c]||e,searchMode:n,...l.length?{sourceType:l.join(`,`)}:{},...c?{scope:c}:{},...o?{sortBy:o}:{},...s?{sortOrder:s}:{}}}function Rh(e,t){return Ko(e).map(e=>{let n=Number(t?.[e]);return{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),...Number.isFinite(n)?{count:n}:{}}})}async function zh(e){let t=e?.data??e?.items;if(!Array.isArray(t)||t.length===0)return e;let{isDiceResponse:n,mapDiceCandidatesToInternal:r}=await Promise.resolve().then(()=>require("./diceCandidateMapper-BjMhHno3.cjs")).then(e=>e.t);if(!n({data:e}))return e;let i=r(t);return{...e,data:i,items:i}}function Bh({endpoint:e,criteria:n,searchMode:r,sources:i,sourceModules:a}){if(!e)throw Error(`No search endpoint is configured for this form.`);return async function(o,s,c,l={}){let{scope:u,sort:d,sortDir:f}=l,p=Lh({moduleName:o,criteria:n,searchMode:r,sources:i,sourceModules:a,scope:u,sort:d,sortDir:f}),m;try{m=await t.o(t.x,e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...p,limit:s,offset:c})})}catch(e){let t=e?.response?.error;throw t&&(e.code=t.code,e.details=t.details,e.response?.message&&(e.message=e.response.message)),e}if(m?.status===!1){let e=Error(m?.message||`Search failed`);throw e.code=m?.error?.code,e.details=m?.error?.details,e}let h=await zh(m?.data??m??{}),{data:g,..._}=h;return{..._,items:h.items??g??[],tabs:h.tabs?.length?h.tabs:Rh(i,h.count)}}}var{Text:Vh}=s.Typography,Hh=`selectedSource`,Uh=new Set([Hh,`source`,`sourceType`,`scope`]),Wh={searched:!1,rows:[],total:0,fields:[],actions:[],actionRules:[],loading:!1};function Gh(e){return Array.isArray(e)?e:Array.isArray(e?.groups)?e.groups:Array.isArray(e?.data?.groups)?e.data.groups:[]}function Kh(e){return e===!0||e===1||e===`1`}function qh(e){return[Number(e.min??0),Number(e.max??30)]}function Jh(e){if(e.type===`range`)return String(e.defaultRange??``).trim()===`full`?qh(e):void 0;if(e.type===`daterangePreset`){let t=String(e.defaultPreset??``).trim();if(!t)return;let[n,r]=Sm(t);return{preset:t,from:wm(n),to:Cm(r)}}let t=(Array.isArray(e.options)?e.options:[]).filter(e=>e.locked).map(e=>e.value);if(t.length)return e.type===`radio`?t[0]:t}function Yh(e,t){if(e?.type===`range`){if(String(e.defaultRange??``).trim()!==`full`||!Array.isArray(t)||t.length!==2)return!1;let[n,r]=qh(e);return Number(t[0])===n&&Number(t[1])===r}if(e?.type===`daterangePreset`){let n=String(e.defaultPreset??``).trim();return!!n&&t?.preset===n}return!1}function Xh(e,t){return String(e?._id??e?.id??e?.applicantRefrenceId??e?.applicantReferanceId??e?.diceId??e?.profileId??t)}function Zh(e,t,n){let r=e?yh(e,t,n):void 0;return r===void 0?t==null||t===``||Yh(e,t)?!1:!Array.isArray(t)||t.length>0:r}function Qh(e,t=[],n={}){let r=new Map(t.map(e=>[e.field,e]));return Object.entries(e??{}).some(([e,t])=>{if(Uh.has(e))return!1;let i=r.get(e);return Zh(i,t,{...n,isPrimary:Wm(i)})})}function $h({moduleName:e,action:i,formType:a=`search`,title:u,migrationJobId:f,sourceModules:p,searchActionContext:m,onBack:h}){let[g]=s.Form.useForm(),_=(0,d.useNavigate)(),[v,y]=(0,o.useState)(null),[b,x]=(0,o.useState)(!0),[S,C]=(0,o.useState)(``),[w,T]=(0,o.useState)(0),[E,D]=(0,o.useState)(`traditional`),[O,k]=(0,o.useState)(`internal`),[A,j]=(0,o.useState)({}),[M,N]=(0,o.useState)([]),[P,F]=(0,o.useState)(Wh),[I,L]=(0,o.useState)({current:1,pageSize:10}),[R,z]=(0,o.useState)(null),[B,V]=(0,o.useState)({}),[H,U]=(0,o.useState)({}),[ee,te]=(0,o.useState)(null),[ne,re]=(0,o.useState)(0),[ie,ae]=(0,o.useState)(null),[W,oe]=(0,o.useState)(`list`),[se,ce]=(0,o.useState)(!1),le=(0,o.useId)(),ue=(0,o.useRef)(!1),de=(0,o.useCallback)(e=>{ue.current&&(ue.current=!1,e&&ce(!0))},[]);(0,o.useEffect)(()=>{if(!e)return;let t=!1;return n.xr(e,a,i).then(e=>{t||(y(Array.isArray(e)?e[0]??null:e??null),C(``))}).catch(e=>{t||C(e?.message||`Failed to load the search form configuration.`)}).finally(()=>{t||x(!1)}),()=>{t=!0}},[e,a,i,w]);let fe=()=>{x(!0),T(e=>e+1)},pe=(0,o.useMemo)(()=>Gh(v).filter(e=>!Kh(e.hideGroup)).sort((e,t)=>Number(e.order??0)-Number(t.order??0)).flatMap(e=>(e.fields??[]).filter(e=>e?.field&&e.show!==0&&!Kh(e.hidden)).slice().sort((e,t)=>Number(e.order??0)-Number(t.order??0))),[v]),me=(0,o.useMemo)(()=>Jo(pe,p),[pe,p]),he=(0,o.useMemo)(()=>pe.some(e=>e.field===Hh),[pe]),ge=(0,o.useMemo)(()=>pe.find(e=>Wm(e))??null,[pe]),_e=!!v?.booleanSearchEnabled&&!!v?.booleanSearchEndpoint&&!!ge,G=_e&&E===`boolean`,K=(0,o.useMemo)(()=>ge?[ge]:[],[ge]);(0,o.useEffect)(()=>{pe.filter(e=>e.booleanCapable&&!Fm(e.booleanApiKey)).forEach(e=>{console.warn(`[SearchBuilderV1] "${e.field}" is marked booleanCapable but its booleanApiKey (${JSON.stringify(e.booleanApiKey)}) is not one of ${Nm.join(`, `)} — Boolean now belongs to the common Keywords field only, so this renders as a normal field and its value is matched literally. Clear the flag in Admin → Form Groups.`)})},[pe]);let ve=(0,o.useMemo)(()=>pe.filter(e=>!(G&&Kh(e.hideInBooleanMode))),[pe,G]),ye=(0,o.useCallback)(e=>pe.find(t=>Um(t)&&Gm(t)&&qm(t)===qm(e)),[pe]),be=e=>{let t={};pe.filter(Wm).forEach(n=>{let r=g.getFieldValue(n.field);if(e){t[n.field]=ah(r);return}let{model:i,exclude:a,converted:o}=oh(r,{starsEnabled:Km(n)});if(o){if(a?.length){let e=ye(n);if(!e)return;t[e.field]={...Hm(g.getFieldValue(e.field)),terms:a.map(e=>({value:e,mandatory:!1})),mandatoryAll:!1}}t[n.field]=i}}),Object.keys(t).length&&(g.setFieldsValue(t),U(e=>({...e,...t}))),j({}),te(null),D(e?`boolean`:`traditional`)},xe=(0,o.useCallback)(async(t,r,i={})=>{let a=Number(i.pageSize)>0?Number(i.pageSize):I.pageSize,o=Number(i.current),c=Number.isFinite(o)&&o>0?Math.floor(o):1,l=Ko(t?.[Hh]),u=he?r?qo(r,O):l.includes(`internal`)?`internal`:qo(t?.[Hh],O):``,d=me[Go(u)]||e;z(t),L({current:c,pageSize:a}),j({}),F(e=>({...e,loading:!0,searched:!0}));try{let e;if(G){let n=Mh(t,ve,{booleanMode:!0,defaultSourceType:he?v?.booleanDefaultSourceType||u||`internal`:``,module:d});e=await Ih(v.booleanSearchEndpoint,n,{limit:a,offset:(c-1)*a})}else e=await n.bn(d,{...Ph(t,ve),...u?{[Hh]:(l.length?l:[u]).join(`,`)}:{}},{limit:a,offset:(c-1)*a},{scope:u,filters:Fh(t,ve)});let r=Number(e.counts?.[u]),i=Number.isFinite(r)?r:e.total;if(k(u),de(Number(i)>0||(e.rows?.length??0)>0),F({searched:!0,rows:e.rows,total:i,fields:e.fields??[],actions:e.actions??[],actionRules:e.actionRules??[],loading:!1}),!he){N(e.tabs??[]);return}N(t=>es({sources:l.length?l:e.sources,activeSource:u,activeCount:i,responseCounts:e.counts,currentTabs:t,backendTabs:e.tabs}))}catch(e){let t=e?.details?String(e.details):``,n=e?.code===`INVALID_BOOLEAN_QUERY`?K.find(e=>t.toLowerCase().includes(String(e.field).toLowerCase())):null;n?j({[n.field]:t}):s.message.error(t||e?.message||`Search failed`),F({...Wh,searched:!0})}},[ve,K,he,G,e,I.pageSize,v,O,de,me]),Se=String(v?.searchEndpoint??``).trim(),Ce=(0,o.useCallback)(e=>{let t=Fh(e,ve);return{...Mh(e,ve,{booleanMode:G,defaultSourceType:he?v?.booleanDefaultSourceType||`internal`:``}),...t.length?{fieldFilters:t}:{}}},[ve,he,G,v]),we=(0,o.useMemo)(()=>!Se||!ee?null:Bh({endpoint:Se,criteria:ee,searchMode:G?`boolean`:`traditional`,sources:ie??[],sourceModules:me}),[Se,ee,G,ie,me]),Te=(0,o.useCallback)(e=>!e?.apiPath||!e?.routeTemplate?e:{...e,onClick:async({selectedRecords:i})=>{let a=i?.[0]??{},o=r.r(a),c=o?{...a,diceId:o}:a,l=n.N(e.apiPath,c._id??c.id,c);if(!l){s.message.error(`${e.label}: the configured API path is not a valid in-app path.`);return}try{let r=String(e.apiMethod||`POST`).toUpperCase(),i=await t.o(t.x,l,{method:r,body:[`GET`,`DELETE`].includes(r)?void 0:JSON.stringify({ids:[a._id??a.id],records:[a]})});s.message.success(`${e.label} completed`);let o={...c,...i?.data??i??{}},u=n.N(e.routeTemplate,o._id??o.id,o);u&&_(u)}catch(t){s.message.error(t?.message||`${e.label} failed`)}}},[_]),Ee=(0,o.useCallback)((e,t)=>{let n=ri(e,t);return de(Number(n.total)>0||(n.rows?.length??0)>0),{...n,actions:(n.actions??[]).map(Te)}},[Te,de]),De=()=>{g.validateFields().then(e=>{if(ue.current=!0,Se){ae(Ko(e?.[Hh])),te(Ce(e)),re(e=>e+1);return}xe(e,void 0,{current:1})}).catch(()=>{ue.current=!1,ce(!1),s.message.error(`Fix the highlighted field before searching.`)})},Oe=()=>{ue.current=!1,ce(!1),g.resetFields(),U({}),j({}),F(Wh),N([]),k(`internal`),te(null),ae(null)},ke=(0,o.useCallback)(async(e,t)=>{let n=os(e,t);V(e=>({...e,[n]:{...e[n],loading:!0}}));try{await ss(e,t),V(e=>({...e,[n]:{loading:!1,completed:!0}})),s.message.success(e.successMessage)}catch(t){V(e=>({...e,[n]:{loading:!1}})),s.message.error(t?.message||e.errorMessage)}},[]),Ae=(0,o.useMemo)(()=>{let e=P.fields?.length?P.fields:(()=>{let e=P.rows[0];return e?Object.keys(e).filter(t=>!t.startsWith(`_`)&&typeof e[t]!=`object`).map(e=>({value:e,field:e,label:e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase()),isVisible:!0})):[]})(),t=is({rows:P.rows,selectedSource:O});if(!t.length)return e;let n=new Set(t.map(e=>e.field));return[...e.filter(e=>e.cardRole!==`action`&&!n.has(e.value)),...t.map(e=>({value:e.field,field:e.field,label:e.label??`Action`,cardRole:`action`,isVisible:!0,sorter:!1,render:(t,n)=>{if(!as(e,n,O))return null;let r=os(e,n),i=B[r]??{};return(0,l.jsx)(s.Button,{type:`primary`,size:`small`,loading:i.loading,disabled:!r||i.completed,onClick:()=>ke(e,n),children:i.completed?e.completedLabel:e.buttonLabel})}}))]},[ke,P.fields,P.rows,O,B]),je=(0,o.useMemo)(()=>m??(f?{jobId:f}:null),[m,f]),Me=(0,o.useMemo)(()=>{if(!je)return P.actions;let e=t=>({...t,popupState:{...je,...t.popupState},...t.children?{children:t.children.map(e)}:{}});return(P.actions??[]).map(e)},[P.actions,je]),Ne=!!v?.actionButtonEnabled,Pe=Ne?n.N(v?.actionButtonUrl,void 0,je??{}):null,Fe=()=>{if(Pe){if(v?.actionButtonTarget===`_blank`){window.open(Pe,`_blank`,`noopener`);return}_(Pe)}},Ie={booleanMode:G},Le=K.some(e=>Zh(e,H[e.field],{...Ie,isPrimary:!0})),Re=ve.filter(e=>Kh(e.req)&&!Zh(e,H[e.field],{...Ie,isPrimary:Wm(e)})),ze=Re.length>0||(G?!Le:!Qh(H,ve,Ie)),q=Re.length?`Enter ${Re.map(e=>e.label??e.field).join(`, `)} to search.`:G&&!Le&&K.length?`Enter a query in at least one of: ${K.map(e=>e.label??e.field).join(`, `)}.`:``;return e?b?(0,l.jsx)(`div`,{className:`sbv1-page`,children:(0,l.jsx)(s.Card,{className:`sbv1-card`,children:(0,l.jsx)(s.Skeleton,{active:!0,paragraph:{rows:4}})})}):S?(0,l.jsx)(`div`,{className:`sbv1-page`,children:(0,l.jsx)(s.Card,{className:`sbv1-card`,children:(0,l.jsxs)(s.Space,{direction:`vertical`,align:`center`,style:{width:`100%`},children:[(0,l.jsx)(Vh,{strong:!0,children:`Failed to load the search form`}),(0,l.jsx)(Vh,{type:`secondary`,children:S}),(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.ReloadOutlined,{}),onClick:fe,children:`Retry`})]})})}):pe.length?(0,l.jsxs)(`div`,{className:`sbv1-page`,children:[(0,l.jsx)(s.Card,{className:`sbv1-card${se?` sbv1-card-collapsed`:``}`,title:(0,l.jsx)(Vh,{strong:!0,children:u??v?.label??`Search`}),extra:(0,l.jsxs)(s.Space,{size:12,children:[(0,l.jsx)(s.Button,{size:`small`,className:`sbv1-action-btn`,icon:(0,l.jsx)(c.FilterOutlined,{}),onClick:Oe,children:`Reset filters`}),(0,l.jsx)(s.Tooltip,{title:q||void 0,children:(0,l.jsx)(s.Button,{size:`small`,className:`sbv1-action-btn`,icon:(0,l.jsx)(c.SearchOutlined,{}),disabled:ze,loading:P.loading,onClick:De,children:`Search`})}),Ne&&(0,l.jsx)(s.Tooltip,{title:Pe?void 0:`No valid destination configured`,children:(0,l.jsx)(s.Button,{size:`small`,className:`sbv1-action-btn`,icon:(0,l.jsx)(c.FileTextOutlined,{}),disabled:!Pe,onClick:Fe,children:v?.actionButtonLabel||`Open`})}),h&&(0,l.jsx)(s.Button,{size:`small`,className:`sbv1-action-btn`,onClick:h,children:`Back`}),(0,l.jsx)(s.Tooltip,{title:se?`Show filters`:`Hide filters`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,className:`sbv1-collapse-btn`,icon:se?(0,l.jsx)(c.DownOutlined,{}):(0,l.jsx)(c.UpOutlined,{}),"aria-label":se?`Show filters`:`Hide filters`,"aria-expanded":!se,"aria-controls":le,onClick:()=>ce(e=>!e)})})]}),children:(0,l.jsxs)(s.Form,{id:le,form:g,layout:`vertical`,colon:!1,onValuesChange:(e,t)=>U(t),children:[(0,l.jsx)(s.Row,{gutter:[24,0],children:ve.map(t=>{let n=G&&K.includes(t),r=Um(t),i=e=>r?Hm(e).expression:e,a=[];return Kh(t.req)&&a.push({required:!0,message:`${t.label??t.field} is required`}),n&&(a.push({validator:(e,t)=>{let{errors:n}=Im(i(t));return n.length?Promise.reject(Error(n[0])):Promise.resolve()}}),a.push({warningOnly:!0,validator:(e,t)=>{let{warnings:n}=Im(i(t));return n.length?Promise.reject(Error(n[0])):Promise.resolve()}})),(0,l.jsx)(s.Col,{xs:24,sm:12,lg:t.col??12,children:(0,l.jsx)(s.Form.Item,{name:t.field,label:vh(t)?null:t.label??t.field,rules:a.length?a:void 0,initialValue:Jh(t),children:n&&!r?(0,l.jsx)(Eh,{field:t,serverError:A[t.field]}):(0,l.jsx)(wh,{field:t,moduleName:e,extraProps:r?{booleanEnabled:_e,booleanMode:G,onBooleanModeChange:be,serverError:A[t.field]}:void 0})})},t.field)})}),q&&(0,l.jsx)(`div`,{className:`sbv1-actions`,children:(0,l.jsx)(Vh,{type:`secondary`,className:`sbv1-empty-hint`,children:q})})]})}),Se&&we&&(0,l.jsx)(Lo,{moduleName:e,breadcrumbItems:[],fetchData:we,responseMapper:Ee,queryParams:ee,rowKey:Xh,showSearch:!1,activeView:W,onViewChange:oe,showViewToggle:!0,autoCardForExternalRows:!1},ne),!Se&&P.searched&&(0,l.jsx)(Lo,{moduleName:e,breadcrumbItems:[],dataSource:P.rows,fields:Ae,total:P.total,loading:P.loading,current:I.current,pageSize:I.pageSize,showSearch:!1,tabs:M,selectedSource:O,onTabChange:e=>xe(R??{},e,{current:1}),onPageChange:(e,t)=>xe(R??{},O,{current:e,pageSize:t}),onPageSizeChange:(e,t)=>xe(R??{},O,{current:1,pageSize:t}),actions:Me,actionRules:P.actionRules})]}):(0,l.jsx)(`div`,{className:`sbv1-page`,children:(0,l.jsx)(s.Card,{className:`sbv1-card`,children:(0,l.jsxs)(Vh,{type:`secondary`,children:[`No search fields are configured for “`,e,`”.`]})})}):(0,l.jsx)(`div`,{className:`sbv1-page`,children:(0,l.jsx)(s.Card,{className:`sbv1-card`,children:(0,l.jsx)(Vh,{type:`danger`,children:`moduleName is required.`})})})}$h.propTypes={moduleName:f.default.string.isRequired,action:f.default.string,formType:f.default.string,title:f.default.string,migrationJobId:f.default.oneOfType([f.default.string,f.default.number]),searchActionContext:f.default.object,sourceModules:f.default.object,onBack:f.default.func};var eg={active:`green`,approved:`green`,hired:`green`,submitted:`gold`,resubmitted:`purple`,pending:`gold`,draft:`default`,rejected:`red`,inactive:`default`,completed:`blue`,not_submitted:`default`};function tg({status:e}){let t=String(e??`unknown`),n=eg[t.toLowerCase()]??`default`;return(0,l.jsx)(s.Tag,{color:n,style:{borderRadius:6,fontWeight:600,fontSize:12,textTransform:`capitalize`},children:t.replace(/_/g,` `)})}function ng(e,t){if(!e||typeof e!=`object`)return null;let n=e.key??e.value??e.id??String(t),r=e.label??e.title??e.name??e.tabTitle;return!n||!r?null:{key:String(n),label:String(r),count:e.count??e.countValue}}function rg({tabs:e=[],activeKey:t,onChange:n,className:r=``}){let i=e.map(ng).filter(Boolean);if(!i.length)return null;let a=i.some(e=>e.key===t)?t:i[0].key;return(0,l.jsx)(`div`,{className:`stylish-tabs ${r}`.trim(),children:i.map(e=>{let t=e.key===a,r=e.count!=null;return(0,l.jsxs)(`button`,{type:`button`,className:`stylish-tabs__item${t?` stylish-tabs__item--active`:``}`,onClick:()=>n?.(e.key),children:[(0,l.jsx)(`span`,{className:`stylish-tabs__label`,children:e.label}),r&&(0,l.jsx)(s.Badge,{count:e.count,showZero:!0,overflowCount:999,className:`stylish-tabs__badge${t?` stylish-tabs__badge--active`:``}`})]},e.key)})})}var{TextArea:ig}=s.Input;function ag({value:e=``,onChange:t,placeholder:n="e.g. ${{clientRate}} /{{rateType}}",disabled:r=!1,textareaRef:i}){return(0,l.jsx)(ig,{ref:i,value:e,disabled:r,placeholder:n,autoSize:{minRows:2,maxRows:6},spellCheck:!1,onChange:e=>t?.(e.target.value),style:{width:`100%`,fontFamily:`"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace`,fontSize:12,lineHeight:`20px`,resize:`vertical`}})}var og=[`Weekly`,`Bi-Weekly`,`Monthly`].map(e=>({value:e,label:e})),sg=[7,15,30,45,60,90].map(e=>({value:`NET_${e}`,label:`NET ${e}`}));function cg({search:e,onSearchChange:t,searchPlaceholder:n=`Search employee, client, employer, project…`,monthValue:r,onMonthChange:i,cycleValue:a,onCycleChange:o,termsValue:u,onTermsChange:d,termsOptions:f=sg,statusValue:p,onStatusChange:m,statusOptions:h=[],chips:g=[],activeChips:_=[],onToggleChip:v,onReset:y,onRefresh:b,onExport:x,exporting:S=!1,disabled:C=!1}){return(0,l.jsxs)(`div`,{className:`fin-toolbar`,children:[(0,l.jsxs)(`div`,{className:`fin-toolbar__main`,children:[(0,l.jsxs)(`div`,{className:`fin-toolbar__filters`,children:[(0,l.jsx)(s.Input,{className:`fin-toolbar__search`,size:`large`,allowClear:!0,prefix:(0,l.jsx)(c.SearchOutlined,{className:`fin-toolbar__search-icon`}),placeholder:n,value:e,onChange:e=>t?.(e.target.value),disabled:C}),(0,l.jsx)(s.DatePicker,{className:`fin-toolbar__control`,picker:`month`,allowClear:!0,placeholder:`All months`,value:r,onChange:i,disabled:C}),d?(0,l.jsx)(s.Select,{className:`fin-toolbar__control`,allowClear:!0,placeholder:`Payment terms`,value:u||void 0,onChange:e=>d(e??``),options:f,disabled:C,popupMatchSelectWidth:!1}):null,o?(0,l.jsx)(s.Select,{className:`fin-toolbar__control`,allowClear:!0,placeholder:`Payment cycle`,value:a||void 0,onChange:e=>o(e??``),options:og,disabled:C,popupMatchSelectWidth:!1}):null,(0,l.jsx)(s.Select,{className:`fin-toolbar__control`,allowClear:!0,placeholder:`Status`,value:p||void 0,onChange:e=>m?.(e??``),options:h,disabled:C,popupMatchSelectWidth:!1})]}),(0,l.jsxs)(`div`,{className:`fin-toolbar__actions`,children:[(0,l.jsx)(s.Tooltip,{title:`Reset filters`,children:(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.ClearOutlined,{}),onClick:y,disabled:C,"aria-label":`Reset filters`})}),(0,l.jsx)(s.Tooltip,{title:`Refresh`,children:(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.ReloadOutlined,{}),onClick:b,disabled:C,"aria-label":`Refresh`})}),(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.DownloadOutlined,{}),onClick:x,loading:S,disabled:C,children:`Export`})]})]}),g.length?(0,l.jsxs)(`div`,{className:`fin-toolbar__chips`,children:[(0,l.jsxs)(`span`,{className:`fin-toolbar__chips-label`,children:[(0,l.jsx)(c.ThunderboltOutlined,{}),` Quick filters`]}),g.map(e=>{let t=_.includes(e.key);return(0,l.jsx)(`button`,{type:`button`,className:`fin-chip${t?` fin-chip--active`:``}`,onClick:()=>v?.(e.key),disabled:C,children:e.label},e.key)})]}):null]})}var lg={regularDayHours:8,standardMaxHours:8,overtimeMaxRegular:16,overtimeMaxWeekOff:24,step:.5,decimals:2,epsilon:.001},ug={ST_MAX:`Standard hours cannot exceed 8 hours.`,LEAVE_MAX:`Leave hours cannot exceed 8 hours.`,LEAVE_REMAINING:`Leave hours cannot exceed the remaining regular hours.`,DAY_TOTAL:`Standard + Leave hours cannot exceed 8 hours.`,OT_MAX_REGULAR:`Overtime cannot exceed 16 hours on a regular working day.`,OT_MAX_WEEKOFF:`Overtime cannot exceed 24 hours on a week-off.`,OT_REQUIRES_FULL_STANDARD:`Overtime can only be entered after completing 8 standard working hours.`,WEEKOFF_NA:`Standard and Leave hours are not applicable on a week-off.`,ST_NEGATIVE:`Standard hours cannot be negative.`,OT_NEGATIVE:`Overtime cannot be negative.`,LEAVE_NEGATIVE:`Leave hours cannot be negative.`};function dg(e){let t=Number(e);return Number.isFinite(t)?t:0}function fg(e,t=lg.decimals){let n=10**t;return Math.round(dg(e)*n)/n}function pg(e,t,n,r=lg.decimals){return fg(Math.min(Math.max(dg(e),t),n),r)}function mg(e){return e?.isHoliday?`holiday`:e?.isWeekOff?`weekOff`:`working`}function hg(e,t,n,r,i=!0){e.push({field:t,code:n,message:ug[n],blocking:i})}function gg(e,t,n=lg){let r=mg(e),i=fg(t?.ST,n.decimals),a=fg(t?.OT,n.decimals),o=fg(t?.Leave,n.decimals),s=[],c,l;if(r===`holiday`)l=0,c={ST:{min:0,max:0,step:n.step,disabled:!0},OT:{min:0,max:0,step:n.step,disabled:!0},Leave:{min:0,max:0,step:n.step,disabled:!0}};else if(r===`weekOff`)l=n.overtimeMaxWeekOff,c={ST:{min:0,max:0,step:n.step,disabled:!0},OT:{min:0,max:l,step:n.step,disabled:!1},Leave:{min:0,max:0,step:n.step,disabled:!0}},(i>n.epsilon||o>n.epsilon)&&hg(s,`ST`,`WEEKOFF_NA`,n,!1),a<0?hg(s,`OT`,`OT_NEGATIVE`,n):a>l+n.epsilon&&hg(s,`OT`,`OT_MAX_WEEKOFF`,n);else{l=n.overtimeMaxRegular;let e=pg(n.regularDayHours-i,0,n.regularDayHours,n.decimals),t=!1;i<0?(hg(s,`ST`,`ST_NEGATIVE`,n),t=!0):i>n.standardMaxHours+n.epsilon&&(hg(s,`ST`,`ST_MAX`,n),t=!0),t||(o<0?hg(s,`Leave`,`LEAVE_NEGATIVE`,n):o>n.regularDayHours+n.epsilon?hg(s,`Leave`,`LEAVE_MAX`,n):o>e+n.epsilon&&(e<=n.epsilon?hg(s,`ST`,`DAY_TOTAL`,n):hg(s,`Leave`,`LEAVE_REMAINING`,n)));let r=Math.abs(i-n.standardMaxHours)<=n.epsilon;a<0?hg(s,`OT`,`OT_NEGATIVE`,n):a>n.epsilon&&!r?hg(s,`OT`,`OT_REQUIRES_FULL_STANDARD`,n):a>l+n.epsilon&&hg(s,`OT`,`OT_MAX_REGULAR`,n),c={ST:{min:0,max:n.standardMaxHours,step:n.step,disabled:!1},OT:{min:0,max:l,step:n.step,disabled:!r},Leave:{min:0,max:e,step:n.step,disabled:e<=n.epsilon}}}let u=fg(i+o,n.decimals),d=r===`working`?Math.max(0,fg(n.regularDayHours-u,n.decimals)):0,f=r===`working`?Math.max(0,fg(c.Leave.max-o,n.decimals)):0,p=fg(i+a+o,n.decimals),m={ST:null,OT:null,Leave:null};for(let e of s)e.blocking&&!m[e.field]&&(m[e.field]=e.message);return{dayKind:r,values:{ST:i,OT:a,Leave:o},fields:c,regularAllocated:u,regularRemaining:d,leaveRemaining:f,overtimeCap:l,dayTotal:p,isFull:r===`working`&&d<=n.epsilon,violations:s,errorsByField:m,valid:!s.some(e=>e.blocking)}}function _g(e,t,n=[],r=lg){let i=fg(t?.ST,r.decimals),a=fg(t?.Leave,r.decimals),o=fg(t?.OT,r.decimals);if(e===`weekOff`){let e={};return i!==0&&(e.ST=0),a!==0&&(e.Leave=0),Object.keys(e).length?e:null}if(e===`working`){let e={},t=e=>e>=0&&e<=r.regularDayHours+r.epsilon;if(n.includes(`ST`)){let t=pg(r.regularDayHours-i,0,r.regularDayHours,r.decimals);a!==t&&(e.Leave=t)}else if(n.includes(`Leave`)){if(t(a)){let t=pg(r.regularDayHours-a,0,r.regularDayHours,r.decimals);i!==t&&(e.ST=t)}}else{let t=pg(r.regularDayHours-i,0,r.regularDayHours,r.decimals);a>t+r.epsilon&&(e.Leave=t)}let s=e.ST===void 0?i:e.ST;return!(Math.abs(s-r.standardMaxHours)<=r.epsilon)&&o>r.epsilon&&(e.OT=0),Object.keys(e).length?e:null}return null}function vg(e){return!e||e.dayKind===`holiday`?``:e.dayKind===`weekOff`?`Week off — overtime only, up to ${e.overtimeCap} hrs.`:e.isFull?`Maximum standard hours reached — 8 regular hours allocated.`:`Maximum available leave: ${e.leaveRemaining} hrs`}var{Text:yg}=s.Typography,bg={draft:`default`,logged:`blue`,submitted:`processing`,approved:`success`,rejected:`error`,resubmitted:`purple`,reopened:`warning`,save_draft:`default`,pending:`warning`,not_submitted:`default`};function xg({status:e}){if(!e||e===`draft`||e===`not_submitted`)return null;let t={submitted:{icon:(0,l.jsx)(c.CheckOutlined,{}),color:`blue`,label:`Submitted`},approved:{icon:(0,l.jsx)(c.CheckCircleOutlined,{}),color:`green`,label:`Approved`},rejected:{icon:(0,l.jsx)(c.CloseCircleOutlined,{}),color:`red`,label:`Rejected`},resubmitted:{icon:(0,l.jsx)(c.SyncOutlined,{}),color:`purple`,label:`Re-Submitted`},reopened:{icon:(0,l.jsx)(c.SyncOutlined,{}),color:`orange`,label:`Reopened`},save_draft:{icon:null,color:`default`,label:`Draft`}}[e];return t?(0,l.jsx)(s.Tag,{color:t.color,icon:t.icon,style:{borderRadius:20,fontSize:12,padding:`2px 10px`},children:t.label}):(0,l.jsx)(s.Tag,{color:bg[e]??`default`,children:e})}function Sg({configKey:e=`timesheet`,month:t,year:n}){let r=Le(e);return t&&n&&(0,u.default)(`${n}-${t}-01`).isBefore((0,u.default)().subtract(r.thresholdMonths,`month`),`month`)?(0,l.jsx)(s.Tag,{color:r.pastColor,children:r.pastLabel}):null}var Cg={working:`timesheet-day-cell--working`,overtime:`timesheet-day-cell--overtime`,leave:`timesheet-day-cell--leave`,holiday:`timesheet-day-cell--holiday`,weekoff:`timesheet-day-cell--weekoff`};function wg(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function Tg(e){let t=wg(e);return t===0?`0h`:`${t.toFixed(1).replace(/\.0$/,``)}h`}var Eg={ST:`#D0E6FF`,OT:`#AAFEBCA6`,leave:`#FFECBA`};function Dg(e,t){let n=Math.min(Math.max(e,0),1);return!String(t).startsWith(`135`)&&!String(t).startsWith(`45`)?n:n<=.5?Math.sqrt(n/2):1-Math.sqrt((1-n)/2)}function Og(e={},{angle:t=`135deg`}={}){let n=[[`ST`,wg(e?.workingHours?.ST)],[`OT`,wg(e?.workingHours?.OT)],[`leave`,wg(e?.leave?.CL)+wg(e?.leave?.SL)]].filter(([,e])=>e>0),r=n.reduce((e,[,t])=>e+t,0);if(n.length<2||r<=0)return null;let i=[],a=0;return n.forEach(([e,o],s)=>{let c=Dg(a/r,t)*100;a+=o;let l=s===n.length-1?100:Dg(a/r,t)*100;i.push(`${Eg[e]} ${c.toFixed(2)}% ${l.toFixed(2)}%`)}),`linear-gradient(${t}, ${i.join(`, `)})`}function kg(e={},{isUnloggedHighlight:t=!1,selected:n=!1,selectable:r=!1,reviewMode:i=!1}={}){let a=wg(e?.workingHours?.ST),o=wg(e?.workingHours?.OT),s=wg(e?.leave?.CL)+wg(e?.leave?.SL),c=[a,o,s].filter(e=>e>0).length>1,l=o>0?`overtime`:a>0?`working`:s>0?`leave`:null,u=!!e?.isOutOfAssignmentRange,d=u?null:e?.isHoliday?`holiday`:l??(e?.isWeekOff?`weekoff`:null),f=e?.status;return[`timesheet-day-cell`,u?`timesheet-day-cell--out-of-range`:!c&&d?Cg[d]??``:``,e?.isFuture?`timesheet-day-cell--future`:``,f===`rejected`?`timesheet-day-cell--rejected`:``,f===`approved`?`timesheet-day-cell--approved`:``,n?`timesheet-day-cell--selected`:``,t?`timesheet-day-cell--unlogged-highlight`:``,r?`timesheet-day-cell--selectable`:``,i?`timesheet-day-cell--review`:``].filter(Boolean).join(` `)}function Ag({day:e,readonly:t=!1,selected:n=!1,isUnloggedHighlight:r=!1,onSelect:i,onQuickLog:a,splitMode:o=`proportional`,splitAngle:d=`135deg`,selectable:f=!1,onToggleSelect:p,reviewMode:m=!1,onApproveDay:h,onRejectDay:g}){let _=wg(e?.workingHours?.ST),v=wg(e?.workingHours?.OT),y=wg(e?.leave?.CL)+wg(e?.leave?.SL),b=e?.status,x=b===`approved`,S=b===`rejected`,C=x&&!m,w=!!e?.isOutOfAssignmentRange,T=!t&&!f&&!w&&!e?.isFuture&&!e?.isHoliday&&!e?.isWeekOff&&!e?.isLogged,E=o===`proportional`?Og(e,{angle:d}):null,D=t=>{t.stopPropagation(),a?.(e?.date)},O=()=>{if(f){p?.(e?.date);return}i?.(e)},k=m&&e?.isLogged,A=(0,l.jsxs)(`button`,{type:`button`,className:kg(e,{isUnloggedHighlight:r,selected:n,selectable:f,reviewMode:m}),style:E?{background:E}:void 0,disabled:t&&!k||e?.isFuture||w||C&&!m,onClick:O,children:[(0,l.jsxs)(`span`,{className:`timesheet-day-cell__top`,children:[(0,l.jsxs)(`span`,{className:`timesheet-day-cell__date`,children:[e?.date?(0,u.default)(e.date).date():`-`,S&&(0,l.jsx)(`span`,{className:`timesheet-day-cell__reject-dot`})]}),(0,l.jsxs)(`span`,{className:`timesheet-day-cell__top-right`,children:[T&&(0,l.jsx)(s.Tooltip,{title:`Quick log 8h`,placement:`top`,children:(0,l.jsx)(c.ClockCircleOutlined,{className:`timesheet-day-cell__quick-log-icon`,onClick:D})}),!T&&!w&&!e?.isHoliday&&!e?.isWeekOff&&!e?.isFuture&&(0,l.jsx)(c.ClockCircleOutlined,{className:`timesheet-day-cell__quick-log-icon timesheet-day-cell__quick-log-icon--logged`})]})]}),(0,l.jsxs)(`span`,{className:`timesheet-day-cell__body`,children:[!w&&e?.isHoliday&&(0,l.jsx)(s.Tag,{color:`purple`,className:`timesheet-type-tag`,children:`H`}),!w&&e?.isWeekOff&&!e?.isLogged&&(0,l.jsx)(yg,{type:`secondary`,className:`timesheet-no-log`,children:`Off`}),_>0&&(0,l.jsxs)(`span`,{className:`timesheet-hour-label`,children:[(0,l.jsx)(`span`,{className:`timesheet-hour-value`,children:Tg(_)}),(0,l.jsx)(`span`,{className:`timesheet-hour-suffix timesheet-hour-st`,children:` s`})]}),v>0&&(0,l.jsxs)(`span`,{className:`timesheet-hour-label timesheet-hour-label--ot`,children:[(0,l.jsx)(`span`,{className:`timesheet-hour-value`,children:Tg(v)}),(0,l.jsx)(`span`,{className:`timesheet-hour-suffix timesheet-hour-ot`,children:` o`})]}),y>0&&(0,l.jsxs)(`span`,{className:`timesheet-hour-label timesheet-hour-label--leave${E?` timesheet-hour-label--split-end`:``}`,children:[(0,l.jsx)(`span`,{className:`timesheet-hour-value`,children:Tg(y)}),(0,l.jsx)(`span`,{className:`timesheet-hour-suffix timesheet-hour-leave`,children:` L`})]}),!w&&!e?.isLogged&&!e?.isHoliday&&!e?.isWeekOff&&!e?.isFuture&&(0,l.jsx)(yg,{type:`secondary`,className:`timesheet-no-log`,children:`No log`})]}),x&&(0,l.jsx)(c.CheckOutlined,{className:`timesheet-day-cell__verdict timesheet-day-cell__verdict--approved`}),S&&(0,l.jsx)(c.CloseCircleOutlined,{className:`timesheet-day-cell__verdict timesheet-day-cell__verdict--rejected`}),m&&e?.isLogged&&(h||g)&&(0,l.jsxs)(`span`,{className:`timesheet-day-review-actions`,children:[h&&(0,l.jsx)(`span`,{role:`button`,tabIndex:-1,className:`ts-approve`,title:`Approve this day`,onClick:t=>{t.stopPropagation(),h(e?.date)},children:(0,l.jsx)(c.CheckOutlined,{})}),g&&(0,l.jsx)(`span`,{role:`button`,tabIndex:-1,className:`ts-reject`,title:`Reject this day`,onClick:t=>{t.stopPropagation(),g(e?.date)},children:(0,l.jsx)(c.CloseCircleOutlined,{})})]})]});return S&&e?.rejectionReason?(0,l.jsx)(s.Tooltip,{title:e.rejectionReason,placement:`top`,children:(0,l.jsx)(`span`,{style:{display:`block`,width:`100%`},children:A})}):A}var jg=e=>e==null?``:`${e}`,Mg=e=>e===``||e===void 0?void 0:Number(e);function Ng({open:e,day:t,saving:r=!1,onCancel:i,onSubmit:a,hoursStep:d,policy:f}){let[p]=s.Form.useForm(),m=s.Form.useWatch(`ST`,p),h=s.Form.useWatch(`OT`,p),g=s.Form.useWatch(`Leave`,p),_=(0,o.useMemo)(()=>({...lg,...d?{step:d}:null,...f}),[d,f]);(0,o.useEffect)(()=>{if(!e)return;let n=mg(t),r={ST:wg(t?.workingHours?.ST),OT:wg(t?.workingHours?.OT),Leave:wg(t?.leave?.CL)+wg(t?.leave?.SL)},i=_g(n,r,[],_);p.setFieldsValue({...r,...i})},[t,p,e,_]);let v=e=>({getFieldValue:n})=>({validator(){let{errorsByField:r}=gg(t,{ST:n(`ST`),OT:n(`OT`),Leave:n(`Leave`)},_),i=r[e];return i?Promise.reject(Error(i)):Promise.resolve()}}),y=()=>{p.validateFields([`ST`,`OT`,`Leave`]).catch(()=>{})},b=(e,n)=>{let r=_g(mg(t),n,Object.keys(e),_);r&&p.setFieldsValue(r),y()},x=async()=>{let e;try{e=await p.validateFields()}catch(e){let t=document.querySelector(`.timesheet-log-modal`)??document;n.l(e,p,{root:t});return}let r=wg(e.ST),i=wg(e.OT),o=wg(e.Leave),s=[r,i,o].filter(e=>e>0).length;a?.({date:t?.date,logType:s>1?`mixed`:i>0?`overtime`:o>0?`leave`:`working`,workingHours:{ST:r,OT:i},leave:{CL:o,SL:0},isHoliday:!!t?.isHoliday,isWeekOff:!!t?.isWeekOff,notes:``})},S=t?.isHoliday,C=!!t?.isWeekOff&&!S,w=t?.date?(0,u.default)(t.date).format(`MMM DD, YYYY`):`Log time`,T=(0,o.useMemo)(()=>gg(t,{ST:m,OT:h,Leave:g},_),[t,m,h,g,_]);return(0,l.jsxs)(s.Modal,{rootClassName:`timesheet-log-modal`,title:(0,l.jsxs)(s.Space,{children:[(0,l.jsx)(yg,{strong:!0,children:w}),t?.isHoliday&&(0,l.jsx)(s.Tag,{color:`purple`,children:`Holiday`}),t?.isWeekOff&&(0,l.jsx)(s.Tag,{children:`Week Off`})]}),open:e,onCancel:i,onOk:x,confirmLoading:r,okText:`Save`,cancelText:`Cancel`,destroyOnHidden:!0,width:340,footer:(e,{OkBtn:t,CancelBtn:n})=>(0,l.jsxs)(s.Space,{style:{width:`100%`,justifyContent:`flex-end`},children:[(0,l.jsx)(n,{}),!S&&(0,l.jsx)(t,{})]}),children:[t?.rejectionReason&&(0,l.jsxs)(`div`,{className:`timesheet-log-reject`,children:[(0,l.jsxs)(`div`,{className:`timesheet-log-reject__note`,children:[(0,l.jsx)(c.CloseCircleOutlined,{className:`timesheet-log-reject__icon`}),(0,l.jsxs)(`div`,{className:`timesheet-log-reject__body`,children:[(0,l.jsx)(`span`,{className:`timesheet-log-reject__title`,children:`Sent back by your reviewer`}),(0,l.jsx)(`span`,{className:`timesheet-log-reject__reason`,children:t.rejectionReason})]})]}),(0,l.jsxs)(`div`,{className:`timesheet-log-reject__proof`,children:[(0,l.jsx)(c.UploadOutlined,{className:`timesheet-log-reject__proof-icon`}),(0,l.jsxs)(`div`,{className:`timesheet-log-reject__body`,children:[(0,l.jsx)(`span`,{className:`timesheet-log-reject__title timesheet-log-reject__title--proof`,children:`To fix it`}),(0,l.jsxs)(`ol`,{className:`timesheet-log-reject__steps`,children:[(0,l.jsx)(`li`,{children:`Correct the hours below.`}),(0,l.jsx)(`li`,{children:`Replace the proof / screenshot so it matches.`}),(0,l.jsx)(`li`,{children:`Save, then re-submit your timesheet.`})]})]})]})]}),S?(0,l.jsx)(s.Alert,{type:`info`,showIcon:!0,message:`Holiday — no manual log required.`}):(0,l.jsxs)(l.Fragment,{children:[C&&(0,l.jsx)(s.Alert,{type:`info`,showIcon:!0,message:`Week off — overtime only.`,style:{marginBottom:12}}),(0,l.jsxs)(s.Form,{form:p,layout:`vertical`,className:`timesheet-log-form`,validateTrigger:[`onChange`,`onBlur`],onValuesChange:b,children:[(0,l.jsx)(s.Form.Item,{name:`ST`,label:(0,l.jsxs)(`span`,{style:{color:`#1d4ed8`,fontWeight:600},children:[`Standard `,(0,l.jsx)(`span`,{style:{fontWeight:400,color:`#6b7280`},children:`hrs`})]}),dependencies:[`Leave`],rules:[v(`ST`)],extra:!T.errorsByField.ST&&T.fields.ST.disabled?`Disabled on a week off.`:void 0,children:(0,l.jsx)(s.InputNumber,{step:T.fields.ST.step,disabled:T.fields.ST.disabled,style:{width:`100%`},formatter:jg,parser:Mg,addonAfter:(0,l.jsx)(`span`,{style:{color:`#1d4ed8`,fontWeight:700},children:`s`})})}),(0,l.jsx)(s.Form.Item,{name:`OT`,label:(0,l.jsxs)(`span`,{style:{color:`#15803d`,fontWeight:600},children:[`Overtime `,(0,l.jsx)(`span`,{style:{fontWeight:400,color:`#6b7280`},children:`hrs`})]}),dependencies:[`ST`],rules:[v(`OT`)],extra:!T.errorsByField.OT&&T.fields.OT.disabled?`Complete 8 standard hours to log overtime.`:void 0,children:(0,l.jsx)(s.InputNumber,{step:T.fields.OT.step,disabled:T.fields.OT.disabled,style:{width:`100%`},formatter:jg,parser:Mg,addonAfter:(0,l.jsx)(`span`,{style:{color:`#15803d`,fontWeight:700},children:`o`})})}),(0,l.jsx)(s.Form.Item,{name:`Leave`,label:(0,l.jsxs)(`span`,{style:{color:`#b45309`,fontWeight:600},children:[`Leave `,(0,l.jsx)(`span`,{style:{fontWeight:400,color:`#6b7280`},children:`hrs`})]}),dependencies:[`ST`],rules:[v(`Leave`)],extra:!T.errorsByField.Leave&&T.fields.Leave.disabled?C?`Disabled on a week off.`:`Maximum reached — 8 regular hours allocated.`:void 0,children:(0,l.jsx)(s.InputNumber,{step:T.fields.Leave.step,disabled:T.fields.Leave.disabled,style:{width:`100%`},formatter:jg,parser:Mg,addonAfter:(0,l.jsx)(`span`,{style:{color:`#b45309`,fontWeight:700},children:`L`})})})]})]})]})}function Pg({count:e=0,total:t=0,hours:n=8,loading:r=!1,onConfirm:i,onCancel:a,onSelectAll:o,onSelectNone:u}){return(0,l.jsxs)(`div`,{className:`timesheet-quicklog-bar`,children:[(0,l.jsxs)(s.Space,{size:8,wrap:!0,children:[(0,l.jsx)(yg,{strong:!0,children:e===0?`No days selected`:`Log ${n}h standard on ${e} day${e===1?``:`s`}`}),t>0&&(0,l.jsxs)(yg,{type:`secondary`,style:{fontSize:12},children:[e,` of `,t,` eligible · click a day to deselect it`]})]}),(0,l.jsxs)(s.Space,{size:6,children:[(0,l.jsx)(s.Button,{size:`small`,onClick:o,disabled:e===t,children:`Select all`}),(0,l.jsx)(s.Button,{size:`small`,onClick:u,disabled:e===0,children:`Clear`}),(0,l.jsx)(s.Button,{size:`small`,onClick:a,children:`Cancel`}),(0,l.jsx)(s.Button,{size:`small`,type:`primary`,icon:(0,l.jsx)(c.ClockCircleOutlined,{}),loading:r,disabled:e===0,onClick:i,children:`Confirm`})]})]})}function Fg({open:e=!1,loading:t=!1,onSave:n,onCancel:r}){let[i,a]=(0,o.useState)(``);return(0,o.useEffect)(()=>{e&&a(``)},[e]),(0,l.jsx)(s.Modal,{title:`Rejection Reason`,open:e,onCancel:r,footer:(0,l.jsxs)(s.Space,{children:[(0,l.jsx)(s.Button,{onClick:r,children:`Cancel`}),(0,l.jsx)(s.Button,{type:`primary`,danger:!0,disabled:!i.trim(),loading:t,onClick:()=>n?.(i.trim()),children:`Reject`})]}),destroyOnHidden:!0,children:(0,l.jsx)(s.Form,{layout:`vertical`,children:(0,l.jsx)(s.Form.Item,{label:(0,l.jsxs)(`span`,{children:[(0,l.jsx)(`span`,{style:{color:`#ff4d4f`},children:`*`}),` Comments`]}),help:i.trim()?``:`Rejection reason is required`,validateStatus:i.trim()?``:`error`,children:(0,l.jsx)(s.Input.TextArea,{rows:4,maxLength:1e3,showCount:!0,placeholder:`Enter reason for rejection...`,value:i,onChange:e=>a(e.target.value)})})})})}function Ig({loading:e=!1,disabled:t=!1,onQuickLog:r}){return(0,l.jsx)(s.Card,{size:`small`,className:`timesheet-quick-log`,children:(0,l.jsx)(s.Space,{wrap:!0,children:(0,l.jsx)(n.lt,{variant:`primary`,icon:(0,l.jsx)(c.ClockCircleOutlined,{}),loading:e,disabled:t,onClick:()=>r?.(`businessDays`),children:`Quick Log (8h s)`})})})}var Lg={".pdf":[c.FilePdfOutlined,`pdf`],".doc":[c.FileWordOutlined,`word`],".docx":[c.FileWordOutlined,`word`],".xls":[c.FileExcelOutlined,`excel`],".xlsx":[c.FileExcelOutlined,`excel`],".csv":[c.FileExcelOutlined,`excel`],".png":[c.FileImageOutlined,`image`],".jpg":[c.FileImageOutlined,`image`],".jpeg":[c.FileImageOutlined,`image`],".gif":[c.FileImageOutlined,`image`],".webp":[c.FileImageOutlined,`image`]};function Rg({fileName:e}){let[t,n]=Lg[Rc(e)]??[c.FileOutlined,`default`];return(0,l.jsx)(t,{className:`timesheet-proof__type-icon timesheet-proof__type-icon--${n}`})}function zg({proof:e,uploading:t=!1,disabled:n=!1,required:r=!1,onUpload:i,onPreview:a,onRemove:o,previewUrl:u}){let d=!!e?.fileName,f=e?.size?zc(e.size):``,p=Rc(e?.fileName??``).replace(`.`,``).toUpperCase(),m=e?.pending?`Selected — uploads on submit`:`Previously uploaded`,h=[f||p,m].filter(Boolean).join(` • `),g=!n&&!(d&&o);return(0,l.jsxs)(s.Card,{className:`timesheet-proof${d?` timesheet-proof--filled`:``}`,size:`small`,title:(0,l.jsxs)(l.Fragment,{children:[`Proof / screenshot`,r&&(0,l.jsx)(`span`,{className:`timesheet-proof__required`,children:` *`})]}),children:[d?(0,l.jsxs)(`div`,{className:`timesheet-proof__file`,children:[(0,l.jsx)(`span`,{className:`timesheet-proof__file-icon`,children:(0,l.jsx)(Rg,{fileName:e.fileName})}),(0,l.jsxs)(`span`,{className:`timesheet-proof__file-info`,children:[(0,l.jsx)(`span`,{className:`timesheet-proof__file-name`,title:e.fileName,children:e.fileName}),(0,l.jsx)(`span`,{className:`timesheet-proof__file-meta`,children:h})]}),(0,l.jsxs)(s.Space,{size:6,className:`timesheet-proof__file-actions`,children:[a&&(0,l.jsx)(s.Button,{size:`small`,icon:(0,l.jsx)(c.EyeOutlined,{}),className:`timesheet-proof__view-btn`,onClick:()=>a(e),children:`View`}),o&&(0,l.jsx)(s.Tooltip,{title:`Remove`,children:(0,l.jsx)(s.Button,{size:`small`,danger:!0,icon:(0,l.jsx)(c.DeleteOutlined,{}),"aria-label":`Remove ${e.fileName}`,className:`timesheet-proof__delete-btn`,onClick:()=>o(e)})})]})]}):(0,l.jsx)(yg,{type:`secondary`,style:{fontSize:12},children:`Upload Proof`}),g&&(0,l.jsx)(s.Upload,{beforeUpload:e=>(i?.(e),!1),maxCount:1,showUploadList:!1,disabled:n,accept:`.pdf,.doc,.docx,.png,.jpg,.jpeg`,children:(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.UploadOutlined,{}),loading:t,block:!0,size:`small`,style:{marginTop:6},children:d?`Replace proof`:`Upload proof`})}),(0,l.jsx)(yg,{type:`secondary`,className:`timesheet-proof__hint`,style:{fontSize:11},children:`Supports: .pdf, .doc, .docx, .png, .jpg — max 10 MB`})]})}function Bg({value:e,disabled:t=!1,onChange:n,label:r=`Notes / Comments`,maxLength:i=1e3}){let a=(e??``).length;return(0,l.jsxs)(s.Card,{className:`timesheet-notes`,size:`small`,title:r,children:[(0,l.jsx)(`div`,{className:`timesheet-notes__field`,children:(0,l.jsx)(s.Input.TextArea,{className:`timesheet-notes__textarea`,rows:5,maxLength:i,value:e,disabled:t,onChange:e=>n?.(e.target.value),placeholder:`Add notes or comments...`})}),(0,l.jsxs)(`div`,{className:`timesheet-notes__count`,children:[a,` / `,i]})]})}function Vg({status:e,loading:t=!1,readonly:r=!1,rejectionReason:i,rejectionMode:a=`modal`,title:u=`Review Notes`,hint:d=`Review comment is mandatory while rejecting`,approveDisabled:f=!1,approveDisabledReason:p,rejectDisabled:m=!1,rejectDisabledReason:h,onSubmit:g,onApprove:_,onReject:v,onReopen:y}){let[b,x]=(0,o.useState)(!1),[S,C]=(0,o.useState)(!1),[w,T]=(0,o.useState)(``),E=[`submitted`,`resubmitted`,`reopened`,`save_draft`].includes(e),D=e===`rejected`,O=e===`approved`,k=e===`submitted`||e===`resubmitted`,A=e===`reopened`,j=!e||e===`draft`||e===`not_submitted`,M=async e=>{C(!0);try{await v?.(e),x(!1)}finally{C(!1)}},N=()=>s.Modal.confirm({title:`Reopen timesheet?`,content:`This returns the month to the resource to correct and re-submit. It cannot be reopened once its invoice or payment has been processed.`,okText:`Reopen`,onOk:y}),P=()=>{let e=w.trim();if(!e){s.message.error(`A review comment is required to reject`);return}v?.(e)};if(a===`inline`)return(0,l.jsxs)(s.Card,{size:`small`,className:`timesheet-review-notes-card`,children:[(0,l.jsxs)(`div`,{className:`timesheet-review-notes-card__head`,children:[(0,l.jsx)(yg,{strong:!0,children:u}),(0,l.jsxs)(yg,{type:`secondary`,className:`timesheet-review-notes-card__hint`,children:[(0,l.jsx)(c.InfoCircleOutlined,{}),` `,d]})]}),i&&D&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:`Rejected`,description:i,className:`timesheet-review-notes-card__alert`}),k?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Input.TextArea,{rows:3,maxLength:1e3,value:w,onChange:e=>T(e.target.value),placeholder:`Add your note`,className:`timesheet-review-notes-card__input`}),(0,l.jsxs)(`div`,{className:`timesheet-review-notes-card__actions`,children:[(0,l.jsx)(s.Tooltip,{title:m?h:``,children:(0,l.jsx)(s.Button,{danger:!0,loading:t,disabled:m,onClick:P,children:`Reject`})}),(0,l.jsx)(s.Tooltip,{title:f?p:``,children:(0,l.jsx)(s.Button,{type:`primary`,loading:t,disabled:f,onClick:_,children:`Approve`})})]})]}):(0,l.jsxs)(`div`,{className:`timesheet-review-notes-card__decided`,children:[(0,l.jsxs)(yg,{type:`secondary`,children:[`This timesheet is `,e,`.`]}),(O||D)&&y?(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.InfoCircleOutlined,{}),loading:t,onClick:N,children:`Reopen`}):null]})]});let F=`Submit`,I=!1;return k&&(F=e===`resubmitted`?`Re-Submitted`:`Submitted`,I=!0),(D||A)&&(F=`Re-Submit`,I=!1),O&&(F=`Approved`,I=!0),(0,l.jsxs)(l.Fragment,{children:[i&&D&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:`Rejected`,description:i,style:{marginBottom:8}}),(0,l.jsxs)(`div`,{className:`timesheet-action-bar`,children:[(j||D||A||k||O)&&g&&(0,l.jsx)(n.lt,{variant:`primary`,icon:(0,l.jsx)(c.SendOutlined,{}),loading:t,disabled:I,onClick:I?void 0:g,block:!0,children:F}),E&&_&&(0,l.jsx)(n.lt,{variant:`primary`,icon:(0,l.jsx)(c.CheckOutlined,{}),loading:t,onClick:_,children:`Approve`}),E&&v&&(0,l.jsx)(s.Button,{danger:!0,loading:t,onClick:()=>x(!0),children:`Reject`}),(O||D)&&y&&(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.InfoCircleOutlined,{}),loading:t,onClick:N,children:`Reopen`})]}),(0,l.jsx)(Fg,{open:b,loading:S,onSave:M,onCancel:()=>x(!1)})]})}var Hg=e=>Number.isFinite(Number(e))?Number(e):0;function Ug(e,t,{isToday:n}={}){let r=Number(e.slice(-2)),i=Hg(t?.workingHours?.ST),a=Hg(t?.workingHours?.OT),o=Hg(t?.leave?.CL)+Hg(t?.leave?.SL),c=i+a,d=!!t?.isLogged||c>0||o>0,f=t?t.isHoliday?`holiday`:d&&c>0?`work`:o>0?`leave`:t.isWeekOff?`weekoff`:`blank`:`blank`,p=[`fin-daycell`,`fin-daycell--${f}`,t?.status===`approved`?`fin-daycell--approved`:``,t?.status===`rejected`?`fin-daycell--rejected`:``,n?`fin-daycell--today`:``].filter(Boolean).join(` `),m=f===`work`?Og(t):null,h=(0,l.jsxs)(`div`,{className:p,style:m?{background:m}:void 0,children:[(0,l.jsx)(`span`,{className:`fin-daycell__num`,children:r}),f===`work`?(0,l.jsxs)(`span`,{className:`fin-daycell__hours`,children:[c%1==0?c:c.toFixed(1),`h`,a>0?(0,l.jsx)(`em`,{children:` +OT`}):null]}):f===`leave`?(0,l.jsx)(`span`,{className:`fin-daycell__hours`,children:`Leave`}):f===`holiday`?(0,l.jsx)(`span`,{className:`fin-daycell__hours`,children:`Holiday`}):null]});if(!t)return h;let g=[(0,u.default)(e).format(`ddd, MMM D`),i?`ST ${i}h`:null,a?`OT ${a}h`:null,o?`Leave ${o}h`:null,t.isHoliday?`Holiday`:null,t.status===`rejected`?`Rejected${t.rejectionReason?` — ${t.rejectionReason}`:``}`:null,t.status===`approved`?`Approved`:null].filter(Boolean).join(` · `);return(0,l.jsx)(s.Tooltip,{title:g,children:h})}var Wg=[{label:`Standard`,color:`#3b82f6`},{label:`Overtime`,color:`#22c55e`},{label:`Leave`,color:`#f59e0b`},{label:`Holiday`,color:`#8b5cf6`},{label:`Rejected`,color:`#ef4444`}];function Gg({dailyLogs:e=[],timesheetSummary:t={},rate:n=0,rateLabel:r=`Rate`,amountLabel:i=`Amount`,approvedHours:a,month:d,year:f,monthLabel:p,extraEquationTerms:m=[]}){let h=(0,o.useMemo)(()=>Xd(e),[e]),g=(0,o.useMemo)(()=>Zd(e,n),[e,n]),_=(0,o.useMemo)(()=>ef(e,n),[e,n]),v=h.totalHours||Hg(a),y=v*Hg(n),b=Math.max(1,...g.map(e=>e.total)),x=Math.max(1,..._.map(e=>e.total)),S=[{key:`hours`,label:`Approved Hours`,value:Nd(v),icon:(0,l.jsx)(c.ClockCircleOutlined,{}),tone:`brand`,sub:`${h.loggedDays} logged days`},{key:`st`,label:`Standard`,value:Nd(h.stHours||t.totalSTHours),icon:(0,l.jsx)(c.FieldTimeOutlined,{}),tone:`neutral`},{key:`ot`,label:`Overtime`,value:Nd(h.otHours||t.totalOTHours),icon:(0,l.jsx)(c.ThunderboltOutlined,{}),tone:`warning`},{key:`leave`,label:`Leave`,value:Nd(h.leaveHours||t.leaveHours),icon:(0,l.jsx)(c.RestOutlined,{}),tone:`neutral`,sub:`${h.leaveDays} days`},{key:`avg`,label:`Avg / Logged Day`,value:Nd(h.avgHoursPerLoggedDay),icon:(0,l.jsx)(c.CalendarOutlined,{}),tone:`info`},{key:`amount`,label:i,value:Md(y),icon:(0,l.jsx)(c.DollarOutlined,{}),tone:`success`}],C=[{label:`Approved days`,value:h.approvedDays,tone:`success`},{label:`Pending days`,value:h.pendingDays,tone:`gold`},{label:`Rejected days`,value:h.rejectedDays,tone:h.rejectedDays?`danger`:`neutral`},{label:`Holidays`,value:h.holidayDays,tone:`neutral`},{label:`Week-offs`,value:h.weekOffDays,tone:`neutral`}],w=[{title:`Date`,dataIndex:`date`,width:150,render:(e,t)=>(0,l.jsxs)(`div`,{className:`fin-cell-text`,children:[(0,l.jsx)(`span`,{className:`fin-cell__primary`,children:e?(0,u.default)(e).format(`ddd, MMM D`):`—`}),t.isHoliday?(0,l.jsx)(`span`,{className:`fin-cell__secondary`,children:`Holiday`}):null]})},{title:`ST`,dataIndex:`st`,align:`right`,width:70,render:e=>e.toFixed(2)},{title:`OT`,dataIndex:`ot`,align:`right`,width:70,render:e=>e?e.toFixed(2):`—`},{title:`Leave`,dataIndex:`leave`,align:`right`,width:70,render:e=>e?e.toFixed(2):`—`},{title:`Total`,dataIndex:`total`,align:`right`,width:170,render:e=>(0,l.jsxs)(`div`,{className:`fin-bar`,children:[(0,l.jsx)(`span`,{className:`fin-bar__track`,children:(0,l.jsx)(`span`,{className:`fin-bar__fill`,style:{width:`${e/b*100}%`}})}),(0,l.jsx)(`span`,{className:`fin-bar__value`,children:e.toFixed(2)})]})},{title:i,dataIndex:`amount`,align:`right`,width:110,render:e=>(0,l.jsx)(`strong`,{className:`fin-cell-money__value`,children:Md(e)})},{title:`Status`,dataIndex:`status`,align:`center`,width:100,render:e=>(0,l.jsx)(uf,{status:e,size:`sm`})},{title:`Reviewer`,dataIndex:`reviewer`,width:130,render:e=>e||(0,l.jsx)(`span`,{className:`fin-cell__secondary`,children:`—`})},{title:`Remarks`,dataIndex:`remarks`,ellipsis:!0,render:e=>e?(0,l.jsx)(s.Tooltip,{title:e,children:(0,l.jsx)(`span`,{className:`fin-remarks`,children:e})}):(0,l.jsx)(`span`,{className:`fin-cell__secondary`,children:`—`})}],T=[{title:`Week`,dataIndex:`label`,render:(e,t)=>(0,l.jsx)(Kg,{primary:e,secondary:`${t.days} logged days`})},{title:`ST`,dataIndex:`st`,align:`right`,width:64,render:e=>e.toFixed(1)},{title:`OT`,dataIndex:`ot`,align:`right`,width:64,render:e=>e?e.toFixed(1):`—`},{title:`Hours`,dataIndex:`total`,align:`right`,width:150,render:e=>(0,l.jsxs)(`div`,{className:`fin-bar`,children:[(0,l.jsx)(`span`,{className:`fin-bar__track`,children:(0,l.jsx)(`span`,{className:`fin-bar__fill`,style:{width:`${e/x*100}%`}})}),(0,l.jsx)(`span`,{className:`fin-bar__value`,children:e.toFixed(1)})]})},{title:i,dataIndex:`amount`,align:`right`,width:110,render:e=>(0,l.jsx)(`strong`,{className:`fin-cell-money__value`,children:Md(e)})}];return(0,l.jsxs)(`div`,{className:`fin-analysis`,children:[(0,l.jsx)(df,{items:S,compact:!0}),(0,l.jsx)(`div`,{className:`fin-daychips`,children:C.map(e=>(0,l.jsxs)(`span`,{className:`fin-badge fin-badge--${e.tone}`,children:[e.value,` `,e.label]},e.label))}),(0,l.jsx)(mf,{className:`fin-equation-card`,children:(0,l.jsx)(_f,{terms:[{value:Nd(v),label:`Approved Hours`},{op:`×`},{value:Pd(n),label:r},{op:`=`},{value:Md(y),label:i,tone:`accent`},...m]})}),(0,l.jsxs)(`div`,{className:`fin-analysis__grid`,children:[(0,l.jsx)(A,{className:`fin-heatmap`,days:e,startDay:`Mon`,readonly:!0,year:f,month:d,monthLabel:p,legend:Wg,renderDayContent:Ug,onPrevMonth:()=>{},onNextMonth:()=>{}}),(0,l.jsx)(mf,{title:`Weekly Breakdown`,className:`fin-weekly`,children:(0,l.jsx)(s.Table,{className:`fin-analysis-table`,size:`small`,rowKey:e=>e.label,pagination:!1,dataSource:_,columns:T,locale:{emptyText:`No logged weeks`}})})]}),(0,l.jsx)(mf,{title:`Daily Breakdown — Hours × ${r} = ${i}`,children:(0,l.jsx)(s.Table,{className:`fin-analysis-table`,size:`small`,rowKey:`key`,pagination:!1,dataSource:g,columns:w,scroll:{x:900},locale:{emptyText:`No approved day logs to analyse`},summary:()=>g.length?(0,l.jsxs)(s.Table.Summary.Row,{className:`fin-analysis-total`,children:[(0,l.jsx)(s.Table.Summary.Cell,{index:0,children:(0,l.jsx)(`strong`,{children:`Total`})}),(0,l.jsx)(s.Table.Summary.Cell,{index:1,align:`right`,children:h.stHours.toFixed(2)}),(0,l.jsx)(s.Table.Summary.Cell,{index:2,align:`right`,children:h.otHours?h.otHours.toFixed(2):`—`}),(0,l.jsx)(s.Table.Summary.Cell,{index:3,align:`right`,children:h.leaveHours?h.leaveHours.toFixed(2):`—`}),(0,l.jsx)(s.Table.Summary.Cell,{index:4,align:`right`,children:(0,l.jsx)(`strong`,{children:v.toFixed(2)})}),(0,l.jsx)(s.Table.Summary.Cell,{index:5,align:`right`,children:(0,l.jsx)(`strong`,{children:Md(y)})}),(0,l.jsx)(s.Table.Summary.Cell,{index:6}),(0,l.jsx)(s.Table.Summary.Cell,{index:7}),(0,l.jsx)(s.Table.Summary.Cell,{index:8})]}):null})})]})}function Kg({primary:e,secondary:t}){return(0,l.jsxs)(`div`,{className:`fin-cell-text`,children:[(0,l.jsx)(`span`,{className:`fin-cell__primary`,children:e}),t?(0,l.jsx)(`span`,{className:`fin-cell__secondary`,children:t}):null]})}var qg=`submissionManager`,Jg=`onboardingManager`,Yg=`cfo`,Xg=`onlyFinance`,Zg=`submissionManagerReapprove`,Qg=`onboardingManagerReapprove`;function $g(e,t={}){return e?String(e).replace(/\{(\w+)\}/g,(e,n)=>t[n]===void 0?e:String(t[n])):``}var e_={rateUnit:`hr`,currency:`$`,labels:{employerVms:{required:`Employer VMS`,notRequired:`Not required`,notRequiredSub:`VMS not required for this submission`,unavailable:`VMS Not available`,unavailableSub:`No VMS percentage configured for this employer`}},header:{crumbSeparator:` · `,crumbFields:[{key:`client`,source:[`record.client.clientName`,`identity.client`]},{key:`reqId`,source:[`record.job.jobReferenceId`,`identity.reqId`]}]},sections:{jobClient:{title:`Basic Details`,items:[{key:`jobTitle`,label:`Job Title`,source:[`record.job.jobTitle`,`identity.role`]},{key:`jobLocation`,label:`Job Location`,source:[`identity.location`,`record.job.jobLocation`]},{key:`candidateName`,label:`Candidate Name`,source:[`identity.name`,`record.submission.candidateFullName`]},{key:`candidateEmail`,label:`Candidate Email`,source:[`identity.email`,`record.submission.email`]},{key:`contractType`,label:`Employment Type`,source:[`inputs.contractType`]},{key:`employer`,label:`Employer`,source:[`record.submission.supplierName`,`identity.vendor`]},{key:`submittedBy`,label:`Submitted By`,source:[`identity.submittedBy`,`record.submission.signatureEmail`]},{key:`submittedAt`,label:`Submitted Date`,source:[`identity.submittedAt`,`record.submission.createdAt`],format:`date`}]},rateBreakdown:{proposed:{policy:{decimals:2,min:0,message:`Enter a valid amount — numbers only, up to 2 decimal places.`},overClientPolicy:`warn`,overClient:{title:`Proposed rate is above the Client Job Rate`,body:`You are asking the client for {delta} ({pct}) more than the rate posted on this job. Approving is allowed — the higher rate will be what goes to the client and what payroll is finalised against.`,confirmTitle:`Approve above the client rate?`,confirmBody:`The proposed rate of {proposed} exceeds the Client Job Rate of {client} by {delta} ({pct}). This will be recorded against your approval.`,confirmOk:`Approve anyway`,confirmCancel:`Go back`,blockMessage:`Proposed rate can’t exceed the Client Job Rate ({client}).`}}},referral:{policy:{decimals:2,min:0,message:`Enter a valid amount — numbers only, up to 2 decimal places.`}}}},t_=[{key:`submitted`,label:`Recruiter Submitted`},{key:`manager`,label:`Manager Approved`},{key:`onboarding`,label:`Onboarding Confirmed`},{key:`cfo`,label:`CFO Review`}],n_={[qg]:{title:`Finance Review`,statusLabel:`Pending Your Approval`,trail:{steps:t_.slice(0,2),current:`manager`,show:!1},sections:{jobClient:{show:!0},clientJobRate:{show:!0,note:!0},rateBreakdown:{show:!0,employer:{show:!0,editable:!1},proposed:{show:!0,editable:!0}},referral:{show:!0,toggle:!0,toggleLabel:`Add Referral`,toggleHint:`Include a referral payout — reduces the margin below.`,mode:`select`,source:`referrals`,optionLabelField:`referalCompanyName`,rateEditable:!0,typeField:!0,lastRate:!0,linkBothWays:!0}},margin:{label:`Realtek Margin`,formula:`netProposed-netEmployer-referral`},actions:{primary:{key:`approve`,label:`Approve`,tone:`primary`,api:`submissionApprove`,requireProposedRate:!0},reject:{key:`reject`,label:`Reject`,tone:`warn`,api:`submissionReject`,openPopup:`reject`}},persist:{proposedRateHistory:!0,referralLink:!0,rateHistory:!0},readOnly:!1},[Jg]:{title:`Onboarding Review`,statusLabel:`Pending Onboarding`,trail:{steps:t_.slice(0,3),current:`onboarding`,show:!0},sections:{jobClient:{show:!0},clientJobRate:{show:!0,note:!0},rateBreakdown:{show:!0,editToggle:!0,employer:{show:!0,editable:!1,locked:!0},proposed:{show:!0,editable:!0}},referral:{show:!0,toggle:!0,toggleLabel:`Add Referral`,toggleHint:`Include a referral payout — reduces the total margin below.`,mode:`select`,source:`referrals`,optionLabelField:`referalCompanyName`,rateEditable:!0,typeField:!0,lastRate:!0,linkBothWays:!0}},margin:{label:`Total Margin`,formula:`netProposed-netEmployer-referral`},actions:{primary:{key:`send`,label:`Send for CFO Approval`,tone:`primary`,api:`cfoSend`},reject:{key:`reject`,label:`Reject`,tone:`warn`,api:`onboardingReject`,requireReason:!0}},persist:{proposedRateHistory:!0,referralLink:!0,referralRateOnEngagement:!0,rateHistory:!0},readOnly:!1},cfo:{title:`Final Approval`,statusLabel:`Pending CFO Sign-off`,trail:{steps:t_,current:`cfo`,show:!0},sections:{jobClient:{show:!0},clientJobRate:{show:!0,note:!0},rateBreakdown:{show:!0,finalBadge:!0,employer:{show:!0,editable:!1},proposed:{show:!0,editable:!1}},referral:{show:`ifEnabled`,mode:`print`,typeChip:!0}},margin:{label:`Total Margin`,formula:`netProposed-netEmployer-referral`},actions:{primary:{key:`approve`,label:`Approve & Finalize`,tone:`primary`,api:`cfoApprove`},reject:{key:`reject`,label:`Reject`,tone:`warn`,api:`cfoReject`,requireReason:!0}},persist:{rateHistory:!1},readOnly:!0},[Xg]:{title:`Finance Summary`,statusLabel:``,header:{show:!1},trail:{steps:[],current:``,show:!1},sections:{jobClient:{show:!1},clientJobRate:{show:!1},rateBreakdown:{show:!0,finalBadge:!0,employer:{show:!0,editable:!1},proposed:{show:!0,editable:!1,locked:!0}},referral:{show:`ifExists`,mode:`print`,typeChip:!0}},margin:{label:`Total Margin`,formula:`netProposed-netEmployer-referral`},actions:{show:!1},persist:{rateHistory:!1},readOnly:!0}};function r_(e,{title:t,primaryLabel:n,primaryApi:r}){return{...e,title:t,statusLabel:`Rejected by CFO — Re-approval Needed`,rejection:{show:!0,sources:[`submission.cfoRejectionReason`,`engagement.financeApproval.rejectionReason`,`engagement.financeApproval.remarks`,`financeApprovalRequest.rejectionReason`,`rejectionReason`],title:`CFO Rejected This Request`},actions:{primary:{...e.actions.primary,label:n,...r?{api:r}:{}}}}}n_[Zg]={...r_(n_[qg],{title:`Finance Re-Review`,primaryLabel:`Send For Approval`,primaryApi:`submissionReapproveSend`}),sections:{...n_[qg].sections,referral:{show:`ifExists`,mode:`print`,typeChip:!0}},margin:{label:`Total Margin`,formula:`netProposed-netEmployer-referral`}},n_[Qg]=r_(n_[Jg],{title:`Onboarding Re-Review`,primaryLabel:`Re-send for CFO Approval`});var i_=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function a_(e,t){if(!i_(t))return e===void 0?t:e;if(e===void 0)return t;if(!i_(e))return e;let n={...e};for(let[r,i]of Object.entries(t))n[r]=a_(e[r],i);return n}var o_=new Map;function s_(e){let t=n_[e]??n_.cfo;return o_.has(t)||o_.set(t,a_(t,e_)),o_.get(t)}function c_(e,t){let n=e?.rejection?.sources??[];for(let e of n){let n=e.split(`.`).reduce((e,t)=>e?.[t],t);if(n!=null&&String(n).trim()!==``)return String(n)}return``}function l_(e){return String(e?.margin?.formula??``).includes(`referral`)}var u_=`W2`,d_=`C2C`,f_={rateUnit:`hr`,currency:`$`},p_=e=>{let t=Number(e);return Number.isFinite(t)?t:0},m_=e=>e===!0||e===`true`||e===1||e===`1`,h_=e=>e!=null&&e!==``,g_=(...e)=>e.find(h_),__=e=>Math.round((p_(e)+2**-52)*100)/100;function v_(e){return Array.isArray(e)?e.length?e[e.length-1]:{}:e??{}}var y_=e=>String(e?.$oid??e?._id?.$oid??e?._id??e?.id??e??``);function b_(e=[]){let t={};return e.forEach(e=>{(e.fields??[]).forEach(e=>{let n=e.field??e.fieldName??e.name;n&&e.value!==void 0&&e.value!==null&&e.value!==``&&(t[n]=e.value)})}),t}function x_(e={}){let t={};for(let[n,r]of Object.entries(e)){let e=String(n).split(`.`),i=t;for(let t=0;t<e.length-1;t+=1){let n=e[t];(!i[n]||typeof i[n]!=`object`||Array.isArray(i[n]))&&(i[n]={}),i=i[n]}let a=e[e.length-1];i[a]&&typeof i[a]==`object`&&!Array.isArray(i[a])||(i[a]=r)}return t}function S_(e=[]){let t=e.find(e=>(e.fields??[]).some(e=>(e.field??e.name)===`employerId`));if(!t)return{};let n=Array.isArray(t.rows)?t.rows:null;if(n?.length)return n[n.length-1]??{};let r={};return(t.fields??[]).forEach(e=>{let t=e.field??e.name;t&&e.value!==void 0&&e.value!==null&&e.value!==``&&(r[t]=e.value)}),r}function C_(e,t,n){if(!e)return;let r=e[t];if(n===void 0)return r!=null&&r!==``?r:void 0;if(Array.isArray(r)&&r.length){let e=r[r.length-1]?.[n];if(e!=null&&e!==``)return e}else if(r&&typeof r==`object`){let e=r[n];if(e!=null&&e!==``)return e}let i=e[`${t}.${n}`];if(i!=null&&i!==``)return i;let a=e[`${t}.0.${n}`];if(a!=null&&a!==``)return a}function w_(e){let t=String(e??``).trim().toUpperCase().replace(/[\s_-]/g,``);return t===`W2`||t.includes(`W2`)?`W2`:`C2C`}function T_(e,t){return __(p_(e)*p_(t)/100)}function E_(e={},t={},n={}){let r={...f_,...n??{}},i=e.submission??e??{},a=e.job??{},o=e.client??{},s=e.engagement??{},c=w_(C_(i,`contractType`)??s.onboardingType??e.contractType),l=a.jobPayDetails??{},u=p_(l.clientBudgetStart??C_(i,`clientBudget`,`clientBudgetStart`)),d=p_(l.clientBudgetEnd??C_(i,`clientBudget`,`clientBudgetEnd`))||u,f=d||u,p=v_(o.vmsFeeHistory)??{},m=t.clientVmsFee??o.vmsFee??{},h=h_(p.vmsPercentage)?p_(p.vmsPercentage):h_(o.vmsPercentage)?p_(o.vmsPercentage):m.isApplicable===!1?0:p_(g_(m.value,m.percent,typeof m==`number`?m:void 0,C_(i,`clientVmsPercent`),C_(i,`vmsPercent`))),g=String(g_(p.vmsPercentageType,o.vmsPercentageType)??`recurring`).toLowerCase(),_=p_(C_(i,`proposedRate`,`candidateProposedRate`)??e.proposedRateValue),v=g_(C_(i,`proposedRate`,`candidateProposedRateCurrencySymbol`),C_(i,`proposedRate`,`candidateProposedRateCurrency`),C_(i,`candidateBudget`,`candidateBudgetCurrencySymbol`),C_(i,`candidateBudget`,`candidateBudgetCurrency`),l.clientBudgetCurrencySymbol,l.clientBudgetCurrency,a.currency,a.currencySymbol,r.currency),y=Ql(v,r.currency),b=g_(C_(i,`proposedRate`,`candidateProposedRateUnit`),C_(i,`candidateBudget`,`candidateBudgetUnit`),l.clientBudgetUnit,r.rateUnit),x=p_(C_(i,`candidateBudget`,`candidateBudgetStart`)??C_(i,`candidateBudget`,`candidateBudgetRate`)??C_(i,`candidateRate`,`candidateAcceptedRate`)),S=m_(C_(i,`submission_current_employer`,`isVmsRequired`)??C_(i,`submission_current_employer`,`isVMSRequired`)),C=p_(g_(C_(i,`submission_current_employer`,`vmsPercentage`),C_(i,`submission_current_employer`,`vmsCommission`),e.employer?.vmsPercentage,e.employer?.vmsCommission,s.vmsPercent)),w=C>0,T=S?C:0,E=String(C_(i,`submission_current_employer`,`vmsType`)??C_(i,`submission_current_employer`,`vmsCommissionType`)??`Recurring`),D=C_(i,`submission_current_employer`,`tax`);return{contractType:c,currency:y,currencyRaw:v,rateUnit:b,clientJobRate:f,clientJobRateFrom:u,clientJobRateTo:d,clientVmsPercent:h,clientVmsPercentageType:g,proposedRate:_,employerRate:x,employerVmsPercent:T,employerVmsPercentConfigured:C,employerVmsAvailable:w,employerVmsType:E,employerVmsRequired:S,locationTaxPercent:t.locationTaxPercent==null?D!=null&&D!==``?p_(D):D_(t.locationTaxRows,C_(i,`submission_current_employer`,`locationId`)??C_(i,`submission_current_employer`,`location`)??C_(i,`city`)??C_(i,`state`)??a.jobLocation):p_(t.locationTaxPercent)}}function D_(e,t){if(!Array.isArray(e)||!t)return 0;let n=String(t).trim().toLowerCase(),r=e.find(e=>{let t=String(e?.location??``).trim().toLowerCase();return t&&(t===n||n.includes(t)||t.includes(n))});return p_(r?.taxValue??r?.taxPercent)}function O_(e,t={}){let{contractType:n=`C2C`,currency:r=f_.currency,currencyRaw:i,rateUnit:a=f_.rateUnit,clientJobRate:o=0,clientJobRateFrom:s=0,clientJobRateTo:c=0,clientVmsPercent:l=0,clientVmsPercentageType:u=`recurring`,proposedRate:d=0,employerRate:f=0,employerVmsPercent:p=0,employerVmsPercentConfigured:m=0,employerVmsAvailable:h=!1,employerVmsType:g=`Recurring`,employerVmsRequired:_=!1,locationTaxPercent:v=0}=e??{},y=Ql(r,f_.currency),b=t.proposedRate==null?p_(d):p_(t.proposedRate),x=!!t.includeReferral,S=x?p_(t.referralRate):0,C=(t.deductReferral==null?x:t.deductReferral)?S:0,w=T_(o,l),T=__(o-w),E=T_(b,l),D=__(b-E),O=n===`W2`,k=O?v:p,A=T_(f,k),j=__(f-A),M=__(D-j-C);return{contractType:n,currency:y,currencyRaw:i??y,rateUnit:a,rateUnitLabel:eu(a),rateUnitShort:nu(a),isW2:O,clientJobRate:__(o),clientJobRateFrom:__(s),clientJobRateTo:__(c),clientVmsPercent:p_(l),clientVmsPercentageType:u,clientDiscount:w,netClientRate:T,proposedRate:__(b),discountVms:E,netProposedRate:D,employerRate:__(f),employerDeductionPercent:p_(k),employerDeduction:A,employerDeductionLabel:O?`Location Tax`:`Employer VMS`,employerVmsType:g,employerVmsRequired:!!_,employerVmsPercentConfigured:p_(m),employerVmsAvailable:!!h,netEmployerRate:j,includereferral:x,referralRate:__(S),referralDeduction:__(C),totalMargin:M,marginPositive:M>=0}}function k_(e,t,n={}){return O_(E_(e,t,n.defaults),n)}var A_={decimals:2,min:0};function j_(e){let t=String(e??``).trim();if(!t||/e/i.test(t))return t?1/0:0;let n=t.indexOf(`.`);return n===-1?0:t.length-n-1}function M_(e,t={}){let{decimals:n=A_.decimals,min:r,max:i}={...A_,...t};if(e==null||e===``)return!0;let a=String(e).trim();if(!/^-?\d*(\.\d*)?$/.test(a)||j_(a)>p_(n))return!1;let o=Number(a);return!(!Number.isFinite(o)||r!=null&&o<p_(r)||i!=null&&o>p_(i))}var N_=new Set([`Backspace`,`Delete`,`Tab`,`Enter`,`Escape`,`Home`,`End`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`]);function P_(e={},t,n=``,r=null,i=null){if(N_.has(t)||String(t??``).length!==1)return!0;let{decimals:a=A_.decimals,min:o}={...A_,...e},s=String(n??``),c=r??s.length,l=i??c,u=s.slice(0,c)+t+s.slice(l),d=o==null||p_(o)<0;return t===`-`?d&&/^-?\d*(\.\d*)?$/.test(u):t===`.`?p_(a)>0&&/^-?\d*(\.\d*)?$/.test(u):!/^\d$/.test(t)||!/^-?\d*(\.\d*)?$/.test(u)?!1:j_(u)<=p_(a)}function F_(e,t={}){let{decimals:n=A_.decimals,min:r,max:i}={...A_,...t},a=p_(e),o=10**p_(n);return a=Math.round((a+2**-52)*o)/o,r!=null&&(a=Math.max(a,p_(r))),i!=null&&(a=Math.min(a,p_(i))),a}function I_(e,t,n=new Date){let r=n instanceof Date?n.toISOString():n;return[[`proposedRate`,e.proposedRate],[`discountVms`,e.discountVms],[`netProposedRate`,e.netProposedRate],[`employerRate`,e.employerRate],[e.isW2?`locationTax`:`employerVms`,e.employerDeduction],[`netEmployerRate`,e.netEmployerRate],[`referralRate`,e.referralRate],[`totalMargin`,e.totalMargin]].map(([e,n])=>({field:e,value:n,updatedBy:t,timestamp:r}))}function L_(e,t=f_.currency){let n=ru(e);return au(Number.isNaN(n)?0:n,t,{decimals:2})}var{TextArea:R_}=s.Input,z_=(...e)=>e.find(e=>e!=null&&e!==``)??`-`;function B_(e){return String(e??``).toLowerCase().replace(/\s+/g,``)===`onetime`?`One Time`:`Recurring`}function V_(e){let t=e?.$date??e;if(!t)return`-`;let r=(0,u.default)(t);return r.isValid()?r.format(n.zn().dateFormat):`-`}function H_(e,t){return String(t??``).split(`.`).reduce((e,t)=>e?.[t],e)}var U_={date:V_};function W_(e,t){let n=(Array.isArray(e?.source)?e.source:[e?.source].filter(Boolean)).map(e=>H_(t,e)).find(e=>e!=null&&e!==``),r=U_[e?.format];return r?r(n):n==null||n===``?`-`:n}function G_(e,{onValue:t,onError:n}){return{min:e.min,max:e.max,step:e.step,precision:e.decimals,parser:e=>String(e??``).replace(/[^\d.-]/g,``),onKeyDown:t=>{if(t.ctrlKey||t.metaKey||t.altKey)return;let r=t.target??{};P_(e,t.key,r.value??``,r.selectionStart,r.selectionEnd)||(t.preventDefault(),n(!0))},onChange:r=>{n(!M_(r,e)),t(F_(r??0,e))}}}function K_({label:e,value:t}){return(0,l.jsxs)(`div`,{className:`fa-info-item`,children:[(0,l.jsx)(`div`,{className:`fa-info-k`,children:e}),(0,l.jsx)(`div`,{className:`fa-info-v`,children:String(t??`-`)})]})}K_.propTypes={label:f.default.string,value:f.default.node};function q_({label:e,sub:t,value:n,deduction:r,children:i,total:a}){return(0,l.jsxs)(`div`,{className:`fa-rate-row${a?` fa-rate-total`:``}`,children:[(0,l.jsxs)(`div`,{className:`fa-rate-label`,children:[e,t?(0,l.jsx)(`span`,{className:`fa-rate-sub`,children:t}):null]}),i??(0,l.jsx)(`div`,{className:`fa-rate-val fa-num${r?` fa-deduction`:``}`,children:n})]})}q_.propTypes={label:f.default.node,sub:f.default.node,value:f.default.node,deduction:f.default.bool,children:f.default.node,total:f.default.bool};function J_({label:e,value:t,hero:n,tone:r}){return(0,l.jsxs)(`div`,{className:`fa-stat${n?` fa-stat-hero`:``}${r?` fa-stat-${r}`:``}`,children:[(0,l.jsx)(`div`,{className:`fa-stat-k`,children:e}),(0,l.jsx)(`div`,{className:`fa-stat-v fa-num`,children:t})]})}J_.propTypes={label:f.default.string,value:f.default.node,hero:f.default.bool,tone:f.default.string};function Y_({type:e,record:t,lookups:r,identity:i,referralOptions:a,onReferralChange:u,onAddReferral:d,currentUserId:f,actions:p,onClose:m,variant:h}){let g=s_(e),_=(0,o.useMemo)(()=>({rateUnit:g.rateUnit,currency:g.currency}),[g]),v=(0,o.useMemo)(()=>E_(t,r,_),[t,r,_]),y=l_(g),[b,x]=(0,o.useState)(v.proposedRate),[S,C]=(0,o.useState)(t?.engagement?.financeApproval?.referralId??t?.referral?._id??null),[w,T]=(0,o.useState)(t?.engagement?.financeApproval?.referralRate??t?.referral?.referalRate??0),[E,D]=(0,o.useState)(t?.referral?.isNewReferral?0:t?.referral?.referalRate??t?.referral?.referralRate??t?.engagement?.financeApproval?.referralRate??0),[O,k]=(0,o.useState)(t?.engagement?.financeApproval?.referralType??t?.referral?.referralType??t?.referral?.referalType??`Recurring`),[A,j]=(0,o.useState)(!1),[M,N]=(0,o.useState)(!1),[P,F]=(0,o.useState)(``),[I,L]=(0,o.useState)(!1),[R,z]=(0,o.useState)(``),[B,V]=(0,o.useState)(!1),[H,U]=(0,o.useState)(``),ee=!!g.sections.rateBreakdown?.editToggle,[te,ne]=(0,o.useState)(!1),re=!ee||te,[ie,ae]=(0,o.useState)(!1),[W,oe]=(0,o.useState)(!1),se=g.sections.referral??{},ce=t?.engagement?.financeApproval?.referralEnabled??t?.referralEnabled??(Number(w)>0||!!S),[le,ue]=(0,o.useState)(!!ce),de=se.toggle===!0,fe=Number(w)>0,pe=se.show===!0?!de||le:se.show===`ifEnabled`?le:se.show===`ifExists`&&fe,me=String(O??``).trim().toLowerCase().replace(/[\s_-]+/g,``).startsWith(`onetime`),he=y&&pe,ge=he&&!me,_e=g.rejection?.show?c_(g,t):``,G=(0,o.useMemo)(()=>O_(v,{proposedRate:g.sections.rateBreakdown?.proposed?.editable?b:void 0,includeReferral:he,deductReferral:ge,referralRate:w}),[v,b,w,he,ge,g]),K=G.currency,ve=g.readOnly,ye=Number(G.proposedRate)>0,be=Number(g.margin?.minMarginPercent??20),xe=Number(G.netProposedRate)>0?Number(G.totalMargin)/Number(G.netProposedRate)*100:0,Se=G.marginPositive?xe<be?`fa-warn`:`fa-good`:`fa-bad`,Ce=G.isW2?`Candidate`:`Employer`,we=G.rateUnitShort?`/${G.rateUnitShort}`:``,Te={record:t,identity:i,inputs:v,computed:G},Ee=(g.header?.crumbFields??[]).map(e=>W_(e,Te)).filter(e=>e!==`-`&&e!==``&&e!=null).join(g.header?.crumbSeparator??` · `),De=g.sections.rateBreakdown?.proposed?.policy??A_,Oe=g.sections.referral?.policy??De,ke=g.labels?.employerVms??{},Ae=G.employerVmsRequired&&G.employerVmsAvailable,je=!!g.sections.rateBreakdown?.proposed?.editable,Me=Number(G.clientJobRate)||0,Ne=je&&Me>0&&Number(b)>Me,Pe=g.sections.rateBreakdown?.proposed?.overClient??{},Fe=g.sections.rateBreakdown?.proposed?.overClientPolicy??`warn`,Ie=Ne&&Fe===`block`,Le=Ne&&Fe===`warn`,Re=Ne?Number(b)-Me:0,ze=Me>0?Re/Me*100:0,q={proposed:`${L_(Number(b),K)}${we}`,client:`${L_(Me,K)}${we}`,delta:`${L_(Re,K)}${we}`,pct:`${ze.toFixed(+(ze<10))}%`,unit:G.rateUnitShort??``},J=e=>$g(Pe[e],q),Y=g.actions?.primary,X=!!Y?.requireProposedRate&&!(Number(G.proposedRate)>0),Be=X?`Enter the Proposed Rate first — it drives the margin and the rate sent for approval.`:Ie?J(`blockMessage`):``,Ve=e=>{C(e),oe(!1);let t=(a??[]).find(t=>t.value===e);if(!t?.isNewReferral&&t?.lastRate!=null&&t.lastRate!==``){let e=Number(t.lastRate)||0;T(e),D(e)}else D(0);t?.type&&k(t.type),u?.(e,t)},He=e=>{let t=e.target.checked;ue(t),oe(t)},Ue=e=>(0,l.jsxs)(`div`,{children:[e,d&&(0,l.jsx)(`div`,{className:`fa-referral-dropdown-footer`,children:(0,l.jsx)(n.lt,{className:`fa-referral-add-btn`,icon:(0,l.jsx)(c.UserAddOutlined,{}),onMouseDown:e=>e.preventDefault(),onClick:()=>{oe(!1),d()},children:`Add`})})]}),We=async(e,{skipOverClientConfirm:t=!1}={})=>{if(!e)return;if(e===g.actions.primary&&Be){s.message.error(Be);return}if(e===g.actions.primary&&Le&&!t){ae(!0);return}if(e.requireReason&&!P.trim()){L(!0);return}if(e.requireCategory&&!R){V(!0);return}let n=p?.[e.api];if(!n){s.message.error(`No handler wired for "${e.api}"`);return}U(e.key);try{await n({computed:G,proposedRate:G.proposedRate,referral:pe?{referralId:S,referralRate:G.referralRate,referralType:O,referralEnabled:!0}:{referralEnabled:!1,referralRate:0},referralEnabled:le,reason:P.trim(),category:R,rateHistory:g.persist?.rateHistory?I_(G,f):void 0})}catch(e){s.message.error(e?.message??`Action failed`)}finally{U(``)}},Ge=g.actions.primary,Ke=g.actions.reject;return(0,l.jsxs)(`div`,{className:`fa-panel fa-variant-${h}`,children:[g.header?.show!==!1&&(0,l.jsx)(`div`,{className:`fa-topbar`,children:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`fa-crumb`,children:Ee}),(0,l.jsxs)(`div`,{className:`fa-title-row`,children:[(0,l.jsxs)(`h2`,{className:`fa-title`,children:[g.title,` — `,z_(i?.name,t?.submission?.candidateFullName)]}),(0,l.jsxs)(`span`,{className:`fa-status-pill`,children:[(0,l.jsx)(c.ClockCircleOutlined,{}),` `,g.statusLabel]})]})]})}),g.rejection?.show&&(0,l.jsxs)(`div`,{className:`fa-rejection`,children:[(0,l.jsx)(c.CloseCircleFilled,{className:`fa-rejection-icon`}),(0,l.jsxs)(`div`,{className:`fa-rejection-body`,children:[(0,l.jsx)(`div`,{className:`fa-rejection-title`,children:g.rejection.title}),(0,l.jsx)(`div`,{className:`fa-rejection-reason${_e?``:` fa-rejection-empty`}`,children:_e||`No reason was provided.`})]})]}),g.trail?.show&&(0,l.jsx)(`div`,{className:`fa-trail`,children:g.trail.steps.map((e,t)=>(0,l.jsxs)(`span`,{className:`fa-trail-part`,children:[(0,l.jsxs)(`span`,{className:`fa-trail-step${e.key===g.trail.current?` fa-current`:``}`,children:[e.key===g.trail.current?(0,l.jsx)(c.ClockCircleOutlined,{}):(0,l.jsx)(c.CheckOutlined,{}),e.label]}),t<g.trail.steps.length-1&&(0,l.jsx)(`span`,{className:`fa-trail-sep`,children:`→`})]},e.key))}),g.sections.jobClient?.show&&(0,l.jsxs)(`section`,{className:`fa-card`,children:[(0,l.jsx)(`div`,{className:`fa-card-head`,children:(0,l.jsx)(`h3`,{children:g.sections.jobClient.title})}),(0,l.jsx)(`div`,{className:`fa-card-body`,children:(0,l.jsx)(`div`,{className:`fa-info-grid`,children:(g.sections.jobClient.items??[]).map(e=>(0,l.jsx)(K_,{label:e.label,value:W_(e,Te)},e.key))})})]}),g.sections.clientJobRate?.show&&(0,l.jsxs)(`section`,{className:`fa-card`,children:[(0,l.jsx)(`div`,{className:`fa-card-head`,children:(0,l.jsx)(`h3`,{children:`Client Job Rate`})}),(0,l.jsx)(`div`,{className:`fa-card-body`,children:(0,l.jsxs)(`div`,{className:`fa-strip`,children:[(0,l.jsxs)(`div`,{className:`fa-strip-item`,children:[(0,l.jsx)(`span`,{className:`fa-strip-k`,children:`Client Job Rate`}),(0,l.jsxs)(`span`,{className:`fa-strip-v fa-num`,children:[L_(G.clientJobRate,K),we]})]}),(0,l.jsxs)(`span`,{className:`fa-strip-op fa-num`,children:[`− `,G.clientVmsPercent,`% VMS`,(0,l.jsx)(`span`,{className:`fa-type-chip fa-vms-chip`,children:B_(G.clientVmsPercentageType)})]}),(0,l.jsx)(`span`,{className:`fa-strip-eq`,children:`=`}),(0,l.jsxs)(`div`,{className:`fa-strip-item`,children:[(0,l.jsx)(`span`,{className:`fa-strip-k`,children:`Net Client Rate`}),(0,l.jsxs)(`span`,{className:`fa-strip-v fa-num`,style:{color:`var(--color-brand, #0053a5)`},children:[L_(G.netClientRate,K),we]})]}),g.sections.clientJobRate.note&&(0,l.jsxs)(`div`,{className:`fa-strip-note`,children:[`For context only — the client-side rate doesn't feed into the `,g.margin.label,` below.`]})]})})]}),g.sections.rateBreakdown?.show&&(0,l.jsxs)(`section`,{className:`fa-card`,children:[(0,l.jsxs)(`div`,{className:`fa-card-head`,children:[(0,l.jsx)(`h3`,{children:`Rate Breakdown`}),g.sections.rateBreakdown.finalBadge&&(0,l.jsxs)(`span`,{className:`fa-final-badge`,children:[(0,l.jsx)(c.LockOutlined,{}),` Final`]}),ee&&!ve&&!te&&(0,l.jsx)(n.lt,{className:`fa-rate-edit-btn`,size:`small`,onClick:()=>ne(!0),children:`Edit`})]}),(0,l.jsxs)(`div`,{className:`fa-card-body`,children:[(0,l.jsxs)(`div`,{className:`fa-rate-grid`,children:[(0,l.jsxs)(`div`,{className:`fa-rate-panel fa-employer`,children:[(0,l.jsxs)(`div`,{className:`fa-panel-head`,children:[(0,l.jsx)(`span`,{className:`fa-dot`}),Ce,` Rate`]}),(0,l.jsxs)(`div`,{className:`fa-rate-rows`,children:[(0,l.jsx)(q_,{label:`${Ce} Rate`,sub:`as submitted by recruiter`,value:(0,l.jsxs)(l.Fragment,{children:[L_(G.employerRate,K),` `,(0,l.jsx)(`span`,{className:`fa-unit`,children:we})]})}),G.isW2&&(0,l.jsx)(q_,{label:`Employer Location`,sub:`used to determine location tax`,children:(0,l.jsx)(`div`,{className:`fa-rate-val`,children:z_(i?.employerLocation,t?.submission?.city,t?.job?.jobLocation)})}),!G.isW2&&!Ae?(0,l.jsx)(q_,{label:(0,l.jsx)(`span`,{className:`fa-locked-label`,children:ke.required}),sub:G.employerVmsAvailable?ke.notRequiredSub:ke.unavailableSub,value:(0,l.jsx)(`span`,{className:`fa-vms-none`,children:G.employerVmsAvailable?ke.notRequired:ke.unavailable})}):(0,l.jsx)(q_,{label:G.isW2?G.employerDeductionLabel:(0,l.jsxs)(`span`,{className:`fa-locked-label`,children:[G.employerDeductionLabel,(0,l.jsx)(`span`,{className:`fa-type-chip fa-vms-chip`,children:B_(G.employerVmsType)})]}),sub:`${G.employerDeductionPercent}% of employer rate`,value:`−${L_(G.employerDeduction,K).replace(`−`,``)}`,deduction:!0}),(0,l.jsx)(q_,{total:!0,label:`Net ${Ce} Rate`,value:(0,l.jsx)(`span`,{style:{color:`var(--color-purple, #7c3aed)`},children:L_(G.netEmployerRate,K)})})]})]}),(0,l.jsxs)(`div`,{className:`fa-rate-panel fa-client`,children:[(0,l.jsxs)(`div`,{className:`fa-panel-head`,children:[(0,l.jsx)(`span`,{className:`fa-dot`}),`Proposed Rate`]}),(0,l.jsxs)(`div`,{className:`fa-rate-rows`,children:[g.sections.rateBreakdown.proposed.editable&&re?(0,l.jsxs)(`div`,{className:`fa-rate-row fa-editable`,children:[(0,l.jsxs)(`div`,{className:`fa-editable-head`,children:[(0,l.jsxs)(`span`,{className:`fa-editable-label`,children:[`Proposed Rate`,(0,l.jsx)(`span`,{className:`fa-edit-badge`,children:`Editable`})]}),(0,l.jsx)(s.InputNumber,{className:`fa-rate-input`,...G_(De,{onValue:x,onError:j}),value:b,prefix:K,controls:!1,status:A||Ie?`error`:Le?`warning`:``})]}),(0,l.jsx)(`div`,{className:`fa-editable-sub`,children:`rate we ask the client for`}),A&&(0,l.jsxs)(`div`,{className:`fa-reason-error`,children:[`! `,De.message]}),X&&(0,l.jsxs)(`div`,{className:`fa-reason-error`,children:[`! Enter the proposed rate to enable `,Y?.label??`approval`,`.`]}),Ie&&(0,l.jsxs)(`div`,{className:`fa-reason-error`,children:[`! `,J(`blockMessage`)]}),g.rejection?.show&&(0,l.jsxs)(`div`,{className:`fa-last-rejected`,children:[`Last rejected at `,(0,l.jsxs)(`b`,{children:[L_(v.proposedRate,K),we]})]})]}):(0,l.jsx)(q_,{label:(0,l.jsxs)(`span`,{className:`fa-locked-label`,children:[`Proposed Rate`,g.sections.rateBreakdown.proposed.locked&&(0,l.jsxs)(`span`,{className:`fa-locked-badge`,children:[(0,l.jsx)(c.LockOutlined,{}),` Locked`]})]}),sub:`approved at finance review`,value:(0,l.jsxs)(l.Fragment,{children:[L_(G.proposedRate,K),` `,(0,l.jsx)(`span`,{className:`fa-unit`,children:we})]})}),(0,l.jsx)(q_,{label:(0,l.jsxs)(`span`,{className:`fa-locked-label`,children:[`Discount (VMS)`,(0,l.jsx)(`span`,{className:`fa-type-chip fa-vms-chip`,children:B_(G.clientVmsPercentageType)})]}),sub:`${G.clientVmsPercent}% of proposed rate`,value:`−${L_(G.discountVms,K).replace(`−`,``)}`,deduction:!0}),(0,l.jsx)(q_,{total:!0,label:`Net Proposed Rate`,value:(0,l.jsx)(`span`,{style:{color:`var(--color-brand, #0053a5)`},children:L_(G.netProposedRate,K)})})]})]})]}),de&&!ve&&re&&(0,l.jsxs)(`div`,{className:`fa-referral-toggle`,children:[(0,l.jsx)(s.Checkbox,{checked:le,onChange:He,children:(0,l.jsx)(`span`,{className:`fa-rt-title`,children:se.toggleLabel??`Add Referral`})}),(0,l.jsx)(`div`,{className:`fa-rt-hint`,children:se.toggleHint})]})]})]}),pe&&(0,l.jsxs)(`section`,{className:`fa-card fa-referral-card`,children:[(0,l.jsxs)(`div`,{className:`fa-card-head`,children:[(0,l.jsxs)(`h3`,{children:[(0,l.jsx)(`span`,{className:`fa-dot fa-dot-warning`}),`Referral`]}),se.mode===`print`&&se.typeChip&&(0,l.jsx)(`span`,{className:`fa-type-chip`,children:O})]}),(0,l.jsx)(`div`,{className:`fa-card-body`,children:se.mode===`select`&&re?(0,l.jsxs)(`div`,{className:`fa-referral-fields`,children:[(0,l.jsxs)(`div`,{className:`fa-referral-field`,children:[(0,l.jsx)(`label`,{className:`fa-rf-k`,htmlFor:`fa-referral-company`,children:`Referral Company`}),(0,l.jsx)(s.Select,{id:`fa-referral-company`,className:`fa-referral-select`,placeholder:`Select a referral`,open:W,value:S??void 0,onChange:Ve,options:a??[],showSearch:!0,optionFilterProp:`label`,onDropdownVisibleChange:oe,onOpenChange:oe,popupRender:Ue,dropdownRender:Ue})]}),(0,l.jsxs)(`div`,{className:`fa-referral-field`,children:[(0,l.jsx)(`label`,{className:`fa-rf-k`,htmlFor:`fa-referral-rate`,children:`Referral Rate`}),(0,l.jsx)(s.InputNumber,{id:`fa-referral-rate`,className:`fa-referral-rate-input`,...G_(Oe,{onValue:T,onError:N}),value:w,prefix:K,controls:!1,disabled:!S,status:M?`error`:``}),M&&(0,l.jsxs)(`div`,{className:`fa-reason-error`,children:[`! `,Oe.message]})]}),(0,l.jsxs)(`div`,{className:`fa-referral-field`,children:[(0,l.jsx)(`label`,{className:`fa-rf-k`,htmlFor:`fa-referral-type`,children:`Referral Type`}),(0,l.jsx)(s.Select,{id:`fa-referral-type`,className:`fa-referral-type`,value:O,onChange:k,disabled:!S,options:[{value:`Recurring`,label:`Recurring — every pay cycle`},{value:`One-time`,label:`One-time payout`}]})]}),S&&(0,l.jsx)(`div`,{className:`fa-referral-note`,children:E?(0,l.jsxs)(l.Fragment,{children:[`Last referral rate paid to this company:`,` `,(0,l.jsx)(`b`,{children:L_(E,K)})]}):(0,l.jsx)(`b`,{children:`New referral`})})]}):(0,l.jsxs)(`div`,{className:`fa-rate-rows fa-print-rows`,children:[(0,l.jsx)(q_,{label:`Referral Name`,sub:`added during onboarding`,children:(0,l.jsx)(`div`,{className:`fa-rate-val`,children:z_(t?.referral?.referalCompanyName,i?.referralName)})}),(0,l.jsx)(q_,{label:`Referral Rate`,sub:me?`one-time payout — excluded from recurring margin`:`deducted every pay cycle`,value:me?L_(w,K):`−${L_(w,K).replace(`−`,``)}${we?` ${we}`:``}`,deduction:!me})]})})]}),ye&&(0,l.jsxs)(`div`,{className:`fa-outcome ${Se}`,children:[(0,l.jsxs)(`div`,{className:`fa-outcome-label`,children:[(0,l.jsx)(`div`,{className:`fa-outcome-icon`,children:Se===`fa-good`?(0,l.jsx)(c.RiseOutlined,{}):(0,l.jsx)(c.WarningOutlined,{})}),(0,l.jsx)(`div`,{className:`fa-outcome-t`,children:g.margin.label})]}),(0,l.jsxs)(`div`,{className:`fa-outcome-stats`,children:[(0,l.jsx)(J_,{label:`Net Proposed Rate`,value:(0,l.jsxs)(l.Fragment,{children:[L_(G.netProposedRate,K),(0,l.jsx)(`span`,{className:`fa-u`,children:we})]})}),(0,l.jsx)(`span`,{className:`fa-stat-arrow`,children:`−`}),(0,l.jsx)(J_,{label:`Net ${Ce} Rate`,value:(0,l.jsxs)(l.Fragment,{children:[L_(G.netEmployerRate,K),(0,l.jsx)(`span`,{className:`fa-u`,children:we})]})}),ge&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`fa-stat-arrow`,children:`−`}),(0,l.jsx)(J_,{label:`Referral Rate`,tone:`referral`,value:(0,l.jsxs)(l.Fragment,{children:[L_(G.referralRate,K),(0,l.jsx)(`span`,{className:`fa-u`,children:we})]})})]}),(0,l.jsx)(J_,{hero:!0,label:`Margin`,value:(0,l.jsxs)(l.Fragment,{children:[L_(G.totalMargin,K),(0,l.jsx)(`span`,{className:`fa-u`,children:we})]})})]})]}),ye&&(0,l.jsxs)(`div`,{className:`fa-margin-note ${Se}`,children:[(0,l.jsxs)(`span`,{className:`fa-margin-note-pct`,children:[xe.toFixed(1),`%`]}),(0,l.jsx)(`span`,{className:`fa-margin-note-text`,children:Se===`fa-bad`?(0,l.jsxs)(l.Fragment,{children:[`This submission is running at a `,(0,l.jsx)(`b`,{children:`loss`}),`. Adjust the proposed or employer rate before approving.`]}):Se===`fa-warn`?(0,l.jsxs)(l.Fragment,{children:[`Profit margin is `,(0,l.jsxs)(`b`,{children:[`below the `,be,`% target`]}),`. Consider a higher proposed rate before approving.`]}):(0,l.jsxs)(l.Fragment,{children:[`Healthy margin — at or above the `,be,`% target.`]})})]}),Ke?.requireReason&&(0,l.jsxs)(`div`,{className:`fa-reason`,children:[Ke.requireCategory&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`label`,{className:`fa-reason-label`,htmlFor:`fa-rejection-category`,children:[`Return To `,(0,l.jsx)(`span`,{children:`(required to reject)`})]}),(0,l.jsx)(s.Select,{id:`fa-rejection-category`,placeholder:`Select where to return this rejection`,value:R||void 0,status:B?`error`:``,options:[{value:`submission`,label:`Submission`},{value:`onboarding`,label:`Onboarding`}],onChange:e=>{z(e),V(!1)},style:{width:`100%`,marginBottom:16}}),B&&(0,l.jsx)(`div`,{className:`fa-reason-error`,children:`! Select where to return the rejection.`})]}),(0,l.jsxs)(`label`,{className:`fa-reason-label`,htmlFor:`fa-reason`,children:[`Comments `,(0,l.jsx)(`span`,{children:`(required to reject)`})]}),(0,l.jsx)(R_,{id:`fa-reason`,rows:3,maxLength:500,showCount:!0,value:P,status:I?`error`:``,placeholder:`Enter your comments here…`,onChange:e=>{F(e.target.value),e.target.value.trim()&&L(!1)}}),I&&(0,l.jsx)(`div`,{className:`fa-reason-error`,children:`! Comments are required when rejecting.`})]}),Le&&(0,l.jsxs)(`div`,{className:`fa-rate-warning`,role:`status`,children:[(0,l.jsxs)(`div`,{className:`fa-rate-warning-head`,children:[(0,l.jsx)(c.WarningOutlined,{className:`fa-rate-warning-icon`}),(0,l.jsx)(`h4`,{children:J(`title`)})]}),(0,l.jsxs)(`div`,{className:`fa-rate-warning-grid`,children:[(0,l.jsxs)(`div`,{className:`fa-rate-warning-cell`,children:[(0,l.jsx)(`span`,{className:`fa-rate-warning-key`,children:`Client Job Rate`}),(0,l.jsx)(`span`,{className:`fa-rate-warning-val`,children:q.client})]}),(0,l.jsxs)(`div`,{className:`fa-rate-warning-cell`,children:[(0,l.jsx)(`span`,{className:`fa-rate-warning-key`,children:`Proposed Rate`}),(0,l.jsx)(`span`,{className:`fa-rate-warning-val`,children:q.proposed})]}),(0,l.jsxs)(`div`,{className:`fa-rate-warning-cell fa-rate-warning-delta`,children:[(0,l.jsx)(`span`,{className:`fa-rate-warning-key`,children:`Over by`}),(0,l.jsxs)(`span`,{className:`fa-rate-warning-val`,children:[q.delta,` `,(0,l.jsxs)(`small`,{children:[`(`,q.pct,`)`]})]})]})]}),J(`body`)&&(0,l.jsx)(`p`,{className:`fa-rate-warning-body`,children:J(`body`)}),(0,l.jsxs)(`p`,{className:`fa-rate-warning-margin`,children:[`Resulting margin:`,` `,(0,l.jsxs)(`b`,{className:Se,children:[L_(G.totalMargin,K),we,Number(G.netProposedRate)>0&&(0,l.jsxs)(l.Fragment,{children:[` (`,xe.toFixed(1),`%)`]})]})]})]}),(0,l.jsx)(s.Modal,{open:ie,title:J(`confirmTitle`),okText:J(`confirmOk`)||`Approve anyway`,cancelText:J(`confirmCancel`)||`Go back`,okButtonProps:{danger:!0},onCancel:()=>ae(!1),onOk:()=>{ae(!1),We(g.actions.primary,{skipOverClientConfirm:!0})},children:(0,l.jsx)(`p`,{children:J(`confirmBody`)})}),g.actions?.show!==!1&&(Ge||Ke)&&(0,l.jsxs)(`div`,{className:`fa-action-bar`,children:[(0,l.jsx)(`div`,{className:`fa-action-note`,children:X?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`b`,{children:`Proposed rate required`}),` — enter it above to enable `,Ge?.label??`approval`,`.`]}):e===`cfo`?(0,l.jsxs)(l.Fragment,{children:[`Approving finalizes payroll at `,(0,l.jsxs)(`b`,{children:[L_(G.netProposedRate,K),we]}),pe?(0,l.jsxs)(l.Fragment,{children:[` including the `,String(O).toLowerCase(),` `,(0,l.jsxs)(`b`,{children:[L_(w,K),we]}),` referral`]}):null,`.`]}):(0,l.jsxs)(l.Fragment,{children:[`Approving locks the `,(0,l.jsxs)(`b`,{children:[L_(G.netProposedRate,K),we]}),` proposed rate and moves this forward.`]})}),(0,l.jsxs)(`div`,{className:`fa-actions`,children:[m&&(0,l.jsx)(n.lt,{className:`fa-btn-ghost`,onClick:m,children:`Cancel`}),Ke&&(0,l.jsx)(n.lt,{danger:!0,loading:H===Ke.key,disabled:!!H,onClick:()=>We(Ke),children:Ke.label}),Ge&&(0,l.jsx)(s.Tooltip,{title:Be||``,placement:`top`,children:(0,l.jsx)(`span`,{className:`fa-btn-tip`,children:(0,l.jsx)(n.lt,{variant:`primary`,icon:(0,l.jsx)(c.CheckOutlined,{}),loading:H===Ge.key,disabled:!!H||!!Be,onClick:()=>We(Ge),children:Ge.label})})})]})]})]})}Y_.propTypes={type:f.default.string.isRequired,record:f.default.object,lookups:f.default.object,identity:f.default.object,referralOptions:f.default.array,onReferralChange:f.default.func,onAddReferral:f.default.func,currentUserId:f.default.oneOfType([f.default.number,f.default.string]),actions:f.default.object,onClose:f.default.func,variant:f.default.oneOf([`popup`,`page`])},Y_.defaultProps={record:{},lookups:{},identity:{},referralOptions:[],variant:`page`};var X_=e=>String(e??``).trim().toLowerCase();function Z_(e){let t=e?.data??e;for(let e of[`data`,`rows`,`records`,`items`,`list`])if(Array.isArray(t?.[e]))return t[e];return Array.isArray(t)?t:[]}var Q_=e=>n.yn(e,300,0).then(Z_).catch(()=>[]),$_=e=>t=>e&&y_(t._id??t.id)===String(e),ev=(e,n)=>n?t.o(t.x,`/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(n)}`).then(e=>{let t=e?.data??e??{};return(Array.isArray(t?.data)?t.data:Array.isArray(t)?t:[])[0]??{}}).catch(()=>({})):Promise.resolve({}),tv=e=>e==null||e===``?Promise.resolve(null):t.o(t.x,`/get-detailed-view?userId=${encodeURIComponent(e)}`).then(e=>e?.data??e??null).catch(()=>null);function nv(e){return e&&([e.first_name??e.firstName??e.FIRST_NAME,e.last_name??e.lastName??e.LAST_NAME].filter(Boolean).join(` `).trim()||e.user_name||e.userName||e.username||e.email)||``}function rv(e){let t=e?.jobPayDetails,n=Array.isArray(t)?t[t.length-1]:t;return n&&typeof n==`object`&&!Array.isArray(n)?n:{}}async function iv(e,t){if(!t)return{};let n=await av(e,t).catch(()=>({}));return{...x_(b_(n.groups??[])),...n.recordMeta??{}}}async function av(e,t){let{fetchFormGroupsPayload:n}=await Promise.resolve().then(()=>require("./addFormApi-DhugyuLa.cjs")).then(e=>e.t),r=await n({module:e,id:t});return r?.data??r??{}}async function ov(e,t={}){let r=await av(`submission`,e).catch(()=>({})),i=r.groups??[],a=r.recordMeta??{},o=b_(i),s=S_(i),c=y_(a.clientId??o.clientId??t.clientId),l=y_(a.jobId??o.jobId??t.jobId),u=y_(s.employerId),d=a.createdBy??o.createdBy??t.createdBy,f=s.locationId??s.location,[p,m,h,g,_,v,y,b,x]=await Promise.all([l?n.fn(`jobs`,l).catch(()=>null):Promise.resolve(null),Q_(`jobs`),Q_(`clients`),Q_(`employers`),Q_(`locations`),Q_(`workforceEngagements`),iv(`jobs`,l),tv(d),ev(`submissions`,e)]),S=p?.data??p??{},C=S.record??S.item??S??{},w=m.find($_(l))??{},T={...w,...C,...y};T.jobPayDetails={...rv(w),...rv(C),...rv(y)};let E=(Array.isArray(v)?v:[]).find(t=>y_(t.submissionId)===String(e)),D=y_(T.clientId)||y_(E?.clientId)||c,O=o.clientName??t.clientName??T.clientName,k=O?h.filter(e=>X_(e.clientName)===X_(O)):[],A=h.find($_(D))??k[0]??{},j=await iv(`clients`,y_(A._id??A.id)||D),M={...A,...j},N=g.find($_(u))??{},P=_.find($_(f))??_.find(e=>X_(e.name)===X_(f))??{};return{record:{submission:{...x.signatureEmail?{signatureEmail:x.signatureEmail}:{},...t,...o,submission_current_employer:[s]},job:T,client:M,employer:N},lookups:{clientVmsFee:M.vmsFee??o.clientVmsFee??o.vmsFee,locationTaxPercent:s.tax??P.taxValue},display:{clientName:o.clientName??M.clientName,jobTitle:o.jobTitle??T.jobTitle,reqId:a.jobClientRefrenceId??o.jobRefrenceId??a.jobRefrenceId??a.mspReqId,jobLocation:o.jobLocation??T.jobLocation,employerName:N.empCompanyName,employerLocation:P.name??N.empCompanyLocation??f,submittedBy:x.signatureEmail||o.signatureEmail||t.signatureEmail||nv(b),email:o.email,candidateName:[o.firstName,o.lastName].filter(Boolean).join(` `)||o.candidateFullName,createdAt:a.createdAt,submissionId:a.submissionId},engagement:E??null,meta:a}}function sv(e={}){return e.referalCompanyName??e.referralCompanyName??e.referalName??e.referralName??e.vendorName??e.employerName??e.name??e.companyName??``}function cv(e={}){let t=Array.isArray(e.referralDetails)?e.referralDetails.at(-1):e.referralDetails,n=e.financeApproval??e.financeApprovalRequest??{},r=Array.isArray(n.referralDetails)?n.referralDetails.at(-1):n.referralDetails,i=[t?.referalRate,t?.referralRate,r?.referalRate,r?.referralRate,n.referalRate,n.referralRate,e.referalRate,e.referralRate,e.referralLastPayRate,e.referalLastPayRate,e.lastPayRate,e.payRate].find(e=>e!=null&&e!==``),a=Number(i);return Number.isFinite(a)?a:0}function lv(e){return String(e??``).trim().toLowerCase().replace(/\s+/g,` `)}function uv(e={}){let t=Array.isArray(e.referralDetails)?e.referralDetails:[e.referralDetails].filter(Boolean),n=e.financeApproval??e.financeApprovalRequest??{},r=Array.isArray(n.referralDetails)?n.referralDetails:[n.referralDetails].filter(Boolean);return[e._id,e.id,e.referralId,e.referalId,e.referral_id,e.referal_id,e.referral?._id,e.referral?.id,e.referal?._id,e.referal?.id,n.referralId,n.referalId,e.engagement?.referralId,e.engagement?.referalId,e.engagement?.financeApproval?.referralId,e.engagement?.financeApproval?.referalId,...t.flatMap(e=>[e?.referralId,e?.referalId,e?.referral_id,e?.referal_id]),...r.flatMap(e=>[e?.referralId,e?.referalId,e?.referral_id,e?.referal_id])].map(y_).filter(Boolean)}function dv(e={}){let t=Array.isArray(e.referralDetails)?e.referralDetails:[e.referralDetails].filter(Boolean),n=e.financeApproval??e.financeApprovalRequest??{},r=Array.isArray(n.referralDetails)?n.referralDetails:[n.referralDetails].filter(Boolean);return[sv(e),sv(e.referral??{}),sv(e.referal??{}),e.referralCompanyName,e.referalCompanyName,e.referralName,e.referalName,n.referralCompanyName,n.referalCompanyName,n.referralName,n.referalName,e.engagement?.referralCompanyName,e.engagement?.referalCompanyName,e.engagement?.referralName,e.engagement?.referalName,...t.flatMap(e=>[e?.referralCompanyName,e?.referalCompanyName,e?.referralName,e?.referalName]),...r.flatMap(e=>[e?.referralCompanyName,e?.referalCompanyName,e?.referralName,e?.referalName])].map(lv).filter(Boolean)}function fv(e={}){let t=e.financeApproval?.approvedAt??e.financeApproval?.submittedAt??e.financeApprovalRequest?.approvedAt??e.financeApprovalRequest?.submittedAt??e.decidedAt??e.submittedAt??e.updatedAt??e.createdAt??0;return new Date(t?.$date??t).getTime()||0}async function pv(e,{pageSize:n=100,maxPages:r=20}={}){let i=[];for(let a=1;a<=r;a+=1){let r=new URLSearchParams({module:e,page:String(a),limit:String(n)}),o=await t.o(t.x,`/module/list?${r.toString()}`),s=o?.data??o??{},c=Array.isArray(s?.data)?s.data:Array.isArray(s?.rows)?s.rows:Array.isArray(s)?s:[];i.push(...c);let l=Number(s?.total??0);if(c.length<n||l>0&&i.length>=l)break}return i}function mv(e={},t=[]){let n=new Set(uv(e)),r=new Set(dv(e));return!n.size&&!r.size?0:t.filter(e=>uv(e).some(e=>n.has(e))||dv(e).some(e=>r.has(e))).map(e=>({rate:cv(e),date:fv(e)})).filter(e=>e.rate>0).sort((e,t)=>t.date-e.date)[0]?.rate??0}async function hv(){let e=(await Q_(`referrals`)).filter(e=>!e?.isDeleted&&sv(e)),t=(await Promise.all([`submissions`,`workforceFinanceApprovals`,`workforceEngagements`,`onboarding`,`candidateMovements`].map(e=>pv(e).catch(()=>[])))).flat();return(await Promise.all(e.map(async e=>{let n=mv(e,t),r=cv(e),i=n>0?n:r;return{value:y_(e._id??e.id),label:sv(e),isNewReferral:i<=0,hasHistory:i>0,lastRate:i,lastPayRate:i,referralLastPayRate:i,referalLastPayRate:i,rate:i,referralRate:i,referalRate:i,type:e.referalType??e.referralType,record:e}}))).filter(e=>e.value)}function gv({title:e=`Proof`,files:t=[],onPreview:n,emptyText:r=`No files uploaded`,className:i}){return t.length?(0,l.jsx)(s.Card,{size:`small`,title:e,className:`znx-file-list__card ${i??``}`.trim(),children:t.map((e,t)=>(0,l.jsxs)(`div`,{className:`znx-file-list__chip`,children:[(0,l.jsx)(`span`,{className:`znx-file-list__name`,title:e.name,children:e.name||`File`}),(0,l.jsxs)(`span`,{className:`znx-file-list__actions`,children:[n&&(0,l.jsx)(s.Tooltip,{title:`Preview`,children:(0,l.jsx)(`button`,{type:`button`,className:`znx-file-list__btn`,onClick:()=>n(t),"aria-label":`Preview ${e.name||`file`}`,children:(0,l.jsx)(c.EyeOutlined,{})})}),(0,l.jsx)(s.Tooltip,{title:`Download`,children:(0,l.jsx)(`a`,{className:`znx-file-list__btn`,href:e.url,download:e.name,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Download ${e.name||`file`}`,children:(0,l.jsx)(c.DownloadOutlined,{})})})]})]},e.url??t))}):(0,l.jsx)(s.Card,{size:`small`,className:`znx-file-list__empty ${i??``}`.trim(),children:(0,l.jsx)(s.Empty,{image:s.Empty.PRESENTED_IMAGE_SIMPLE,description:r})})}function _v({moduleName:e,recordId:t,cancelPath:r,onSuccess:i,fieldNameMap:c={},onFileUpload:l=null}){let f=(0,d.useNavigate)(),[p,m]=(0,o.useState)([]),[h,g]=(0,o.useState)({}),[_,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(``),[x,S]=(0,o.useState)(!1),[C,w]=(0,o.useState)(``);(0,o.useEffect)(()=>{if(!e||!t)return;let r=!1;async function i(){try{v(!0),b(``);let[i,o]=await Promise.all([a.r({module:e,id:t}),n.mn(e,t)]);if(r)return;m(Array.isArray(i)?i:[]),g(o??{})}catch(e){r||b(e?.message||`Failed to load record`)}finally{r||v(!1)}}return i(),()=>{r=!0}},[e,t]);function T(e,t){let n={...h},r=t.flatMap(e=>e.fields??[]);return Object.entries(e).forEach(([e,t])=>{if(t!==void 0&&r.find(t=>t.field===e)?.type!==`file`){if(u.default.isDayjs(t)){applyDotValue(n,e,t.format(`MM-DD-YYYY`));return}applyDotValue(n,e,t)}}),Object.keys(n).forEach(e=>{e.includes(`.`)&&delete n[e]}),Object.entries(c).forEach(([e,t])=>{n[e]!==void 0&&(n[t]=n[e],delete n[e])}),Object.keys(n).forEach(e=>{let t=n[e];if(typeof t==`string`&&t!==``){let r=/(date|time|Date|Time|At|at)$/.test(e),i=/ago|month|year|day|week|hour|minute/i.test(t),a=/^\d{4}-\d{2}-\d{2}/.test(t);r&&(i||!a)&&delete n[e]}}),Object.keys(n).forEach(e=>{let t=n[e];Array.isArray(t)&&t[0]?.originFileObj&&delete n[e]}),n}async function E(a,o){try{if(S(!0),w(``),l){let e=o.flatMap(e=>e.fields??[]).filter(e=>e.type===`file`);for(let n of e){let e=a[n.field];if(!Array.isArray(e))continue;let r=e.filter(e=>e.originFileObj instanceof File);await Promise.all(r.map(e=>l(n.field,e.originFileObj,t)))}}await n.hn(e,t,T(a,o)),s.message.success(`${e} updated successfully`),i?i():n.j(f,{cancelPath:r})}catch(e){w(e?.message||`Failed to save changes`),s.message.error(e?.message||`Failed to save changes`)}finally{S(!1)}}return{formGroups:p,rawRecord:h,loading:_,error:y,submitting:x,submitError:C,submit:E}}var vv=`data:image/svg+xml,%3csvg%20width='380'%20height='130'%20viewBox='0%200%20380%20130'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_30_1933)'%20filter='url(%23filter0_d_30_1933)'%3e%3cpath%20d='M13.5623%2060V34.296H19.2143V44.16H29.6183V34.296H35.2703V60H29.6183V48.912H19.2143V60H13.5623ZM39.8859%2060V34.296H45.5379V60H39.8859ZM50.1431%2060V34.296H64.0031C66.2591%2034.296%2068.0951%2034.992%2069.5111%2036.384C70.8551%2037.728%2071.5271%2039.396%2071.5271%2041.388C71.5271%2044.58%2070.1711%2046.728%2067.4591%2047.832V47.904C69.7151%2048.48%2070.9631%2050.484%2071.2031%2053.916C71.2751%2054.948%2071.3471%2055.98%2071.4191%2057.012C71.5631%2058.404%2071.8511%2059.4%2072.2831%2060H66.6311C66.3671%2059.352%2066.1631%2058.38%2066.0191%2057.084C65.9231%2056.004%2065.8271%2054.924%2065.7311%2053.844C65.5391%2052.452%2065.1191%2051.456%2064.4711%2050.856C63.8471%2050.256%2062.8391%2049.956%2061.4471%2049.956H55.7951V60H50.1431ZM55.7951%2038.688V45.924H61.9871C64.5791%2045.924%2065.8751%2044.7%2065.8751%2042.252C65.8751%2039.876%2064.5791%2038.688%2061.9871%2038.688H55.7951ZM75.7635%2060V34.296H94.9875V39.048H81.4155V44.556H93.8715V48.948H81.4155V55.248H95.2755V60H75.7635ZM118.336%2060V10.02H125.336L142.626%2053.84L159.846%2010.02H166.846V60H162.086V16.81H161.946L144.866%2060H140.386L123.236%2016.81H123.096V60H118.336ZM190.506%2022.83C195.826%2022.83%20200.05%2024.72%20203.176%2028.5C206.116%2032.0467%20207.586%2036.5267%20207.586%2041.94C207.586%2047.3533%20206.116%2051.8333%20203.176%2055.38C200.05%2059.16%20195.826%2061.05%20190.506%2061.05C185.186%2061.05%20180.963%2059.16%20177.836%2055.38C174.896%2051.8333%20173.426%2047.3533%20173.426%2041.94C173.426%2036.5267%20174.896%2032.0467%20177.836%2028.5C180.963%2024.72%20185.186%2022.83%20190.506%2022.83ZM190.506%2026.54C186.493%2026.54%20183.32%2028.15%20180.986%2031.37C178.886%2034.2633%20177.836%2037.7867%20177.836%2041.94C177.836%2046.0933%20178.886%2049.6167%20180.986%2052.51C183.32%2055.73%20186.493%2057.34%20190.506%2057.34C194.52%2057.34%20197.693%2055.73%20200.026%2052.51C202.126%2049.6167%20203.176%2046.0933%20203.176%2041.94C203.176%2037.7867%20202.126%2034.2633%20200.026%2031.37C197.693%2028.15%20194.52%2026.54%20190.506%2026.54ZM213.443%2060V23.88H217.503V32.35H217.643C218.763%2029.41%20220.513%2027.1467%20222.893%2025.56C225.273%2023.9733%20228.073%2023.25%20231.293%2023.39V27.8C227.373%2027.6133%20224.153%2028.78%20221.633%2031.3C219.113%2033.7733%20217.853%2036.9233%20217.853%2040.75V60H213.443ZM265.203%2043.13H237.413C237.46%2046.8633%20238.393%2050.0367%20240.213%2052.65C242.406%2055.7767%20245.44%2057.34%20249.313%2057.34C255.286%2057.34%20259.066%2054.26%20260.653%2048.1H265.063C263.056%2056.7333%20257.806%2061.05%20249.313%2061.05C243.9%2061.05%20239.746%2059.16%20236.853%2055.38C234.286%2051.9733%20233.003%2047.4933%20233.003%2041.94C233.003%2036.6667%20234.286%2032.28%20236.853%2028.78C239.793%2024.8133%20243.946%2022.83%20249.313%2022.83C254.773%2022.83%20258.926%2024.9533%20261.773%2029.2C264.246%2032.8867%20265.39%2037.53%20265.203%2043.13ZM237.413%2039.42H260.793C260.7%2035.8733%20259.65%2032.8867%20257.643%2030.46C255.496%2027.8467%20252.72%2026.54%20249.313%2026.54C245.906%2026.54%20243.106%2027.87%20240.913%2030.53C238.953%2032.8633%20237.786%2035.8267%20237.413%2039.42Z'%20fill='white'/%3e%3cpath%20d='M124.417%20111V90.048H116.713V85.296H137.773V90.048H130.069V111H124.417ZM141.637%20111V85.296H147.289V111H141.637ZM153.154%20111V85.296H167.014C169.27%2085.296%20171.106%2085.992%20172.522%2087.384C173.866%2088.728%20174.538%2090.396%20174.538%2092.388C174.538%2095.58%20173.182%2097.728%20170.47%2098.832V98.904C172.726%2099.48%20173.974%20101.484%20174.214%20104.916C174.286%20105.948%20174.358%20106.98%20174.43%20108.012C174.574%20109.404%20174.862%20110.4%20175.294%20111H169.642C169.378%20110.352%20169.174%20109.38%20169.03%20108.084C168.934%20107.004%20168.838%20105.924%20168.742%20104.844C168.55%20103.452%20168.13%20102.456%20167.482%20101.856C166.858%20101.256%20165.85%20100.956%20164.458%20100.956H158.806V111H153.154ZM158.806%2089.688V96.924H164.998C167.59%2096.924%20168.886%2095.7%20168.886%2093.252C168.886%2090.876%20167.59%2089.688%20164.998%2089.688H158.806ZM180.034%20111V85.296H199.258V90.048H185.686V95.556H198.142V99.948H185.686V106.248H199.546V111H180.034ZM226.246%20111V61.02H231.006V106.94H259.006V111H226.246ZM295.134%2094.13H267.344C267.391%2097.863%20268.324%20101.037%20270.144%20103.65C272.337%20106.777%20275.371%20108.34%20279.244%20108.34C285.217%20108.34%20288.997%20105.26%20290.584%2099.1H294.994C292.987%20107.733%20287.737%20112.05%20279.244%20112.05C273.831%20112.05%20269.677%20110.16%20266.784%20106.38C264.217%20102.973%20262.934%2098.493%20262.934%2092.94C262.934%2087.667%20264.217%2083.28%20266.784%2079.78C269.724%2075.813%20273.877%2073.83%20279.244%2073.83C284.704%2073.83%20288.857%2075.953%20291.704%2080.2C294.177%2083.887%20295.321%2088.53%20295.134%2094.13ZM267.344%2090.42H290.724C290.631%2086.873%20289.581%2083.887%20287.574%2081.46C285.427%2078.847%20282.651%2077.54%20279.244%2077.54C275.837%2077.54%20273.037%2078.87%20270.844%2081.53C268.884%2083.863%20267.717%2086.827%20267.344%2090.42ZM328.843%2085.45H324.433C324.34%2082.837%20323.36%2080.83%20321.493%2079.43C319.813%2078.17%20317.643%2077.54%20314.983%2077.54C312.696%2077.54%20310.783%2077.983%20309.243%2078.87C307.376%2079.99%20306.443%2081.623%20306.443%2083.77C306.443%2086.71%20308.94%2088.74%20313.933%2089.86L319.813%2091.19C326.673%2092.73%20330.103%2096.067%20330.103%20101.2C330.103%20104.793%20328.54%20107.57%20325.413%20109.53C322.706%20111.21%20319.44%20112.05%20315.613%20112.05C306.373%20112.05%20301.426%20107.803%20300.773%2099.31H305.183C305.37%20102.203%20306.42%20104.443%20308.333%20106.03C310.293%20107.57%20312.79%20108.34%20315.823%20108.34C318.296%20108.34%20320.466%20107.827%20322.333%20106.8C324.573%20105.54%20325.693%20103.767%20325.693%20101.48C325.693%2098.26%20323.056%2096.067%20317.783%2094.9L312.113%2093.64C308.846%2092.893%20306.443%2091.89%20304.903%2090.63C302.99%2089.043%20302.033%2086.827%20302.033%2083.98C302.033%2080.573%20303.503%2077.96%20306.443%2076.14C308.916%2074.6%20311.973%2073.83%20315.613%2073.83C319.393%2073.83%20322.473%2074.787%20324.853%2076.7C327.373%2078.753%20328.703%2081.67%20328.843%2085.45ZM364.294%2085.45H359.884C359.791%2082.837%20358.811%2080.83%20356.944%2079.43C355.264%2078.17%20353.094%2077.54%20350.434%2077.54C348.147%2077.54%20346.234%2077.983%20344.694%2078.87C342.827%2079.99%20341.894%2081.623%20341.894%2083.77C341.894%2086.71%20344.391%2088.74%20349.384%2089.86L355.264%2091.19C362.124%2092.73%20365.554%2096.067%20365.554%20101.2C365.554%20104.793%20363.991%20107.57%20360.864%20109.53C358.157%20111.21%20354.891%20112.05%20351.064%20112.05C341.824%20112.05%20336.877%20107.803%20336.224%2099.31H340.634C340.821%20102.203%20341.871%20104.443%20343.784%20106.03C345.744%20107.57%20348.241%20108.34%20351.274%20108.34C353.747%20108.34%20355.917%20107.827%20357.784%20106.8C360.024%20105.54%20361.144%20103.767%20361.144%20101.48C361.144%2098.26%20358.507%2096.067%20353.234%2094.9L347.564%2093.64C344.297%2092.893%20341.894%2091.89%20340.354%2090.63C338.441%2089.043%20337.484%2086.827%20337.484%2083.98C337.484%2080.573%20338.954%2077.96%20341.894%2076.14C344.367%2074.6%20347.424%2073.83%20351.064%2073.83C354.844%2073.83%20357.924%2074.787%20360.304%2076.7C362.824%2078.753%20364.154%2081.67%20364.294%2085.45Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_30_1933'%20x='0'%20y='0'%20width='380'%20height='130'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='4'/%3e%3cfeGaussianBlur%20stdDeviation='7'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_30_1933'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_30_1933'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_30_1933'%3e%3crect%20width='352'%20height='102'%20fill='white'%20transform='translate(14%2010)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,yv=`data:image/svg+xml,%3csvg%20width='738'%20height='346'%20viewBox='0%200%20738%20346'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M166.531%20110.373V111.304L158.082%20116.188L158.071%20115.256L166.531%20110.373Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M162.346%20110.647V111.578L158.071%20114.043V113.123L162.346%20110.647Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M159.716%20109.501L159.727%20110.433L158.06%20111.387V110.455L159.716%20109.501Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M158.648%20121.324C158.485%20121.68%20158.4%20122.067%20158.399%20122.459V134.554C158.399%20135.508%20159.079%20135.894%20159.907%20135.406L177.916%20124.992C178.352%20124.709%20178.714%20124.326%20178.974%20123.877C179.234%20123.427%20179.385%20122.922%20179.413%20122.403V110.319C179.423%20110.026%20179.335%20109.739%20179.164%20109.501L168.957%20122.437L158.648%20121.324Z'%20stroke='%23E6F4FF'%20stroke-width='0.75'%20stroke-miterlimit='10'/%3e%3cpath%20d='M159.894%20119.821C159.346%20120.197%20158.911%20120.715%20158.635%20121.32L168.921%20122.387L179.128%20109.452C179.006%20109.325%20178.848%20109.238%20178.675%20109.206C178.502%20109.173%20178.323%20109.196%20178.164%20109.271L159.894%20119.821Z'%20stroke='%23E6F4FF'%20stroke-width='0.75'%20stroke-miterlimit='10'/%3e%3cpath%20d='M182.85%20117.448L217.621%2097.3806V115.551'%20stroke='%23E6F4FF'%20stroke-width='0.75'%20stroke-miterlimit='10'/%3e%3cpath%20d='M368.923%20155.802C382.01%20163.366%20382.078%20175.642%20369.07%20183.206L307.977%20218.741C294.969%20226.315%20273.818%20226.315%20260.72%20218.741L199.264%20183.206C186.176%20175.642%20186.108%20163.366%20199.116%20155.802L260.175%20120.268C273.183%20112.693%20294.334%20112.693%20307.421%20120.268L368.923%20155.802Z'%20fill='%2379AEF5'/%3e%3cpath%20d='M369.066%20150.158L307.973%20185.693C294.965%20193.268%20273.814%20193.268%20260.715%20185.693L199.259%20150.158C192.67%20146.354%20189.381%20141.357%20189.393%20136.36V143.435C189.393%20148.421%20192.67%20153.429%20199.259%20157.234L260.738%20192.78C273.825%20200.343%20294.987%20200.343%20307.995%20192.78L369.054%20157.245C375.507%20153.486%20378.751%20148.568%20378.762%20143.617V136.542C378.762%20141.482%20375.53%20146.399%20369.066%20150.158Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M368.923%20122.754C382.01%20130.317%20382.078%20142.594%20369.07%20150.157L307.977%20185.692C294.969%20193.267%20273.818%20193.267%20260.72%20185.692L199.264%20150.157C186.176%20142.594%20186.108%20130.317%20199.116%20122.754L260.175%2087.2192C273.183%2079.6444%20294.334%2079.6444%20307.421%2087.2192L368.923%20122.754Z'%20fill='white'/%3e%3cpath%20d='M179.53%20276.419C192.617%20283.983%20192.685%20296.259%20179.677%20303.834L118.584%20339.358C105.576%20346.932%2084.4257%20346.932%2071.3384%20339.358L9.87097%20303.834C-3.21637%20296.259%20-3.28442%20283.994%209.72354%20276.419L70.7827%20240.885C83.7906%20233.321%20104.941%20233.321%20118.04%20240.885L179.53%20276.419Z'%20fill='%2379AEF5'/%3e%3cpath%20d='M179.673%20270.775L118.58%20306.344C105.572%20313.919%2084.4213%20313.919%2071.334%20306.344L9.86657%20270.821C3.27754%20267.005%20-0.0113116%20262.008%202.9229e-05%20257.011V264.086C2.9229e-05%20269.083%203.27754%20274.08%209.85523%20277.884L71.3226%20313.419C84.41%20320.994%20105.572%20320.994%20118.58%20313.419L179.639%20277.884C186.092%20274.125%20189.336%20269.208%20189.347%20264.256V257.181C189.381%20262.053%20186.137%20267.016%20179.673%20270.775Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M179.525%20243.37C192.613%20250.933%20192.681%20263.21%20179.673%20270.773L118.58%20306.342C105.572%20313.917%2084.4209%20313.917%2071.3336%20306.342L9.86621%20270.819C-3.18711%20263.187%20-3.25515%20250.933%209.70744%20243.37L70.7666%20207.835C83.7745%20200.26%20104.925%20200.26%20118.024%20207.835L179.525%20243.37Z'%20fill='white'/%3e%3cpath%20d='M561.71%20254.942C574.798%20262.506%20574.866%20274.782%20561.858%20282.357L500.765%20317.881C487.757%20325.456%20466.606%20325.456%20453.519%20317.881L392.051%20282.357C378.964%20274.782%20378.896%20262.517%20391.904%20254.942L452.963%20219.408C465.971%20211.844%20487.122%20211.844%20500.22%20219.408L561.71%20254.942Z'%20fill='%2379AEF5'/%3e%3cpath%20d='M561.861%20249.299L500.768%20284.834C487.76%20292.409%20466.609%20292.409%20453.522%20284.834L392.054%20249.311C385.465%20245.495%20382.176%20240.498%20382.188%20235.501V242.576C382.188%20247.573%20385.465%20252.57%20392.043%20256.375L453.51%20291.909C466.598%20299.484%20487.76%20299.484%20500.768%20291.909L561.849%20256.375C568.302%20252.616%20571.546%20247.698%20571.557%20242.747V235.672C571.557%20240.623%20568.325%20245.54%20561.861%20249.299Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M561.71%20221.895C574.798%20229.459%20574.866%20241.735%20561.858%20249.299L500.765%20284.833C487.757%20292.408%20466.606%20292.408%20453.519%20284.833L392.051%20249.31C378.964%20241.735%20378.896%20229.459%20391.904%20221.895L452.963%20186.36C465.971%20178.785%20487.122%20178.785%20500.22%20186.36L561.71%20221.895Z'%20fill='white'/%3e%3cpath%20opacity='0.43'%20d='M499.163%20269.382L514.995%20269.268L547.963%20250.666L529.681%20241.66L499.163%20269.382Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M727.582%20144.647C740.669%20152.21%20740.749%20164.487%20727.741%20172.05L666.636%20207.539C653.628%20215.114%20632.478%20215.114%20619.39%20207.539L557.923%20172.005C544.836%20164.441%20544.768%20152.165%20557.775%20144.601L618.835%20109.066C631.843%20101.492%20652.993%20101.492%20666.092%20109.066L727.582%20144.647Z'%20fill='%2379AEF5'/%3e%3cpath%20d='M727.709%20139.004L666.639%20174.538C653.631%20182.113%20632.48%20182.113%20619.393%20174.538L557.925%20139.004C551.336%20135.199%20548.048%20130.202%20548.059%20125.205V132.28C548.059%20137.266%20551.336%20142.263%20557.925%20146.079L619.382%20181.614C632.469%20189.177%20653.631%20189.177%20666.639%20181.614L727.698%20146.079C734.162%20142.32%20737.394%20137.391%20737.406%20132.451V125.387C737.406%20130.316%20734.162%20135.245%20727.709%20139.004Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M727.585%20111.591C740.673%20119.166%20740.752%20131.443%20727.744%20139.006L666.674%20174.541C653.666%20182.116%20632.515%20182.116%20619.428%20174.541L557.96%20139.006C544.873%20131.443%20544.805%20119.166%20557.813%20111.603L618.872%2076.0681C631.88%2068.4933%20653.031%2068.4933%20666.129%2076.0681L727.585%20111.591Z'%20fill='white'/%3e%3cpath%20d='M188.892%20167.791L116.878%20126.158C114.281%20124.659%20111.922%20124.511%20110.209%20125.511L106.002%20128.043C107.703%20127.055%20110.062%20127.191%20112.67%20128.702L184.673%20170.335C189.845%20173.322%20194.018%20180.556%20194.007%20186.507L193.882%20228.924C193.882%20231.876%20192.839%20233.955%20191.149%20234.931L195.379%20232.467C197.058%20231.49%20198.101%20229.412%20198.112%20226.459L198.226%20184.042C198.248%20178.069%20194.075%20170.823%20188.892%20167.791Z'%20fill='%23C8F3FF'/%3e%3cpath%20d='M184.677%20170.305C189.848%20173.292%20194.022%20180.526%20194.01%20186.477L193.886%20228.894C193.886%20234.833%20189.667%20237.229%20184.495%20234.242L112.492%20192.609C107.321%20189.622%20103.136%20182.388%20103.159%20176.437L103.272%20134.021C103.272%20128.07%20107.502%20125.685%20112.674%20128.672L184.677%20170.305Z'%20fill='%235C6BC0'/%3e%3cpath%20d='M114.142%20165.041L121.426%20150.951L123.13%20151.834L119.886%20158.109L127.389%20161.998L130.632%20155.723L132.336%20156.606L125.053%20170.697L123.349%20169.813L126.607%20163.511L119.104%20159.622L115.846%20165.925L114.142%20165.041Z'%20fill='white'/%3e%3cpath%20d='M137.451%20159.257L130.168%20173.348L128.464%20172.465L135.747%20158.374L137.451%20159.257Z'%20fill='white'/%3e%3cpath%20d='M133.585%20175.119L140.868%20161.028L145.622%20163.493C146.722%20164.062%20147.527%20164.718%20148.038%20165.46C148.551%20166.197%20148.809%20166.979%20148.811%20167.806C148.813%20168.633%20148.6%20169.462%20148.171%20170.292C147.742%20171.122%20147.192%20171.77%20146.521%20172.237C145.85%20172.703%20145.069%20172.938%20144.179%20172.942C143.291%20172.941%20142.302%20172.658%20141.212%20172.093L137.364%20170.099L138.161%20168.558L141.953%20170.524C142.704%20170.913%20143.366%20171.116%20143.938%20171.134C144.514%20171.153%20145.01%20171.015%20145.424%20170.718C145.846%20170.419%20146.203%20169.987%20146.494%20169.423C146.786%20168.859%20146.936%20168.311%20146.943%20167.78C146.95%20167.249%20146.782%20166.749%20146.438%20166.279C146.096%20165.806%20145.545%20165.372%20144.785%20164.978L141.789%20163.425L135.288%20176.002L133.585%20175.119ZM143.48%20172.222L143.671%20180.347L141.692%20179.321L141.556%20171.225L143.48%20172.222Z'%20fill='white'/%3e%3cpath%20d='M154.947%20168.326L147.664%20182.417L145.96%20181.533L153.243%20167.443L154.947%20168.326Z'%20fill='white'/%3e%3cpath%20d='M169.522%20175.88L162.238%20189.971L160.589%20189.116L158.64%20174.079L158.503%20174.007L152.784%20185.071L151.081%20184.187L158.364%20170.097L160.013%20170.952L161.975%20186.031L162.113%20186.102L167.845%20175.011L169.522%20175.88Z'%20fill='white'/%3e%3cpath%20d='M180.274%20187.036C180.362%20186.495%20180.378%20185.977%20180.32%20185.481C180.269%20184.984%20180.142%20184.517%20179.938%20184.08C179.739%20183.645%20179.462%20183.248%20179.107%20182.89C178.752%20182.531%20178.321%20182.221%20177.812%20181.957C176.978%20181.525%20176.109%20181.348%20175.204%20181.425C174.298%20181.502%20173.427%20181.856%20172.59%20182.487C171.753%20183.117%20171.02%20184.042%20170.389%20185.263C169.758%20186.483%20169.43%20187.618%20169.404%20188.669C169.377%20189.719%20169.601%20190.641%20170.074%20191.433C170.548%20192.225%20171.219%20192.846%20172.09%20193.297C172.896%20193.715%20173.695%20193.911%20174.486%20193.885C175.285%20193.857%20176.02%20193.616%20176.69%20193.161C177.368%20192.704%20177.93%20192.044%20178.375%20191.182L178.841%20191.562L174.608%20189.369L175.391%20187.855L180.75%20190.633L179.967%20192.146C179.368%20193.307%20178.599%20194.188%20177.661%20194.789C176.727%20195.393%20175.705%20195.707%20174.596%20195.73C173.493%20195.752%20172.382%20195.473%20171.265%20194.894C170.019%20194.248%20169.076%20193.387%20168.436%20192.311C167.8%20191.237%20167.499%20190.022%20167.532%20188.667C167.569%20187.314%20167.972%20185.894%20168.74%20184.408C169.316%20183.293%20169.983%20182.368%20170.741%20181.633C171.505%20180.895%20172.325%20180.354%20173.199%20180.011C174.074%20179.667%20174.973%20179.523%20175.897%20179.577C176.822%20179.632%20177.735%20179.893%20178.637%20180.361C179.379%20180.745%20180.013%20181.216%20180.538%20181.773C181.07%20182.328%20181.482%20182.94%20181.775%20183.61C182.075%20184.277%20182.249%20184.981%20182.296%20185.72C182.346%20186.456%20182.258%20187.198%20182.033%20187.948L180.274%20187.036Z'%20fill='white'/%3e%3cpath%20d='M291.119%20297.896C292.922%20298.941%20292.934%20300.633%20291.119%20301.678L279.619%20308.39C278.614%20308.905%20277.5%20309.174%20276.37%20309.174C275.24%20309.174%20274.127%20308.905%20273.121%20308.39L261.474%20301.678C259.671%20300.633%20259.659%20298.941%20261.474%20297.896L273.019%20291.184C274.025%20290.669%20275.138%20290.4%20276.268%20290.4C277.398%20290.4%20278.512%20290.669%20279.517%20291.184L291.119%20297.896Z'%20fill='white'/%3e%3cg%20opacity='0.29'%3e%3cpath%20d='M266.168%20283.475C267.971%20284.519%20267.982%20286.2%20266.168%20287.245L254.668%20293.968C253.662%20294.483%20252.549%20294.752%20251.419%20294.752C250.289%20294.752%20249.176%20294.483%20248.17%20293.968L236.523%20287.245C234.72%20286.2%20234.708%20284.519%20236.523%20283.475L248.045%20276.82C249.051%20276.304%20250.165%20276.036%20251.294%20276.036C252.424%20276.036%20253.538%20276.304%20254.543%20276.82L266.168%20283.475Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M265.479%20260.52C267.282%20261.565%20267.282%20263.257%20265.479%20264.29L253.934%20271.013C252.926%20271.529%20251.811%20271.797%20250.679%20271.797C249.548%20271.797%20248.432%20271.529%20247.424%20271.013L235.834%20264.324C234.031%20263.291%20234.019%20261.599%20235.834%20260.554L247.379%20253.842C248.385%20253.327%20249.498%20253.058%20250.628%20253.058C251.758%20253.058%20252.871%20253.327%20253.877%20253.842L265.479%20260.52Z'%20fill='%2358AFFB'/%3e%3cpath%20d='M330.119%20297.896C331.922%20298.94%20331.933%20300.633%20330.119%20301.677L318.574%20308.389C317.568%20308.904%20316.454%20309.173%20315.325%20309.173C314.195%20309.173%20313.081%20308.904%20312.075%20308.389L300.451%20301.666C298.648%20300.632%20298.637%20298.94%20300.451%20297.896L311.996%20291.172C313.003%20290.662%20314.116%20290.397%20315.245%20290.397C316.374%20290.397%20317.487%20290.662%20318.494%20291.172L330.119%20297.896Z'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M266.328%20312.022C268.131%20313.067%20268.142%20314.747%20266.328%20315.792L254.783%20322.504C253.777%20323.019%20252.663%20323.288%20251.534%20323.288C250.404%20323.288%20249.29%20323.019%20248.284%20322.504L236.66%20315.792C234.857%20314.747%20234.857%20313.055%20236.66%20312.022L248.205%20305.299C249.212%20304.789%20250.325%20304.523%20251.454%20304.523C252.583%20304.523%20253.696%20304.789%20254.703%20305.299L266.328%20312.022Z'%20fill='%2358AFFB'/%3e%3cpath%20d='M473.363%20111.794C475.177%20112.839%20475.177%20114.52%20473.363%20115.565L461.818%20122.288C460.811%20122.8%20459.698%20123.068%20458.569%20123.068C457.439%20123.068%20456.326%20122.8%20455.319%20122.288L443.718%20115.553C441.926%20114.508%20441.915%20112.828%20443.718%20111.783L455.263%20105.06C456.271%20104.547%20457.386%20104.28%20458.518%20104.28C459.649%20104.28%20460.764%20104.547%20461.772%20105.06L473.363%20111.794Z'%20fill='white'/%3e%3cg%20opacity='0.29'%3e%3cpath%20d='M448.416%2097.3849C450.219%2098.4184%20450.23%20100.111%20448.416%20101.155L436.871%20107.878C435.863%20108.388%20434.751%20108.654%20433.622%20108.654C432.493%20108.654%20431.38%20108.388%20430.373%20107.878L418.748%20101.155C416.945%20100.111%20416.945%2098.4184%20418.748%2097.3849L430.293%2090.6618C431.301%2090.1464%20432.416%2089.8777%20433.548%2089.8777C434.68%2089.8777%20435.795%2090.1464%20436.803%2090.6618L448.416%2097.3849Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M447.727%2074.4206C449.53%2075.4654%20449.542%2077.1462%20447.727%2078.191L436.205%2084.8913C435.199%2085.4067%20434.085%2085.6754%20432.956%2085.6754C431.826%2085.6754%20430.712%2085.4067%20429.706%2084.8913L418.082%2078.1796C416.279%2077.1348%20416.268%2075.454%20418.082%2074.4092L429.627%2067.6861C430.634%2067.1761%20431.747%2066.9104%20432.876%2066.9104C434.005%2066.9104%20435.118%2067.1761%20436.125%2067.6861L447.727%2074.4206Z'%20fill='%2358AFFB'/%3e%3cg%20opacity='0.26'%3e%3cpath%20d='M512.378%20111.797C514.17%20112.842%20514.182%20114.522%20512.378%20115.567L500.833%20122.29C499.825%20122.803%20498.71%20123.07%20497.579%20123.07C496.448%20123.07%20495.332%20122.803%20494.324%20122.29L482.722%20115.556C480.919%20114.511%20480.908%20112.83%20482.722%20111.785L494.267%20105.062C495.273%20104.547%20496.386%20104.278%20497.516%20104.278C498.646%20104.278%20499.76%20104.547%20500.765%20105.062L512.378%20111.797Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M448.598%20125.885C450.413%20126.929%20450.413%20128.622%20448.598%20129.655L437.053%20136.378C436.048%20136.893%20434.934%20137.162%20433.804%20137.162C432.674%20137.162%20431.561%20136.893%20430.555%20136.378L418.931%20129.655C417.139%20128.622%20417.128%20126.929%20418.931%20125.885L430.453%20119.173C431.459%20118.658%20432.572%20118.389%20433.702%20118.389C434.832%20118.389%20435.946%20118.658%20436.951%20119.173L448.598%20125.885Z'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M659.707%20269.092C661.511%20270.137%20661.522%20271.817%20659.707%20272.862L648.196%20279.574C647.189%20280.089%20646.073%20280.358%20644.942%20280.358C643.81%20280.358%20642.695%20280.089%20641.687%20279.574L630.051%20272.862C628.248%20271.817%20628.237%20270.125%20630.051%20269.092L641.596%20262.369C642.602%20261.853%20643.715%20261.585%20644.845%20261.585C645.975%20261.585%20647.089%20261.853%20648.094%20262.369L659.707%20269.092Z'%20fill='white'/%3e%3cg%20opacity='0.29'%3e%3cpath%20d='M634.761%20254.66C636.564%20255.705%20636.576%20257.397%20634.761%20258.442L623.25%20265.154C622.244%20265.669%20621.131%20265.938%20620.001%20265.938C618.871%20265.938%20617.758%20265.669%20616.752%20265.154L605.105%20258.442C603.302%20257.397%20603.29%20255.705%20605.105%20254.66L616.65%20247.949C617.655%20247.433%20618.769%20247.165%20619.899%20247.165C621.029%20247.165%20622.142%20247.433%20623.148%20247.949L634.761%20254.66Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M634.071%20231.709C635.874%20232.754%20635.874%20234.446%20634.071%20235.48L622.526%20242.203C621.518%20242.718%20620.403%20242.987%20619.271%20242.987C618.139%20242.987%20617.024%20242.718%20616.016%20242.203L604.426%20235.48C602.623%20234.446%20602.611%20232.754%20604.426%20231.709L615.971%20224.997C616.977%20224.482%20618.09%20224.213%20619.22%20224.213C620.35%20224.213%20621.463%20224.482%20622.469%20224.997L634.071%20231.709Z'%20fill='%2358AFFB'/%3e%3cg%20opacity='0.26'%3e%3cpath%20d='M698.708%20269.094C700.511%20270.127%20700.523%20271.819%20698.708%20272.864L687.163%20279.576C686.157%20280.091%20685.044%20280.36%20683.914%20280.36C682.784%20280.36%20681.671%20280.091%20680.665%20279.576L669.041%20272.853C667.237%20271.819%20667.215%20270.127%20669.041%20269.082L680.586%20262.371C681.591%20261.855%20682.705%20261.587%20683.835%20261.587C684.964%20261.587%20686.078%20261.855%20687.084%20262.371L698.708%20269.094Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M634.916%20283.189C636.72%20284.234%20636.731%20285.914%20634.916%20286.959L623.371%20293.682C622.364%20294.192%20621.251%20294.458%20620.122%20294.458C618.993%20294.458%20617.881%20294.192%20616.873%20293.682L605.249%20286.959C603.446%20285.914%20603.446%20284.222%20605.249%20283.189L616.794%20276.466C617.801%20275.956%20618.914%20275.69%20620.043%20275.69C621.172%20275.69%20622.285%20275.956%20623.292%20276.466L634.916%20283.189Z'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M561.176%2037.9307L561.232%2058.3498L558.919%2059.6899L558.885%2050.1163L550.311%2055.0791L550.334%2064.6527L548.043%2065.9814L547.986%2045.5623L550.277%2044.2336L550.3%2052.7737L558.885%2047.8109L558.862%2039.2708L561.176%2037.9307Z'%20fill='white'/%3e%3cpath%20d='M567.436%2034.321L567.493%2054.7288L565.213%2056.0462L565.145%2035.6384L567.436%2034.321Z'%20fill='white'/%3e%3cpath%20d='M581.673%2040.9289C581.954%2042.5768%20582.418%2044.1881%20583.057%2045.7328L580.686%2047.1069C580.127%2045.7614%20579.728%2044.355%20579.496%2042.9163C578.951%2040.4065%20577.999%2039.8955%20575.923%2040.9971L573.769%2042.2463V51.0931L571.5%2052.4104V32.2752C572.892%2031.1793%20574.362%2030.1885%20575.901%2029.3111C578.35%2027.8916%20579.927%2027.4941%20581.027%2028.0051C581.934%2028.4026%20582.433%2029.5042%20582.433%2031.0714C582.362%2032.4286%20582.024%2033.7584%20581.438%2034.9843C580.852%2036.2102%20580.03%2037.308%20579.019%2038.2147V38.3283C580.426%2038.0671%20581.288%2039.0437%20581.673%2040.9289ZM576.105%2038.8961C577.26%2038.2922%20578.239%2037.3999%20578.948%2036.3056C579.658%2035.2113%20580.073%2033.9521%20580.153%2032.65C580.153%2030.0152%20578.486%2029.8335%20576.059%2031.1963C575.256%2031.6417%20574.496%2032.1626%20573.791%2032.7522V40.2021L576.139%2038.8507'%20fill='white'/%3e%3cpath%20d='M595.179%2018.2722L595.19%2020.4868L587.898%2024.7001L587.92%2031.1506L594.816%2027.1644V29.3449L587.932%2033.3311L587.943%2040.6901L595.632%2036.2497V38.4642L585.664%2044.222L585.596%2023.8142L595.179%2018.2722Z'%20fill='white'/%3e%3cpath%20d='M610.61%2011.7433C612.198%2012.5042%20613.128%2014.3326%20613.128%2017.6374C613.14%2020.9419%20612.266%2024.1891%20610.599%2027.0406C608.677%2030.172%20605.977%2032.7507%20602.762%2034.5246C601.141%2035.4559%20599.768%2036.16%20598.612%2036.6824V16.6039C600.166%2015.4264%20601.79%2014.3455%20603.477%2013.3673C606.709%2011.4594%20609.057%2010.9824%20610.61%2011.7433ZM603.205%2032.1852C605.54%2030.9088%20607.48%2029.0148%20608.814%2026.7098C610.148%2024.4048%20610.824%2021.7773%20610.769%2019.1137C610.769%2014.2758%20608.41%2012.5951%20603.568%2015.3888C602.626%2015.9243%20601.728%2016.5318%20600.88%2017.2058V33.3208C601.663%2032.9985%20602.421%2032.6189%20603.148%2032.1852'%20fill='white'/%3e%3cpath%20d='M58.2918%20176.574V178.152C58.2937%20178.364%2058.3509%20178.572%2058.4576%20178.755C58.5644%20178.938%2058.717%20179.09%2058.9004%20179.195C59.0838%20179.301%2059.2915%20179.357%2059.5031%20179.357C59.7146%20179.357%2059.9226%20179.302%2060.1064%20179.197L67.5573%20174.905C67.7404%20174.799%2067.8924%20174.646%2067.9979%20174.463C68.1034%20174.279%2068.1588%20174.071%2068.1584%20173.86V172.338C68.166%20172.128%2068.1192%20171.92%2068.0225%20171.733C67.9258%20171.547%2067.7825%20171.389%2067.6066%20171.274C67.4307%20171.16%2067.2281%20171.093%2067.0187%20171.081C66.8094%20171.068%2066.6003%20171.11%2066.4119%20171.202L58.961%20175.506C58.7626%20175.606%2058.5954%20175.758%2058.4774%20175.947C58.3594%20176.135%2058.2952%20176.352%2058.2918%20176.574Z'%20fill='%23F2F9FF'/%3e%3cpath%20d='M34.6559%20197.957V199.592C34.6569%20199.803%2034.7128%20200.01%2034.8182%20200.193C34.9235%20200.376%2035.0746%20200.528%2035.2566%20200.635C35.4387%20200.742%2035.6453%20200.799%2035.8561%20200.801C36.067%20200.804%2036.2748%20200.751%2036.459%20200.648L67.5443%20182.762C67.7274%20182.656%2067.8794%20182.503%2067.9849%20182.32C68.0904%20182.136%2068.1458%20181.928%2068.1454%20181.717V180.138C68.1478%20179.926%2068.094%20179.716%2067.9895%20179.531C67.8849%20179.347%2067.7334%20179.193%2067.5503%20179.085C67.3671%20178.978%2067.1589%20178.921%2066.9467%20178.921C66.7345%20178.92%2066.5259%20178.976%2066.3422%20179.082L35.2909%20196.912C35.1015%20197.013%2034.9427%20197.164%2034.831%20197.347C34.7193%20197.531%2034.6588%20197.742%2034.6559%20197.957Z'%20fill='%23F2F9FF'/%3e%3cg%20opacity='0.53'%3e%3cpath%20d='M47.4966%20206.339V207.917C47.4962%20208.129%2047.5515%20208.336%2047.6568%20208.52C47.7622%20208.703%2047.9139%20208.855%2048.0967%20208.961C48.2795%20209.067%2048.487%20209.123%2048.6982%20209.123C48.9094%20209.123%2049.1169%20209.068%2049.2998%20208.962L67.5472%20198.457C67.7374%20198.359%2067.8958%20198.208%2068.0042%20198.023C68.1126%20197.838%2068.1665%20197.626%2068.1597%20197.412V195.822C68.1601%20195.611%2068.1048%20195.403%2067.9995%20195.22C67.8941%20195.036%2067.7424%20194.884%2067.5596%20194.778C67.3768%20194.672%2067.1693%20194.616%2066.9581%20194.616C66.7469%20194.616%2066.5394%20194.672%2066.3565%20194.778L48.0977%20205.271C47.9112%20205.379%2047.7571%20205.535%2047.6513%20205.722C47.5456%20205.91%2047.4922%20206.123%2047.4966%20206.339Z'%20fill='%23F2F9FF'/%3e%3c/g%3e%3cpath%20d='M39.5103%20203.054V204.633C39.5113%20204.844%2039.5672%20205.051%2039.6726%20205.234C39.7779%20205.417%2039.929%20205.569%2040.1111%20205.676C40.2931%20205.782%2040.4997%20205.84%2040.7105%20205.842C40.9214%20205.844%2041.1292%20205.791%2041.3135%20205.689L67.5448%20190.63C67.7288%20190.522%2067.8812%20190.368%2067.9867%20190.183C68.0923%20189.997%2068.1471%20189.787%2068.1459%20189.574V187.995C68.1449%20187.784%2068.089%20187.577%2067.9836%20187.394C67.8783%20187.211%2067.7271%20187.059%2067.5451%20186.952C67.3631%20186.846%2067.1565%20186.788%2066.9456%20186.786C66.7348%20186.784%2066.527%20186.836%2066.3427%20186.939L40.1113%20202.009C39.9282%20202.115%2039.7763%20202.267%2039.6707%20202.451C39.5652%20202.634%2039.5099%20202.842%2039.5103%20203.054Z'%20fill='%23F2F9FF'/%3e%3cpath%20d='M8.80978%20208.234V229.448L24.8004%20239.851'%20stroke='white'%20stroke-width='0.53'%20stroke-miterlimit='10'/%3e%3cpath%20d='M8.71457%20208.631C9.76055%20208.631%2010.6085%20207.782%2010.6085%20206.735C10.6085%20205.687%209.76055%20204.838%208.71457%20204.838C7.66858%20204.838%206.82065%20205.687%206.82065%20206.735C6.82065%20207.782%207.66858%20208.631%208.71457%20208.631Z'%20stroke='white'%20stroke-width='1.06'%20stroke-miterlimit='10'/%3e%3cpath%20d='M386.505%20197.436V218.638L402.484%20229.052'%20stroke='white'%20stroke-width='0.53'%20stroke-miterlimit='10'/%3e%3cpath%20d='M386.406%20197.821C387.452%20197.821%20388.3%20196.972%20388.3%20195.925C388.3%20194.877%20387.452%20194.028%20386.406%20194.028C385.36%20194.028%20384.512%20194.877%20384.512%20195.925C384.512%20196.972%20385.36%20197.821%20386.406%20197.821Z'%20stroke='white'%20stroke-width='1.06'%20stroke-miterlimit='10'/%3e%3cpath%20opacity='0.35'%20d='M249.201%20154.586C259.943%20154.586%20268.651%20149.044%20268.651%20142.208C268.651%20135.371%20259.943%20129.829%20249.201%20129.829C238.46%20129.829%20229.752%20135.371%20229.752%20142.208C229.752%20149.044%20238.46%20154.586%20249.201%20154.586Z'%20fill='%23A6D0F4'/%3e%3cpath%20opacity='0.35'%20d='M258.559%20155.143C258.559%20158.959%20263.424%20162.048%20269.412%20162.048C275.4%20162.048%20280.265%20158.959%20280.265%20155.143C280.265%20151.327%20275.411%20148.238%20269.412%20148.238C263.413%20148.238%20258.559%20151.327%20258.559%20155.143Z'%20fill='%23A6D0F4'/%3e%3cpath%20opacity='0.35'%20d='M302.642%20131.248C302.642%20135.064%20307.507%20138.153%20313.495%20138.153C319.483%20138.153%20324.348%20135.064%20324.348%20131.248C324.348%20127.432%20319.494%20124.332%20313.495%20124.332C307.496%20124.332%20302.642%20127.432%20302.642%20131.248Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M260.79%20140.663C260.564%20143.218%20258.171%20144.944%20256.005%20145.875C253.633%20146.854%20251.084%20147.329%20248.52%20147.272C245.889%20147.278%20243.29%20146.7%20240.91%20145.58C238.857%20144.569%20236.691%20142.741%20236.691%20140.242C236.594%20141.088%20236.671%20141.944%20236.916%20142.758C237.162%20143.573%20237.572%20144.328%20238.12%20144.978C239.93%20146.723%20242.229%20147.872%20244.709%20148.272C249.359%20149.225%20255.676%20148.771%20259.203%20145.183C259.806%20144.534%20260.263%20143.764%20260.543%20142.923C260.823%20142.083%20260.919%20141.192%20260.824%20140.311L260.79%20140.663Z'%20fill='%23ADCDFC'/%3e%3cpath%20d='M257.252%20135.994C261.981%20138.731%20262.015%20143.16%20257.32%20145.897C254.682%20147.231%20251.769%20147.926%20248.814%20147.926C245.859%20147.926%20242.946%20147.231%20240.308%20145.897C235.579%20143.16%20235.557%20138.731%20240.308%20135.994C242.936%20134.667%20245.837%20133.976%20248.78%20133.976C251.723%20133.976%20254.624%20134.667%20257.252%20135.994Z'%20fill='white'/%3e%3cpath%20d='M250.044%20132.339L250.021%20142.401L248.762%20143.139L248.774%20133.077L250.044%20132.339Z'%20fill='%23C7D8F2'/%3e%3cpath%20d='M248.775%20133.077L248.764%20143.139L247.493%20142.401L247.505%20132.339L248.775%20133.077Z'%20fill='%237BAEFF'/%3e%3cpath%20d='M250.634%20130.51L248.786%20131.577L246.926%20130.51L248.774%20129.431L250.634%20130.51Z'%20fill='%234DA5DC'/%3e%3cpath%20d='M236.786%2096.247C236.786%2096.247%20232.987%2098.5183%20231.978%20100.79C230.968%20103.061%20231.24%20118.96%20236.514%20126.069C241.787%20133.179%20251.631%20134.144%20253.911%20133.133C256.19%20132.122%20269.278%20125.558%20270.287%20122.276C271.296%20118.994%20266.261%20116.473%20263.483%20115.212C260.704%20113.952%20258.946%20112.18%20257.438%20107.638C255.93%20103.095%20255.17%2095.2703%20253.401%2094.0097C251.631%2092.7491%20247.379%2090.7163%20236.786%2096.247Z'%20fill='%2325437F'/%3e%3cpath%20d='M255.614%20130.875C257.462%20130.057%20266.512%20125.537%20270.357%20122.119C271.162%20118.916%20266.252%20116.44%20263.552%20115.203C260.853%20113.965%20259.016%20112.17%20257.508%20107.628C255.999%20103.085%20255.24%2095.2604%20253.47%2093.9998C251.701%2092.7392%20247.426%2090.7177%20236.833%2096.2711C235.702%2096.9583%20234.642%2097.7572%20233.669%2098.656C232.717%20101.302%20233.057%20116.827%20238.262%20123.811C243.468%20130.795%20253.346%20131.885%20255.614%20130.875Z'%20fill='%23254DA1'/%3e%3cpath%20d='M245.804%2084.3226C245.594%2085.0765%20245.562%2085.8687%20245.71%2086.6372C245.857%2087.4056%20246.181%2088.1294%20246.654%2088.7517C248.129%2090.512%20247.845%2091.023%20247.562%2091.6363C247.278%2092.2495%20245.532%2094.2369%20245.736%2096.9739C245.94%2099.7108%20253.595%2098.4502%20254.298%2096.5537C255.001%2094.6571%20252.2%2091.5%20252.03%2089.1038C251.86%2086.7075%20253.504%2083.6185%20251.474%2082.8463C249.444%2082.074%20246.791%2081.4835%20245.804%2084.3226Z'%20fill='%23BB543E'/%3e%3cpath%20d='M267.259%20149.509C267.259%20149.509%20266.556%20151.428%20266.987%20151.996C267.317%20152.802%20267.505%20153.659%20267.542%20154.529L268.245%20154.949L268.529%20153.541C268.678%20154.157%20268.965%20154.732%20269.368%20155.221C270.774%20156.172%20272.348%20156.842%20274.007%20157.197C275.821%20157.618%20276.388%20157.481%20276.524%20156.777C276.66%20156.073%20274.562%20153.541%20273.303%20152.7C272.045%20151.86%20267.259%20149.509%20267.259%20149.509Z'%20fill='%23254DA1'/%3e%3cpath%20d='M271.375%20149.326C271.766%20150.155%20272.221%20150.952%20272.736%20151.711C273.303%20152.415%20274.845%20153.675%20274.698%20154.38C274.55%20155.084%20273.155%20154.947%20271.477%20154.38C269.798%20153.812%20269.367%20152.279%20268.528%20151.847C268.063%20151.686%20267.675%20151.357%20267.441%20150.924C267.206%20150.491%20267.14%20149.986%20267.258%20149.508C267.405%20148.054%20271.375%20149.326%20271.375%20149.326Z'%20fill='%23FF9554'/%3e%3cpath%20d='M263.743%20126.295C263.373%20125.609%20263.284%20124.805%20263.496%20124.054C263.708%20123.304%20264.203%20122.665%20264.877%20122.275C267.327%20120.901%20269.119%20123.036%20269.55%20124.035C270.549%20126.061%20271.157%20128.257%20271.342%20130.508C271.342%20133.166%20271.557%20149.701%20271.557%20149.701C271.268%20149.956%20270.93%20150.149%20270.563%20150.269C270.197%20150.389%20269.81%20150.434%20269.427%20150.4C269.043%20150.366%20268.67%20150.254%20268.33%20150.071C267.991%20149.889%20267.692%20149.639%20267.452%20149.337C267.452%20149.337%20265.047%20129.486%20264.991%20128.532C264.768%20127.694%20264.339%20126.925%20263.743%20126.295Z'%20fill='%23FF9554'/%3e%3cpath%20d='M263.141%20151.574C263.141%20151.574%20262.438%20153.493%20262.857%20154.05C263.195%20154.854%20263.387%20155.711%20263.424%20156.582L264.127%20157.003L264.411%20155.594C264.559%20156.215%20264.846%20156.793%20265.25%20157.287C266.651%20158.235%20268.223%20158.902%20269.877%20159.251C271.703%20159.671%20272.27%20159.535%20272.406%20158.831C272.542%20158.127%20270.444%20155.594%20269.174%20154.754C267.904%20153.914%20263.141%20151.574%20263.141%20151.574Z'%20fill='%23254DA1'/%3e%3cpath%20d='M256.94%20131.145C256.94%20131.145%20255.25%20128.703%20257.496%20127.011C259.741%20125.319%20261.805%20127.204%20262.361%20128.147C263.62%20130.024%20264.509%20132.125%20264.981%20134.336C265.355%20136.959%20267.249%20151.371%20267.249%20151.371C266.997%20151.662%20266.688%20151.9%20266.341%20152.068C265.994%20152.236%20265.617%20152.332%20265.232%20152.351C264.847%20152.369%20264.462%20152.308%20264.102%20152.173C263.741%20152.038%20263.411%20151.831%20263.132%20151.564C263.132%20151.564%20258.596%20134.132%20258.46%20133.189C258.13%20132.393%20257.608%20131.69%20256.94%20131.145Z'%20fill='%23FF9554'/%3e%3cpath%20d='M267.256%20151.383C267.642%20152.219%20268.097%20153.02%20268.617%20153.779C269.173%20154.472%20270.727%20155.744%20270.579%20156.448C270.432%20157.152%20269.037%20157.005%20267.358%20156.448C265.68%20155.892%20265.249%20154.336%20264.41%20153.916C263.945%20153.754%20263.557%20153.425%20263.322%20152.992C263.087%20152.56%20263.022%20152.055%20263.14%20151.576C263.287%20150.123%20267.256%20151.383%20267.256%20151.383Z'%20fill='%23FF9554'/%3e%3cpath%20d='M267.077%20120.46C266.397%20119.813%20258.47%20113.055%20258.47%20113.055L245.36%20115.111C245.36%20115.111%20245.553%20121.119%20248.762%20125.048C250.535%20127.298%20252.616%20129.286%20254.943%20130.953C255.65%20131.527%20256.487%20131.917%20257.381%20132.089C257.822%20131.055%20258.63%20130.221%20259.649%20129.75C261.611%20128.614%20268.212%20124.071%20269.051%20124.264C269.89%20124.457%20270.037%20124.821%20270.037%20124.821C269.41%20123.153%20268.395%20121.658%20267.077%20120.46Z'%20fill='%2362759A'/%3e%3cpath%20d='M257.026%2092.5215C257.026%2092.5215%20258.942%2092.6237%20260.054%2095.2471C261.165%2097.8704%20262.583%20104.548%20262.98%20105.161C263.377%20105.775%20262.889%20107.58%20260.462%20108.091C259.046%20106.268%20257.825%20104.3%20256.822%20102.22C255.313%2098.9947%20254.667%2093.9751%20257.026%2092.5215Z'%20fill='%23C7D8F2'/%3e%3cpath%20d='M249.241%2091.1594C249.241%2091.1594%20243.979%2094.9298%20243.458%2096.179C242.831%2098.5159%20242.991%20100.994%20243.911%20103.231C245.045%20105.503%20244.603%20114.088%20244.989%20115.724C245.374%20117.359%20249.876%20117.927%20252.666%20117.393C255.456%20116.859%20258.813%20114.827%20258.711%20111.579C258.609%20108.331%20258.144%20106.536%20259.845%2098.8592C260.163%2097.4169%20258.813%2095.668%20258.133%2093.1809C257.985%2092.6698%20256.239%2092.1247%20256.239%2092.1247C256.239%2092.1247%20254.413%2090.9436%20249.241%2091.1594Z'%20fill='%23C7D8F2'/%3e%3cpath%20d='M247.341%2094.2955C247.341%2094.2955%20242.805%2093.3869%20240.865%20100.383C239.663%20105.198%20238.518%20109.298%20239.187%20110.183C239.856%20111.069%20241.829%20111.875%20243.088%20110.853C244.347%20109.831%20248.101%2098.2589%20248.01%2097.1119C247.919%2095.9649%20248.305%2095.1131%20247.341%2094.2955Z'%20fill='%23C7D8F2'/%3e%3cpath%20d='M259.453%20100.109C259.453%20100.109%20257.537%20104.754%20248.351%20102.937C246.536%20102.835%20244.812%20106.98%20245.924%20109.206C247.119%20111.81%20247.866%20114.597%20248.135%20117.451C249.637%20117.696%20251.169%20117.696%20252.672%20117.451C255.45%20116.906%20258.818%20114.884%20258.716%20111.636C258.363%20107.83%20258.65%20103.991%20259.567%20100.279L259.453%20100.109Z'%20fill='%23A9C9E6'/%3e%3cpath%20d='M249.114%2090.9548C248.966%2091.0754%20248.852%2091.2312%20248.781%2091.4078C248.709%2091.5845%20248.683%2091.7762%20248.705%2091.9655C249.335%2093.4506%20250.325%2094.7545%20251.586%2095.7586C252.391%2096.1561%20253.242%2093.7825%20253.242%2093.7825C253.242%2093.7825%20254.966%2094.498%20255.567%2093.987C256.168%2093.4759%20254.512%2091.5567%20254.058%2091.2046C252.449%2090.7577%20250.76%2090.6724%20249.114%2090.9548Z'%20fill='white'/%3e%3cpath%20d='M253.811%2090.4542C253.797%2090.5101%20253.797%2090.5687%20253.811%2090.6246C253.868%2091.0107%20254.061%2091.9987%20254.095%2092.4076C254.129%2092.8164%20253.675%2093.4865%20252.62%2093.4637C251.566%2093.441%20249.74%2092.9981%20249.139%2091.7262C249.165%2090.4746%20249.109%2089.2225%20248.969%2087.9785L253.811%2090.4542Z'%20fill='%23FF8654'/%3e%3cpath%20d='M255.328%2084.0166C254.829%2081.3592%20252.731%2079.8488%20250.349%2080.4052C249.573%2080.5081%20248.832%2080.7905%20248.185%2081.2301C247.537%2081.6697%20247.001%2082.2544%20246.618%2082.9378C245.484%2085.2091%20247.162%2087.117%20248.24%2088.3208C248.693%2088.8091%20249.033%2089.1952%20249.249%2089.4564L249.487%2089.729C250.104%2090.3499%20250.863%2090.81%20251.699%2091.0691C252.194%2091.2405%20252.726%2091.2773%20253.24%2091.1755C253.754%2091.0737%20254.232%2090.8371%20254.624%2090.4899C255.305%2089.7858%20255.804%2086.6854%20255.328%2084.0166Z'%20fill='%23FF9554'/%3e%3cpath%20d='M248.186%2087.036C248.186%2087.036%20247.403%2085.9685%20246.825%2086.2524C246.246%2086.5363%20247.607%2088.8985%20248.481%2088.853C249.354%2088.8076%20248.186%2087.036%20248.186%2087.036Z'%20fill='%23FF9554'/%3e%3cpath%20d='M257.244%20114.688L266.657%20123.683L259.353%20127.76L249.952%20118.765L257.244%20114.688Z'%20fill='white'/%3e%3cpath%20d='M258.933%20116.767C258.6%20117.311%20258.312%20117.881%20258.071%20118.471C257.912%20118.993%20257.425%20119.981%20257.629%20120.254C257.833%20120.526%20258.525%20120.083%20258.661%20119.765C258.759%20119.577%20258.908%20119.419%20259.092%20119.311L259.183%20120.254C259.183%20120.833%20259.455%20122.071%20259.92%20122.298C260.385%20122.525%20261.054%20121.628%20261.383%20121.094C261.678%20120.306%20261.725%20119.446%20261.519%20118.63C261.337%20118.266%20260.85%20117.437%20260.85%20117.437L258.933%20116.767Z'%20fill='%23FF9554'/%3e%3cpath%20d='M259.208%20105.559C259.255%20105.191%20259.413%20104.845%20259.661%20104.569C259.908%20104.292%20260.234%20104.098%20260.595%20104.012C260.956%20103.925%20261.335%20103.951%20261.68%20104.086C262.026%20104.22%20262.323%20104.457%20262.531%20104.764C262.966%20105.401%20263.277%20106.114%20263.45%20106.865C263.949%20109.137%20261.646%20117.086%20261.42%20117.79C261.193%20118.495%20259.809%20118.824%20258.732%20117.927C257.654%20117.03%20259.174%20108.047%20259.174%20106.945C259.159%20106.483%20259.17%20106.02%20259.208%20105.559Z'%20fill='%23C7D8F2'/%3e%3cpath%20d='M252.571%20117.199C253.201%20117.287%20253.823%20117.424%20254.431%20117.608C254.93%20117.812%20256.008%20118.062%20256.087%20118.392C256.166%20118.721%20255.384%20118.982%20255.055%20118.891C254.851%20118.833%20254.635%20118.833%20254.431%20118.891L255.1%20119.55C255.509%20119.97%20256.336%20120.924%20256.234%20121.413C256.132%20121.901%20254.998%20121.867%20254.374%20121.787C253.582%20121.52%20252.89%20121.016%20252.39%20120.345C252.22%20119.97%20251.891%20119.05%20251.891%20119.05L252.571%20117.199Z'%20fill='%23FF9554'/%3e%3cpath%20d='M241.843%20108.207C241.53%20108.011%20241.165%20107.915%20240.796%20107.93C240.427%20107.945%20240.071%20108.071%20239.775%20108.292C239.479%20108.512%20239.256%20108.817%20239.135%20109.167C239.015%20109.516%20239.002%20109.894%20239.099%20110.251C239.306%20110.995%20239.652%20111.692%20240.12%20112.306C241.526%20114.135%20250.927%20119.336%20251.63%20119.609C252.334%20119.881%20253.456%20119.052%20253.456%20117.644C253.456%20116.236%20243.771%20109.774%20242.932%20109.07C242.585%20108.763%20242.221%20108.475%20241.843%20108.207Z'%20fill='%23C7D8F2'/%3e%3cpath%20d='M252.752%2082.6185C252.752%2082.6185%20252.049%2082.3345%20251.698%2083.3226C251.346%2084.3106%20251.142%2085.5939%20249.872%2086.1276C248.602%2086.6614%20248.261%2086.8999%20247.354%2086.8318C246.869%2086.7941%20246.416%2086.572%20246.089%2086.2109C245.763%2085.8498%20245.586%2085.3771%20245.596%2084.8898C245.655%2083.7529%20246.063%2082.6621%20246.766%2081.7673C247.468%2080.8725%20248.431%2080.2176%20249.52%2079.8929C250.153%2079.6834%20250.823%2079.6063%20251.487%2079.6662C252.151%2079.726%20252.796%2079.9217%20253.382%2080.241C253.967%2080.5603%20254.481%2080.9965%20254.892%2081.5226C255.303%2082.0487%20255.601%2082.6536%20255.769%2083.2999C256.189%2085.0488%20255.497%2085.1964%20255.497%2085.1964C255.497%2085.1964%20255.417%2082.2891%20252.752%2082.6185Z'%20fill='%23BB543E'/%3e%3cpath%20opacity='0.35'%20d='M292.625%20129.105C303.367%20129.105%20312.075%20123.563%20312.075%20116.726C312.075%20109.89%20303.367%20104.347%20292.625%20104.347C281.884%20104.347%20273.176%20109.89%20273.176%20116.726C273.176%20123.563%20281.884%20129.105%20292.625%20129.105Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M304.215%20115.181C303.988%20117.725%20301.595%20119.451%20299.441%20120.382C297.068%20121.37%20294.513%20121.846%20291.944%20121.779C289.314%20121.784%20286.716%20121.206%20284.335%20120.087C282.293%20119.076%20280.116%20117.248%20280.116%20114.761C280.02%20115.604%20280.097%20116.458%20280.343%20117.271C280.588%20118.083%20280.998%20118.837%20281.545%20119.485C283.355%20121.23%20285.654%20122.379%20288.134%20122.778C292.784%20123.744%20299.1%20123.278%20302.627%20119.701C303.23%20119.052%20303.686%20118.281%20303.966%20117.441C304.245%20116.601%20304.342%20115.71%20304.249%20114.829C304.238%20114.942%20304.238%20115.056%20304.215%20115.181Z'%20fill='%23ADCDFC'/%3e%3cpath%20d='M300.688%20110.535C305.406%20113.272%20305.44%20117.701%20300.745%20120.438C298.102%20121.787%20295.177%20122.49%20292.211%20122.49C289.244%20122.49%20286.32%20121.787%20283.677%20120.438C278.947%20117.701%20278.936%20113.271%20283.677%20110.546C286.312%20109.205%20289.225%20108.506%20292.181%20108.504C295.137%20108.502%20298.051%20109.197%20300.688%20110.535Z'%20fill='white'/%3e%3cpath%20d='M293.463%20106.859L293.44%20116.909L292.181%20117.648L292.204%20107.586L293.463%20106.859Z'%20fill='%23C7D8F2'/%3e%3cpath%20d='M292.205%20107.586L292.183%20117.648L290.912%20116.909L290.935%20106.859L292.205%20107.586Z'%20fill='%237BAEFF'/%3e%3cpath%20d='M294.053%20105.018L292.205%20106.097L290.345%20105.018L292.193%20103.951L294.053%20105.018Z'%20fill='%234DA5DC'/%3e%3cpath%20d='M280.209%2070.7737C280.209%2070.7737%20276.41%2073.045%20275.401%2075.3163C274.392%2077.5876%20274.664%2093.4869%20279.937%20100.596C285.211%20107.705%20295.066%20108.671%20297.334%20107.66C299.602%20106.649%20312.712%20100.096%20313.722%2096.8143C314.731%2093.5323%20309.684%2090.9998%20306.917%2089.7392C304.15%2088.4786%20302.381%2086.7183%20300.872%2082.1643C299.364%2077.6103%20298.604%2069.797%20296.835%2068.5364C295.066%2067.2758%20290.802%2065.2203%20280.209%2070.7737Z'%20fill='%2325437F'/%3e%3cpath%20d='M299.036%20105.333C300.885%20104.515%20309.946%2099.9953%20313.78%2096.5769C314.596%2093.3744%20309.674%2090.8987%20306.975%2089.6608C304.276%2088.4229%20302.439%2086.6399%20300.93%2082.0859C299.422%2077.532%20298.662%2069.7186%20296.893%2068.458C295.124%2067.1975%20290.848%2065.176%20280.256%2070.7294C279.124%2071.4166%20278.064%2072.2155%20277.092%2073.1142C276.139%2075.7603%20276.479%2091.2848%20281.696%2098.2691C286.913%20105.253%20296.768%20106.389%20299.036%20105.333Z'%20fill='%23254DA1'/%3e%3cpath%20d='M303.153%2071.151C303.153%2071.151%20304.287%2071.5371%20305.115%2074.3422C305.943%2077.1473%20308.347%2082.2237%20307.508%2084.4723C306.669%2086.7209%20304.106%2085.4489%20303.437%2083.7682C302.768%2082.0874%20299.932%2074.2627%20300.488%2073.1157C301.044%2071.9687%20302.03%2070.7649%20303.153%2071.151Z'%20fill='%23113569'/%3e%3cpath%20d='M310.014%20128.657C310.183%20129.275%20310.419%20129.873%20310.717%20130.44C311.586%20131.532%20312.606%20132.496%20313.745%20133.302C314.505%20133.949%20315.435%20135.153%20315.344%20135.721C315.253%20136.288%20313.428%20136.425%20311.999%20136.118C310.57%20135.811%20309.311%20134.21%20308.891%20134.244C308.472%20134.278%20306.907%20133.972%20306.623%20133.427C306.339%20132.881%20306.838%20130.735%20306.838%20130.735V129.179L310.014%20128.657Z'%20fill='%23232839'/%3e%3cpath%20d='M317.044%20124.16C317.213%20124.775%20317.449%20125.369%20317.748%20125.932C318.613%20127.031%20319.633%20127.998%20320.776%20128.805C321.535%20129.452%20322.465%20130.645%20322.375%20131.224C322.284%20131.803%20320.458%20131.928%20319.029%20131.621C317.6%20131.315%20316.341%20129.714%20315.922%20129.748C315.502%20129.782%20313.937%20129.475%20313.654%20128.93C313.37%20128.385%20313.869%20126.238%20313.869%20126.238V124.683L317.044%20124.16Z'%20fill='%23232839'/%3e%3cpath%20d='M290.43%2093.2273C290.37%2095.1503%20290.892%2097.0465%20291.927%2098.6671C293.606%20101.109%20300.535%20107.287%20301.283%20107.855C302.032%20108.422%20302.225%20112.534%20302.973%20114.407C303.722%20116.281%20305.967%20128.467%20306.375%20129.409C306.375%20129.409%20306.75%20130.341%20309.369%20129.784C310.866%20129.591%20311.048%20129.035%20311.048%20129.035C311.048%20129.035%20310.118%20115.35%20309.369%20112.159C308.621%20108.968%20308.428%20105.413%20307.101%20104.107C305.774%20102.801%20299.423%2094.5447%20299.423%2094.5447L297.927%2092.103L290.43%2093.2273Z'%20fill='%23113C7A'/%3e%3cpath%20d='M302.03%2090.2268C302.03%2090.2268%20312.135%2095.9051%20313.541%2097.1203C314.897%2098.3056%20315.832%2099.8997%20316.206%20101.663C316.32%20102.276%20317.34%20124.013%20317.76%20125.001C317.896%20125.841%20315.231%20126.409%20313.961%20125.989C313.466%20125.646%20313.039%20125.215%20312.702%20124.717C312.702%20124.717%20310.173%20111.645%20310.173%20109.817C309.937%20107.359%20309.558%20104.917%20309.039%20102.503L297.392%2095.8938L296.541%2092.941L302.03%2090.2268Z'%20fill='%23113C7A'/%3e%3cpath%20d='M290.807%2095.1093C290.807%2095.1093%20291.782%2097.9144%20295.853%2097.4942L297.26%2097.2103L297.543%2094.939C298.96%2094.7497%20300.31%2094.2198%20301.479%2093.3945C302.034%2093.6784%20302.182%2095.0866%20302.737%2095.2229C303.293%2095.3592%20304.28%2093.3945%20303.996%2091.9863C303.713%2090.5781%20303.021%2091.1459%20303.021%2091.1459C303.021%2091.1459%20291.51%2094.0305%20290.807%2095.1093Z'%20fill='%23112C5C'/%3e%3cpath%20d='M295.1%2069.6954C295.1%2069.6954%20290.292%2073.1024%20289.815%2074.2381C289.244%2076.376%20289.391%2078.643%20290.235%2080.6886C291.222%2082.801%20290.859%2090.6143%20291.222%2092.1361C291.584%2093.6579%20295.69%2094.1462%20298.23%2093.6579C300.771%2093.1695%20303.901%2091.3184%20303.753%2088.343C303.606%2085.3675%20303.753%2079.8369%20303.889%2078.4968C304.024%2076.1613%20303.81%2073.8188%20303.254%2071.5466C303.118%2071.0696%20301.519%2070.5699%20301.519%2070.5699C301.519%2070.5699%20299.829%2069.491%20295.1%2069.6954Z'%20fill='white'/%3e%3cpath%20d='M299.272%2069.0491C299.265%2069.0981%20299.265%2069.1478%20299.272%2069.1968C299.329%2069.5488%20299.51%2070.4573%20299.533%2070.8321C299.556%2071.2069%20299.159%2071.8201%20298.183%2071.7974C297.564%2071.8184%20296.949%2071.684%20296.394%2071.4063C295.839%2071.1286%20295.363%2070.7165%20295.008%2070.2075C295.027%2069.0696%20294.974%2067.9317%20294.849%2066.8005L299.272%2069.0491Z'%20fill='%23E16B40'/%3e%3cpath%20d='M294.976%2069.4673C295.233%2070.1558%20295.7%2070.7458%20296.31%2071.1536C296.921%2071.5613%20297.645%2071.766%20298.378%2071.7386H298.56L297.233%2073.8736C296.292%2073.3206%20295.403%2072.6819%20294.579%2071.9657C294.19%2071.4984%20293.984%2070.9048%20294.001%2070.2963L294.976%2069.4673Z'%20fill='white'/%3e%3cpath%20d='M298.55%2071.7878L299.933%2073.1165C300.275%2072.7255%20300.494%2072.2428%20300.565%2071.7281C300.635%2071.2134%20300.554%2070.6893%20300.33%2070.2206L299.468%2069.8799C299.481%2070.2487%20299.405%2070.6152%20299.245%2070.9476C299.084%2071.2801%20298.846%2071.5684%20298.55%2071.7878Z'%20fill='white'/%3e%3cpath%20d='M301.33%2062.379C300.809%2059.6421%20298.642%2058.0862%20296.193%2058.6541C295.393%2058.7607%20294.63%2059.0523%20293.963%2059.5057C293.295%2059.959%20292.743%2060.5617%20292.348%2061.2661C291.214%2063.6055%20292.904%2065.5702%20294.015%2066.8195C294.48%2067.3191%20294.832%2067.7166%20295.059%2067.9551C295.136%2068.0513%20295.219%2068.1424%20295.308%2068.2277C295.945%2068.8588%20296.723%2069.3297%20297.576%2069.6018C298.089%2069.777%20298.638%2069.8147%20299.169%2069.7111C299.7%2069.6075%20300.195%2069.3662%20300.604%2069.0113C301.308%2068.3299%20301.841%2065.1273%20301.33%2062.379Z'%20fill='%23FF8654'/%3e%3cpath%20d='M293.988%2070.3425C293.988%2070.3425%20293.274%2071.0353%20294.215%2072.7615C295.501%2075.2189%20296.211%2077.9377%20296.291%2080.7111C296.381%2083.9932%20296.812%2094.339%20296.381%2096.5535C295.519%2097.3258%20291.369%2096.633%20290.155%2094.5548C289.634%2091.5339%20289.894%2082.3464%20289.293%2080.4499C288.788%2078.3751%20288.757%2076.2128%20289.203%2074.1243C290.498%2072.5233%20292.132%2071.2314%20293.988%2070.3425Z'%20fill='%23113C7A'/%3e%3cpath%20d='M300.676%2070.2751C301.189%2072.3546%20301.421%2074.4935%20301.368%2076.6348C301.368%2080.0418%20302.343%2094.1807%20302.502%2094.4647C302.661%2094.7486%20304.702%2092.9656%20304.77%2090.8873C304.838%2088.8091%20304.078%2076.0557%20303.965%2074.7837C303.894%2073.5356%20303.618%2072.3077%20303.148%2071.1496C302.356%2070.7742%20301.528%2070.4812%20300.676%2070.2751Z'%20fill='%23113C7A'/%3e%3cpath%20d='M299.67%2072.4777L299.046%2073.795L297.742%2072.7616L298.547%2071.7849L299.67%2072.4777Z'%20fill='%23113C7A'/%3e%3cpath%20d='M299.333%2072.9654C299.333%2072.9654%20300.569%2088.7851%20300.569%2089.4778L299.741%2090.9315L298.607%2089.7958L298.199%2072.8745L299.333%2072.9654Z'%20fill='%23113C7A'/%3e%3cpath%20d='M289.442%2073.5905C288.618%2074.4566%20288.039%2075.5266%20287.764%2076.6908C287.015%2079.0303%20286.539%2087.1843%20286.539%2088.3995C286.539%2089.6146%20286.539%2091.0228%20287.571%2091.6815C287.794%2091.8623%20288.054%2091.9901%20288.333%2092.0553C288.613%2092.1206%20288.903%2092.1215%20289.182%2092.0581C289.462%2091.9947%20289.723%2091.8685%20289.947%2091.6892C290.171%2091.5099%20290.351%2091.282%20290.474%2091.0228C291.132%2089.8077%20291.608%2082.8688%20292.062%2080.7224C292.516%2078.576%20293.287%2076.4069%20292.345%2075.0441C292.079%2074.5241%20291.654%2074.1028%20291.131%2073.8414C290.609%2073.58%20290.018%2073.4921%20289.442%2073.5905Z'%20fill='%23113C7A'/%3e%3cpath%20d='M292.814%2059.0649C293.137%2058.5521%20293.577%2058.1231%20294.097%2057.8132C294.617%2057.5033%20295.204%2057.3212%20295.808%2057.282C297.963%2057.1002%20298.53%2057.8498%20299.46%2057.9406C300.39%2058.0315%20301.24%2057.5659%20301.898%2058.5993C302.556%2059.6328%20301.15%2061.5975%20301.15%2061.5975C301.15%2061.5975%20300.401%2061.4157%20299.653%2063.2896C298.904%2065.1634%20296.182%2064.6864%20295.626%2064.5047L295.162%2065.436V66.2877L294.504%2066.1855C294.504%2066.1855%20294.787%2065.1634%20294.13%2064.7887C293.472%2064.4139%20293.29%2065.1634%20293.381%2065.7199C293.705%2066.6813%20294.371%2067.4898%20295.252%2067.9912L294.969%2068.559L294.787%2068.9338C294.254%2068.5023%20293.754%2068.0316%20293.29%2067.5256C292.814%2066.9691%20292.156%2067.4347%20291.226%2065.3678C290.296%2063.3009%20290.569%2061.711%20291.408%2060.8252L292.258%2059.8826L292.814%2059.0649Z'%20fill='%2396432A'/%3e%3cpath%20d='M302.164%2090.5122L311.577%2099.5066L304.274%20103.584L294.872%2094.5892L302.164%2090.5122Z'%20fill='%23CBDCEB'/%3e%3cpath%20d='M300.032%2097.3015C300.032%2097.3015%20300.497%2097.6309%20300.735%2097.7785L302.277%2098.7552C302.687%2099.1897%20303.034%2099.6789%20303.309%20100.209C303.571%20100.636%20303.73%20101.118%20303.774%20101.617C303.684%20101.856%20303.4%20101.708%20303.4%20101.708C303.124%20102.018%20302.737%20102.206%20302.323%20102.23C301.767%20102.174%20301.291%20101.481%20301.291%20101.481L300.497%20100.777C300.174%20100.417%20299.92%20100.002%20299.748%2099.5501L299.193%2099.1754C299.193%2099.1754%20298.796%2098.7552%20300.032%2097.3015Z'%20fill='%23FF8654'/%3e%3cpath%20d='M298.31%2098.8821C298.31%2098.8821%20298.899%2097.2127%20299.603%2096.7925L300.396%2097.349C299.896%2097.9305%20299.542%2098.6237%20299.364%2099.3704L298.31%2098.8821Z'%20fill='white'/%3e%3cpath%20d='M298.311%2098.8837C297.811%2098.837%20297.33%2098.6736%20296.904%2098.4068C295.66%2097.4896%20294.357%2096.655%20293.003%2095.9083C291.184%2095.0735%20289.483%2094.0004%20287.945%2092.7171C287.077%2091.8788%20286.572%2090.733%20286.539%2089.5259C286.914%2089.0409%20287.44%2088.695%20288.034%2088.5428C288.627%2088.3906%20289.255%2088.4408%20289.816%2088.6855C291.66%2089.5661%20293.365%2090.7141%20294.875%2092.0925C296.553%2093.5007%20299.411%2096.2944%20299.411%2096.2944L299.898%2096.8736C299.51%2097.0812%20299.168%2097.3668%20298.895%2097.7127C298.622%2098.0586%20298.423%2098.4573%20298.311%2098.8837Z'%20fill='%23113C7A'/%3e%3cpath%20d='M304.84%2085.0278C304.766%2085.9753%20304.858%2086.9285%20305.113%2087.8442C305.543%2089.2524%20304.557%2094.0335%20304.976%2094.4537C305.302%2094.7787%20305.706%2095.0143%20306.149%2095.1376C306.592%2095.2609%20307.059%2095.2679%20307.505%2095.1578L308.345%2094.59C308.345%2094.59%20308.764%2089.8089%20308.764%2088.4007C308.764%2086.9925%20308.345%2083.0631%20307.369%2082.2227C306.394%2081.3823%20303.99%2082.0751%20304.84%2085.0278Z'%20fill='%23113569'/%3e%3cpath%20d='M305.328%2094.3081C305.687%2093.9832%20306.157%2093.809%20306.64%2093.8217C307.124%2093.8344%20307.584%2094.033%20307.925%2094.3762L307.993%2095.3643C307.993%2095.3643%20307.71%2096.2841%20305.396%2095.4324L305.328%2094.3081Z'%20fill='white'/%3e%3cpath%20d='M305.545%2095.1786C305.895%2094.9846%20306.292%2094.8905%20306.691%2094.9065C307.091%2094.9226%20307.479%2095.0481%20307.813%2095.2694L307.904%2095.6442C307.904%2095.6442%20308.21%2096.4846%20308.323%2096.8593C308.376%2097.182%20308.353%2097.5126%20308.255%2097.8247C308.236%2098.1817%20308.179%2098.5357%20308.085%2098.8808C307.994%2099.0398%20307.813%2098.9944%20307.643%2098.9717C307.141%2098.8111%20306.648%2098.6215%20306.168%2098.4038C305.794%2098.2448%20305.681%2097.4272%20305.613%2097.1432C305.567%2096.7129%20305.567%2096.2789%20305.613%2095.8486C305.62%2095.6232%20305.597%2095.3979%20305.545%2095.1786Z'%20fill='%23FF8654'/%3e%3cpath%20d='M329.925%2063.9153V65.4938C329.926%2065.7053%20329.871%2065.9132%20329.765%2066.0965C329.66%2066.2798%20329.508%2066.4321%20329.325%2066.5381C329.143%2066.644%20328.935%2066.6998%20328.724%2066.6999C328.513%2066.7%20328.305%2066.6444%20328.122%2066.5386L320.671%2062.2345C320.487%2062.1292%20320.333%2061.9773%20320.226%2061.794C320.118%2061.6106%20320.061%2061.4023%20320.059%2061.1897V59.6111C320.061%2059.3993%20320.118%2059.1916%20320.225%2059.0087C320.331%2058.8258%20320.484%2058.6741%20320.667%2058.5685C320.851%2058.4629%20321.059%2058.4071%20321.27%2058.4067C321.482%2058.4064%20321.69%2058.4614%20321.874%2058.5663L329.324%2062.8591C329.509%2062.9659%20329.662%2063.12%20329.768%2063.3056C329.873%2063.4912%20329.928%2063.7016%20329.925%2063.9153Z'%20fill='%23F9FBFC'/%3e%3cpath%20d='M353.526%2085.2874V86.8773C353.526%2087.0888%20353.471%2087.2967%20353.366%2087.48C353.26%2087.6633%20353.109%2087.8156%20352.926%2087.9215C352.743%2088.0274%20352.535%2088.0833%20352.324%2088.0834C352.113%2088.0835%20351.906%2088.0278%20351.723%2087.9221L320.671%2070.1263C320.486%2070.0192%20320.332%2069.8653%20320.225%2069.68C320.117%2069.4947%20320.06%2069.2844%20320.059%2069.0702V67.4916C320.059%2067.2788%20320.115%2067.0697%20320.221%2066.8852C320.326%2066.7008%20320.479%2066.5474%20320.663%2066.4405C320.846%2066.3335%20321.055%2066.2768%20321.267%2066.2759C321.48%2066.275%20321.689%2066.33%20321.874%2066.4354L352.925%2084.2653C353.105%2084.3692%20353.254%2084.5179%20353.36%2084.697C353.465%2084.8761%20353.522%2085.0795%20353.526%2085.2874Z'%20fill='%23F9FBFC'/%3e%3cg%20opacity='0.53'%3e%3cpath%20d='M340.735%2093.6676V95.2462C340.735%2095.459%20340.679%2095.6681%20340.573%2095.8525C340.467%2096.037%20340.315%2096.1904%20340.131%2096.2973C339.948%2096.4043%20339.739%2096.461%20339.527%2096.4619C339.314%2096.4628%20339.105%2096.4078%20338.92%2096.3024L320.673%2085.8202C320.49%2085.7144%20320.338%2085.5621%20320.232%2085.3786C320.127%2085.1952%20320.072%2084.9871%20320.072%2084.7754V83.1969C320.073%2082.9857%20320.129%2082.7785%20320.234%2082.5956C320.34%2082.4127%20320.491%2082.2604%20320.673%2082.1538C320.855%2082.0472%20321.061%2081.9899%20321.272%2081.9876C321.483%2081.9853%20321.691%2082.0381%20321.875%2082.1407L340.123%2092.6228C340.307%2092.7281%20340.461%2092.88%20340.568%2093.0634C340.676%2093.2467%20340.733%2093.4551%20340.735%2093.6676Z'%20fill='%23F9FBFC'/%3e%3c/g%3e%3cpath%20d='M348.722%2090.3889V91.9789C348.72%2092.1907%20348.663%2092.3984%20348.556%2092.5813C348.449%2092.7641%20348.296%2092.9159%20348.113%2093.0215C347.93%2093.1271%20347.722%2093.1829%20347.51%2093.1832C347.299%2093.1836%20347.091%2093.1286%20346.907%2093.0237L320.676%2077.9648C320.493%2077.859%20320.341%2077.7067%20320.235%2077.5232C320.13%2077.3398%20320.074%2077.1317%20320.075%2076.92V75.3301C320.074%2075.1186%20320.129%2074.9107%20320.235%2074.7274C320.34%2074.5441%20320.492%2074.3918%20320.675%2074.2859C320.857%2074.1799%20321.065%2074.1241%20321.276%2074.124C321.487%2074.1239%20321.695%2074.1795%20321.878%2074.2853L348.109%2089.3441C348.294%2089.4494%20348.447%2089.6013%20348.555%2089.7847C348.662%2089.968%20348.72%2090.1764%20348.722%2090.3889Z'%20fill='%23F9FBFC'/%3e%3cpath%20d='M365.824%2091.1697V112.384L350.729%20121.287'%20stroke='white'%20stroke-width='0.53'%20stroke-miterlimit='10'/%3e%3cpath%20d='M367.61%2089.6723C367.607%2090.0469%20367.494%2090.4125%20367.285%2090.7229C367.076%2091.0332%20366.779%2091.2746%20366.433%2091.4164C366.086%2091.5582%20365.706%2091.5941%20365.339%2091.5197C364.973%2091.4452%20364.636%2091.2637%20364.373%2090.998C364.109%2090.7323%20363.93%2090.3944%20363.857%2090.0268C363.785%2089.6592%20363.823%2089.2785%20363.967%2088.9326C364.111%2088.5867%20364.354%2088.2912%20364.665%2088.0833C364.976%2087.8754%20365.342%2087.7644%20365.716%2087.7644C365.965%2087.7644%20366.213%2087.8138%20366.443%2087.9098C366.674%2088.0059%20366.883%2088.1466%20367.059%2088.3239C367.235%2088.5012%20367.374%2088.7116%20367.469%2088.943C367.563%2089.1745%20367.611%2089.4223%20367.61%2089.6723V89.6723Z'%20stroke='white'%20stroke-width='1.06'%20stroke-miterlimit='10'/%3e%3cpath%20d='M715.132%2070.3542V91.5684L700.048%20100.472'%20stroke='white'%20stroke-width='0.53'%20stroke-miterlimit='10'/%3e%3cpath%20d='M715.031%2070.7535C716.077%2070.7535%20716.925%2069.9044%20716.925%2068.857C716.925%2067.8096%20716.077%2066.9604%20715.031%2066.9604C713.985%2066.9604%20713.137%2067.8096%20713.137%2068.857C713.137%2069.9044%20713.985%2070.7535%20715.031%2070.7535Z'%20stroke='white'%20stroke-width='1.06'%20stroke-miterlimit='10'/%3e%3cpath%20opacity='0.35'%20d='M501.346%20238.069C501.346%20242.305%20495.959%20245.723%20489.313%20245.723C482.668%20245.723%20477.281%20242.316%20477.281%20238.069C477.281%20233.822%20482.668%20230.415%20489.313%20230.415C495.959%20230.415%20501.346%20233.844%20501.346%20238.069Z'%20fill='%23A6D0F4'/%3e%3cpath%20opacity='0.35'%20d='M512.446%20235.683C524.353%20235.683%20534.005%20229.541%20534.005%20221.964C534.005%20214.387%20524.353%20208.245%20512.446%20208.245C500.539%20208.245%20490.887%20214.387%20490.887%20221.964C490.887%20229.541%20500.539%20235.683%20512.446%20235.683Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M496.12%20218.762C496.369%20221.59%20499.023%20223.509%20501.416%20224.531C504.044%20225.625%20506.872%20226.151%20509.717%20226.076C512.634%20226.086%20515.516%20225.446%20518.155%20224.202C520.423%20223.066%20522.839%20221.056%20522.827%20218.297C522.827%20220.307%20522.691%20221.965%20521.251%20223.532C519.245%20225.467%20516.697%20226.743%20513.947%20227.189C508.799%20228.256%20501.79%20227.745%20497.877%20223.782C496.301%20222.192%20496.086%20220.511%20496.086%20218.387C496.087%20218.513%20496.098%20218.638%20496.12%20218.762Z'%20fill='%23ADCDFC'/%3e%3cpath%20d='M500.033%20213.627C494.793%20216.648%20494.759%20221.576%20499.965%20224.597C505.17%20227.618%20513.653%20227.618%20518.892%20224.597C524.132%20221.576%20524.143%20216.648%20518.892%20213.627C513.642%20210.606%20505.306%20210.595%20500.033%20213.627Z'%20fill='white'/%3e%3cpath%20d='M508.03%20209.526L508.053%20220.678L509.459%20221.495L509.425%20210.343L508.03%20209.526Z'%20fill='%23C7D8F2'/%3e%3cpath%20d='M509.424%20210.343L509.458%20221.495L510.864%20220.678L510.842%20209.526L509.424%20210.343Z'%20fill='%237BAEFF'/%3e%3cpath%20d='M507.375%20207.494L509.428%20208.687L511.48%20207.494L509.439%20206.313L507.375%20207.494Z'%20fill='%234DA5DC'/%3e%3cpath%20d='M522.735%20169.54C522.735%20169.54%20526.942%20172.016%20528.065%20174.537C529.188%20177.058%20528.881%20194.729%20523.007%20202.565C517.132%20210.401%20506.245%20211.514%20503.727%20210.401C501.21%20209.288%20486.716%20201.997%20485.582%20198.363C484.448%20194.729%20490.118%20191.924%20493.135%20190.527C496.152%20189.13%20498.159%20187.177%20499.837%20182.135C501.516%20177.092%20502.355%20168.427%20504.306%20167.019C506.256%20165.611%20510.974%20163.385%20522.735%20169.54Z'%20fill='black'/%3e%3cpath%20d='M501.9%20207.903C499.859%20206.994%20489.822%20201.986%20485.581%20198.204C484.673%20194.638%20490.117%20191.913%20493.156%20190.527C496.196%20189.142%20498.18%20187.177%20499.859%20182.135C501.537%20177.092%20502.376%20168.427%20504.327%20167.019C506.278%20165.611%20511.041%20163.385%20522.779%20169.54C524.031%20170.305%20525.204%20171.191%20526.283%20172.186C527.349%20175.116%20526.963%20192.356%20521.191%20200.067C515.418%20207.778%20504.372%20209.027%20501.9%20207.903Z'%20fill='%23232839'/%3e%3cpath%20d='M500.764%20171.451C500.764%20171.451%20499.517%20171.883%20498.587%20174.995C497.657%20178.106%20495.003%20183.728%20495.944%20186.215C496.885%20188.702%20499.675%20187.35%20500.48%20185.431C501.286%20183.512%20504.359%20174.904%20503.735%20173.62C503.112%20172.337%20502.012%20171.02%20500.764%20171.451Z'%20fill='%23113569'/%3e%3cpath%20d='M493.169%20235.204C492.983%20235.885%20492.725%20236.544%20492.398%20237.169C491.854%20238.225%20489.869%20239.633%20488.996%20240.349C488.123%20241.064%20487.125%20242.393%20487.238%20243.029C487.352%20243.665%20489.359%20243.824%20490.947%20243.472C492.534%20243.12%20493.918%20241.36%20494.349%20241.394C494.78%20241.428%20496.617%20241.098%20496.912%20240.497C497.207%20239.895%20496.674%20237.51%20496.674%20237.51V235.784L493.169%20235.204Z'%20fill='%23232839'/%3e%3cpath%20d='M485.391%20230.256C485.205%20230.937%20484.946%20231.596%20484.619%20232.221C484.075%20233.277%20482.09%20234.685%20481.217%20235.401C480.344%20236.116%20479.346%20237.445%20479.448%20238.081C479.55%20238.717%20481.58%20238.865%20483.168%20238.524C484.756%20238.183%20486.139%20236.412%20486.57%20236.446C487.001%20236.48%20488.782%20236.139%20489.133%20235.549C489.485%20234.958%20488.895%20232.562%20488.895%20232.562V230.836L485.391%20230.256Z'%20fill='%23232839'/%3e%3cpath%20d='M514.883%20195.924C514.944%20198.055%20514.368%20200.155%20513.227%20201.955C511.356%20204.658%20503.678%20211.517%20502.85%20212.176C502.022%20212.834%20501.807%20217.366%20500.979%20219.444C500.151%20221.522%20497.667%20235.025%20497.248%20236.07C497.248%20236.07%20496.828%20237.104%20493.925%20236.479C492.269%20236.274%20492.065%20235.65%20492.065%20235.65C492.065%20235.65%20493.097%20220.489%20493.925%20216.946C494.753%20213.402%20494.968%20209.473%20496.42%20208.019C497.871%20206.566%20504.925%20197.424%20504.925%20197.424L506.581%20194.721L514.883%20195.924Z'%20fill='%23113C7A'/%3e%3cpath%20d='M502.023%20192.609C502.023%20192.609%20490.818%20198.844%20489.253%20200.241C487.765%20201.546%20486.732%20203.292%20486.304%20205.226C486.179%20205.919%20485.057%20230.006%20484.592%20231.097C484.433%20232.039%20487.393%20232.652%20488.788%20232.232C489.34%20231.859%20489.817%20231.385%20490.194%20230.835C490.194%20230.835%20492.995%20216.344%20492.995%20214.312C493.253%20211.59%20493.67%20208.887%20494.243%20206.214L507.16%20198.889L508.09%20195.607L502.023%20192.609Z'%20fill='%23113C7A'/%3e%3cpath%20d='M514.479%20198.058C514.479%20198.058%20513.345%20201.181%20508.876%20200.704L507.311%20200.397L507.005%20197.899C505.435%20197.694%20503.939%20197.105%20502.65%20196.184C502.027%20196.502%20501.868%20198.058%20501.244%20198.217C500.62%20198.376%20499.532%20196.184%20499.849%20194.628C500.167%20193.073%20500.983%20193.697%20500.983%20193.697C500.983%20193.697%20513.696%20196.809%20514.479%20198.058Z'%20fill='%23112C5C'/%3e%3cpath%20d='M509.703%20169.839C509.703%20169.839%20515.033%20173.644%20515.555%20174.916C516.198%20177.281%20516.039%20179.794%20515.101%20182.059C513.967%20184.41%20514.409%20193.064%20513.967%20194.756C513.525%20196.448%20509.011%20197.027%20506.187%20196.436C503.363%20195.846%20499.961%20193.847%20500.063%20190.554C500.165%20187.26%20500.063%20181.116%20499.927%20179.64C499.769%20177.049%20500.006%20174.449%20500.63%20171.929C500.766%20171.407%20502.547%20170.85%20502.547%20170.85C502.547%20170.85%20504.452%20169.612%20509.703%20169.839Z'%20fill='%23C7BFCE'/%3e%3cpath%20d='M505.075%20169.122C505.082%20169.179%20505.082%20169.236%20505.075%20169.293C505.018%20169.679%20504.825%20170.678%20504.78%20171.098C504.734%20171.518%20505.199%20172.234%20506.277%20172.166C507.354%20172.098%20509.191%20171.689%20509.804%20170.406C509.776%20169.135%20509.837%20167.864%20509.985%20166.601L505.075%20169.122Z'%20fill='%23E16B40'/%3e%3cpath%20d='M509.84%20169.586C509.561%20170.356%20509.048%20171.018%20508.372%20171.479C507.696%20171.94%20506.892%20172.175%20506.075%20172.153H505.882L507.345%20174.515C508.388%20173.904%20509.371%20173.197%20510.282%20172.402C510.714%20171.884%20510.944%20171.226%20510.929%20170.551L509.84%20169.586Z'%20fill='white'/%3e%3cpath%20d='M505.891%20172.155L504.348%20173.62C504.348%20173.62%20503.214%20172.666%20503.906%20170.429L504.859%20170.043C504.842%20170.453%20504.928%20170.861%20505.108%20171.23C505.288%20171.598%20505.557%20171.916%20505.891%20172.155Z'%20fill='white'/%3e%3cpath%20d='M502.807%20161.739C503.374%20158.696%20505.778%20156.97%20508.478%20157.606C509.364%20157.723%20510.211%20158.046%20510.952%20158.549C511.692%20159.051%20512.305%20159.72%20512.742%20160.502C514.046%20163.091%20512.129%20165.271%20510.893%20166.646C510.372%20167.213%20509.975%20167.645%20509.759%20167.929L509.487%20168.235C508.783%20168.942%20507.919%20169.467%20506.969%20169.769C506.403%20169.963%20505.796%20170.005%20505.208%20169.889C504.621%20169.774%20504.074%20169.505%20503.624%20169.11C502.83%20168.326%20502.24%20164.772%20502.807%20161.739Z'%20fill='%23FF8654'/%3e%3cpath%20d='M510.973%20170.552C510.973%20170.552%20511.767%20171.313%20510.712%20173.244C509.301%20175.976%20508.525%20178.992%20508.444%20182.068C508.353%20185.713%20507.877%20197.138%20508.354%20199.636C509.306%20200.499%20513.911%20199.727%20515.249%20197.433C515.827%20194.026%20515.544%20183.896%20516.213%20181.784C516.77%20179.485%20516.801%20177.089%20516.303%20174.777C515.759%20173.72%20512.107%20170.836%20510.973%20170.552Z'%20fill='%23113C7A'/%3e%3cpath%20d='M503.521%20170.486C502.951%20172.788%20502.691%20175.156%20502.75%20177.527C502.75%20181.309%20501.673%20196.981%20501.48%20197.299C501.287%20197.617%20499.053%20195.641%20498.985%20193.336C498.917%20191.03%20499.756%20176.891%20499.881%20175.483C499.954%20174.099%20500.257%20172.736%20500.777%20171.452C501.655%20171.034%20502.575%20170.711%20503.521%20170.486Z'%20fill='%23113C7A'/%3e%3cpath%20d='M504.631%20172.927L505.323%20174.38L506.775%20173.233L505.89%20172.154L504.631%20172.927Z'%20fill='%23113C7A'/%3e%3cpath%20d='M505.02%20173.472C505.02%20173.472%20503.648%20191.018%20503.648%20191.779L504.566%20193.392L505.791%20192.086L506.245%20173.325L505.02%20173.472Z'%20fill='%23113C7A'/%3e%3cpath%20d='M429.925%20232.455L427.396%20230.979L427.327%20201.997L429.856%20203.473L429.925%20232.455Z'%20fill='%238750CA'/%3e%3cpath%20d='M429.857%20203.473L427.327%20201.997L461.77%20182.078L464.31%20183.554L429.857%20203.473Z'%20fill='%23DBDBDB'/%3e%3cpath%20d='M464.311%20183.557L464.379%20212.539L429.925%20232.458L429.857%20203.476L464.311%20183.557Z'%20fill='%239966D7'/%3e%3cpath%20d='M432.321%20197.968L432.253%20226.95L501.296%20266.562L501.364%20237.58L432.321%20197.968Z'%20fill='%23A478D9'/%3e%3cpath%20d='M432.28%20214.174L501.334%20253.785L501.368%20237.58L432.325%20197.968L432.28%20214.174Z'%20fill='%238750CA'/%3e%3cpath%20d='M499.169%20269.379L496.629%20267.903L496.561%20238.921L499.101%20240.397L499.169%20269.379Z'%20fill='%238750CA'/%3e%3cpath%20d='M499.101%20240.396L496.561%20238.92L531.014%20219L533.543%20220.477L499.101%20240.396Z'%20fill='%23DBDBDB'/%3e%3cpath%20d='M533.54%20220.477L533.62%20249.459L499.166%20269.379L499.098%20240.397L533.54%20220.477Z'%20fill='%23976EC9'/%3e%3cpath%20d='M538.269%20219.725L538.258%20222.45L499.2%20245.175L499.211%20242.449L538.269%20219.725Z'%20fill='%238C57CC'/%3e%3cpath%20d='M499.209%20242.452L499.198%20245.178L421.558%20200.296L421.57%20197.571L499.209%20242.452Z'%20fill='%238750CA'/%3e%3cpath%20d='M538.271%20219.725L499.213%20242.45L421.573%20197.569L460.631%20174.833L538.271%20219.725Z'%20fill='%23B59AD7'/%3e%3cpath%20d='M515.975%20174.164C516.891%20175.111%20517.537%20176.288%20517.846%20177.571C518.674%20180.171%20519.195%20189.2%20519.195%20190.551C519.195%20191.903%20519.195%20193.47%20518.061%20194.197C517.814%20194.394%20517.526%20194.533%20517.218%20194.603C516.91%20194.674%20516.591%20194.674%20516.283%20194.604C515.974%20194.534%20515.686%20194.396%20515.438%20194.2C515.191%20194.004%20514.99%20193.754%20514.852%20193.47C514.126%20192.118%20513.604%20184.385%20513.083%20182.034C512.561%20179.683%20511.733%20177.253%20512.777%20175.697C513.081%20175.137%20513.554%20174.688%20514.128%20174.412C514.702%20174.137%20515.348%20174.05%20515.975%20174.164Z'%20fill='%23113C7A'/%3e%3cpath%20d='M504.164%20200.444C504.164%20200.444%20503.643%20200.807%20503.382%20200.966L501.669%20202.102C501.213%20202.58%20500.831%20203.123%20500.535%20203.714C500.238%20204.183%20500.058%20204.717%20500.014%20205.27C500.116%20205.531%20500.433%20205.372%20500.433%20205.372C500.74%20205.713%20501.167%20205.921%20501.624%20205.952C502.248%20205.895%20502.758%20205.123%20502.758%20205.123L503.643%20204.339C503.999%20203.943%20504.279%20203.485%20504.471%20202.987L505.094%20202.567C505.094%20202.567%20505.593%20202.056%20504.164%20200.444Z'%20fill='%23FF8654'/%3e%3cpath%20d='M506.141%20202.194C506.141%20202.194%20505.495%20200.343%20504.723%20199.923L503.839%20200.548C504.394%20201.202%20504.783%20201.981%20504.973%20202.819L506.141%20202.194Z'%20fill='white'/%3e%3cpath%20d='M506.146%20202.194C506.701%20202.144%20507.236%20201.965%20507.711%20201.672C509.092%20200.65%20510.539%20199.72%20512.043%20198.89C514.059%20197.967%20515.943%20196.779%20517.645%20195.358C518.603%20194.428%20519.161%20193.161%20519.199%20191.826C518.785%20191.287%20518.202%20190.902%20517.545%20190.734C516.887%20190.565%20516.192%20190.622%20515.57%20190.895C513.527%20191.854%20511.639%20193.113%20509.967%20194.631C508.096%20196.187%20504.909%20199.287%20504.909%20199.287L504.365%20199.934C504.805%20200.164%20505.19%20200.484%20505.497%20200.873C505.804%20201.263%20506.025%20201.713%20506.146%20202.194Z'%20fill='%23113C7A'/%3e%3cpath%20d='M502.908%20161.207C502.625%20160.774%20502.43%20160.289%20502.337%20159.78C502.243%20159.271%20502.252%20158.748%20502.364%20158.243C502.794%20156.71%20504.768%20157.368%20505.868%20157.255C506.968%20157.141%20511.232%20157.255%20512.672%20159.117C514.113%20160.98%20513.444%20161.865%20513.444%20161.865C513.557%20162.754%20513.444%20163.656%20513.115%20164.489C512.559%20165.693%20509.78%20167.896%20509.78%20167.896C510.514%20167.003%20511.086%20165.988%20511.47%20164.898C511.584%20163.91%20511.028%20163.365%20510.699%20163.58C510.37%20163.796%20510.155%20165.659%20510.155%20165.659L510.007%20166.567C509.281%20166.317%20509.497%20164.784%20509.497%20164.784C509.153%20164.282%20508.896%20163.725%20508.737%20163.137C508.51%20162.263%20508.408%20161.831%20507.524%20161.389C506.859%20160.904%20506.065%20160.628%20505.243%20160.595C504.422%20160.563%20503.609%20160.776%20502.908%20161.207Z'%20fill='%23505E83'/%3e%3cpath%20d='M484.475%20177.56C484.475%20177.56%20483.92%20177.265%20483.659%20177.094C483.398%20176.924%20482.4%20176.333%20481.912%20176.061C481.282%20175.859%20480.624%20175.756%20479.962%20175.754C479.41%20175.706%20478.855%20175.788%20478.34%20175.993C478.158%20176.209%20478.442%20176.413%20478.442%20176.413C478.266%20176.838%20478.266%20177.316%20478.442%20177.742C478.763%20178.105%20479.208%20178.336%20479.689%20178.389L480.824%20178.821C481.335%20178.967%20481.871%20179.013%20482.4%20178.957L483.046%20179.332C483.046%20179.332%20483.659%20179.536%20484.475%20177.56Z'%20fill='%23FF8654'/%3e%3cpath%20d='M483.761%20180.083C483.761%20180.083%20485.111%20178.675%20485.179%20177.812L484.226%20177.301C483.899%20178.084%20483.394%20178.78%20482.752%20179.334L483.761%20180.083Z'%20fill='white'/%3e%3cpath%20d='M483.754%20180.082C484.039%20180.544%20484.427%20180.932%20484.888%20181.217C486.42%20181.998%20487.901%20182.875%20489.323%20183.841C491.051%20185.227%20492.958%20186.373%20494.993%20187.248C496.254%20187.688%20497.637%20187.619%20498.849%20187.055C499.143%20186.442%20499.225%20185.749%20499.081%20185.084C498.937%20184.42%20498.576%20183.822%20498.055%20183.387C496.274%20181.992%20494.299%20180.867%20492.192%20180.048C489.924%20179.082%20485.773%20177.617%20485.773%20177.617L484.956%20177.424C484.955%20177.927%20484.847%20178.424%20484.64%20178.882C484.433%20179.34%20484.131%20179.749%20483.754%20180.082Z'%20fill='%23113569'/%3e%3cpath%20d='M501.324%20223.795L509.206%20228.383L521.964%20221.002L514.082%20216.414L501.324%20223.795Z'%20fill='%238C57CC'/%3e%3cpath%20d='M499.872%20221.066V223.02L507.765%20227.608L507.754%20225.654L499.872%20221.066Z'%20fill='%23CBDCEB'/%3e%3cpath%20d='M507.752%20225.656L507.763%20227.609L520.521%20220.228V218.274L507.752%20225.656Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M499.872%20221.065L507.754%20225.653L520.523%20218.271L512.63%20213.683L499.872%20221.065Z'%20fill='white'/%3e%3cpath%20d='M447.361%20200.377L455.254%20204.965L468.013%20197.594L460.12%20192.995L447.361%20200.377Z'%20fill='%238C57CC'/%3e%3cpath%20d='M445.913%20197.652L445.924%20199.605L453.806%20204.193V202.24L445.913%20197.652Z'%20fill='%23CBDCEB'/%3e%3cpath%20d='M453.801%20202.236V204.189L466.571%20196.818L466.559%20194.854L453.801%20202.236Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M445.913%20197.654L453.806%20202.242L466.564%20194.86L458.682%20190.272L445.913%20197.654Z'%20fill='white'/%3e%3cpath%20d='M490.068%20214.659L497.961%20219.247L510.719%20211.865L502.837%20207.277L490.068%20214.659Z'%20fill='white'/%3e%3cpath%20d='M496.942%20205.938C498.746%20206.983%20498.746%20208.663%20496.942%20209.708L485.397%20216.42C484.39%20216.935%20483.274%20217.204%20482.142%20217.204C481.011%20217.204%20479.895%20216.935%20478.888%20216.42L467.275%20209.708C465.471%20208.663%20465.46%20206.971%20467.275%20205.938L478.82%20199.215C479.825%20198.699%20480.939%20198.431%20482.069%20198.431C483.199%20198.431%20484.312%20198.699%20485.318%20199.215L496.942%20205.938Z'%20fill='%238C57CC'/%3e%3cpath%20d='M486.649%20207.686C486.634%20207.719%20486.615%20207.749%20486.592%20207.777L486.512%20207.856H486.456L486.376%20207.913L481.591%20210.571L476.419%20207.584V207.947L481.591%20210.934L486.376%20208.265H486.433H486.49L486.547%20208.208C486.547%20208.208%20486.547%20208.208%20486.547%20208.152V208.061V207.538C486.594%20207.577%20486.629%20207.628%20486.649%20207.686Z'%20fill='%23BAC0D2'/%3e%3cpath%20d='M486.392%20207.21C486.767%20207.426%20486.755%20207.766%20486.392%20207.982L481.606%20210.64L476.435%20207.653L480.484%20204.575C480.69%20204.466%20480.92%20204.409%20481.153%20204.409C481.386%20204.409%20481.616%20204.466%20481.822%20204.575L486.392%20207.21Z'%20fill='white'/%3e%3cpath%20d='M493.476%20195.894C493.905%20196.175%20494.21%20196.61%20494.327%20197.109L496.799%20213.78C496.867%20214.212%20496.584%20214.382%20496.187%20214.144L470.931%20199.585C470.499%20199.307%20470.193%20198.871%20470.08%20198.37L467.608%20181.698C467.54%20181.267%20467.812%20181.096%20468.22%20181.335L493.476%20195.894Z'%20fill='%23C7C9D7'/%3e%3cpath%20d='M497.204%20213.625V213.5L494.72%20196.829V196.658V196.522V196.374L494.641%20196.272L469.385%20181.656H468.976H468.908L468.511%20181.952H468.591C468.628%20181.946%20468.667%20181.946%20468.704%20181.952H468.84C468.897%20181.964%20468.951%20181.987%20468.999%20182.02L494.255%20196.636L494.403%20196.738L494.55%20196.863L494.686%20197.01L494.8%20197.169L494.902%20197.34L494.992%20197.51C494.997%20197.571%20494.997%20197.631%20494.992%20197.692C494.997%20197.745%20494.997%20197.798%20494.992%20197.851L497.465%20214.522C497.47%20214.568%20497.47%20214.613%20497.465%20214.658C497.47%20214.696%20497.47%20214.734%20497.465%20214.772C497.47%20214.795%20497.47%20214.818%20497.465%20214.84C497.444%20214.875%20497.417%20214.906%20497.385%20214.931L497.794%20214.636C497.825%20214.614%20497.849%20214.582%20497.862%20214.545V214.454L497.204%20213.625Z'%20fill='white'/%3e%3cpath%20opacity='0.2'%20d='M479.477%20205.318L476.415%20207.658L481.587%20210.645L485.204%20208.634L479.477%20205.318Z'%20fill='%23777DB2'/%3e%3cpath%20d='M482.675%20200.386L481.586%20211.028L476.404%20208.029L478.422%20198.058L482.675%20200.386Z'%20fill='%23BAC0D2'/%3e%3cpath%20d='M497.444%20233.936L500.313%20232.346L496.264%20230.245L497.444%20233.936Z'%20fill='%238C57CC'/%3e%3cpath%20d='M498.329%20229.19L499.123%20228.906L498.238%20233.653L497.445%20233.937L498.329%20229.19Z'%20fill='%23656874'/%3e%3cpath%20d='M485.4%20221.944L486.182%20221.66L499.122%20228.905L498.328%20229.189L485.4%20221.944Z'%20fill='%239C9EA6'/%3e%3cpath%20d='M498.329%20229.189L497.444%20233.936L484.516%20226.69L485.4%20221.943L498.329%20229.189Z'%20fill='%23232839'/%3e%3cpath%20d='M452.76%20189.871C453.894%20190.507%20453.894%20191.529%20452.76%20192.143C452.147%20192.456%20451.469%20192.619%20450.781%20192.619C450.093%20192.619%20449.415%20192.456%20448.802%20192.143C448.572%20192.055%20448.374%20191.9%20448.235%20191.697C448.095%20191.494%20448.02%20191.253%20448.02%20191.007C448.02%20190.761%20448.095%20190.52%20448.235%20190.317C448.374%20190.115%20448.572%20189.959%20448.802%20189.871C449.414%20189.556%20450.093%20189.391%20450.781%20189.391C451.47%20189.391%20452.148%20189.556%20452.76%20189.871Z'%20fill='%238C57CC'/%3e%3cpath%20d='M453.137%20184.219V190.442C453.116%20190.67%20453.034%20190.888%20452.9%20191.074C452.767%20191.26%20452.586%20191.406%20452.377%20191.498C451.806%20191.789%20451.175%20191.941%20450.534%20191.941C449.893%20191.941%20449.262%20191.789%20448.691%20191.498C448.48%20191.405%20448.297%20191.257%20448.161%20191.069C448.026%20190.882%20447.942%20190.661%20447.92%20190.431V184.196C447.938%20184.429%20448.02%20184.653%20448.156%20184.843C448.291%20185.033%20448.477%20185.183%20448.691%20185.275C449.262%20185.566%20449.893%20185.718%20450.534%20185.718C451.175%20185.718%20451.806%20185.566%20452.377%20185.275C452.586%20185.183%20452.767%20185.036%20452.9%20184.85C453.034%20184.665%20453.116%20184.447%20453.137%20184.219Z'%20fill='white'/%3e%3cpath%20d='M452.321%20183.137C453.342%20183.727%20453.353%20184.681%20452.321%20185.272C451.751%20185.563%20451.119%20185.715%20450.479%20185.715C449.838%20185.715%20449.206%20185.563%20448.636%20185.272C447.615%20184.681%20447.604%20183.727%20448.636%20183.137C449.206%20182.846%20449.838%20182.694%20450.479%20182.694C451.119%20182.694%20451.751%20182.846%20452.321%20183.137Z'%20fill='%23CBDCEB'/%3e%3cpath%20d='M451.925%20183.375C452.098%20183.434%20452.249%20183.545%20452.356%20183.694C452.463%20183.842%20452.52%20184.021%20452.52%20184.204C452.52%20184.387%20452.463%20184.566%20452.356%20184.715C452.249%20184.864%20452.098%20184.975%20451.925%20185.033C451.479%20185.262%20450.986%20185.382%20450.485%20185.382C449.984%20185.382%20449.49%20185.262%20449.044%20185.033C448.871%20184.975%20448.72%20184.864%20448.613%20184.715C448.506%20184.566%20448.449%20184.387%20448.449%20184.204C448.449%20184.021%20448.506%20183.842%20448.613%20183.694C448.72%20183.545%20448.871%20183.434%20449.044%20183.375C449.489%20183.144%20449.983%20183.024%20450.485%20183.024C450.986%20183.024%20451.48%20183.144%20451.925%20183.375Z'%20fill='%238C57CC'/%3e%3cpath%20d='M448.471%20184.387C447.988%20182.685%20447.397%20181.016%20446.701%20179.39C446.701%20178.811%20447.904%20179.503%20448.357%20180.582C448.747%20181.722%20449.043%20182.892%20449.242%20184.08C449.242%20184.08%20449.162%20178.504%20450.126%20177.266C450.739%20177.425%20450.365%20183.546%20450.285%20184.012C450.285%20184.012%20452.202%20179.924%20453.472%20179.083C454.05%20179.151%20451.623%20184.194%20451.623%20184.194C451.917%20183.646%20452.317%20183.163%20452.8%20182.773C453.283%20182.383%20453.839%20182.094%20454.436%20181.922C453.824%20182.822%20453.158%20183.683%20452.44%20184.5C452.151%20184.839%20451.776%20185.092%20451.355%20185.234C450.933%20185.376%20450.481%20185.401%20450.047%20185.307C449.73%20185.292%20449.421%20185.2%20449.146%20185.04C448.872%20184.88%20448.64%20184.656%20448.471%20184.387Z'%20fill='%234CA15C'/%3e%3cpath%20d='M562.062%20231.844C564.762%20233.411%20564.773%20235.933%20562.062%20237.523C560.558%20238.292%20558.892%20238.693%20557.203%20238.693C555.513%20238.693%20553.848%20238.292%20552.343%20237.523C549.644%20235.978%20549.633%20233.446%20552.343%20231.844C553.848%20231.076%20555.514%20230.675%20557.203%20230.675C558.892%20230.675%20560.558%20231.076%20562.062%20231.844Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M562.872%20217.955V233.241C562.822%20233.8%20562.625%20234.335%20562.3%20234.792C561.975%20235.249%20561.534%20235.612%20561.023%20235.841C559.619%20236.56%20558.064%20236.935%20556.487%20236.935C554.91%20236.935%20553.355%20236.56%20551.95%20235.841C551.43%20235.609%20550.98%20235.241%20550.649%20234.775C550.318%20234.31%20550.117%20233.764%20550.068%20233.195V217.909C550.119%20218.478%20550.32%20219.023%20550.651%20219.488C550.982%20219.953%20551.43%20220.322%20551.95%20220.555C553.354%20221.276%20554.909%20221.652%20556.487%20221.652C558.064%20221.652%20559.619%20221.276%20561.023%20220.555C561.534%20220.325%20561.974%20219.962%20562.298%20219.505C562.623%20219.048%20562.821%20218.513%20562.872%20217.955Z'%20fill='%23CBDCEB'/%3e%3cpath%20d='M560.975%20215.31C563.493%20216.764%20563.504%20219.114%20560.975%20220.557C559.571%20221.277%20558.016%20221.653%20556.439%20221.653C554.861%20221.653%20553.306%20221.277%20551.902%20220.557C549.396%20219.103%20549.385%20216.752%20551.902%20215.31C553.306%20214.588%20554.861%20214.211%20556.439%20214.211C558.016%20214.211%20559.572%20214.588%20560.975%20215.31Z'%20fill='white'/%3e%3cpath%20d='M559.976%20215.889C561.938%20217.024%20561.949%20218.853%20559.976%20219.977C558.883%20220.532%20557.674%20220.821%20556.449%20220.821C555.223%20220.821%20554.015%20220.532%20552.922%20219.977C550.971%20218.841%20550.96%20217.013%20552.922%20215.889C554.015%20215.332%20555.223%20215.042%20556.449%20215.042C557.675%20215.042%20558.883%20215.332%20559.976%20215.889Z'%20fill='%23713336'/%3e%3cpath%20d='M551.538%20218.388C551.538%20218.388%20548.328%20207.701%20547.194%20206.1C547.194%20204.68%20550.12%20206.384%20551.254%20209.03C552.211%20211.836%20552.939%20214.715%20553.432%20217.638C553.432%20217.638%20553.239%20203.92%20555.598%20200.899C557.106%20201.273%20556.165%20216.31%20555.983%20217.445C555.983%20217.445%20560.701%20207.417%20563.82%20205.339C565.226%20205.532%20559.284%20217.911%20559.284%20217.911C559.284%20217.911%20561.733%20213.289%20566.179%20212.437C564.671%20214.643%20563.031%20216.755%20561.268%20218.763C561.268%20218.763%20559.658%20221.227%20555.416%20220.75C555.416%20220.75%20552.479%20220.568%20551.538%20218.388Z'%20fill='%234CA15C'/%3e%3cpath%20opacity='0.35'%20d='M428.648%20256.795C428.648%20263.609%20437.358%20269.173%20448.097%20269.173C458.837%20269.173%20467.547%20263.631%20467.547%20256.795C467.547%20249.958%20458.837%20244.427%20448.097%20244.427C437.358%20244.427%20428.648%20249.958%20428.648%20256.795Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M456.241%20259.475C456.241%20259.475%20455.47%20262.564%20455.935%20263.189C456.315%20263.558%20456.784%20263.824%20457.297%20263.959C457.809%20264.094%20458.348%20264.095%20458.861%20263.961C459.652%20263.615%20460.306%20263.016%20460.721%20262.258C461.912%20261.589%20463.004%20260.755%20463.964%20259.782C464.143%20259.534%20464.239%20259.236%20464.239%20258.93C464.239%20258.624%20464.143%20258.326%20463.964%20258.078C463.084%20257.992%20462.196%20258.046%20461.333%20258.237C460.284%20258.536%20459.254%20258.896%20458.248%20259.316L456.241%20259.475Z'%20fill='%23232839'/%3e%3cpath%20d='M448.361%20255.136C448.361%20255.136%20447.59%20258.237%20448.055%20258.85C448.433%20259.223%20448.902%20259.491%20449.415%20259.627C449.929%20259.762%20450.469%20259.761%20450.981%20259.622C451.772%20259.276%20452.426%20258.677%20452.841%20257.919C454.033%20257.25%20455.125%20256.417%20456.085%20255.443C456.264%20255.195%20456.36%20254.897%20456.36%20254.591C456.36%20254.285%20456.264%20253.987%20456.085%20253.74C455.205%20253.66%20454.318%20253.714%20453.453%20253.899C452.403%20254.213%20451.373%20254.592%20450.369%20255.034L448.361%20255.136Z'%20fill='%23232839'/%3e%3cpath%20d='M472.03%20209.904L462.31%20219.841L452.864%20217.388L462.583%20207.451L472.03%20209.904Z'%20fill='white'/%3e%3cpath%20d='M461.593%20210.515L462.523%20210.867C462.912%20210.584%20463.363%20210.398%20463.838%20210.323C464.313%20210.248%20464.799%20210.286%20465.256%20210.435L466.027%20209.799C465.284%20209.561%20464.495%20209.501%20463.725%20209.625C462.954%20209.75%20462.224%20210.054%20461.593%20210.515Z'%20fill='%23E2EDFF'/%3e%3cpath%20d='M461.47%20210.605C460.563%20211.412%20460.62%20212.365%20461.538%20212.933L462.332%20212.275C461.913%20211.923%20461.924%20211.412%20462.4%20210.957L461.47%20210.605Z'%20fill='%23E2EDFF'/%3e%3cpath%20d='M461.661%20213.004L461.967%20213.141C462.702%20213.372%20463.48%20213.431%20464.241%20213.313C465.002%20213.195%20465.726%20212.903%20466.356%20212.459L465.426%20212.107C465.037%20212.373%20464.593%20212.547%20464.128%20212.616C463.662%20212.685%20463.187%20212.647%20462.738%20212.505L462.443%20212.357L461.661%20213.004Z'%20fill='%233EABFF'/%3e%3cpath%20d='M465.441%20210.516C466.099%20210.857%20466.156%20211.493%20465.555%20212.015L466.485%20212.367C467.505%20211.493%20467.381%20210.414%20466.224%20209.869L465.441%20210.516Z'%20fill='%233EABFF'/%3e%3cpath%20d='M454.053%20241.784C453.679%20244.838%20452.148%20252.856%20451.898%20255.65C451.898%20255.65%20451.263%20256.672%20449.358%20256.422L448.451%20256.036C448.273%20255.966%20448.124%20255.839%20448.027%20255.674C447.93%20255.509%20447.892%20255.317%20447.918%20255.128C448.277%20252.562%20448.417%20249.971%20448.337%20247.382C448.152%20245.793%20448.326%20244.182%20448.848%20242.669C448.779%20241.715%20448.655%20238.411%20450.56%20237.525C450.56%20237.525%20455.232%20236.662%20454.053%20241.784Z'%20fill='%23113569'/%3e%3cpath%20d='M450.171%20238.92L450.681%20239.93C450.681%20239.93%20458.495%20240.316%20460.593%20242.611C461.338%20242.936%20461.951%20243.506%20462.33%20244.226C462.709%20244.946%20462.833%20245.774%20462.68%20246.574C462.294%20249.629%20459.709%20256.988%20459.448%20259.793C459.448%20259.793%20458.813%20260.804%20456.907%20260.554L456.011%20260.179C455.833%20260.106%20455.683%20259.977%20455.585%20259.811C455.487%20259.645%20455.445%20259.451%20455.467%20259.259C455.825%20256.694%20455.969%20254.103%20455.898%20251.514C455.707%20249.928%20455.881%20248.32%20456.408%20246.812C453.973%20247.309%20451.588%20248.032%20449.286%20248.97C445.601%20250.503%20442.425%20248.72%20441.03%20247.948C440.34%20247.607%20439.696%20247.18%20439.114%20246.676C437.859%20246.591%20436.665%20246.101%20435.711%20245.279C434.056%20243.882%20433.806%20240.192%20435.587%20238.022C437.367%20235.853%20450.171%20238.92%20450.171%20238.92Z'%20fill='%23113C7A'/%3e%3cpath%20d='M447.385%20219.567C447.385%20219.567%20447.147%20219.567%20447.226%20217.898C447.333%20217.17%20447.575%20216.469%20447.941%20215.831C447.941%20215.831%20445.287%20214.003%20443.155%20214.514C442.456%20215.949%20441.503%20217.246%20440.342%20218.341C440.342%20218.341%20441.533%20221.487%20447.385%20219.567Z'%20fill='%23FF8654'/%3e%3cpath%20d='M444.618%20220.518C444.618%20220.518%20439.946%20216.611%20438.948%20216.52C438.305%20216.397%20437.64%20216.527%20437.091%20216.882C436.542%20217.238%20436.151%20217.791%20435.999%20218.428C435.83%20219.054%20435.868%20219.717%20436.107%20220.319C436.347%20220.921%20436.774%20221.429%20437.326%20221.767C438.188%20222.244%20445.718%20225.867%20447.056%20225.867C447.366%20225.894%20447.676%20225.828%20447.948%20225.678C448.22%20225.528%20448.441%20225.3%20448.583%20225.024C448.725%20224.747%20448.782%20224.435%20448.747%20224.126C448.711%20223.817%20448.585%20223.526%20448.383%20223.289C447.578%20221.858%20444.618%20220.518%20444.618%20220.518Z'%20fill='%23113569'/%3e%3cpath%20d='M443.189%20217.922C443.189%20217.922%20448.144%20219.569%20449.539%20221.863C450.934%20224.157%20450.673%20226.701%20449.675%20230.267C448.677%20233.832%20450.685%20237.012%20450.174%20238.92C449.664%20240.828%20446.114%20242.611%20440.898%20241.714C435.681%20240.817%20435.307%20238.795%20434.932%20237.648C434.558%20236.501%20435.942%20231.027%20434.672%20226.576C434.209%20225.124%20434.176%20223.569%20434.579%20222.099C434.982%20220.63%20435.802%20219.309%20436.94%20218.297C437.983%20217.536%20440.013%20216.525%20443.189%20217.922Z'%20fill='%23113C7A'/%3e%3cpath%20d='M447.931%20220.036C447.931%20220.036%20446.593%20220.899%20443.259%20220.422C439.924%20219.945%20439.732%20217.561%20440.015%20217.368C440.333%20217.079%20440.622%20216.759%20440.877%20216.414C440.877%20216.414%20444.404%20218.038%20445.64%20218.515C446.876%20218.992%20447.546%20219.275%20447.546%20219.275L447.931%20220.036Z'%20fill='white'/%3e%3cpath%20d='M433.505%20262.056C433.675%20263.975%20435.489%20265.292%20437.122%20265.997C438.92%20266.735%20440.851%20267.091%20442.793%20267.041C444.784%20267.049%20446.751%20266.615%20448.554%20265.769C450.108%20265.008%20451.752%20263.623%20451.741%20261.738C451.815%20262.376%20451.758%20263.023%20451.572%20263.638C451.387%20264.254%20451.078%20264.824%20450.663%20265.315C449.293%20266.629%20447.557%20267.497%20445.685%20267.802C442.169%20268.529%20437.383%20268.177%20434.718%20265.531C434.262%20265.04%20433.916%20264.456%20433.705%20263.819C433.493%20263.182%20433.421%20262.507%20433.493%20261.84C433.493%20261.84%20433.493%20261.931%20433.505%20262.056Z'%20fill='%23ADCDFC'/%3e%3cpath%20d='M436.181%20257.981C432.609%20260.048%20432.586%20263.398%20436.181%20265.465C438.18%20266.484%20440.391%20267.015%20442.634%20267.015C444.877%20267.015%20447.088%20266.484%20449.087%20265.465C452.659%20263.398%20452.671%20260.048%20449.087%20257.981C447.089%20256.96%20444.877%20256.427%20442.634%20256.427C440.391%20256.427%20438.179%20256.96%20436.181%20257.981Z'%20fill='white'/%3e%3cpath%20d='M440.983%20253.808L441.005%20261.791L442.4%20262.598L442.378%20254.614L440.983%20253.808Z'%20fill='%23C7D8F2'/%3e%3cpath%20d='M442.377%20254.614L442.4%20262.598L443.806%20261.791L443.784%20253.808L442.377%20254.614Z'%20fill='%237BAEFF'/%3e%3cpath%20d='M440.983%20253.808L442.378%20254.614L443.784%20253.808L442.389%20252.99L440.983%20253.808Z'%20fill='%234DA5DC'/%3e%3cpath%20d='M424.542%20224.136C424.549%20223.878%20424.616%20223.626%20424.739%20223.399C424.862%20223.172%20425.037%20222.977%20425.249%20222.831C425.462%20222.685%20425.706%20222.591%20425.961%20222.557C426.217%20222.524%20426.477%20222.551%20426.719%20222.637C431.256%20224.238%20441.905%20230.439%20442.597%20231.722C443.288%20233.006%20445.307%20240.16%20446.316%20243.749C446.386%20243.991%20446.509%20244.213%20446.677%20244.4C446.846%20244.586%20447.055%20244.732%20447.288%20244.825C447.521%20244.918%20447.772%20244.957%20448.023%20244.938C448.273%20244.918%20448.516%20244.842%20448.732%20244.714L455.049%20240.989C455.317%20240.828%20455.626%20240.748%20455.938%20240.757C456.251%20240.766%20456.554%20240.866%20456.812%20241.043C457.07%20241.22%20457.272%20241.467%20457.394%20241.756C457.516%20242.044%20457.552%20242.362%20457.499%20242.67L456.489%20248.769C456.448%20249.006%20456.354%20249.231%20456.214%20249.427C456.075%20249.624%20455.894%20249.787%20455.684%20249.904L448.88%20253.8C447.018%20254.868%20444.922%20255.459%20442.777%20255.521C440.632%20255.582%20438.505%20255.112%20436.586%20254.152L431.381%20251.54C426.844%20249.268%20424.02%20243.056%20424.202%20237.912L424.542%20224.136Z'%20fill='%233278CC'/%3e%3cpath%20d='M442.574%20231.776C443.209%20233.06%20445.285%20240.214%20446.294%20243.803C446.363%20244.045%20446.487%20244.267%20446.655%20244.454C446.824%20244.64%20447.032%20244.786%20447.266%20244.879C447.499%20244.972%20447.75%20245.011%20448%20244.991C448.251%20244.972%20448.493%20244.896%20448.71%20244.768L455.027%20241.043C455.295%20240.882%20455.604%20240.801%20455.916%20240.811C456.229%20240.82%20456.532%20240.919%20456.79%20241.096C457.048%20241.273%20457.25%20241.521%20457.372%20241.809C457.493%20242.098%20457.53%20242.415%20457.476%20242.724L456.467%20248.822C456.443%20248.96%20456.401%20249.093%20456.342%20249.22L456.093%20249.606C455.971%20249.751%20455.825%20249.874%20455.662%20249.969L448.857%20253.865C447.456%20254.668%20445.918%20255.203%20444.321%20255.443C438.843%20251.185%20439.535%20233.412%20441.52%20231.913C441.758%20231.731%20442.022%20231.586%20442.302%20231.481C442.407%20231.565%20442.499%20231.665%20442.574%20231.776Z'%20fill='%233AAEEF'/%3e%3cpath%20d='M455.052%20225.713C455.052%20225.713%20449.619%20221.068%20448.667%20220.966C447.533%20220.875%20446.591%20222.635%20446.206%20224.259C446.038%20224.886%20446.078%20225.55%20446.319%20226.152C446.56%20226.754%20446.99%20227.261%20447.544%20227.598C448.406%20228.075%20455.936%20231.709%20457.263%20231.709C457.625%20231.697%20457.978%20231.596%20458.29%20231.415C458.603%20231.233%20458.867%20230.977%20459.056%20230.669C459.246%20230.361%20459.357%20230.01%20459.378%20229.648C459.4%20229.287%20459.332%20228.926%20459.18%20228.597C458.318%20227.189%20455.052%20225.713%20455.052%20225.713Z'%20fill='%23113C7A'/%3e%3cpath%20d='M461.368%20220.179C461.498%20219.92%20461.593%20219.645%20461.652%20219.362C461.581%20218.857%20461.581%20218.345%20461.652%20217.84C461.844%20217.079%20462.173%20216.409%20462.321%20215.875C462.695%20215.398%20463.035%20216.261%20462.752%20217.011C462.468%20217.76%20462.559%20218.146%20462.842%20218.203C463.523%20218.007%20464.145%20217.648%20464.657%20217.158C464.986%20216.772%20466.925%20214.887%20467.084%20215.148C467.243%20215.409%20467.277%20215.625%20466.608%20216.341C466.21%20216.689%20465.886%20217.114%20465.655%20217.59C465.625%20217.918%20465.545%20218.24%20465.417%20218.544C465.179%20219.112%20465.417%20219.498%20464.94%20220.02C464.464%20220.543%20463.704%20220.633%20463.319%20220.974L462.933%20221.304L461.368%20220.179Z'%20fill='%23FFAA83'/%3e%3cpath%20d='M457.265%20231.727C457.911%20231.803%20458.564%20231.662%20459.122%20231.327C459.68%20230.992%20460.111%20230.482%20460.35%20229.876C461.427%20227.605%20463.276%20221.665%20463.525%20221.097C463.317%20220.678%20462.992%20220.329%20462.59%20220.091C462.187%20219.853%20461.724%20219.737%20461.257%20219.757C461.257%20219.757%20459.477%20223.255%20458.456%20224.857C457.435%20226.458%20453.863%20231.091%20457.265%20231.727Z'%20fill='%23113C7A'/%3e%3cpath%20d='M450.551%20210.085C450.551%20211.163%20450.232%20212.217%20449.634%20213.113C449.036%20214.01%20448.186%20214.709%20447.191%20215.121C446.196%20215.534%20445.102%20215.642%20444.046%20215.431C442.99%20215.221%20442.02%20214.702%20441.259%20213.94C440.497%20213.177%20439.979%20212.206%20439.769%20211.148C439.559%20210.091%20439.667%20208.995%20440.079%20207.999C440.491%20207.003%20441.188%20206.151%20442.083%20205.552C442.979%20204.953%20444.031%20204.634%20445.108%20204.634C445.823%20204.632%20446.532%20204.772%20447.193%20205.046C447.854%20205.319%20448.455%20205.721%20448.96%20206.227C449.466%20206.734%20449.867%20207.335%20450.14%20207.997C450.413%20208.659%20450.553%20209.369%20450.551%20210.085Z'%20fill='%23FF8654'/%3e%3cpath%20d='M450.553%20210.449C450.553%20210.449%20450.621%20215.911%20449.419%20217.013C448.217%20218.114%20446.402%20215.979%20443.488%20215.298C440.573%20214.617%20445.847%20208.87%20445.847%20208.87L450.553%20210.449Z'%20fill='%23FF8654'/%3e%3cpath%20d='M440.533%20205.61C440.533%20205.61%20446.351%20202.203%20449.605%20205.031C452.86%20207.859%20449.14%20208.983%20448.562%20209.801C447.984%20210.619%20448.562%20211.277%20448.256%20211.868C447.95%20212.458%20447.859%20212.561%20447.859%20212.561L448.063%20213.265L447.711%20213.571C447.711%20213.571%20447.246%20212.254%20446.815%20212.288C446.385%20212.322%20446.044%20213.185%20446.192%20213.685C446.339%20214.185%20446.781%20214.741%20446.702%20215.093C446.623%20215.445%20446.158%20216.41%20445.727%20216.444C444.688%20216.361%20443.67%20216.112%20442.71%20215.706C441.201%20214.78%20439.998%20213.429%20439.251%20211.822C439.028%20211.25%20438.94%20210.633%20438.993%20210.021C439.046%20209.408%20439.239%20208.816%20439.557%20208.29C439.413%20207.798%20439.43%20207.272%20439.606%20206.79C439.781%20206.308%20440.106%20205.895%20440.533%20205.61Z'%20fill='%2396432A'/%3e%3cpath%20opacity='0.43'%20d='M668.681%20149.759L684.513%20149.656L717.481%20131.043L699.2%20122.037L668.681%20149.759Z'%20fill='%23A6D0F4'/%3e%3cpath%20opacity='0.35'%20d='M688.581%20112.949C698.196%20112.949%20705.99%20107.991%20705.99%20101.876C705.99%2095.7606%20698.196%2090.8032%20688.581%2090.8032C678.967%2090.8032%20671.173%2095.7606%20671.173%20101.876C671.173%20107.991%20678.967%20112.949%20688.581%20112.949Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M675.418%2099.2895C675.623%20101.561%20677.766%20103.117%20679.694%20103.957C681.817%20104.836%20684.1%20105.258%20686.396%20105.195C688.748%20105.202%20691.072%20104.686%20693.201%20103.685C695.027%20102.787%20696.977%20101.141%20696.977%2098.9148C697.064%2099.6711%20696.995%20100.437%20696.774%20101.166C696.554%20101.894%20696.187%20102.57%20695.696%20103.151C694.076%20104.711%20692.018%20105.737%20689.799%20106.092C685.637%20106.955%20679.977%20106.535%20676.825%20103.333C676.293%20102.748%20675.893%20102.057%20675.65%20101.304C675.408%20100.552%20675.329%2099.7568%20675.418%2098.9716V99.2895Z'%20fill='%23ADCDFC'/%3e%3cpath%20d='M678.556%2095.1075C674.326%2097.5491%20674.292%20101.513%20678.556%20103.966C680.923%20105.17%20683.54%20105.797%20686.194%20105.797C688.849%20105.797%20691.466%20105.17%20693.832%20103.966C698.063%20101.513%20698.074%2097.5491%20693.832%2095.1075C691.468%2093.8964%20688.85%2093.2649%20686.194%2093.2649C683.539%2093.2649%20680.921%2093.8964%20678.556%2095.1075Z'%20fill='white'/%3e%3cpath%20d='M685.004%2091.8394L685.026%20100.845L686.16%20101.504L686.138%2092.498L685.004%2091.8394Z'%20fill='%23C7D8F2'/%3e%3cpath%20d='M686.144%2092.498L686.166%20101.504L687.3%20100.845L687.278%2091.8394L686.144%2092.498Z'%20fill='%237BAEFF'/%3e%3cpath%20d='M684.482%2090.2053L686.138%2091.1593L687.793%2090.2053L686.149%2089.24L684.482%2090.2053Z'%20fill='%234DA5DC'/%3e%3cpath%20d='M696.881%2059.5533C696.881%2059.5533%20700.283%2061.5521%20701.179%2063.5849C702.075%2065.6177%20701.837%2079.893%20697.096%2086.2186C692.356%2092.5442%20683.567%2093.4414%20681.537%2092.5442C679.507%2091.647%20667.769%2085.7302%20666.873%2082.823C665.977%2079.9157%20670.479%2077.633%20672.963%2076.4974C675.447%2075.3617%20677.023%2073.7831%20678.373%2069.6834C679.722%2065.5837%20680.403%2058.6107%20681.99%2057.4864C683.578%2056.3621%20687.4%2054.5791%20696.881%2059.5533Z'%20fill='%2325437F'/%3e%3cpath%20d='M680.029%2090.57C678.374%2089.8318%20670.265%2085.8002%20666.84%2082.734C666.114%2079.8608%20670.514%2077.6576%20672.964%2076.5446C675.414%2075.4317%20677.024%2073.8304%20678.374%2069.7307C679.723%2065.6309%20680.404%2058.658%20681.991%2057.5337C683.579%2056.4094%20687.401%2054.5923%20696.882%2059.5665C697.895%2060.1825%20698.845%2060.8977%20699.717%2061.7016C700.568%2064.0751%20700.261%2077.9869%20695.589%2084.2103C690.917%2090.4337%20682.059%2091.4331%20680.029%2090.57Z'%20fill='%23254DA1'/%3e%3cpath%20d='M609.514%20118.378L606.985%20116.902L606.917%2087.9197L609.446%2089.396L609.514%20118.378Z'%20fill='%23CB6A50'/%3e%3cpath%20d='M609.446%2089.395L606.917%2087.9186L641.359%2068.0105L643.899%2069.4869L609.446%2089.395Z'%20fill='%23DBDBDB'/%3e%3cpath%20d='M643.9%2069.4895L643.968%2098.4715L609.515%20118.38L609.447%2089.3976L643.9%2069.4895Z'%20fill='%239966D7'/%3e%3cpath%20d='M611.92%2083.8906L611.852%20112.873L670.768%20146.886L670.836%20117.904L611.92%2083.8906Z'%20fill='%23A478D9'/%3e%3cpath%20d='M611.887%20100.108L670.791%20134.121L670.837%20117.904L611.921%2083.8906L611.887%20100.108Z'%20fill='%238C57CC'/%3e%3cpath%20d='M668.621%20149.703L666.092%20148.238L666.024%20119.256L668.553%20120.732L668.621%20149.703Z'%20fill='%238C57CC'/%3e%3cpath%20d='M668.553%20120.731L666.024%20119.254L700.466%2099.335L703.007%20100.811L668.553%20120.731Z'%20fill='%23DBDBDB'/%3e%3cpath%20d='M703.008%20100.814L703.076%20129.796L668.622%20149.704L668.554%20120.733L703.008%20100.814Z'%20fill='%23976EC9'/%3e%3cpath%20d='M707.733%20100.052L707.722%20102.778L668.664%20125.513V122.788L707.733%20100.052Z'%20fill='%238C57CC'/%3e%3cpath%20d='M668.663%20122.79V125.515L601.151%2086.2214L601.163%2083.4958L668.663%20122.79Z'%20fill='%238C57CC'/%3e%3cpath%20d='M707.738%20100.054L668.669%20122.79L601.168%2083.496L640.226%2060.7715L707.738%20100.054Z'%20fill='%23B195D2'/%3e%3cpath%20d='M670.777%20104.115L678.67%20108.703L691.429%20101.332L683.535%2096.7441L670.777%20104.115Z'%20fill='%238C57CC'/%3e%3cpath%20d='M669.325%20101.393L669.336%20103.358L677.229%20107.946L677.218%20105.981L669.325%20101.393Z'%20fill='%23CBDCEB'/%3e%3cpath%20d='M677.216%20105.977L677.227%20107.942L689.985%20100.56L689.974%2098.6069L677.216%20105.977Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M669.325%20101.392L677.218%20105.98L689.976%2098.6096L682.094%2094.0215L669.325%20101.392Z'%20fill='white'/%3e%3cpath%20d='M659.536%2094.9864L667.429%2099.5858L680.188%2092.204L672.294%2087.616L659.536%2094.9864Z'%20fill='white'/%3e%3cpath%20d='M666.398%2086.2649C668.212%2087.3097%20668.212%2089.0018%20666.398%2090.0353L654.853%2096.7584C653.847%2097.2737%20652.733%2097.5424%20651.604%2097.5424C650.474%2097.5424%20649.36%2097.2737%20648.355%2096.7584L636.73%2090.0353C634.938%2089.0018%20634.927%2087.3097%20636.73%2086.2649L648.275%2079.5532C649.283%2079.0378%20650.398%2078.769%20651.53%2078.769C652.662%2078.769%20653.777%2079.0378%20654.785%2079.5532L666.398%2086.2649Z'%20fill='%238C57CC'/%3e%3cpath%20d='M656.133%2088.0245C656.135%2088.0548%20656.135%2088.0852%20656.133%2088.1154L656.065%2088.1949H655.997H655.929L651.131%2090.8637L645.926%2087.9905V88.2971L651.086%2091.2839L655.883%2088.6264H655.94L656.008%2088.5583C656.01%2088.5243%20656.01%2088.4902%20656.008%2088.4561V88.0927C656.044%2088.0612%20656.087%2088.0379%20656.133%2088.0245Z'%20fill='%23BAC0D2'/%3e%3cpath%20d='M655.849%2087.5369C655.929%2087.5648%20655.999%2087.617%20656.048%2087.6861C656.097%2087.7553%20656.123%2087.8381%20656.123%2087.923C656.123%2088.0079%20656.097%2088.0907%20656.048%2088.1599C655.999%2088.2291%20655.929%2088.2812%20655.849%2088.3091L651.052%2090.9779L645.926%2087.9912L649.963%2084.9022C650.169%2084.7928%20650.399%2084.7356%20650.632%2084.7356C650.866%2084.7356%20651.095%2084.7928%20651.302%2084.9022L655.849%2087.5369Z'%20fill='white'/%3e%3cpath%20d='M662.942%2076.2336C663.158%2076.369%20663.344%2076.5463%20663.49%2076.755C663.636%2076.9637%20663.739%2077.1996%20663.793%2077.4488L666.276%2094.1202C666.333%2094.5518%20666.061%2094.7108%20665.653%2094.4836L640.396%2079.8564C640.183%2079.7221%20639.999%2079.5464%20639.855%2079.3396C639.711%2079.1329%20639.61%2078.8992%20639.557%2078.6526L637.074%2061.9811C637.006%2061.5382%20637.289%2061.3792%20637.686%2061.6177L662.942%2076.2336Z'%20fill='%23C7C9D7'/%3e%3cpath%20d='M666.672%2093.9753V93.8504L664.2%2077.1789V76.9404V76.8382V76.736L664.12%2076.6338L638.864%2062.0179H637.991H637.64C637.631%2062.0129%20637.621%2062.0103%20637.611%2062.0103C637.601%2062.0103%20637.592%2062.0129%20637.583%2062.0179L637.175%2062.3131C637.205%2062.307%20637.235%2062.307%20637.265%2062.3131H637.39H637.526L637.674%2062.3926L662.941%2076.2363L663.1%2076.3385L663.236%2076.4634L663.372%2076.6111C663.42%2076.659%20663.462%2076.7124%20663.497%2076.7701C663.535%2076.8243%20663.569%2076.8812%20663.599%2076.9404L663.678%2077.1108L663.746%2077.2811C663.752%2077.3378%20663.752%2077.3948%20663.746%2077.4515L666.23%2094.1229C666.236%2094.1682%20666.236%2094.214%20666.23%2094.2592C666.236%2094.2968%20666.236%2094.3352%20666.23%2094.3728V94.4409C666.218%2094.4777%20666.194%2094.5096%20666.162%2094.5318L666.559%2094.2365C666.594%2094.21%20666.621%2094.1748%20666.638%2094.1343V93.9753H666.672Z'%20fill='white'/%3e%3cpath%20opacity='0.2'%20d='M648.944%2085.6511L645.882%2087.9906L651.042%2090.9774L654.671%2088.9559L648.944%2085.6511Z'%20fill='%23777DB2'/%3e%3cpath%20d='M652.132%2080.7118L651.044%2091.3642L645.861%2088.3548L647.891%2078.395L652.132%2080.7118Z'%20fill='%23BAC0D2'/%3e%3cpath%20d='M606.644%20113.464C606.644%20113.464%20607.846%20115.349%20607.676%20116.031C607.506%20116.712%20606.644%20115.69%20606.644%20115.69C606.644%20115.69%20606.905%20117.961%20606.304%20118.438C605.703%20118.915%20605.442%20117.496%20605.442%20117.496C605.2%20117.659%20604.905%20117.723%20604.618%20117.674C604.331%20117.625%20604.074%20117.468%20603.899%20117.234C603.593%20116.631%20603.448%20115.958%20603.478%20115.281C603.507%20114.605%20603.711%20113.948%20604.07%20113.373C604.761%20112.26%20606.644%20113.464%20606.644%20113.464Z'%20fill='%23FF9554'/%3e%3cpath%20d='M610.772%2081.4148C610.772%2081.4148%20607.574%2081.3013%20606.089%2085.7644C604.603%2090.2275%20604.036%2097.2118%20603.82%2099.2674C603.605%20101.323%20603.503%20112.804%20603.616%20113.372C603.787%20113.662%20604.025%20113.906%20604.311%20114.083C604.597%20114.259%20604.922%20114.363%20605.257%20114.386C605.593%20114.408%20605.928%20114.348%20606.235%20114.211C606.542%20114.074%20606.811%20113.864%20607.019%20113.599C607.937%20111.544%20607.914%20102.583%20608.935%2099.1538C609.956%2095.7241%20612.485%2087.025%20612.598%2084.6174C612.652%2083.9614%20612.507%2083.3043%20612.181%2082.7326C611.855%2082.161%20611.364%2081.7016%20610.772%2081.4148Z'%20fill='%23113569'/%3e%3cpath%20d='M631.99%2074.4519C632%2073.9354%20632.084%2073.4229%20632.239%2072.9302C632.5%2072.2033%20631.729%2071.0563%20631.525%2070.3977C631.321%2069.739%20631.525%2069.5005%20631.979%2069.5459C632.432%2069.5913%20633.305%2071.5333%20633.498%2071.8172C633.691%2072.1011%20634.984%2070.2273%20635.381%2070.1592C635.778%2070.091%20636.152%2070.7043%20636.118%2071.1926C636.084%2071.6809%20637.105%2072.862%20636.628%2074.0318C636.152%2075.2015%20634.882%2076.1214%20634.36%2075.8715C633.838%2075.6217%20631.99%2074.4519%20631.99%2074.4519Z'%20fill='%23FF9554'/%3e%3cpath%20opacity='0.35'%20d='M595.057%20146.604C595.057%20153.895%20604.345%20159.812%20615.822%20159.812C627.299%20159.812%20636.575%20153.895%20636.575%20146.604C636.575%20139.313%20627.287%20133.396%20615.822%20133.396C604.356%20133.396%20595.057%20139.302%20595.057%20146.604Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M609.731%20143.59C609.312%20143.793%20608.966%20144.119%20608.738%20144.525C608.511%20144.932%20608.414%20145.398%20608.461%20145.861C608.471%20146.284%20608.551%20146.703%20608.699%20147.099C609.058%20147.392%20609.5%20147.564%20609.962%20147.59C610.424%20147.617%20610.883%20147.497%20611.273%20147.247C612.257%20146.565%20613.04%20145.632%20613.541%20144.544C614.141%20143.727%20614.657%20142.852%20615.084%20141.932C615.197%20141.285%20614.471%20140.796%20613.802%20140.887C612.512%20141.591%20611.29%20142.412%20610.15%20143.34C610.031%20143.434%20609.902%20143.514%20609.765%20143.579L609.731%20143.59Z'%20fill='%23232839'/%3e%3cpath%20d='M608.507%20106.594C608.507%20106.594%20608.235%20115.679%20608.575%20121.187C608.881%20126.093%20608.45%20140.3%20608.348%20143.457C608.321%20143.895%20608.429%20144.331%20608.655%20144.706C608.882%20145.082%20609.218%20145.379%20609.618%20145.558C609.952%20145.679%20610.31%20145.719%20610.663%20145.675C611.016%20145.632%20611.353%20145.506%20611.648%20145.308C611.902%20145.155%20612.121%20144.949%20612.289%20144.704C612.457%20144.459%20612.571%20144.181%20612.624%20143.889C613.236%20140.936%20615.277%20130.874%20615.572%20125.775C615.912%20119.767%20616.219%20112.261%20616.559%20109.876C616.899%20107.491%20608.507%20106.594%20608.507%20106.594Z'%20fill='%23113569'/%3e%3cpath%20d='M621.192%20146.817C620.742%20146.924%20620.336%20147.167%20620.028%20147.512C619.72%20147.857%20619.525%20148.288%20619.468%20148.747C619.399%20149.165%20619.399%20149.591%20619.468%20150.008C619.764%20150.36%20620.16%20150.614%20620.604%20150.736C621.047%20150.858%20621.517%20150.841%20621.952%20150.689C623.07%20150.245%20624.047%20149.502%20624.775%20148.543C625.538%20147.857%20626.23%20147.096%20626.839%20146.272C626.881%20146.117%20626.885%20145.954%20626.851%20145.797C626.818%20145.64%20626.748%20145.493%20626.648%20145.368C626.547%20145.243%20626.419%20145.144%20626.273%20145.078C626.127%20145.012%20625.968%20144.981%20625.807%20144.988C624.401%20145.401%20623.034%20145.941%20621.725%20146.601C621.586%20146.666%20621.442%20146.719%20621.294%20146.76L621.192%20146.817Z'%20fill='%23232839'/%3e%3cpath%20d='M623.76%20108.367C623.76%20108.367%20624.225%20136.213%20623.216%20146.298C623.212%20146.63%20623.135%20146.958%20622.991%20147.258C622.847%20147.557%20622.638%20147.821%20622.381%20148.032C622.123%20148.242%20621.823%20148.393%20621.501%20148.474C621.179%20148.555%20620.843%20148.564%20620.517%20148.501C620.347%20148.501%20619.201%20148.785%20619.008%20148.705C618.101%20148.365%20617.137%20121.449%20616.332%20118.326C615.527%20115.203%20613.134%20112.943%20613.361%20108.367C613.588%20103.79%20620.449%20106.084%20623.76%20108.367Z'%20fill='%23113C7A'/%3e%3cpath%20d='M624.303%20110.578C623.906%20112.599%20618.077%20113.121%20614.72%20112.576C611.363%20112.031%20607.405%20111.27%20607.518%20107.375C607.518%20107.375%20607.836%2089.92%20607.836%2086.8537C607.882%2084.9035%20608.554%2083.0201%20609.752%2081.482C609.752%2081.482%20611.635%2079.3356%20617.544%2080.5394C617.544%2080.5394%20622.352%2081.5842%20624.575%2085.1502C624.575%2085.1502%20626.423%2088.5572%20625.913%2096.6885C625.647%20101.346%20625.11%20105.983%20624.303%20110.578Z'%20fill='%23113C7A'/%3e%3cpath%20d='M612.926%2076.2691C613.196%2077.7025%20613.196%2079.1739%20612.926%2080.6073C612.846%2081.2887%20615.817%2083.5827%20618.448%2082.9808C619.98%2082.6401%20619.9%2081.8452%20619.9%2081.8452C619.153%2080.5839%20618.761%2079.1436%20618.766%2077.6773C618.959%2075.6672%20614.717%2075.8035%20612.926%2076.2691Z'%20fill='%23FF7C40'/%3e%3cpath%20d='M621.268%2082.0607L619.442%2081.0273C619.442%2081.0273%20614.758%2080.5957%20613.08%2079.4941L612.207%2080.7434C612.646%2081.4711%20613.254%2082.0829%20613.978%2082.5274C614.702%2082.972%20615.522%2083.2364%20616.369%2083.2986C617.889%2083.572%20619.457%2083.2596%20620.758%2082.4241L621.268%2082.0607Z'%20fill='%23E1E8F2'/%3e%3cpath%20d='M622.655%2084.6527C622.293%2084.6577%20621.937%2084.7455%20621.614%2084.9091C621.291%2085.0728%20621.009%2085.3081%20620.79%2085.5972C620.572%2085.8863%20620.422%2086.2215%20620.352%2086.5774C620.282%2086.9332%20620.294%2087.3003%20620.387%2087.6508C620.61%2088.525%20621.1%2089.3074%20621.79%2089.888C622.48%2090.4685%20623.334%2090.8181%20624.232%2090.8874C629.029%2091.6029%20638.362%2087.4805%20639.451%2085.3795C640.54%2083.2785%20637.036%2075.4766%20635.425%2074.2841C634.064%2073.4324%20631.807%2074.7384%20632.023%2075.8627C632.238%2076.987%20634.2%2082.5631%20634.291%2082.8583C634.382%2083.1536%20634.11%2083.165%20634.11%2083.165L624.504%2084.5164C623.89%2084.593%20623.273%2084.6385%20622.655%2084.6527Z'%20fill='%23113C7A'/%3e%3cpath%20d='M621.512%2071.262C621.525%2072.4014%20621.2%2073.519%20620.578%2074.4729C619.955%2075.4269%20619.064%2076.174%20618.017%2076.6194C616.969%2077.0648%20615.814%2077.1884%20614.696%2076.9744C613.578%2076.7604%20612.55%2076.2186%20611.74%2075.4177C610.931%2074.6168%20610.377%2073.5931%20610.15%2072.4765C609.923%2071.36%20610.033%2070.2011%20610.465%2069.1471C610.898%2068.0931%20611.633%2067.1916%20612.578%2066.5571C613.523%2065.9226%20614.635%2065.5838%20615.773%2065.5837C617.282%2065.5866%20618.73%2066.1836%20619.804%2067.2459C620.877%2068.3083%20621.491%2069.7508%20621.512%2071.262Z'%20fill='%23FF8654'/%3e%3cpath%20d='M621.513%2071.6276C621.513%2071.6276%20621.581%2077.374%20620.379%2078.5437C619.177%2079.7134%20617.204%2077.4081%20614.13%2076.738C611.057%2076.068%20616.625%2069.9241%20616.625%2069.9241L621.513%2071.6276Z'%20fill='%23FF8654'/%3e%3cpath%20d='M610.956%2066.5292C610.956%2066.5292%20617.091%2062.9746%20620.516%2065.916C623.941%2068.8573%20620.028%2070.0952%20619.382%2070.947C618.735%2071.7987%20619.382%2072.5028%20619.053%2073.1161C618.724%2073.7293%20618.645%2073.8542%20618.645%2073.8542L618.849%2074.5924L618.486%2074.9218C618.486%2074.9218%20618.021%2073.5363%20617.579%2073.5363C617.136%2073.5363%20616.762%2074.4789%20616.921%2075.0126C617.08%2075.5464%20617.533%2076.1483%20617.454%2076.4776C617.375%2076.8069%20616.887%2077.8745%20616.433%2077.9199C615.337%2077.8264%20614.261%2077.562%20613.246%2077.1363C611.663%2076.1551%20610.399%2074.7349%20609.606%2073.0479C609.371%2072.4436%20609.278%2071.793%20609.335%2071.1469C609.392%2070.5008%20609.597%2069.8766%20609.935%2069.323C609.789%2068.809%20609.809%2068.262%20609.992%2067.7602C610.176%2067.2584%20610.513%2066.8275%20610.956%2066.5292Z'%20fill='%2396432A'/%3e%3cpath%20d='M236.658%20220.478L247.715%20223.442L236.703%20239.171L236.692%20235.049L213.886%20248.234L213.863%20238.444L236.669%20225.259L236.658%20220.478Z'%20fill='white'/%3e%3cpath%20d='M607.506%20199.468L618.564%20202.432L607.552%20218.161L607.54%20214.039L584.734%20227.223L584.711%20217.434L607.518%20204.249L607.506%20199.468Z'%20fill='white'/%3e%3cpath%20d='M361.999%20210.934L372.898%20226.061L361.954%20228.559L361.965%20224.596L337.537%20210.48L337.56%20200.781L361.988%20214.898L361.999%20210.934Z'%20fill='white'/%3e%3cpath%20d='M84.669%20223.126C84.669%20223.126%2085.8712%20225.011%2085.7011%20225.704C85.5309%20226.396%2084.669%20225.352%2084.669%20225.352C84.669%20225.352%2084.9299%20227.623%2084.3288%20228.1C83.7277%20228.577%2083.4783%20227.157%2083.4783%20227.157C83.2359%20227.324%2082.9385%20227.39%2082.6487%20227.341C82.3589%20227.292%2082.0993%20227.133%2081.9246%20226.896C81.6177%20226.292%2081.4731%20225.618%2081.505%20224.941C81.5368%20224.264%2081.7439%20223.607%2082.106%20223.035C82.7865%20221.922%2084.669%20223.126%2084.669%20223.126Z'%20fill='%23FF9554'/%3e%3cpath%20d='M88.7642%20191.074C88.7642%20191.074%2085.5547%20190.961%2084.0691%20195.424C82.5834%20199.887%2082.0164%20206.872%2081.8009%20208.927C81.5854%20210.983%2081.4834%20222.464%2081.5968%20223.032C81.7673%20223.322%2082.0059%20223.566%2082.292%20223.742C82.578%20223.919%2082.9027%20224.023%2083.238%20224.045C83.5733%20224.068%2083.9089%20224.008%2084.2158%20223.871C84.5227%20223.734%2084.7916%20223.524%2084.999%20223.259C85.9063%20221.204%2085.8836%20212.255%2086.9043%20208.813C87.925%20205.372%2090.454%20196.685%2090.5674%20194.277C90.6235%20193.624%2090.4815%20192.968%2090.1598%20192.397C89.8381%20191.826%2089.3517%20191.365%2088.7642%20191.074Z'%20fill='%23113569'/%3e%3cpath%20opacity='0.35'%20d='M93.849%20269.47C105.317%20269.47%20114.614%20263.556%20114.614%20256.262C114.614%20248.967%20105.317%20243.054%2093.849%20243.054C82.3808%20243.054%2073.0839%20248.967%2073.0839%20256.262C73.0839%20263.556%2082.3808%20269.47%2093.849%20269.47Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M87.7696%20253.262C87.3488%20253.462%2087%20253.788%2086.7707%20254.195C86.5414%20254.601%2086.4427%20255.068%2086.4881%20255.533C86.501%20255.956%2086.5814%20256.374%2086.7262%20256.771C87.0908%20257.053%2087.5323%20257.216%2087.9922%20257.241C88.452%20257.265%2088.9084%20257.149%2089.3006%20256.907C90.2813%20256.227%2091.064%20255.298%2091.5688%20254.216C92.1687%20253.395%2092.6854%20252.516%2093.1111%20251.592C93.2359%20250.956%2092.4987%20250.457%2091.8296%20250.559C90.5388%20251.261%2089.3163%20252.082%2088.1778%20253.012C88.0587%20253.102%2087.9292%20253.179%2087.7923%20253.239L87.7696%20253.262Z'%20fill='%23232839'/%3e%3cpath%20d='M86.4744%20216.253C86.4744%20216.253%2086.2022%20225.339%2086.5424%20230.847C86.8486%20235.753%2086.4177%20249.96%2086.327%20253.117C86.2944%20253.554%2086.3979%20253.991%2086.6233%20254.367C86.8487%20254.744%2087.1849%20255.041%2087.5858%20255.218C87.9192%20255.34%2088.2766%20255.382%2088.6291%20255.341C88.9817%20255.299%2089.3197%20255.175%2089.6158%20254.979C89.8692%20254.822%2090.0869%20254.614%2090.2549%20254.367C90.4229%20254.121%2090.5374%20253.842%2090.5911%20253.548C91.2035%20250.607%2093.2562%20240.534%2093.5397%20235.435C93.88%20229.427%2094.1862%20221.92%2094.5264%20219.535C94.8666%20217.151%2086.4744%20216.253%2086.4744%20216.253Z'%20fill='%23113569'/%3e%3cpath%20d='M99.222%20256.476C98.7745%20256.585%2098.371%20256.829%2098.0651%20257.173C97.7592%20257.518%2097.5654%20257.948%2097.5095%20258.406C97.4369%20258.823%2097.4369%20259.25%2097.5095%20259.667C97.8043%20260.021%2098.1998%20260.277%2098.6435%20260.401C99.0871%20260.525%2099.5579%20260.51%2099.9931%20260.359C101.11%20259.911%20102.085%20259.169%20102.817%20258.213C103.58%20257.528%20104.271%20256.767%20104.881%20255.942C105.142%20255.34%20104.541%20254.658%20103.849%20254.658C102.44%20255.071%20101.073%20255.614%2099.7663%20256.282C99.627%20256.344%2099.4828%20256.393%2099.3354%20256.43L99.222%20256.476Z'%20fill='%23232839'/%3e%3cpath%20d='M101.785%20218.026C101.785%20218.026%20102.25%20245.873%20101.24%20255.969C101.235%20256.3%20101.157%20256.627%20101.012%20256.925C100.867%20257.223%20100.658%20257.486%20100.401%20257.695C100.144%20257.904%2099.8439%20258.054%2099.5226%20258.134C99.2013%20258.215%2098.8663%20258.224%2098.5411%20258.161C98.371%20258.161%2097.2256%20258.444%2097.0441%20258.365C96.1255%20258.024%2095.1616%20231.109%2094.3564%20227.986C93.5512%20224.863%2091.1582%20222.603%2091.3851%20218.026C91.6119%20213.45%2098.4731%20215.744%20101.785%20218.026Z'%20fill='%23113C7A'/%3e%3cpath%20d='M102.342%20220.236C101.934%20222.258%2096.1044%20222.78%2092.7475%20222.246C89.3906%20221.713%2085.4326%20220.94%2085.546%20217.034C85.546%20217.034%2085.8636%20199.579%2085.8636%20196.524C85.9205%20194.584%2086.5961%20192.714%2087.7915%20191.186C87.7915%20191.186%2089.6628%20189.04%2095.5713%20190.244C95.5713%20190.244%20100.391%20191.3%20102.603%20194.854C102.603%20194.854%20104.451%20198.261%20103.941%20206.393C103.673%20211.034%20103.139%20215.656%20102.342%20220.236Z'%20fill='%23113C7A'/%3e%3cpath%20d='M90.952%20185.964C91.2221%20187.397%2091.2221%20188.868%2090.952%20190.302C90.8726%20190.983%2093.8439%20193.277%2096.475%20192.687C98.006%20192.346%2097.9266%20191.551%2097.9266%20191.551C97.1797%20190.29%2096.7878%20188.849%2096.7925%20187.383C97.0307%20185.328%2092.7438%20185.498%2090.952%20185.964Z'%20fill='%23FF7C40'/%3e%3cpath%20d='M99.2954%20191.722L97.4695%20190.7C97.4695%20190.7%2092.7858%20190.257%2091.1073%20189.156L90.2341%20190.405C90.6738%20191.134%2091.2808%20191.747%2092.0047%20192.193C92.7287%20192.639%2093.5485%20192.906%2094.3962%20192.972C95.9183%20193.242%2097.4862%20192.925%2098.7851%20192.086L99.2954%20191.722Z'%20fill='%23E1E8F2'/%3e%3cpath%20d='M99.5354%20180.913C99.5354%20182.049%2099.1988%20183.16%2098.5683%20184.105C97.9377%20185.05%2097.0415%20185.787%2095.9929%20186.222C94.9444%20186.657%2093.7905%20186.77%2092.6774%20186.549C91.5642%20186.327%2090.5417%20185.78%2089.7392%20184.976C88.9367%20184.172%2088.3901%20183.148%2088.1687%20182.034C87.9473%20180.919%2088.0609%20179.764%2088.4953%20178.714C88.9296%20177.664%2089.6651%20176.766%2090.6088%20176.135C91.5525%20175.503%2092.6619%20175.166%2093.7969%20175.166C95.3188%20175.166%2096.7785%20175.772%2097.8546%20176.849C98.9308%20177.927%2099.5354%20179.389%2099.5354%20180.913Z'%20fill='%23FF8654'/%3e%3cpath%20d='M99.5445%20181.286C99.5445%20181.286%2099.6125%20187.043%2098.4104%20188.202C97.2083%20189.36%2095.2349%20187.066%2092.1616%20186.396C89.0882%20185.726%2094.6566%20179.582%2094.6566%20179.582L99.5445%20181.286Z'%20fill='%23FF8654'/%3e%3cpath%20d='M88.9823%20176.191C88.9823%20176.191%2095.1177%20172.636%2098.5426%20175.578C101.968%20178.519%2098.055%20179.757%2097.4086%20180.62C96.7621%20181.483%2097.4085%20182.176%2097.0797%20182.789C96.7508%20183.402%2096.6714%20183.516%2096.6714%20183.516L96.8755%20184.254L96.5126%20184.583C96.5126%20184.583%2096.025%20183.198%2095.5713%20183.232C95.1177%20183.266%2094.7548%20184.175%2094.9136%20184.708C95.0723%20185.242%2095.526%20185.844%2095.4466%20186.185C95.3672%20186.525%2094.8795%20187.57%2094.4259%20187.616C93.3294%20187.522%2092.2542%20187.258%2091.2391%20186.832C89.6561%20185.851%2088.3914%20184.431%2087.5987%20182.744C87.3635%20182.139%2087.2708%20181.489%2087.3279%20180.843C87.3849%20180.196%2087.5902%20179.572%2087.9276%20179.019C87.7789%20178.496%2087.8011%20177.94%2087.9908%20177.431C88.1806%20176.922%2088.5281%20176.488%2088.9823%20176.191Z'%20fill='%2396432A'/%3e%3cpath%20d='M109.698%20224.2L104.028%20227.607L104.776%20237.635L117.161%20229.969L116.684%20220.407L109.698%20224.2Z'%20fill='%2394C3FF'/%3e%3cpath%20d='M110.776%20221.454C110.776%20221.454%20112.126%20222.873%20112.409%20223.305C112.693%20223.737%20112.84%20225.928%20112.477%20226.212C111.69%20226.714%20110.789%20227.007%20109.858%20227.064C109.291%20226.916%20108.939%20226.632%20108.939%20226.417C108.939%20226.201%20108.803%20224.793%20108.803%20224.793C108.803%20224.793%20107.805%20224.077%20107.737%20223.657C107.707%20223.3%20107.73%20222.94%20107.805%20222.59L110.776%20221.454Z'%20fill='%23FF9554'/%3e%3cpath%20d='M100.629%20192.584C101.648%20193.135%20102.542%20193.89%20103.257%20194.802C103.971%20195.715%20104.489%20196.765%20104.78%20197.888C105.539%20201.488%20107.048%20210.755%20107.048%20210.755L111.21%20221.237C111.111%20221.644%20110.917%20222.022%20110.645%20222.34C110.372%20222.658%20110.028%20222.907%20109.641%20223.067C109.254%20223.226%20108.835%20223.292%20108.418%20223.258C108%20223.224%20107.597%20223.092%20107.241%20222.872C107.241%20222.872%20102.704%20214.162%20101.57%20211.709C100.436%20209.256%2099.302%20197.888%2099.1092%20195.616C99.0222%20195.016%2099.1212%20194.403%2099.393%20193.861C99.6647%20193.319%20100.096%20192.873%20100.629%20192.584Z'%20fill='%23113C7A'/%3e%3cpath%20d='M364.359%20134.939C367.058%20136.495%20367.069%20139.016%20364.359%20140.617C362.853%20141.384%20361.188%20141.784%20359.499%20141.784C357.81%20141.784%20356.145%20141.384%20354.639%20140.617C351.952%20139.062%20351.94%20136.54%20354.639%20134.939C356.145%20134.172%20357.81%20133.772%20359.499%20133.772C361.188%20133.772%20362.853%20134.172%20364.359%20134.939Z'%20fill='%23A6D0F4'/%3e%3cpath%20d='M365.159%20121.041V136.338C365.107%20136.898%20364.908%20137.434%20364.581%20137.891C364.254%20138.348%20363.812%20138.709%20363.299%20138.939C361.894%20139.654%20360.34%20140.027%20358.763%20140.027C357.186%20140.027%20355.632%20139.654%20354.227%20138.939C353.706%20138.706%20353.256%20138.338%20352.925%20137.872C352.594%20137.407%20352.394%20136.862%20352.344%20136.293V121.007C352.393%20121.574%20352.594%20122.119%20352.925%20122.582C353.256%20123.046%20353.706%20123.411%20354.227%20123.641C355.631%20124.359%20357.186%20124.733%20358.763%20124.733C360.34%20124.733%20361.895%20124.359%20363.299%20123.641C363.811%20123.411%20364.253%20123.049%20364.58%20122.592C364.906%20122.135%20365.106%20121.6%20365.159%20121.041Z'%20fill='%23CBDCEB'/%3e%3cpath%20d='M363.266%20118.394C365.773%20119.848%20365.795%20122.199%20363.266%20123.652C361.862%20124.37%20360.307%20124.744%20358.73%20124.744C357.153%20124.744%20355.598%20124.37%20354.194%20123.652C351.687%20122.21%20351.676%20119.859%20354.194%20118.406C355.598%20117.689%20357.152%20117.314%20358.728%20117.312C360.305%20117.31%20361.86%20117.681%20363.266%20118.394Z'%20fill='white'/%3e%3cpath%20d='M362.267%20118.962C364.229%20120.097%20364.229%20121.914%20362.267%20123.05C361.175%20123.607%20359.966%20123.898%20358.74%20123.898C357.514%20123.898%20356.306%20123.607%20355.213%20123.05C353.263%20121.914%20353.251%20120.097%20355.213%20118.973C356.303%20118.409%20357.512%20118.114%20358.739%20118.112C359.966%20118.11%20361.175%20118.402%20362.267%20118.962Z'%20fill='%23713336'/%3e%3cpath%20d='M353.838%20121.482C353.838%20121.482%20350.629%20110.795%20349.495%20109.183C349.495%20107.774%20352.421%20109.467%20353.555%20112.124C354.509%20114.926%20355.233%20117.801%20355.721%20120.721C355.721%20120.721%20355.539%20107.014%20357.898%20103.993C359.406%20104.367%20358.465%20119.404%20358.272%20120.539C358.272%20120.539%20362.99%20110.511%20366.109%20108.433C367.527%20108.626%20361.573%20121.005%20361.573%20121.005C361.573%20121.005%20364.022%20116.371%20368.456%20115.52C366.949%20117.729%20365.309%20119.846%20363.546%20121.857C363.546%20121.857%20361.947%20124.321%20357.694%20123.844C357.705%20123.844%20354.779%20123.651%20353.838%20121.482Z'%20fill='%234CA15C'/%3e%3cpath%20d='M231.058%2046.2549L231.069%2048.4808L225.864%2051.4903L225.875%2056.2941L223.732%2057.532L223.721%2050.5023L231.058%2046.2549Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M231.075%2048.4773L251.965%2036.4053V49.6471V55.632L248.2%2057.8125L225.881%2070.7135V56.2907V51.4868L231.075%2048.4773ZM251.398%2055.2913L251.341%2037.4614L226.482%2051.8389V69.6687L251.353%2055.2913'%20fill='%23E6F4FF'/%3e%3cpath%20d='M254.342%2048.2988L254.364%2056.7481L248.24%2060.28V57.8157L252.006%2055.6352L251.994%2049.6503L254.342%2048.2988Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M252.028%2045.9031L273.95%2033.4109V54.9884L291.336%2066.7198'%20stroke='%23E6F4FF'%20stroke-width='0.75'%20stroke-miterlimit='10'/%3e%3cpath%20d='M243.33%2056.6934H243.398H243.466L243.545%2056.6366H243.613H243.67L243.738%2056.5798V56.523H243.806L243.874%2056.4662L244.01%2056.33L244.067%2056.2732L244.124%2056.205H244.192V56.1369L244.248%2056.0687C244.319%2056.0064%20244.383%2055.938%20244.441%2055.8643L244.498%2055.7962V55.7281L244.555%2055.6599L244.611%2055.5918L244.679%2055.5236L244.906%2055.2284V55.1602L244.963%2055.0807V55.0126L245.224%2054.6265V54.547L245.28%2054.4788L245.564%2054.0019V53.9224V53.8315C245.643%2053.6952%20245.711%2053.5589%20245.779%2053.4227C244.948%2053.3118%20244.111%2053.2511%20243.273%2053.241C243.251%2053.2815%20243.224%2053.3195%20243.194%2053.3545C242.873%2053.8563%20242.447%2054.2825%20241.946%2054.6038C241.758%2054.7243%20241.547%2054.8047%20241.327%2054.8399C241.106%2054.8751%20240.881%2054.8643%20240.665%2054.8082H240.585C240.517%2054.899%20239.043%2056.6366%20238.215%2057.7268L238.295%2057.8063L238.431%2057.8972H238.487L238.646%2057.9653H238.703H238.873H239.882H240.018H240.268H240.415H240.472H240.744H240.824H240.88H240.971H241.062H241.152H241.22L243.33%2056.6934Z'%20fill='%234B5CC0'/%3e%3cpath%20d='M242.196%2053.4647C242.141%2053.5833%20242.076%2053.6972%20242.003%2053.8054C242.219%2053.8615%20242.445%2053.8723%20242.665%2053.8371C242.886%2053.802%20243.096%2053.7216%20243.284%2053.601C243.786%2053.2798%20244.211%2052.8536%20244.532%2052.3518C244.45%2052.3375%20244.375%2052.2977%20244.317%2052.2382C244.215%2051.9725%20244.154%2051.6931%20244.135%2051.4092L243.602%2052.1587C243.52%2052.2863%20243.412%2052.3948%20243.284%2052.4767C243.179%2052.5179%20243.061%2052.5179%20242.956%2052.4767L242.411%2052.3291C242.375%2052.7136%20242.303%2053.0938%20242.196%2053.4647Z'%20fill='%23CBDCEB'/%3e%3cpath%20d='M242.081%2050.0277C242.009%2050.0798%20241.928%2050.1183%20241.843%2050.1413L241.718%2051.0839V51.4019C241.712%2051.4623%20241.712%2051.5232%20241.718%2051.5836C241.737%2051.7642%20241.807%2051.9357%20241.919%2052.0783C242.032%2052.221%20242.182%2052.3289%20242.353%2052.3899L242.897%2052.5375C243.003%2052.5787%20243.12%2052.5787%20243.226%2052.5375C243.354%2052.4556%20243.462%2052.3471%20243.544%2052.2195L244.077%2051.47C244.405%2051.009%20244.63%2050.482%20244.734%2049.9255V49.6757V49.051L244.292%2047.6655C244.292%2047.6655%20244.224%2047.5633%20244.065%2047.6655C243.922%2047.7614%20243.798%2047.8849%20243.702%2048.0289C243.283%2048.6308%20243.238%2049.1646%20242.512%2049.6984C242.373%2049.8145%20242.229%2049.9244%20242.081%2050.0277Z'%20fill='%23CBDCEB'/%3e%3cpath%20d='M242.723%2046.82C242.015%2047.47%20241.55%2048.344%20241.408%2049.2958C241.369%2049.7306%20241.407%2050.169%20241.521%2050.5904C241.567%2050.784%20241.628%2050.9738%20241.703%2051.1582V51.0787L241.828%2050.1361C241.913%2050.1132%20241.994%2050.0747%20242.066%2050.0226C242.278%2049.8989%20242.482%2049.7623%20242.678%2049.6137C243.404%2049.0913%20243.449%2048.5462%20243.869%2047.9443C243.965%2047.8003%20244.088%2047.6768%20244.232%2047.5809C244.391%2047.4787%20244.459%2047.5809%20244.459%2047.5809L244.901%2048.9664C244.901%2048.9664%20244.901%2048.7847%20245.003%2048.5462C245.105%2048.3077%20245.128%2047.9784%20245.162%2047.7626C245.21%2047.2124%20245.057%2046.6633%20244.731%2046.2181C244.493%2045.991%20243.858%2046.0478%20243.222%2046.4112C243.043%2046.5301%20242.875%2046.6671%20242.723%2046.82Z'%20fill='%2396432A'/%3e%3cpath%20d='M244.567%2052.3549C244.597%2052.3199%20244.624%2052.2818%20244.647%2052.2413C245.489%2052.2518%20246.329%2052.3124%20247.164%2052.4231C247.842%2051.1363%20248.21%2049.7094%20248.242%2048.2552C248.242%2045.1776%20246.064%2043.9283%20243.376%2045.4842C241.967%2046.3993%20240.794%2047.6361%20239.954%2049.093C239.114%2050.5499%20238.632%2052.1854%20238.545%2053.8653C238.506%2054.4056%20238.587%2054.948%20238.783%2055.4528C238.979%2055.9577%20239.285%2056.4124%20239.679%2056.784L239.6%2056.7045C240.428%2055.5688%20241.868%2053.8767%20241.97%2053.7858H242.049C242.123%2053.6777%20242.187%2053.5637%20242.242%2053.4451C242.338%2053.0731%20242.399%2052.6929%20242.424%2052.3095C242.253%2052.2485%20242.103%2052.1405%20241.99%2051.9979C241.878%2051.8553%20241.808%2051.6838%20241.789%2051.5032C241.771%2051.5374%20241.743%2051.5652%20241.709%2051.5827C241.301%2051.7303%20241.085%2050.9581%20241.346%2050.6514L241.46%2050.5492H241.539C241.425%2050.1278%20241.387%2049.6894%20241.426%2049.2546C241.568%2048.3028%20242.033%2047.4289%20242.741%2046.7788C242.902%2046.6365%20243.077%2046.5109%20243.263%2046.4041C243.898%2046.0406%20244.533%2045.9839%20244.771%2046.211C245.098%2046.6562%20245.251%2047.2053%20245.202%2047.7555C245.202%2047.9713%20245.1%2048.2893%20245.043%2048.5391C245.068%2048.5068%20245.099%2048.4798%20245.134%2048.4596C245.171%2048.4482%20245.211%2048.4482%20245.248%2048.4596C245.508%2048.4596%20245.304%2049.493%20244.919%2049.7883H244.851C244.746%2050.3448%20244.521%2050.8718%20244.193%2051.3328C244.2%2051.6244%20244.258%2051.9126%20244.363%2052.1846C244.409%2052.2631%20244.482%2052.3233%20244.567%2052.3549Z'%20fill='%2358AFFB'/%3e%3cpath%20d='M237.782%2056.8159V57.7358L229.333%2062.6191V61.6993L237.782%2056.8159Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M233.597%2057.0879V58.0078L229.322%2060.4835V59.5523L233.597%2057.0879Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M230.977%2055.9329V56.8641L229.322%2057.8294V56.8868L230.977%2055.9329Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M237.782%2071.5825V72.5024L229.333%2077.3857V76.4659L237.782%2071.5825Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M233.597%2071.8525V72.7724L229.322%2075.2481V74.3169L233.597%2071.8525Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M230.977%2070.6956V71.6268L229.322%2072.5921V71.6495L230.977%2070.6956Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M237.782%2080.6665V81.5864L229.333%2086.4697V85.5498L237.782%2080.6665Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M233.597%2080.9365V81.8564L229.322%2084.3321V83.4009L233.597%2080.9365Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M230.977%2079.7815V80.7127L229.322%2081.678V80.7354L230.977%2079.7815Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M310.242%2026.2321L310.162%2053.4197L294.694%2044.4821L294.773%2017.2944L310.242%2026.2321Z'%20stroke='%23E6F4FF'%20stroke-width='0.75'%20stroke-miterlimit='10'/%3e%3cpath%20d='M308.224%2027.3716L308.757%2027.0649L308.677%2054.2526L308.144%2054.5592L308.224%2027.3716Z'%20fill='%23BDC5CB'/%3e%3cpath%20d='M292.754%2018.4301L293.287%2018.1121L308.756%2027.0611L308.223%2027.3677L292.754%2018.4301Z'%20fill='white'/%3e%3cpath%20d='M308.222%2027.3698L308.143%2054.5574L292.674%2045.6198L292.753%2018.4321L308.222%2027.3698Z'%20fill='%23EAF1F7'/%3e%3cpath%20d='M297.045%2028.5267V28.7653C297.045%2028.7974%20297.037%2028.829%20297.021%2028.8568C297.005%2028.8847%20296.983%2028.9079%20296.955%2028.924C296.927%2028.9402%20296.896%2028.9487%20296.864%2028.9488C296.832%2028.9489%20296.8%2028.9405%20296.773%2028.9244L295.638%2028.2767C295.611%2028.2598%20295.588%2028.2364%20295.572%2028.2086C295.557%2028.1809%20295.548%2028.1496%20295.547%2028.1176V27.879C295.547%2027.847%20295.555%2027.8154%20295.571%2027.7875C295.587%2027.7597%20295.61%2027.7365%20295.637%2027.7203C295.665%2027.7042%20295.696%2027.6956%20295.728%2027.6956C295.76%2027.6955%20295.792%2027.7039%20295.819%2027.7199L296.954%2028.3676C296.982%2028.3837%20297.005%2028.4069%20297.021%2028.4349C297.037%2028.4628%20297.045%2028.4945%20297.045%2028.5267Z'%20fill='%2394A3C0'/%3e%3cpath%20d='M300.612%2031.7523V31.9908C300.612%2032.0228%20300.604%2032.0544%20300.588%2032.0822C300.573%2032.1101%20300.55%2032.1332%20300.522%2032.1494C300.494%2032.1655%20300.463%2032.174%20300.431%2032.1741C300.399%2032.1742%20300.368%2032.1658%20300.34%2032.1498L295.645%2029.4583C295.617%2029.4422%20295.594%2029.419%20295.578%2029.391C295.562%2029.3631%20295.554%2029.3314%20295.554%2029.2993V29.0608C295.554%2029.0287%20295.562%2028.9972%20295.578%2028.9694C295.594%2028.9415%20295.616%2028.9183%20295.644%2028.9022C295.672%2028.8861%20295.703%2028.8775%20295.735%2028.8774C295.767%2028.8774%20295.799%2028.8858%20295.826%2028.9018L300.521%2031.5933C300.548%2031.6102%20300.571%2031.6336%20300.587%2031.6613C300.603%2031.6891%20300.611%2031.7204%20300.612%2031.7523Z'%20fill='%2394A3C0'/%3e%3cg%20opacity='0.53'%3e%3cpath%20d='M298.667%2033.0225V33.261C298.667%2033.293%20298.659%2033.3246%20298.643%2033.3524C298.627%2033.3803%20298.604%2033.4035%20298.576%2033.4196C298.549%2033.4357%20298.517%2033.4443%20298.485%2033.4444C298.453%2033.4444%20298.422%2033.436%20298.394%2033.42L295.639%2031.8301C295.61%2031.815%20295.586%2031.792%20295.57%2031.7638C295.554%2031.7357%20295.546%2031.7035%20295.548%2031.6711V31.4326C295.547%2031.4006%20295.556%2031.369%20295.571%2031.3412C295.587%2031.3133%20295.61%2031.2902%20295.638%2031.274C295.665%2031.2579%20295.697%2031.2493%20295.729%2031.2493C295.761%2031.2492%20295.792%2031.2576%20295.82%2031.2736L298.576%2032.8635C298.604%2032.8796%20298.627%2032.9028%20298.643%2032.9308C298.659%2032.9587%20298.667%2032.9904%20298.667%2033.0225Z'%20fill='%2394A3C0'/%3e%3c/g%3e%3cpath%20d='M299.875%2032.5257V32.7642C299.875%2032.7962%20299.867%2032.8278%20299.851%2032.8556C299.835%2032.8835%20299.813%2032.9066%20299.785%2032.9228C299.757%2032.9389%20299.726%2032.9475%20299.694%2032.9475C299.662%2032.9476%20299.63%2032.9392%20299.603%2032.9232L295.645%2030.6519C295.617%2030.6358%20295.594%2030.6126%20295.578%2030.5847C295.562%2030.5567%20295.554%2030.525%20295.554%2030.4929V30.2544C295.554%2030.2223%20295.562%2030.1908%20295.578%2030.163C295.594%2030.1351%20295.616%2030.1119%20295.644%2030.0958C295.672%2030.0797%20295.703%2030.0711%20295.735%2030.071C295.767%2030.071%20295.799%2030.0794%20295.826%2030.0954L299.784%2032.3667C299.812%2032.3828%20299.835%2032.406%20299.851%2032.4339C299.867%2032.4619%20299.875%2032.4935%20299.875%2032.5257Z'%20fill='%2394A3C0'/%3e%3cpath%20d='M297.045%2034.4908V34.7295C297.045%2034.7615%20297.037%2034.7931%20297.021%2034.8209C297.005%2034.8488%20296.983%2034.872%20296.955%2034.8881C296.927%2034.9043%20296.896%2034.9128%20296.864%2034.9129C296.832%2034.913%20296.8%2034.9046%20296.773%2034.8885L295.638%2034.2408C295.611%2034.2239%20295.588%2034.2005%20295.572%2034.1727C295.557%2034.145%20295.548%2034.1137%20295.547%2034.0817V33.8431C295.547%2033.8111%20295.555%2033.7795%20295.571%2033.7516C295.587%2033.7238%20295.61%2033.7006%20295.637%2033.6844C295.665%2033.6683%20295.696%2033.6597%20295.728%2033.6597C295.76%2033.6596%20295.792%2033.668%20295.819%2033.684L296.954%2034.3317C296.982%2034.3478%20297.005%2034.371%20297.021%2034.399C297.037%2034.4269%20297.045%2034.4586%20297.045%2034.4908Z'%20fill='%2394A3C0'/%3e%3cpath%20d='M300.612%2037.7145V37.9529C300.612%2037.985%20300.604%2038.0165%20300.588%2038.0444C300.573%2038.0722%20300.55%2038.0954%20300.522%2038.1115C300.494%2038.1277%20300.463%2038.1362%20300.431%2038.1363C300.399%2038.1363%20300.368%2038.128%20300.34%2038.1119L295.645%2035.4204C295.617%2035.4043%20295.594%2035.3811%20295.578%2035.3532C295.562%2035.3253%20295.554%2035.2936%20295.554%2035.2614V35.0229C295.554%2034.9909%20295.562%2034.9594%20295.578%2034.9315C295.594%2034.9037%20295.616%2034.8805%20295.644%2034.8644C295.672%2034.8482%20295.703%2034.8397%20295.735%2034.8396C295.767%2034.8395%20295.799%2034.8479%20295.826%2034.8639L300.521%2037.5555C300.548%2037.5724%20300.571%2037.5958%20300.587%2037.6235C300.603%2037.6513%20300.611%2037.6825%20300.612%2037.7145Z'%20fill='%2394A3C0'/%3e%3cg%20opacity='0.53'%3e%3cpath%20d='M298.667%2038.9906V39.229C298.667%2039.2611%20298.659%2039.2926%20298.643%2039.3205C298.627%2039.3483%20298.604%2039.3715%20298.576%2039.3876C298.549%2039.4038%20298.517%2039.4123%20298.485%2039.4124C298.453%2039.4125%20298.422%2039.404%20298.394%2039.388L295.639%2037.7981C295.61%2037.783%20295.586%2037.76%20295.57%2037.7319C295.554%2037.7037%20295.546%2037.6715%20295.548%2037.6391V37.4006C295.547%2037.3686%20295.556%2037.3371%20295.571%2037.3092C295.587%2037.2814%20295.61%2037.2582%20295.638%2037.242C295.665%2037.2259%20295.697%2037.2174%20295.729%2037.2173C295.761%2037.2172%20295.792%2037.2256%20295.82%2037.2416L298.576%2038.8316C298.604%2038.8477%20298.627%2038.8708%20298.643%2038.8988C298.659%2038.9267%20298.667%2038.9584%20298.667%2038.9906Z'%20fill='%2394A3C0'/%3e%3c/g%3e%3cpath%20d='M299.875%2038.4879V38.7264C299.875%2038.7584%20299.867%2038.7899%20299.851%2038.8178C299.835%2038.8456%20299.813%2038.8688%20299.785%2038.8849C299.757%2038.9011%20299.726%2038.9096%20299.694%2038.9097C299.662%2038.9098%20299.63%2038.9014%20299.603%2038.8853L295.645%2036.614C295.617%2036.5979%20295.594%2036.5747%20295.578%2036.5468C295.562%2036.5189%20295.554%2036.4872%20295.554%2036.455V36.2165C295.554%2036.1845%20295.562%2036.153%20295.578%2036.1251C295.594%2036.0973%20295.616%2036.0741%20295.644%2036.0579C295.672%2036.0418%20295.703%2036.0333%20295.735%2036.0332C295.767%2036.0331%20295.799%2036.0415%20295.826%2036.0576L299.784%2038.3289C299.812%2038.345%20299.835%2038.3682%20299.851%2038.3961C299.867%2038.424%20299.875%2038.4557%20299.875%2038.4879Z'%20fill='%2394A3C0'/%3e%3cpath%20d='M316.193%2026.9705H314.492V28.6739H316.193V26.9705Z'%20fill='white'/%3e%3cpath%20d='M321.292%2029.8127H317.323V33.7876H321.292V29.8127Z'%20fill='white'/%3e%3cpath%20d='M525.999%20135.142H524.298V136.845H525.999V135.142Z'%20fill='white'/%3e%3cpath%20d='M531.102%20137.982H527.133V141.957H531.102V137.982Z'%20fill='white'/%3e%3cpath%20d='M625.797%200H624.096V1.70349H625.797V0Z'%20fill='white'/%3e%3cpath%20d='M630.903%202.83838H626.934V6.81319H630.903V2.83838Z'%20fill='white'/%3e%3cpath%20d='M541.221%20108.171H539.52V109.875H541.221V108.171Z'%20fill='white'/%3e%3cpath%20d='M546.324%20111.01H542.354V114.984H546.324V111.01Z'%20fill='white'/%3e%3cpath%20d='M394.448%20207.254H392.747V208.958H394.448V207.254Z'%20fill='white'/%3e%3cpath%20d='M399.547%20210.095H395.578V214.07H399.547V210.095Z'%20fill='white'/%3e%3cpath%20d='M81.4377%20163.34H79.7366V165.044H81.4377V163.34Z'%20fill='white'/%3e%3cpath%20d='M86.5408%20166.177H82.5715V170.152H86.5408V166.177Z'%20fill='white'/%3e%3cpath%20d='M195.978%20272.556H194.277V274.26H195.978V272.556Z'%20fill='white'/%3e%3cpath%20d='M201.082%20275.397H197.112V279.372H201.082V275.397Z'%20fill='white'/%3e%3cpath%20d='M609.762%20152.212V153.132L601.313%20158.016V157.096L609.762%20152.212Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M605.581%20152.484V153.404L601.306%20155.88V154.949L605.581%20152.484Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M602.957%20151.329V152.26L601.301%20153.226L601.29%20152.283L602.957%20151.329Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M401.858%20174.723V175.654L393.409%20180.537V179.606L401.858%20174.723Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M397.677%20174.997V175.928L393.401%20178.392V177.472L397.677%20174.997Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M395.057%20173.847V174.779L393.402%20175.733L393.39%20174.801L395.057%20173.847Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M518.674%20137.212C520.036%20138.1%20521.17%20139.297%20521.984%20140.706C522.797%20142.115%20523.268%20143.696%20523.358%20145.321V152.35C523.358%20155.326%20521.237%20156.53%20518.651%20155.031L512.255%20151.34L509.431%20153.679V149.716L504.804%20147.036C503.443%20146.148%20502.31%20144.95%20501.498%20143.541C500.687%20142.132%20500.218%20140.551%20500.132%20138.927V131.897C500.132%20128.922%20502.252%20127.718%20504.838%20129.217L518.674%20137.212ZM522.904%20152.101V145.082C522.828%20143.603%20522.402%20142.163%20521.663%20140.88C520.924%20139.597%20519.892%20138.507%20518.651%20137.7L504.815%20129.751C502.468%20128.388%20500.551%20129.49%20500.54%20132.192V139.222C500.623%20140.698%20501.051%20142.135%20501.789%20143.415C502.528%20144.695%20503.557%20145.784%20504.793%20146.593L509.851%20149.511V152.589L512.051%20150.783L518.64%20154.588C520.999%20155.95%20522.915%20154.86%20522.915%20152.146'%20fill='white'/%3e%3cpath%20d='M509.963%20136.258V136.86C509.962%20136.94%20509.939%20137.019%20509.898%20137.088C509.857%20137.157%20509.799%20137.215%20509.73%20137.255C509.66%20137.295%20509.581%20137.316%20509.501%20137.316C509.421%20137.317%20509.341%20137.296%20509.271%20137.257L506.436%20135.622C506.367%20135.582%20506.309%20135.524%20506.269%20135.454C506.229%20135.384%20506.209%20135.305%20506.209%20135.224V134.622C506.211%20134.542%20506.233%20134.463%20506.274%20134.394C506.315%20134.325%20506.373%20134.268%20506.443%20134.228C506.513%20134.187%20506.591%20134.166%20506.672%20134.166C506.752%20134.165%20506.831%20134.186%20506.901%20134.225L509.725%20135.86C509.797%20135.899%20509.857%20135.956%20509.899%20136.026C509.94%20136.096%20509.963%20136.176%20509.963%20136.258Z'%20fill='%23F9FBFC'/%3e%3cpath%20d='M518.915%20144.377V144.979C518.914%20145.059%20518.891%20145.138%20518.85%20145.207C518.809%20145.276%20518.751%20145.334%20518.682%20145.374C518.612%20145.414%20518.533%20145.435%20518.453%20145.436C518.373%20145.436%20518.293%20145.416%20518.223%20145.376L506.44%20138.563C506.368%20138.525%20506.307%20138.468%20506.265%20138.397C506.223%20138.327%20506.201%20138.247%20506.202%20138.165V137.563C506.204%20137.483%20506.226%20137.404%20506.267%20137.335C506.308%20137.266%20506.366%20137.208%20506.436%20137.168C506.505%20137.128%20506.584%20137.107%20506.664%20137.106C506.745%20137.106%20506.824%20137.126%20506.894%20137.166L518.688%20143.98C518.756%20144.021%20518.813%20144.08%20518.852%20144.149C518.892%20144.219%20518.914%20144.297%20518.915%20144.377Z'%20fill='%23F9FBFC'/%3e%3cg%20opacity='0.53'%3e%3cpath%20d='M514.066%20147.566V148.168C514.066%20148.248%20514.046%20148.327%20514.006%20148.396C513.967%20148.466%20513.91%20148.524%20513.841%20148.564C513.772%20148.605%20513.693%20148.626%20513.613%20148.626C513.533%20148.626%20513.454%20148.605%20513.385%20148.565L506.445%20144.579C506.372%20144.541%20506.312%20144.484%20506.269%20144.414C506.227%20144.344%20506.206%20144.263%20506.206%20144.182V143.58C506.208%20143.499%20506.23%20143.421%20506.271%20143.351C506.312%20143.282%20506.37%20143.225%20506.44%20143.185C506.51%20143.145%20506.588%20143.124%20506.669%20143.123C506.749%20143.123%20506.828%20143.143%20506.898%20143.182L513.828%20147.157C513.9%20147.198%20513.96%20147.257%20514.002%20147.329C514.044%20147.401%20514.066%20147.483%20514.066%20147.566Z'%20fill='%23F9FBFC'/%3e%3c/g%3e%3cpath%20d='M517.097%20146.319V146.921C517.095%20147.001%20517.073%20147.08%20517.032%20147.149C516.991%20147.218%20516.933%20147.276%20516.863%20147.316C516.793%20147.356%20516.715%20147.377%20516.634%20147.377C516.554%20147.378%20516.475%20147.357%20516.405%20147.318L506.448%20141.64C506.375%20141.602%20506.314%20141.545%20506.272%20141.475C506.23%20141.405%20506.209%20141.324%20506.209%20141.242V140.641C506.211%20140.56%20506.233%20140.481%20506.274%20140.412C506.315%20140.343%20506.373%20140.286%20506.443%20140.246C506.513%20140.206%20506.591%20140.184%20506.672%20140.184C506.752%20140.183%20506.831%20140.204%20506.901%20140.243L516.87%20145.921C516.939%20145.962%20516.997%20146.02%20517.037%20146.089C517.077%20146.159%20517.097%20146.238%20517.097%20146.319Z'%20fill='%23F9FBFC'/%3e%3cpath%20d='M284.927%2030.6317C286.323%2031.5387%20287.484%2032.7638%20288.316%2034.2068C289.148%2035.6497%20289.627%2037.2695%20289.713%2038.9333C289.713%2041.9883%20287.558%2043.2148%20284.904%2041.6816C283.508%2040.7745%20282.345%2039.5496%20281.512%2038.1069C280.678%2036.6641%20280.197%2035.0444%20280.107%2033.38C280.119%2030.3818%20282.273%2029.0872%20284.927%2030.6317Z'%20stroke='%23E6F4FF'%20stroke-width='0.75'%20stroke-miterlimit='10'/%3e%3cpath%20d='M286.657%2034.6392L287.689%2036.4222L283.754%2038.6708L281.837%2035.3546L282.869%2034.7641L283.754%2036.2972L286.657%2034.6392Z'%20fill='white'/%3e%3cpath%20d='M605.057%2054.7488L606.134%2057.6788L609.071%2058.769L606.134%2059.8592L605.057%2062.7892L603.968%2059.8592L601.031%2058.769L603.968%2057.6788L605.057%2054.7488Z'%20fill='white'/%3e%3cpath%20d='M618.664%2045.6648L619.742%2048.5948L622.679%2049.685L619.742%2050.7753L618.664%2053.7052L617.575%2050.7753L614.638%2049.685L617.575%2048.5948L618.664%2045.6648Z'%20fill='white'/%3e%3cpath%20d='M628.591%2059.0103L629.362%2061.1112L631.472%2061.8948L629.362%2062.6784L628.591%2064.7794L627.809%2062.6784L625.699%2061.8948L627.809%2061.1112L628.591%2059.0103Z'%20fill='white'/%3e%3cpath%20d='M384.006%20161.057L391.899%20156.435'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M352.2%20179.716L380.563%20163.078'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M352.575%20180.809C352.575%20181.261%20352.44%20181.702%20352.189%20182.076C351.937%20182.451%20351.579%20182.742%20351.161%20182.912C350.744%20183.082%20350.285%20183.124%20349.843%20183.032C349.402%20182.939%20348.998%20182.717%20348.683%20182.394C348.368%20182.07%20348.157%20181.66%20348.076%20181.216C347.995%20180.772%20348.048%20180.314%20348.228%20179.9C348.409%20179.486%20348.708%20179.135%20349.088%20178.892C349.469%20178.65%20349.913%20178.526%20350.364%20178.538C350.955%20178.552%20351.518%20178.798%20351.931%20179.223C352.344%20179.647%20352.575%20180.216%20352.575%20180.809Z'%20stroke='%23E6F4FF'%20stroke-miterlimit='10'/%3e%3cpath%20d='M559.788%2027.6204L567.681%2022.9983'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M527.982%2046.2785L556.346%2029.6411'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M528.358%2047.4156C528.358%2047.8648%20528.224%2048.304%20527.975%2048.6775C527.726%2049.051%20527.372%2049.3421%20526.957%2049.514C526.543%2049.6859%20526.087%2049.7309%20525.647%2049.6433C525.207%2049.5556%20524.803%2049.3393%20524.486%2049.0217C524.168%2048.704%20523.952%2048.2993%20523.865%2047.8587C523.777%2047.4181%20523.822%2046.9614%20523.994%2046.5464C524.166%2046.1314%20524.456%2045.7767%20524.829%2045.5271C525.202%2045.2775%20525.641%2045.1443%20526.089%2045.1443C526.691%2045.1443%20527.268%2045.3836%20527.693%2045.8095C528.119%2046.2355%20528.358%2046.8132%20528.358%2047.4156Z'%20stroke='%23E6F4FF'%20stroke-miterlimit='10'/%3e%3cpath%20d='M641.44%2021.9437L649.333%2017.3215'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M609.635%2040.5979L637.999%2023.9604'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M610.014%2041.733C610.014%2042.1822%20609.881%2042.6214%20609.632%2042.9949C609.383%2043.3684%20609.028%2043.6595%20608.614%2043.8314C608.199%2044.0033%20607.743%2044.0483%20607.303%2043.9607C606.863%2043.873%20606.459%2043.6567%20606.142%2043.3391C605.825%2043.0214%20605.609%2042.6167%20605.521%2042.1761C605.434%2041.7355%20605.479%2041.2788%20605.65%2040.8638C605.822%2040.4488%20606.113%2040.094%20606.486%2039.8445C606.859%2039.5949%20607.297%2039.4617%20607.746%2039.4617C608.347%2039.4617%20608.924%2039.701%20609.35%2040.1269C609.775%2040.5529%20610.014%2041.1306%20610.014%2041.733Z'%20stroke='%23E6F4FF'%20stroke-miterlimit='10'/%3e%3cpath%20d='M10.4121%20314.616L2.53021%20309.993'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M42.2219%20333.27L13.8471%20316.633'%20stroke='%23E6F4FF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M41.8344%20334.359C41.8344%20334.808%2041.9675%20335.247%2042.2167%20335.621C42.4659%20335.994%2042.8202%20336.285%2043.2346%20336.457C43.6491%20336.629%2044.1051%20336.674%2044.5451%20336.586C44.9851%20336.499%2045.3892%20336.282%2045.7065%20335.965C46.0237%20335.647%2046.2397%20335.242%2046.3272%20334.802C46.4147%20334.361%2046.3698%20333.905%2046.1981%20333.49C46.0265%20333.074%2045.7357%20332.72%2045.3627%20332.47C44.9897%20332.221%2044.5512%20332.087%2044.1026%20332.087C43.5011%20332.087%2042.9241%20332.327%2042.4988%20332.753C42.0734%20333.179%2041.8344%20333.756%2041.8344%20334.359Z'%20stroke='%23E6F4FF'%20stroke-miterlimit='10'/%3e%3cpath%20d='M537.046%20165.261V166.181L545.495%20171.075V170.144L537.046%20165.261Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M541.227%20165.537V166.457L545.502%20168.932V168.012L541.227%20165.537Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M543.852%20164.374V165.305L545.507%20166.27L545.519%20165.339L543.852%20164.374Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M544.63%20195.469C544.85%20195.797%20545.136%20196.075%20545.47%20196.287L545.663%20196.389C545.322%20196.264%20544.982%20196.105%20544.63%20195.935V195.469Z'%20fill='%23747878'/%3e%3cpath%20d='M544.5%20177.641L544%20177.322L544.114%20177.39L544.432%20177.595L544.5%20177.641Z'%20fill='%236C7070'/%3e%3cpath%20d='M544.209%20192.554L544.437%20192.668L544.209%20192.554Z'%20fill='%23747878'/%3e%3cpath%20d='M545.176%20193C545.002%20192.949%20544.817%20192.949%20544.642%20193V192.783C544.816%20192.865%20544.995%20192.937%20545.176%20193Z'%20fill='%23747878'/%3e%3cpath%20d='M545.292%20178.223L545.655%20178.53C545.299%20178.218%20544.919%20177.933%20544.521%20177.677L544.657%20177.768V177.564C544.834%20177.814%20545.048%20178.037%20545.292%20178.223Z'%20fill='%23747878'/%3e%3cpath%20d='M544.046%20174.202C544.273%20174.327%20544.488%20174.463%20544.693%20174.599V175.065C544.513%20175.142%20544.364%20175.276%20544.268%20175.447C544.172%20175.617%20544.134%20175.814%20544.16%20176.008C544.185%20176.567%20544.37%20177.107%20544.693%20177.563V177.768C544.486%20177.618%20544.27%20177.482%20544.046%20177.359C540.44%20175.269%20537.491%20176.95%20537.48%20181.118C537.595%20183.393%20538.247%20185.609%20539.382%20187.583C540.518%20189.557%20542.104%20191.233%20544.012%20192.475L544.216%20192.588L544.454%20192.713L544.659%20192.804V193.02C544.479%20193.095%20544.329%20193.226%20544.231%20193.394C544.133%20193.562%20544.092%20193.758%20544.114%20193.951C544.137%20194.51%20544.323%20195.051%20544.647%20195.507V195.972L544.466%20195.882L544.001%20195.632C538.863%20192.656%20534.724%20185.411%20534.735%20179.562C534.747%20173.713%20538.92%20171.204%20544.046%20174.202Z'%20stroke='%23E6F4FF'%20stroke-width='0.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M545.544%20175.222L545.725%20175.347H545.805C549.516%20178.466%20552.069%20182.747%20553.051%20187.498C553.056%20187.54%20553.056%20187.582%20553.051%20187.623V187.759C553.055%20187.805%20553.055%20187.85%20553.051%20187.896C553.054%20187.941%20553.054%20187.987%20553.051%20188.032V188.168C553.049%20188.214%20553.049%20188.259%20553.051%20188.305C553.051%20188.373%20553.051%20188.407%20553.051%20188.452C553.056%20188.547%20553.056%20188.642%20553.051%20188.736V188.861V190.837C553.048%20190.879%20553.048%20190.92%20553.051%20190.962C553.054%20191.004%20553.054%20191.045%20553.051%20191.087C553.06%20191.128%20553.06%20191.171%20553.051%20191.212C553.059%20191.253%20553.059%20191.295%20553.051%20191.337C553.051%20191.405%20553.051%20191.428%20553.051%20191.462C553.051%20191.496%20553.051%20191.553%20553.051%20191.575C553.051%20191.598%20553.051%20191.757%20553.051%20191.836C553.051%20191.916%20553.051%20191.916%20553.051%20191.95V192.064V192.177V192.279C553.049%20192.317%20553.049%20192.355%20553.051%20192.393V192.507C553.048%20192.544%20553.048%20192.582%20553.051%20192.62C553.047%20192.658%20553.047%20192.696%20553.051%20192.734C552.144%20196.141%20549.309%20197.628%20545.77%20196.356H545.702L545.51%20196.254C545.111%20195.994%20544.779%20195.644%20544.54%20195.232C544.302%20194.819%20544.164%20194.356%20544.137%20193.881C544.115%20193.687%20544.156%20193.492%20544.254%20193.324C544.352%20193.156%20544.502%20193.024%20544.682%20192.949C544.856%20192.899%20545.041%20192.899%20545.215%20192.949H545.283C546.17%20193.309%20547.152%20193.361%20548.073%20193.097H548.186H548.288H548.402L548.492%20193.04H548.594H548.685L548.787%20192.983L548.878%20192.927L548.98%20192.859L549.059%20192.79L549.15%20192.722L549.229%20192.643L549.32%20192.563L549.4%20192.484L549.479%20192.393L549.558%20192.302V192.245V192.177L549.626%20192.075L549.694%20191.973C549.721%20191.937%20549.743%20191.899%20549.762%20191.859L549.831%20191.746V191.643C549.854%20191.608%20549.873%20191.57%20549.887%20191.53C549.892%20191.488%20549.892%20191.446%20549.887%20191.405V191.28V191.155V191.019V190.894C549.884%20190.848%20549.884%20190.803%20549.887%20190.758V190.621C549.884%20190.576%20549.884%20190.53%20549.887%20190.485C549.89%20190.436%20549.89%20190.387%20549.887%20190.337C549.89%20190.284%20549.89%20190.231%20549.887%20190.178C549.892%20190.129%20549.892%20190.08%20549.887%20190.031C549.887%20190.031%20549.887%20189.929%20549.887%20189.883C549.887%20189.838%20549.887%20189.781%20549.887%20189.736C549.887%20189.69%20549.887%20189.622%20549.887%20189.565C549.887%20189.508%20549.887%20189.452%20549.887%20189.406C549.887%20189.361%20549.887%20189.293%20549.887%20189.236V189.065C549.887%20188.997%20549.887%20188.941%20549.887%20188.895C549.893%20188.838%20549.893%20188.781%20549.887%20188.725V188.554C549.894%20188.498%20549.894%20188.441%20549.887%20188.384C549.894%20188.324%20549.894%20188.263%20549.887%20188.202C549.894%20188.146%20549.894%20188.089%20549.887%20188.032C549.887%20187.953%20549.887%20187.896%20549.887%20187.839C549.887%20187.669%20549.887%20187.669%20549.887%20187.498C549.882%20187.438%20549.882%20187.377%20549.887%20187.317C549.883%20187.256%20549.883%20187.195%20549.887%20187.135V186.953C549.887%20186.76%20549.808%20186.59%20549.774%20186.408C549.767%20186.348%20549.767%20186.287%20549.774%20186.226L549.672%20185.863C548.932%20183.323%20547.554%20181.016%20545.668%20179.163L545.555%20179.049L545.419%20178.924L545.351%20178.856L545.271%20178.788L544.897%20178.47C544.665%20178.281%20544.463%20178.059%20544.296%20177.811C543.973%20177.354%20543.788%20176.814%20543.763%20176.255C543.737%20176.061%20543.775%20175.864%20543.872%20175.694C543.968%20175.524%20544.117%20175.39%20544.296%20175.313C544.472%20175.177%20544.684%20175.096%20544.906%20175.079C545.128%20175.063%20545.35%20175.113%20545.544%20175.222Z'%20fill='%2358AFFB'/%3e%3cpath%20d='M545.724%20175.349L545.543%20175.224C545.291%20175.06%20544.985%20175.003%20544.692%20175.065V174.61C544.998%20174.837%20545.395%20175.087%20545.724%20175.349Z'%20fill='%23747878'/%3e%3cpath%20d='M579.805%2062.4946V63.4145L571.356%2068.2978V67.378L579.805%2062.4946Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M575.616%2062.7666V63.6865L571.341%2066.1622V65.231L575.616%2062.7666Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M573%2061.6077V62.5389L571.344%2063.5042L571.333%2062.573L573%2061.6077Z'%20fill='%23E6F4FF'/%3e%3cpath%20d='M548.123%2073.3742L548.214%20102.413L564.726%2092.8622L564.646%2063.8347L548.123%2073.3742Z'%20stroke='%23E6F4FF'%20stroke-width='0.8'%20stroke-miterlimit='10'/%3e%3cpath%20d='M550.291%2074.5995L549.713%2074.2588L549.803%20103.298L550.37%20103.627L550.291%2074.5995Z'%20fill='%23BDC5CB'/%3e%3cpath%20d='M566.803%2065.049L566.236%2064.7083L549.713%2074.2591L550.291%2074.5998L566.803%2065.049Z'%20fill='white'/%3e%3cpath%20d='M550.291%2074.5985L550.371%20103.626L566.883%2094.075L566.803%2065.0476L550.291%2074.5985Z'%20fill='%23EAF1F7'/%3e%3cpath%20d='M561.945%2078.3853L561.957%2079.3051L553.496%2084.1998V83.2686L561.945%2078.3853Z'%20fill='%2394A3C0'/%3e%3cpath%20d='M557.76%2078.6553L557.772%2079.5752L553.496%2082.0509V81.131L557.76%2078.6553Z'%20fill='%2394A3C0'/%3e%3cpath%20d='M555.148%2077.4963L555.16%2078.4276L553.492%2079.3929V78.4616L555.148%2077.4963Z'%20fill='%2394A3C0'/%3e%3cpath%20d='M561.945%2087.6621L561.957%2088.582L553.496%2093.4653V92.5454L561.945%2087.6621Z'%20fill='%2394A3C0'/%3e%3cpath%20d='M557.76%2087.9321L557.772%2088.852L553.496%2091.3278V90.3965L557.76%2087.9321Z'%20fill='%2394A3C0'/%3e%3cpath%20d='M555.148%2086.7771L555.16%2087.7083L553.492%2088.6736V87.731L555.148%2086.7771Z'%20fill='%2394A3C0'/%3e%3c/svg%3e`,bv=`data:image/svg+xml,%3csvg%20width='22'%20height='32'%20viewBox='0%200%2022%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.1593%2014.3814C17.2069%2015.0272%205.56056%2018.3882%205.56056%2018.3882C4.03868%2021.4659%2011.1005%2023.4995%2011.1005%2023.4995C6.62739%2019.7609%2013.9819%2017.901%2018.4833%2016.4868C23.7193%2014.8403%2020.7473%2012.4385%2020.7473%2012.4385C21.0173%2013.2089%2020.6906%2013.8716%2019.1574%2014.3776'%20fill='white'/%3e%3cpath%20d='M19.9428%2015.3237C18.6683%2015.7448%2014.2688%2016.9796%2010.7945%2018.3807C6.36106%2020.1763%2011.1004%2023.5014%2011.1004%2023.5014C6.62729%2019.7628%2013.9818%2017.903%2018.4832%2016.4887C23.7211%2014.8403%2020.7491%2012.4404%2020.7491%2012.4404C21.4477%2013.36%2021.476%2014.8177%2019.9428%2015.3237Z'%20fill='white'/%3e%3cpath%20d='M5.56915%2023.6885C8.14464%2026.9022%2013.0124%2030.0007%2015.7314%2031.5887C16.8794%2032.259%2018.3295%2032.0966%2019.3001%2031.1903C20.1007%2030.4425%2020.1422%2029.1869%2019.3945%2028.3863C19.2472%2028.2277%2019.0754%2028.0955%2018.8847%2027.9936C16.1657%2026.5321%2011.7624%2024.0756%208.74509%2021.923C4.09636%2018.6111%207.66693%2017.7822%207.66693%2017.7822C3.3392%2018.7414%202.58392%2019.9688%205.56915%2023.6828'%20fill='white'/%3e%3cpath%20d='M3.38919%2016.1084C-1.84676%2017.753%201.12525%2020.1567%201.12525%2020.1567C0.853355%2019.3844%201.1819%2018.7235%202.71511%2018.2175C4.67505%2017.5698%2016.312%2014.207%2016.312%2014.207C17.8357%2011.1292%2010.7739%209.09375%2010.7739%209.09375C15.2433%2012.8324%207.88875%2014.6941%203.38919%2016.1084Z'%20fill='white'/%3e%3cpath%20d='M3.38919%2016.1084C-1.84676%2017.753%201.12525%2020.1567%201.12525%2020.1567C0.426624%2019.2371%200.38886%2017.7794%201.92962%2017.2734C3.20604%2016.8523%207.60552%2015.6174%2011.0798%2014.2164C15.5114%2012.4207%2010.7739%209.09375%2010.7739%209.09375C15.2433%2012.8324%207.88875%2014.6941%203.38919%2016.1084Z'%20fill='white'/%3e%3cpath%20d='M2.57331%201.40596C1.77272%202.15368%201.72929%203.40933%202.47701%204.20992C2.62429%204.36853%202.79612%204.5007%202.98682%204.60266C5.70771%206.06412%2010.111%208.51877%2013.1283%2010.6732C17.777%2013.9851%2014.2065%2014.814%2014.2065%2014.814C18.5323%2013.8529%2019.2895%2012.6275%2016.3042%208.9134C13.7287%205.6997%208.86098%202.59929%206.1401%201.01321C4.99397%200.342905%203.54195%200.50529%202.57331%201.41162'%20fill='white'/%3e%3cg%20opacity='0.3'%3e%3cpath%20d='M15.6146%2014.4409C15.8714%2014.3635%2016.1093%2014.2823%2016.3264%2014.1973C16.4284%2014.0293%2016.4945%2013.8404%2016.519%2013.646C16.5473%2013.391%2016.5152%2013.1324%2016.4227%2012.8907C16.3377%2012.6622%2016.2207%2012.447%2016.0791%2012.2487C15.9431%2012.0523%2015.7921%2011.8692%2015.6278%2011.6973C15.303%2011.365%2014.9518%2011.0572%2014.5798%2010.7778C13.8434%2010.2264%2013.0655%209.72607%2012.2895%209.23325C11.5134%208.74232%2010.7223%208.27405%209.92923%207.81333C8.34315%206.89378%206.73441%206.00633%205.13134%205.12077L3.93045%204.45235C3.52826%204.24087%203.17328%203.95009%202.88817%203.597C2.75033%203.41951%202.65026%203.2137%202.5955%202.99467C2.54263%202.77564%202.55396%202.54528%202.6276%202.33191C2.70312%202.11855%202.82019%201.92218%202.97125%201.75413C3.04677%201.66916%203.12797%201.58797%203.21294%201.51055L3.34133%201.40103L3.40931%201.34817L3.44518%201.32173L3.46218%201.30851C3.46218%201.30851%203.47351%201.31795%203.46218%201.29152C3.45085%201.26509%203.46218%201.29152%203.44707%201.28019H3.43763L3.42064%201.29341L3.38476%201.31984L3.31679%201.37082L3.18272%201.48034C3.09587%201.55587%203.01279%201.63706%202.93537%201.72392C2.77488%201.89385%202.65026%202.094%202.56717%202.31303C2.48787%202.53584%202.47276%202.77564%202.52375%203.006C2.5785%203.23447%202.67858%203.44783%202.82019%203.63476C3.1072%204.00107%203.46595%204.30507%203.8738%204.52977L5.06525%205.21707C6.657%206.13662%208.24874%207.03728%209.81783%207.9776C10.6014%208.44965%2011.3794%208.93303%2012.1479%209.43151C12.9145%209.92999%2013.6754%2010.4455%2014.3929%2010.9968C14.7498%2011.2725%2015.0821%2011.5765%2015.3918%2011.905C15.6977%2012.2166%2015.9375%2012.5867%2016.0998%2012.9926C16.1678%2013.1833%2016.1924%2013.3892%2016.1678%2013.5912C16.1376%2013.7876%2016.0564%2013.9745%2015.9299%2014.1293C15.8355%2014.2445%2015.7279%2014.3484%2015.607%2014.4371'%20fill='white'/%3e%3c/g%3e%3c/svg%3e`,xv=`data:image/svg+xml,%3csvg%20width='89'%20height='21'%20viewBox='0%200%2089%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.4537%209.65056L5.6297%2017.2781H12.9309C13.4136%2017.243%2013.8916%2017.3924%2014.2685%2017.696C14.4166%2017.8312%2014.5335%2017.997%2014.6112%2018.1818C14.6889%2018.3667%2014.7255%2018.5662%2014.7185%2018.7666C14.7242%2018.9592%2014.6875%2019.1507%2014.6111%2019.3276C14.5346%2019.5045%2014.4202%2019.6624%2014.2759%2019.7902C13.9792%2020.0539%2013.5309%2020.1858%2012.9309%2020.1858H2.83086C2.12127%2020.1858%201.59463%2020.0325%201.24107%2019.7209C1.0652%2019.5615%200.926946%2019.3651%200.836296%2019.1457C0.745646%2018.9264%200.704869%2018.6896%200.716905%2018.4526C0.728826%2018.0998%200.858518%2017.7612%201.0853%2017.4908C1.3309%2017.1611%201.84023%2016.5677%202.61329%2015.7106C3.43744%2014.8007%204.17918%2013.9766%204.83851%2013.2381C5.50608%2012.4964%206.12667%2011.8115%206.70028%2011.1687C7.27389%2010.5258%207.74861%209.98434%208.1269%209.5393C8.50519%209.09426%208.80683%208.71103%209.03429%208.39208H3.5009C2.9168%208.41478%202.33277%208.34553%201.77017%208.18686C1.37787%208.0517%201.18173%207.69237%201.18173%207.10887C1.17386%206.91572%201.2098%206.7233%201.28688%206.54603C1.36395%206.36876%201.48015%206.21123%201.62677%206.08526C1.98683%205.80907%202.43488%205.6729%202.88773%205.70203H11.4425C12.0692%205.66774%2012.6949%205.78744%2013.2647%206.05065C13.6867%206.28306%2013.8985%206.69926%2013.9001%207.29924C13.8974%207.51195%2013.8555%207.72233%2013.7765%207.91984C13.7093%208.10655%2013.6179%208.28361%2013.5045%208.44647C13.4032%208.58246%2013.2573%208.74811%2013.0941%208.94097C12.9309%209.13382%2012.7084%209.37118%2012.4537%209.64562'%20fill='white'/%3e%3cpath%20d='M17.2637%203.64451C16.7764%203.65633%2016.3022%203.4862%2015.9335%203.16732C15.7567%202.99393%2015.6165%202.78678%2015.5212%202.55816C15.4259%202.32955%2015.3776%202.08413%2015.3789%201.83647C15.3803%201.58881%2015.4314%201.34394%2015.5292%201.11641C15.6271%200.888871%2015.7696%200.683299%2015.9483%200.511889C16.3048%200.178623%2016.7758%20-0.00464918%2017.2637%208.96584e-05C17.7334%20-0.00408682%2018.1889%200.160906%2018.5469%200.464912C18.7373%200.632%2018.8868%200.84066%2018.9837%201.07475C19.0806%201.30884%2019.1223%201.56208%2019.1057%201.81488C19.1194%202.06527%2019.0778%202.31562%2018.9838%202.5481C18.8898%202.78058%2018.7457%202.98947%2018.5617%203.15991C18.2073%203.48319%2017.7434%203.65992%2017.2637%203.6544M19.1057%207.50404V18.2716C19.1057%2019.0134%2018.9301%2019.5821%2018.5741%2019.9628C18.4037%2020.15%2018.1948%2020.2981%2017.9618%2020.3972C17.7288%2020.4962%2017.4772%2020.5437%2017.2241%2020.5364C16.9723%2020.5445%2016.7219%2020.4961%2016.4913%2020.3947C16.2607%2020.2933%2016.0557%2020.1415%2015.8915%2019.9505C15.5503%2019.5598%2015.3797%2018.9986%2015.3797%2018.2716V7.60294C15.3797%206.86614%2015.5503%206.31066%2015.8915%205.93649C16.0602%205.75283%2016.2667%205.6078%2016.4967%205.51136C16.7267%205.41491%2016.9749%205.36933%2017.2241%205.37771C17.4758%205.37068%2017.7261%205.41681%2017.9587%205.5131C18.1913%205.60938%2018.401%205.75366%2018.5741%205.93649C18.9496%206.3654%2019.1406%206.92517%2019.1057%207.49415'%20fill='white'/%3e%3cpath%20d='M24.8301%207.43997V7.88996C25.3957%207.10255%2026.1308%206.45199%2026.9811%205.98616C27.8125%205.56827%2028.7334%205.3595%2029.6637%205.37793C30.5817%205.36311%2031.4882%205.58356%2032.2969%206.0183C33.0505%206.42702%2033.6562%207.06291%2034.0276%207.83557C34.2757%208.29687%2034.4375%208.79962%2034.5048%209.31905C34.5864%209.98918%2034.6227%2010.664%2034.6136%2011.3391V18.262C34.6136%2019.0087%2034.443%2019.5724%2034.1018%2019.9531C33.9362%2020.141%2033.731%2020.2899%2033.501%2020.3891C33.271%2020.4883%2033.0219%2020.5353%2032.7716%2020.5268C32.5172%2020.5353%2032.2641%2020.4872%2032.0306%2020.3858C31.7971%2020.2845%2031.5891%2020.1325%2031.4217%2019.9408C31.0755%2019.5501%2030.9024%2018.9889%2030.9024%2018.262V12.0511C30.9024%2010.8149%2030.7318%209.88524%2030.3906%209.23251C30.0494%208.57978%2029.3695%208.25836%2028.3508%208.25836C27.6969%208.25479%2027.0594%208.46296%2026.5336%208.85175C25.9783%209.26214%2025.5602%209.83104%2025.3344%2010.4836C25.1515%2011.0374%2025.06%2012.0742%2025.06%2013.594V18.262C25.06%2019.0169%2024.8853%2019.5831%2024.5358%2019.9606C24.3635%2020.1468%2024.153%2020.2938%2023.9188%2020.3915C23.6846%2020.4892%2023.4321%2020.5353%2023.1784%2020.5268C22.9279%2020.5335%2022.679%2020.4845%2022.4498%2020.3831C22.2206%2020.2818%2022.0168%2020.1307%2021.8532%2019.9408C21.5071%2019.5501%2021.334%2018.9889%2021.334%2018.262V7.49436C21.334%206.78477%2021.4897%206.25813%2021.7988%205.90457C21.958%205.72826%2022.1543%205.58954%2022.3737%205.49845C22.5931%205.40737%2022.8299%205.3662%2023.0672%205.37793C23.3787%205.37314%2023.6856%205.4535%2023.9548%205.61034C24.2293%205.77571%2024.45%206.01702%2024.5902%206.30511C24.7616%206.6584%2024.8463%207.04742%2024.8375%207.43997'%20fill='white'/%3e%3cpath%20d='M40.2031%207.43997V7.88996C40.7688%207.10255%2041.5038%206.45199%2042.3542%205.98616C43.1847%205.56829%2044.1047%205.3595%2045.0343%205.37793C45.9531%205.36279%2046.8605%205.58325%2047.67%206.0183C48.4231%206.4277%2049.0285%207.06339%2049.4007%207.83557C49.6477%208.29734%2049.8093%208.79988%2049.8779%209.31905C49.9582%209.98929%2049.9945%2010.6641%2049.9867%2011.3391V18.262C49.9867%2019.0087%2049.8161%2019.5724%2049.4749%2019.9531C49.3093%2020.141%2049.1041%2020.2899%2048.8741%2020.3891C48.6441%2020.4883%2048.395%2020.5353%2048.1447%2020.5268C47.89%2020.5347%2047.6367%2020.4862%2047.403%2020.3849C47.1692%2020.2836%2046.9606%2020.132%2046.7922%2019.9408C46.4461%2019.5501%2046.2755%2018.9889%2046.2755%2018.262V12.0511C46.2755%2010.8149%2046.1049%209.88524%2045.7637%209.23251C45.4225%208.57978%2044.7401%208.25836%2043.7214%208.25836C43.0683%208.25514%2042.4317%208.4633%2041.9066%208.85175C41.3499%209.26122%2040.9308%209.83035%2040.705%2010.4836C40.5237%2011.0374%2040.433%2012.0742%2040.433%2013.594V18.262C40.433%2019.0169%2040.2575%2019.5831%2039.9064%2019.9606C39.7344%2020.1472%2039.524%2020.2945%2039.2897%2020.3922C39.0554%2020.4899%2038.8027%2020.5358%2038.549%2020.5268C38.2989%2020.5332%2038.0505%2020.4839%2037.8217%2020.3826C37.5929%2020.2813%2037.3896%2020.1303%2037.2263%2019.9408C36.8801%2019.5501%2036.707%2018.9889%2036.707%2018.262V7.49436C36.707%206.78477%2036.8628%206.25813%2037.1719%205.90457C37.331%205.72826%2037.5274%205.58954%2037.7468%205.49845C37.9661%205.40737%2038.203%205.3662%2038.4402%205.37793C38.7517%205.37314%2039.0587%205.4535%2039.3279%205.61034C39.6023%205.77571%2039.823%206.01702%2039.9633%206.30511C40.1346%206.6584%2040.2194%207.04742%2040.2105%207.43997'%20fill='white'/%3e%3cpath%20d='M62.5909%2013.8682H55.3045C55.2961%2014.6445%2055.4706%2015.4119%2055.8138%2016.1083C56.0972%2016.7002%2056.5443%2017.1985%2057.1021%2017.5442C57.6599%2017.8899%2058.3051%2018.0686%2058.9613%2018.059C59.3736%2018.0634%2059.7846%2018.0109%2060.1827%2017.9033C60.5618%2017.7916%2060.9225%2017.625%2061.2533%2017.4088C61.5893%2017.1934%2061.9091%2016.9538%2062.2101%2016.6918C62.5002%2016.4363%2062.8777%2016.091%2063.3425%2015.6558C63.5761%2015.4765%2063.8671%2015.3885%2064.1609%2015.4086C64.4983%2015.3935%2064.8292%2015.5056%2065.0881%2015.7226C65.2092%2015.835%2065.304%2015.973%2065.3656%2016.1264C65.4271%2016.2799%2065.454%2016.4451%2065.4441%2016.6102C65.4164%2017.0309%2065.2801%2017.4372%2065.0485%2017.7895C64.736%2018.2937%2064.3308%2018.7342%2063.8543%2019.0876C63.2467%2019.5398%2062.5682%2019.8882%2061.8467%2020.1186C60.9495%2020.4048%2060.0116%2020.5426%2059.0701%2020.5266C56.6767%2020.5266%2054.8158%2019.8442%2053.4872%2018.4794C52.1587%2017.1146%2051.4944%2015.2635%2051.4944%2012.9262C51.4863%2011.8837%2051.6534%2010.8473%2051.9889%209.86033C52.2925%208.96156%2052.7819%208.1368%2053.4254%207.43978C54.0703%206.75306%2054.8635%206.22281%2055.7446%205.88954C56.7214%205.5203%2057.7588%205.33747%2058.803%205.35054C60.1121%205.31362%2061.4066%205.63234%2062.5488%206.27277C63.5369%206.83149%2064.3482%207.65648%2064.8903%208.65376C65.3902%209.56343%2065.6569%2010.5828%2065.6666%2011.6207C65.6666%2012.5586%2065.3988%2013.166%2064.8631%2013.4429C64.3241%2013.7199%2063.57%2013.8583%2062.5958%2013.8583M55.3094%2011.7443H62.0642C61.9736%2010.4718%2061.6299%209.5183%2061.0332%208.8837C60.7303%208.56817%2060.3638%208.32058%2059.9581%208.15733C59.5523%207.99408%2059.1164%207.91889%2058.6794%207.93674C58.2515%207.92332%2057.8257%208.00227%2057.431%208.16824C57.0364%208.33422%2056.6821%208.5833%2056.3924%208.89853C55.7957%209.53808%2055.4347%2010.4867%2055.3094%2011.7443Z'%20fill='white'/%3e%3cpath%20d='M75.0025%2018.9842L72.3001%2015.0135L69.5309%2018.9842C69.2359%2019.4182%2068.8925%2019.8172%2068.5073%2020.1735C68.21%2020.4156%2067.8347%2020.5412%2067.4516%2020.5271C67.0071%2020.5377%2066.5751%2020.3796%2066.2425%2020.0845C66.0908%2019.9616%2065.9679%2019.8069%2065.8825%2019.6313C65.797%2019.4557%2065.7511%2019.2635%2065.748%2019.0683C65.748%2018.676%2066.0027%2018.1164%2066.512%2017.3895L69.882%2012.5583L66.8928%208.53063C66.3736%207.86801%2066.1164%207.2944%2066.1164%206.7999C66.1177%206.61148%2066.1597%206.42556%2066.2395%206.25486C66.3193%206.08417%2066.435%205.93273%2066.5788%205.81092C66.9148%205.51876%2067.3505%205.36733%2067.7952%205.38813C68.1892%205.37419%2068.5745%205.50527%2068.8782%205.75652C69.2554%206.10401%2069.5921%206.49301%2069.882%206.91611L72.2976%2010.2193L74.6465%206.91611C74.9393%206.48057%2075.2857%206.08351%2075.6775%205.73427C75.9802%205.4913%2076.3601%205.36497%2076.7481%205.37823C77.1925%205.36149%2077.6274%205.5094%2077.9695%205.79361C78.1225%205.9126%2078.2465%206.06477%2078.3321%206.23866C78.4178%206.41254%2078.4629%206.6036%2078.464%206.79743C78.4633%207.08041%2078.3955%207.3592%2078.2661%207.61087C78.0919%207.93536%2077.8883%208.24322%2077.6579%208.53063L74.6489%2012.5583L78.0189%2017.3895C78.5447%2018.1444%2078.8084%2018.7131%2078.8101%2019.0955C78.8094%2019.2901%2078.7645%2019.482%2078.6789%2019.6568C78.5932%2019.8315%2078.469%2019.9845%2078.3156%2020.1043C77.9771%2020.3904%2077.5446%2020.5411%2077.1016%2020.5271C76.7074%2020.538%2076.3223%2020.4073%2076.0162%2020.1587C75.6305%2019.8104%2075.2892%2019.416%2075%2018.9842'%20fill='white'/%3e%3cpath%20d='M80.1811%205.70949H80.5915V3.46944C80.5915%202.86863%2080.6064%202.39886%2080.6385%202.05766C80.6608%201.74802%2080.752%201.44728%2080.9055%201.17746C81.0552%200.917818%2081.2721%200.703405%2081.5335%200.556866C81.8103%200.392732%2082.1266%200.307244%2082.4484%200.309618C82.9289%200.31336%2083.3891%200.504012%2083.7316%200.841198C83.9854%201.06984%2084.1588%201.37415%2084.2261%201.70904C84.3039%202.18956%2084.3378%202.67618%2084.3274%203.16285V5.70949H85.6922C86.1277%205.67931%2086.5587%205.81242%2086.9013%206.08284C87.037%206.20323%2087.1446%206.35203%2087.2164%206.51868C87.2882%206.68533%2087.3224%206.86574%2087.3167%207.0471C87.3338%207.26146%2087.2865%207.47606%2087.1808%207.66332C87.075%207.85057%2086.9157%208.00192%2086.7233%208.0979C86.187%208.32481%2085.6062%208.4271%2085.0247%208.39707H84.3274V15.2483C84.3202%2015.6975%2084.3409%2016.1467%2084.3892%2016.5933C84.4163%2016.8756%2084.5304%2017.1426%2084.7156%2017.3573C84.8317%2017.4641%2084.969%2017.5452%2085.1185%2017.5955C85.268%2017.6457%2085.4264%2017.664%2085.5835%2017.6491C85.8823%2017.6397%2086.1795%2017.6016%2086.4711%2017.5353C86.7574%2017.4677%2087.0498%2017.4288%2087.3439%2017.4191C87.4965%2017.4205%2087.6473%2017.4533%2087.7868%2017.5154C87.9263%2017.5775%2088.0516%2017.6676%2088.1548%2017.7801C88.2737%2017.8963%2088.3673%2018.0357%2088.4298%2018.1897C88.4924%2018.3437%2088.5225%2018.509%2088.5183%2018.6751C88.5183%2019.2735%2088.1886%2019.7325%2087.5293%2020.0523C86.87%2020.3721%2085.9288%2020.5311%2084.7057%2020.5295C83.5387%2020.5295%2082.6585%2020.3342%2082.0577%2019.9435C81.469%2019.5736%2081.0444%2018.9924%2080.8709%2018.3191C80.6615%2017.4107%2080.5677%2016.4794%2080.5915%2015.5475V8.39459H80.097C79.6515%208.42648%2079.2102%208.28969%2078.8608%208.01136C78.7234%207.8914%2078.6142%207.74251%2078.5411%207.57537C78.468%207.40823%2078.4328%207.22698%2078.438%207.04463C78.4337%206.8606%2078.4716%206.67803%2078.5487%206.5109C78.6259%206.34376%2078.7402%206.19649%2078.8831%206.08036C79.2545%205.807%2079.7111%205.67466%2080.1712%205.70702'%20fill='white'/%3e%3c/svg%3e`,Sv=`data:image/svg+xml,%3csvg%20width='7'%20height='13'%20viewBox='0%200%207%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.04492%206.50535L0.757579%2010.7927C0.457835%2011.0924%200.457835%2011.5784%200.757579%2011.8782C1.05732%2012.1779%201.54331%2012.1779%201.84305%2011.8782L6.67312%207.04809C6.97287%206.74835%206.97287%206.26236%206.67312%205.96262L1.84305%201.13255C1.54331%200.832802%201.05732%200.832802%200.757579%201.13255C0.457835%201.43229%200.457835%201.91827%200.757579%202.21802L5.04492%206.50535Z'%20fill='white'/%3e%3c/svg%3e`,Cv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10%2019C5.5544%2017.9895%202%2013.6998%202%209.18182V4.27273L10%201L18%204.27273V9.18182C18%2013.7015%2014.4456%2017.9895%2010%2019ZM3.6%205.09091V9.18182C3.64572%2011.0736%204.29629%2012.8979%205.45214%2014.3755C6.608%2015.8532%208.20545%2016.9028%2010%2017.3636C11.7946%2016.9028%2013.392%2015.8532%2014.5479%2014.3755C15.7037%2012.8979%2016.3543%2011.0736%2016.4%209.18182V5.09091L10%202.63636L3.6%205.09091Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M10%209.18185C11.1046%209.18185%2012%208.26607%2012%207.1364C12%206.00672%2011.1046%205.09094%2010%205.09094C8.89543%205.09094%208%206.00672%208%207.1364C8%208.26607%208.89543%209.18185%2010%209.18185Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M6%2012.4545C6.39431%2013.1894%206.97247%2013.804%207.67531%2014.2353C8.37815%2014.6666%209.18042%2014.8991%2010%2014.9091C10.8196%2014.8991%2011.6219%2014.6666%2012.3247%2014.2353C13.0275%2013.804%2013.6057%2013.1894%2014%2012.4545C13.98%2010.9033%2011.3264%2010%2010%2010C8.6664%2010%206.02%2010.9033%206%2012.4545Z'%20fill='%23C9C9E8'/%3e%3c/svg%3e`,wv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.66669%202.5H13.3334C14.2538%202.5%2015%203.24619%2015%204.16667V17.5L10%2015L5%2017.5V4.16667C5%203.24619%205.74621%202.5%206.66669%202.5Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.91669%207.5H12.0834'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.91669%2010.8333H10.8334'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M15%205.83333H16.25C16.9404%205.83333%2017.5%206.39298%2017.5%207.08333V13.75C17.5%2014.4404%2016.9404%2015%2016.25%2015H15'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5%2015H3.75C3.05964%2015%202.5%2014.4404%202.5%2013.75V7.08333C2.5%206.39298%203.05964%205.83333%203.75%205.83333H5'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Tv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17%205.3335H3.66667C2.74619%205.3335%202%206.07969%202%207.00016V15.3335C2%2016.254%202.74619%2017.0002%203.66667%2017.0002H17C17.9205%2017.0002%2018.6667%2016.254%2018.6667%2015.3335V7.00016C18.6667%206.07969%2017.9205%205.3335%2017%205.3335Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.6667%2017V3.66667C13.6667%203.22464%2013.4911%202.80072%2013.1785%202.48816C12.866%202.17559%2012.442%202%2012%202H8.66667C8.22464%202%207.80072%202.17559%207.48816%202.48816C7.1756%202.80072%207%203.22464%207%203.66667V17'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Ev=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.1667%2017.5V15.8333C19.1661%2015.0948%2018.9203%2014.3773%2018.4678%2013.7936C18.0153%2013.2099%2017.3818%2012.793%2016.6667%2012.6083'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.1667%2017.5V15.8333C14.1667%2014.9493%2013.8155%2014.1014%2013.1904%2013.4763C12.5652%2012.8512%2011.7174%2012.5%2010.8333%2012.5H4.16668C3.28262%2012.5%202.43478%2012.8512%201.80965%2013.4763C1.18453%2014.1014%200.833344%2014.9493%200.833344%2015.8333V17.5'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.3333%202.60834C14.0504%202.79192%2014.6859%203.20892%2015.1397%203.7936C15.5935%204.37827%2015.8399%205.09736%2015.8399%205.8375C15.8399%206.57765%2015.5935%207.29674%2015.1397%207.88141C14.6859%208.46609%2014.0504%208.88309%2013.3333%209.06667'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.49999%209.16667C9.34094%209.16667%2010.8333%207.67428%2010.8333%205.83333C10.8333%203.99238%209.34094%202.5%207.49999%202.5C5.65904%202.5%204.16666%203.99238%204.16666%205.83333C4.16666%207.67428%205.65904%209.16667%207.49999%209.16667Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Dv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.33331%205.83333C3.33331%204.91286%204.07951%204.16667%204.99998%204.16667H11.6666C12.5871%204.16667%2013.3333%204.91286%2013.3333%205.83333V12.5C13.3333%2013.4205%2012.5871%2014.1667%2011.6666%2014.1667H4.99998C4.07951%2014.1667%203.33331%2013.4205%203.33331%2012.5V5.83333Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.24998%208.33333C6.24998%207.8731%206.62308%207.5%207.08331%207.5H9.16665C9.62688%207.5%209.99998%207.8731%209.99998%208.33333C9.99998%208.79357%209.62688%209.16667%209.16665%209.16667H7.08331C6.62308%209.16667%206.24998%208.79357%206.24998%208.33333Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.83331%2011.6667H10.8333'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.3333%207.5H15.8333C16.7538%207.5%2017.5%208.24619%2017.5%209.16667C17.5%2010.0871%2016.7538%2010.8333%2015.8333%2010.8333H13.3333'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.3333%2014.1667L15.4166%2016.25'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.25%2017.5C16.9403%2017.5%2017.5%2016.9404%2017.5%2016.25C17.5%2015.5596%2016.9403%2015%2016.25%2015C15.5596%2015%2015%2015.5596%2015%2016.25C15%2016.9404%2015.5596%2017.5%2016.25%2017.5Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.49998%203.33333C3.19034%203.33333%203.74998%202.77369%203.74998%202.08333C3.74998%201.39298%203.19034%200.833333%202.49998%200.833333C1.80962%200.833333%201.24998%201.39298%201.24998%202.08333C1.24998%202.77369%201.80962%203.33333%202.49998%203.33333Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M3.41665%202.91667L4.99998%204.16667'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Ov=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.5%2011.6667H11.6667V17.5001H17.5V11.6667Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.33333%2011.6667H2.5V17.5001H8.33333V11.6667Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M17.5%202.5H11.6667V8.33333H17.5V2.5Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.33333%202.5H2.5V8.33333H8.33333V2.5Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,kv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.33331%208.33333H16.6666V16.25C16.6666%2016.7102%2016.2936%2017.0833%2015.8333%2017.0833H4.16665C3.70641%2017.0833%203.33331%2016.7102%203.33331%2016.25V8.33333Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.66669%208.33333V5.41667C6.66669%204.95643%207.03978%204.58333%207.50002%204.58333H12.5C12.9603%204.58333%2013.3334%204.95643%2013.3334%205.41667V8.33333'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.5%208.33333H17.5'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'/%3e%3cpath%20d='M7.5%2012.0833H12.5'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'/%3e%3cpath%20d='M10%209.58333V14.5833'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'/%3e%3cpath%20d='M5.83331%202.91667H14.1666'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'/%3e%3c/svg%3e`,Av=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10%201C5.02991%201%201%205.02991%201%2010C1%2014.9701%205.02991%2019%2010%2019C14.9701%2019%2019%2014.9701%2019%2010C19%205.02991%2014.9701%201%2010%201ZM10%2017.4732C5.87366%2017.4732%202.52679%2014.1263%202.52679%2010C2.52679%205.87366%205.87366%202.52679%2010%202.52679C14.1263%202.52679%2017.4732%205.87366%2017.4732%2010C17.4732%2014.1263%2014.1263%2017.4732%2010%2017.4732Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M12.242%206.07661C11.6393%205.54826%2010.8437%205.25897%209.99999%205.25897C9.15624%205.25897%208.36071%205.55027%207.75803%206.07661C7.13124%206.62504%206.78571%207.36232%206.78571%208.15183V8.30451C6.78571%208.3929%206.85803%208.46522%206.94642%208.46522H7.91071C7.9991%208.46522%208.07142%208.3929%208.07142%208.30451V8.15183C8.07142%207.26589%208.93727%206.54469%209.99999%206.54469C11.0627%206.54469%2011.9286%207.26589%2011.9286%208.15183C11.9286%208.77661%2011.4866%209.34915%2010.8016%209.61232C10.3757%209.77504%2010.0141%2010.0603%209.7549%2010.434C9.49173%2010.8157%209.35512%2011.2737%209.35512%2011.7378V12.1697C9.35512%2012.2581%209.42745%2012.3304%209.51584%2012.3304H10.4801C10.5685%2012.3304%2010.6408%2012.2581%2010.6408%2012.1697V11.7137C10.6419%2011.5186%2010.7017%2011.3285%2010.8124%2011.1679C10.9231%2011.0074%2011.0797%2010.8839%2011.2616%2010.8137C12.4469%2010.3576%2013.2123%209.31299%2013.2123%208.15183C13.2143%207.36232%2012.8687%206.62504%2012.242%206.07661ZM9.19642%2014.4197C9.19642%2014.6328%209.28108%2014.8372%209.43178%2014.9879C9.58248%2015.1386%209.78687%2015.2233%209.99999%2015.2233C10.2131%2015.2233%2010.4175%2015.1386%2010.5682%2014.9879C10.7189%2014.8372%2010.8036%2014.6328%2010.8036%2014.4197C10.8036%2014.2066%2010.7189%2014.0022%2010.5682%2013.8515C10.4175%2013.7008%2010.2131%2013.6161%209.99999%2013.6161C9.78687%2013.6161%209.58248%2013.7008%209.43178%2013.8515C9.28108%2014.0022%209.19642%2014.2066%209.19642%2014.4197Z'%20fill='%23C9C9E8'/%3e%3c/svg%3e`,jv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%2018.3333C16.3807%2018.3333%2017.5%2017.214%2017.5%2015.8333C17.5%2014.4526%2016.3807%2013.3333%2015%2013.3333C13.6193%2013.3333%2012.5%2014.4526%2012.5%2015.8333C12.5%2017.214%2013.6193%2018.3333%2015%2018.3333Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5%2012.5C6.38071%2012.5%207.5%2011.3807%207.5%2010C7.5%208.61929%206.38071%207.5%205%207.5C3.61929%207.5%202.5%208.61929%202.5%2010C2.5%2011.3807%203.61929%2012.5%205%2012.5Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.15833%2011.2584L12.85%2014.575'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M15%206.66669C16.3807%206.66669%2017.5%205.5474%2017.5%204.16669C17.5%202.78598%2016.3807%201.66669%2015%201.66669C13.6193%201.66669%2012.5%202.78598%2012.5%204.16669C12.5%205.5474%2013.6193%206.66669%2015%206.66669Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.8417%205.42499L7.15833%208.74165'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Mv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.6667%201.66669H5.00001C4.55798%201.66669%204.13406%201.84228%203.8215%202.15484C3.50894%202.4674%203.33334%202.89133%203.33334%203.33335V16.6667C3.33334%2017.1087%203.50894%2017.5326%203.8215%2017.8452C4.13406%2018.1578%204.55798%2018.3334%205.00001%2018.3334H15C15.442%2018.3334%2015.866%2018.1578%2016.1785%2017.8452C16.4911%2017.5326%2016.6667%2017.1087%2016.6667%2016.6667V6.66669L11.6667%201.66669Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.3333%2014.1667H6.66666'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.3333%2010.8333H6.66666'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.33332%207.5H7.49999H6.66666'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.6667%201.66669V6.66669H16.6667'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Nv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_530_15536)'%3e%3cpath%20d='M10%2012.5C11.3807%2012.5%2012.5%2011.3807%2012.5%2010C12.5%208.61929%2011.3807%207.5%2010%207.5C8.61929%207.5%207.5%208.61929%207.5%2010C7.5%2011.3807%208.61929%2012.5%2010%2012.5Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.1667%2012.5C16.0557%2012.7513%2016.0227%2013.0301%2016.0717%2013.3005C16.1207%2013.5708%2016.2496%2013.8202%2016.4417%2014.0166L16.4917%2014.0666C16.6466%2014.2214%2016.7696%2014.4052%2016.8534%2014.6076C16.9373%2014.8099%2016.9805%2015.0268%2016.9805%2015.2458C16.9805%2015.4648%2016.9373%2015.6817%2016.8534%2015.884C16.7696%2016.0864%2016.6466%2016.2702%2016.4917%2016.425C16.3369%2016.5799%2016.1531%2016.7029%2015.9507%2016.7867C15.7484%2016.8706%2015.5315%2016.9138%2015.3125%2016.9138C15.0935%2016.9138%2014.8766%2016.8706%2014.6743%2016.7867C14.4719%2016.7029%2014.2881%2016.5799%2014.1333%2016.425L14.0833%2016.375C13.8869%2016.1829%2013.6375%2016.054%2013.3672%2016.005C13.0968%2015.956%2012.818%2015.989%2012.5667%2016.1C12.3202%2016.2056%2012.11%2016.381%2011.9619%2016.6046C11.8139%2016.8282%2011.7344%2017.0902%2011.7333%2017.3583V17.5C11.7333%2017.942%2011.5577%2018.3659%2011.2452%2018.6785C10.9326%2018.991%2010.5087%2019.1666%2010.0667%2019.1666C9.62465%2019.1666%209.20073%2018.991%208.88817%2018.6785C8.5756%2018.3659%208.40001%2017.942%208.40001%2017.5V17.425C8.39356%2017.1491%208.30427%2016.8816%208.14377%2016.6572C7.98326%2016.4328%207.75896%2016.2619%207.50001%2016.1666C7.24866%2016.0557%206.96985%2016.0226%206.69952%2016.0716C6.42919%2016.1207%206.17974%2016.2495%205.98334%2016.4416L5.93334%2016.4916C5.77855%2016.6466%205.59474%2016.7695%205.39241%2016.8534C5.19008%2016.9373%204.9732%2016.9805%204.75418%2016.9805C4.53515%2016.9805%204.31827%2016.9373%204.11594%2016.8534C3.91361%2016.7695%203.7298%2016.6466%203.57501%2016.4916C3.42005%2016.3369%203.29712%2016.153%203.21324%2015.9507C3.12937%2015.7484%203.0862%2015.5315%203.0862%2015.3125C3.0862%2015.0935%203.12937%2014.8766%203.21324%2014.6742C3.29712%2014.4719%203.42005%2014.2881%203.57501%2014.1333L3.62501%2014.0833C3.81712%2013.8869%203.946%2013.6375%203.99501%2013.3671C4.04403%2013.0968%204.01094%2012.818%203.90001%2012.5666C3.79437%2012.3202%203.61897%2012.11%203.3954%2011.9619C3.17182%2011.8138%202.90983%2011.7344%202.64168%2011.7333H2.50001C2.05798%2011.7333%201.63406%2011.5577%201.3215%2011.2452C1.00894%2010.9326%200.833344%2010.5087%200.833344%2010.0666C0.833344%209.62462%201.00894%209.2007%201.3215%208.88813C1.63406%208.57557%202.05798%208.39998%202.50001%208.39998H2.57501C2.85084%208.39353%203.11835%208.30424%203.34276%208.14374C3.56717%207.98323%203.73811%207.75893%203.83334%207.49998C3.94427%207.24863%203.97736%206.96982%203.92835%206.69949C3.87933%206.42916%203.75046%206.17971%203.55834%205.98331L3.50834%205.93331C3.35338%205.77852%203.23045%205.59471%203.14658%205.39238C3.0627%205.19005%203.01953%204.97317%203.01953%204.75415C3.01953%204.53512%203.0627%204.31824%203.14658%204.11591C3.23045%203.91358%203.35338%203.72977%203.50834%203.57498C3.66313%203.42002%203.84695%203.29709%204.04928%203.21321C4.25161%203.12934%204.46848%203.08617%204.68751%203.08617C4.90654%203.08617%205.12341%203.12934%205.32574%203.21321C5.52807%203.29709%205.71189%203.42002%205.86668%203.57498L5.91668%203.62498C6.11308%203.81709%206.36252%203.94597%206.63285%203.99498C6.90318%204.044%207.182%204.01091%207.43334%203.89998H7.50001C7.74648%203.79434%207.95669%203.61894%208.10475%203.39537C8.25282%203.17179%208.33227%202.9098%208.33334%202.64165V2.49998C8.33334%202.05795%208.50894%201.63403%208.8215%201.32147C9.13406%201.00891%209.55798%200.833313%2010%200.833313C10.442%200.833313%2010.866%201.00891%2011.1785%201.32147C11.4911%201.63403%2011.6667%202.05795%2011.6667%202.49998V2.57498C11.6677%202.84313%2011.7472%203.10513%2011.8953%203.3287C12.0433%203.55228%2012.2535%203.72768%2012.5%203.83331C12.7514%203.94424%2013.0302%203.97733%2013.3005%203.92832C13.5708%203.8793%2013.8203%203.75043%2014.0167%203.55831L14.0667%203.50831C14.2215%203.35335%2014.4053%203.23042%2014.6076%203.14655C14.8099%203.06267%2015.0268%203.0195%2015.2458%203.0195C15.4649%203.0195%2015.6817%203.06267%2015.8841%203.14655C16.0864%203.23042%2016.2702%203.35335%2016.425%203.50831C16.58%203.6631%2016.7029%203.84692%2016.7868%204.04925C16.8706%204.25158%2016.9138%204.46845%2016.9138%204.68748C16.9138%204.90651%2016.8706%205.12338%2016.7868%205.32571C16.7029%205.52804%2016.58%205.71186%2016.425%205.86665L16.375%205.91665C16.1829%206.11305%2016.054%206.36249%2016.005%206.63282C15.956%206.90315%2015.9891%207.18197%2016.1%207.43331V7.49998C16.2056%207.74645%2016.381%207.95666%2016.6046%208.10472C16.8282%208.25279%2017.0902%208.33224%2017.3583%208.33331H17.5C17.942%208.33331%2018.366%208.50891%2018.6785%208.82147C18.9911%209.13403%2019.1667%209.55795%2019.1667%209.99998C19.1667%2010.442%2018.9911%2010.8659%2018.6785%2011.1785C18.366%2011.4911%2017.942%2011.6666%2017.5%2011.6666H17.425C17.1569%2011.6677%2016.8949%2011.7472%2016.6713%2011.8952C16.4477%2012.0433%2016.2723%2012.2535%2016.1667%2012.5V12.5Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_530_15536'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,Pv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%204.33333C1%203.18274%201.93274%202.25%203.08333%202.25H16.4167C17.5673%202.25%2018.5%203.18274%2018.5%204.33333V16C18.5%2017.1506%2017.5673%2018.0833%2016.4167%2018.0833H3.08333C1.93274%2018.0833%201%2017.1506%201%2016V4.33333ZM3.08333%203.08333C2.39298%203.08333%201.83333%203.64298%201.83333%204.33333V16C1.83333%2016.6904%202.39298%2017.25%203.08333%2017.25H16.4167C17.107%2017.25%2017.6667%2016.6904%2017.6667%2016V4.33333C17.6667%203.64298%2017.107%203.08333%2016.4167%203.08333H3.08333Z'%20fill='%23C9C9E8'%20stroke='%23C9C9E8'%20stroke-width='0.6'%20stroke-linejoin='round'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%204.33333C1%203.18274%201.93274%202.25%203.08333%202.25H16.4167C17.5673%202.25%2018.5%203.18274%2018.5%204.33333V6.83333C18.5%207.06345%2018.3135%207.25%2018.0833%207.25H1.41667C1.18655%207.25%201%207.06345%201%206.83333V4.33333ZM3.08333%203.08333C2.39298%203.08333%201.83333%203.64298%201.83333%204.33333V6.41667H17.6667V4.33333C17.6667%203.64298%2017.107%203.08333%2016.4167%203.08333H3.08333Z'%20fill='%23C9C9E8'%20stroke='%23C9C9E8'%20stroke-width='0.6'%20stroke-linejoin='round'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.33333%201V3.91667H3.5V1H4.33333Z'%20fill='%23C9C9E8'%20stroke='%23C9C9E8'%20stroke-width='0.6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.1667%201V3.91667H9.33334V1H10.1667Z'%20fill='%23C9C9E8'%20stroke='%23C9C9E8'%20stroke-width='0.6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%201V3.91667H15.1667V1H16Z'%20fill='%23C9C9E8'%20stroke='%23C9C9E8'%20stroke-width='0.6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.53453%2015.2573C6.43104%2015.1538%206.38944%2015.0036%206.42493%2014.8616L7.01419%2012.5046C7.03251%2012.4313%207.07039%2012.3644%207.12379%2012.311L10.0701%209.36472C10.5582%208.87657%2011.3497%208.87657%2011.8378%209.36472L12.4271%209.95398C12.9152%2010.4421%2012.9152%2011.2336%2012.4271%2011.7217L9.48081%2014.668C9.42741%2014.7214%209.3605%2014.7593%209.28724%2014.7776L6.93022%2015.3669C6.78823%2015.4024%206.63802%2015.3608%206.53453%2015.2573ZM8.97316%2013.9972L11.8378%2011.1325C12.0006%2010.9698%2012.0006%2010.706%2011.8378%2010.5432L11.2486%209.95398C11.0859%209.79126%2010.822%209.79126%2010.6593%209.95398L7.79465%2012.8186L7.40181%2014.39L8.97316%2013.9972Z'%20fill='%23C9C9E8'%20stroke='%23C9C9E8'%20stroke-width='0.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Fv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_530_15505)'%3e%3cpath%20d='M18.3333%201.66669L9.16666%2010.8334'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M18.3333%201.66669L12.5%2018.3334L9.16666%2010.8334L1.66666%207.50002L18.3333%201.66669Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_530_15505'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,Iv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7154_21562)'%3e%3cpath%20d='M4.10156%208.64844H8.24219V9.82031H4.10156V8.64844Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M4.10156%2010.9922H8.24219V12.1641H4.10156V10.9922Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M4.10156%2013.3359H8.24219V14.5078H4.10156V13.3359Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M18.2422%2011.3516H20V0.804688H9.41406V3.96074H4.10156C2.80922%203.96074%201.75781%205.01215%201.75781%206.30449V14.5076C1.75781%2014.9344%201.87301%2015.3345%202.07312%2015.6795H0V16.2654C0%2017.8809%201.31426%2019.1951%202.92969%2019.1951H17.0703C18.6857%2019.1951%2020%2017.8809%2020%2016.2654V15.6795H17.9269C18.127%2015.3345%2018.2422%2014.9344%2018.2422%2014.5076V11.3516ZM10.5859%201.97656H18.8281V10.1797H12.1429L10.5859%2011.7112V1.97656ZM1.27227%2016.8513H7.07031V18.0232H2.92969C2.16578%2018.0232%201.5141%2017.5334%201.27227%2016.8513ZM11.7578%2016.8513V18.0232H8.24219V16.8513H11.7578ZM17.0703%2018.0232H12.9297V16.8513H18.7277C18.4859%2017.5334%2017.8342%2018.0232%2017.0703%2018.0232ZM4.10156%2015.6795C3.45539%2015.6795%202.92969%2015.1538%202.92969%2014.5076V6.30445C2.92969%205.65828%203.45539%205.13258%204.10156%205.13258H9.41406V14.5075L12.6227%2011.3515H17.0703V14.5076C17.0703%2015.1538%2016.5446%2015.6795%2015.8984%2015.6795H4.10156Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M17.6367%208.42184C17.6367%207.64664%2017.3213%206.88887%2016.7714%206.34258L16.4648%206.0368V4.90625C16.4648%203.93699%2015.6763%203.14844%2014.707%203.14844C13.7378%203.14844%2012.9492%203.93699%2012.9492%204.90625V6.03691L12.6437%206.34152C12.0931%206.88793%2011.7773%207.64617%2011.7773%208.42188V9.00781H17.6367V8.42184ZM13.0507%207.8359C13.1386%207.58801%2013.2814%207.35973%2013.4702%207.17234L14.1211%206.52328V4.90625C14.1211%204.58316%2014.3839%204.32031%2014.707%204.32031C15.0301%204.32031%2015.293%204.58316%2015.293%204.90625V6.52313L15.9448%207.17336C16.1331%207.36016%2016.2756%207.5882%2016.3634%207.83594H13.0507V7.8359Z'%20fill='%23C9C9E8'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7154_21562'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,Lv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_6415_8719)'%3e%3cpath%20d='M10.0391%208.88672H11.0156C11.3392%208.88672%2011.6016%208.62438%2011.6016%208.30078C11.6016%207.97719%2011.3392%207.71484%2011.0156%207.71484H10.0391C9.71547%207.71484%209.45312%207.97719%209.45312%208.30078C9.45312%208.62438%209.71547%208.88672%2010.0391%208.88672Z'%20fill='white'/%3e%3cpath%20d='M7.53906%207.71484H6.5625C6.23891%207.71484%205.97656%207.97719%205.97656%208.30078C5.97656%208.62438%206.23891%208.88672%206.5625%208.88672H7.53906C7.86266%208.88672%208.125%208.62438%208.125%208.30078C8.125%207.97719%207.86266%207.71484%207.53906%207.71484Z'%20fill='white'/%3e%3cpath%20d='M13.5156%208.88672H14.4922C14.8158%208.88672%2015.0781%208.62438%2015.0781%208.30078C15.0781%207.97719%2014.8158%207.71484%2014.4922%207.71484H13.5156C13.192%207.71484%2012.9297%207.97719%2012.9297%208.30078C12.9297%208.62438%2013.192%208.88672%2013.5156%208.88672Z'%20fill='white'/%3e%3cpath%20d='M4.0625%2010.3516H3.08594C2.76234%2010.3516%202.5%2010.6139%202.5%2010.9375C2.5%2011.2611%202.76234%2011.5234%203.08594%2011.5234H4.0625C4.38609%2011.5234%204.64844%2011.2611%204.64844%2010.9375C4.64844%2010.6139%204.38609%2010.3516%204.0625%2010.3516Z'%20fill='white'/%3e%3cpath%20d='M7.53906%2010.3516H6.5625C6.23891%2010.3516%205.97656%2010.6139%205.97656%2010.9375C5.97656%2011.2611%206.23891%2011.5234%206.5625%2011.5234H7.53906C7.86266%2011.5234%208.125%2011.2611%208.125%2010.9375C8.125%2010.6139%207.86266%2010.3516%207.53906%2010.3516Z'%20fill='white'/%3e%3cpath%20d='M11.6016%2010.9375C11.6016%2010.6139%2011.3392%2010.3516%2011.0156%2010.3516H10.0391C9.71547%2010.3516%209.45312%2010.6139%209.45312%2010.9375C9.45312%2011.2611%209.71547%2011.5234%2010.0391%2011.5234H11.0156C11.3392%2011.5234%2011.6016%2011.2611%2011.6016%2010.9375Z'%20fill='white'/%3e%3cpath%20d='M4.0625%2012.9883H3.08594C2.76234%2012.9883%202.5%2013.2506%202.5%2013.5742C2.5%2013.8978%202.76234%2014.1602%203.08594%2014.1602H4.0625C4.38609%2014.1602%204.64844%2013.8978%204.64844%2013.5742C4.64844%2013.2506%204.38609%2012.9883%204.0625%2012.9883Z'%20fill='white'/%3e%3cpath%20d='M7.53906%2012.9883H6.5625C6.23891%2012.9883%205.97656%2013.2506%205.97656%2013.5742C5.97656%2013.8978%206.23891%2014.1602%206.5625%2014.1602H7.53906C7.86266%2014.1602%208.125%2013.8978%208.125%2013.5742C8.125%2013.2506%207.86266%2012.9883%207.53906%2012.9883Z'%20fill='white'/%3e%3cpath%20d='M17.5781%2010.9014V3.32031C17.5781%202.13566%2016.6143%201.17188%2015.4297%201.17188H14.2969V0.585938C14.2969%200.262344%2014.0345%200%2013.7109%200C13.3873%200%2013.125%200.262344%2013.125%200.585938V1.17188H11.0156V0.585938C11.0156%200.262344%2010.7533%200%2010.4297%200C10.1061%200%209.84375%200.262344%209.84375%200.585938V1.17188H7.73438V0.585938C7.73438%200.262344%207.47203%200%207.14844%200C6.82484%200%206.5625%200.262344%206.5625%200.585938V1.17188H4.45312V0.585938C4.45312%200.262344%204.19078%200%203.86719%200C3.54359%200%203.28125%200.262344%203.28125%200.585938V1.17188H2.14844C0.963789%201.17188%200%202.13566%200%203.32031V15.0391C0%2016.0083%200.788555%2016.7969%201.75781%2016.7969H10.5321C11.2184%2018.6643%2013.0147%2020%2015.1172%2020C17.8096%2020%2020%2017.8096%2020%2015.1172C20%2013.3217%2019.0257%2011.7496%2017.5781%2010.9014ZM1.17188%203.32031C1.17188%202.78184%201.60996%202.34375%202.14844%202.34375H3.28125V2.92969C3.28125%203.25328%203.54359%203.51562%203.86719%203.51562C4.19078%203.51562%204.45312%203.25328%204.45312%202.92969V2.34375H6.5625V2.92969C6.5625%203.25328%206.82484%203.51562%207.14844%203.51562C7.47203%203.51562%207.73438%203.25328%207.73438%202.92969V2.34375H9.84375V2.92969C9.84375%203.25328%2010.1061%203.51562%2010.4297%203.51562C10.7533%203.51562%2011.0156%203.25328%2011.0156%202.92969V2.34375H13.125V2.92969C13.125%203.25328%2013.3873%203.51562%2013.7109%203.51562C14.0345%203.51562%2014.2969%203.25328%2014.2969%202.92969V2.34375H15.4297C15.9682%202.34375%2016.4062%202.78184%2016.4062%203.32031V5.07812H1.17188V3.32031ZM1.75781%2015.625C1.43473%2015.625%201.17188%2015.3621%201.17188%2015.0391V6.25H16.4062V10.4074C15.9954%2010.2948%2015.5632%2010.2344%2015.1172%2010.2344C12.4248%2010.2344%2010.2344%2012.4248%2010.2344%2015.1172C10.2344%2015.2886%2010.2434%2015.458%2010.2607%2015.625H1.75781ZM15.1172%2018.8281C13.071%2018.8281%2011.4062%2017.1634%2011.4062%2015.1172C11.4062%2013.071%2013.071%2011.4062%2015.1172%2011.4062C17.1634%2011.4062%2018.8281%2013.071%2018.8281%2015.1172C18.8281%2017.1634%2017.1634%2018.8281%2015.1172%2018.8281Z'%20fill='white'/%3e%3cpath%20d='M17.0703%2014.5312H15.7031V13.1641C15.7031%2012.8405%2015.4408%2012.5781%2015.1172%2012.5781C14.7936%2012.5781%2014.5312%2012.8405%2014.5312%2013.1641V15.1172C14.5312%2015.4408%2014.7936%2015.7031%2015.1172%2015.7031H17.0703C17.3939%2015.7031%2017.6562%2015.4408%2017.6562%2015.1172C17.6562%2014.7936%2017.3939%2014.5312%2017.0703%2014.5312Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_6415_8719'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,Rv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.415%208.82125C18.21%208.71313%2017.9606%208.72938%2017.7694%208.86063L11.8056%2012.9894L10.3562%2011.9856C10.1419%2011.8375%209.85875%2011.8375%209.64437%2011.9856L8.19438%2012.9894L3.0275%209.4125L5.32188%208.03563C5.61813%207.85813%205.71375%207.47438%205.53625%207.17813C5.35875%206.88188%204.97438%206.78625%204.67875%206.96375L1.55375%208.83875C1.37%208.94875%201.25%209.17563%201.25%209.375V16.875C1.25%2017.9088%202.09125%2018.75%203.125%2018.75H16.875C17.9088%2018.75%2018.75%2017.9088%2018.75%2016.875V9.375C18.75%209.1425%2018.6206%208.92938%2018.415%208.82125ZM2.51%2016.925C2.50875%2016.9075%202.5%2016.8925%202.5%2016.875V10.5681L7.09625%2013.75L2.51%2016.925ZM3.87625%2017.5L10%2013.26L16.1244%2017.5H3.87625ZM17.5%2016.875C17.5%2016.8925%2017.4912%2016.9075%2017.49%2016.925L12.9037%2013.75L17.5%2010.5681V16.875Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M13.3644%208.7025C13.5975%208.60562%2013.75%208.3775%2013.75%208.125V2.5C13.75%202.2475%2013.5975%202.01937%2013.3644%201.9225C13.13%201.825%2012.8619%201.87937%2012.6831%202.05812C11.6162%203.125%209.95937%203.125%208.75%203.125H7.8125C6.60625%203.125%205.625%204.10625%205.625%205.3125C5.625%206.44875%206.49937%207.37437%207.60875%207.47937L8.1375%2010.1225C8.20438%2010.4587%208.53187%2010.6806%208.87312%2010.6125C9.21187%2010.545%209.43125%2010.2156%209.36312%209.87687L8.8875%207.5C10.0831%207.50125%2011.655%207.53812%2012.6831%208.56625C12.8619%208.74562%2013.13%208.79937%2013.3644%208.7025ZM8.125%206.25H7.8125C7.29562%206.25%206.875%205.82937%206.875%205.3125C6.875%204.79562%207.29562%204.375%207.8125%204.375H8.125V6.25ZM12.5%206.905C11.4719%206.3725%2010.3263%206.27437%209.375%206.25562V4.36937C10.3263%204.35062%2011.4719%204.2525%2012.5%203.72V6.905Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M16.25%204.6875H17.5C17.845%204.6875%2018.125%204.9675%2018.125%205.3125C18.125%205.6575%2017.845%205.9375%2017.5%205.9375H16.25C15.905%205.9375%2015.625%205.6575%2015.625%205.3125C15.625%204.9675%2015.905%204.6875%2016.25%204.6875Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M17.2488%202.1875C17.4213%202.48625%2017.3188%202.86875%2017.02%203.04125L15.9375%203.66625C15.6413%203.8375%2015.2575%203.73875%2015.0838%203.4375C14.9113%203.13875%2015.0138%202.75625%2015.3125%202.58375L16.395%201.95875C16.6931%201.78562%2017.0763%201.88812%2017.2488%202.1875Z'%20fill='%23C9C9E8'/%3e%3cpath%20d='M15.0838%207.1875C15.2563%206.88813%2015.6388%206.78562%2015.9375%206.95875L17.02%207.58375C17.3194%207.75625%2017.4213%208.13875%2017.2488%208.4375C17.075%208.73813%2016.6913%208.8375%2016.395%208.66625L15.3125%208.04125C15.0132%207.86875%2014.9113%207.48625%2015.0838%207.1875Z'%20fill='%23C9C9E8'/%3e%3c/svg%3e`,zv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M20%204.35092C20%203.33607%2019.1743%202.51041%2018.1595%202.51041H1.84052C0.825863%202.51045%200.000351564%203.33572%200%204.35123V4.35155V15.6484C0%2016.676%200.834066%2017.4896%201.84114%2017.4896H18.1588C19.1863%2017.4896%2020%2016.6555%2020%2015.6484V4.35155C20%204.35147%2020%204.35139%2020%204.35131C20%204.35119%2020%204.35108%2020%204.35092ZM1.84052%203.68233H18.1595C18.5282%203.68233%2018.8281%203.98229%2018.8281%204.3519C18.8281%204.54831%2018.7305%204.73061%2018.5668%204.83967L10.3713%2010.3036C10.1458%2010.454%209.8543%2010.454%209.62875%2010.3036C9.62875%2010.3036%201.43301%204.83956%201.43317%204.83967C1.43321%204.83971%201.43305%204.8396%201.43301%204.83956C1.2695%204.73061%201.17188%204.54831%201.17188%204.35092C1.17188%203.98225%201.47184%203.68233%201.84052%203.68233ZM18.1589%2016.3177H1.84114C1.47633%2016.3177%201.17188%2016.0227%201.17188%2015.6484V6.07394L8.97867%2011.2786C9.2889%2011.4854%209.64445%2011.5888%2010%2011.5888C10.3556%2011.5888%2010.7112%2011.4854%2011.0214%2011.2786L18.8281%206.07394V15.6485C18.8281%2016.0132%2018.5332%2016.3177%2018.1589%2016.3177Z'%20fill='%23586888'/%3e%3c/svg%3e`,Bv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.6666%201.66666H4.99992C4.55789%201.66666%204.13397%201.84225%203.82141%202.15481C3.50885%202.46737%203.33325%202.8913%203.33325%203.33332V16.6667C3.33325%2017.1087%203.50885%2017.5326%203.82141%2017.8452C4.13397%2018.1577%204.55789%2018.3333%204.99992%2018.3333H14.9999C15.4419%2018.3333%2015.8659%2018.1577%2016.1784%2017.8452C16.491%2017.5326%2016.6666%2017.1087%2016.6666%2016.6667V6.66666L11.6666%201.66666Z'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.3334%2014.1667H6.66675'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.3334%2010.8333H6.66675'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.33341%207.5H7.50008H6.66675'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.6667%201.66666V6.66666H16.6667'%20stroke='%23C9C9E8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Vv=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15.3077%2011.0205C15.6349%2010.7536%2016.1175%2010.7725%2016.4226%2011.0775L19.1309%2013.7858C19.4562%2014.1112%2019.4562%2014.6387%2019.1309%2014.9641C18.8055%2015.2895%2018.278%2015.2895%2017.9526%2014.9641L16.6667%2013.6784V18.3333C16.6667%2018.7935%2016.2936%2019.1666%2015.8334%2019.1666C15.3733%2019.1666%2015.0002%2018.7934%2015.0001%2018.3333V13.6784L13.7142%2014.9641C13.3888%2015.2895%2012.8613%2015.2895%2012.5359%2014.9641C12.2107%2014.6387%2012.2106%2014.1111%2012.5359%2013.7858L15.2442%2011.0775L15.3077%2011.0205ZM13.3334%203.33331C14.2539%203.33331%2015.0001%204.0795%2015.0001%204.99998V9.16665H13.3334V8.33331H3.33341V11.6666H10.0001V13.3333H3.33341C2.41294%2013.3333%201.66675%2012.5871%201.66675%2011.6666V4.99998C1.66675%204.0795%202.41294%203.33331%203.33341%203.33331H13.3334ZM3.33341%206.24998H13.3334V4.99998H3.33341V6.24998Z'%20fill='%23C9C9E8'/%3e%3c/svg%3e`;function Hv(e){return!e||typeof e!=`string`?`User`:e.split(` `).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Uv(e){let t=(e||`User`).split(` `).filter(Boolean);return`${t[0]?.charAt(0)||`U`}${t.length>1?t.at(-1)?.charAt(0):``}`.toUpperCase()}function Wv(e){let t=(e||`User`).charAt(0).toUpperCase(),n=JSON.parse(localStorage.getItem(`colorMap`)||`{}`);if(n[t])return n[t];let r=[`#0053a5`,`#1677ff`,`#15803d`,`#f97316`,`#6366f1`,`#8b5cf6`],i=r[t.charCodeAt(0)%r.length];return localStorage.setItem(`colorMap`,JSON.stringify({...n,[t]:i})),i}function Gv({leftOffset:e}){let r=(0,d.useNavigate)(),i=(0,d.useLocation)(),a=localStorage.getItem(`companyName`)||`Zinnext`,o=localStorage.getItem(`userName`)||localStorage.getItem(`preferred_Username`)||`User`,u=localStorage.getItem(`preferred_Username`)||o,f=localStorage.getItem(`roleId`)||``,p=Hv(o),m=Uv(p);function h(){t.h(),r(`/login`,{replace:!0})}let g=[{key:`profile-name`,label:(0,l.jsxs)(`div`,{className:`app-layout-profile-summary`,children:[(0,l.jsx)(s.Avatar,{size:42,style:{backgroundColor:Wv(p)},children:m}),(0,l.jsxs)(`div`,{className:`app-layout-profile-copy`,children:[(0,l.jsx)(n.Tn,{variant:`body-strong`,truncate:!0,className:`app-layout-profile-name`,children:p}),f&&(0,l.jsx)(n.Tn,{variant:`caption`,color:`secondary`,className:`app-layout-profile-role`,children:f})]})]}),disabled:!0},{type:`divider`},{key:`dashboard`,label:(0,l.jsxs)(d.Link,{to:`/dashboard`,className:`app-layout-menu-link`,children:[(0,l.jsx)(c.AppstoreOutlined,{}),`Dashboard`]})},{key:`my-profile`,label:(0,l.jsxs)(d.Link,{to:`/my-profile`,className:`app-layout-menu-link`,children:[(0,l.jsx)(c.UserOutlined,{}),`My Profile`]})},{type:`divider`},{key:`logout`,label:(0,l.jsxs)(`span`,{className:`app-layout-menu-link app-layout-menu-danger`,children:[(0,l.jsx)(c.LogoutOutlined,{}),`Logout`]}),onClick:h}];return(0,l.jsxs)(`header`,{className:`app-layout-header`,style:{left:e},children:[(0,l.jsx)(`div`,{className:`app-layout-company`,children:(0,l.jsx)(n.Tn,{variant:`body-strong`,truncate:!0,className:`app-layout-company-name`,children:a})}),(0,l.jsxs)(`div`,{className:`app-layout-header-actions`,children:[(0,l.jsx)(s.Tooltip,{title:`Inbox`,children:(0,l.jsx)(d.Link,{to:`/inbox`,className:i.pathname===`/inbox`?`app-layout-icon-btn is-active`:`app-layout-icon-btn`,"aria-label":`Inbox`,children:(0,l.jsx)(`img`,{src:zv,alt:``,"aria-hidden":`true`,className:`app-layout-icon-img`})})}),(0,l.jsx)(`div`,{className:`app-layout-header-divider`}),(0,l.jsxs)(`div`,{className:`app-layout-user`,children:[(0,l.jsx)(s.Avatar,{size:30,style:{backgroundColor:Wv(p)},children:m}),(0,l.jsx)(n.Tn,{variant:`label`,truncate:!0,className:`app-layout-user-name`,children:u}),(0,l.jsx)(s.Dropdown,{menu:{items:g},trigger:[`click`],placement:`bottomRight`,overlayClassName:`app-layout-user-dropdown`,children:(0,l.jsx)(`button`,{type:`button`,className:`app-layout-dropdown-btn`,"aria-label":`Open user menu`,children:(0,l.jsx)(c.DownOutlined,{})})})]})]})]})}var{Sider:Kv}=s.Layout,qv={Dashboard:Ov,Jobs:Tv,Candidates:Ev,Submissions:Fv,Network:jv,ClientManagement:Dv,Clients:Dv,clients:Dv,EmployerManagement:kv,Employers:kv,employers:kv,ReferralManagement:kv,Referral:kv,Referrals:kv,referrals:kv,Scheduler:Pv,Admin:Cv,Reports:Mv,Settings:Nv,Help:Av,onboarding:Iv,Onboarding:Iv,assignments:wv,Assignments:wv,assignment:wv,Assignment:wv,timesheet:Lv,Timesheet:Lv,billing:Bv,Billing:Bv,payroll:Vv,Payroll:Vv,campaign:Rv,Campaign:Rv,addTestCase:Mv,viewTestCase:Pv,manageModules:Nv,bulkUpload:c.UploadOutlined,"bulk-upload":c.UploadOutlined};function Jv(e){let t=localStorage.getItem(e);if(!t||t===`undefined`||t===`null`||t.trim()===``)return[];try{let e=JSON.parse(t);return Array.isArray(e)?e:Array.isArray(e?.menu)?e.menu:Array.isArray(e?.menus?.menu)?e.menus.menu:[]}catch(t){return console.error(`Error parsing ${e}:`,t),[]}}function Yv(e){let t=e.replace(/^\/+/,``);if(!t)return[`dashboard`];let n=t.split(`/`);return[t,n[0],n.at(-1)].filter(Boolean)}function Xv({icon:e,itemKey:t}){let n=t===`bulk-upload`?c.UploadOutlined:t===`assignments`?wv:t===`employers`?kv:qv[e];return n?typeof n==`string`?(0,l.jsx)(`img`,{src:n,alt:``,className:`app-sidebar-menu-icon`,"aria-hidden":`true`}):(0,l.jsx)(n,{className:`app-sidebar-menu-icon`,"aria-hidden":`true`}):null}function Zv(e){return e.map(e=>({key:e.key,icon:(0,l.jsx)(Xv,{icon:e.icon,itemKey:e.key}),label:e.label,disabled:e.status===`inactive`,children:Array.isArray(e.children)?Zv(e.children):void 0}))}function Qv(e){let t;try{t=JSON.parse(localStorage.getItem(`menuPermission`)||`{}`)}catch{return e}let n=Object.entries(t).reduce((e,[t,n])=>({...e,[String(t).trim().toLowerCase()]:n}),{}),r=Object.keys(n),i=e=>n[e]??n[r.find(t=>t===`${e}s`||`${t}s`===e)??``];return e.flatMap(e=>{let t=[e.key,e.label].map(e=>String(e??``).trim().toLowerCase()).map(i).find(Boolean)?.view;if(t!=null&&![!0,1,`1`].includes(t))return[];let n=Array.isArray(e.children)?Qv(e.children):void 0;return[{...e,children:n}]})}function $v(e){return new Set(e.flatMap(e=>[String(e?.key??``).trim().toLowerCase(),...Array.isArray(e?.children)?[...$v(e.children)]:[]]).filter(Boolean))}function ey(e){return[!0,1,`1`].includes(e)}function ty(e){return String(e).split(/[\s_\-/]+/).filter(Boolean).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(` `)}function ny(e){let t;try{t=JSON.parse(localStorage.getItem(`menuPermission`)||`{}`)}catch{return e}if(!t||typeof t!=`object`||Array.isArray(t))return e;let n=$v(e),r=Object.entries(t).flatMap(([e,t])=>{let r=String(e).trim().toLowerCase();return!r||r.includes(`/`)||n.has(r)||!ey(t?.view)?[]:(n.add(r),[{key:r,icon:r,label:ty(r),status:`active`}])});return[...e,...r]}function ry(e){let t=e.some(e=>e.key===`addTestCase`),n=e.some(e=>e.key===`bulk-upload`);if(!t||n)return e;let r=[...e],i=r.findIndex(e=>e.key===`manageModules`);return r.splice(i>=0?i+1:r.length,0,{key:`bulk-upload`,icon:`bulk-upload`,label:`Bulk upload`,status:`active`}),r}function iy(){try{let e=JSON.parse(localStorage.getItem(`menuPermission`)||`{}`),t=e?.client??e?.clients;return!t||typeof t!=`object`?!1:[`view`,`add`,`edit`].some(e=>Number(t[e])===1||t[e]===!0||t[e]===`1`)}catch{return!1}}function ay(){try{let e=JSON.parse(localStorage.getItem(`menuPermission`)||`{}`),t=e?.employers??e?.employer;return!t||typeof t!=`object`?!1:[`view`,`add`,`edit`].some(e=>Number(t[e])===1||t[e]===!0||t[e]===`1`)}catch{return!1}}function oy(e){if(e.some(e=>e.key===`clients`||e.key===`client`)||!iy())return e;let t=[...e],n=t.findIndex(e=>e.key===`jobs`);return t.splice(n>=0?n:t.length,0,{key:`clients`,icon:`ClientManagement`,label:`Client Management`,status:`active`}),t}function sy(e){let t=e.some(e=>e.key===`employers`||e.key===`employer`),n=e.some(e=>e.key===`clients`||e.key===`client`),r=ay()||n||iy();if(t||!r)return e;let i=[...e],a=i.findIndex(e=>e.key===`jobs`);return i.splice(a>=0?a:i.length,0,{key:`employers`,icon:`EmployerManagement`,label:`Employer Management`,status:`active`}),i}function cy(){try{let e=JSON.parse(localStorage.getItem(`menuPermission`)||`{}`),t=e?.referrals??e?.referral;return!t||typeof t!=`object`?!1:[`view`,`add`,`edit`].some(e=>Number(t[e])===1||t[e]===!0||t[e]===`1`)}catch{return!1}}function ly(e){let t=e.some(e=>e.key===`referrals`||e.key===`referral`),n=e.some(e=>e.key===`employers`||e.key===`employer`),r=cy()||ay()||n||iy();if(t||!r)return e;let i=[...e],a=i.findIndex(e=>e.key===`employers`||e.key===`employer`),o=i.findIndex(e=>e.key===`jobs`),s=a>=0?a+1:o>=0?o:i.length;return i.splice(s,0,{key:`referrals`,icon:`ReferralManagement`,label:`Referral Management`,status:`active`}),i}function uy(e){try{let t=JSON.parse(localStorage.getItem(`menuPermission`)||`{}`)?.[e];return t&&[`view`,`add`,`edit`].some(e=>Number(t[e])===1||t[e]===!0||t[e]===`1`)}catch{return!1}}function dy(e){let t=[...e],n=t.findIndex(e=>e.key===`assignments`),r=n>=0?n+1:t.length;for(let[e,n]of[[`billing`,`Billing`],[`payroll`,`Payroll`]])!t.some(t=>t.key===e)&&uy(e)&&(t.splice(r,0,{key:e,icon:e,label:n,status:`active`}),r+=1);return t}function fy(e){return e.filter(e=>{let t=String(e.key??``).toLowerCase(),n=String(e.label??``).toLowerCase();return!t.includes(`vendor`)&&n!==`vendors`}).map(e=>Array.isArray(e.children)?{...e,children:fy(e.children)}:e)}function py({collapsed:e,onToggle:t}){let n=(0,d.useNavigate)(),r=(0,d.useLocation)(),[i,a]=(0,o.useState)([]),c=(0,o.useMemo)(()=>Yv(r.pathname),[r.pathname]);(0,o.useEffect)(()=>{c.length>0&&localStorage.setItem(`activeKey`,c[0])},[c]);let u=(0,o.useMemo)(()=>Zv(Qv(ny(dy(ry(ly(sy(oy(fy(Jv(`menu`)))))))))),[]);function f(){e||a([]),t()}function p({key:e}){n(`/${e}`)}return(0,l.jsx)(Kv,{trigger:null,collapsible:!0,collapsed:e,width:200,collapsedWidth:60,className:`app-sidebar`,children:(0,l.jsxs)(`div`,{className:`app-sidebar-panel`,children:[(0,l.jsx)(`div`,{className:`app-sidebar-brand`,children:(0,l.jsxs)(`div`,{className:`app-sidebar-logo`,children:[(0,l.jsx)(`img`,{src:bv,alt:``,className:`app-sidebar-logo-icon`}),(0,l.jsx)(`img`,{src:xv,alt:`Zinnext`,className:`app-sidebar-logo-text`})]})}),(0,l.jsx)(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:f,"aria-label":e?`Expand sidebar`:`Collapse sidebar`,children:(0,l.jsx)(`img`,{src:Sv,alt:``,"aria-hidden":`true`})}),(0,l.jsx)(`div`,{className:`app-sidebar-body`,children:(0,l.jsx)(s.Menu,{mode:`inline`,theme:`dark`,selectedKeys:c,openKeys:e?[]:i,items:u,onClick:p,onOpenChange:a,className:`app-sidebar-menu`})})]})})}var my=`You're not logged in`,hy=`You haven't logged into this session. Please login to access the data.`;function gy(){try{return!!t.u()}catch{return!1}}function _y({children:e,title:t=my,message:n=hy,loginPath:r=`/login`,loginLabel:i=`Go to Login`,onLogin:a,fallback:u}){let[d,f]=(0,o.useState)(gy);return(0,o.useEffect)(()=>{let e=()=>f(gy());return window.addEventListener(`auth:login`,e),window.addEventListener(`auth:logout`,e),window.addEventListener(`storage`,e),window.addEventListener(`focus`,e),()=>{window.removeEventListener(`auth:login`,e),window.removeEventListener(`auth:logout`,e),window.removeEventListener(`storage`,e),window.removeEventListener(`focus`,e)}},[]),d?e:u===void 0?(0,l.jsx)(`div`,{className:`ct-auth-guard`,children:(0,l.jsx)(`div`,{className:`ct-auth-guard__card`,children:(0,l.jsx)(s.Result,{status:`403`,icon:(0,l.jsx)(c.LockOutlined,{className:`ct-auth-guard__icon`}),title:t,subTitle:n,extra:(0,l.jsx)(s.Button,{type:`primary`,size:`large`,onClick:()=>{if(typeof a==`function`){a();return}typeof window<`u`&&window.location.assign(r)},children:i})})})}):u}_y.propTypes={children:f.default.node,title:f.default.node,message:f.default.node,loginPath:f.default.string,loginLabel:f.default.node,onLogin:f.default.func,fallback:f.default.node};var vy={"candidate-onboarding":`onboarding`,"candidate-assignment":`assignments`,candidate:`candidates`,job:`jobs`,submission:`submissions`,client:`clients`,employer:`employers`,referral:`referrals`,timesheet:`timesheets`},yy=new Set([``,`dashboard`,`my-profile`,`profile`,`viewall-sticky`,`select-project`,`addtestcase`,`managemodules`,`viewtestcase`,`test-cases`,`zinnext-home`,`lms-home`,`test`]);function by(e){return String(e??``).split(`?`)[0].split(`#`)[0].replace(/^\/+/,``).split(`/`)[0].trim().toLowerCase()}function xy(e){let t=by(e);return!t||yy.has(t)?``:vy[t]??t}function Sy({children:e}){let t=(0,d.useLocation)(),n=(0,d.useNavigate)(),r=xy(t.pathname),{canView:i}=tr(r);if(r&&!i){let e=r.replace(/[-_]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase());return(0,l.jsx)(`div`,{className:`ct-auth-guard`,children:(0,l.jsx)(`div`,{className:`ct-auth-guard__card`,children:(0,l.jsx)(s.Result,{status:`403`,icon:(0,l.jsx)(c.LockOutlined,{className:`ct-auth-guard__icon`}),title:`Access Denied`,subTitle:`You do not have View access to the ${e} module. Please contact your administrator if you need access.`,extra:(0,l.jsx)(s.Button,{type:`primary`,size:`large`,onClick:()=>n(`/dashboard`),children:`Go to Dashboard`})})})})}return e}var Cy=60;function wy({children:e}){let[t,n]=(0,o.useState)(!0);return(0,l.jsxs)(`div`,{className:`app-layout-shell`,children:[(0,l.jsx)(py,{collapsed:t,onToggle:()=>n(e=>!e)}),(0,l.jsx)(Gv,{leftOffset:60}),(0,l.jsx)(`main`,{className:`app-layout-main`,style:{marginLeft:60,paddingTop:Cy},children:(0,l.jsx)(`div`,{className:`app-layout-content`,children:(0,l.jsx)(_y,{children:(0,l.jsx)(Sy,{children:e??(0,l.jsx)(d.Outlet,{})})})})})]})}function Ty({onLogin:e,defaultRedirectPath:r=`/`}){let[i,a]=(0,o.useState)(!1),[u,f]=(0,o.useState)(``),p=(0,d.useNavigate)(),m=(0,d.useLocation)(),h=m.state?.from?.pathname||r,g=new URLSearchParams(m.search).get(`session_expired`)===`1`;async function _(n){f(``),a(!0);try{let r=await t.m({email:n.email,user_pwd:n.user_pwd});if(e?.(r),t.p()){p(`/select-project`,{replace:!0});return}p(h,{replace:!0})}catch(e){f(e.message||`Unable to login. Please check your credentials.`)}finally{a(!1)}}return(0,l.jsxs)(`div`,{className:`auth-login-page`,children:[(0,l.jsx)(`section`,{className:`auth-login-bg`,style:{background:n.Dn.brand},children:(0,l.jsxs)(`div`,{className:`auth-login-static-section`,children:[(0,l.jsx)(`div`,{children:(0,l.jsx)(`img`,{src:vv,alt:``,className:`auth-login-img-one`})}),(0,l.jsx)(`div`,{className:`auth-login-hero-wrap`,children:(0,l.jsx)(`img`,{src:yv,alt:``,className:`auth-login-img-two`})}),(0,l.jsx)(n.Tn,{as:`p`,variant:`body`,color:`inverse`,size:`2xl`,weight:`regular`,align:`right`,className:`auth-login-tagline`,children:`Best in class processes in a box.`})]})}),(0,l.jsx)(`section`,{className:`auth-login-form-layout`,children:(0,l.jsx)(`div`,{className:`auth-login-form-container`,children:(0,l.jsxs)(`div`,{className:`auth-login-form-shell`,children:[g&&(0,l.jsx)(`div`,{className:`auth-login-session-expired-container`,children:(0,l.jsx)(`div`,{className:`auth-login-slide-in`,children:(0,l.jsx)(s.Alert,{type:`warning`,showIcon:!0,icon:(0,l.jsx)(c.ExclamationCircleFilled,{style:{fontSize:30,color:`#FFC107`}}),message:(0,l.jsxs)(`div`,{className:`auth-login-alert-message-container`,children:[(0,l.jsx)(s.Divider,{className:`auth-login-alert-divider`,type:`vertical`}),(0,l.jsx)(`div`,{className:`auth-login-alert-text`,children:`Session expired. Please log in again.`})]}),className:`auth-login-session-expired-alert`})})}),(0,l.jsxs)(`div`,{className:`auth-login-brand`,children:[(0,l.jsx)(`img`,{src:`/favicon.ico`,alt:``,className:`auth-login-logo`}),(0,l.jsx)(n.Tn,{variant:`h3`,color:`primary`,weight:`bold`,className:`auth-login-brand-text`,children:`Zinnext`})]}),(0,l.jsx)(`div`,{className:`auth-login-body`,children:(0,l.jsxs)(`div`,{className:`auth-login-sign-body`,children:[(0,l.jsx)(n.Tn,{variant:`h2`,color:`primary`,weight:`bold`,align:`center`,className:`auth-login-title`,children:`Sign in`}),(0,l.jsx)(`div`,{className:`auth-login-form-con`,children:(0,l.jsxs)(s.Form,{className:`v1-form auth-login-form`,layout:`vertical`,requiredMark:!1,onFinish:_,autoComplete:`off`,children:[(0,l.jsx)(s.Form.Item,{label:`Email`,name:`email`,rules:[{type:`email`,required:!0,message:`Enter valid email.`}],children:(0,l.jsx)(s.Input,{size:`large`,placeholder:`Your work email`,autoComplete:`email`})}),(0,l.jsx)(s.Form.Item,{label:`Password`,name:`user_pwd`,rules:[{required:!0,message:`Mandatory field.`}],children:(0,l.jsx)(s.Input.Password,{size:`large`,placeholder:`Enter password`,autoComplete:`current-password`})}),(0,l.jsx)(s.Form.Item,{className:`auth-login-forgot-row`,children:(0,l.jsx)(s.Button,{type:`link`,className:`auth-login-forgot`,htmlType:`button`,children:`Forgot Password?`})}),u&&(0,l.jsx)(s.Form.Item,{children:(0,l.jsx)(n.Tn,{color:`danger`,variant:`body`,children:u})}),(0,l.jsx)(s.Button,{className:`auth-login-submit`,block:!0,size:`large`,type:`primary`,htmlType:`submit`,loading:i,id:`znxt-signin`,children:`Sign in`}),(0,l.jsx)(s.Form.Item,{className:`auth-login-divider-row`,children:(0,l.jsx)(s.Divider,{children:`Or`})}),(0,l.jsxs)(n.Tn,{as:`p`,variant:`body`,color:`secondary`,align:`center`,className:`auth-login-signup-text`,children:[`Not registered yet?`,` `,(0,l.jsx)(s.Button,{type:`link`,htmlType:`button`,className:`auth-login-signup`,id:`znxt-signup`,children:`Sign up`})]})]})})]})})]})})})]})}var Ey=e.t({addCTFlow:()=>Jy,addCTModule:()=>Hy,addCTSubmodule:()=>Gy,addLmsFlow:()=>Ry,addTestFlow:()=>Py,addTestingOption:()=>My,bulkInsertTestSteps:()=>Ly,deleteCTFlow:()=>Qy,getActionFieldRules:()=>Ny,getCTFlow:()=>Yy,getCTFlows:()=>qy,getCTModules:()=>Vy,getCTNextStep:()=>Xy,getCTProjects:()=>By,getCTSubmodules:()=>Wy,getLmsFlows:()=>zy,getTestFlows:()=>Fy,getTestingOptions:()=>jy,setCTModuleStatus:()=>Uy,setCTSubmoduleStatus:()=>Ky,updateCTFlow:()=>Zy,validateTestSteps:()=>Iy});async function Dy(e){return t.t(t.x,e)}async function Oy(e,n){let r=await t.o(t.x,e,{method:`POST`,body:JSON.stringify(n)});return r.data??r}async function ky(e,n){let r=await t.o(t.x,e,{method:`PUT`,body:JSON.stringify(n)});return r.data??r}async function Ay(e){let n=await t.o(t.x,e,{method:`DELETE`});return n.data??n}async function jy(e){return Dy(`/testing-modules?type=${encodeURIComponent(e)}`)}async function My({name:e,type:t}){return Oy(`/testing-modules`,{name:e,type:t})}async function Ny(){return Dy(`/test-action-field-rules`)}async function Py(e){return Oy(`/test-flows`,e)}async function Fy({limit:e=10,offset:t=0,search:n=``,module:r=``,keyword:i=``,tags:a=``,active:o}={}){let s=new URLSearchParams({limit:String(e),offset:String(t)});return n&&s.append(`search`,n),r&&s.append(`module`,r),i&&s.append(`keyword`,i),a&&s.append(`tags`,a),o!=null&&o!==``&&s.append(`active`,String(o)),Dy(`/test-flows?${s.toString()}`)}async function Iy(e){return Oy(`/test-steps/validate`,e)}async function Ly(e){return Oy(`/test-steps/bulk-insert`,e)}async function Ry(e){return Oy(`/lms-flows`,e)}async function zy({limit:e=10,offset:t=0,search:n=``,module:r=``,keyword:i=``,tags:a=``,active:o}={}){let s=new URLSearchParams({limit:String(e),offset:String(t)});return n&&s.append(`search`,n),r&&s.append(`module`,r),i&&s.append(`keyword`,i),a&&s.append(`tags`,a),o!=null&&o!==``&&s.append(`active`,String(o)),Dy(`/lms-flows?${s.toString()}`)}async function By({activeOnly:e=!1}={}){let t=new URLSearchParams;e&&t.append(`active`,`1`);let n=t.toString();return Dy(`/ct/projects${n?`?${n}`:``}`)}async function Vy({project:e=``,activeOnly:t=!1}={}){let n=new URLSearchParams;e&&n.append(`project`,e),t&&n.append(`active`,`1`);let r=n.toString();return Dy(`/ct/modules${r?`?${r}`:``}`)}async function Hy({project:e,modulename:t}){return Oy(`/ct/modules`,{project:e,modulename:t})}async function Uy(e,t){return ky(`/ct/modules/status`,{id:e,active:t})}async function Wy({project:e=``,module:t=``,activeOnly:n=!1}={}){let r=new URLSearchParams;e&&r.append(`project`,e),t&&r.append(`module`,t),n&&r.append(`active`,`1`);let i=r.toString();return Dy(`/ct/submodules${i?`?${i}`:``}`)}async function Gy({project:e,modulename:t,submodulename:n}){return Oy(`/ct/submodules`,{project:e,modulename:t,submodulename:n})}async function Ky(e,t){return ky(`/ct/submodules/status`,{id:e,active:t})}async function qy({project:e=``,module:t=``,submodule:n=``,product_parent_ID:r=``,module_parent_ID:i=``,submodule_parent_ID:a=``,actions:o=``,search:s=``,active:c,limit:l=1e3,offset:u=0}={}){let d=new URLSearchParams({limit:String(l),offset:String(u)}),f=r||e,p=i||t,m=a||n;return f&&d.append(`product_parent_ID`,f),p&&d.append(`module_parent_ID`,p),m&&d.append(`submodule_parent_ID`,m),o&&d.append(`actions`,o),s&&d.append(`search`,s),c!=null&&c!==``&&d.append(`active`,String(c)),Dy(`/ct/flows?${d.toString()}`)}async function Jy(e){return Oy(`/ct/flows`,e)}async function Yy(e){return Dy(`/ct/flows/${encodeURIComponent(e)}`)}async function Xy({project:e,module:t,submodule:n,product_parent_ID:r,module_parent_ID:i,submodule_parent_ID:a}){return Dy(`/ct/flows/next-step?${new URLSearchParams({product_parent_ID:String(r||e),module_parent_ID:String(i||t),submodule_parent_ID:String(a||n)}).toString()}`)}async function Zy(e,t){return ky(`/ct/flows/${encodeURIComponent(e)}`,t)}async function Qy(e){return Ay(`/ct/flows/${encodeURIComponent(e)}`)}var $y=`zinnext`;function eb(){let[e]=s.Form.useForm(),r=(0,d.useNavigate)(),[i,a]=(0,o.useState)([]),[u,f]=(0,o.useState)(!1),[p,m]=(0,o.useState)(``);(0,o.useEffect)(()=>{let n=!0;return Promise.resolve().then(()=>By({activeOnly:!0})).then(r=>{if(!n)return;let i=r?.items??[];a(i);let o=t.l(),s=i.find(e=>e.id===o?.id)||i.find(e=>e.projectname?.toLowerCase()===$y)||i[0];s&&e.setFieldsValue({project:s.id})}).catch(e=>{console.error(`Unable to load projects:`,e),n&&m(`Unable to load projects. Please try again.`)}),()=>{n=!1}},[e]);function h(e){let n=i.find(t=>t.id===e.project);if(!n){m(`Please select a project.`);return}f(!0),t._({id:n.id,name:n.projectname}),r(`/addTestCase`,{replace:!0})}return(0,l.jsxs)(`div`,{className:`auth-login-page`,children:[(0,l.jsx)(`section`,{className:`auth-login-bg`,style:{background:n.Dn.brand},children:(0,l.jsxs)(`div`,{className:`auth-login-static-section`,children:[(0,l.jsx)(`div`,{children:(0,l.jsx)(`img`,{src:vv,alt:``,className:`auth-login-img-one`})}),(0,l.jsx)(`div`,{className:`auth-login-hero-wrap`,children:(0,l.jsx)(`img`,{src:yv,alt:``,className:`auth-login-img-two`})}),(0,l.jsx)(n.Tn,{as:`p`,variant:`body`,color:`inverse`,size:`2xl`,weight:`regular`,align:`right`,className:`auth-login-tagline`,children:`Best in class processes in a box.`})]})}),(0,l.jsx)(`section`,{className:`auth-login-form-layout`,children:(0,l.jsx)(`div`,{className:`auth-login-form-container`,children:(0,l.jsxs)(`div`,{className:`auth-login-form-shell`,children:[(0,l.jsxs)(`div`,{className:`auth-login-brand`,children:[(0,l.jsx)(`img`,{src:`/favicon.ico`,alt:``,className:`auth-login-logo`}),(0,l.jsx)(n.Tn,{variant:`h3`,color:`primary`,weight:`bold`,className:`auth-login-brand-text`,children:`Zinnext`})]}),(0,l.jsx)(`div`,{className:`auth-login-body`,children:(0,l.jsxs)(`div`,{className:`auth-login-sign-body`,children:[(0,l.jsx)(n.Tn,{variant:`h2`,color:`primary`,weight:`bold`,align:`center`,className:`auth-login-title`,children:`Select Project`}),(0,l.jsx)(`div`,{className:`auth-login-form-con`,children:(0,l.jsxs)(s.Form,{form:e,className:`v1-form auth-login-form`,layout:`vertical`,requiredMark:!1,onFinish:h,autoComplete:`off`,children:[(0,l.jsx)(s.Form.Item,{label:`Project`,name:`project`,rules:[{required:!0,message:`Select a project.`}],children:(0,l.jsx)(s.Select,{size:`large`,showSearch:!0,optionFilterProp:`label`,placeholder:`Select project`,prefix:(0,l.jsx)(c.ProjectOutlined,{}),options:i.map(e=>({value:e.id,label:e.projectname}))})}),p&&(0,l.jsx)(s.Form.Item,{children:(0,l.jsx)(n.Tn,{color:`danger`,variant:`body`,children:p})}),(0,l.jsx)(s.Button,{className:`auth-login-submit`,block:!0,size:`large`,type:`primary`,htmlType:`submit`,loading:u,id:`znxt-select-project`,children:`Continue`})]})})]})})]})})})]})}function tb(e,t){function n(n){return(0,l.jsx)(_y,{...t,children:(0,l.jsx)(e,{...n})})}return n.displayName=`withAuthGuard(${e.displayName||e.name||`Component`})`,n}var nb=`${t.v}`;async function rb(e,n={}){let r=t.u(),i=await fetch(`${nb}${e}`,{...n,headers:{"Content-Type":`application/json`,...t.A({"X-App-Id":String(t.y)}),...r?{Authorization:`Bearer ${r}`}:{},...n.headers??{}}}),a=await i.json().catch(()=>({}));if(!i.ok)throw Error(a?.error??a?.message??`Request failed: ${i.status}`);return a?.data??a}function ib(e,t=[]){if(Array.isArray(e))return e;for(let n of[...t,`data`,`result`,`rows`,`items`])if(Array.isArray(e?.[n]))return e[n];for(let n of t){if(Array.isArray(e?.data?.[n]))return e.data[n];if(Array.isArray(e?.result?.[n]))return e.result[n]}return[]}function ab(e){let t=e.user_id??e.userId??e.UserId??e.legacyUserId??e.legacy_user_id??e.id??e._id,n=e.user_type_id??e.roleId??e.role_id??e.RoleId,r=e.first_name??e.firstName??``,i=e.last_name??e.lastName??``,a=e.reporting_id??e.reportingId??e.reportingManagerId??e.managerId??0;return{...e,user_id:t,userId:t,legacyUserId:e.legacyUserId??e.legacy_user_id??t,username:e.username??e.userName??e.user_name??`${r}${i}`.trim(),userName:e.userName??e.username??e.user_name??`${r}${i}`.trim(),first_name:r,firstName:r,last_name:i,lastName:i,email:e.email,mobile:e.mobile??e.phoneNumber??e.phone_number??e.mobile_number,mobileNumber:e.mobileNumber??e.mobile_number??e.mobile??e.phoneNumber??e.phone_number,user_type_id:n,role_id:n,roleId:n,reporting_id:a,reportingId:a,profile_image:e.profile_image??e.photoLocation??e.photo_location,status:cb(e.status??e.active_status)}}function ob(e){let t=e.user_type_id??e.role_id??e.roleId??e.id;return{...e,user_type_id:t,user_type_name:e.user_type_name??e.role_name??e.roleName??e.name,description:e.description??e.role_description??e.roleDescription??``,status:cb(e.status??e.active_status??`ACTIVE`)}}function sb(e){let t=e.menu_id??e.menuId??e.legacyMenuId??e.id,n=e.parent_menu_id??e.parentMenuId,r=e.menu_name??e.menuName??e.name??e.label;return{...e,menu_id:t,menu_name:r,menu_key:e.menu_key??e.menuKey??e.key,api_url:e.api_url??e.apiUrl??e.route??``,menu_type:e.menu_type??e.menuType??e.placement??`MENU`,parent_menu_id:n||null,component_name:e.component_name??e.componentName??``,display_order:e.display_order??e.displayOrder??t??0,status:cb(e.status)}}function cb(e){if(e===!0||e===1||e===`1`)return`ACTIVE`;let t=String(e??`ACTIVE`).trim().toUpperCase();return t===`ACTIVE`||t===`ENABLED`?`ACTIVE`:`INACTIVE`}function lb(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:0}function ub(e){if(e==null||e===``)return 0;let t=Number(e);return Number.isFinite(t)&&t>0?t:e}function db(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:void 0}function fb(){return{tenantId:localStorage.getItem(`tenantId`)||void 0,businessId:localStorage.getItem(`businessId`)||void 0,businessUnitId:localStorage.getItem(`businessUnitId`)||void 0}}function pb(e){let n=e.username??e.user_name??e.userName,r=e.first_name??e.firstName??``,i=e.last_name??e.lastName??``,a=lb(e.user_type_id??e.role_id??e.roleId),o=ub(e.reporting_id??e.reportingId??e.managerId),s=e.mobile??e.mobileNumber??e.mobile_number??e.phone_number,c=cb(e.status??e.activeStatus)===`ACTIVE`,l=String(t.y),u=db(e.updated_by??e.updatedBy),d=db(e.created_by??e.createdBy);return{...e,...fb(),appId:l,app_id:l,userName:n,user_name:n,username:n,firstName:r,first_name:r,lastName:i,last_name:i,email:e.email,user_pwd:e.password??e.user_pwd,password:e.password??e.user_pwd,phoneNumber:s,phone_number:s,mobileNumber:s,mobile_number:s,roleId:a,role_id:a,user_type_id:a,reportingId:o,reporting_id:o,activeStatus:c,status:c?`ACTIVE`:`INACTIVE`,statusText:c?`ACTIVE`:`INACTIVE`,updatedBy:u,updated_by:u,createdBy:d,created_by:d}}function mb(e){let t=String(e.menu_type??e.menuType??e.placement??`MENU`).toUpperCase();return{...e,menuName:e.menu_name,name:e.menu_name,menuKey:e.menu_key,key:e.menu_key,parentMenuId:Number(e.parent_menu_id??0),placement:t===`FOOTER`?`footer`:`main`,icon:e.icon,status:e.status}}function hb(e){return(Array.isArray(e)?e:Object.entries(e??{}).map(([e,t])=>({...t,menu_name:e}))).map(e=>{let t=e.menu_id??e.menuId,n=e.menu_name??e.menuName??e.name??String(t??``),r=Object.entries(e.permissions??{}).reduce((e,[t,n])=>(e[t]={...n,permission_id:n?.permission_id??n?.permissionId??n?.id,permission_key:n?.permission_key??n?.permissionKey??t,value:n?.value??n?.access_value??n},e),{});return{...e,menu_id:t,menu_name:n,menu_key:e.menu_key??e.menuKey??n,permissions:r}})}function gb(e,t,n=[]){return{roleId:e,menus:t.reduce((e,t)=>{let n=t.menu_name??t.menuName??t.menu_key??String(t.menu_id),r=t.permission_key??t.permissionKey;return r?(e[n]||(e[n]={menuId:t.menu_id??t.menuId,permissions:{}}),e[n].permissions[r]={id:t.permission_id??t.permissionId,value:String(+(Number(t.access_value??t.accessValue)===1))},e):e},{}),menuOrder:n}}function _b({limit:e=10,offset:t=0,search:n=``,type:r=``,sort:i=``}={}){let a=new URLSearchParams({limit:String(e),offset:String(t)});return n&&a.set(`searchquery`,n),r&&a.set(`type`,r),i&&a.set(`sortBy`,i),rb(`/get-all-users?${a.toString()}`).then(e=>({users:ib(e,[`users`]).map(ab),total:Number(e?.totalCount??e?.total??0)||0}))}function vb(e){return rb(`/get-users?roleId=${encodeURIComponent(e)}`).then(e=>ib(e,[`users`]).map(ab))}function yb(e){return rb(`/create-user`,{method:`POST`,body:JSON.stringify(pb(e))})}function bb(e,t){return rb(`/update-user?userId=${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(pb(t))})}function xb(e){return rb(`/delete-user?userId=${encodeURIComponent(e)}`,{method:`PUT`})}function Sb(){return rb(`/get-roles`).then(e=>[...ib(e,[`zinnext_default`]),...ib(e,[`custom_roles`])].map(ob))}function Cb(e){return rb(`/add-custom-role`,{method:`POST`,body:JSON.stringify({importedPermissionId:Number(e.imported_permission_id??0),newRoleName:e.user_type_name,roleDescription:e.description??``,menuIds:e.visible_menu_ids??[]})}).then(ob)}function wb(e,t){return rb(`/custom-roles/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify({roleName:t.user_type_name,role_name:t.user_type_name,roleDescription:t.description??``,description:t.description??``,status:+(cb(t.status)===`ACTIVE`),statusText:cb(t.status)})}).then(ob)}function Tb(e){return rb(`/custom-roles/${encodeURIComponent(e)}`,{method:`DELETE`})}function Eb(){return rb(`/admin/menu-modules`).then(e=>ib(e).map(sb))}function Db(e){return rb(`/admin/menu-modules`,{method:`POST`,body:JSON.stringify(mb(e))})}function Ob(e,t){return rb(`/admin/menu-modules/${e}`,{method:`PUT`,body:JSON.stringify(mb(t))})}function kb(e){return rb(`/admin/menu-modules/${e}`,{method:`DELETE`})}function Ab(){return rb(`/admin/menu-actions`)}function jb(e){return rb(`/get-role-details?roleid=${encodeURIComponent(e)}`).then(hb)}function Mb(e,t){return rb(`/edit-role-details`,{method:`PUT`,body:JSON.stringify(gb(e,t,[...new Set(t.map(e=>e.menu_key??e.menuName??e.menu_name).filter(Boolean))]))})}var Nb={po:[],msa:[],sourcing:[`jobs`],assign:[`jobs`],approve:[`submissions`,`onboarding`,`assignments`,`timesheet`,`vendors`,`test cases`],move_onboard:[`submissions`],change_status:[`jobs`,`candidates`,`submissions`,`onboarding`,`assignments`],candidate_self:[`candidates`],candidate_all:[`candidates`],my_jobs:[`jobs`],all_jobs:[`jobs`],reject:[`submissions`,`onboarding`,`assignments`,`timesheet`,`vendors`,`test cases`],viewProposedRate:[`submissions`],po_msa:[`onboarding`],reApprove:[`onboarding`],sendApprove:[`onboarding`]};function Pb(e,t){let n=String(t??``).trim().toLowerCase(),r=Object.keys(Nb).find(e=>e.toLowerCase()===n),i=r?Nb[r]:void 0;return!i||i.includes(String(e??``).trim().toLowerCase())}function Z({title:e,icon:t,extra:n,children:r,variant:i=`default`,...a}){let o=t||e?(0,l.jsxs)(`span`,{className:`app-card-title`,children:[t&&(0,l.jsx)(`span`,{className:`app-card-title-icon`,children:t}),e]}):void 0;return(0,l.jsx)(s.Card,{className:`app-card app-card--${i}`,title:o,extra:n,...a,children:r})}var{Text:Fb}=s.Typography,{Option:Ib}=s.Select,Lb=[{key:`job`,label:`Jobs`},{key:`candidate`,label:`Candidates`},{key:`submissions`,label:`Submissions`},{key:`billing`,label:`Billing`},{key:`payroll`,label:`Payroll`}],Rb=[{key:``,label:`Text`,icon:(0,l.jsx)(`span`,{style:{fontSize:14,fontWeight:700},children:`Aa`})},{key:`badge`,label:`Badge`,icon:(0,l.jsx)(c.TagsOutlined,{style:{fontSize:16}})},{key:`avatar`,label:`Avatar`,icon:(0,l.jsx)(c.UserOutlined,{style:{fontSize:16}})},{key:`link`,label:`Link`,icon:(0,l.jsx)(c.LinkOutlined,{style:{fontSize:16}})}],zb=[{color:`#52c41a`,bg:`#f6ffed`},{color:`#1677ff`,bg:`#e6f7ff`},{color:`#fa8c16`,bg:`#fff7e6`},{color:`#ff4d4f`,bg:`#fff2f0`},{color:`#722ed1`,bg:`#f9f0ff`},{color:`#13c2c2`,bg:`#e6fffb`},{color:`#eb2f96`,bg:`#fff0f6`},{color:`#faad14`,bg:`#fffbe6`}],Bb={job:`jobs`,candidate:`candidates`,submissions:`submissions`,billing:`billing`,payroll:`payroll`};function Vb(e){return String(e||``).replace(/[-_]/g,` `).replace(/\b\w/g,e=>e.toUpperCase()).trim()}function Hb(e){if(typeof e==`string`)return{key:e,apiModule:e,label:Vb(e)};let t=e?.menuKey??e?.key??e?.moduleKey??e?.value??e?.module??e?.apiModule??e?.name??e?.modulename??e?.menuName;return t?{key:t,apiModule:e?.apiModule??e?.api_module??e?.module??e?.value??e?.menuKey??e?.key??e?.name??e?.modulename??e?.menuName??t,label:e?.label??e?.moduleLabel??e?.moduleName??e?.name??e?.modulename??e?.menuName??Vb(t)}:null}function Ub(e){let t=Array.isArray(e)&&e.length?e:Lb,n=new Set,r=t.map(Hb).filter(Boolean).filter(e=>!n.has(e.key)&&(n.add(e.key),!0));return r.length?r:Lb}function Wb({field:e,collections:t,collFields:r,subfields:i,onCollectionChange:a,onLookupFieldChange:u,addSecondaryField:d,removeSecondaryField:f,addActionButton:p,updateActionButton:m,removeActionButton:h,moduleKey:g,fieldKey:_,update:v}){let[y,b]=(0,o.useState)(``),[x,S]=(0,o.useState)({}),[C,w]=(0,o.useState)(!1);function T(e){v(e===`common`?{commonStyle:{color:`#1677ff`,bg:`#e6f7ff`,variant:`badge`},valueStyles:[]}:{commonStyle:null})}function E(t){v({commonStyle:{...e.commonStyle??{color:`#595959`,bg:`#f5f5f5`,variant:`badge`},...t}})}function D(){v({valueStyles:[...e.valueStyles??[],{value:``,label:``,color:`#595959`,bg:`#f5f5f5`,variant:`badge`}]})}function O(t,n){let r=[...e.valueStyles??[]];r[t]={...r[t],...n},v({valueStyles:r})}function k(t){v({valueStyles:(e.valueStyles??[]).filter((e,n)=>n!==t)})}async function A(){w(!0);try{let t=await Fn(e.apiModule??Bb[g]??g,_,``,50,0),n=(Array.isArray(t)?t:t?.data??[]).map((e,t)=>{let n=typeof e==`object`?e.value??e.label??``:String(e),r=typeof e==`object`?e.label??e.value??``:String(e);return{value:String(n),label:String(r),variant:`badge`,...zb[t%zb.length]}});if(n.length===0){s.message.info(`No values found for this field`);return}v({valueStyles:n})}catch{s.message.error(`Could not detect values`)}finally{w(!1)}}async function j(e,t){S(t=>({...t,[e]:!0}));try{let r=await n.gi(t);m(e,{iconUrl:r?.iconUrl??r?.url??``,iconPath:r?.iconPath??r?.path??``})}catch{s.message.error(`Icon upload failed`)}finally{S(t=>({...t,[e]:!1}))}return!1}let M=e.renderType??``,N=!!e.commonStyle,P=e.commonStyle??{},F=e.valueStyles??[],I=e.renderConfig??{};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`uss-detail-section`,children:[(0,l.jsx)(`div`,{className:`uss-detail-label`,children:`Display Style`}),(0,l.jsx)(`div`,{className:`uss-detail-row`,children:Rb.map(e=>(0,l.jsxs)(`button`,{className:`uss-render-type-btn${M===e.key?` active`:``}`,onClick:()=>v({renderType:e.key,commonStyle:null,valueStyles:[],renderConfig:null}),children:[e.icon,(0,l.jsx)(`span`,{children:e.label})]},e.key))}),M===`badge`&&(0,l.jsxs)(`div`,{className:`uss-badge-config`,children:[(0,l.jsxs)(s.Radio.Group,{size:`small`,value:N?`common`:`perValue`,onChange:e=>T(e.target.value),style:{marginBottom:8},children:[(0,l.jsx)(s.Radio,{value:`perValue`,children:`Per value`}),(0,l.jsx)(s.Radio,{value:`common`,children:`Same for all`})]}),N&&(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,flexWrap:`wrap`},children:[(0,l.jsx)(s.Tooltip,{title:`Text color`,children:(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,l.jsx)(`input`,{type:`color`,value:P.color||`#595959`,style:{width:28,height:24,border:`none`,cursor:`pointer`,padding:0},onChange:e=>E({color:e.target.value})}),(0,l.jsx)(Fb,{style:{fontSize:10},children:`Text`})]})}),(0,l.jsx)(s.Tooltip,{title:`Background color`,children:(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,l.jsx)(`input`,{type:`color`,value:P.bg||`#f5f5f5`,style:{width:28,height:24,border:`none`,cursor:`pointer`,padding:0},onChange:e=>E({bg:e.target.value})}),(0,l.jsx)(Fb,{style:{fontSize:10},children:`BG`})]})}),(0,l.jsx)(s.Select,{size:`small`,style:{width:80},value:P.variant||`badge`,options:[{value:`badge`,label:`Badge`},{value:`dot`,label:`Dot`},{value:`tag`,label:`Tag`}],onChange:e=>E({variant:e})}),(0,l.jsx)(`span`,{style:{padding:`1px 12px`,borderRadius:20,fontSize:11,fontWeight:500,color:P.color||`#595959`,background:P.bg||`#f5f5f5`},children:`Preview`})]}),!N&&(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:6},children:[(0,l.jsx)(Fb,{style:{fontSize:11,color:`#555`,fontWeight:600},children:`Value → Style mapping`}),(0,l.jsxs)(s.Space,{size:6,children:[(0,l.jsx)(s.Button,{size:`small`,loading:C,onClick:A,children:`Auto-detect values`}),(0,l.jsx)(s.Button,{size:`small`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:D,children:`Add`})]})]}),F.length===0&&(0,l.jsx)(Fb,{type:`secondary`,style:{fontSize:12},children:`Click "Auto-detect values" to populate from live data, or "Add" to map manually.`}),F.map((e,t)=>(0,l.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr 62px 62px 54px 26px`,gap:5,alignItems:`center`,marginBottom:6},children:[(0,l.jsx)(s.Input,{size:`small`,placeholder:`raw value`,value:e.value??``,onChange:e=>O(t,{value:e.target.value})}),(0,l.jsx)(s.Input,{size:`small`,placeholder:`display label`,value:e.label??``,onChange:e=>O(t,{label:e.target.value})}),(0,l.jsx)(s.Tooltip,{title:`Text color`,children:(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:3},children:[(0,l.jsx)(`input`,{type:`color`,value:e.color||`#595959`,style:{width:28,height:24,border:`none`,cursor:`pointer`,padding:0},onChange:e=>O(t,{color:e.target.value})}),(0,l.jsx)(Fb,{style:{fontSize:10},children:`Text`})]})}),(0,l.jsx)(s.Tooltip,{title:`Background color`,children:(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:3},children:[(0,l.jsx)(`input`,{type:`color`,value:e.bg||`#f5f5f5`,style:{width:28,height:24,border:`none`,cursor:`pointer`,padding:0},onChange:e=>O(t,{bg:e.target.value})}),(0,l.jsx)(Fb,{style:{fontSize:10},children:`BG`})]})}),(0,l.jsx)(`span`,{style:{padding:`1px 6px`,borderRadius:20,fontSize:11,fontWeight:500,textAlign:`center`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:e.color||`#595959`,background:e.bg||`#f5f5f5`},children:e.label||e.value||`…`}),(0,l.jsx)(s.Button,{size:`small`,type:`text`,danger:!0,icon:(0,l.jsx)(c.CloseOutlined,{}),onClick:()=>k(t)})]},t))]})]}),(0,l.jsxs)(`div`,{style:{marginTop:10},children:[(0,l.jsx)(Fb,{style:{fontSize:11,color:`#555`,display:`block`,marginBottom:3},children:`Array item field (latest item)`}),(0,l.jsx)(s.Select,{size:`small`,showSearch:!0,allowClear:!0,style:{width:`100%`},placeholder:i.length>0?`Select a child field from the array`:`Enter child field, e.g. clientBudgetStart`,value:I.lastItemField||void 0,options:i.map(e=>({value:e,label:e})),onChange:e=>v({renderConfig:{...I,lastItemField:e??``}}),onSearch:e=>{i.includes(e)},dropdownRender:e=>(0,l.jsxs)(l.Fragment,{children:[e,(0,l.jsx)(`div`,{style:{padding:`8px 10px`,borderTop:`1px solid var(--color-border-muted)`},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Custom child field`,value:I.lastItemField||``,onChange:e=>v({renderConfig:{...I,lastItemField:e.target.value.trim()}})})})]})}),(0,l.jsx)(Fb,{type:`secondary`,style:{display:`block`,marginTop:4,fontSize:10},children:`For an array such as jobPayDetails, ListView displays this field from the last array element.`})]}),M===`avatar`&&(0,l.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr 80px`,gap:8,marginTop:8},children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Fb,{style:{fontSize:11,color:`#555`,display:`block`,marginBottom:3},children:`Name field`}),(0,l.jsx)(s.Select,{size:`small`,showSearch:!0,allowClear:!0,style:{width:`100%`},placeholder:`e.g. recruiterName`,value:I.labelField||void 0,options:i.length>0?i.map(e=>({value:e,label:e})):[],onChange:e=>v({renderConfig:{...I,labelField:e??``}})})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Fb,{style:{fontSize:11,color:`#555`,display:`block`,marginBottom:3},children:`Color field (opt.)`}),(0,l.jsx)(s.Select,{size:`small`,showSearch:!0,allowClear:!0,style:{width:`100%`},placeholder:`color`,value:I.colorField||void 0,options:i.length>0?i.map(e=>({value:e,label:e})):[],onChange:e=>v({renderConfig:{...I,colorField:e??``}})})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Fb,{style:{fontSize:11,color:`#555`,display:`block`,marginBottom:3},children:`Max visible`}),(0,l.jsx)(s.Input,{size:`small`,type:`number`,min:1,max:10,value:I.maxVisible||3,onChange:e=>v({renderConfig:{...I,maxVisible:Number(e.target.value)||3}})})]})]})]}),(0,l.jsxs)(`div`,{className:`uss-detail-section`,children:[(0,l.jsx)(`div`,{className:`uss-detail-label`,children:`Display Template`}),(0,l.jsx)(ag,{value:e.displayTemplate??``,onChange:e=>v({displayTemplate:e}),placeholder:`e.g. {{firstName}} {{lastName}}`})]}),(0,l.jsxs)(`div`,{className:`uss-detail-section`,children:[(0,l.jsx)(`div`,{className:`uss-detail-label`,children:`Default Value`}),(0,l.jsx)(s.Input,{size:`small`,allowClear:!0,value:e.defaultValue??``,onChange:e=>v({defaultValue:e.target.value}),placeholder:`Shown when data is empty, e.g. N/A`}),(0,l.jsx)(Fb,{type:`secondary`,style:{display:`block`,marginTop:4,fontSize:10},children:`Used only when this column resolves to an empty, null, missing, or unavailable value.`})]}),(0,l.jsxs)(`div`,{className:`uss-detail-section`,children:[(0,l.jsx)(`div`,{className:`uss-detail-label`,children:`Empty / Group Value Rules`}),(0,l.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12},children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Fb,{style:{fontSize:11},children:`Treat numeric 0 as empty`}),(0,l.jsx)(Fb,{type:`secondary`,style:{display:`block`,fontSize:10},children:`Useful for integer fields where 0 means the value was not provided.`})]}),(0,l.jsx)(s.Switch,{size:`small`,checked:!!I.treatZeroAsEmpty,onChange:e=>v({renderConfig:{...I,treatZeroAsEmpty:e}})})]}),(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12},children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Fb,{style:{fontSize:11},children:`Clean grouped template when a value is empty`}),(0,l.jsxs)(Fb,{type:`secondary`,style:{display:`block`,fontSize:10},children:[`Example: `,(0,l.jsx)(`code`,{children:`{{field1}} - {{field2}}`}),` shows only field2 when field1 is empty, without the extra dash.`]})]}),(0,l.jsx)(s.Switch,{size:`small`,checked:!!I.cleanEmptyTemplateSeparators,onChange:e=>v({renderConfig:{...I,cleanEmptyTemplateSeparators:e}})})]})]})]}),(0,l.jsxs)(`div`,{className:`uss-detail-section`,children:[(0,l.jsxs)(`div`,{className:`uss-detail-label`,children:[`Link`,(0,l.jsx)(s.Switch,{size:`small`,style:{marginLeft:8},checked:!!e.isLink,onChange:e=>v({isLink:e})})]}),e.isLink&&(0,l.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,paddingTop:4},children:[(0,l.jsx)(ag,{value:e.linkTemplate??``,onChange:e=>v({linkTemplate:e}),placeholder:`e.g. /jobs/{{jobId}}`}),(0,l.jsxs)(`div`,{className:`uss-detail-row`,children:[(0,l.jsxs)(s.Select,{size:`small`,value:e.linkType??`internal`,onChange:e=>v({linkType:e}),style:{width:120},children:[(0,l.jsx)(Ib,{value:`internal`,children:`internal`}),(0,l.jsx)(Ib,{value:`external`,children:`external`})]}),(0,l.jsxs)(s.Select,{size:`small`,value:e.linkTarget??`_self`,onChange:e=>v({linkTarget:e}),style:{width:100},children:[(0,l.jsx)(Ib,{value:`_self`,children:`_self`}),(0,l.jsx)(Ib,{value:`_blank`,children:`_blank`})]})]})]})]}),(0,l.jsxs)(`div`,{className:`uss-detail-section`,children:[(0,l.jsx)(`div`,{className:`uss-detail-label`,children:`Secondary Fields`}),(0,l.jsx)(`div`,{className:`uss-detail-row`,style:{flexWrap:`wrap`},children:(e.secondaryFields??[]).map(e=>(0,l.jsxs)(`span`,{className:`uss-secondary-tag`,children:[e,(0,l.jsx)(`button`,{onClick:()=>f(e),children:`×`})]},e))}),(0,l.jsxs)(`div`,{className:`uss-detail-row`,children:[(0,l.jsx)(s.Input,{size:`small`,placeholder:`Add field key`,value:y,onChange:e=>b(e.target.value),onPressEnter:()=>{d(y),b(``)},style:{width:160}}),(0,l.jsx)(s.Button,{size:`small`,type:`link`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>{d(y),b(``)},children:`Add`})]}),e.secondaryFields?.length>0&&(0,l.jsxs)(`div`,{style:{marginTop:4,display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(Fb,{style:{fontSize:11,color:`var(--color-text-muted)`},children:`Separator:`}),(0,l.jsx)(s.Input,{size:`small`,value:e.secondarySeparator??``,placeholder:`·`,style:{width:64},onChange:e=>v({secondarySeparator:e.target.value})})]})]}),(0,l.jsxs)(`div`,{className:`uss-detail-section`,children:[(0,l.jsxs)(`div`,{className:`uss-detail-label`,children:[`Lookup (FK resolve)`,(0,l.jsx)(s.Switch,{size:`small`,style:{marginLeft:8},checked:!!e.lookup,onChange:e=>v({lookup:e?{collection:``,displayField:``,valueField:``,projectFields:[]}:null})})]}),e.lookup&&(0,l.jsxs)(`div`,{className:`uss-lookup-grid`,children:[(0,l.jsxs)(`div`,{className:`uss-lookup-row`,children:[(0,l.jsx)(`span`,{className:`uss-lookup-label`,children:`Collection`}),(0,l.jsx)(s.Select,{size:`small`,value:e.lookup?.collection??``,onChange:a,showSearch:!0,placeholder:`Select collection`,style:{flex:1},children:t.map(e=>(0,l.jsx)(Ib,{value:e,children:e},e))})]}),(0,l.jsxs)(`div`,{className:`uss-lookup-row`,children:[(0,l.jsx)(`span`,{className:`uss-lookup-label`,children:`Tenant scoped`}),(0,l.jsx)(s.Switch,{size:`small`,checked:!!e.lookup?.tenantScoped,onChange:t=>u(e.fieldKey,{tenantScoped:t})})]}),(0,l.jsxs)(`div`,{className:`uss-lookup-row`,children:[(0,l.jsx)(`span`,{className:`uss-lookup-label`,children:`Source Field`}),(0,l.jsx)(s.Input,{size:`small`,value:e.lookup?.localField??``,placeholder:`Defaults to ${e.fieldKey}`,onChange:t=>u(e.fieldKey,{localField:t.target.value}),style:{flex:1}})]}),r.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`uss-lookup-row`,children:[(0,l.jsx)(`span`,{className:`uss-lookup-label`,children:`Value Field`}),(0,l.jsx)(s.Select,{size:`small`,value:e.lookup?.valueField??``,onChange:t=>u(e.fieldKey,{valueField:t}),placeholder:`ID field`,style:{flex:1},children:r.map(e=>(0,l.jsx)(Ib,{value:e,children:e},e))})]}),(0,l.jsxs)(`div`,{className:`uss-lookup-row`,children:[(0,l.jsx)(`span`,{className:`uss-lookup-label`,children:`Display Field`}),(0,l.jsx)(s.Select,{size:`small`,value:e.lookup?.displayField??``,onChange:t=>u(e.fieldKey,{displayField:t}),placeholder:`Label field`,style:{flex:1},children:[...r,...i].map(e=>(0,l.jsx)(Ib,{value:e,children:e},e))})]})]})]})]}),(0,l.jsxs)(`div`,{className:`uss-detail-section`,children:[(0,l.jsxs)(`div`,{className:`uss-detail-label`,children:[`Derived Array Value`,(0,l.jsx)(s.Switch,{size:`small`,style:{marginLeft:8},checked:!!e.derived,onChange:e=>v({derived:e?{type:`arrayField`,source:``,matchField:``,matchValue:``,valueField:``,default:null}:null})})]}),e.derived&&(0,l.jsx)(`div`,{className:`uss-lookup-grid`,children:[[`Source array`,`source`,`e.g. stages`],[`Match field`,`matchField`,`e.g. stageCode`],[`Match value`,`matchValue`,`e.g. PO_MSA`],[`Value field`,`valueField`,`e.g. status`]].map(([t,n,r])=>(0,l.jsxs)(`div`,{className:`uss-lookup-row`,children:[(0,l.jsx)(`span`,{className:`uss-lookup-label`,children:t}),(0,l.jsx)(s.Input,{size:`small`,value:e.derived?.[n]??``,placeholder:r,onChange:t=>v({derived:{...e.derived,[n]:t.target.value}})})]},n))})]}),(0,l.jsxs)(`div`,{className:`uss-detail-section`,children:[(0,l.jsxs)(`div`,{className:`uss-detail-label`,children:[`Computed Value`,(0,l.jsx)(s.Switch,{size:`small`,style:{marginLeft:8},checked:!!e.computed,onChange:e=>v({computed:e?{operator:`subtract`,operands:[],default:0}:null})})]}),e.computed&&(0,l.jsxs)(`div`,{className:`uss-lookup-grid`,children:[(0,l.jsxs)(`div`,{className:`uss-lookup-row`,children:[(0,l.jsx)(`span`,{className:`uss-lookup-label`,children:`Operator`}),(0,l.jsx)(s.Select,{size:`small`,value:e.computed?.operator??`subtract`,style:{flex:1},options:[`add`,`subtract`,`multiply`,`divide`,`percentage`,`ifNull`].map(e=>({value:e,label:e})),onChange:t=>v({computed:{...e.computed,operator:t}})})]}),(0,l.jsx)(Fb,{style:{fontSize:11},children:`Operands JSON (field or value entries)`}),(0,l.jsx)(s.Input.TextArea,{rows:3,defaultValue:JSON.stringify(e.computed?.operands??[],null,2),placeholder:`[{"field":"billRate"},{"field":"payRate"}]`,onBlur:t=>{try{let n=JSON.parse(t.target.value||`[]`);if(!Array.isArray(n))throw Error(`Operands must be an array`);v({computed:{...e.computed,operands:n}})}catch(e){s.message.error(e.message||`Invalid operands JSON`)}}},JSON.stringify(e.computed?.operands??[]))]})]}),(0,l.jsxs)(`div`,{className:`uss-detail-section`,children:[(0,l.jsxs)(`div`,{className:`uss-detail-label`,style:{display:`flex`,justifyContent:`space-between`},children:[(0,l.jsxs)(`span`,{children:[`Action Buttons `,(0,l.jsx)(`span`,{style:{fontSize:11,fontWeight:400,color:`var(--color-text-muted)`},children:`(max 3)`})]}),(e.actionButtons??[]).length<3&&(0,l.jsx)(s.Button,{type:`link`,size:`small`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:p,children:`Add Icon`})]}),(e.actionButtons??[]).map((e,t)=>(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`uss-action-btn-row`,children:[(0,l.jsx)(s.Upload,{showUploadList:!1,beforeUpload:e=>(j(t,e),!1),accept:`image/*`,children:(0,l.jsx)(s.Tooltip,{title:`Click to upload icon`,children:(0,l.jsx)(`div`,{className:`uss-action-btn-icon-slot`,children:x[t]?(0,l.jsx)(s.Spin,{size:`small`}):e.iconUrl?(0,l.jsx)(`img`,{src:e.iconUrl,alt:`action-${t}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,l.jsx)(c.UploadOutlined,{style:{color:`#aaa`,fontSize:14}})})})}),(0,l.jsx)(s.Input,{size:`small`,value:e.name??``,onChange:e=>m(t,{name:e.target.value}),placeholder:`Tooltip (e.g. Edit)`,style:{width:110}}),(0,l.jsxs)(s.Radio.Group,{size:`small`,value:e.type??`page`,onChange:e=>m(t,{type:e.target.value}),children:[(0,l.jsx)(s.Radio,{value:`page`,children:`Page`}),(0,l.jsx)(s.Radio,{value:`popup`,children:`Popup`})]}),(0,l.jsx)(s.Input,{size:`small`,value:e.routeUrl??``,onChange:e=>m(t,{routeUrl:e.target.value}),placeholder:`Route URL (e.g. /jobs/:_id)`,prefix:(0,l.jsx)(c.LinkOutlined,{style:{color:`#bbb`}}),style:{flex:1}}),(0,l.jsx)(s.Button,{size:`small`,danger:!0,type:`text`,onClick:()=>h(t),children:`✕`})]}),(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,paddingLeft:36},children:[(0,l.jsx)(Fb,{style:{fontSize:11,color:`#999`,whiteSpace:`nowrap`},children:`Permission:`}),(0,l.jsx)(s.Select,{size:`small`,allowClear:!0,value:e.permissionKey||void 0,onChange:e=>m(t,{permissionKey:e??``}),placeholder:`Always visible`,style:{width:180},options:[{value:`edit`},{value:`delete`},{value:`add`},{value:`view`}]})]}),(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,paddingLeft:36,marginTop:4,flexWrap:`wrap`},children:[(0,l.jsx)(Fb,{style:{fontSize:11,color:`#999`,whiteSpace:`nowrap`},children:`Show only if:`}),(0,l.jsx)(s.Input,{size:`small`,value:e.showIfField??``,onChange:e=>m(t,{showIfField:e.target.value}),placeholder:`field (e.g. createdBy)`,style:{width:180}}),(0,l.jsx)(s.Select,{size:`small`,value:e.showIfOperator||`eq`,style:{width:130},onChange:e=>m(t,{showIfOperator:e}),options:Gb}),![`isEmpty`,`notEmpty`].includes(e.showIfOperator||`eq`)&&(0,l.jsx)(s.Select,{size:`small`,showSearch:!0,allowClear:!0,mode:`tags`,maxCount:1,value:e.showIfValue?[e.showIfValue]:[],style:{width:200},onChange:e=>m(t,{showIfValue:e[e.length-1]??``}),placeholder:`value or {currentUserId}`,options:[{value:`{currentUserId}`,label:`{currentUserId} — signed-in user`}],filterOption:(e,t)=>(t?.label??t?.value??``).toLowerCase().includes(e.toLowerCase())}),e.showIfField&&(0,l.jsx)(s.Button,{size:`small`,type:`text`,danger:!0,icon:(0,l.jsx)(c.CloseOutlined,{}),onClick:()=>m(t,{showIfField:``,showIfOperator:``,showIfValue:``})})]})]},t))]})]})}var Gb=[{value:`eq`,label:`equals`},{value:`ne`,label:`not equals`},{value:`isEmpty`,label:`is empty`},{value:`notEmpty`,label:`is not empty`},{value:`contains`,label:`contains`},{value:`includes`,label:`list includes (exact)`},{value:`notIncludes`,label:`list excludes (exact)`}],Kb=[{label:`Module data (distinct)`,value:`module`},{label:`Masters collection`,value:`master`},{label:`Group value`,value:`group`}],qb=[`select`,`radio`,`checkbox`],Jb=[{label:`Dropdown`,value:`dropdown`},{label:`Checkbox`,value:`checkbox`},{label:`Radio`,value:`radio`},{label:`Date Range`,value:`datepicker`},{label:`Number Range`,value:`number-range`}];function Yb({field:e,update:t,configType:n,collections:r,collFields:i,onCollectionChange:a,onLookupFieldChange:o,availableFields:c=[]}){let u=qb.includes(e.type),d=!!e.lookup;function f(e){t({lookup:e?{collection:``,displayField:``,valueField:``,projectFields:[]}:null})}return(0,l.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`},children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(Fb,{style:{fontSize:12},children:`Editable`}),(0,l.jsx)(s.Switch,{size:`small`,checked:!!e.isEditable,onChange:e=>t({isEditable:e})})]}),(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(Fb,{style:{fontSize:12},children:`Mandatory`}),(0,l.jsx)(s.Switch,{size:`small`,checked:!!e.ismandatory,onChange:e=>t({ismandatory:e})})]}),n===`filter`&&(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(Fb,{style:{fontSize:12},children:`Value Input`}),(0,l.jsx)(s.Select,{size:`small`,value:e.filterInputType??`dropdown`,onChange:e=>t({filterInputType:e}),options:Jb,style:{width:140}})]}),n===`filter`&&(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(Fb,{style:{fontSize:12},children:`Default`}),(0,l.jsx)(s.Switch,{size:`small`,checked:!!e.isDefaultFilter,onChange:e=>t({isDefaultFilter:e})})]}),n===`filter`&&(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(Fb,{style:{fontSize:12},children:`Lookup`}),(0,l.jsx)(s.Switch,{size:`small`,checked:d,onChange:f})]}),n===`filter`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:360},children:[(0,l.jsx)(Fb,{style:{fontSize:12},children:`Group Value Fields`}),(0,l.jsx)(s.Select,{size:`small`,mode:`multiple`,allowClear:!0,value:Array.isArray(e.filterGroupFields)?e.filterGroupFields:[],onChange:e=>t({filterGroupFields:e}),options:(c??[]).map(e=>({label:e.fieldName??e.label??e.fieldKey,value:e.fieldKey})).filter(e=>e.value),placeholder:`e.g. First Name + Last Name`,style:{minWidth:250}})]}),(e.filterGroupFields??[]).length>1&&(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(Fb,{style:{fontSize:12},children:`Group Separator`}),(0,l.jsx)(s.Input,{size:`small`,value:e.filterGroupSeparator??` `,onChange:e=>t({filterGroupSeparator:e.target.value}),placeholder:`space`,style:{width:90}})]})]}),n===`filter`&&d&&(0,l.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`,flexWrap:`wrap`},children:[(0,l.jsx)(s.Select,{size:`small`,value:e.lookup?.collection||void 0,onChange:a,showSearch:!0,placeholder:`Collection`,style:{width:160},options:(r??[]).map(e=>({label:e,value:e}))}),(i??[]).length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Select,{size:`small`,value:e.lookup?.valueField||void 0,onChange:t=>o(e.fieldKey,{valueField:t}),showSearch:!0,placeholder:`Value field (ID)`,style:{width:160},options:(i??[]).map(e=>({label:e,value:e}))}),(0,l.jsx)(s.Input,{size:`small`,value:e.lookup?.displayField??``,onChange:t=>o(e.fieldKey,{displayField:t.target.value}),placeholder:`Display field (e.g. name)`,style:{width:180}})]})]}),u&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(Fb,{style:{fontSize:12},children:`Source`}),(0,l.jsx)(s.Select,{size:`small`,value:e.dataSource??`module`,onChange:e=>t({dataSource:e,groupName:``}),options:Kb,style:{width:170}})]}),(e.dataSource??`module`)===`group`&&(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(Fb,{style:{fontSize:12},children:`Group Name`}),(0,l.jsx)(s.Input,{size:`small`,value:e.groupName??``,onChange:e=>t({groupName:e.target.value}),placeholder:`e.g. skills`,style:{width:120}})]})]})]})}function Xb({field:e,index:t,configType:r,moduleKey:i,onUpdate:a,onReorder:u,collections:d,onFetchCollFields:f,dragFromRef:p,availableFields:m}){let[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(e.fieldName),[x,S]=(0,o.useState)([]),[C,w]=(0,o.useState)([]),[T,E]=(0,o.useState)(!1),[D,O]=(0,o.useState)(!1);(0,o.useEffect)(()=>{queueMicrotask(()=>{b(e.fieldName)})},[e.fieldName]),(0,o.useEffect)(()=>{if(!h||r!==`listView`||!e.fieldKey)return;let t=!1,a=e.apiModule??Bb[i]??i;return n.hr(a,e.fieldKey).then(e=>{t||w(Array.isArray(e)?e:[])}).catch(()=>{t||w([])}),()=>{t=!0}},[h,r,e.apiModule,e.fieldKey,i]);function k(e){p.current=t,e.dataTransfer.effectAllowed=`move`,O(!0)}function A(){O(!1),E(!1)}function j(e){e.preventDefault(),E(!0)}function M(){E(!1)}function N(e){e.preventDefault(),E(!1),p.current!==null&&p.current!==t&&u(p.current,t),p.current=null}function P(e){a(t,e)}function F(){v(!1);let t=y.trim();t&&t!==e.fieldName?P({fieldName:t}):b(e.fieldName)}async function I(t){P({lookup:{...e.lookup,collection:t,displayField:``,valueField:``,projectFields:[]}});let n=await f(t);S(n)}async function L(t,r){if(P({lookup:{...e.lookup,...r}}),r.valueField)try{w(await n.hr(i,t))}catch{w([])}}function R(t){let n=e.secondaryFields??[];!t||n.includes(t)||P({secondaryFields:[...n,t]})}function z(t){P({secondaryFields:(e.secondaryFields??[]).filter(e=>e!==t)})}function B(){let t=e.actionButtons??[];t.length>=3||P({actionButtons:[...t,{name:``,iconUrl:``,iconPath:``,type:`page`,routeUrl:``,permissionKey:``}]})}function V(t,n){let r=[...e.actionButtons??[]];r[t]={...r[t],...n},P({actionButtons:r})}function H(t){let n=[...e.actionButtons??[]];n.splice(t,1),P({actionButtons:n})}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{draggable:!0,onDragStart:k,onDragEnd:A,onDragOver:j,onDragLeave:M,onDrop:N,className:`uss-field-row${T?` drag-over`:``}${D?` dragging`:``}`,style:{gridTemplateColumns:`24px 1fr 80px 56px`},children:[(0,l.jsx)(`span`,{className:`uss-drag-handle`,children:(0,l.jsx)(c.HolderOutlined,{})}),(0,l.jsxs)(`span`,{className:`uss-field-name`,children:[e.isVirtual&&(0,l.jsx)(`span`,{className:`uss-virtual-tag`,children:`virtual`}),_?(0,l.jsx)(`input`,{autoFocus:!0,value:y,onChange:e=>b(e.target.value),onBlur:F,onKeyDown:t=>{t.key===`Enter`&&F(),t.key===`Escape`&&(v(!1),b(e.fieldName))},onClick:e=>e.stopPropagation()}):(0,l.jsx)(s.Tooltip,{title:`Double-click to rename`,children:(0,l.jsx)(`span`,{style:{cursor:`text`,borderBottom:`1px dashed var(--color-border-muted)`},onDoubleClick:e=>{e.stopPropagation(),v(!0)},children:e.fieldName})}),(0,l.jsx)(`span`,{className:`uss-field-key`,children:e.fieldKey})]}),(0,l.jsx)(`span`,{className:`uss-toggle-cell`,children:(0,l.jsx)(s.Switch,{size:`small`,checked:e.isVisible,onChange:e=>P({isVisible:e})})}),(0,l.jsx)(`span`,{className:`uss-toggle-cell`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:h?(0,l.jsx)(c.DownOutlined,{}):(0,l.jsx)(c.RightOutlined,{}),onClick:()=>g(e=>!e),style:{color:`var(--color-text-muted)`}})})]}),h&&(0,l.jsx)(`div`,{className:`uss-detail-panel`,children:r===`listView`?(0,l.jsx)(Wb,{field:e,collections:d,collFields:x,subfields:C,onCollectionChange:I,onLookupFieldChange:L,addSecondaryField:R,removeSecondaryField:z,addActionButton:B,updateActionButton:V,removeActionButton:H,moduleKey:i,fieldKey:e.fieldKey,update:P}):(0,l.jsx)(Yb,{field:e,update:P,configType:r,collections:d,collFields:x,onCollectionChange:I,onLookupFieldChange:L,availableFields:m})})]})}function Zb({role:e,configType:t}){let[r,i]=(0,o.useState)({}),[a,c]=(0,o.useState)({}),[u,d]=(0,o.useState)({}),[f,p]=(0,o.useState)(Lb),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)({}),[v,y]=(0,o.useState)(`job`),[b,x]=(0,o.useState)([]),S=(0,o.useRef)({}),C=(0,o.useRef)(null),w=(0,o.useCallback)(async(r=e,i=t)=>{let[a,o]=await Promise.all([n._r().catch(()=>[]),n.gr()]),s=Ub(a);if(!i||i===`listView`){let e=await n.Vr(r,i,s);return{tabs:s,colls:o,fields:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.fields])),visibilityModes:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.dataVisibilityMode??`all`])),ownerFields:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.dataOwnerField??`createdBy`]))}}return{tabs:s,colls:o,fields:await n.Br(r,i,s),visibilityModes:{},ownerFields:{}}},[t,e]);(0,o.useEffect)(()=>{if(!e)return;let t=!1;return queueMicrotask(()=>{h(!0),(async()=>{try{let{tabs:e,colls:n,fields:r,visibilityModes:a,ownerFields:o}=await w();if(t)return;p(e),x(n),y(t=>e.some(e=>e.key===t)?t:e[0]?.key??``),i(r),c(a??{}),d(o??{})}catch{t||s.message.error(`Failed to load field config`)}finally{t||h(!1)}})()}),()=>{t=!0}},[w,e]);let T=r[v]??[];function E(e,t){i(n=>({...n,[e]:typeof t==`function`?t(n[e]??[]):t}))}function D(e,t){E(v,n=>n.map((n,r)=>r===e?{...n,...t}:n))}function O(e,t){E(v,n=>{let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),r.map((e,t)=>({...e,order:t}))})}async function k(e){if(S.current[e])return S.current[e];try{let t=await n.br(e);return S.current[e]=t,t}catch{return[]}}async function A(){let r=v;_(e=>({...e,[r]:!0}));try{await n.di(e,r,T,t,f,a[r]??`all`,u[r]??`createdBy`),s.message.success(`Saved`)}catch{s.message.error(`Save failed`)}finally{_(e=>({...e,[r]:!1}))}}return(0,l.jsxs)(s.Spin,{spinning:m,children:[(0,l.jsx)(s.Tabs,{size:`small`,activeKey:v,onChange:y,items:f.map(e=>({key:e.key,label:e.label}))}),(!t||t===`listView`)&&(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,margin:`4px 0 14px`},children:[(0,l.jsx)(Fb,{strong:!0,style:{minWidth:120},children:`Data Visibility`}),(0,l.jsx)(s.Select,{size:`small`,style:{width:290},value:a[v]??`all`,onChange:e=>c(t=>({...t,[v]:e})),options:[{value:`all`,label:`All Data`},{value:`reportingManager`,label:`Reporting Manager Wise`},{value:`self`,label:`My Created Data`}]}),(0,l.jsx)(Fb,{type:`secondary`,children:`Reporting Manager Wise shows data owned by the user and users reporting under them.`})]}),(!t||t===`listView`)&&(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,margin:`-4px 0 14px`},children:[(0,l.jsx)(Fb,{strong:!0,style:{minWidth:120},children:`Created By Field`}),(0,l.jsx)(s.Input,{size:`small`,style:{width:290},value:u[v]??`createdBy`,placeholder:`createdBy`,onChange:e=>d(t=>({...t,[v]:e.target.value})),onBlur:()=>d(e=>({...e,[v]:String(e[v]||``).trim()||`createdBy`}))}),(0,l.jsx)(Fb,{type:`secondary`,children:`Defaults to createdBy. Change this only when the module stores its creator/owner user ID in another field.`})]}),(0,l.jsxs)(`div`,{className:`uss-field-header`,style:{gridTemplateColumns:`24px 1fr 80px 56px`},children:[(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{children:`Field`}),(0,l.jsx)(`span`,{style:{textAlign:`center`},children:`Visible`}),(0,l.jsx)(`span`,{})]}),(0,l.jsxs)(`div`,{className:`uss-field-list`,children:[T.length===0&&!m&&(0,l.jsx)(`div`,{className:`uss-empty`,children:`No fields found.`}),T.map((e,n)=>(0,l.jsx)(Xb,{field:e,index:n,configType:t,moduleKey:v,onUpdate:D,onReorder:O,collections:b,onFetchCollFields:k,dragFromRef:C,availableFields:T},`${e.fieldKey??n}-${v}`))]}),(0,l.jsx)(`div`,{className:`uss-modal-footer`,children:(0,l.jsxs)(s.Button,{type:`primary`,size:`small`,loading:g[v],onClick:A,children:[`Save `,f.find(e=>e.key===v)?.label]})})]})}function Qb(e){return String(e||``).replace(/[-_]/g,` `).replace(/\b\w/g,e=>e.toUpperCase()).trim()}var $b=[`menuKey`,`menu_key`,`MENUKEY`,`module`,`key`,`moduleKey`,`value`,`apiModule`,`name`,`modulename`,`menuName`,`menu_name`,`MENUNAME`],ex=[`menuName`,`menu_name`,`MENUNAME`,`label`,`moduleLabel`,`moduleName`,`name`,`modulename`];function tx(e,t){for(let n of t){let t=e?.[n];if(t==null)continue;let r=String(t).trim();if(r)return r}}function nx(e){if(typeof e==`string`)return{value:e,label:Qb(e)};let t=tx(e,$b);return t?{value:t,label:tx(e,ex)??Qb(t)}:null}function rx(e){let t=new Set;return(Array.isArray(e)?e:[]).map(nx).filter(Boolean).filter(e=>!t.has(e.value)&&(t.add(e.value),!0))}var ix=Object.freeze({clientId:``,region:``}),{Text:ax}=s.Typography;function ox(e,t){return{...e,enabled:t,fields:e.fields.map(e=>({...e}))}}function sx(e,t){return{...e,editable:t,fields:e.fields.map(e=>({...e}))}}function cx({role:e}){let[t,r]=(0,o.useState)([]),[i,a]=(0,o.useState)(``),[u,d]=(0,o.useState)([]),[f,p]=(0,o.useState)(!1),[m,h]=(0,o.useState)(!1),g=ix,_=(0,o.useCallback)(async()=>rx(await n._r().catch(()=>[])).map(({value:e,label:t})=>({key:e,label:t})),[]);(0,o.useEffect)(()=>{let e=!1;return queueMicrotask(()=>{_().then(t=>{e||(r(t),a(e=>t.some(t=>t.key===e)?e:t[0]?.key??``))})}),()=>{e=!0}},[_]);let v=(0,o.useCallback)(async(t,r)=>{if(!e||!t){d([]);return}p(!0);try{let i=await n.Rr(e,t,r);d(Array.isArray(i)?i:[])}catch{s.message.error(`Failed to load form permissions`),d([])}finally{p(!1)}},[e]);(0,o.useEffect)(()=>{queueMicrotask(()=>{v(i,g)})},[i,g,v]);function y(e,t){d(n=>n.map(n=>n.name===e?ox(n,t):n))}function b(e,t){d(n=>n.map(n=>n.name===e?sx(n,t):n))}function x(e,t,n){d(r=>r.map(r=>r.name===e?{...r,fields:r.fields.map(e=>e.field===t?{...e,enabled:n}:e)}:r))}function S(e,t,n){d(r=>r.map(r=>r.name===e?{...r,fields:r.fields.map(e=>e.field===t?{...e,editable:n}:e)}:r))}async function C(){h(!0);try{await n.ni(e,i,u),s.message.success(`Saved`)}catch{s.message.error(`Save failed`)}finally{h(!1)}}return(0,l.jsxs)(s.Spin,{spinning:f,children:[(0,l.jsx)(s.Tabs,{size:`small`,activeKey:i,onChange:a,items:t.map(e=>({key:e.key,label:e.label}))}),(0,l.jsxs)(`div`,{className:`fg-expanded-fields`,style:{marginTop:8},children:[u.length===0&&!f&&(0,l.jsx)(s.Empty,{description:`No form groups configured for this module.`}),u.map(e=>(0,l.jsxs)(`div`,{className:`fg-field-card`,style:{flexDirection:`column`,alignItems:`stretch`},children:[(0,l.jsxs)(`div`,{className:`fg-field-card-inner`,style:{padding:`8px 12px`},children:[(0,l.jsxs)(`span`,{className:`uss-field-name`,style:{flex:1},children:[(0,l.jsx)(`strong`,{children:e.label}),e.locked&&(0,l.jsx)(s.Tooltip,{title:`Every field in this group is disabled globally in Form Groups`,children:(0,l.jsx)(c.LockOutlined,{style:{marginLeft:6,color:`var(--color-text-muted)`}})})]}),(0,l.jsxs)(s.Space,{size:16,children:[(0,l.jsxs)(`span`,{className:`uss-toggle-pair`,children:[(0,l.jsx)(ax,{type:`secondary`,style:{fontSize:11,marginRight:6},children:`Show`}),(0,l.jsx)(s.Switch,{size:`small`,checked:e.enabled,disabled:e.locked,checkedChildren:`On`,unCheckedChildren:`Off`,onChange:t=>y(e.name,t)})]}),(0,l.jsxs)(`span`,{className:`uss-toggle-pair`,children:[(0,l.jsx)(ax,{type:`secondary`,style:{fontSize:11,marginRight:6},children:`Editable`}),(0,l.jsx)(s.Switch,{size:`small`,checked:e.editable!==!1,disabled:e.locked||!e.enabled,checkedChildren:`Yes`,unCheckedChildren:`No`,onChange:t=>b(e.name,t)})]})]})]}),(0,l.jsx)(`div`,{className:`fg-expanded-fields`,style:{padding:`4px 12px 10px 28px`,opacity:e.enabled?1:.5},children:e.fields.map(t=>(0,l.jsxs)(`div`,{className:`fg-field-row`,style:{justifyContent:`space-between`},children:[(0,l.jsxs)(`span`,{className:`fg-field-row-info`,children:[(0,l.jsx)(`span`,{className:`fg-field-row-label`,children:t.label}),(0,l.jsx)(`span`,{className:`fg-field-row-key`,children:t.field}),t.locked&&(0,l.jsx)(s.Tooltip,{title:`Disabled globally in Form Groups — a role can never re-enable it`,children:(0,l.jsx)(c.LockOutlined,{style:{color:`var(--color-text-muted)`}})})]}),(0,l.jsxs)(s.Space,{size:16,children:[(0,l.jsxs)(`span`,{className:`uss-toggle-pair`,children:[(0,l.jsx)(ax,{type:`secondary`,style:{fontSize:11,marginRight:6},children:`Show`}),(0,l.jsx)(s.Switch,{size:`small`,checked:t.enabled,disabled:t.locked||!e.enabled,checkedChildren:`On`,unCheckedChildren:`Off`,onChange:n=>x(e.name,t.field,n)})]}),(0,l.jsxs)(`span`,{className:`uss-toggle-pair`,children:[(0,l.jsx)(ax,{type:`secondary`,style:{fontSize:11,marginRight:6},children:`Editable`}),(0,l.jsx)(s.Switch,{size:`small`,checked:t.editable!==!1,disabled:t.locked||!e.enabled||!t.enabled||e.editable===!1,checkedChildren:`Yes`,unCheckedChildren:`No`,onChange:n=>S(e.name,t.field,n)})]})]})]},t.field))})]},e.name))]}),u.length>0&&(0,l.jsx)(`div`,{className:`uss-modal-footer`,children:(0,l.jsxs)(s.Button,{type:`primary`,size:`small`,loading:m,onClick:C,children:[`Save `,t.find(e=>e.key===i)?.label]})}),(0,l.jsxs)(ax,{type:`secondary`,style:{fontSize:11,display:`block`,marginTop:8},children:[`Groups and fields are read from Form Groups. `,(0,l.jsx)(`b`,{children:`Show`}),` hides a group/field from the add & edit form; `,(0,l.jsx)(`b`,{children:`Editable`}),` keeps it visible but read-only (disabled). Everything is shown and editable by default. A role can only ever narrow what Form Groups already enables — never re-enable something disabled globally.`]})]})}var{Text:lx,Title:ux}=s.Typography,dx=(e,t)=>`${e}::${t}`,fx=e=>String(e??``).trim().toLowerCase();function px(e){let t=fx(e);for(let e of[`details`,`detail`])if(t.endsWith(e)){let n=t.slice(0,-e.length);if(n)return n}return``}function mx(e,t){let[n,r]=[fx(e),fx(t)],i=e=>e.replace(/s$/,``);return i(px(n))===i(r)||i(px(r))===i(n)}function hx(e){let t=new Set;return(e??[]).forEach(e=>{t.add(e.key),(e.children??[]).forEach(n=>t.add(dx(e.key,n.key)))}),t}function gx({role:e}){let t=Number(e?.roleId??0),[r,i]=(0,o.useState)([]),[a,u]=(0,o.useState)(``),[d,f]=(0,o.useState)([]),[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(new Set),[y,b]=(0,o.useState)(!1),[x,S]=(0,o.useState)([]),C=(0,o.useMemo)(()=>x.filter(e=>mx(e,a)),[x,a]);(0,o.useEffect)(()=>{n.cr().then(e=>{let t=rx(e).map(e=>e.value);i(t),u(e=>e||t[0]||``)}).catch(()=>i([])),n.Ur().then(e=>S([...new Set((Array.isArray(e)?e:[]).map(e=>String(e?.module??``).trim()).filter(Boolean))])).catch(()=>S([]))},[]);let w=(0,o.useCallback)(async()=>{if(a){m(!0);try{let e=await n.Ur(a);f(Array.isArray(e)?e:[])}catch(e){s.message.error(e.message),f([])}finally{m(!1)}}},[a]);(0,o.useEffect)(()=>{queueMicrotask(()=>{w()})},[w]);let T=(0,o.useCallback)(e=>{let t=d.filter(t=>t.roleId===e);return t.find(e=>e.module===a)??t[0]??null},[d,a]),E=(0,o.useMemo)(()=>T(0),[T]),D=(0,o.useMemo)(()=>T(t),[T,t]),O=(0,o.useMemo)(()=>E?.rowActions??D?.rowActions??[],[E,D]);(0,o.useEffect)(()=>{queueMicrotask(()=>{v(hx(D?D.rowActions:O)),b(!1)})},[D,O]);function k(e,t,n=[]){v(r=>{let i=new Set(r);return t?(i.add(e),n.forEach(e=>i.add(e))):(i.delete(e),n.forEach(e=>i.delete(e))),i}),b(!0)}async function A(){let r=O.filter(e=>_.has(e.key)).map(e=>e.children?.length?{...e,children:e.children.filter(t=>_.has(dx(e.key,t.key)))}:e);g(!0);try{D?await n.pi(D.id??D._id,r):await n.Zn({module:a,roleId:t,rowActions:r}),s.message.success(`Actions saved for ${e?.roleName??`role`}`),await w()}catch(e){s.message.error(e.message),String(e.message??``).toLowerCase().includes(`already exists`)&&w()}finally{g(!1)}}async function j(){if(D){g(!0);try{await n.sr(D.id??D._id),s.message.success(`Role override removed — this role now inherits the default actions`),await w()}catch(e){s.message.error(e.message)}finally{g(!1)}}}let M=[{title:`Action`,key:`identity`,render:(e,t)=>(0,l.jsxs)(s.Space,{direction:`vertical`,size:0,children:[(0,l.jsx)(lx,{strong:!0,children:t.label||t.key}),(0,l.jsx)(lx,{type:`secondary`,code:!0,children:t.key})]})},{title:`Behaviour`,key:`behaviour`,width:220,render:(e,t)=>(0,l.jsxs)(s.Space,{direction:`vertical`,size:0,children:[(0,l.jsx)(s.Tag,{color:`blue`,style:{width:`fit-content`},children:t.actionType}),(0,l.jsx)(lx,{type:`secondary`,ellipsis:{tooltip:!0},style:{maxWidth:190},children:t.actionType===`group`?`${(t.children??[]).length} child action(s)`:t.popupKey||t.routeTemplate||t.apiPath||t.copyField||t.documentField||`—`})]})},{title:`Enabled for this role`,key:`enabled`,width:160,render:(e,t)=>(0,l.jsx)(s.Switch,{checked:_.has(t.key),onChange:e=>k(t.key,e,(t.children??[]).map(e=>dx(t.key,e.key)))})}],N=e=>[{title:`Child Action`,key:`identity`,render:(e,t)=>(0,l.jsxs)(s.Space,{direction:`vertical`,size:0,children:[(0,l.jsx)(lx,{strong:!0,children:t.label||t.key}),(0,l.jsx)(lx,{type:`secondary`,code:!0,children:t.key})]})},{title:`Behaviour`,key:`behaviour`,width:220,render:(e,t)=>(0,l.jsx)(lx,{type:`secondary`,children:t.popupKey||t.routeTemplate||t.apiPath||t.actionType})},{title:`Enabled`,key:`enabled`,width:160,render:(t,n)=>(0,l.jsx)(s.Switch,{disabled:!_.has(e.key),checked:_.has(dx(e.key,n.key)),onChange:t=>k(dx(e.key,n.key),t)})}];return(0,l.jsxs)(`section`,{className:`admin-editor`,children:[(0,l.jsxs)(`div`,{className:`admin-section-head`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(ux,{level:4,children:`Role Actions`}),(0,l.jsxs)(lx,{type:`secondary`,children:[`Enable or disable row actions for `,e?.roleName??`this role`,`. The action library itself is managed in Configurations → Actions.`]})]}),(0,l.jsxs)(s.Space,{children:[D&&(0,l.jsx)(s.Popconfirm,{title:`Remove this role's override and inherit the default actions?`,okText:`Reset`,okType:`danger`,onConfirm:j,children:(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.UndoOutlined,{}),loading:h,children:`Reset to Default`})}),(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.ReloadOutlined,{}),onClick:w,loading:p,children:`Reload`}),(0,l.jsx)(s.Button,{type:`primary`,icon:(0,l.jsx)(c.SaveOutlined,{}),loading:h,disabled:!y||!a,onClick:A,children:`Save`})]})]}),(0,l.jsxs)(s.Space,{style:{marginBottom:12},wrap:!0,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(lx,{type:`secondary`,style:{display:`block`,marginBottom:4,fontSize:12},children:`Module`}),(0,l.jsx)(s.Select,{showSearch:!0,optionFilterProp:`label`,style:{width:220},mode:`tags`,maxCount:1,value:a?[a]:[],placeholder:`Pick or type a module key`,onChange:e=>u(String(e[e.length-1]??``).trim()),options:r.map(e=>({value:e,label:e}))})]}),(0,l.jsxs)(`div`,{style:{paddingTop:20},children:[D?(0,l.jsx)(s.Tag,{color:`green`,children:`Role override active`}):(0,l.jsx)(s.Tag,{color:`orange`,children:`Inheriting default (All Roles) — Save creates an override`}),y&&(0,l.jsx)(lx,{type:`warning`,style:{marginLeft:8},children:`Unsaved changes`})]})]}),C.length>0&&(0,l.jsx)(s.Alert,{type:`info`,showIcon:!0,style:{marginBottom:12},message:`This override also applies to: ${C.join(`, `)}`,description:`Those surfaces (e.g. the detail view) keep their own extra actions — only the ones you turn off here are hidden from them.`}),!p&&!O.length&&(0,l.jsx)(s.Alert,{type:`info`,showIcon:!0,style:{marginBottom:12},message:`No actions configured for this module yet.`,description:`Define the actions first in Configurations → Actions (Action library), then enable them per role here.`}),(0,l.jsx)(s.Spin,{spinning:p,children:(0,l.jsx)(s.Table,{dataSource:O.map((e,t)=>({...e,_rowKey:e.key||t})),rowKey:`_rowKey`,columns:M,pagination:!1,size:`small`,expandable:{rowExpandable:e=>e.actionType===`group`&&(e.children??[]).length>0,expandedRowRender:e=>(0,l.jsx)(s.Table,{dataSource:(e.children??[]).map((e,t)=>({...e,_rowKey:e.key||t})),rowKey:`_rowKey`,columns:N(e),pagination:!1,size:`small`})}})})]})}var _x=[{label:`Equals (=)`,value:`eq`},{label:`Not equals (≠)`,value:`neq`},{label:`Has any value`,value:`truthy`},{label:`Is empty`,value:`falsy`},{label:`Is one of (comma-separated)`,value:`in`},{label:`Is not one of (comma-separated)`,value:`notIn`},{label:`Has at least one row (addRow group)`,value:`notEmpty`}],vx=[`eq`,`neq`,`in`,`notIn`],yx=e=>vx.includes(e??`eq`),bx=`unique`,xx=[{label:`Exact (compare as stored)`,value:`exact`},{label:`Trim whitespace`,value:`trim`},{label:`Trim + lowercase`,value:`trimLower`},{label:`Email (trim + lowercase)`,value:`email`},{label:`Digits only (phone/ID)`,value:`digitsOnly`}],Sx=[{label:`On blur (recommended)`,value:`blur`},{label:`On submit only`,value:`submit`}],Cx=`trim`,wx=`blur`,Tx=[{label:`Look at the field (recommended)`,value:`field`},{label:`Also keep a hidden copy`,value:`index`}],Ex=`field`,Dx=new Set(Tx.map(e=>e.value)),Ox=new Set([`blur`,`submit`,`change`]),kx=new Set([`file`,`text-editor`,`checkbox`]),Ax=`Uniqueness currently supports scalar values only — a single value compared against a single stored value.`;function jx(e={}){let t=String(e.type??`text`),n=e=>({supported:!1,reason:`${e} ${Ax}`});return kx.has(t)?n(`${t===`text-editor`?`Rich text`:t===`file`?`File`:`Checkbox`} fields cannot be checked for uniqueness.`):t===`tagify`?n(`Tag fields store a list of values.`):e.multiSelect?n(`Multi-select fields store a list of values.`):e.multiple?n(`Multi-value fields store a list of values.`):e.addRow?n(`Repeatable fields store one value per row.`):Array.isArray(e.subFields)&&e.subFields.length?n(`Fields with sub-fields store one object per row.`):e.dataType===`array`?n(`Fields sent as an array store a list of values.`):{supported:!0,reason:``}}var Mx=/^[A-Za-z_][A-Za-z0-9_-]*$/;function Nx(e){let t=String(e??``);if(!t.trim())return`Collection field is required`;if(t!==t.trim())return`Remove the surrounding spaces`;if(t.includes(`\0`))return`Path contains a null byte`;if(t.includes(`$`))return`Path may not contain "$"`;let n=t.split(`.`);for(let e of n){if(!e)return`Path has an empty segment — use a.b, not a..b`;if(!Mx.test(e))return`Invalid path segment "${e}" — letters, digits, _ and - only`}return``}function Px(e={}){return String(e.payloadKey??``).trim()||String(e.field??``).trim()}function Fx(e={}){return{collectionField:Px(e),normalizer:Cx,skipBlank:!0,validateOn:wx,enforcement:Ex}}var Ix=new Set(xx.map(e=>e.value));function Lx(e,t={}){let n=e&&typeof e==`object`&&!Array.isArray(e)?e:{},r=Fx(t),i=String(n.collectionField??``).trim()||r.collectionField,a=Ix.has(n.normalizer)?n.normalizer:r.normalizer,o=Ox.has(n.validateOn)?n.validateOn:r.validateOn,s=n.skipBlank===void 0||n.skipBlank===null?r.skipBlank:!!n.skipBlank,c=Dx.has(n.enforcement)?n.enforcement:r.enforcement,l={...n,collectionField:i,normalizer:a,skipBlank:s,validateOn:o,enforcement:c},u=Bx(n.alsoCheck);return u.length?l.alsoCheck=u:delete l.alsoCheck,l}function Rx(){return{module:``,collection:``,collectionField:``,normalizer:``,message:``,excludeFrom:{path:``,matchField:``}}}function zx(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{},n=t.excludeFrom&&typeof t.excludeFrom==`object`?t.excludeFrom:{},r={...t,module:String(t.module??``).trim(),collection:String(t.collection??``).trim(),collectionField:String(t.collectionField??``).trim(),normalizer:String(t.normalizer??``).trim(),message:String(t.message??``).trim()},i=String(n.path??``).trim(),a=String(n.matchField??``).trim();return i?r.excludeFrom={...n,path:i,matchField:a}:delete r.excludeFrom,r}function Bx(e){return Array.isArray(e)?e.map(zx).filter(e=>e.module||e.collection):[]}function Vx(e={}){let t=[],n=String(e.module??``).trim(),r=String(e.collection??``).trim();!n&&!r&&t.push(`Name a module (preferred) or a collection to also check.`),r&&!n&&(r.includes(`.`)?t.push(`Collection must be a single name, not a path.`):Nx(r)&&t.push(`Collection: ${Nx(r)}`));let i=String(e.collectionField??``).trim();i&&Nx(i)&&t.push(`Field in that collection: ${Nx(i)}`);let a=String(e.excludeFrom?.path??``).trim();a&&Nx(a)&&t.push(`Exclusion path: ${Nx(a)}`);let o=String(e.excludeFrom?.matchField??``).trim();return o&&Nx(o)&&t.push(`Exclusion match field: ${Nx(o)}`),t}function Hx(e,t={}){if(!e||e.type!==`unique`)return[];let n=[],r=jx(t);r.supported||n.push(r.reason),String(e.message??``).trim()||n.push(`An error message is required — it is what the user sees.`);let i=e.value&&typeof e.value==`object`?e.value:{},a=Nx(i.collectionField);return a&&n.push(a),(Array.isArray(i.alsoCheck)?i.alsoCheck:[]).forEach((e,t)=>{Object.entries(e??{}).some(([e,t])=>e===`excludeFrom`?!!(String(t?.path??``).trim()||String(t?.matchField??``).trim()):!!String(t??``).trim())&&Vx(e).forEach(e=>n.push(`Also check #${t+1}: ${e}`))}),n}function Ux(e){return!!e&&e.type===`unique`}function Wx(e){return(e?.validations??[]).some(Ux)}function Gx(e){return(e?.validations??[]).find(Ux)??null}function Kx({primaryModule:e=``,groupTargetModule:t=``,field:n={},config:r={},collectionForModule:i}={}){let a=String(t??``).trim()||String(e??``).trim();return{module:a,collection:typeof i==`function`?String(i(a)??``).trim():``,formField:String(n.field??``).trim(),storedField:String(r.collectionField??``).trim()||Px(n),isCrossModule:!!String(t??``).trim()&&String(t).trim()!==String(e??``).trim()}}var{Paragraph:qx,Text:Jx}=s.Typography;function Yx({open:e,scope:t,action:r,title:i,description:a,confirmLabel:u=`Confirm`,danger:d=!1,onCancel:f,onVerified:p,onConfirm:m}){let[h,g]=(0,o.useState)(``),[_,v]=(0,o.useState)(``),[y,b]=(0,o.useState)(!1),[x,S]=(0,o.useState)(!1),[C,w]=(0,o.useState)(``),T=(0,o.useRef)(!1);async function E(){if(!(!t||!r)){b(!0),w(``);try{let e=await n.qr(t,r);v(e?.data?.email||e?.email||`the registered approver`),s.message.success(`OTP sent`)}catch(e){w(e?.message||`Could not send the OTP`)}finally{b(!1)}}}(0,o.useEffect)(()=>{e&&!T.current&&(T.current=!0,g(``),w(``),v(``),E()),e||(T.current=!1)},[e]);async function D(){if(!h.trim()){w(`Enter the OTP sent to your email`);return}S(!0),w(``);try{let e=m?await m(h.trim()):await n.Un(t,r,h.trim());s.message.success(e?.data?.message||e?.message||`Done`),p?.(e)}catch(e){w(e?.message||`Verification failed — check the code and try again`)}finally{S(!1)}}return(0,l.jsxs)(s.Modal,{open:e,onCancel:f,title:(0,l.jsxs)(`span`,{children:[(0,l.jsx)(c.SafetyCertificateOutlined,{}),` `,i]}),destroyOnClose:!0,maskClosable:!x,footer:[(0,l.jsx)(s.Button,{onClick:f,disabled:x,children:`Cancel`},`cancel`),(0,l.jsx)(s.Button,{type:`primary`,danger:d,loading:x,onClick:D,children:u},`ok`)],children:[a&&(0,l.jsx)(qx,{type:`secondary`,style:{fontSize:13,marginBottom:8},children:a}),(0,l.jsxs)(qx,{type:`secondary`,style:{fontSize:13},children:[`This is a protected action. A one-time code has been emailed to`,` `,(0,l.jsx)(Jx,{strong:!0,children:_||`…`}),`. Enter it below to continue.`]}),(0,l.jsx)(s.Input,{size:`large`,inputMode:`numeric`,placeholder:`Enter OTP`,value:h,maxLength:6,onChange:e=>g(e.target.value.replace(/\D/g,``)),onPressEnter:D,autoFocus:!0}),C&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:C,style:{marginTop:12}}),(0,l.jsx)(`div`,{style:{marginTop:12},children:(0,l.jsx)(s.Button,{type:`link`,size:`small`,loading:y,onClick:E,style:{padding:0},children:`Resend code`})})]})}var{Text:Xx}=s.Typography;function Zx({moduleOptions:e=[]}){let[t,r]=(0,o.useState)(``),[i,a]=(0,o.useState)([]),[u,d]=(0,o.useState)([]),[f,p]=(0,o.useState)([]),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(!1);(0,o.useEffect)(()=>{!t&&e.length&&r(e[0].value)},[e,t]);let v=(0,o.useCallback)(async e=>{if(e){h(!0);try{let[t,r]=await Promise.all([n.ur(e).catch(()=>[]),n.Fr(e).catch(()=>[])]),i=new Set,o=[];(Array.isArray(t)?t:[]).forEach(e=>{(e.fields??[]).forEach(t=>{let n=String(t.field??``).trim();!n||i.has(n)||(i.add(n),o.push({value:n,label:`${t.label??n} · ${n}`,group:e.label??e.name}))})}),a(o),p(r),d(r)}catch(e){s.message.error(e?.message||`Could not load default fields`)}finally{h(!1)}}},[]);(0,o.useEffect)(()=>{queueMicrotask(()=>{v(t)})},[t,v]);let y=(0,o.useMemo)(()=>{if(u.length!==f.length)return!0;let e=[...u].sort(),t=[...f].sort();return e.some((e,n)=>e!==t[n])},[u,f]);async function b(e){let r=await n.ei(t,u,e);return p(u),r}return(0,l.jsxs)(Z,{icon:(0,l.jsx)(c.SafetyCertificateOutlined,{}),title:`Default Fields`,extra:(0,l.jsxs)(s.Space,{children:[(0,l.jsx)(s.Select,{size:`small`,showSearch:!0,optionFilterProp:`label`,style:{width:220},placeholder:`Module`,value:t||void 0,options:e,onChange:r}),(0,l.jsx)(s.Button,{type:`primary`,size:`small`,icon:(0,l.jsx)(c.SaveOutlined,{}),disabled:!t||!y,onClick:()=>_(!0),children:`Save (OTP)`})]}),children:[(0,l.jsx)(`div`,{className:`admin-accent-bar`}),(0,l.jsxs)(Xx,{type:`secondary`,style:{fontSize:13,display:`block`,marginBottom:12},children:[`Fields chosen here are `,(0,l.jsx)(`b`,{children:`always shown and always required`}),` on this module's add & edit form. Their Show / Required switches are locked in Form Groups so no one can turn them off. Changing this list requires an OTP emailed to the approver.`]}),(0,l.jsxs)(s.Spin,{spinning:m,children:[(0,l.jsx)(s.Select,{mode:`multiple`,allowClear:!0,showSearch:!0,optionFilterProp:`label`,style:{width:`100%`},placeholder:`Select the fields that must always show + be required`,value:u,options:i,onChange:d,maxTagCount:`responsive`}),(0,l.jsxs)(`div`,{style:{marginTop:12},children:[(0,l.jsxs)(Xx,{type:`secondary`,style:{fontSize:12},children:[`Currently enforced (`,f.length,`): `]}),f.length?f.map(e=>(0,l.jsx)(s.Tag,{color:`blue`,style:{marginTop:4},children:e},e)):(0,l.jsx)(Xx,{type:`secondary`,style:{fontSize:12},children:`none`})]}),!m&&i.length===0&&(0,l.jsx)(s.Alert,{style:{marginTop:12},type:`info`,showIcon:!0,message:`This module has no form-group fields yet — configure its Form Groups first.`})]}),(0,l.jsx)(Yx,{open:g,scope:`defaultFields`,action:`save`,title:`Confirm Default Fields change`,description:`Adding or updating a module's default (always-shown + required) fields is a protected action.`,confirmLabel:`Verify & Save`,onCancel:()=>_(!1),onConfirm:b,onVerified:()=>{_(!1),v(t)}})]})}function Qx(e){return(e??[]).filter(e=>e?.label||e?.value).map(e=>{let t={...e},n=String(t.module??``).trim();return n?t.module=n:delete t.module,t})}var{Text:$x}=s.Typography,eS={reset:{action:`reset`,title:`Reset all form groups`,confirmLabel:`Reset All`,danger:!0,description:`This reseeds every module in this workspace back to the built-in default groups, discarding current customizations.`},save:{action:`save`,title:`Save current as default`,confirmLabel:`Save Default`,danger:!1,description:`Snapshots the current form groups for all modules as the saved default you can restore to later.`},restore:{action:`restore`,title:`Restore saved default`,confirmLabel:`Restore Default`,danger:!0,description:`Replaces the current form groups for all modules with the last saved default.`}},tS=xm.filter(({key:e})=>e!==`custom`).map(({key:e,label:t})=>({value:e,label:t})),nS=[{label:`Full span`,value:`full`},{label:`None (start empty)`,value:`none`}],rS=[`#0053a5`,`#52c41a`,`#722ed1`,`#fa8c16`,`#eb2f96`,`#13c2c2`],iS=[{label:`Text`,value:`text`},{label:`Number`,value:`number`},{label:`Email`,value:`email`},{label:`Date`,value:`date`},{label:`Time Picker`,value:`time`},{label:`Location`,value:`location`},{label:`Select`,value:`select`},{label:`Radio`,value:`radio`},{label:`Checkbox`,value:`checkbox`},{label:`Tagify`,value:`tagify`},{label:`Textarea`,value:`textarea`},{label:`Text Editor`,value:`text-editor`},{label:`File`,value:`file`}],aS=[{label:`Keywords (chips + mandatory star)`,value:`keywords`},{label:`Multi Select`,value:`multiselect`},{label:`Date Range`,value:`daterange`},{label:`Range Slider`,value:`range`},{label:`Date Range (with presets)`,value:`daterangePreset`}],oS=[{label:`query (all search fields)`,value:`query`},{label:`excludeKeywords`,value:`excludeKeywords`},{label:`skills`,value:`skills`},{label:`jobTitle`,value:`jobTitle`},{label:`designation`,value:`designation`},{label:`currentLocation`,value:`currentLocation`},{label:`experience.from`,value:`experience.from`},{label:`experience.to`,value:`experience.to`},{label:`experience.from + to (range)`,value:`experience.from,experience.to`},{label:`workExperienceYears`,value:`workExperienceYears`},{label:`sourceType`,value:`sourceType`},{label:`createdFrom + createdTo (date range)`,value:`createdFrom,createdTo`}],sS=[`keywords`],cS=[{label:`Full row`,value:24},{label:`Half row`,value:12},{label:`One third`,value:8},{label:`One quarter`,value:6}],lS=[{label:`Include (match these)`,value:`include`},{label:`Exclude (must not match)`,value:`exclude`}],uS=[{label:`Slider + From/To`,value:`both`},{label:`Slider only`,value:`slider`},{label:`From / To only`,value:`inputs`}],dS=[{label:`Static (define options here)`,value:`static`},{label:`Masters collection`,value:`master`},{label:`Module data (distinct)`,value:`module`},{label:`Collection lookup (FK)`,value:`lookup`},{label:`Group value`,value:`group`},{label:`Location Master (Country/State/City)`,value:`locationMaster`}],fS=[{label:`Country`,value:`country`},{label:`State (needs a Country field)`,value:`state`},{label:`City (needs a Country + State field)`,value:`city`}],pS=[{label:`Required`,value:`required`,hasValue:!1},{label:`Min length/value`,value:`min`,hasValue:!0,valueType:`number`,placeholder:`e.g. 2`},{label:`Max length/value`,value:`max`,hasValue:!0,valueType:`number`,placeholder:`e.g. 100`},{label:`Pattern (regex)`,value:`pattern`,hasValue:!0,valueType:`text`,placeholder:`^[A-Za-z]+$`},{label:`Email (reject numeric-only address)`,value:`email`,hasValue:!1},{label:`Phone format`,value:`phone`,hasValue:!1},{label:`On or after another date field`,value:`dateAfterField`,hasValue:!0,valueType:`text`,placeholder:`startDate`,dateOnly:!0,messageOptional:!0},{label:`On or before another date field`,value:`dateBeforeField`,hasValue:!0,valueType:`text`,placeholder:`endDate`,dateOnly:!0,messageOptional:!0},{label:`Before another time field`,value:`timeBeforeField`,hasValue:!0,valueType:`text`,placeholder:`endTime`,messageOptional:!0},{label:`After another time field`,value:`timeAfterField`,hasValue:!0,valueType:`text`,placeholder:`startTime`,messageOptional:!0},{label:`File types allowed`,value:`fileType`,hasValue:!0,valueType:`text`,placeholder:`pdf,doc,jpg`,messageOptional:!0},{label:`Max file size (MB)`,value:`fileSize`,hasValue:!0,valueType:`number`,placeholder:`e.g. 5`,messageOptional:!0},{label:`Max files count`,value:`maxFiles`,hasValue:!0,valueType:`number`,placeholder:`e.g. 3`,messageOptional:!0},{label:`Greater than or equal to field`,value:`greaterThanField`,hasValue:!0,valueType:`text`,placeholder:`experienceRequiredFrom`},{label:`Greater than field (strict)`,value:`strictGreaterThanField`,hasValue:!0,valueType:`text`,placeholder:`numberOfPosition`},{label:`Less than field (strict)`,value:`strictLessThanField`,hasValue:!0,valueType:`text`,placeholder:`experienceRequiredTo`},{label:`Less than or equal to field`,value:`lessThanOrEqualField`,hasValue:!0,valueType:`text`,placeholder:`experienceRequiredTo`},{label:`Max field with fallback`,value:`maxFieldWithFallback`,hasValue:!0,valueType:`text`,placeholder:`group.preferredToField,group.fallbackFromField`},{label:`Disable previous dates`,value:`noPastDate`,hasValue:!1,messageOptional:!0,dateOnly:!0},{label:`Disable future dates`,value:`noFutureDate`,hasValue:!1,messageOptional:!0,dateOnly:!0},{label:`Min age (years)`,value:`minAge`,hasValue:!0,valueType:`number`,placeholder:`e.g. 18`,messageOptional:!0,dateOnly:!0},{label:`Max from another field`,value:`maxFromField`,hasValue:!1,needsField:!0,messageOptional:!0},{label:`Unique value / Already present check`,value:bx,hasValue:!0,valueType:`object`}],mS=_x,hS=vx,gS=[{label:`Auto (infer from field)`,value:`auto`},{label:`String`,value:`string`},{label:`Number`,value:`number`},{label:`Boolean`,value:`boolean`},{label:`Array`,value:`array`},{label:`Object`,value:`object`},{label:`Date (ISO)`,value:`date`}],_S=[{label:`(none)`,value:``},{label:`String`,value:`string`},{label:`Number`,value:`number`},{label:`Boolean`,value:`boolean`}],vS=[{label:`Auto (value as-is)`,value:`auto`},{label:`Value only — { key: id }`,value:`value`},{label:`Label only — { key: "India" }`,value:`label`},{label:`Full object — { id, name }`,value:`object`},{label:`Custom template`,value:`custom`},{label:`Skip (never send)`,value:`skip`}],yS={required:`red`,min:`orange`,max:`gold`,pattern:`purple`,email:`blue`,phone:`cyan`,dateAfterField:`volcano`,dateBeforeField:`orange`,fileType:`cyan`,fileSize:`blue`,maxFiles:`geekblue`,greaterThanField:`lime`,strictGreaterThanField:`green`,strictLessThanField:`cyan`,lessThanOrEqualField:`blue`,maxFieldWithFallback:`purple`,maxFromField:`volcano`,noPastDate:`geekblue`,noFutureDate:`magenta`,minAge:`green`,unique:`magenta`};function bS(e){return pS.find(t=>t.value===e)??{hasValue:!1}}function xS(e){return[{key:`all`,label:`All`,color:`#8c8c8c`},...e.map((e,t)=>({key:e.key,label:e.label,color:rS[t%rS.length]}))]}function SS(e){return Object.fromEntries(e.map(({key:e})=>[e,{groups:[],loading:!1,loaded:!1,error:``}]))}function CS(e){if(e==null)return;if(typeof e==`object`)return e;let t=String(e).trim();if(t)try{let e=JSON.parse(t);return e&&typeof e==`object`?e:void 0}catch{return}}function wS(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return``}}function TS(e,t){t.payloadKey&&(e.payloadKey=t.payloadKey),t.prefillFrom&&(e.prefillFrom=t.prefillFrom),t.prefillAsHint&&(e.prefillAsHint=!0,String(t.prefillHintLabel??``).trim()&&(e.prefillHintLabel=String(t.prefillHintLabel).trim())),t.prefillFromModule&&(e.prefillFromModule=t.prefillFromModule);let n=(Array.isArray(t.prefillWhen)?t.prefillWhen:[]).filter(e=>e&&e.field&&e.value!==void 0&&e.value!==``&&(e.clearValue?!0:e.setValue!==void 0&&e.setValue!==``)).map(e=>e.clearValue?{field:e.field,value:e.value,clearValue:!0}:e);n.length&&(e.prefillWhen=n,t.prefillWhenReset===!1&&(e.prefillWhenReset=!1),t.prefillWhenExclusive===!0&&(e.prefillWhenExclusive=!0)),t.dataType&&t.dataType!==`auto`&&(e.dataType=t.dataType),t.elementType&&(e.elementType=t.elementType),t.payloadMode&&t.payloadMode!==`auto`&&(e.payloadMode=t.payloadMode),t.valueKey&&(e.valueKey=t.valueKey),t.displayKey&&(e.displayKey=t.displayKey),t.defaultValue!==void 0&&t.defaultValue!==``&&(e.defaultValue=t.defaultValue),t.richValue&&(e.richValue=!0),t.omitEmpty&&(e.omitEmpty=!0);let r=CS(t.payloadTemplate);r&&(e.payloadTemplate=r);let i=CS(t.transformRule);return i&&(e.transformRule=i),e}var ES=[{label:`equals`,value:`eq`},{label:`not equals`,value:`ne`},{label:`in`,value:`in`},{label:`not in`,value:`nin`},{label:`is not empty`,value:`notEmpty`},{label:`is empty`,value:`empty`}],DS=[`currentUserId`,`currentRoleId`,`currentUserName`,`currentUserEmail`,`currentReportingId`,`tenantId`,`businessId`,`businessUnitId`];function OS(e){return Array.isArray(e)?e.filter(e=>e&&e.field).map(e=>{let t=e.valuesFrom??null,n=t&&t.match?Object.keys(t.match)[0]??``:``,r=n?t.match[n]:void 0,i=r&&typeof r==`object`&&typeof r.$valueFrom==`string`,a=i?``:(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return e;let t=Object.keys(e);return t.length===1&&(t[0]===`$in`||t[0]===`$eq`)?e[t[0]]:e})(r);return{field:e.field??``,op:e.op??`eq`,valueSource:t?`collection`:e.valueFrom?`identity`:`literal`,value:Array.isArray(e.value)?e.value.join(`, `):e.value??``,valueFrom:e.valueFrom??``,srcCollection:t?.collection??``,srcValueField:t?.valueField??``,srcMatchField:n,srcMatchValue:Array.isArray(a)?a.join(`, `):a??``,srcMatchValueFrom:i?r.$valueFrom:``,srcRecursive:t?.recursive??!1,srcRecursiveField:t?.recursiveField??``}}):[]}function kS(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=String(n?.field??``).trim();if(!e)continue;let r=String(n?.op??`eq`).trim()||`eq`,i={field:e,op:r};if(r===`notEmpty`||r===`empty`){t.push(i);continue}let a=n.valueSource??(n.srcCollection?`collection`:n.valueFrom?`identity`:`literal`);if(a===`collection`){let e=String(n.srcCollection??``).trim();if(!e)continue;let t={collection:e,valueField:String(n.srcValueField??``).trim()||`_id`},r=String(n.srcMatchField??``).trim();if(r){let e=String(n.srcMatchValueFrom??``).trim(),i=String(n.srcMatchValue??``).trim();e?t.match={[r]:{$valueFrom:e}}:i&&(t.match={[r]:i.includes(`,`)?i.split(`,`).map(e=>e.trim()).filter(Boolean):i})}if(n.srcRecursive){t.recursive=!0;let e=String(n.srcRecursiveField??``).trim()||r;e&&(t.recursiveField=e)}i.valuesFrom=t}else if(a===`identity`){let e=String(n.valueFrom??``).trim();if(!e)continue;i.valueFrom=e}else{let e=n.value;if(e==null||String(e).trim()===``)continue;let t=String(e).trim();i.value=t.includes(`,`)?t.split(`,`).map(e=>e.trim()).filter(Boolean):t}t.push(i)}return t}function AS(e=[]){let t=[];for(let n of e??[]){let e=n?.label||n?.field||`field`;for(let r of n?.validations??[])for(let i of Hx(r,n))t.push(`${e}: ${i}`)}return t}function jS(e){let t={};return[`title`,`body`,`ok`,`cancel`].forEach(n=>{let r=String(e?.[n]??``).trim();r&&(t[n]=r)}),Object.keys(t).length?t:null}var MS=Object.freeze({mode:`newestFirst`,startField:`startDate`,endField:`endDate`}),NS=Object.freeze({field:`startDate`,tieBreak:`endDate`,direction:`desc`,inProgressField:`currentStudyingHere`,inProgressFirst:!0,confirmMove:!0}),PS=Object.freeze({levelField:`qualification`,requireBelow:!0,message:`You have entered only a higher qualification — {missing} is also required.`});function FS(e=[]){return e.filter(e=>String(e?.field??``).trim()!==``).map((e,t)=>{let n=(e.validations??[]).filter(e=>e?.type).map(t=>{let n=bS(t.type),r={type:t.type,message:t.message??``};if(n.hasValue&&t.value!==``&&t.value!==void 0&&t.value!==null?r.value=n.valueType===`object`?t.type===`unique`?Lx(t.value,e):t.value:n.valueType===`number`?Number(t.value):t.value:n.valueType===`object`&&t.type===`unique`&&(r.value=Fx(e)),n.needsField){let e=String(t.field??``).trim();e&&(r.field=e)}if(t.type===`dateAfterField`||t.type===`dateBeforeField`){t.strict&&(r.strict=!0);let e=Number(t.minGap?.value);Number.isFinite(e)&&e>0&&(r.minGap={value:e,unit:t.minGap?.unit||`month`});let n=String(t.minGapFrom??``).trim();n&&(r.minGapFrom=n)}return r}),r={label:e.label,field:e.field,type:e.type??`text`,show:+!!e.show,req:+!!e.req,edit:+!!e.edit,order:t,formatter:e.formatter??``,validations:n};if(e.col!==void 0&&e.col!==null&&e.col!==``&&Number(e.col)>0&&(r.col=Number(e.col)),e.showOnAdd===!1&&(r.showOnAdd=!1),e.addRow){r.addRow=!0,e.minRows!==void 0&&e.minRows!==``&&Number(e.minRows)>0&&(r.minRows=Number(e.minRows)),e.maxRows!==void 0&&e.maxRows!==``&&Number(e.maxRows)>0&&(r.maxRows=Number(e.maxRows)),e.initialRows!==void 0&&e.initialRows!==``&&(r.initialRows=Number(e.initialRows)),e.addLabel&&(r.addLabel=e.addLabel);let t=(e.subFields??[]).filter(e=>e&&e.field);t.length&&(r.subFields=t.map(e=>{let t={field:String(e.field).trim(),label:e.label??e.field,type:e.type??`text`,show:1,edit:1,req:+!!e.req};if(e.col!==void 0&&e.col!==``&&Number(e.col)>0&&(t.col=Number(e.col)),e.payloadKey&&(t.payloadKey=String(e.payloadKey).trim()),[`select`,`radio`,`checkbox`].includes(t.type)){let n=e.dataSource??`static`;t.dataSource=n,t.type===`select`&&(t.multiSelect=e.multiSelect??!1),n===`master`&&(t.masterName=e.masterName??``),n===`group`&&(t.groupName=e.groupName??``),n===`static`&&(t.options=Qx(e.options)),n===`lookup`&&(t.lookupCollection=e.lookupCollection??``,t.displayField=e.displayField??``,e.displayField2&&(t.displayField2=e.displayField2),t.valueField=e.valueField??`_id`,e.lookupFilterField&&e.lookupFilterValueFrom&&(t.lookupFilterField=e.lookupFilterField,t.lookupFilterValueFrom=e.lookupFilterValueFrom))}return t}))}if(e.placeholder&&(r.placeholder=e.placeholder),e.hidePlaceholder&&(r.hidePlaceholder=!0),e.combineKey&&(r.combineKey=e.combineKey),e.combineLabel&&(r.combineLabel=e.combineLabel),e.combineRole&&(r.combineRole=e.combineRole),e.combineToggleLabel&&(r.combineToggleLabel=e.combineToggleLabel),e.combineToggleTarget&&(r.combineToggleTarget=e.combineToggleTarget),e.combineWidth!==void 0&&e.combineWidth!==``&&Number(e.combineWidth)>0&&(r.combineWidth=Number(e.combineWidth)),e.combineWrap&&(r.combineWrap=!0),e.combineSpan!==void 0&&e.combineSpan!==``&&[12,24].includes(Number(e.combineSpan))&&(r.combineSpan=Number(e.combineSpan)),e.defaultOnEdit&&(r.defaultOnEdit=!0),e.noPrefill&&(r.noPrefill=!0),e.emptyValues!==void 0&&e.emptyValues!==``&&(r.emptyValues=String(e.emptyValues).split(`,`).map(e=>e.trim()).filter(e=>e!==``)),e.valuePaths!==void 0&&e.valuePaths!==``&&(r.valuePaths=String(e.valuePaths).split(`,`).map(e=>e.trim()).filter(e=>e!==``)),e.clientScope&&(r.clientScope=!0,e.clientGateMessage&&(r.clientGateMessage=e.clientGateMessage),e.clientGateResetOnChange&&(r.clientGateResetOnChange=!0)),e.visiblePermission&&(r.visiblePermission=String(e.visiblePermission).trim()),e.editablePermission&&(r.editablePermission=String(e.editablePermission).trim()),e.infoEnabled&&e.infoText&&(r.infoEnabled=!0,r.infoText=e.infoText),e.tooltip&&(r.tooltip=String(e.tooltip)),e.booleanApiKey){let t=String(e.booleanApiKey).split(`,`).map(e=>e.trim()).filter(Boolean);t.length&&(r.booleanApiKey=t.length>1?t:t[0])}if(e.booleanCapable&&Fm(r.booleanApiKey)&&(r.booleanCapable=!0),r.booleanCapable&&e.booleanPlaceholder&&(r.booleanPlaceholder=String(e.booleanPlaceholder).trim()),e.type===`keywords`){e.isPrimaryKeyword&&(r.isPrimaryKeyword=!0),e.showMandatoryOption&&(r.showMandatoryOption=!0),String(e.keywordRole??``).trim().toLowerCase()===`exclude`&&(r.keywordRole=`exclude`);let t=String(e.keywordGroup??``).trim();t&&t!==e.field&&(r.keywordGroup=t);let n=String(e.keywordFields??``).split(`,`).map(e=>e.trim()).filter(Boolean);n.length&&(r.keywordFields=n),e.maxKeywords!==void 0&&e.maxKeywords!==``&&Number(e.maxKeywords)>0&&(r.maxKeywords=Number(e.maxKeywords))}if(e.hideInBooleanMode&&(r.hideInBooleanMode=!0),e.type===`range`&&String(e.defaultRange??``).trim()===`full`&&(r.defaultRange=`full`),e.type===`daterangePreset`&&String(e.defaultPreset??``).trim()&&(r.defaultPreset=String(e.defaultPreset).trim()),(e.type===`number`||e.type===`range`)&&(e.min!==void 0&&e.min!==``&&(r.min=Number(e.min)),e.max!==void 0&&e.max!==``&&(r.max=Number(e.max))),e.type===`range`){e.display&&e.display!==`both`&&(r.display=e.display);let t=String(e.minLabel??``).trim(),n=String(e.maxLabel??``).trim(),i=String(e.unit??``).trim();t&&(r.minLabel=t),n&&(r.maxLabel=n),i&&(r.unit=i);let a=String(e.rangeKeys??``).split(`,`).map(e=>e.trim()).filter(Boolean);a.length===2&&(r.rangeKeys=a)}e.type===`daterangePreset`&&e.filterField&&(r.filterField=String(e.filterField).trim()),e.type===`checkbox`&&e.hideSelectAll&&(r.hideSelectAll=!0),TS(r,e),e.type===`file`&&(r.multiple=e.multiple??!1,r.maxCount=r.multiple?Number(e.maxCount??5):1,e.fileKey&&(r.fileKey=e.fileKey),e.fileNameKey&&(r.fileNameKey=e.fileNameKey),e.fileUrlKey&&(r.fileUrlKey=e.fileUrlKey),e.accept&&e.accept!==`any`&&(r.accept=e.accept));let i=(Array.isArray(e.showIf?.conditions)?e.showIf.conditions:[]).filter(e=>e?.field&&String(e.field).trim()).map(e=>{let t={field:String(e.field).trim(),operator:e.operator??`eq`};return hS.includes(t.operator)&&e.value!=null&&e.value!==``&&(t.value=e.value),t});if((e.showIf?.field||i.length)&&(r.showIf={},e.showIf?.field&&(r.showIf.field=e.showIf.field,r.showIf.operator=e.showIf.operator??`eq`,hS.includes(r.showIf.operator)&&e.showIf.value!=null&&e.showIf.value!==``&&(r.showIf.value=e.showIf.value)),i.length&&(r.showIf.conditions=i,r.showIf.logic=e.showIf?.logic===`or`?`or`:`and`)),e.labelWhen?.field&&e.labelWhen?.label&&(r.labelWhen={field:String(e.labelWhen.field).trim(),operator:e.labelWhen.operator??`eq`,label:String(e.labelWhen.label).trim()},hS.includes(r.labelWhen.operator)&&e.labelWhen.value!=null&&e.labelWhen.value!==``&&(r.labelWhen.value=e.labelWhen.value)),e.colWhenField&&Number(e.colWhenCol)>0){let t={field:String(e.colWhenField).trim(),operator:e.colWhenOperator??`eq`,col:Number(e.colWhenCol)};hS.includes(t.operator)&&e.colWhenValue!=null&&e.colWhenValue!==``&&(t.value=e.colWhenValue),r.colWhen=[t]}if(e.verifyAction){if(r.verifyAction=e.verifyAction,e.verifyResultField&&(r.verifyResultField=String(e.verifyResultField).trim()),e.verifyTimestampField&&(r.verifyTimestampField=String(e.verifyTimestampField).trim()),e.verifyIdleLabel&&(r.verifyIdleLabel=String(e.verifyIdleLabel).trim()),e.verifyRetryLabel&&(r.verifyRetryLabel=String(e.verifyRetryLabel).trim()),e.verifySuccessLabel&&(r.verifySuccessLabel=String(e.verifySuccessLabel).trim()),e.verifyLockedWhenFields){let t=rp(e.verifyLockedWhenFields);t.length&&(r.verifyLockedWhenFields=t.join(`,`))}e.verifyLockedLabel&&(r.verifyLockedLabel=String(e.verifyLockedLabel).trim())}if(e.disabledByField&&(r.disabledByField=String(e.disabledByField).trim()),e.requiredIfField&&(r.requiredIfField=String(e.requiredIfField).trim()),e.overrideEnabled){let t=String(e.overrideSkipValidations??``).split(`,`).map(e=>e.trim()).filter(Boolean);if(t.length){let n={skipValidations:t};e.overrideLabel&&(n.label=String(e.overrideLabel).trim()),e.overrideField&&(n.field=String(e.overrideField).trim()),e.overrideConfirmTitle&&(n.confirmTitle=String(e.overrideConfirmTitle).trim()),e.overrideConfirmBody&&(n.confirmBody=String(e.overrideConfirmBody).trim()),e.overrideConfirmOkText&&(n.confirmOkText=String(e.overrideConfirmOkText).trim()),e.overrideConfirmCancelText&&(n.confirmCancelText=String(e.overrideConfirmCancelText).trim()),e.overrideStore===!1&&(n.store=!1),r.overrideCheckbox=n}}if(e.linkedClearField){let t=String(e.linkedClearField).split(`,`).map(e=>e.trim()).filter(Boolean);t.length===1?r.linkedClearField=t[0]:t.length>1&&(r.linkedClearField=t)}e.clearGroupOnChange&&(r.clearGroupOnChange=!0),e.splitDialCodeInto&&(r.splitDialCodeInto=String(e.splitDialCodeInto).trim()),e.checkDuplicateOnBlur&&(r.checkDuplicateOnBlur=!0);let a=String(e.helpText??``).split(`
4
4
  `).map(e=>e.trim()).filter(Boolean);if(a.length===1?r.helpText=a[0]:a.length>1&&(r.helpText=a),e.rowHierarchyEnabled&&(r.rowHierarchy=e.rowHierarchy??MS),e.autofillFrom)try{let t=typeof e.autofillFrom==`string`?JSON.parse(e.autofillFrom):e.autofillFrom;Array.isArray(t)&&t.length>0&&(r.autofillFrom=t)}catch{}Array.isArray(e.aiActions)&&e.aiActions.length>0&&(r.aiActions=e.aiActions.filter(e=>e?.key&&e?.label&&e?.serviceKey&&e?.endpointPath).map(e=>({key:e.key,label:e.label,trigger:e.trigger||`click`,serviceKey:e.serviceKey,endpointPath:e.endpointPath,bodyType:e.bodyType||`json`,inputs:(e.inputs||[]).filter(e=>e?.param&&e?.sourceField).map(e=>({param:e.param,sourceField:e.sourceField,kind:e.kind||`text`,...e.transform?{transform:e.transform}:{},...e.group?{group:e.group}:{},...e.required?{required:!0}:{},...Number(e.minWords)>0?{minWords:Number(e.minWords)}:{}})),...String(e.responseDataPath||``).trim()?{responseDataPath:String(e.responseDataPath).trim()}:{},...String(e.position||``).trim()?{position:String(e.position).trim()}:{},...e.confirmWhen&&e.confirmWhen!==`never`?{confirmWhen:e.confirmWhen}:{},...jS(e.confirmMessages)?{confirmMessages:jS(e.confirmMessages)}:{}})));let o=e.validator?.type;if(o){r.validator={type:o},e.validator.title&&(r.validator.title=e.validator.title);let t=Number(e.validator.maxLength);!isNaN(t)&&t>0&&(r.validator.maxLength=t);let n=Number(e.validator.maxChars);!isNaN(n)&&n>0&&(r.validator.maxChars=n)}if(e.type===`location`&&(r.multiSelect=e.multiSelect??!1),[`select`,`radio`,`checkbox`].includes(e.type)){let t=e.dataSource??`static`;if(r.dataSource=t,e.type===`select`&&(r.multiSelect=e.multiSelect??!1),e.allowCustomValues&&(r.allowCustomValues=!0,e.tokenSeparators!==void 0&&String(e.tokenSeparators)!==``&&(r.tokenSeparators=String(e.tokenSeparators))),e.optionsFromField&&(r.optionsFromField=String(e.optionsFromField).trim()),t===`master`&&(r.masterName=e.masterName??``),t===`group`&&(r.groupName=e.groupName??``,e.groupRoleContains&&(r.groupRoleContains=String(e.groupRoleContains).trim())),t===`locationMaster`&&(r.locationLevel=e.locationLevel||`country`,(r.locationLevel===`state`||r.locationLevel===`city`)&&e.locationCountryFrom&&(r.locationCountryFrom=String(e.locationCountryFrom).trim()),r.locationLevel===`city`&&e.locationStateFrom&&(r.locationStateFrom=String(e.locationStateFrom).trim())),t===`static`&&(r.options=Qx(e.options)),t===`lookup`){r.lookupCollection=e.lookupCollection??``,r.displayField=e.displayField??``,e.displayField2&&(r.displayField2=e.displayField2),r.valueField=e.valueField??`_id`,e.lookupFilterField&&e.lookupFilterValueFrom&&(r.lookupFilterField=e.lookupFilterField,r.lookupFilterValueFrom=e.lookupFilterValueFrom);let t=kS(e.lookupFilters);t.length&&(r.lookupFilters=t);let n=String(e.optionsRequireExtraField??``).trim();if(n){r.optionsRequireExtraField=n;let t=String(e.optionsRequireExtraValue??``).trim();t&&(r.optionsRequireExtraValue=t)}let i=String(e.optionsHierarchyParentField??``).trim();if(i&&(r.optionsHierarchyParentField=i,r.optionsHierarchySelfFrom=String(e.optionsHierarchySelfFrom??``).trim()||`currentUserId`),e.quickCreate){r.quickCreate=!0,e.quickCreateModule&&(r.quickCreateModule=e.quickCreateModule),e.quickCreateLabel&&String(e.quickCreateLabel).trim().toLowerCase()!==`add more`&&(r.quickCreateLabel=String(e.quickCreateLabel).trim());let t=e.quickCreateNotice;if(t?.enabled){let e={enabled:!0};[`title`,`message`,`recordNameField`,`recordLabel`,`creatorLabel`].forEach(n=>{let r=String(t[n]??``).trim();r&&(e[n]=r)}),e.showCreator=t.showCreator!==!1,e.showRecordName=t.showRecordName!==!1,r.quickCreateNotice=e}}e.quickEdit&&(r.quickEdit=!0,e.quickEditModule&&(r.quickEditModule=e.quickEditModule),e.quickEditLabel&&String(e.quickEditLabel).trim().toLowerCase()!==`add more`&&(r.quickEditLabel=String(e.quickEditLabel).trim()),e.quickEditIdFrom&&(r.quickEditIdFrom=e.quickEditIdFrom))}}for(let[t,n]of Object.entries(e))n!=null&&n!==``&&(t in r||LS.has(t)||(r[t]=n));return r})}function IS({collection:e,displayField:t,valueField:r,value:i,labelValue:a,onChange:c}){let[u,d]=(0,o.useState)([]),[f,p]=(0,o.useState)(!1),m=(0,o.useRef)(``),h=()=>{let i=`${e}|${t}|${r}`;!e||!t||m.current===i||(p(!0),n.kr(e,t,r||`_id`).then(e=>{m.current=i,d(e)}).catch(()=>d([])).finally(()=>p(!1)))},g=i&&!u.some(e=>e.value===i)?[{label:a||i,value:i},...u]:u;return(0,l.jsx)(s.Select,{size:`small`,showSearch:!0,allowClear:!0,loading:f,placeholder:e?`Pick from ${e}`:`Configure a lookup first`,disabled:!e||!t,style:{width:220},optionFilterProp:`label`,options:g,value:i||void 0,onDropdownVisibleChange:e=>{e&&h()},onChange:(e,t)=>c(e??``,t?.label??``),getPopupContainer:()=>document.body})}var LS=new Set(`label.field.type.show.req.edit.order.formatter.validations.showOnAdd.addRow.minRows.maxRows.initialRows.addLabel.subFields.placeholder.hidePlaceholder.combineKey.combineLabel.combineRole.combineToggleLabel.combineToggleTarget.combineWidth.combineWrap.combineSpan.defaultOnEdit.noPrefill.emptyValues.valuePaths.clientScope.clientGateMessage.clientGateResetOnChange.visiblePermission.editablePermission.infoEnabled.infoText.tooltip.helpText.payloadKey.prefillFrom.prefillFromModule.dataType.elementType.prefillAsHint.prefillHintLabel.payloadMode.valueKey.displayKey.defaultValue.richValue.omitEmpty.payloadTemplate.transformRule.multiple.maxCount.fileKey.fileNameKey.fileUrlKey.accept.showIf.labelWhen.colWhen.colWhenField.colWhenOperator.colWhenValue.colWhenCol.verifyAction.verifyResultField.verifyTimestampField.prefillWhen.prefillWhenReset.prefillWhenExclusive.verifyIdleLabel.verifyRetryLabel.verifySuccessLabel.verifyLockedWhenFields.verifyLockedLabel.disabledByField.requiredIfField.linkedClearField.clearGroupOnChange.splitDialCodeInto.overrideCheckbox.overrideEnabled.overrideLabel.overrideField.overrideSkipValidations.overrideConfirmTitle.overrideConfirmBody.overrideConfirmOkText.overrideConfirmCancelText.overrideStore.checkDuplicateOnBlur.rowHierarchy.exclusiveInGroup.autofillFrom.aiActions.validator.dataSource.masterName.groupName.groupRoleContains.options.multiSelect.lookupCollection.displayField.displayField2.valueField.lookupFilterField.lookupFilterValueFrom.lookupFilters.locationLevel.locationCountryFrom.locationStateFrom.optionsRequireExtraField.optionsRequireExtraValue.optionsHierarchyParentField.optionsHierarchySelfFrom.allowCustomValues.tokenSeparators.optionsFromField.quickCreate.quickCreateModule.quickCreateLabel.quickCreateNotice.quickEdit.quickEditModule.quickEditLabel.quickEditIdFrom.value.documentPreview.displayAs.renderType.renderOptions`.split(`.`)),RS=new Set(`module.name.label.addRow.order.fields.hideGroup.hideGroupInForm.moduleName.linkField.linkTypeField.parentRefField.hierarchyLevel.hierarchyParent.hierarchyLinkField.writeRefs.dependsOn.optionalWrite.appendHistory.allowCollapse.defaultCollapsed.historyField.historyFields.historyTimestampField.historyLabels.historyLabelFrom.historyAfterGroup.historyAmountFields.historyCurrencyFields.historyUnitFields.minRows.maxRows.initialRows.requireOne.requireValidatedField.requireValidatedFieldMessage.submitDisabledMessage.allowInProgress.inProgressMessage.orderBy.orderByEnabled.levelRule.levelRuleEnabled.regionRules.linkGroup.mergeInto.mergePosition.infoEnabled.infoText.toggleEnabled.toggleLabel.toggleField.afterSubmit.showIf.showIfField.showIfOperator.showIfValue.disabled.disabledIf.disabledIfField.disabledIfOperator.disabledIfValue.formActions.afterSubmitMode.afterSubmitTarget.submitMessages.submitMsgAddSuccess.submitMsgEditSuccess.submitMsgAddError.submitMsgEditError.submitMsgSuppress.id._id.rows.toggleValue`.split(`.`));function zS(e){return{...e,show:e.show===1,req:e.req===1,edit:e.edit===1,showOnAdd:e.showOnAdd!==!1,addRow:e.addRow??!1,minRows:e.minRows??``,maxRows:e.maxRows??``,initialRows:e.initialRows??``,addLabel:e.addLabel??``,subFields:Array.isArray(e.subFields)?e.subFields.map(e=>({field:e.field??``,label:e.label??``,type:e.type??`text`,req:e.req===1||e.req===!0,col:e.col??``,payloadKey:e.payloadKey??``,dataSource:e.dataSource??`static`,multiSelect:e.multiSelect??!1,masterName:e.masterName??``,groupName:e.groupName??``,options:Array.isArray(e.options)?e.options:[],lookupCollection:e.lookupCollection??``,displayField:e.displayField??``,displayField2:e.displayField2??``,valueField:e.valueField??`_id`,lookupFilterField:e.lookupFilterField??``,lookupFilterValueFrom:e.lookupFilterValueFrom??``})):[],placeholder:e.placeholder??``,hidePlaceholder:e.hidePlaceholder??!1,clientScope:e.clientScope??!1,clientGateMessage:e.clientGateMessage??``,clientGateResetOnChange:e.clientGateResetOnChange??!1,visiblePermission:e.visiblePermission??``,editablePermission:e.editablePermission??``,infoEnabled:e.infoEnabled??!1,infoText:e.infoText??``,tooltip:e.tooltip??``,helpText:Array.isArray(e.helpText)?e.helpText.join(`
5
5
  `):e.helpText??``,formatter:e.formatter??``,combineKey:e.combineKey??``,combineLabel:e.combineLabel??``,combineRole:e.combineRole??``,combineToggleLabel:e.combineToggleLabel??``,combineToggleTarget:e.combineToggleTarget??``,combineWidth:e.combineWidth??``,combineWrap:e.combineWrap??!1,combineSpan:e.combineSpan??``,defaultOnEdit:e.defaultOnEdit??!1,noPrefill:e.noPrefill??!1,emptyValues:Array.isArray(e.emptyValues)?e.emptyValues.join(`, `):e.emptyValues??``,valuePaths:Array.isArray(e.valuePaths)?e.valuePaths.join(`, `):e.valuePaths??``,booleanCapable:e.booleanCapable??!1,booleanApiKey:Array.isArray(e.booleanApiKey)?e.booleanApiKey.join(`,`):e.booleanApiKey??``,booleanPlaceholder:e.booleanPlaceholder??``,col:e.col??void 0,isPrimaryKeyword:e.isPrimaryKeyword??!1,showMandatoryOption:e.showMandatoryOption??!1,keywordRole:e.keywordRole??`include`,keywordGroup:e.keywordGroup??e.field??``,keywordFields:Array.isArray(e.keywordFields)?e.keywordFields.join(`, `):e.keywordFields??``,maxKeywords:e.maxKeywords??``,hideInBooleanMode:e.hideInBooleanMode??!1,min:e.min??``,max:e.max??``,defaultRange:e.defaultRange??void 0,defaultPreset:e.defaultPreset??void 0,display:e.display??`both`,minLabel:e.minLabel??``,maxLabel:e.maxLabel??``,unit:e.unit??``,rangeKeys:Array.isArray(e.rangeKeys)?e.rangeKeys.join(`,`):e.rangeKeys??``,filterField:e.filterField??``,hideSelectAll:e.hideSelectAll??!1,dataSource:e.dataSource??`static`,masterName:e.masterName??``,groupName:e.groupName??``,groupRoleContains:e.groupRoleContains??``,options:e.options??[],lookupCollection:e.lookupCollection??``,displayField:e.displayField??``,displayField2:e.displayField2??``,valueField:e.valueField??`_id`,lookupFilterField:e.lookupFilterField??``,lookupFilterValueFrom:e.lookupFilterValueFrom??``,locationLevel:e.locationLevel??`country`,locationCountryFrom:e.locationCountryFrom??``,locationStateFrom:e.locationStateFrom??``,lookupFilters:OS(e.lookupFilters),optionsRequireExtraField:e.optionsRequireExtraField??``,optionsRequireExtraValue:e.optionsRequireExtraValue??``,optionsHierarchyParentField:e.optionsHierarchyParentField??``,optionsHierarchySelfFrom:e.optionsHierarchySelfFrom??``,allowCustomValues:e.allowCustomValues??!1,tokenSeparators:e.tokenSeparators??``,optionsFromField:e.optionsFromField??``,quickCreate:e.quickCreate??!1,quickCreateModule:e.quickCreateModule??``,quickCreateLabel:e.quickCreateLabel??``,quickEdit:e.quickEdit??!1,quickEditModule:e.quickEditModule??``,quickEditLabel:e.quickEditLabel??``,quickEditIdFrom:e.quickEditIdFrom??``,quickCreateNotice:{enabled:e.quickCreateNotice?.enabled??!1,title:e.quickCreateNotice?.title??``,message:e.quickCreateNotice?.message??``,showCreator:e.quickCreateNotice?.showCreator!==!1,showRecordName:e.quickCreateNotice?.showRecordName!==!1,recordNameField:e.quickCreateNotice?.recordNameField??``,recordLabel:e.quickCreateNotice?.recordLabel??``,creatorLabel:e.quickCreateNotice?.creatorLabel??``},multiSelect:e.multiSelect??!1,multiple:e.multiple??!1,maxCount:e.maxCount??5,accept:e.accept??`any`,fileKey:e.fileKey??``,fileNameKey:e.fileNameKey??``,fileUrlKey:e.fileUrlKey??``,payloadKey:e.payloadKey??``,prefillFrom:e.prefillFrom??``,prefillAsHint:!!e.prefillAsHint,prefillHintLabel:e.prefillHintLabel??``,prefillFromModule:e.prefillFromModule??``,prefillWhen:Array.isArray(e.prefillWhen)?e.prefillWhen:[],prefillWhenReset:e.prefillWhenReset!==!1,prefillWhenExclusive:e.prefillWhenExclusive===!0,dataType:e.dataType??`auto`,elementType:e.elementType??``,payloadMode:e.payloadMode??`auto`,valueKey:e.valueKey??``,displayKey:e.displayKey??``,defaultValue:e.defaultValue??``,richValue:e.richValue??!1,omitEmpty:e.omitEmpty??!1,payloadTemplate:wS(e.payloadTemplate),transformRule:wS(e.transformRule),showIf:e.showIf?.field||e.showIf?.conditions?.length?{field:e.showIf.field??``,operator:e.showIf.operator??`eq`,value:e.showIf.value??``,logic:e.showIf.logic===`or`?`or`:`and`,conditions:Array.isArray(e.showIf.conditions)?e.showIf.conditions.map(e=>({field:e.field??``,operator:e.operator??`eq`,value:e.value??``})):[]}:{field:``,operator:`eq`,value:``,logic:`and`,conditions:[]},labelWhen:e.labelWhen?.field?{field:e.labelWhen.field,operator:e.labelWhen.operator??`eq`,value:e.labelWhen.value??``,label:e.labelWhen.label??``}:{field:``,operator:`eq`,value:``,label:``},colWhenField:(Array.isArray(e.colWhen)?e.colWhen[0]?.field:e.colWhen?.field)??``,colWhenOperator:(Array.isArray(e.colWhen)?e.colWhen[0]?.operator:e.colWhen?.operator)??`eq`,colWhenValue:(Array.isArray(e.colWhen)?e.colWhen[0]?.value:e.colWhen?.value)??``,colWhenCol:(Array.isArray(e.colWhen)?e.colWhen[0]?.col:e.colWhen?.col)??void 0,verifyAction:e.verifyAction??``,verifyResultField:e.verifyResultField??``,verifyTimestampField:e.verifyTimestampField??``,verifyIdleLabel:e.verifyIdleLabel??``,verifyRetryLabel:e.verifyRetryLabel??``,verifySuccessLabel:e.verifySuccessLabel??``,verifyLockedWhenFields:rp(e.verifyLockedWhenFields).join(`, `),verifyLockedLabel:e.verifyLockedLabel??``,validations:(e.validations??[]).map(t=>({type:t.type,value:t.type===`unique`?Lx(t.value,e):t.value??``,field:t.field??``,message:t.message??``,strict:!!t.strict,minGap:{value:t.minGap?.value??``,unit:t.minGap?.unit??`month`},minGapFrom:t.minGapFrom??``})),validator:{type:e.validator?.type??``,title:e.validator?.title??``,maxLength:e.validator?.maxLength??``,maxChars:e.validator?.maxChars??``},disabledByField:e.disabledByField??``,requiredIfField:e.requiredIfField??``,overrideEnabled:!!e.overrideCheckbox,overrideLabel:e.overrideCheckbox?.label??``,overrideField:e.overrideCheckbox?.field??``,overrideSkipValidations:Array.isArray(e.overrideCheckbox?.skipValidations)?e.overrideCheckbox.skipValidations.join(`, `):e.overrideCheckbox?.skipValidations??``,overrideConfirmTitle:e.overrideCheckbox?.confirmTitle??``,overrideConfirmBody:e.overrideCheckbox?.confirmBody??``,overrideConfirmOkText:e.overrideCheckbox?.confirmOkText??``,overrideConfirmCancelText:e.overrideCheckbox?.confirmCancelText??``,overrideStore:e.overrideCheckbox?.store!==!1,linkedClearField:Array.isArray(e.linkedClearField)?e.linkedClearField.join(`, `):e.linkedClearField??``,clearGroupOnChange:!!e.clearGroupOnChange,splitDialCodeInto:e.splitDialCodeInto??``,checkDuplicateOnBlur:!!e.checkDuplicateOnBlur,rowHierarchyEnabled:!!e.rowHierarchy,rowHierarchy:e.rowHierarchy??null,autofillFrom:Array.isArray(e.autofillFrom)?JSON.stringify(e.autofillFrom,null,2):e.autofillFrom??``,aiActions:Array.isArray(e.aiActions)?e.aiActions.map(e=>({...e,inputs:(e.inputs??[]).map(e=>({...e,minWords:e.minWords??``})),responseDataPath:e.responseDataPath??``,confirmWhen:e.confirmWhen??`never`,confirmMessages:{title:e.confirmMessages?.title??``,body:e.confirmMessages?.body??``,ok:e.confirmMessages?.ok??``,cancel:e.confirmMessages?.cancel??``},position:e.position??``})):[]}}function BS(e,t,n,r,i){if(!t||!n||!String(r??``).trim())return``;let a=new Map;i.forEach(e=>{e.moduleName&&a.set(e.moduleName,e)});let o=[`${t}.${r.trim()}`],s=n,c=new Set([t]),l=0;for(;s&&s!==e&&l<10;){if(c.has(s))return``;c.add(s);let e=a.get(s);if(!e||!e.hierarchyLinkField)return o.unshift(s),o.join(` → `);o.unshift(`${e.moduleName}.${e.hierarchyLinkField}`),s=e.hierarchyParent,l+=1}if(s===e)o.unshift(e);else return``;return o.join(` → `)}function VS(){let[e,t]=(0,o.useState)({});return(0,o.useEffect)(()=>{let e=!1;return n.Pr().then(n=>{e||t(n??{})}).catch(()=>{}),()=>{e=!0}},[]),(0,o.useMemo)(()=>t=>e[String(t??``).trim().toLowerCase()]??``,[e])}function HS({form:e,fieldItems:t,add:r,remove:i,move:a,absBase:o,moduleFieldOptions:u,dragIndexRef:d,dragOverIndex:f,setDragOverIndex:p,onFieldKeySelect:m,expandedFieldKeys:h,onToggleField:g,defaultFieldSet:_=new Set,uniqueTarget:v={primaryModule:``,getTargetModule:()=>``,collectionForModule:()=>``}}){let y=[...o,`fields`];return(0,l.jsxs)(l.Fragment,{children:[t.map(({key:t,name:r,...o},b)=>{let x=[...y,r],S=e.getFieldValue(x)??{},C=h&&!h.has(b),w=e.getFieldValue(`formType`)===`search`;return(0,l.jsx)(`div`,{draggable:!0,onDragStart:()=>{d.current=b},onDragEnd:()=>{d.current=null,p(null)},onDragOver:e=>{e.preventDefault(),p(b)},onDragLeave:()=>p(null),onDrop:e=>{e.preventDefault();let t=d.current;t!==null&&t!==b&&a(t,b),d.current=null,p(null)},className:`fg-field-card${f===b?` fg-drag-over`:``}`,children:(0,l.jsxs)(`div`,{className:`fg-field-card-inner`,children:[(0,l.jsx)(`span`,{className:`fg-drag-handle`,children:(0,l.jsx)(c.HolderOutlined,{})}),C?(0,l.jsxs)(`div`,{className:`fg-field-summary`,children:[(0,l.jsxs)(`button`,{type:`button`,className:`fg-field-summary-main`,onClick:()=>g(b),children:[(0,l.jsx)(c.RightOutlined,{className:`fg-field-summary-chevron`}),(0,l.jsxs)(`span`,{children:[(0,l.jsx)(`strong`,{children:S.label||S.field||`Field ${b+1}`}),(0,l.jsxs)(`small`,{children:[S.field||`Field key not set`,` · `,S.type||`text`]})]})]}),(0,l.jsxs)(s.Space,{size:4,children:[S.req&&(0,l.jsx)(s.Tag,{color:`red`,children:`Required`}),S.show===!1&&(0,l.jsx)(s.Tag,{children:`Hidden`}),(0,l.jsx)(s.Tooltip,{title:`Edit field settings`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.EditOutlined,{}),onClick:()=>g(b)})}),(0,l.jsx)(s.Tooltip,{title:`Remove field`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,danger:!0,icon:(0,l.jsx)(c.MinusCircleOutlined,{}),onClick:()=>i(r)})})]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`fg-field-body`,children:[h&&(0,l.jsxs)(`button`,{type:`button`,className:`fg-field-collapse-btn`,onClick:()=>g(b),children:[(0,l.jsx)(c.DownOutlined,{}),` Collapse field`]}),(0,l.jsx)(s.Form.Item,{...o,name:[r,`field`],label:`Field`,style:{marginBottom:10},rules:[{required:!0,message:`Required`}],children:(0,l.jsx)(s.AutoComplete,{options:u,placeholder:`Search or type field key…`,filterOption:(e,t)=>(t?.searchLabel??``).includes(e.toLowerCase()),onSelect:e=>m(e,r),className:`fg-mono-input`})}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,children:[(0,l.jsx)(s.Form.Item,{...o,name:[r,`label`],label:`Label`,style:{marginBottom:8,flex:2},rules:[{required:!0,message:`Required`}],children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Display label`})}),(0,l.jsx)(s.Form.Item,{...o,name:[r,`type`],label:`Type`,style:{marginBottom:8,flex:2},initialValue:`text`,children:(0,l.jsx)(s.Select,{size:`small`,options:w?[...iS,...aS]:iS})}),(0,l.jsx)(s.Form.Item,{...o,name:[r,`formatter`],label:`Formatter`,style:{marginBottom:8,flex:2},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`name / phone…`})})]}),(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:`Layout / Combine`}),(0,l.jsxs)(`div`,{className:`fg-options-controls`,style:{flexWrap:`wrap`},children:[(0,l.jsx)(s.Form.Item,{name:[r,`col`],label:`Width`,style:{marginBottom:0},tooltip:`How much of the row this field takes. Blank uses the form's default (half a row on most forms). Use Full row for controls that need the space, such as a keyword chip box.`,children:(0,l.jsx)(s.Select,{size:`small`,allowClear:!0,style:{width:130},placeholder:`Default`,options:cS})}),(0,l.jsx)(s.Form.Item,{name:[r,`combineKey`],label:`Combine Key`,style:{marginBottom:0},tooltip:`Fields with the same key render together as one visual block. Payload stays unchanged.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. client_rate`,style:{width:150},className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`combineLabel`],label:`Combined Label`,style:{marginBottom:0},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. Client Rate`,style:{width:160}})}),(0,l.jsx)(s.Form.Item,{name:[r,`combineRole`],label:`Role`,style:{marginBottom:0},children:(0,l.jsx)(s.Select,{size:`small`,style:{width:120},allowClear:!0,options:[{label:`Primary`,value:`primary`},{label:`From`,value:`from`},{label:`To`,value:`to`},{label:`Currency`,value:`currency`},{label:`Unit`,value:`unit`}]})}),(0,l.jsx)(s.Form.Item,{name:[r,`combineToggleLabel`],label:`Toggle Label`,style:{marginBottom:0},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. Range`,style:{width:130}})}),(0,l.jsx)(s.Form.Item,{name:[r,`combineToggleTarget`],label:`Toggle Target`,style:{marginBottom:0},tooltip:`Field key hidden until the combined-field slider is enabled. Example: clientRateTo.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`target field key`,style:{width:150},className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`combineWidth`],label:`Width`,style:{marginBottom:0},tooltip:`Width weight of this box inside the combined block. Set the same key's fields to e.g. 2 & 1 for 2:1, or 1/2/3 for 1:2:3. Blank/0 = equal share.`,children:(0,l.jsx)(s.Input,{size:`small`,type:`number`,min:0,step:.5,placeholder:`1`,style:{width:80}})}),(0,l.jsx)(s.Form.Item,{name:[r,`combineWrap`],label:`Wrap`,valuePropName:`checked`,style:{marginBottom:0},tooltip:`Allow this combined block to wrap to another line. Useful for wider controls such as document upload rows.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Yes`,unCheckedChildren:`No`})}),(0,l.jsx)(s.Form.Item,{name:[r,`combineSpan`],label:`Block Span`,style:{marginBottom:0},tooltip:`How much row width this combined block uses. Blank keeps the existing automatic layout.`,children:(0,l.jsx)(s.Select,{size:`small`,allowClear:!0,placeholder:`Auto`,style:{width:110},options:[{label:`Half`,value:12},{label:`Full`,value:24}]})})]})]}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:8},children:({getFieldValue:e})=>{if(e(`formType`)!==`search`||!e(`booleanSearchEnabled`))return null;let t=e([...x,`type`])??`text`,n=e([...x,`booleanApiKey`]),i=sS.includes(t)&&Nm.includes(n);return(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:`Boolean Search`}),(0,l.jsxs)(`div`,{className:`fg-options-controls`,children:[(0,l.jsx)(s.Form.Item,{name:[r,`booleanApiKey`],label:`Boolean API key`,style:{marginBottom:0},tooltip:`Which boolean-search request parameter this field fills. Needed by plain fields too — without it the field is not sent in Boolean mode.`,children:(0,l.jsx)(s.Select,{size:`small`,allowClear:!0,style:{width:240},placeholder:`Not sent`,options:oS})}),i?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Form.Item,{name:[r,`booleanCapable`],label:`Boolean capable`,valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,tooltip:`When the user turns the Boolean toggle on, this field becomes an AND/OR/NOT expression box. Fields left off keep their normal control in both modes.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Yes`,unCheckedChildren:`No`})}),e([...x,`booleanCapable`])&&(0,l.jsx)(s.Form.Item,{name:[r,`booleanPlaceholder`],label:`Example expression`,style:{marginBottom:0},tooltip:`Shown inside this field's expression box. Give an example using THIS field's own vocabulary — blank falls back to one generic example shared by every boolean field.`,children:(0,l.jsx)(s.Input,{size:`small`,style:{width:360},placeholder:`e.g., (Java OR J2EE) AND "Spring Boot" NOT PHP`})})]}):sS.includes(t)&&(0,l.jsx)(`span`,{className:`fg-options-hint`,children:`Boolean mode belongs to the common Keywords field. Use a Keywords field mapped to the query API key.`})]})]})}}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:8},children:({getFieldValue:e})=>{if(e(`formType`)!==`search`||e([...x,`type`])!==`keywords`)return null;let t=e([...x,`keywordRole`])===`exclude`;return(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:`Keyword Search`}),(0,l.jsxs)(`div`,{className:`fg-options-controls`,children:[(0,l.jsx)(s.Form.Item,{name:[r,`keywordRole`],label:`Role`,style:{marginBottom:0},initialValue:`include`,tooltip:`Include fields contribute the keywords to match. An Exclude field contributes keywords that must NOT match — point it at another field's group to attach it.`,children:(0,l.jsx)(s.Select,{size:`small`,style:{width:200},options:lS})}),(0,l.jsx)(s.Form.Item,{name:[r,`keywordGroup`],label:`Group`,style:{marginBottom:0},tooltip:`Which keyword group this field feeds. Two fields naming the same group are merged into one — that is how an Exclude box attaches to its Keywords box. Blank uses the field's own key.`,children:(0,l.jsx)(s.Input,{size:`small`,style:{width:200},placeholder:`same as field key`})}),(0,l.jsx)(s.Form.Item,{name:[r,`keywordFields`],label:`Search in fields`,style:{marginBottom:0},tooltip:`Comma-separated database paths this field's keywords match against, e.g. skills or currentLocation, projectLocation. Leave blank to search the entire resume (every configured search field).`,children:(0,l.jsx)(s.Input,{size:`small`,style:{width:320},placeholder:`blank = entire resume`})}),!t&&(0,l.jsx)(s.Form.Item,{name:[r,`showMandatoryOption`],label:`Mandatory star`,valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,tooltip:`Shows a star on every keyword chip and a 'Mark all keywords as mandatory' checkbox below the box. Starred keywords must all match; unstarred ones only need one match between them. Off means plain chips.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Yes`,unCheckedChildren:`No`})}),(0,l.jsx)(s.Form.Item,{name:[r,`isPrimaryKeyword`],label:`Primary (owns Boolean)`,valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,tooltip:`The one field that draws the Boolean toggle and becomes the AND/OR/NOT expression box. Set this on exactly one field per form — without it the form shows no Boolean toggle at all.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Yes`,unCheckedChildren:`No`})}),(0,l.jsx)(s.Form.Item,{name:[r,`maxKeywords`],label:`Max keywords`,style:{marginBottom:0},tooltip:`How many chips this box accepts. Blank means 50.`,children:(0,l.jsx)(s.InputNumber,{size:`small`,min:1,style:{width:110},placeholder:`50`})}),t&&(0,l.jsx)(`span`,{className:`fg-options-hint`,children:`Exclude fields never show stars — a mandatory exclusion has no meaning.`})]})]})}}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:8},children:({getFieldValue:e})=>e(`formType`)!==`search`||!e(`booleanSearchEnabled`)?null:(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:`Boolean Mode`}),(0,l.jsx)(`div`,{className:`fg-options-controls`,children:(0,l.jsx)(s.Form.Item,{name:[r,`hideInBooleanMode`],label:`Hide when Boolean is on`,valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,tooltip:`Removes this field from the form while the Boolean toggle is on, and stops it being submitted. Use it for controls the expression already covers.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Yes`,unCheckedChildren:`No`})})})]})}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:8},children:({getFieldValue:e})=>e(`formType`)!==`search`||e([...x,`type`])!==`checkbox`?null:(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:`Select All`}),(0,l.jsx)(`div`,{className:`fg-options-controls`,children:(0,l.jsx)(s.Form.Item,{name:[r,`hideSelectAll`],label:`Show 'All' checkbox`,valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,getValueProps:e=>({checked:!e}),normalize:e=>!e,tooltip:`On by default. Turn off if this field's options should never offer a select-everything shortcut.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Shown`,unCheckedChildren:`Hidden`})})})]})}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:8},children:({getFieldValue:e})=>{let t=e([...x,`type`]);return[`range`,`number`].includes(t)?(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:t===`range`?`Range`:`Bounds`}),(0,l.jsxs)(`div`,{className:`fg-options-controls`,children:[(0,l.jsx)(s.Form.Item,{name:[r,`min`],label:`Min`,style:{marginBottom:0},children:(0,l.jsx)(s.Input,{size:`small`,type:`number`,placeholder:`0`,style:{width:90}})}),(0,l.jsx)(s.Form.Item,{name:[r,`max`],label:`Max`,style:{marginBottom:0},children:(0,l.jsx)(s.Input,{size:`small`,type:`number`,placeholder:`30`,style:{width:90}})}),t===`range`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Form.Item,{name:[r,`defaultRange`],label:`Default`,style:{marginBottom:0},tooltip:`Full span means the From/To boxes arrive holding Min and Max, and that range is applied to every search — records with no value for this field will not appear until the user changes it. None starts the field empty and filters nothing.`,children:(0,l.jsx)(s.Select,{size:`small`,allowClear:!0,style:{width:170},placeholder:`None`,options:nS})}),(0,l.jsx)(s.Form.Item,{name:[r,`display`],label:`Show as`,style:{marginBottom:0},initialValue:`both`,tooltip:`Drag bar, plain From/To boxes, or both. Switch to From / To if the horizontal slider is not wanted.`,children:(0,l.jsx)(s.Select,{size:`small`,style:{width:170},options:uS})}),(0,l.jsx)(s.Form.Item,{name:[r,`minLabel`],label:`Start label`,style:{marginBottom:0},tooltip:`What the LOW end reads as under the track. Blank shows the Min number itself.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`0`,style:{width:110}})}),(0,l.jsx)(s.Form.Item,{name:[r,`maxLabel`],label:`End label`,style:{marginBottom:0},tooltip:`What the HIGH end reads as under the track. Use it to mark an open ceiling: with Max 30, "30+" reads as "30 or more" where a bare 30 reads as an exact value. Blank shows the Max number itself.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`30+`,style:{width:110}})}),(0,l.jsx)(s.Form.Item,{name:[r,`unit`],label:`Unit`,style:{marginBottom:0},tooltip:`Caption shown after the From / To boxes, e.g. Years. Leave blank when the field label already names the unit.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Years`,style:{width:110}})}),(0,l.jsx)(s.Form.Item,{name:[r,`rangeKeys`],label:`From / To params`,style:{marginBottom:0},tooltip:`Comma-separated query params this range fills in normal search, e.g. experienceFrom,experienceTo. Blank uses <field>From / <field>To.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`experienceFrom,experienceTo`,style:{width:220},className:`fg-mono-input`})})]})]})]}):null}}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:8},children:({getFieldValue:e})=>e([...x,`type`])===`daterangePreset`?(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:`Date Filter`}),(0,l.jsxs)(`div`,{className:`fg-options-controls`,children:[(0,l.jsx)(s.Form.Item,{name:[r,`filterField`],label:`Filter Field`,style:{marginBottom:0},tooltip:`Mongo field this range filters on, e.g. createdAt. Blank uses the field's own key. Normal search only — in Boolean mode the range is sent via the Boolean API key instead (createdFrom + createdTo), which the boolean-search API accepts but does not filter on yet.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`createdAt`,style:{width:200},className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`defaultPreset`],label:`Default`,style:{marginBottom:0},tooltip:`Which preset the field arrives on. This is a REAL value — it is applied to every search, not just shown, so records outside the window will not appear until the user changes it. Blank means the field starts empty and filters nothing.`,children:(0,l.jsx)(s.Select,{size:`small`,allowClear:!0,style:{width:190},placeholder:`None`,options:tS})})]})]}):null}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:8},children:({getFieldValue:e})=>{if(e([...x,`type`])!==`file`)return null;let t=e([...x,`multiple`]);return(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:`File Options`}),(0,l.jsxs)(`div`,{className:`fg-options-controls`,children:[(0,l.jsx)(s.Form.Item,{name:[r,`accept`],label:`Allowed Content`,style:{marginBottom:0},initialValue:`any`,tooltip:`Restrict what this upload accepts. A file outside the selected category is rejected on upload. Overrides the 'File types allowed' validation rule.`,children:(0,l.jsx)(s.Select,{size:`small`,style:{width:230},options:n.ft})}),(0,l.jsx)(s.Form.Item,{name:[r,`multiple`],label:`Upload Mode`,valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Multiple`,unCheckedChildren:`Single`})}),t&&(0,l.jsx)(s.Form.Item,{name:[r,`maxCount`],label:`Max files`,style:{marginBottom:0},initialValue:5,rules:[{required:!0,message:`Required`}],children:(0,l.jsx)(s.Input,{size:`small`,type:`number`,min:2,placeholder:`e.g. 5`,style:{width:80}})}),(0,l.jsx)(s.Form.Item,{name:[r,`fileKey`],label:`File Key`,style:{marginBottom:0},tooltip:`Multipart field name sent to the server. Leave blank to use the field key. Set to 'file' for the jobs service.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. file`,style:{width:120},className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`fileNameKey`],label:`Name Key`,style:{marginBottom:0},tooltip:`Stored object key that contains the uploaded file name. Leave blank for automatic detection.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. passportUploadName`,style:{width:180},className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`fileUrlKey`],label:`URL Key`,style:{marginBottom:0},tooltip:`Stored object key that contains the file location/path. Leave blank for automatic detection.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. passportCopyLocation`,style:{width:190},className:`fg-mono-input`})})]})]})}}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:8},children:({getFieldValue:e})=>{let t=e([...x,`type`]);if(![`select`,`radio`,`checkbox`,`location`].includes(t))return null;let i=t===`location`,a=e([...x,`dataSource`])??`static`;return(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:i?`Location selection`:`Options / Values`}),(0,l.jsxs)(`div`,{className:`fg-options-controls`,children:[!i&&(0,l.jsx)(s.Form.Item,{name:[r,`dataSource`],label:`Source`,style:{marginBottom:0},initialValue:`static`,children:(0,l.jsx)(s.Select,{size:`small`,style:{width:190},options:dS})}),(t===`select`||i)&&(0,l.jsx)(s.Form.Item,{name:[r,`multiSelect`],label:`Multi Select`,valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Multi`,unCheckedChildren:`Single`})}),a===`master`&&(0,l.jsx)(s.Form.Item,{name:[r,`masterName`],label:`Master Name`,style:{marginBottom:0},rules:[{required:!0,message:`Enter master name`}],children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. tracker`,style:{width:140}})}),a===`group`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Form.Item,{name:[r,`groupName`],label:`Group Name`,style:{marginBottom:0},rules:[{required:!0,message:`Enter group name`}],children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. users`,style:{width:140}})}),String(e([...x,`groupName`])??``).toLowerCase().trim()===`users`&&(0,l.jsx)(s.Form.Item,{name:[r,`groupRoleContains`],label:`Only roles containing`,style:{marginBottom:0},tooltip:`List only users whose role name CONTAINS this word (case-insensitive) — e.g. 'manager' matches Delivery Manager, Onboarding Manager, Submission Manager, etc. Blank = every user.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. manager`,style:{width:160}})})]}),a===`locationMaster`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Form.Item,{name:[r,`locationLevel`],label:`Level`,style:{marginBottom:0},initialValue:`country`,children:(0,l.jsx)(s.Select,{size:`small`,style:{width:220},options:fS})}),[`state`,`city`].includes(e([...x,`locationLevel`]))&&(0,l.jsx)(s.Form.Item,{name:[r,`locationCountryFrom`],label:`Country field`,style:{marginBottom:0},rules:[{required:!0,message:`Pick the Country field`}],tooltip:`The sibling field on this form that holds the selected country. This field's options are filtered to that country's states/cities and it stays disabled until that field has a value.`,children:(0,l.jsx)(s.AutoComplete,{size:`small`,style:{width:220},placeholder:`e.g. address.country`,options:(e(y)??[]).map((e,t)=>({candidate:e,index:t})).filter(({candidate:e,index:t})=>t!==r&&e?.field).map(({candidate:e})=>({value:e.field,label:`${e.label||e.field} (${e.field})`})),filterOption:(e,t)=>String(t?.label??``).toLowerCase().includes(String(e).toLowerCase()),getPopupContainer:()=>document.body})}),e([...x,`locationLevel`])===`city`&&(0,l.jsx)(s.Form.Item,{name:[r,`locationStateFrom`],label:`State field`,style:{marginBottom:0},rules:[{required:!0,message:`Pick the State field`}],tooltip:`The sibling field on this form that holds the selected state.`,children:(0,l.jsx)(s.AutoComplete,{size:`small`,style:{width:220},placeholder:`e.g. address.state`,options:(e(y)??[]).map((e,t)=>({candidate:e,index:t})).filter(({candidate:e,index:t})=>t!==r&&e?.field).map(({candidate:e})=>({value:e.field,label:`${e.label||e.field} (${e.field})`})),filterOption:(e,t)=>String(t?.label??``).toLowerCase().includes(String(e).toLowerCase()),getPopupContainer:()=>document.body})})]})]}),!i&&(0,l.jsxs)(`div`,{className:`fg-options-controls`,style:{marginTop:8,flexWrap:`wrap`},children:[(0,l.jsx)(s.Form.Item,{name:[r,`allowCustomValues`],label:`Allow typed values`,valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,tooltip:`Let users enter a value that is not in the option list above. The typed text is stored as-is.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Typed OK`,unCheckedChildren:`List only`})}),e([...x,`allowCustomValues`])&&(0,l.jsx)(s.Form.Item,{name:[r,`tokenSeparators`],label:`Token separators`,style:{marginBottom:0},tooltip:`Characters that finish the typed entry and start a new one. Default is a comma, so 'React,Node' becomes two values. Leave blank to require Enter.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`,`,style:{width:90},className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`optionsFromField`],label:`Restrict options to field`,style:{marginBottom:0},tooltip:`Show only the options whose value matches the current value of ANOTHER field on this form. Blank = show every option. Example: point a rate-unit picker at the job's unit field so a recruiter cannot switch units.`,children:(0,l.jsx)(s.AutoComplete,{size:`small`,style:{width:230},placeholder:`blank = all options`,options:(e(y)??[]).map((e,t)=>({candidate:e,index:t})).filter(({candidate:e,index:t})=>t!==r&&e?.field).map(({candidate:e})=>({value:e.field,label:`${e.label||e.field} (${e.field})`})),filterOption:(e,t)=>String(t?.label??``).toLowerCase().includes(String(e).toLowerCase()),getPopupContainer:()=>document.body})})]}),!i&&a===`static`&&(0,l.jsxs)(`div`,{className:`fg-static-options`,children:[(0,l.jsx)(`span`,{className:`fg-static-options-hint`,children:`Label / Value pairs`}),[`checkbox`,`radio`].includes(t)&&e(`formType`)===`search`&&(0,l.jsx)(`p`,{className:`fg-source-hint`,style:{marginBottom:6},children:`Locked options are pre-selected and cannot be unchecked by the user. Module lets one option answer from a different module, so its results tab gets that module's own columns and row actions.`}),(0,l.jsx)(s.Form.List,{name:[r,`options`],children:(n,{add:r,remove:i})=>(0,l.jsxs)(l.Fragment,{children:[n.map(({key:n,name:r})=>(0,l.jsxs)(`div`,{className:`fg-option-row`,children:[(0,l.jsx)(s.Form.Item,{name:[r,`label`],style:{marginBottom:0,flex:1},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Label`})}),(0,l.jsx)(s.Form.Item,{name:[r,`value`],style:{marginBottom:0,flex:1},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Value`,className:`fg-mono-input`})}),[`checkbox`,`radio`].includes(t)&&e(`formType`)===`search`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Form.Item,{name:[r,`module`],style:{marginBottom:0,flex:1},tooltip:`Module key this option's results tab is served by, e.g. dice. The tab then gets that module's own columns and row actions instead of the form's. Blank = use the form's module.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Module (optional)`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`locked`],valuePropName:`checked`,style:{marginBottom:0},tooltip:`Pre-selected on load and cannot be unchecked.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Locked`,unCheckedChildren:`Free`})})]}),(0,l.jsx)(c.MinusCircleOutlined,{onClick:()=>i(r),className:`fg-remove-icon`})]},n)),(0,l.jsx)(s.Button,{size:`small`,type:`dashed`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>r({label:``,value:``}),className:`fg-add-option-btn`,children:`Add Option`})]})})]}),a===`module`&&(0,l.jsx)(`p`,{className:`fg-source-hint`,children:`Options fetched from the module's distinct field values at runtime.`}),a===`group`&&(0,l.jsx)(`p`,{className:`fg-source-hint`,children:`Use "users" to load all users from the MongoDB-backed user collection.`}),a===`lookup`&&(0,l.jsxs)(`div`,{className:`fg-lookup-block`,children:[(0,l.jsx)(`p`,{className:`fg-source-hint`,style:{marginBottom:8},children:`Cross-collection lookup — shows label, stores FK value.`}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,children:[(0,l.jsx)(s.Form.Item,{name:[r,`lookupCollection`],label:`Collection`,style:{marginBottom:0,flex:1},rules:[{required:!0,message:`Required`}],children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. vendors`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`displayField`],label:`Display Field`,style:{marginBottom:0,flex:1},rules:[{required:!0,message:`Required`}],children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. vendorContact.firstName`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`displayField2`],label:`Display Field 2`,style:{marginBottom:0,flex:1},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. vendorContact.lastName`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`valueField`],label:`Value Field (FK)`,style:{marginBottom:0,flex:1},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`_id`,className:`fg-mono-input`})})]}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{marginTop:8},children:[(0,l.jsx)(s.Form.Item,{name:[r,`lookupFilterField`],label:`Filter Field`,style:{marginBottom:0,flex:1},tooltip:`Optional DB field to filter lookup rows by. Example: _id or clientId.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. _id`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`lookupFilterValueFrom`],label:`Filter Value From`,style:{marginBottom:0,flex:1},tooltip:`Optional form/scope field that provides the filter value. Example: clientId.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. clientId`,className:`fg-mono-input`})})]}),(0,l.jsxs)(`div`,{className:`fg-lookup-conditions`,style:{marginTop:12},children:[(0,l.jsxs)(`p`,{className:`fg-source-hint`,style:{marginBottom:6},children:[(0,l.jsx)(`b`,{children:`Dropdown conditions`}),` — every condition must match (AND). Evaluated on the server, so they restrict the data, not just the UI.`]}),(0,l.jsx)(s.Form.List,{name:[r,`lookupFilters`],children:(e,{add:t,remove:n})=>(0,l.jsxs)(l.Fragment,{children:[e.map(({key:e,name:t,...i})=>(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{marginBottom:8,alignItems:`flex-end`,flexWrap:`wrap`},children:[(0,l.jsx)(s.Form.Item,{...i,name:[t,`field`],label:`Field`,style:{marginBottom:0,flex:1,minWidth:140},tooltip:`Field on the lookup collection to test. Example: roleId, legacyUserId.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. roleId`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{...i,name:[t,`op`],label:`Operator`,style:{marginBottom:0,width:130},initialValue:`eq`,children:(0,l.jsx)(s.Select,{size:`small`,options:ES})}),(0,l.jsx)(s.Form.Item,{...i,name:[t,`valueSource`],label:`Value from`,style:{marginBottom:0,width:160},initialValue:`literal`,tooltip:`Literal = a fixed value. Signed-in user = resolved from the auth token on the server. Another collection = a sub-query supplying the values.`,children:(0,l.jsx)(s.Select,{size:`small`,options:[{label:`Literal value`,value:`literal`},{label:`Signed-in user`,value:`identity`},{label:`Another collection`,value:`collection`}]})}),(0,l.jsx)(s.Form.Item,{noStyle:!0,shouldUpdate:!0,children:({getFieldValue:e})=>{let n=[`fields`,r,`lookupFilters`,t],a=e([...n,`op`])??`eq`;if(a===`notEmpty`||a===`empty`)return(0,l.jsx)(`span`,{className:`fg-source-hint`,style:{flex:1},children:`No value needed.`});let o=e([...n,`valueSource`])??`literal`;return o===`identity`?(0,l.jsx)(s.Form.Item,{...i,name:[t,`valueFrom`],label:`Identity`,style:{marginBottom:0,flex:1,minWidth:170},children:(0,l.jsx)(s.Select,{size:`small`,showSearch:!0,placeholder:`currentUserId`,options:DS.map(e=>({label:e,value:e}))})}):o===`collection`?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Form.Item,{...i,name:[t,`srcCollection`],label:`Collection`,style:{marginBottom:0,flex:1,minWidth:120},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. roles`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{...i,name:[t,`srcValueField`],label:`Value field`,style:{marginBottom:0,flex:1,minWidth:120},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`_id`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{...i,name:[t,`srcMatchField`],label:`Where field`,style:{marginBottom:0,flex:1,minWidth:120},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. roleName`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{...i,name:[t,`srcMatchValue`],label:`Equals`,style:{marginBottom:0,flex:1,minWidth:120},tooltip:`Fixed value. Comma-separate for a list. Ignored when an Identity is chosen next to it.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. RECRUITER`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{...i,name:[t,`srcMatchValueFrom`],label:`…or identity`,style:{marginBottom:0,flex:1,minWidth:150},tooltip:`Match against the signed-in user instead of a fixed value — resolved on the server.`,children:(0,l.jsx)(s.Select,{size:`small`,allowClear:!0,placeholder:`none`,options:DS.map(e=>({label:e,value:e}))})}),(0,l.jsx)(s.Form.Item,{...i,name:[t,`srcRecursive`],valuePropName:`checked`,style:{marginBottom:0},tooltip:`Keep following the chain outward — e.g. a reporting tree, so the whole downline is included and not just direct reports.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Chain`,unCheckedChildren:`Direct`})})]}):(0,l.jsx)(s.Form.Item,{...i,name:[t,`value`],label:`Value`,style:{marginBottom:0,flex:1,minWidth:150},tooltip:`Comma-separate for a list.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. Active`,className:`fg-mono-input`})})}}),(0,l.jsx)(s.Button,{size:`small`,danger:!0,type:`text`,onClick:()=>n(t),children:`Remove`})]},e)),(0,l.jsx)(s.Button,{size:`small`,type:`dashed`,onClick:()=>t({op:`eq`,valueSource:`literal`}),children:`+ Add condition`})]})})]}),(0,l.jsxs)(`div`,{className:`fg-lookup-row-filters`,style:{marginTop:12},children:[(0,l.jsxs)(`p`,{className:`fg-source-hint`,style:{marginBottom:6},children:[(0,l.jsx)(`b`,{children:`Option filters (in-browser)`}),` — narrow the returned options by a value on each record, and/or to the signed-in user's reporting line.`]}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{alignItems:`flex-end`},children:[(0,l.jsx)(s.Form.Item,{name:[r,`optionsRequireExtraField`],label:`Match Field`,style:{marginBottom:0,flex:1},tooltip:`Field on the looked-up record to test, e.g. roleId. Left empty, no value filter is applied.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. roleId`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`optionsRequireExtraValue`],label:`Match Value(s)`,style:{marginBottom:0,flex:1},tooltip:`Allowed value, or several separated by commas (e.g. 10, 13). Empty means the field must be exactly true.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`empty = must be true`,className:`fg-mono-input`})})]}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{marginTop:8,alignItems:`flex-end`},children:[(0,l.jsx)(s.Form.Item,{name:[r,`optionsHierarchyParentField`],label:`Reports-To Field`,style:{marginBottom:0,flex:1},tooltip:`Field holding each record's parent id, in the same id space as the Value Field (e.g. reportingId). Set it to show only people below the signed-in user — directly or through any number of levels. The signed-in user is not listed.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. reportingId`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`optionsHierarchySelfFrom`],label:`Whose Line`,style:{marginBottom:0,flex:1},tooltip:`Whose reporting line to keep. Defaults to the signed-in user.`,children:(0,l.jsx)(s.Select,{size:`small`,allowClear:!0,placeholder:`currentUserId`,options:[{label:`Signed-in user (currentUserId)`,value:`currentUserId`}]})})]})]}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{marginTop:8,alignItems:`flex-end`},children:[(0,l.jsx)(s.Form.Item,{name:[r,`quickCreate`],valuePropName:`checked`,style:{marginBottom:0},tooltip:`Adds a button inside this dropdown so someone can create a new record without leaving the form. When they save, it is selected here automatically.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Add button`,unCheckedChildren:`No add`})}),(0,l.jsx)(s.Form.Item,{name:[r,`quickCreateModule`],label:`What it creates`,style:{marginBottom:0,flex:1},tooltip:`Which list the new record is added to. Leave blank to use the Collection set above.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`same as Collection above`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`quickEdit`],valuePropName:`checked`,style:{marginBottom:0},tooltip:`Adds a button so someone can edit the record they have selected, without leaving the form.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Edit button`,unCheckedChildren:`No edit`})}),(0,l.jsx)(s.Form.Item,{name:[r,`quickEditModule`],label:`What it edits`,style:{marginBottom:0,flex:1},tooltip:`Which list the edited record belongs to. Leave blank to use the Collection set above.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`same as Collection above`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[r,`quickEditIdFrom`],label:`Edit which record`,style:{marginBottom:0,flex:1},tooltip:`Normally the record chosen in THIS box. If the thing to edit is chosen in a different box, name that box here — e.g. a recruiter row that should edit its employer names employerId.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. employerId`,className:`fg-mono-input`})})]}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:0},children:({getFieldValue:e})=>{let t=e([...x,`quickCreateModule`])||e([...x,`lookupCollection`])||``,i=e([...x,`quickEditModule`])||e([...x,`lookupCollection`])||``;return(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{marginTop:8,alignItems:`flex-end`},children:[(0,l.jsx)(s.Form.Item,{name:[r,`quickCreateLabel`],label:`Add button wording`,style:{marginBottom:0,flex:1},tooltip:`Leave blank and the button names what it adds, worked out from the list above. Only type something here if you want different wording.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:n.ut({quickCreateModule:t},t)})}),(0,l.jsx)(s.Form.Item,{name:[r,`quickEditLabel`],label:`Edit button wording`,style:{marginBottom:0,flex:1},tooltip:`Leave blank and the button names what it edits. The popup heading matches the button, so the two always agree.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:n.dt({quickEditModule:i},i)})})]})}}),(0,l.jsx)(`p`,{className:`fg-source-hint`,style:{marginTop:4},children:`Leave both blank unless you need different wording. The buttons name the thing they act on — "Add New Employer", "Edit Employer" — instead of a vague "Add More", and the popup heading matches the button that opened it.`}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{marginTop:8,alignItems:`flex-end`},children:[(0,l.jsx)(s.Form.Item,{name:[r,`quickCreateNotice`,`enabled`],valuePropName:`checked`,style:{marginBottom:0},tooltip:`Show a popup right after a record is created here, warning that it still needs an Organization Admin to configure forms, workflows and permissions.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Notice`,unCheckedChildren:`No Notice`})}),(0,l.jsx)(s.Form.Item,{name:[r,`quickCreateNotice`,`title`],label:`Notice Title`,style:{marginBottom:0,flex:1},tooltip:`Popup title. Default: New record created.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`New record created`})}),(0,l.jsx)(s.Form.Item,{name:[r,`quickCreateNotice`,`recordNameField`],label:`Name Field`,style:{marginBottom:0,flex:1},tooltip:`Key on the created record holding its display name. Empty = the Display Field above, then any name-like key.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`defaults to Display Field`,className:`fg-mono-input`})})]}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{marginTop:8,alignItems:`flex-end`},children:[(0,l.jsx)(s.Form.Item,{name:[r,`quickCreateNotice`,`showRecordName`],valuePropName:`checked`,style:{marginBottom:0},tooltip:`Show the created record's name in the popup.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Name`,unCheckedChildren:`No Name`})}),(0,l.jsx)(s.Form.Item,{name:[r,`quickCreateNotice`,`recordLabel`],label:`Name Label`,style:{marginBottom:0,flex:1},tooltip:`Label for the record-name line, e.g. Client name. Default: Record name.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Record name`})}),(0,l.jsx)(s.Form.Item,{name:[r,`quickCreateNotice`,`showCreator`],valuePropName:`checked`,style:{marginBottom:0},tooltip:`Show who created the record.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Creator`,unCheckedChildren:`No Creator`})}),(0,l.jsx)(s.Form.Item,{name:[r,`quickCreateNotice`,`creatorLabel`],label:`Creator Label`,style:{marginBottom:0,flex:1},tooltip:`Label for the creator line. Default: Created by.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Created by`})})]}),(0,l.jsx)(s.Form.Item,{name:[r,`quickCreateNotice`,`message`],label:`Notice Message`,style:{marginTop:8,marginBottom:0},tooltip:`Leave empty to use the standard wording asking the recruiter to contact their Organization Admin before proceeding.`,children:(0,l.jsx)(s.Input.TextArea,{size:`small`,rows:3,placeholder:`Leave empty for the standard message`})})]})]})}}),(0,l.jsxs)(`div`,{className:`fg-toggles-row`,children:[(()=>{let e=_.has(S.field);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Form.Item,{...o,name:[r,`show`],valuePropName:`checked`,style:{marginBottom:0},initialValue:!0,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Show`,unCheckedChildren:`Hide`,checked:e?!0:void 0,disabled:e,title:e?`Locked — Default Field (always shown)`:void 0})}),(0,l.jsx)(s.Form.Item,{...o,name:[r,`req`],valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Req`,unCheckedChildren:`Opt`,checked:e?!0:void 0,disabled:e,title:e?`Locked — Default Field (always required)`:void 0})})]})})(),(0,l.jsx)(s.Form.Item,{...o,name:[r,`showOnAdd`],valuePropName:`checked`,style:{marginBottom:0},initialValue:!0,tooltip:`Show this field on Add. Turn off for edit-only fields.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Add`,unCheckedChildren:`No Add`})}),(0,l.jsx)(s.Form.Item,{...o,name:[r,`edit`],valuePropName:`checked`,style:{marginBottom:0},initialValue:!0,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Edit`,unCheckedChildren:`Read`})}),(0,l.jsx)(s.Form.Item,{...o,name:[r,`addRow`],valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,tooltip:`Let users repeat this single field (add/remove multiple values). Ignored when this field's group is itself Add Row.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Repeat`,unCheckedChildren:`Single`})}),(0,l.jsx)(s.Form.Item,{...o,name:[r,`clientScope`],valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,tooltip:`Use this field as the client-selector gate. It shows as the top 'Select Client' picker and is hidden from the form body (no duplicate client card).`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Client Gate`,unCheckedChildren:`Client Gate`})}),(0,l.jsx)(s.Form.Item,{...o,name:[r,`infoEnabled`],valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,tooltip:`Show an info icon next to this field label in add/edit forms.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Info`,unCheckedChildren:`Info`})})]}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:8},children:({getFieldValue:e})=>e([...x,`addRow`])?(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:`Repeat Field Options`}),(0,l.jsxs)(`div`,{className:`fg-options-controls`,style:{flexWrap:`wrap`},children:[(0,l.jsx)(s.Form.Item,{name:[r,`minRows`],label:`Min Values`,style:{marginBottom:0},tooltip:`Minimum values the user must keep. Delete is disabled at this count.`,children:(0,l.jsx)(s.Input,{size:`small`,type:`number`,min:0,placeholder:`0`,style:{width:90}})}),(0,l.jsx)(s.Form.Item,{name:[r,`initialRows`],label:`Initial Values`,style:{marginBottom:0},tooltip:`How many empty inputs to show on a fresh Add (0 = show only the + button).`,children:(0,l.jsx)(s.Input,{size:`small`,type:`number`,min:0,placeholder:`1`,style:{width:90}})}),(0,l.jsx)(s.Form.Item,{name:[r,`maxRows`],label:`Max Values`,style:{marginBottom:0},tooltip:`Maximum values allowed. The + button hides at this count. Blank = unlimited.`,children:(0,l.jsx)(s.Input,{size:`small`,type:`number`,min:0,placeholder:`∞`,style:{width:90}})}),(0,l.jsx)(s.Form.Item,{name:[r,`addLabel`],label:`Add Button Label`,style:{marginBottom:0},tooltip:`Custom text for the add button. Defaults to 'Add <label>'.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. Add Skill`,style:{width:170}})})]}),(0,l.jsxs)(`div`,{className:`fg-subfields-block`,style:{marginTop:10},children:[(0,l.jsxs)(`span`,{className:`fg-options-label`,children:[`Sub-fields (repeat a group together)`,(0,l.jsx)(`span`,{className:`fg-field-key-hint`,style:{marginLeft:6},children:`leave empty to repeat a single value`})]}),(0,l.jsx)(s.Form.List,{name:[r,`subFields`],children:(t,{add:n,remove:r})=>(0,l.jsxs)(`div`,{children:[t.map(({key:t,name:n,...i})=>(0,l.jsxs)(`div`,{className:`fg-subfield-row`,style:{marginBottom:10},children:[(0,l.jsxs)(`div`,{className:`fg-inline-row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,l.jsx)(s.Form.Item,{...i,name:[n,`field`],label:`Key`,rules:[{required:!0,message:`Key`},{pattern:/^[a-zA-Z0-9_]+$/,message:`a-z 0-9 _`}],style:{marginBottom:0},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. question`,style:{width:140},className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{...i,name:[n,`label`],label:`Label`,rules:[{required:!0,message:`Label`}],style:{marginBottom:0},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. Question`,style:{width:150}})}),(0,l.jsx)(s.Form.Item,{...i,name:[n,`type`],label:`Type`,initialValue:`text`,style:{marginBottom:0},children:(0,l.jsx)(s.Select,{size:`small`,options:iS,style:{width:130}})}),(0,l.jsx)(s.Form.Item,{...i,name:[n,`req`],label:`Required`,valuePropName:`checked`,initialValue:!1,style:{marginBottom:0},children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Yes`,unCheckedChildren:`No`})}),(0,l.jsx)(s.Form.Item,{...i,name:[n,`col`],label:`Width`,tooltip:`Grid span: 12 = half row, 24 = full row. Blank = 12.`,style:{marginBottom:0},children:(0,l.jsx)(s.Input,{size:`small`,type:`number`,placeholder:`12`,style:{width:70}})}),(0,l.jsx)(s.Tooltip,{title:`Remove sub-field`,children:(0,l.jsx)(`button`,{type:`button`,className:`fg-field-remove-btn`,onClick:()=>r(n),"aria-label":`Remove sub-field`,children:(0,l.jsx)(c.MinusCircleOutlined,{})})})]}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:0},children:()=>{let t=e([...x,`subFields`,n,`type`]);if(![`select`,`radio`,`checkbox`].includes(t))return null;let r=e([...x,`subFields`,n,`dataSource`])??`static`;return(0,l.jsxs)(`div`,{className:`fg-options-block`,style:{marginTop:6},children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:`Options / Values`}),(0,l.jsxs)(`div`,{className:`fg-options-controls`,children:[(0,l.jsx)(s.Form.Item,{name:[n,`dataSource`],label:`Source`,style:{marginBottom:0},initialValue:`static`,children:(0,l.jsx)(s.Select,{size:`small`,style:{width:190},options:dS})}),t===`select`&&(0,l.jsx)(s.Form.Item,{name:[n,`multiSelect`],label:`Multi Select`,valuePropName:`checked`,style:{marginBottom:0},initialValue:!1,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Multi`,unCheckedChildren:`Single`})}),r===`master`&&(0,l.jsx)(s.Form.Item,{name:[n,`masterName`],label:`Master Name`,style:{marginBottom:0},rules:[{required:!0,message:`Enter master name`}],children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. tracker`,style:{width:140}})}),r===`group`&&(0,l.jsx)(s.Form.Item,{name:[n,`groupName`],label:`Group Name`,style:{marginBottom:0},rules:[{required:!0,message:`Enter group name`}],children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. users`,style:{width:140}})})]}),r===`static`&&(0,l.jsxs)(`div`,{className:`fg-static-options`,children:[(0,l.jsx)(`span`,{className:`fg-static-options-hint`,children:`Label / Value pairs`}),(0,l.jsx)(s.Form.List,{name:[n,`options`],children:(e,{add:t,remove:n})=>(0,l.jsxs)(l.Fragment,{children:[e.map(({key:e,name:t})=>(0,l.jsxs)(`div`,{className:`fg-option-row`,children:[(0,l.jsx)(s.Form.Item,{name:[t,`label`],style:{marginBottom:0,flex:1},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Label`})}),(0,l.jsx)(s.Form.Item,{name:[t,`value`],style:{marginBottom:0,flex:1},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Value`,className:`fg-mono-input`})}),(0,l.jsx)(c.MinusCircleOutlined,{onClick:()=>n(t),className:`fg-remove-icon`})]},e)),(0,l.jsx)(s.Button,{size:`small`,type:`dashed`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>t({label:``,value:``}),className:`fg-add-option-btn`,children:`Add Option`})]})})]}),r===`group`&&(0,l.jsx)(`p`,{className:`fg-source-hint`,children:`Use "users" to load all users from the MongoDB-backed user collection.`}),r===`lookup`&&(0,l.jsxs)(`div`,{className:`fg-lookup-block`,children:[(0,l.jsx)(`p`,{className:`fg-source-hint`,style:{marginBottom:8},children:`Cross-collection lookup — shows label, stores FK value.`}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,children:[(0,l.jsx)(s.Form.Item,{name:[n,`lookupCollection`],label:`Collection`,style:{marginBottom:0,flex:1},rules:[{required:!0,message:`Required`}],children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. vendors`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[n,`displayField`],label:`Display Field`,style:{marginBottom:0,flex:1},rules:[{required:!0,message:`Required`}],children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. vendorContact.firstName`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[n,`displayField2`],label:`Display Field 2`,style:{marginBottom:0,flex:1},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. vendorContact.lastName`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[n,`valueField`],label:`Value Field (FK)`,style:{marginBottom:0,flex:1},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`_id`,className:`fg-mono-input`})})]}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{marginTop:8},children:[(0,l.jsx)(s.Form.Item,{name:[n,`lookupFilterField`],label:`Filter Field`,style:{marginBottom:0,flex:1},tooltip:`Optional DB field to filter lookup rows by. Example: _id or clientId.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. _id`,className:`fg-mono-input`})}),(0,l.jsx)(s.Form.Item,{name:[n,`lookupFilterValueFrom`],label:`Filter Value From`,style:{marginBottom:0,flex:1},tooltip:`Optional form/scope field that provides the filter value. Example: clientId.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. clientId`,className:`fg-mono-input`})})]})]})]})}})]},t)),(0,l.jsx)(s.Button,{type:`dashed`,size:`small`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>n({type:`text`,req:!1}),children:`Add Sub-field`})]})})]})]}):null}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{marginTop:8},children:[(0,l.jsx)(s.Form.Item,{name:[r,`placeholder`],label:`Placeholder`,style:{marginBottom:0,flex:1},children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`Admin-controlled placeholder`})}),(0,l.jsx)(s.Form.Item,{name:[r,`hidePlaceholder`],label:`Hide Placeholder`,valuePropName:`checked`,style:{marginBottom:0},children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Hidden`,unCheckedChildren:`Shown`})})]}),(0,l.jsxs)(`div`,{className:`fg-field-meta-row`,style:{marginTop:8},children:[(0,l.jsx)(s.Form.Item,{name:[r,`visiblePermission`],label:`Visible permission key`,style:{marginBottom:0,flex:1},tooltip:`Menu-permission key ('<module>.<key>', e.g. submission.viewRate) gating whether this field is rendered at all. Leave blank to show to everyone (subject to the Show toggle above). Add matching keys in Admin → Permissions.`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. submission.viewRate`})}),(0,l.jsx)(s.Form.Item,{name:[r,`editablePermission`],label:`Editable permission key`,style:{marginBottom:0,flex:1},tooltip:`Menu-permission key gating whether this field can be edited. Users without it see the field disabled with a tooltip. Leave blank to allow everyone (subject to the Edit toggle above).`,children:(0,l.jsx)(s.Input,{size:`small`,placeholder:`e.g. submission.editRate`})})]}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:8},children:({getFieldValue:e})=>e([...x,`clientScope`])?(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsx)(`span`,{className:`fg-options-label`,children:`Client Gate Message`}),(0,l.jsx)(s.Form.Item,{name:[r,`clientGateMessage`],style:{marginBottom:0},children:(0,l.jsx)(s.Input.TextArea,{rows:2,placeholder:`Message shown below 'Select Client' in the add form (leave blank for default)`})}),(0,l.jsx)(s.Form.Item,{name:[r,`clientGateResetOnChange`],valuePropName:`checked`,style:{margin:`10px 0 0`},tooltip:`When the selected client changes or is cleared, remove every value already entered in the form before loading the new client configuration.`,children:(0,l.jsx)(s.Switch,{size:`small`,checkedChildren:`Reset form on client change`,unCheckedChildren:`Keep form values`})})]}):null}),(0,l.jsxs)(`div`,{className:`fg-options-block`,children:[(0,l.jsxs)(`span`,{className:`fg-options-label`,children:[(0,l.jsx)(c.InfoCircleOutlined,{}),` Help Text`]}),(0,l.jsx)(s.Form.Item,{...o,name:[r,`tooltip`],label:`Tooltip`,style:{marginBottom:8},tooltip:`Hover help for this field. Works on every control — including fields rendered without a label, where the info icon below cannot appear. Use this one unless you specifically need the icon.`,children:(0,l.jsx)(s.Input.TextArea,{rows:2,placeholder:`Shown when users hover this field`})}),(0,l.jsx)(s.Form.Item,{shouldUpdate:!0,style:{marginBottom:0},children:({getFieldValue:e})=>e([...x,`infoEnabled`])?(0,l.jsx)(s.Form.Item,{name:[r,`infoText`],label:`Info icon text`,style:{marginBottom:0},rules:[{required:!0,message:`Enter info message`}],tooltip:`Legacy pair (Info switch above + this text). Renders an icon inside the field label, so it never shows on a label-less field. Ignored when a Tooltip is set.`,children:(0,l.jsx)(s.Input.TextArea,{rows:2,placeholder:`Message shown when users hover the info icon`})}):null})]}),(0,l.jsx)(s.Form.Item,{...o,name:[r,`helpText`],label:`Extra Text`,tooltip:`Small grey text under the field. Put EACH LINE on its own line — they render stacked. Use one line for the rule ("Supports .pdf, .doc, .docx up to 2MB") and another for the reason ("Upload the résumé first — we can read the details out of it"). Run together in one paragraph, the second half gets skipped.`,children:(0,l.jsx)(s.Input.TextArea,{rows:3,placeholder:`Supports: .pdf, .doc, .docx up to 2MB
@@ -9,5 +9,5 @@ Upload the résumé first — we can read the details straight from it`})}),(0,l
9
9
  `).replace(/<[^>]+>/g,` `),t=t.replace(/&nbsp;/gi,` `).replace(/&amp;/gi,`&`).replace(/&lt;/gi,`<`).replace(/&gt;/gi,`>`).replace(/&#39;|&apos;/gi,`'`).replace(/&quot;/gi,`"`),t.replace(/[ \t\f\v]+/g,` `).replace(/\n{2,}/g,`
10
10
  `).trim()}function AE(e){return e.replace(/•/g,`
11
11
  `).split(/\n+/).map(e=>e.trim().replace(/^[-–—•]\s*/,``).trim()).filter(Boolean)}function jE(e){return AE(e.replace(/(?:^|\s)[-–—]\s+/g,`
12
- `))}function ME(e){let t=e.match(/^([A-Za-z][A-Za-z&/ ]{1,28}?)\s*:\s*(\S.+)$/);if(!t)return null;let n=t[1].trim(),r=t[2].trim();return n.split(/\s+/).length>3||r.length>60?null:{fieldKey:n.toLowerCase().replace(/\s+/g,`-`),fieldLabel:DE(n),value:r}}function NE(e){let t=e.toLowerCase().replace(/[\s:.\-–—]+$/,``).trim();return CE.has(t)?wE.test(t)?`education`:TE.test(t)?`keySkills`:`overview`:null}function PE(e){let t=[],n={overview:[],keySkills:[],education:[]},r=`overview`;return e.forEach(e=>{let i=NE(e);if(i){r=i;return}if(r===`overview`){let n=ME(e);if(n){t.push(n);return}}n[r].push(e)}),{meta:t,overview:OE(n.overview),keySkills:OE(n.keySkills),education:OE(n.education)}}function FE(e){let t=[...SE].sort((e,t)=>t.length-e.length),n=RegExp(`\\b(${t.map(EE).join(`|`)})\\b\\s*:?`,`gi`),r=[...e.matchAll(n)];if(!r.length)return{meta:[],overview:OE(jE(e)),keySkills:[],education:[]};let i={overview:[],keySkills:[],education:[]},a=e.slice(0,r[0].index).trim();return a&&i.overview.push(...jE(a)),r.forEach((t,n)=>{let a=t[1].trim().toLowerCase(),o=t.index+t[0].length,s=n+1<r.length?r[n+1].index:e.length,c=jE(e.slice(o,s).trim());if(!c.length)return;let l=wE.test(a)?`education`:TE.test(a)?`keySkills`:`overview`;i[l].push(...c)}),{meta:[],overview:OE(i.overview),keySkills:OE(i.keySkills),education:OE(i.education)}}function IE(e){let t=kE(e);if(!t)return{meta:[],overview:[],keySkills:[],education:[]};let n=AE(t);return n.length>=4?PE(n):FE(t)}function LE({items:e}){return(0,l.jsx)(`ul`,{className:`jdv-ats-bullets`,children:e.map((e,t)=>(0,l.jsx)(`li`,{className:`jdv-ats-bullet-item`,children:e},t))})}function RE({raw:e=``,meta:t=[]}){let[n,r]=(0,o.useState)(!1),i=(0,o.useMemo)(()=>IE(e),[e]),a=t.length?t:i.meta,s=[];if(i.overview.length&&s.push({key:`overview`,title:`Overview`,items:i.overview}),i.keySkills.length&&s.push({key:`keySkills`,title:`Key Skills`,items:i.keySkills,card:!0,icon:`🛠️`}),i.education.length&&s.push({key:`education`,title:`Education`,items:i.education,card:!0,icon:`🎓`}),!a.length&&!s.length)return(0,l.jsx)(bE,{type:`secondary`,children:`No description available.`});let c=n?s:s.slice(0,xE),u=s.length-xE;return(0,l.jsxs)(`div`,{className:`jdv-ats-desc`,children:[a.length>0&&(0,l.jsx)(`div`,{className:`jdv-ats-meta-grid`,children:a.map(({fieldKey:e,fieldLabel:t,value:n})=>(0,l.jsxs)(`div`,{className:`jdv-ats-meta-row`,children:[(0,l.jsx)(`span`,{className:`jdv-ats-meta-key`,children:t}),(0,l.jsx)(`span`,{className:`jdv-ats-meta-val`,children:n})]},e??t))}),(0,l.jsx)(`div`,{className:`jdv-ats-sections`,children:c.map(e=>e.card?(0,l.jsxs)(`div`,{className:`education-block`,children:[(0,l.jsxs)(`div`,{className:`education-header`,children:[(0,l.jsx)(`span`,{children:e.icon}),(0,l.jsx)(`span`,{children:e.title})]}),(0,l.jsx)(`ul`,{className:`education-list`,children:e.items.map((e,t)=>(0,l.jsx)(`li`,{className:`education-list-item`,children:e},t))})]},e.key):(0,l.jsxs)(`div`,{className:`jdv-ats-section`,children:[(0,l.jsx)(`div`,{className:`jdv-ats-section-hd`,children:(0,l.jsx)(`span`,{children:e.title})}),(0,l.jsx)(LE,{items:e.items})]},e.key))}),u>0&&(0,l.jsx)(`span`,{className:`jdv-desc-toggle`,onClick:()=>r(e=>!e),children:n?`Show less`:`Show more (${u} more section${u>1?`s`:``})`})]})}var{Text:zE}=s.Typography;function BE(e){return e?e.trim().split(/\s+/).slice(0,2).map(e=>e[0].toUpperCase()).join(``):`?`}function VE(e){return e?e.name?e.name:e.fullName?e.fullName:e.firstName||e.lastName?[e.firstName,e.lastName].filter(Boolean).join(` `):e.candidateName??e.clientName??e.jobTitle??``:``}function HE(e){return e?e.email??e.emailId??e.emailAddress??``:``}function UE(e){return e?e.status?e.status:e.stage?e.stage:typeof e.isActive==`boolean`?e.isActive?`Active`:`Inactive`:``:``}function WE(e){return e==null||e===``?`-`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.join(`, `):typeof e==`object`?e.label??e.name??Object.values(e).join(` `):String(e)}var GE=[`jobDescription`,`description`,`rawDescription`,`jobDescriptionText`];function KE(e){return String(e??``).toLowerCase()===`job`}function qE(e){let t=GE.includes(e.field),n=/description/i.test(e.label??``);return t||n}function JE({record:e}){let t=VE(e),n=HE(e),r=UE(e);return!t&&!n?null:(0,l.jsxs)(`div`,{className:`preview-profile-card`,children:[(0,l.jsxs)(`div`,{className:`preview-profile-card__info`,children:[(0,l.jsx)(s.Avatar,{className:`preview-profile-card__avatar`,children:BE(t)}),(0,l.jsxs)(`div`,{className:`preview-profile-card__text`,children:[t&&(0,l.jsx)(`span`,{className:`preview-profile-card__name`,children:t}),n&&(0,l.jsx)(`span`,{className:`preview-profile-card__email`,children:n})]})]}),r&&(0,l.jsx)(s.Tag,{className:`preview-profile-card__status`,children:r})]})}function YE({fields:e,moduleName:t,centralDocuments:r=[]}){let[i,a]=(0,o.useState)([]),[s,c]=(0,o.useState)(0),[u,d]=(0,o.useState)(!1);if(!e?.length)return null;function f(e){let t=String(e?.type??``).trim().toLowerCase(),n=`${e?.field??``} ${e?.label??``}`;return[`file`,`document`,`upload`].includes(t)||/resume|cv|document|attachment/i.test(n)}function p(e,t){a(e),c(t),d(!0)}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`preview-field-grid`,children:e.map(e=>{let i=e.value,a=Array.isArray(i)&&i.length>0,o=KE(t)&&qE(e)&&typeof i==`string`&&i.trim(),s=f(e)?r.filter(t=>{let n=String(t?.fieldName??t?.field??t?.formField??t?.key??``).trim().toLowerCase(),r=String(e?.field??``).trim().toLowerCase();if(n&&r&&n===r)return!0;let i=`${e?.field??``} ${e?.label??``}`;return/resume|cv/i.test(i)?/resume|cv/i.test(`${n} ${t?.fileName??``} ${t?.name??``}`):!1}).map(t=>({name:t?.fileName||t?.name||t?.uploadedFileName||t?.originalName||e?.label||`Document`,url:t?.fileUrl||t?.downloadUrl||t?.signedUrl||t?.url||``,type:t?.mimeType||t?.contentType||t?.type})).filter(e=>e.url):[],c=f(e)?s.length?s:n.Lt(i).filter(e=>e.url):[];return c.length?(0,l.jsxs)(`div`,{className:`preview-field-card preview-field-card--documents`,children:[(0,l.jsx)(`span`,{className:`preview-field-card__label`,children:e.label}),(0,l.jsx)(`div`,{className:`preview-document-list`,children:c.map((e,t)=>(0,l.jsxs)(`button`,{type:`button`,className:`preview-document-link`,onClick:()=>p(c,t),title:`Preview ${e.name||`document`}`,children:[(0,l.jsx)(`span`,{className:`preview-document-link__icon`,"aria-hidden":`true`,children:`▣`}),(0,l.jsx)(`span`,{className:`preview-document-link__name`,children:e.name||`Document ${t+1}`}),(0,l.jsx)(`span`,{className:`preview-document-link__action`,children:`Preview`})]},`${e.url}-${t}`))})]},e.field??e.label):a?i.map((t,n)=>(0,l.jsxs)(`div`,{className:`preview-field-card`,children:[(0,l.jsxs)(`span`,{className:`preview-field-card__label`,children:[e.label,i.length>1?` (${n+1})`:``]}),(0,l.jsx)(`span`,{className:`preview-field-card__value`,children:WE(t)})]},`${e.field??e.label}-${n}`)):o?(0,l.jsxs)(`div`,{className:`preview-field-card preview-field-card--description`,children:[(0,l.jsx)(`span`,{className:`preview-field-card__label`,children:e.label}),(0,l.jsx)(`div`,{className:`preview-field-card__description`,children:(0,l.jsx)(RE,{raw:i})})]},e.field??e.label):(0,l.jsxs)(`div`,{className:`preview-field-card`,children:[(0,l.jsx)(`span`,{className:`preview-field-card__label`,children:e.label}),(0,l.jsx)(`span`,{className:`preview-field-card__value`,children:WE(i)})]},e.field??e.label)})}),(0,l.jsx)(n.Cn,{documents:i,open:u,onClose:()=>d(!1),initialIndex:s})]})}function XE(){let e=(0,d.useNavigate)(),{moduleName:t=``,record:r=null}=(0,d.useLocation)().state??{},i=r?.id??r?._id,[c,u]=(0,o.useState)([]),[f,p]=(0,o.useState)(!!(t&&i)),[m,h]=(0,o.useState)(null),[g,_]=(0,o.useState)([]),[v,y]=(0,o.useState)(0),b=(0,o.useRef)(null),x=(0,o.useRef)(null),S=(0,o.useRef)([]),C=(0,o.useRef)([]);(0,o.useEffect)(()=>{if(!t||!i)return;let e=!1;return Promise.all([a.r({module:t,id:i}),n.gn(t,i).catch(()=>({data:[]}))]).then(([t,n])=>{e||(u(Array.isArray(t)?t:[]),_(Array.isArray(n)?n:n?.data??[]),p(!1))}).catch(t=>{e||(h(t.message||`Failed to load preview`),_([]),p(!1))}),()=>{e=!0}},[t,i]);function w(){e(-1)}function T(e,t){return e?.label??e?.name??`Section ${t+1}`}function E(e){let t=b.current,n=C.current[e];if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=(t.querySelector(`.preview-stepper-wrap`)?.offsetHeight??0)+12,o=t.scrollTop+i.top-r.top-a;y(e),t.scrollTo({top:Math.max(0,o),behavior:`smooth`})}function D(){let e=b.current;if(!e||!C.current.length)return;let t=e.getBoundingClientRect().top+(e.querySelector(`.preview-stepper-wrap`)?.offsetHeight??0)+24,n=0;C.current.forEach((e,r)=>{e&&e.getBoundingClientRect().top<=t&&(n=r)}),y(e=>e===n?e:n)}(0,o.useEffect)(()=>{let e=x.current,t=S.current[v];if(!e||!t)return;let n=t.offsetLeft-(e.clientWidth-t.offsetWidth)/2,r=Math.max(0,e.scrollWidth-e.clientWidth);e.scrollTo({left:Math.min(Math.max(0,n),r),behavior:`smooth`})},[v,c.length]);function O(){return c.length?(0,l.jsx)(`div`,{ref:x,className:`preview-stepper-wrap`,"aria-label":`Preview sections`,children:(0,l.jsx)(`div`,{className:`preview-stepper`,children:c.map((e,t)=>(0,l.jsxs)(`div`,{className:`preview-stepper__segment`,children:[(0,l.jsxs)(`button`,{type:`button`,className:`preview-stepper__item`,ref:e=>{S.current[t]=e},onClick:()=>E(t),"aria-current":v===t?`step`:void 0,title:`Go to ${T(e,t)}`,children:[(0,l.jsx)(`span`,{className:[`preview-stepper__circle`,t<v?`preview-stepper__circle--done`:``,t===v?`preview-stepper__circle--active`:``].filter(Boolean).join(` `),children:t+1}),(0,l.jsx)(`span`,{className:[`preview-stepper__label`,t===v?`preview-stepper__label--active`:``].filter(Boolean).join(` `),children:T(e,t)})]}),t<c.length-1&&(0,l.jsx)(`span`,{className:[`preview-stepper__line`,t<v?`preview-stepper__line--done`:``].filter(Boolean).join(` `),"aria-hidden":`true`})]},e.name??e.id??t))})}):null}let k=(0,l.jsxs)(`div`,{className:`preview-modal-header`,children:[(0,l.jsx)(`span`,{className:`preview-modal-module`,children:t.toUpperCase()}),(0,l.jsx)(`span`,{className:`preview-modal-title`,children:t?` Details`:`Preview`})]}),A=(0,l.jsx)(`div`,{className:`wizard-footer preview-scroll-footer`,children:(0,l.jsx)(`div`,{className:`wizard-footer-nav`,children:(0,l.jsx)(s.Button,{onClick:w,children:`Close`})})});function j(){return!t||!i?(0,l.jsx)(`div`,{className:`job-preview-content job-preview-status`,children:`Preview id is missing.`}):f?(0,l.jsx)(`div`,{className:`job-preview-content job-preview-status`,children:(0,l.jsx)(s.Spin,{size:`small`})}):m?(0,l.jsx)(`div`,{className:`job-preview-content job-preview-status job-preview-error`,children:m}):c.length?(0,l.jsx)(`div`,{className:`preview-section-list`,children:c.map((e,n)=>(0,l.jsxs)(`section`,{ref:e=>{C.current[n]=e},className:`preview-section-card`,"data-section-index":n,children:[(0,l.jsxs)(`div`,{className:`preview-section-card__header`,children:[(0,l.jsx)(`span`,{className:`preview-section-card__number`,children:n+1}),(0,l.jsx)(`span`,{className:`preview-section-card__title`,children:T(e,n)})]}),(0,l.jsx)(`div`,{className:`preview-section-card__body`,children:e.fields?.length>0?(0,l.jsx)(YE,{fields:e.fields,moduleName:t,centralDocuments:g}):(0,l.jsx)(zE,{type:`secondary`,children:`No fields in this group.`})})]},e.name??e.id??n))}):(0,l.jsx)(`div`,{className:`job-preview-content job-preview-status`,children:`No form groups found.`})}return(0,l.jsx)(s.Modal,{centered:!0,className:`wizard-modal preview-modal preview-scroll-modal`,footer:A,open:!0,title:k,width:`min(900px, calc(100vw - 32px))`,onCancel:w,maskClosable:!1,children:(0,l.jsxs)(`div`,{ref:b,className:`wizard-body preview-scroll-body`,onScroll:D,children:[!f&&!m&&c.length>0&&O(),r&&(0,l.jsx)(JE,{record:r}),j()]})})}var{Text:ZE}=s.Typography,{TextArea:QE}=s.Input,$E=[{key:`basic`,title:`Basic Info`,description:`General details`,fields:[{name:`firstName`,label:`First Name`,type:`input`,required:!0,placeholder:`Enter first name`,span:12},{name:`lastName`,label:`Last Name`,type:`input`,required:!0,placeholder:`Enter last name`,span:12},{name:`email`,label:`Email Address`,type:`input`,required:!0,placeholder:`Enter email address`,rules:[{type:`email`,message:`Please enter a valid email`}]},{name:`phone`,label:`Phone`,type:`input`,placeholder:`Enter phone number`}]},{key:`details`,title:`Details`,description:`Additional info`,fields:[{name:`role`,label:`Role`,type:`select`,required:!0,placeholder:`Select a role`,span:12,options:[{label:`Developer`,value:`developer`},{label:`Designer`,value:`designer`},{label:`Manager`,value:`manager`},{label:`Analyst`,value:`analyst`}]},{name:`department`,label:`Department`,type:`select`,placeholder:`Select department`,span:12,options:[{label:`Engineering`,value:`engineering`},{label:`Product`,value:`product`},{label:`Operations`,value:`operations`},{label:`Finance`,value:`finance`}]},{name:`notes`,label:`Notes`,type:`textarea`,placeholder:`Any additional notes...`}]},{key:`confirm`,title:`Confirm`,description:`Review & submit`,isReview:!0}];function eD(e){switch(e.type){case`select`:return(0,l.jsx)(s.Select,{placeholder:e.placeholder,options:e.options,style:{width:`100%`}});case`textarea`:return(0,l.jsx)(QE,{rows:3,placeholder:e.placeholder});case`number`:return(0,l.jsx)(s.InputNumber,{placeholder:e.placeholder,style:{width:`100%`}});default:return(0,l.jsx)(s.Input,{type:e.inputType||`text`,placeholder:e.placeholder})}}function tD({steps:e,form:t}){let n=t.getFieldsValue(),r=e.filter(e=>!e.isReview);return r.some(e=>(e.fields||[]).some(e=>n[e.name]!==void 0&&n[e.name]!==``))?(0,l.jsxs)(`div`,{className:`wizard-review-content`,children:[r.map(e=>(0,l.jsxs)(`div`,{className:`wizard-review-section`,children:[(0,l.jsx)(ZE,{className:`wizard-review-section-title`,children:e.title}),(0,l.jsx)(`div`,{className:`wizard-review-grid`,children:(e.fields||[]).map(e=>{let t=n[e.name],r=t===void 0||t===``||t===null?`—`:String(t);return(0,l.jsxs)(`div`,{className:`wizard-review-row`,children:[(0,l.jsx)(`span`,{className:`wizard-review-label`,children:e.label}),(0,l.jsx)(`span`,{className:`wizard-review-separator`,children:`:`}),(0,l.jsx)(`span`,{className:`wizard-review-value`,children:r})]},e.name)})})]},e.key)),(0,l.jsxs)(`div`,{className:`wizard-review-confirm-note`,children:[(0,l.jsx)(c.CheckCircleOutlined,{className:`wizard-review-confirm-icon`}),(0,l.jsx)(ZE,{type:`secondary`,children:`Please review the information above before submitting.`})]})]}):(0,l.jsx)(`div`,{className:`wizard-review-empty`,children:(0,l.jsx)(ZE,{type:`secondary`,children:`No data entered yet.`})})}function nD(){let[e]=s.Form.useForm(),t=(0,d.useNavigate)(),{title:n=`Wizard`,moduleName:r=``,steps:i=$E,onSubmit:a}=(0,d.useLocation)().state??{},[c,u]=(0,o.useState)(0),f=i[c],p=c===i.length-1,m=c===0;function h(){t(-1)}function g(){let t=(f.fields||[]).map(e=>e.name);e.validateFields(t.length>0?t:void 0).then(()=>{u(e=>e+1)})}function _(){u(e=>e-1)}function v(){let n=e.getFieldsValue();typeof a==`function`&&a(n),t(-1)}let y=i.map((e,t)=>({title:e.title,description:e.description,status:t<c?`finish`:t===c?`process`:`wait`})),b=r?`${n} — ${r}`:n;return(0,l.jsxs)(s.Modal,{open:!0,title:b,footer:(0,l.jsxs)(`div`,{className:`wizard-footer`,children:[(0,l.jsx)(s.Button,{onClick:h,children:`Cancel`}),(0,l.jsxs)(`div`,{className:`wizard-footer-nav`,children:[!m&&(0,l.jsx)(s.Button,{onClick:_,children:`Back`}),p?(0,l.jsx)(s.Button,{type:`primary`,onClick:v,children:`Submit`}):(0,l.jsx)(s.Button,{type:`primary`,onClick:g,children:`Next`})]})]}),onCancel:h,width:`min(680px, calc(100vw - 32px))`,centered:!0,className:`wizard-modal`,children:[(0,l.jsx)(`div`,{className:`wizard-steps-container`,children:(0,l.jsx)(s.Steps,{current:c,items:y,size:`small`,className:`wizard-steps`})}),(0,l.jsx)(`div`,{className:`wizard-body`,children:(0,l.jsxs)(s.Form,{form:e,layout:`vertical`,children:[i.filter(e=>!e.isReview).map((e,t)=>(0,l.jsx)(`div`,{style:{display:t===c?`block`:`none`},children:(0,l.jsx)(s.Row,{gutter:16,children:(e.fields||[]).map(e=>(0,l.jsx)(s.Col,{span:e.span||24,children:(0,l.jsx)(s.Form.Item,{name:e.name,label:e.label,rules:[...e.required?[{required:!0,message:`${e.label} is required`}]:[],...e.rules||[]],children:eD(e)})},e.name))})},e.key)),f.isReview&&(0,l.jsx)(tD,{steps:i,form:e})]})})]})}function rD({titleText:e,titleIcon:t}){let n=t===`delete`;return(0,l.jsxs)(`span`,{className:`dynamic-popup__header`,children:[(0,l.jsx)(`span`,{className:`dynamic-popup__header-icon-box${n?` dynamic-popup__header-icon-box--danger`:``}`,children:n?(0,l.jsx)(c.DeleteOutlined,{}):(0,l.jsx)(c.AppstoreOutlined,{})}),(0,l.jsx)(`span`,{className:`dynamic-popup__header-label`,children:e})]})}function iD({note:e,description:t,showSelectedCount:r,count:i,itemLabel:a,bodyText:o,deleteError:s}){return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(n.Tn,{variant:`body`,color:`secondary`,className:`dynamic-popup__note`,children:e}),t&&(0,l.jsx)(n.Tn,{variant:`body`,className:`dynamic-popup__description`,children:t}),r&&i>0&&(0,l.jsxs)(n.Tn,{variant:`body`,className:`dynamic-popup__selected-count`,children:[`Changing status for `,(0,l.jsx)(`strong`,{children:i}),` selected `,a,`.`]}),o&&(0,l.jsx)(n.Tn,{variant:`body`,children:o}),s&&(0,l.jsx)(n.Tn,{variant:`caption`,color:`danger`,className:`dynamic-popup__error`,children:s})]})}function aD({footerNote:e}){return e?(0,l.jsx)(n.Tn,{variant:`caption`,color:`secondary`,className:`dynamic-popup__footer-note`,children:e}):null}function oD(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>t?.[n]??``).trim()}function sD(e){return String(e).replace(/\(\s*\)/g,``).replace(/\s+/g,` `).replace(/(^|\s)([-–—·|])(?=\s*\2)/g,``).replace(/^[\s\-–—·|]+/,``).replace(/[\s\-–—·|]+$/,``).trim()}function cD(e){if(!e)return!1;let t=new Date(e).getTime();return Number.isNaN(t)||t<=0?!1:t<=Date.now()+864e5}function lD(e){if(!cD(e))return``;let t=new Date(e),n=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date,i=Math.round((n(r)-n(t))/864e5);if(i<=0)return`Today`;if(i===1)return`Yesterday`;if(i<=30)return`${i} days ago`;let a=(r.getFullYear()-t.getFullYear())*12+(r.getMonth()-t.getMonth());if(r.getDate()<t.getDate()&&--a,a=Math.max(1,a),a<12)return`${a} month${a===1?``:`s`} ago`;let o=Math.floor(a/12);return`${o} year${o===1?``:`s`} ago`}function uD(e){let t=Array.isArray(e?.submissionHistory)?e.submissionHistory:[],n=[e?.lastSubmittedAt,e?.submittedAt,e?.updatedAt,...t.map(e=>e?.submittedAt||e?.updatedAt)].filter(Boolean);return n.length?n.reduce((e,t)=>new Date(t)>new Date(e)?t:e):null}function dD(e){let t=Array.isArray(e?.submissionHistory)?e.submissionHistory:[],n=[e?.lastSubmittedAt,e?.submittedAt,...t.map(e=>e?.submittedAt)].filter(Boolean);return n.length?n.reduce((e,t)=>new Date(t)>new Date(e)?t:e):null}function fD(e,t){if(typeof e==`string`)return{label:e,value:e};if(e?.label!==void 0&&e?.value!==void 0&&!t?.labelTemplate&&!t?.valueKey)return e;let{labelKey:n,valueKey:r,labelTemplate:i}=t??{},a=i?.includes(`{lastdate}`)?{...e,lastdate:lD(uD(e))}:e,o=(i?sD(oD(i,a)):null)||(n?e?.[n]:null)||e?.name||e?.fullName||e?.candidateName||e?.title||e?.displayName||e?.text||e?.applicantReferenceId||e?.applicantRefrenceId||String(Object.values(e||{})[0]??``),s=(r?e?.[r]:null)??e?.id??e?._id??e?.applicantReferenceId??e?.applicantRefrenceId??String(Object.values(e||{})[0]??``),c=e?.disabled===!0||e?.disable===!0,l=String(e?.optionNote??``).trim(),u={label:l?`${String(o)} — ${l}`:String(o),value:String(s),_raw:e};if(c&&(u.disabled=!0),l&&(u.title=l),e?.isSubmitted===!0||e?.alreadySubmitted===!0){u.alreadySubmitted=!0,u.existingSubmissionId=String(e?.existingSubmissionId??e?.jobSubmissionId??e?.submissionId??``);let t=e?.submittedAt||dD(e);t&&(u.submittedAt=t)}if(e?.isFromSubmission===!0&&e?.submissionId){u.isFromSubmission=!0,u.priorSubmissionId=String(e.submissionId);let t=e?.lastSubmittedAt||dD(e);t&&(u.priorSubmittedAt=t)}return u}function pD(e,t){return(t?.[e.optionsKey]??e.defaultOptions??[]).map(t=>fD(t,e))}function mD(e={}){return{selectedIds:[],selectedRecords:[],moduleName:``,removedIds:[],...e}}var hD=`DD MMM YYYY`,gD=`DD MMM YYYY, h:mm A`;function _D(e,t){if(e==null||e===``)return``;let n=(0,u.default)(e);return n.isValid()?t===`relative`?lD(e)||(cD(e)?n.format(hD):`Not updated`):cD(e)?n.format(hD):``:String(e)}function vD(e,t){return e?String(e).includes(`{`)?sD(oD(e,t)):String(t?.[e]??e).trim():``}function yD(e){if(e?.alreadySubmitted){let t=e?.submittedAt?(0,u.default)(e.submittedAt):null;return{tone:`blocked`,tooltip:t?.isValid()?`Already submitted to this job on ${t.format(gD)}`:`Already submitted to this job — a candidate can only be submitted once per job`}}if(e?.isFromSubmission){let t=e?.priorSubmittedAt?(0,u.default)(e.priorSubmittedAt):null;return{tone:`history`,tooltip:t?.isValid()?`Previously submitted on ${t.format(gD)} — this form will prefill from it`:`Submitted to another job before — this form will prefill from it`}}return null}function bD(e,t){return e?.alreadySubmitted||!e?.disabled?``:String(t?.message??e?.title??``).trim()}function xD({meta:e}){return(0,l.jsx)(`div`,{className:`dynamic-popup__option-dates`,children:e.map(e=>(0,l.jsxs)(o.Fragment,{children:[(0,l.jsx)(`span`,{className:`dynamic-popup__option-date-label`,children:e.label}),(0,l.jsx)(`span`,{className:`dynamic-popup__option-date-value`,children:e.text})]},e.label))})}function SD({option:e,layout:t}){let n=e?._raw??e??{},r=vD(t.id,n),i=vD(t.title,n)||String(e?.label??``),a=vD(t.subtitle,n),o=vD(t.titleAccent?.key,n),u=vD(t.titleAccent?.toneKey,n),d=t.titleAccent?.prefix??``,f=(t.meta??[]).map(e=>({label:e.label,text:_D(n?.[e.key],e.type)})).filter(e=>e.text),p=bD(e,n),m=yD(e);return(0,l.jsxs)(`div`,{className:`dynamic-popup__option`,children:[(0,l.jsx)(`span`,{className:`dynamic-popup__option-tick${m?` dynamic-popup__option-tick--${m.tone}`:``}`,children:m&&(0,l.jsx)(s.Tooltip,{title:m.tooltip,placement:`topLeft`,children:(0,l.jsx)(c.CheckCircleFilled,{"aria-label":m.tooltip})})}),(0,l.jsxs)(`div`,{className:`dynamic-popup__option-main`,children:[(0,l.jsxs)(`div`,{className:`dynamic-popup__option-head`,children:[r&&(0,l.jsx)(`span`,{className:`dynamic-popup__option-id`,children:r}),(0,l.jsxs)(`span`,{className:`dynamic-popup__option-title`,children:[(0,l.jsx)(`span`,{className:`dynamic-popup__option-title-text`,children:i}),o&&(0,l.jsx)(`span`,{className:`dynamic-popup__option-title-accent${u?` dynamic-popup__option-title-accent--${u}`:``}`,children:`${d}${o}`})]}),p&&(0,l.jsx)(`span`,{className:`dynamic-popup__option-flag`,children:p})]}),a&&(0,l.jsx)(`div`,{className:`dynamic-popup__option-sub`,children:a})]}),e?.alreadySubmitted?(0,l.jsx)(`span`,{className:`dynamic-popup__option-onjob`,children:`On this job`}):f.length>0&&(0,l.jsx)(xD,{meta:f})]})}var{Text:CD}=s.Typography,{TextArea:wD}=s.Input,TD=[{label:`$`,value:`$`},{label:`EUR`,value:`EUR`},{label:`GBP`,value:`GBP`},{label:`INR`,value:`INR`}],ED=[{label:`Hourly`,value:`Hourly`},{label:`Daily`,value:`Daily`},{label:`Weekly`,value:`Weekly`},{label:`Monthly`,value:`Monthly`},{label:`Yearly`,value:`Yearly`}];function DD(e=[]){return e.map(e=>{if(!e||typeof e!=`object`)return e;let t=[e.value,e.user_id,e.userId,e.USER_ID,e.legacyUserId,e.id,e._id].find(e=>e!=null&&String(e).trim()!==``),n=t==null?``:String(t).trim();return{...e,value:n}}).filter(e=>typeof e!=`object`||!e||String(e.value??``).trim()!==``)}function OD({field:e,value:t,onChange:n}){return(0,l.jsx)(s.Input,{value:t,onChange:n,placeholder:e.placeholder,maxLength:e.maxLength,prefix:(0,l.jsx)(c.CrownOutlined,{})})}function kD({field:e,value:t,onChange:n}){return(0,l.jsx)(wD,{value:t,onChange:n,rows:e.rows??5,placeholder:e.placeholder})}function AD({field:e,options:t,value:n,onChange:r}){let i=DD(t);return(0,l.jsx)(s.Select,{showSearch:!0,value:n,onChange:r,options:i,placeholder:e.placeholder,className:`dynamic-popup__field-select`,optionFilterProp:`label`,prefix:(0,l.jsx)(c.CrownOutlined,{})})}function jD({field:e,options:t,value:n,onChange:r}){let i=DD(t);return(0,l.jsx)(s.Select,{mode:`multiple`,showSearch:!0,value:n,onChange:r,options:i,placeholder:e.placeholder,className:`dynamic-popup__field-select`,optionFilterProp:`label`,prefix:(0,l.jsx)(c.CrownOutlined,{})})}function MD({field:e,options:t,onSearch:n,value:r,onChange:i,popupContext:a}){let o=DD(t),u=e.optionLayout,d=new Map(o.map(e=>[String(e?.value??``),e]));async function f(t,n){let r=n??d.get(String(t??``));(typeof e.onSelectGuard!=`function`||await e.onSelectGuard({value:t,option:r,field:e,popupContext:a,confirm:s.Modal.confirm})!==!1)&&i?.(t)}return(0,l.jsx)(s.Select,{showSearch:!0,filterOption:!1,notFoundContent:e.notFoundContent??null,value:r,onChange:f,options:o,placeholder:e.placeholder,onSearch:n,className:`dynamic-popup__field-select${u?` dynamic-popup__field-select--rich`:``}`,popupClassName:u?`dynamic-popup__option-dropdown`:void 0,listHeight:u?340:void 0,optionLabelProp:`label`,optionRender:u?e=>(0,l.jsx)(SD,{option:e?.data??e,layout:u}):void 0,prefix:(0,l.jsx)(c.CrownOutlined,{})})}function ND({field:e,mentionOpts:t,onMentionSearch:n,value:r,onChange:i}){let a=Number(e.maxLength)>0?Number(e.maxLength):void 0,o=String(r??``).length;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Mentions,{value:r,onChange:i,rows:e.rows??5,placeholder:e.placeholder,prefix:`@`,options:t,onSearch:n,maxLength:a,className:`dynamic-popup__mention-textarea`}),a?(0,l.jsxs)(`div`,{className:`dynamic-popup__char-count`,style:{textAlign:`right`,fontSize:12,marginTop:4,color:o>a*.9?`#b45309`:`#8c8c8c`},children:[o,` / `,a]}):null]})}function PD({field:e={},value:t={},onChange:n}){let r=t.period??`Hourly`,i=t.isRange??!1;function a(e){n?.({...t,...e})}(0,o.useEffect)(()=>{let e={};t.currency??(e.currency=`$`),t.period??(e.period=`Hourly`),Object.keys(e).length&&n?.({...t,...e})},[]);let c=Number(i?t.maxAmount:t.amount),u=i&&t.minAmount!=null&&t.maxAmount!=null&&Number(t.maxAmount)<=Number(t.minAmount),d=e.rateCeiling!=null&&Number.isFinite(c)&&c>Number(e.rateCeiling);return(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(s.Space.Compact,{style:{width:`100%`},children:[i?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.InputNumber,{controls:!1,placeholder:`From`,value:t.minAmount,onChange:e=>a({minAmount:e}),style:{flex:1}}),(0,l.jsx)(s.InputNumber,{controls:!1,placeholder:`To`,value:t.maxAmount,onChange:e=>a({maxAmount:e}),style:{flex:1}})]}):(0,l.jsx)(s.InputNumber,{controls:!1,placeholder:`0`,value:t.amount,onChange:e=>a({amount:e}),style:{flex:2}}),(0,l.jsx)(s.Select,{value:t.currency??`$`,options:TD,onChange:e=>a({currency:e}),style:{width:80}}),(0,l.jsx)(s.Select,{value:r,options:ED,onChange:e=>a({period:e}),style:{width:110}})]}),(u||d)&&(0,l.jsxs)(`div`,{style:{marginTop:4},children:[u&&(0,l.jsx)(CD,{type:`danger`,style:{fontSize:12,display:`block`},children:`To rate must be greater than From rate.`}),d&&(0,l.jsxs)(CD,{type:`danger`,style:{fontSize:12,display:`block`},children:[`Rate must not exceed the client rate (`,e.rateCeiling,`).`]})]}),(0,l.jsxs)(s.Space,{size:`small`,style:{marginTop:8},children:[(0,l.jsx)(s.Switch,{checked:i,onChange:e=>a({isRange:e})}),(0,l.jsx)(`span`,{children:`Range`})]})]})}function FD({field:e,value:t,onChange:n}){return(0,l.jsx)(s.DatePicker,{value:t,onChange:n,placeholder:e.placeholder??`Select date`,style:{width:`100%`},format:`YYYY-MM-DD`})}function ID({field:e,checked:t,onChange:n}){return(0,l.jsx)(s.Checkbox,{checked:t,onChange:n,children:e.checkboxLabel})}function LD({field:e,value:t,onChange:n}){return(0,l.jsx)(s.InputNumber,{value:t,onChange:n,min:e.min,max:e.max,placeholder:e.placeholder,style:{width:`100%`}})}function RD({options:e,value:t,onChange:n}){return(0,l.jsx)(s.Radio.Group,{value:t,onChange:n,options:e})}var zD={input:OD,text:OD,textarea:kD,select:AD,"multi-select":jD,"search-select":MD,"mention-textarea":ND,"candidate-rate":PD,"priority-checkbox":ID,"date-picker":FD,number:LD,radio:RD};function BD(e){return e===`priority-checkbox`?{valuePropName:`checked`}:{}}var VD=new Set([`input`,`text`,`textarea`,`mention-textarea`]);function HD({form:e,fields:t,initialValues:r,dynamicOptions:i,popupContext:a,extraData:o,removedIds:c,setRemovedIds:u,showAlreadyAssigned:d,onValuesChange:f,getSearchHandler:p,getMentionSearchHandler:m,mentionOptions:h}){let g=(o?.recruitersData??[]).filter(e=>{let t=String(e?.user_id??e?.id??e?.userId??``);return t&&!c.includes(t)}),_=d&&o,v=new Set(d?g.map(e=>String(e?.user_id??e?.id??e?.userId??``).trim()).filter(Boolean):[]),y=e=>v.size===0||!Array.isArray(e)?e:e.filter(e=>!v.has(String((e&&typeof e==`object`?e.value??e.id:e)??``).trim()));return!t.length&&!_?null:(0,l.jsxs)(l.Fragment,{children:[_&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`dynamic-popup__already-assigned`,children:[(0,l.jsx)(n.Tn,{variant:`caption`,color:`secondary`,children:`Already Assigned People`}),(0,l.jsx)(`div`,{style:{marginTop:6,display:`flex`,flexWrap:`wrap`,gap:6},children:g.length===0?(0,l.jsx)(n.Tn,{variant:`caption`,color:`secondary`,children:`No one is currently assigned to this job.`}):g.map(e=>{let t=String(e?.user_id??e?.id??e?.userId??``),n=e?.name??e?.user_name??e?.userName??e?.email??`Assigned user`;return(0,l.jsx)(s.Tag,{closable:!0,onClose:()=>{t&&u(e=>Array.from(new Set([...e,t])))},children:n},t||n)})})]}),(0,l.jsx)(s.Divider,{style:{margin:`12px 0`}})]}),t.length>0&&(0,l.jsx)(s.Form,{form:e,layout:`vertical`,initialValues:r,onValuesChange:(e,t)=>f(t),children:UD(t).map(e=>WD(e,e=>{let t=y(i[e.name]??pD(e,a)),r=p(e),o=m(e),c=h[e.name]??[],u=BD(e.type),d=zD[e.type],f=[];return e.required&&f.push({required:!0,message:`${e.label||`This field`} is required`}),typeof e.validator==`function`&&f.push({validator:(t,n)=>{let r=e.validator(n,a);return r?Promise.reject(Error(r)):Promise.resolve()}}),VD.has(e.type)&&f.push(n.an({label:e.label,field:e.name,type:e.type})),(0,l.jsx)(s.Form.Item,{name:e.name,label:e.label,rules:f,...u,children:d?(0,l.jsx)(d,{field:e,options:t,onSearch:r,mentionOpts:c,onMentionSearch:o,popupContext:a}):null},e.name)}))})]})}function UD(e){let t=[];for(let n of e){let e=t[t.length-1];n.inlineRow&&e?.inlineRow===n.inlineRow?e.fields.push(n):t.push({inlineRow:n.inlineRow,fields:[n]})}return t.map(e=>e.fields)}function WD(e,t){return e.length===1?t(e[0]):(0,l.jsx)(`div`,{style:{display:`flex`,gap:8,alignItems:`flex-start`},children:e.map((e,n)=>(0,l.jsx)(`div`,{style:{flex:n===0?2:1,minWidth:0},children:t(e)},e.name))},`row-${e.map(e=>e.name).join(`-`)}`)}function GD(e){return[`select`,`multi-select`,`search-select`,`radio`].includes(e?.type)&&e?.dataSource===`master`&&e?.masterName}function KD(e){let t=e?.data??e;return Array.isArray(t)?t:Array.isArray(t?.data)?t.data:Array.isArray(t?.items)?t.items:Array.isArray(t?.rows)?t.rows:Array.isArray(t?.records)?t.records:[]}function qD(e){let t=String(e?.masterName??``).trim().toLowerCase();return t===`clientsubmissions`||t===`clientsubmissionstatus`}function JD(e){if(e==null)return null;if(typeof e==`string`){let t=e.trim();return t?{label:t,value:t,_raw:{name:t}}:null}let t=String(e?.name??e?.clientSubmissionStatusText??e?.label??e?.text??``).trim();if(!t)return null;let n=Number(e?.id??e?.uniqueId??e?.clientSubmissionStatusId??e?.value??0)||0;return{label:t,value:t,_raw:{...e,...n>0?{id:n,uniqueId:n}:{},name:t,type:String(e?.type??e?.clientSubmissionStatusType??``).trim(),isInitialStatus:e?.isInitialStatus===!0,isTerminalStatus:e?.isTerminalStatus===!0,allowedNextStatusIds:Array.isArray(e?.allowedNextStatusIds)?e.allowedNextStatusIds.map(Number).filter(e=>Number.isInteger(e)&&e>0):[]}}}function YD(e,t){return qD(t)?JD(e):fD(e,t)}function XD(e){let t=e?.clientSubmissionStatus,n=Number((t&&typeof t==`object`?t?.clientSubmissionStatusId??t?.id??t?.uniqueId:void 0)??e?.clientSubmissionStatusId??e?.clientStatusId??e?.[`clientSubmissionStatus.clientSubmissionStatusId`]??0)||0,r=t&&typeof t==`object`?t?.clientSubmissionStatusText??t?.name??t?.text??t?.label:t;return{id:n,text:String(r??e?.clientSubmissionStatusText??e?.clientStatus??e?.clientStatusText??e?.[`clientSubmissionStatus.clientSubmissionStatusText`]??``).trim()}}function ZD(e){let t=Number(e?.id??0)||0,n=String(e?.text??``).trim();return n&&n.toLowerCase()===`not submitted`?!0:t<=0&&!n}function QD(e){return Number(e?._raw?.id??e?._raw?.uniqueId??0)||0}function $D(e){let t=e?._raw?.allowedNextStatusIds;return Array.isArray(t)?t.map(Number).filter(e=>Number.isInteger(e)&&e>0):[]}function eO(e){let t=e?.data??e;return t?Array.isArray(t)?t[0]??null:t?.record&&typeof t.record==`object`?t.record:t?.data&&typeof t.data==`object`&&!Array.isArray(t.data)?t.data:typeof t==`object`?t:null:null}function tO(e){return(Array.isArray(e?.selectedRecords)?e.selectedRecords.filter(Boolean):[]).some(e=>!ZD(XD(e)))?!0:!ZD(XD(e??{}))}async function nO(e,n){if(tO(e))return e;let r=e?.selectedIds?.[0]??e?.selectedRecords?.[0]?._id??e?.selectedRecords?.[0]?.id;if(!r)return e;let i=String(e?.moduleName??`submissions`).trim()||`submissions`,a=new URLSearchParams({module:i,id:String(r)});n&&a.set(`app_id`,n);try{let r=eO(await t.o(t.x,`/module-data-detail?${a.toString()}`,{headers:n?{"X-App-Id":n}:void 0}));if(!r)return e;let i=Array.isArray(e?.selectedRecords)?e.selectedRecords:[];return{...e,selectedRecords:i.length?i.map((e,t)=>t===0?{...e,...r}:e):[r]}}catch(t){return console.warn(`[DynamicPopup] Could not load selected submission detail for client status transition:`,t),e}}function rO(e,t){if(!Array.isArray(e)||!e.length)return[];if(!e.some(e=>e?._raw?.isInitialStatus===!0||e?._raw?.isTerminalStatus===!0||Array.isArray(e?._raw?.allowedNextStatusIds)))return e;let n=Array.isArray(t?.selectedRecords)?t.selectedRecords.filter(Boolean):[],r={clientSubmissionStatus:t?.clientSubmissionStatus,clientSubmissionStatusId:t?.clientSubmissionStatusId,clientSubmissionStatusText:t?.clientSubmissionStatusText,clientStatus:t?.clientStatus,clientStatusId:t?.clientStatusId,clientStatusText:t?.clientStatusText,"clientSubmissionStatus.clientSubmissionStatusId":t?.[`clientSubmissionStatus.clientSubmissionStatusId`],"clientSubmissionStatus.clientSubmissionStatusText":t?.[`clientSubmissionStatus.clientSubmissionStatusText`]},i=n.length?n:[r];return e.filter(t=>i.every(n=>{let i=XD(n);if(ZD(i)){let e=XD(r);ZD(e)||(i=e)}if(ZD(i))return t?._raw?.isInitialStatus===!0;let a=e.find(e=>{let t=QD(e),n=String(e?.label??``).trim();return i.id>0&&t===i.id||i.text&&n.toLowerCase()===i.text.toLowerCase()});return!a||a?._raw?.isTerminalStatus===!0?!1:$D(a).includes(QD(t))}))}function iO({open:e,config:n,api:r,fields:i,popupContext:a,formValues:s}){let[c,l]=(0,o.useState)({}),[u,d]=(0,o.useState)(null);return(0,o.useEffect)(()=>{e||(l({}),d(null))},[e]),(0,o.useEffect)(()=>{if(!e||!n||!r.getOptions)return;let t=new AbortController;return i.forEach(e=>{!e.fetchOptionsKey||e.fetchOptionsParamKey||Promise.resolve(r.getOptions(e,void 0,a)).then(n=>{t.signal.aborted||l(t=>({...t,[e.name]:n}))}).catch(n=>{t.signal.aborted||console.error(`[DynamicPopup] Failed to load options for field "${e.name}":`,n)})}),()=>t.abort()},[e,r,n,i,a]),(0,o.useEffect)(()=>{if(!e||!n)return;let r=i.filter(GD);if(!r.length)return;let o=new AbortController;return r.forEach(e=>{let n=new URLSearchParams({masterName:e.masterName,offset:`0`,limit:String(e.limit??50)}),r=String(t.b??``).trim();r&&n.set(`app_id`,r),t.o(t.x,`/masters/dropdown?${n.toString()}`,{headers:r?{"X-App-Id":r}:void 0}).then(async t=>{if(o.signal.aborted)return;let n=KD(t).map(t=>YD(t,e)).filter(Boolean),i=a;if(qD(e)&&(i=await nO(a,r)),o.signal.aborted)return;let s=qD(e)?rO(n,i):n;l(t=>({...t,[e.name]:s}))}).catch(t=>{o.signal.aborted||console.error(`[DynamicPopup] Failed to load master options for field "${e.name}":`,t)})}),()=>o.abort()},[e,n,i,a]),(0,o.useEffect)(()=>{if(!e||!n||!r.getOptions)return;let t=i.filter(e=>e.fetchOptionsKey&&e.fetchOptionsParamKey);if(!t.length)return;let o=new AbortController;return t.forEach(e=>{let t=s[e.fetchOptionsParamKey]??a[e.fetchOptionsParamKey],n={[e.fetchOptionsParamKey]:t};Promise.resolve(r.getOptions(e,n,a)).then(t=>{o.signal.aborted||l(n=>({...n,[e.name]:t}))}).catch(t=>{o.signal.aborted||console.error(`[DynamicPopup] Failed to load param-dependent options for "${e.name}":`,t)})}),()=>o.abort()},[e,r,n,i,s,a]),(0,o.useEffect)(()=>{if(!e||!n||!r.loadExtraData)return;let t=new AbortController;return Promise.resolve(r.loadExtraData(a)).then(e=>{t.signal.aborted||d(e)}).catch(e=>{t.signal.aborted||(console.error(`[DynamicPopup] Failed to load extra data:`,e),d(null))}),()=>t.abort()},[e,r,n,a]),{dynamicOptions:c,setDynamicOptions:l,extraData:u}}var aO=500,oO=3;function sO({api:e,open:t,fields:n=[],popupContext:r,setDynamicOptions:i}){let[a,s]=(0,o.useState)({}),c=(0,o.useRef)({}),l=(0,o.useRef)({}),u=(0,o.useRef)({}),d=(0,o.useCallback)((t,n)=>{let a=e.searchOptions??e.searchFetcher;if(typeof a!=`function`)return;l.current[t.name]?.abort();let o=new AbortController;return l.current[t.name]=o,Promise.resolve(a(t,n,r)).then(e=>{if(o.signal.aborted)return;let n=Array.isArray(e)?e:e?.items??e?.list??[];i(e=>({...e,[t.name]:n.map(e=>fD(e,t))}))}).catch(e=>{o.signal.aborted||console.error(`[DynamicPopup] Search failed for field "${t.name}":`,e)}),o},[e,r,i]),f=n.filter(e=>(e.searchFetchKey||e.searchFetcher)&&e.preloadOptions!==!1),p=f.map(e=>e.name).join(`|`),m=(0,o.useRef)({runSearch:d,preloadFields:f});(0,o.useEffect)(()=>{m.current={runSearch:d,preloadFields:f}}),(0,o.useEffect)(()=>{if(!t||!p)return;let{runSearch:e,preloadFields:n}=m.current,r=n.map(t=>e(t,``)).filter(Boolean);return()=>r.forEach(e=>e.abort())},[t,p]);function h(t){if(!t.searchFetchKey&&!t.searchFetcher||typeof(e.searchOptions??e.searchFetcher)!=`function`)return;let n=t.searchMinLength??oO;return e=>{clearTimeout(c.current[t.name]);let r=e.length<n?``:e;c.current[t.name]=setTimeout(()=>{d(t,r)},aO)}}function g(t){let n=e.getMentionOptions??e.mentionFetcher;if(typeof n==`function`)return e=>{u.current[t.name]?.abort();let i=new AbortController;u.current[t.name]=i,Promise.resolve(n(t,e,r)).then(e=>{if(i.signal.aborted)return;let n=Array.isArray(e)?e:e?.items??e?.list??[];s(e=>({...e,[t.name]:n.map(e=>({value:e.user_name??e.userName??e.username??String(e),label:e.user_name??e.userName??e.username??String(e)}))}))}).catch(e=>{i.signal.aborted||console.error(`[DynamicPopup] Mention search failed for field "${t.name}":`,e)})}}return{mentionOptions:a,getSearchHandler:h,getMentionSearchHandler:g}}function cO({form:e,config:t,api:n,popupContext:r,resolvedIds:i,dynamicOptions:a,extraData:c,removedIds:l,removalOnlySubmit:u=!1,fields:d,onClose:f,onSubmit:p}){let[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(null);async function v(e){let t={resolvedIds:i,dynamicOptions:a,extraData:c,removedIds:l};if(typeof n.submit==`function`)return n.submit(e,r,t);if(typeof p==`function`)return p(e,r,t)}function y(){if(t){if(!d.length){if(t.mode===`delete`&&typeof n.deleteItems==`function`){h(!0),_(null),Promise.resolve(n.deleteItems(i,r)).then(()=>{s.message.success(t.successMessage||`Deleted successfully`),f({success:!0})}).catch(e=>{let t=e?.message||`Delete failed. Please try again.`;_(t),h(!1),s.message.error(t)});return}if(typeof n.onOk==`function`){h(!0),Promise.resolve(n.onOk(r)).then(()=>f({success:!0})).catch(e=>{let t=e?.message||`Failed. Please try again.`;s.message.error(t),h(!1)});return}if(typeof n.submit==`function`){h(!0),Promise.resolve(v({})).then(e=>{e?.navigated||(s.message.success(t.successMessage||`Saved successfully`),f({success:!0}))}).catch(e=>{s.message.error(e?.message||`Failed. Please try again.`)}).finally(()=>h(!1));return}f();return}if(u){h(!0),Promise.resolve(v(e.getFieldsValue())).then(e=>{e?.navigated||(s.message.success(t.successMessage||`Saved successfully`),f({success:!0}))}).catch(e=>{s.message.error(e?.message||`Failed. Please try again.`)}).finally(()=>h(!1));return}e.validateFields().then(async e=>{h(!0);try{if((await v(e))?.navigated)return;s.message.success(t.successMessage||`Saved successfully`),f({success:!0})}catch(e){s.message.error(e?.message||`Failed. Please try again.`)}finally{h(!1)}}).catch(()=>{})}}function b(){h(!1),_(null)}return{handleOk:y,confirming:m,deleteError:g,resetSubmitState:b}}function lO({open:e=!0,config:t,context:n={},onClose:r,onSubmit:i,api:a={}}){let[c]=s.Form.useForm(),[d,f]=(0,o.useState)({}),[p,m]=(0,o.useState)([]),h=s.Form.useWatch([],c,{preserve:!0})??{},g=(0,o.useMemo)(()=>mD(n),[n]),{selectedIds:_=[],selectedRecords:v=[],moduleName:y=``}=g,b=(0,o.useMemo)(()=>_.map((e,t)=>{let n=v[t];return n?.id??n?._id??e}),[_,v]),x=(0,o.useMemo)(()=>t?typeof t.getFields==`function`?t.getFields(g):t.fields??[]:[],[t,g]),S=(0,o.useMemo)(()=>{let e={};return x.forEach(t=>{let n=g[t.initialValueKey];!t.initialValueKey||n===void 0||(e[t.name]=t.type===`date-picker`?(0,u.default)(n):n)}),e},[x,g]),{dynamicOptions:C,setDynamicOptions:w,extraData:T}=iO({open:e,config:t,api:a,fields:x,popupContext:g,formValues:d}),{mentionOptions:E,getSearchHandler:D,getMentionSearchHandler:O}=sO({api:a,open:e,fields:x,popupContext:g,setDynamicOptions:w});function k(e){typeof r==`function`&&r(e)}let A=x.filter(e=>e.required),j=A.every(e=>{let t=h[e.name];return!(t==null||t===``||Array.isArray(t)&&t.length===0||typeof t==`object`&&!Array.isArray(t)&&Object.keys(t).length===0)}),M=(g.removedIds??[]).length,N=p.length>M,P=A.some(e=>{let t=h[e.name];return!(t==null||t===``||Array.isArray(t)&&t.length===0)}),{handleOk:F,confirming:I,deleteError:L,resetSubmitState:R}=cO({form:c,config:t,api:a,popupContext:g,resolvedIds:b,dynamicOptions:C,extraData:T,removedIds:p,removalOnlySubmit:!!t?.allowRemovalOnlySubmit&&N&&!P,fields:x,onClose:k,onSubmit:i});(0,o.useEffect)(()=>{e&&(c.resetFields(),f(S??{}),m(g.removedIds??[]),R())},[e,S]);let z=!!t?.autoSubmitWhenNoFields&&x.length===0;(0,o.useEffect)(()=>{!e||!z||F()},[e,z]);let B=_.length,V=String(y).replace(/s$/i,``),H=B===1?V:y,U=v[0]??{},ee=t?.getTitleText?t.getTitleText(B,H,U,g):t?.title,te=B===1?U.jobTitle??U.title??U.name??U.fullName??U.candidateName??null:null,ne=t?.getBodyText?t.getBodyText(B,V,H,te,g):t?.bodyText??null,re=typeof t?.getNote==`function`?t.getNote(g):t?.note,ie=t?.disabledUntilFilled&&!j&&!N;if(!t||!e||z)return null;let ae=t.component;return ae?(0,l.jsx)(s.Modal,{open:e,title:t.title||t.getTitleText?(0,l.jsx)(rD,{titleText:ee,titleIcon:t.titleIcon}):null,footer:null,width:t.width??760,centered:!0,maskClosable:!1,onCancel:()=>k(),className:`dynamic-popup${t.className?` ${t.className}`:``}`,children:(0,l.jsx)(ae,{context:g,selectedIds:b,selectedRecords:v,moduleName:y,onClose:k})}):(0,l.jsxs)(s.Modal,{open:e,title:(0,l.jsx)(rD,{titleText:ee,titleIcon:t.titleIcon}),okText:t.okText||`OK`,cancelText:t.cancelText??`Cancel`,onOk:F,onCancel:()=>k(),okButtonProps:{danger:t.okButtonDanger,disabled:ie,loading:I},cancelButtonProps:{disabled:I},closable:!I,maskClosable:!1,width:t.width??480,centered:!0,className:`dynamic-popup${t.className?` ${t.className}`:``}`,children:[(0,l.jsx)(iD,{note:re,description:t.description,showSelectedCount:t.showSelectedCount,count:B,itemLabel:H,bodyText:ne,deleteError:L}),(0,l.jsx)(aD,{footerNote:t.footerNote}),(0,l.jsx)(HD,{form:c,fields:x,initialValues:S,dynamicOptions:C,popupContext:g,extraData:T,removedIds:p,setRemovedIds:m,showAlreadyAssigned:t.showAlreadyAssigned,onValuesChange:f,getSearchHandler:D,getMentionSearchHandler:O,mentionOptions:E})]})}var uO={mode:`delete`,getTitleText:(e,t)=>`Delete ${e>0?`${e} `:``}${t}`,titleIcon:`delete`,okText:`Delete`,okButtonDanger:!0,width:420,getBodyText:(e,t,n,r)=>r?`Are you sure you want to delete the ${r} ${t}?`:e>1?`Are you sure you want to delete ${e} selected ${n}?`:`Are you sure you want to delete this ${t}?`,footerNote:`This action cannot be undone.`,fields:[]},dO={deleteItems:async(e,t)=>{await re(t.moduleName,e)}},fO=new Map;async function pO(e){return e?(fO.has(e)||fO.set(e,a.r({module:e}).catch(t=>(fO.delete(e),console.warn(`[in-progress gate] could not read ${e} form groups:`,t),[]))),fO.get(e)):[]}function mO(e=[],t){return e.some(e=>{let r=n.C(e,t);return r&&r.severity!==`allow`})}async function hO({targetModule:e,sourceModule:t,recordId:r,region:i}={}){let o={severity:`allow`,message:``,group:null};if(!e||!t||!r)return o;let s=i??n.zn().region;try{let i=await pO(e);if(!mO(i,s))return o;let c=await a.r({module:t,id:r}),l={};for(let e of c){let t=e?.payloadKey||e?.name;t&&Array.isArray(e?.rows)&&(l[t]=e.rows)}return n.D(i,s,l)}catch(e){return console.warn(`[in-progress gate] check skipped:`,e),o}}var gO=`Already submitted`,_O=`submissions`,vO=`candidates`,yO=864e5,bO=90,xO=`This candidate was created or last updated more than 90 days ago. Only candidates created or updated within the last 90 days can be selected. Please update this candidate first.`,SO=[`createdAt`,`createdDate`,`dateCreated`,`created_on`,`createdOn`],CO=[`updatedAt`,`updatedDate`,`lastUpdatedAt`,`lastUpdatedDate`,`modifiedAt`,`modifiedDate`];function wO(e,t){for(let n of t){let t=e?.[n];if(!t)continue;let r=new Date(t);if(!Number.isNaN(r.getTime()))return r}return null}function TO(e){return wO(e,SO)}function EO(e){return wO(e,CO)}function DO(e){if(!(e instanceof Date)||Number.isNaN(e.getTime()))return null;let t=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();return Math.max(0,Math.floor((t(new Date)-t(e))/yO))}function OO(e){return e===null?``:e<=14?`green`:e<=89?`yellow`:`red`}function kO(e,t=bO){if(!e)return!1;let n=Date.now()-t*yO,r=TO(e),i=EO(e),a=r&&r.getTime()>=n,o=i&&i.getTime()>=n;return!a&&!o}function AO(e){let t=TO(e);if(!t)return{createdAgo:``,createdAgoTone:``};let n=lD(t);return n?{createdAgo:n,createdAgoTone:OO(DO(t))}:{createdAgo:``,createdAgoTone:``}}function jO(e){return{...e,...AO(e),isStaleCandidate:kO(e)}}function MO(e){return String(e?.applicantId??e?._id??e?.id??``)}var NO=null;async function PO(){return NO||=n.Nr(vO).then(e=>e?.strategies?.duplicateCheck?.editRoute??``).catch(()=>``),NO}async function FO(e){let t=MO(e);if(!t)return``;let n=await PO();return n?n.replace(/:(_?id)\b/g,encodeURIComponent(t)):``}async function IO({option:e,popupContext:t,confirm:n}){let r=e?._raw??e??{},i=MO(r);if(i){let e=await hO({targetModule:_O,sourceModule:vO,recordId:i});if(e.severity===`block`)return new Promise(t=>{n({title:`This candidate cannot be submitted`,content:e.message,okText:`Pick someone else`,cancelText:`Close`,onOk:()=>t(!1),onCancel:()=>t(!1)})})}if(!kO(r))return!0;let a=t?.navigate;return!a||!i?!1:new Promise(e=>{n({title:`Candidate update required`,content:xO,okText:`OK`,cancelText:`Cancel`,onOk:async()=>{let t=await FO(r);t&&a(t),e(!1)},onCancel:()=>e(!1)})})}function LO(e,t,n){return{...e,label:`${e.label} - ${gO}`,disabled:!0,title:`${gO}${t?` (submission ${t})`:``}`,alreadySubmitted:!0,existingSubmissionId:t||``,...n?{submittedAt:n}:{}}}var RO={searchOptions:async(e,t,n)=>{if(e.searchFetchKey===`quickSubmitJobList`){let e=n.selectedRecords?.[0]??{},r=e.id??e._id??n.selectedIds?.[0],i,a=!0;try{i=await we({searchQuery:t,candidateId:r})}catch{a=!1;let e=await Rn({searchQuery:t,candidateId:r});i=Array.isArray(e?.data)?e.data:[]}let o=i.map(e=>({label:[e.jobReferenceId??e.clientJobReferenceId,e.jobTitle].filter(Boolean).join(` - `)||String(e._id??``),value:e._id??``,_raw:e}));if(a)return o.map(e=>{if(e._raw?.isSubmitted||e._raw?.alreadySubmitted)return LO(e,e._raw?.jobSubmissionId||``,e._raw?.submittedAt||``);if(e._raw?.disable){let t=String(e._raw?.message??``).trim();return{...e,disabled:!0,label:t?`${e.label} - ${t}`:e.label,title:t}}return e});let s=await Ee({applicantId:r,jobIds:o.map(e=>e.value)}).catch(()=>new Map);return o.map(e=>{let t=s.get(String(e.value));return t?LO(e,t.submissionId,t.submittedAt):e})}if(e.searchFetchKey===`quickSubmitCandidates`){let e=n.selectedRecords?.[0]??{},r=n.jobId??e.jobId??e.id??e._id??n.selectedIds?.[0],i,a=new Map;try{i=await Te({search:t,jobId:r})}catch{let e=await Uo({isFromSubmission:n.isFromSubmission,jobId:r,submissionId:n.submissionId,search:t});i=Array.isArray(e)?e:[],a=await Ee({jobId:r,applicantIds:i.map(MO)}).catch(()=>new Map)}return i.map(e=>jO(e)).map(e=>{let t=a.get(MO(e));if(!(t||e?.isSubmitted===!0||e?.alreadySubmitted===!0))return e;let n=t?.submissionId||e?.jobSubmissionId||``,r=t?.submittedAt||e?.submittedAt||``;return{...e,disabled:!0,optionNote:gO,isSubmitted:!0,alreadySubmitted:!0,existingSubmissionId:n,...r?{submittedAt:r}:{}}})}return[]},submit:async(e,t,n)=>{let{navigate:r,selectedRecords:i=[],selectedIds:a=[],moduleName:o}=t,s=i[0]??{},c,l;t.jobId?(c=t.jobId,l=s.id??s._id??a[0]??``):o===`candidate`?(c=e.jobId??``,l=s.id??s._id??a[0]??``):(c=s.jobId??s.id??s._id??a[0]??``,l=e.candidate??``);let u=n?.dynamicOptions?.candidate?.find(e=>MO(e?._raw)===String(l)),d=n?.dynamicOptions?.jobId?.find(e=>String(e?.value)===String(c)),f=u?._raw?.isSubmitted||u?._raw?.alreadySubmitted||d?.alreadySubmitted||d?._raw?.isSubmitted||d?._raw?.alreadySubmitted;if(!c||!l)throw Error(`Select both a job and a candidate to quick submit.`);if(kO(u?._raw))throw Error(xO);let p=await hO({targetModule:_O,sourceModule:vO,recordId:l});if(p.severity===`block`)throw Error(p.message);let m=f,h=u?._raw?.existingSubmissionId||u?._raw?.jobSubmissionId||d?.existingSubmissionId||d?._raw?.jobSubmissionId||``;try{let e=await Ce({jobId:c,applicantId:l});m||=!!e?.exists,h=e?.submissionId||h}catch(e){throw Error(`Could not verify existing submissions (${e?.message??`request failed`}). Please try again.`,{cause:e})}if(m)throw Error(`This candidate is already submitted for this job${h?` (submission ${h})`:``}.`);let g=new URLSearchParams;l&&g.set(`candidateId`,l);let _=u?.priorSubmissionId||u?._raw?.submissionId||d?.priorSubmissionId||d?._raw?.submissionId||``;_?(g.set(`submissionId`,String(_)),g.set(`isFromSubmission`,`true`)):g.set(`isFromSubmission`,`false`);let v=Bo(Ho({jobId:c,applicantId:l}).catch(()=>[]));return r(`/submission-create/${c}?${g.toString()}`,{state:{relevantSkillsToken:v}}),{navigated:!0}}},zO={title:`Submit`,okText:`Submit`,width:640,disabledUntilFilled:!0,autoSubmitWhenNoFields:!0,getNote:e=>e.moduleName===`candidate`?`Note: Select a job to submit this candidate.`:`Note: Select a candidate to submit for this job`,getFields:e=>e.jobId?[]:e.moduleName===`candidate`?[{name:`jobId`,label:`Job list`,type:`search-select`,required:!0,placeholder:`Search Job ID / job name - or pick a recent job`,searchFetchKey:`quickSubmitJobList`,optionLayout:{id:`{jobReferenceId}`,title:`{jobTitle}`,subtitle:`{clientJobReferenceId}`,meta:[{label:`Created`,key:`createdAt`,type:`date`},{label:`Updated`,key:`updatedAt`,type:`relative`}]}}]:[{name:`candidate`,label:`Candidate`,type:`search-select`,required:!0,placeholder:`Search candidate name / email - or pick a recent candidate`,optionsKey:`candidateOptions`,searchFetchKey:`quickSubmitCandidates`,labelTemplate:`{applicantRefrenceId} - {firstName} {lastName} - {createdAgo}`,valueKey:`applicantId`,optionLayout:{id:`{applicantRefrenceId}`,title:`{firstName} {lastName}`,titleAccent:{key:`createdAgo`,toneKey:`createdAgoTone`,prefix:` - `},subtitle:`{designation} - {email}`,meta:[{label:`Created`,key:`createdAt`,type:`date`},{label:`Updated`,key:`updatedAt`,type:`relative`}]},onSelectGuard:IO}]},BO={title:`Add Notes & Share`,okText:`Save & Share`,width:480,fields:[{name:`notes`,label:`Notes`,type:`mention-textarea`,required:!0,rows:5,maxLength:2e3,placeholder:`Add your notes on the job. Use '@' to mention someone.`,mentionFetchKey:`mentionUsers`}]},VO=e=>e?.data??e;async function HO({relatedId:e,notes:n,title:r,notesFor:i}){return VO(await bn(t.x,`/notes`,{method:`POST`,body:JSON.stringify({relatedId:e,notes:n,title:r,notesFor:i})}))}var UO={getMentionOptions:async(e,t)=>ae(t),submit:async(e,t)=>{let n=Array.isArray(t.selectedIds)?t.selectedIds[0]:t.selectedIds;if(!n)throw Error(`Please select a record before adding a note.`);await HO({relatedId:String(n),notes:e.notes,notesFor:t.moduleName})}},WO={name:`jobId`,label:`Job Title / ID`,type:`search-select`,required:!0,placeholder:`Minimum 3 characters`,searchFetchKey:`tagToJobJobList`,valueKey:`_id`,labelTemplate:`{jobReferenceId} - {jobTitle}`},GO={name:`hiringStage`,label:`Hiring stage`,type:`select`,required:!0,optionsKey:`hiringStageOptions`,defaultOptions:[{label:`Shortlisted`,value:`shortlisted`},{label:`Pipeline`,value:`pipeline`}],initialValueKey:`hiringStage`},KO={title:`Tag to Job`,okText:`Tag`,width:480,disabledUntilFilled:!0,autoSubmitWhenNoFields:!0,getFields:e=>e.jobId&&e.hiringStage?[]:e.jobId?[GO]:[WO,GO]},qO=e=>e?.data??e;function JO(e){return Array.isArray(e)&&e.every(e=>e&&typeof e==`object`&&`Key`in e)?e.reduce((e,{Key:t,Value:n})=>(e[t]=n,e),{}):e}function YO(e){return e?Array.isArray(e.data)?e.data.map(JO):e.stage&&Array.isArray(e.stage.data)?e.stage.data.map(JO):Array.isArray(e)?e.map(JO):[]:[]}async function XO(e=1,n=10){let r=await t.o(t.x,`/workflow/list/all?page=${e}&limit=${n}`),i=qO(r),a=Array.isArray(i)?i:i?.data??[];return{items:a,total:Number(r?.total??i?.total)||a.length,page:e,limit:n}}async function ZO(e,n){let r=qO(await t.o(t.x,`/workflow/${e}/stage/${n}`));return Array.isArray(r)?{data:r}:r}async function QO(e,n){if(!e||!n)return null;try{let r=new URLSearchParams({module:e,limit:`1`,offset:`0`,scope:`allJobs`,filters:JSON.stringify([{field:`_id`,op:`in`,values:[String(n)],operator:`and`}])}),i=qO(await t.o(t.x,`/module-data-list?${r}`));if(Array.isArray(i))return i[0]??null;if(i?.data&&Array.isArray(i.data))return i.data[0]??null;let a=i?.rows??i?.records??i?.items??i?.list;return Array.isArray(a)?a[0]??null:i??null}catch(t){return console.error(`[getModuleRecordById] failed: ${e}/${n}`,t),null}}async function $O(e){return qO(await t.o(t.T,`/source/workflow-instance`,{method:`POST`,body:JSON.stringify(e)}))}var ek={pipeline:`pipeline`,goodfited:`goodfited`,contacted:`contacted`,submitted:`submitted`,shortlisted:`shortlisted`,interviewinprogress:`interviewInprogress`,selected:`selected`};function tk(e,...t){for(let n of t){let t=String(n).split(`.`).reduce((e,t)=>e?.[t],e);if(t!=null&&t!==``)return t}}function nk(e){let t=String(e??``).trim();return t?ek[t.toLowerCase()]??t:``}function rk(e,t){let n=tk(e,`candidateId`,`candidate_id`,`applicantId`,`applicantID`,`applicantReferenceId`,`applicantRefrenceId`,`_id`,`id`)??t;if(!n)return null;let r=(tk(e,`candidateName`,`candidate_name`,`fullName`,`name`)??[tk(e,`firstName`,`first_name`),tk(e,`lastName`,`last_name`)].filter(Boolean).join(` `))||void 0,i={candidateId:String(n),candidateName:r,phone:tk(e,`phone`,`phoneNumber`,`phone_number`,`mobile`,`mobileNumber`,`mobile_number`),source:tk(e,`source`,`sourceType`,`candidateSource`,`profileSource`),submittedAt:tk(e,`submittedAt`,`lastSubmittedAt`,`updatedAt`),remarks:tk(e,`remarks`,`comment`,`comments`,`notes`),assignedRecruiter:tk(e,`assignedRecruiter`,`recruiterName`,`ownerName`,`assignedToName`),screeningStatus:tk(e,`screeningStatus`,`screening.status`,`screeningResult`),screeningScore:tk(e,`screeningScore`,`screening.score`,`score`),assignedDate:tk(e,`assignedDate`,`assignedAt`,`createdAt`)};return Object.fromEntries(Object.entries(i).filter(([,e])=>e!=null&&e!==``))}var ik={searchOptions:async(e,t)=>e.searchFetchKey===`tagToJobJobList`?ie(t):[],submit:async(e,t)=>{let n=e.jobId??t.jobId,r=nk(e.hiringStage??t.hiringStage),i=Array.isArray(t.selectedIds)?t.selectedIds:[],a=Array.isArray(t.selectedRecords)?t.selectedRecords:[],o=Math.max(i.length,a.length,1);for(let e=0;e<o;e+=1){let t=i[e]?String(i[e]):``,o=rk(a[e]??{},t);await $O({jobId:n,module:`jobs`,currentStage:r,...o?{candidateDetails:o}:{}})}await ce({jobId:n,candidateIds:t.selectedIds,hiringStage:r})}},ak={title:`Change Status`,okText:`Apply`,width:420,showSelectedCount:!0,fields:[{name:`status`,label:`New Status`,type:`select`,required:!0,placeholder:`Select a status`,dataSource:`master`,masterName:`clientSubmissions`,labelKey:`name`,valueKey:`name`,initialValueKey:`currentStatus`,defaultOptions:[{label:`Active`,value:`active`},{label:`Inactive`,value:`inactive`},{label:`Pending`,value:`pending`},{label:`Closed`,value:`closed`}]}]};function ok(e,t){let n=String(e??``).trim().toLowerCase();return(Array.isArray(t?.status)?t.status:[]).find(e=>String(e?.value??``).trim().toLowerCase()===n||String(e?.label??``).trim().toLowerCase()===n||String(e?._raw?.name??``).trim().toLowerCase()===n)??null}var sk={submit:async(e,t,n)=>{let r=ok(e.status,n?.dynamicOptions),i=r?._raw??{},a={clientSubmissionStatusText:String(i.name??r?.label??e.status??``).trim(),clientSubmissionStatusId:Number(i.id??i.uniqueId??0)||0,clientSubmissionStatusType:String(i.type??``).trim()};await ne(t.moduleName,t.selectedIds,a)}},ck={getTitleText:e=>`Remove ${e>1?`${e} Candidates`:`Candidate`} from Shortlist`,titleIcon:`delete`,okText:`Remove`,okButtonDanger:!0,width:420,getBodyText:e=>e>1?`Are you sure you want to remove ${e} selected candidates from the shortlist?`:`Are you sure you want to remove this candidate from the shortlist?`,footerNote:`The candidate will be moved back to the pipeline.`,fields:[]},lk={onOk:async e=>{await De({jobId:e.jobId??e.selectedIds[0],candidateIds:e.selectedIds})}},uk={title:`Add to Groups`,description:`Select a group to add the selected candidate(s) to`,okText:`Add to Group`,width:480,disabledUntilFilled:!0,fields:[{name:`groupId`,label:`Group`,type:`select`,required:!0,placeholder:`Select a group`,fetchOptionsKey:`candidateGroups`}]},dk={getOptions:async e=>e.fetchOptionsKey===`candidateGroups`?le():[],submit:async(e,t,{dynamicOptions:n})=>{let r=(n.groupId??[]).find(t=>String(t.value)===String(e.groupId));await ue({candidateIds:t.selectedIds,groupId:e.groupId,groupName:r?.label??``})}},fk=[{title:`Name`,key:`name`,render:(e,t)=>t.name||`${t.first_name??``} ${t.last_name??``}`.trim()||t.user_name||`Assigned user`},{title:`Role`,dataIndex:`role_name`,key:`role`,render:e=>e||`-`},{title:`Reporting`,dataIndex:`reporting_name`,key:`reporting`,render:e=>e||`-`}];function pk({selectedIds:e,onClose:t}){let n=e?.[0],[r,i]=(0,o.useState)(!0),[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)({assignedUsers:[],totalSubmissions:0,message:``}),[p,m]=(0,o.useState)([]);(0,o.useEffect)(()=>{let e=!1;return i(!0),Promise.all([fe(n).catch(t=>(e||s.message.error(t?.message??`Failed to load self-assign details`),{assignedUsers:[],totalSubmissions:0,message:``})),he(n).catch(()=>({recruitersData:[]}))]).then(([t,n])=>{e||(f(t),m(Array.isArray(n?.recruitersData)?n.recruitersData:[]))}).finally(()=>{e||i(!1)}),()=>{e=!0}},[n]);let h=async()=>{u(!0);try{await de({jobIds:[n]}),s.message.success(`Job assigned successfully`),t?.({success:!0})}catch(e){s.message.error(e?.message??`Failed to assign job`)}finally{u(!1)}};if(r)return(0,l.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:48},children:(0,l.jsx)(s.Spin,{size:`large`})});let g=p.map(e=>({user_id:e.recruiterId??e.id??e.user_id,name:e.name??``,role_name:e.role_name??e.roleName??``,reporting_name:e.reporting_name??e.reportingName??``})),_=new Map(g.map(e=>[String(e.user_id??``),e])),v=(d.assignedUsers?.length??0)>0?d.assignedUsers.map(e=>{let t=e.user_id??e.userId??e.recruiterId??e.id,n=_.get(String(t??``))??{};return{...e,user_id:t,name:n.name||e.name||``,role_name:n.role_name||e.role_name||e.roleName||``,reporting_name:n.reporting_name||e.reporting_name||e.reportingName||``}}):g,y=v.length>0;return(0,l.jsxs)(`div`,{className:`self-assign-popup-body`,children:[y?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{style:{fontWeight:700,marginBottom:8},children:`Team Members Allocated`}),(0,l.jsx)(s.Table,{columns:fk,dataSource:v,pagination:!1,rowKey:e=>e.user_id??`${e.first_name}-${e.last_name}`,size:`small`,className:`mb-3 no-header-bg`,scroll:{y:200}}),(0,l.jsxs)(`div`,{className:`warning-card`,style:{display:`flex`,alignItems:`center`,gap:8,marginTop:12},children:[(0,l.jsx)(c.ExclamationCircleFilled,{style:{color:`#faad14`,fontSize:18}}),(0,l.jsx)(`div`,{style:{fontSize:13},children:`These users are already assigned to this job. Do you still want to assign yourself as well?`})]})]}):(0,l.jsx)(`div`,{style:{padding:`8px 0`},children:d.message||`No one is currently assigned to this job. Do you want to assign yourself?`}),(0,l.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,marginTop:24},children:[(0,l.jsx)(s.Button,{size:`small`,onClick:()=>t?.(),disabled:a,children:`No`}),(0,l.jsx)(s.Button,{type:`primary`,size:`small`,onClick:h,loading:a,children:`Yes`})]})]})}pk.propTypes={selectedIds:f.default.array,onClose:f.default.func};var mk={title:`Self Assign`,width:480,className:`self-assign-modal`,component:pk},hk={submit:async()=>{}};function gk(e={}){let t=Array.isArray(e.jobPayDetails)?e.jobPayDetails[e.jobPayDetails.length-1]:e.jobPayDetails??e.clientBudget??{},n=Number(t.clientBudgetEnd),r=Number(t.clientBudgetStart);return Number.isFinite(n)&&n>0?n:Number.isFinite(r)&&r>0?r:null}var _k={getTitleText:(e,t,n)=>{let r=n?.jobTitle||n?.title||``;return r?`Assign - ${r}`:`Assign`},okText:`Assign`,width:520,disabledUntilFilled:!0,showAlreadyAssigned:!0,allowRemovalOnlySubmit:!0,getFields:e=>(gk(e?.selectedRecords?.[0]??{}),[{name:`assignToUserId`,label:`Assign to`,type:`multi-select`,required:!0,placeholder:`Select recruiter(s)`,fetchOptionsKey:`assignToUsers`}])},vk={getOptions:async e=>e.fetchOptionsKey===`assignToUsers`?me():[],loadExtraData:async e=>he(e.selectedIds[0]),submit:async(e,t,{removedIds:n,extraData:r})=>{await K({jobIds:t.selectedIds,userId:e.assignToUserId,removedIds:n,existingRecruiters:r?.recruitersData})}},yk={title:`Add Sticky Notes`,getTitleText:(e,t,n,r)=>r.editingNoteId?`Edit Sticky Notes`:`Add Sticky Notes`,okText:`Save`,width:480,fields:[{name:`heading`,label:`Heading`,type:`input`,required:!0,placeholder:`Enter heading`,initialValueKey:`editingHeading`},{name:`targetDate`,label:`Target Date`,type:`date-picker`,required:!1,initialValueKey:`editingTargetDate`},{name:`comments`,label:`Comments`,type:`mention-textarea`,required:!0,rows:5,placeholder:`Enter your note here... Use '@' to mention someone.`,mentionFetchKey:`mentionUsers`,initialValueKey:`editingComments`}]},bk={getMentionOptions:async(e,t)=>ae(t),submit:async(e,t)=>{let n=e.targetDate?e.targetDate.toISOString():``;t.editingNoteId?await oe(t.editingNoteId,{title:e.heading,targetDate:n,notes:e.comments}):await W({relatedIds:t.selectedIds,module:t.moduleName,title:e.heading,targetDate:n,notes:e.comments}),window.dispatchEvent(new Event(`sticky-notes:refresh`))}},xk={title:`Move to Onboarding`,bodyText:`Are you sure you want to move this candidate to onboarding?`,okText:`Yes`,cancelText:`No`,width:420,successMessage:`Moved to onboarding successfully`,successNavigate:`/onboarding`,fields:[{name:`sendOnboardingEmail`,type:`priority-checkbox`,checkboxLabel:`Send Onboarding Email`}]},Sk={submit:async(e,t)=>{await ve({submissionId:t.selectedRecords?.[0]?.submissionId,isMail:e.sendOnboardingEmail})}};function Ck(e){return Array.isArray(e)?e[e.length-1]??{}:e&&typeof e==`object`?e:{}}var wk={USD:`$`,INR:`₹`,EUR:`€`,GBP:`£`};function Tk(e,t,n){let r=Ck(e?.[t])[n];if(r!=null&&r!==``)return r;let i=e?.[`${t}.${n}`];return i!=null&&i!==``?i:void 0}function Ek(e){let t=e.selectedRecords?.[0]??{},n=Tk(t,`candidateRate`,`candidateAcceptedRate`)??Tk(t,`candidateBudget`,`candidateBudgetStart`);if(n===void 0||Number(n)===0)return null;let r=Tk(t,`candidateRate`,`candidateAcceptedCurrency`)??Tk(t,`candidateBudget`,`candidateBudgetCurrency`);return{amount:n,symbol:Tk(t,`candidateRate`,`candidateAcceptedCurrencySymbol`)??Tk(t,`candidateBudget`,`candidateBudgetCurrencySymbol`)??wk[String(r??``).toUpperCase()]??(r||`$`),unit:Tk(t,`candidateRate`,`candidateAcceptedPayUnit`)??Tk(t,`candidateBudget`,`candidateBudgetUnit`)??``}}var Dk={title:`Approve Rate`,okText:`Approve`,width:520,className:`medium-modal`,successMessage:`Rate approved`,getBodyText:(e,t,n,r,i)=>{let a=Ek(i);return`Candidate Rate: ${a?`${a.symbol}${a.amount}${a.unit?`/${a.unit}`:``}`:`-`}`},fields:[{name:`candidateProposedRate`,label:`Proposed Rate`,type:`number`,required:!0,placeholder:`Amount`,min:0,inlineRow:`proposedRate`,validator:(e,t)=>{if(e==null||e===``)return;let n=Ek(t);if(n&&Number(e)<=Number(n.amount))return`Proposed rate must be greater than Candidate Rate`}},{name:`candidateProposedRateCurrency`,label:`Currency`,type:`select`,required:!0,inlineRow:`proposedRate`,defaultOptions:[{label:`$ USD`,value:`$`},{label:`₹ INR`,value:`₹`},{label:`€ EUR`,value:`€`}]},{name:`candidateProposedRateUnit`,label:`Unit`,type:`select`,required:!0,inlineRow:`proposedRate`,defaultOptions:[{label:`Year`,value:`yr`},{label:`Month`,value:`mo`},{label:`Week`,value:`wk`},{label:`Hour`,value:`hr`},{label:`Daily`,value:`day`}]},{name:`submitVia`,label:`Submit Via`,type:`radio`,required:!0,defaultOptions:[{label:`Mail`,value:`Mail`},{label:`VMS`,value:`VMS`}]}]},Ok={submit:async(e,t)=>{let n=t.selectedIds[0];if(await ye(n,{candidateProposedRate:e.candidateProposedRate,candidateProposedRateCurrency:e.candidateProposedRateCurrency,candidateProposedRateUnit:e.candidateProposedRateUnit,submitVia:e.submitVia}),e.submitVia===`VMS`)try{await be(n)}catch{s.message.warning(`Approved. VMS notification could not be sent — use Send Mail to notify the client.`)}else s.message.info(`Approved — use Send Mail to notify the client.`)}};async function kk(e,n={}){let r=t.u();if(!r){let e=Error(`Authentication required`);throw e.status=401,e}let i=await fetch(`${t.D}${e}`,{...n,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${r}`,...n.headers}});if(i.status===401&&t.h(),!i.ok){let e=Error(`API ${i.status}: ${i.statusText}`);throw e.status=i.status,e}return i.json()}async function Ak(e){let t=await kk(`/mail-form?${new URLSearchParams({submissionId:e,submissionType:`manager`}).toString()}`);return t.data??t}function jk(e){return Array.isArray(e)?e[e.length-1]:e}function Mk(e={}){let t=jk(e?.proposedRate)?.candidateProposedRate??e?.candidateProposedRate??e?.proposedRateValue,n=Number(t);return Number.isFinite(n)?n:0}function Nk(e,t={}){let n=jk((e?.record?.job??e?.job??t?.job??{})?.jobPayDetails)??{},r=e?.record?.submission??t??{},i=jk(r?.clientBudget)??r?.clientBudget??{},a=n?.clientBudgetEnd??n?.clientBudgetStart??i?.clientBudgetEnd??i?.clientBudgetStart,o=Number(a);return Number.isFinite(o)?o:0}function Pk(e={}){let t=String(e?.currencyRaw??``).trim().toUpperCase(),n=String(e?.currency??``).trim();return n&&!/^[A-Z]{3}$/i.test(n)?n:t===`USD`||n.toUpperCase()===`USD`?`$`:t===`INR`||n.toUpperCase()===`INR`?`₹`:t===`EUR`||n.toUpperCase()===`EUR`?`€`:t===`GBP`||n.toUpperCase()===`GBP`?`£`:n||t}function Fk(e={}){return String(e?.rateUnit??`hr`).trim().replace(/^\/+/,``)||`hr`}function Ik(e,t={}){let n=Number(e);return Number.isFinite(n)?`${Pk(t)}${n}/${Fk(t)}`:``}function Lk(e,t,n){if(n==null||n===``)return String(e??``);let r=String(e??``),i=String(n),a=!1,o=RegExp(`(<(?:td|th)[^>]*>[\\s\\S]*?${t}[\\s\\S]*?</(?:td|th)>\\s*<(?:td|th)[^>]*>)([\\s\\S]*?)(</(?:td|th)>)`,`gi`);r=r.replace(o,(e,t,n,r)=>(a=!0,`${t}${i}${r}`));let s=RegExp(`(<(?:strong|b)[^>]*>\\s*${t}\\s*:?\\s*</(?:strong|b)>\\s*)([\\s\\S]*?)(?=</(?:li|p|div)>)`,`gi`);if(r=r.replace(s,(e,t)=>(a=!0,`${t}${i}`)),!a){let e=RegExp(`(${t}\\s*:?[ \\t]*)([^<\\r\\n]*)`,`gi`);r=r.replace(e,(e,t)=>`${t}${i}`)}return r}function Rk(e,t,n,r,i){let a=Number(n?.proposedRate),o=Number.isFinite(a)?a:Mk(t),s=Number(n?.clientJobRate),c=Number.isFinite(s)&&s>0?s:Nk(r,i),l={proposedRate:o,jobBillRate:c},u=String(e??``).replace(/{{\.?((?:proposedRate)|(?:jobBillRate))}}/g,(e,t)=>{let n=l[t];return n==null?e:String(n)});return u=Lk(u,`(?:Proposed\\s*Rate|Pay\\s*Rate)`,Ik(o,n)),u=Lk(u,`(?:Job\\s*)?Bill\\s*Rate`,Ik(c,n)),u}function zk(...e){return e.map(e=>e==null?``:String(e).trim()).find(Boolean)??``}var Bk=(e,t)=>!!e&&e.toLowerCase()===zk(t).toLowerCase();function Vk(e,t,n){let r=zk(t.submittedBy);return zk(Bk(r,n)||Bk(r,e.submitSource)||Bk(r,e.supplierName)||Bk(r,e.source)||Bk(r,e.candidateSource)?``:r,e.signatureEmail)}function Hk(e,t={}){let n=t.employerName??e.supplierName??e.submitSource;return{client:t.clientName??e.clientName,role:t.jobTitle??e.jobTitle??e.designation,reqId:t.reqId??e.jobClientRefrenceId??e.mspReqId??e.submissionId,name:t.candidateName||[e.firstName,e.lastName].filter(Boolean).join(` `)||e.candidateFullName,location:t.jobLocation??e.city??e.currentLocation??e.jobLocation,vendor:n,submittedBy:Vk(e,t,n),submittedAt:t.createdAt??e.createdAt,email:t.email??e.email,employerLocation:t.employerLocation,employerName:t.employerName}}function Uk(e){let t=e?.$oid??e?._id?.$oid??e?._id??e?.id?.$oid??e?.id??e;if(t==null||typeof t==`object`)return``;let n=String(t).trim();return/^[a-f\d]{24}$/i.test(n)?n:``}function Wk(...e){for(let t of e){let e=[t?.jobId,t?.JobId,t?.job_id,t?.jobDetails?._id,t?.jobDetails?.id,t?.job?._id,t?.job?.id,t?.submission?.jobId,t?.submission?.JobId,t?.submission?.job_id,t?.submission?.jobDetails?._id,t?.submission?.jobDetails?.id,t?.submission?.job?._id,t?.submission?.job?.id,t?.recordMeta?.jobId,t?.recordMeta?.JobId,t?.recordMeta?.job_id,t?.submission?.recordMeta?.jobId,t?.submission?.recordMeta?.JobId,t?.submission?.recordMeta?.job_id].map(Uk).find(Boolean);if(e)return e}return``}function Gk(e){if(!e?.referralId)return{};let t=Number(e.referralRate??e.referalRate??0)||0,n=String(e.referralType??e.referalType??`RECURRING`).trim()||`RECURRING`,r=e.referralId??e.referalId;return{referralId:r,referalId:r,referralRate:t,referalRate:t,referralType:n,referalType:n,referralEnabled:!0,referalEnabled:!0,isReferralApplicable:!0,referralDetails:{referralId:r,referalId:r,referralRate:t,referalRate:t,referralType:n,referalType:n,referralEnabled:!0,referalEnabled:!0,isReferralApplicable:!0}}}function Kk(e=``){return String(e??``).replace(/map\[[^\]]*(?:resume|document|attachment|file)[^\]]*\]/gi,``).replace(/<p>\s*<\/p>/gi,``).replace(/(?:<br\s*\/?>\s*){3,}/gi,`<br><br>`).trim()}function qk(...e){for(let t of e){let e=[t?.candidateId,t?.applicantId,t?.candidate?._id,t?.candidate?.id,t?.submission?.candidateId,t?.submission?.applicantId,t?.recordMeta?.candidateId,t?.recordMeta?.applicantId].map(Uk).find(Boolean);if(e)return e}return``}async function Jk(e){let t=e?.fileUrl??e?.downloadUrl??e?.url;if(!t)return null;let n=await fetch(t);if(!n.ok)throw Error(`Unable to load ${e?.fileName||`resume`}`);let r=await n.blob(),i=e?.fileName??e?.uploadedFileName??e?.originalName??e?.uniqueName??`resume`;return new File([r],i,{type:e?.contentType||r.type||`application/octet-stream`})}async function Yk(e,r,i){let a=[],o=await n.gn(`submissions`,e,`resume`).catch(()=>({data:[]}));a.push(...o?.data??[]);let s=qk(r?.record?.submission,i,r?.record);if(!s){let n=await t.o(t.x,`/module/list?module=submissions&id=${encodeURIComponent(e)}`).catch(()=>({})),r=n?.data??n??{};s=qk((Array.isArray(r?.data)?r.data:Array.isArray(r)?r:[])[0])}if(s){let e=await n.gn(`candidates`,s,`resume`).catch(()=>({data:[]}));a.push(...e?.data??[])}let c=(await Promise.all(a.map(Jk))).filter(Boolean),l=new Set;return c.filter(e=>{let t=`${e.name}:${e.size}:${e.type}`;return!l.has(t)&&(l.add(t),!0)})}function Xk(e={}){return{to:(e.to??e.To??[]).map(e=>e.email??e.Email??e).filter(Boolean).join(`, `),cc:(e.cc??e.Cc??[]).map(e=>e.email??e.Email??e).filter(Boolean).join(`, `),bcc:(e.bcc??e.Bcc??[]).map(e=>e.email??e.Email??e).filter(Boolean).join(`, `),subject:e.subject??e.Subject??``,contents:Kk(e.content?.value??e.Content?.Value??e.contents??e.body??``)}}function Zk({context:e,selectedIds:t,selectedRecords:n,moduleName:r,onClose:i}){let a=n?.[0]??{},c=t?.[0]??y_(a),[u,d]=(0,o.useState)(null),[f,p]=(0,o.useState)(!0),[m,h]=(0,o.useState)([]),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)(`vms`),[b,x]=(0,o.useState)(null),[S,C]=(0,o.useState)(null),[w,T]=(0,o.useState)(!1),[E,D]=(0,o.useState)(!1),[O,k]=(0,o.useState)(!1),[A,j]=(0,o.useState)(!1),[M,N]=(0,o.useState)({to:``,cc:``,bcc:``,subject:``,contents:``,attachments:[],showCc:!1,showBcc:!1});(0,o.useEffect)(()=>{let e=!1;return ov(c,a).then(t=>{e||d(t)}).catch(t=>{e||(s.message.error(t?.message??`Unable to load finance details`),d({record:{submission:a},lookups:{},display:{}}))}).finally(()=>{e||p(!1)}),()=>{e=!0}},[c]),(0,o.useEffect)(()=>{let e=!1;return hv().then(t=>{e||h(t)}).catch(()=>{}),()=>{e=!0}},[]);let P=async()=>{if(b){if(v===`mail`){_(!1),D(!0),k(!0);try{let[e,t]=await Promise.all([Ak(c).then(Xk),Yk(c,u,a).catch(e=>(console.warn(`Unable to resolve resume attachment:`,e),[]))]),n=u?.record?.submission??a;N({to:Rk(e.to,n,b,u,a),cc:Rk(e.cc,n,b,u,a),bcc:Rk(e.bcc,n,b,u,a),subject:Rk(e.subject,n,b,u,a),contents:Rk(e.contents,n,b,u,a),attachments:t,showCc:!!e.cc,showBcc:!!e.bcc})}catch(e){s.message.error(e?.message??`Unable to prepare approval mail`)}finally{k(!1)}return}T(!0);try{await ye(c,{candidateProposedRate:b.proposedRate,candidateProposedRateCurrency:b.currencyRaw??b.currency,candidateProposedRateUnit:b.rateUnit,submitVia:`VMS`,...Gk(S)}),s.message.success(`Submission approved`),_(!1),x(null),C(null),i?.({success:!0})}catch(e){s.message.error(e?.message??`Unable to approve submission`)}finally{T(!1)}}},F=!O&&GT(M.to).length>0&&KT(M.to)&&KT(M.cc)&&KT(M.bcc)&&M.subject.trim()&&M.contents.trim(),I=async()=>{if(!b||!F||A)return;j(!0);let e={candidateProposedRate:b.proposedRate,candidateProposedRateCurrency:b.currencyRaw??b.currency,candidateProposedRateUnit:b.rateUnit};try{await ye(c,{...e,submitVia:`VMS`,...Gk(S)});let t=Wk(u?.record,a);if(!t)s.message.warning(`Submission approved, but job details were not available to send mail`);else try{await mn({jobId:t,toMail:GT(M.to),ccMail:GT(M.cc),bccMail:GT(M.bcc),subject:M.subject,contents:M.contents,attachments:M.attachments??[]}),s.message.success(`Approval mail sent and submission approved`)}catch(e){s.message.warning(e?.message?`Submission approved, but mail was not sent: ${e.message}`:`Submission approved, but mail was not sent`)}D(!1),x(null),C(null),i?.({success:!0})}catch(e){s.message.error(e?.message??`Unable to send approval mail`)}finally{j(!1)}},L=(0,o.useMemo)(()=>({submissionApprove:async({computed:e,referral:t})=>{x(e),C(t??null),y(`vms`),_(!0)},submissionReject:async()=>{e?.navigate?.(`/popup/reject`,{replace:!0,state:{background:e?.background??null,selectedIds:t,selectedRecords:n,moduleName:r}})}}),[e,t,n,r]);return f||!u?(0,l.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:48},children:(0,l.jsx)(s.Spin,{size:`large`})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Y_,{type:qg,record:u.record,lookups:u.lookups,identity:Hk(a,u.display),referralOptions:m,currentUserId:typeof localStorage<`u`?localStorage.getItem(`userId`)??void 0:void 0,actions:L,onClose:()=>i?.(),variant:`popup`}),(0,l.jsx)(s.Modal,{title:`Choose approval method`,open:g,okText:`Approve`,confirmLoading:w,onOk:P,onCancel:()=>{w||(_(!1),x(null),C(null))},children:(0,l.jsxs)(s.Radio.Group,{value:v,onChange:e=>y(e.target.value),style:{display:`grid`,gap:12},children:[(0,l.jsx)(s.Radio,{value:`vms`,children:`Via VMS`}),(0,l.jsx)(s.Radio,{value:`mail`,children:`Via Mail`})]})}),(0,l.jsx)(s.Drawer,{open:E,placement:`right`,onClose:()=>{A||D(!1)},closable:!1,rootClassName:`mail-popup`,width:620,maskClosable:!1,footer:(0,l.jsxs)(`div`,{className:`mail-popup__footer`,children:[(0,l.jsx)(s.Button,{onClick:()=>D(!1),disabled:A,children:`Cancel`}),(0,l.jsx)(s.Button,{type:`primary`,loading:A,disabled:!F,onClick:I,children:`Send`})]}),children:O?(0,l.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:48},children:(0,l.jsx)(s.Spin,{size:`large`})}):(0,l.jsx)(iE,{value:M,onChange:N,moduleName:`submissions`,ready:!O,title:`Submit Via Mail`,contextRecords:[u.record?.submission??a]})})]})}Zk.propTypes={context:f.default.object,selectedIds:f.default.array,selectedRecords:f.default.array,moduleName:f.default.string,onClose:f.default.func};var Qk={title:`Manager Approve`,width:780,className:`fa-modal manager-approve-modal`,component:Zk},$k={submit:async()=>{}};function eA(...e){return e.map(e=>e==null?``:String(e).trim()).find(Boolean)??``}var tA=(e,t)=>!!e&&e.toLowerCase()===eA(t).toLowerCase();function nA(e,t,n){let r=eA(t.submittedBy);return eA(tA(r,n)||tA(r,e.submitSource)||tA(r,e.supplierName)||tA(r,e.source)||tA(r,e.candidateSource)?``:r,e.signatureEmail)}function rA(e,t={}){let n=t.employerName??e.supplierName??e.submitSource;return{client:t.clientName??e.clientName,role:t.jobTitle??e.jobTitle??e.designation,reqId:t.reqId??e.jobClientRefrenceId??e.mspReqId??e.submissionId,name:t.candidateName||[e.firstName,e.lastName].filter(Boolean).join(` `)||e.candidateFullName,location:t.jobLocation??e.city??e.currentLocation??e.jobLocation,vendor:n,submittedBy:nA(e,t,n),submittedAt:t.createdAt??e.createdAt,email:t.email??e.email,employerLocation:t.employerLocation,employerName:t.employerName}}function iA(e){let t=Array.isArray(e)?e:[];for(let e=t.length-1;e>=0;--e)if(String(t[e]?.activityType??``).trim().toLowerCase()===`cfo rejected`)return t[e];return null}function aA(e){return String(e??``).toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}function oA({selectedIds:e,selectedRecords:t,onClose:r}){let i=t?.[0]??{},a=e?.[0]??y_(i),[c,u]=(0,o.useState)(null),[d,f]=(0,o.useState)(``),[p,m]=(0,o.useState)(!0);(0,o.useEffect)(()=>{let e=!1;return m(!0),Promise.all([ov(a,i),n.un(`submission`,a).catch(()=>[])]).then(([t,n])=>{if(e)return;let r=iA(n);f(y_(t?.meta?.workforceEngagementId??i?.onboarding?.workforceEngagementId??i?.workforceEngagementId));let a=t?.meta?.rejectReasonComments||r?.activityComments||``;u({...t,record:{...t.record,submission:{...t.record.submission,cfoRejectionReason:a?aA(a):``,cfoRejectedAt:t?.meta?.rejectedAt??r?.activityTime??null}}})}).catch(t=>{e||(s.message.error(t?.message??`Unable to load finance details`),u({record:{submission:i},lookups:{},display:{}}))}).finally(()=>{e||m(!1)}),()=>{e=!0}},[a]);let h=(0,o.useMemo)(()=>({submissionReapproveSend:async({computed:e})=>{await xe(d,{submissionId:a,billRate:e.proposedRate,payRate:e.employerRate,currency:e.currencyRaw??e.currency,rateUnit:e.rateUnit,vmsPercent:e.clientVmsPercent}),await ye(a,{candidateProposedRate:e.proposedRate,candidateProposedRateCurrency:e.currencyRaw??e.currency,candidateProposedRateUnit:e.rateUnit,submitVia:`Mail`,context:`resend`}),s.message.success(`Re-approved and sent for CFO approval`),r?.({success:!0})}}),[a,d,r]);return p||!c?(0,l.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:48},children:(0,l.jsx)(s.Spin,{size:`large`})}):(0,l.jsx)(Y_,{type:Zg,record:c.record,lookups:c.lookups,identity:rA(i,c.display),currentUserId:typeof localStorage<`u`?localStorage.getItem(`userId`)??void 0:void 0,actions:h,onClose:()=>r?.(),variant:`popup`})}oA.propTypes={selectedIds:f.default.array,selectedRecords:f.default.array,onClose:f.default.func};var sA={title:`Re-Approve`,width:780,className:`fa-modal manager-approve-modal`,component:oA},cA={submit:async()=>{}},lA=[{id:1,name:`Re-Submission`},{id:2,name:`Candidate doesn't fit into the profile`},{id:3,name:`Incomplete candidate details - (Re-Submission)`}],uA={title:`Reject`,okText:`Reject`,okButtonDanger:!0,width:480,successMessage:`Submission rejected successfully`,fields:[{name:`rejectReason`,label:`Rejection Reasons`,type:`select`,required:!0,placeholder:`Select rejection reasons`,defaultOptions:lA.map(e=>({label:e.name,value:e.id}))},{name:`rejectReasonComments`,label:`Comments`,type:`textarea`,required:!0,rows:4}]},dA={submit:async(e,t)=>{let n=lA.find(t=>String(t.id)===String(e.rejectReason));await Se({submissionId:t.selectedIds[0],rejectReasonId:e.rejectReason,rejectReason:n?.name??``,rejectReasonComments:e.rejectReasonComments})}},fA={delete:uO,"quick-submit":zO,"add-notes":BO,"tag-to-job":KO,"change-status":ak,"remove-from-shortlist":ck,"add-to-groups":uk,"self-assign":mk,"others-assign":_k,"sticky-notes":yk,"move-to-onboarding":xk,"approve-rate":Dk,"manager-approve":Qk,"manager-reapprove":sA,reject:uA},pA={delete:dO,"quick-submit":RO,"add-notes":UO,"tag-to-job":ik,"change-status":sk,"remove-from-shortlist":lk,"add-to-groups":dk,"self-assign":hk,"others-assign":vk,"sticky-notes":bk,"move-to-onboarding":Sk,"approve-rate":Ok,"manager-approve":$k,"manager-reapprove":cA,reject:dA};function mA(e){let t=e?.data??e;return Array.isArray(t)?t:t?.data??t?.rows??t?.records??t?.items??t?.list??[]}function hA(e,...t){for(let n of t){let t=String(n).split(`.`).reduce((e,t)=>e?.[t],e);if(t!=null&&t!==``)return t}return``}function gA(e){let t=String(hA(e,`isDeleted`,`deleted`)).toLowerCase(),n=String(hA(e,`assignmentStatus`,`status`)).toLowerCase();return t!==`true`&&t!==`1`&&![`removed`,`inactive`,`deleted`].includes(n)}function _A(e){let t=hA(e,`candidateName`,`candidate_name`,`fullName`,`name`);return t?String(t):[hA(e,`firstName`,`first_name`),hA(e,`lastName`,`last_name`)].filter(Boolean).join(` `)||`Unnamed candidate`}function vA(e){return String(hA(e,`candidateId`,`candidate_id`,`candidate._id`,`candidate.id`))}function yA(e){return String(hA(e,`workforceEngagementId`,`engagementId`,`_id`,`id`))}function bA(e){return String(hA(e,`batchName`,`name`,`title`,`batch_name`))}function xA({open:e=!0,context:r={},onClose:i}){let[a,c]=(0,o.useState)([]),[u,d]=(0,o.useState)([]),[f,p]=(0,o.useState)(``),[m,h]=(0,o.useState)(!0),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)(``),[b,x]=(0,o.useState)(new Map),S=String(r.selectedIds?.[0]??r.selectedRecords?.[0]?._id??r.selectedRecords?.[0]?.id??r.batchId??``);(0,o.useEffect)(()=>{if(!e)return;let t=!1;return Promise.resolve().then(()=>(t||h(!0),Promise.all([n.yn(`onboarding`,200,0),n.yn(`batchCandidates`,1e3,0).catch(()=>[])]))).then(([e,n])=>{t||(c(mA(e)),x(new Map(mA(n).filter(gA).map(e=>[String(hA(e,`candidateId`,`candidate_id`)),e]).filter(([e])=>e))))}).catch(e=>{t||y(e.message||`Unable to load onboarding candidates`)}).finally(()=>{t||h(!1)}),()=>{t=!0}},[e]);let C=(0,o.useMemo)(()=>{let e=f.trim().toLowerCase();return e?a.filter(t=>[_A(t),hA(t,`email`,`candidateEmail`,`candidate_email`),hA(t,`status`,`onboardingStatus`,`onboarding_status`)].some(t=>String(t).toLowerCase().includes(e))):a},[a,f]);async function w(){if(!S){y(`Select a batch before adding candidates`);return}let e=a.filter(e=>u.includes(yA(e)));if(!e.length)return;let o=e.map(e=>({record:e,assignment:b.get(vA(e))})).filter(e=>e.assignment);if(o.length){let e=o.map(({record:e})=>_A(e)).join(`, `);y(`${e} ${o.length===1?`is`:`are`} already added to a batch. Each candidate can be added to only one batch.`);return}_(!0),y(``);try{let{userId:a}=t.s(),o=bA(r.selectedRecords?.[0])||bA(r);await Promise.all(e.map(e=>n.Xn(`batchCandidates`,{schemaVersion:1,batchId:S,batchName:o,candidateId:vA(e),workforceEngagementId:yA(e),source:`ONBOARDING`,assignmentStatus:`ASSIGNED`,assignedAt:new Date().toISOString(),assignedBy:a??0,isDeleted:!1}))),s.message.success(`${e.length} candidate${e.length===1?``:`s`} added to the batch`),i?.({refresh:!0})}catch(e){y(e.message||`Unable to add candidates to the batch`)}finally{_(!1)}}return(0,l.jsxs)(s.Modal,{open:e,title:`Add Candidate to Batch`,okText:`Add`,onOk:w,onCancel:()=>i?.(),okButtonProps:{disabled:u.length===0||!S,loading:g},cancelButtonProps:{disabled:g},closable:!g,maskClosable:!1,width:760,centered:!0,children:[v&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:v,style:{marginBottom:12}}),(0,l.jsx)(s.Input.Search,{allowClear:!0,placeholder:`Search onboarding candidates`,value:f,onChange:e=>p(e.target.value),style:{marginBottom:12}}),(0,l.jsx)(s.Table,{rowKey:e=>yA(e),columns:[{title:`Candidate`,key:`candidate`,render:(e,t)=>_A(t)},{title:`Email`,key:`email`,render:(e,t)=>hA(t,`email`,`candidateEmail`,`candidate_email`)||`—`},{title:`Onboarding status`,key:`status`,render:(e,t)=>hA(t,`status`,`onboardingStatus`,`onboarding_status`)||`—`}],dataSource:C,loading:m,size:`small`,pagination:{pageSize:10,showSizeChanger:!1},rowSelection:{selectedRowKeys:u,onChange:d,getCheckboxProps:e=>{let t=b.get(vA(e));return{disabled:!vA(e)||!yA(e)||!!t,title:t?`Candidate is already added to a batch`:void 0}}},locale:{emptyText:m?`Loading candidates…`:`No onboarding candidates found`}})]})}var SA={text:`input`,string:`input`,textarea:`textarea`,date:`date-picker`,datepicker:`date-picker`,multiselect:`multi-select`,lookup:`search-select`};function CA(e){if(!e)return null;let t=[...e.groups??[]].sort((e,t)=>Number(e.order??0)-Number(t.order??0)).flatMap(e=>[...e.fields??[]].filter(e=>e.show!==0&&e.show!==!1).sort((e,t)=>Number(e.order??0)-Number(t.order??0)).map(e=>({...e,name:e.name??e.field,label:e.label??e.field,type:SA[String(e.type??`text`).toLowerCase()]??e.type??`input`,required:e.required??e.req===1,options:(e.options??[]).map(e=>({label:e.label??e.name??e.value,value:e.value??e.id??e.label}))}))),n=wA(e.successNavigate);return{title:e.label,fields:t,...n?{successNavigate:n}:{}}}function wA(e){let t=String(e??``).trim();return!t||!t.startsWith(`/`)||t.startsWith(`//`)||/^[a-z][a-z0-9+.-]*:/i.test(t)?null:t}function TA(e,t=[]){if(!e||!Array.isArray(t)||!t.length)return e;let n=new Map(t.filter(e=>e?.name).map(e=>[String(e.name),e]));return n.size?{...e,fields:(e.fields??[]).map(r=>{let i=n.get(String(r.name))??n.get(String(r.label))??(n.size===1&&(e.fields??[]).length===1?t[0]:null);if(!i)return r;let{name:a,...o}=i;return{...r,...o}})}:e}function EA({apiMap:e={},extraConfigs:r={}}){let i=(0,o.useMemo)(()=>({...pA,...e}),[e]),a=(0,o.useMemo)(()=>{let e={...fA};return Object.entries(r).forEach(([t,n])=>{e[t]={...e[t]??{},...n}}),e},[r]),{popupKey:s}=(0,d.useParams)(),c=(0,d.useNavigate)(),{state:u={}}=(0,d.useLocation)(),[f,p]=(0,o.useState)({key:``,config:null});(0,o.useEffect)(()=>{let e=!1;if(!s||!u.moduleName)return;let t=`${u.moduleName}:${s}`;return n.xr(u.moduleName,`popup`,s).then(n=>{e||p({key:t,config:CA(n[0])})}).catch(()=>{e||p({key:t,config:null})}),()=>{e=!0}},[s,u.moduleName]);let m=(0,o.useMemo)(()=>{let e=a[s],t=`${u.moduleName}:${s}`,n=f.key===t?f.config:null;return TA(n?{...e,...n}:e,u.popupAction?.popupFieldOverrides)},[f,a,s,u.moduleName,u.popupAction?.popupFieldOverrides]),h=(0,o.useMemo)(()=>({selectedIds:u.selectedIds??[],selectedRecords:u.selectedRecords??[],moduleName:u.moduleName??``,navigate:c,background:u.background??null,...u.popupContext??{}}),[c,u.selectedIds,u.selectedRecords,u.moduleName,u.popupContext,u.background]),g=(0,o.useMemo)(()=>{let e=u.popupAction;return e?.apiPath?{submit:(n,r)=>{let i=String(e.apiMethod||`POST`).toUpperCase();return t.o(t.x,e.apiPath.startsWith(`/`)?e.apiPath:`/${e.apiPath}`,{method:i,body:[`GET`,`DELETE`].includes(i)?void 0:JSON.stringify({...n,selectedIds:r.selectedIds,selectedRecords:r.selectedRecords,moduleName:r.moduleName})})}}:{}},[u.popupAction]),_=e=>{let t=u.background;if(e?.success&&m?.successNavigate){c(m.successNavigate,{replace:!0,state:{refreshTimestamp:Date.now()}});return}if(e?.success&&t?.pathname){c(`${t.pathname}${t.search??``}`,{replace:!0,state:{...t.state??{},refreshTimestamp:Date.now()}});return}c(-1)};return s===`add-batch-candidate`?(0,l.jsx)(xA,{open:!0,context:h,onClose:_}):(0,l.jsx)(lO,{open:!0,config:m,context:h,onClose:_,api:{...i[s]??{},...g}})}var DA={title:`Vendor Share`,maxVendorSelect:1e3,defaultTab:`myVendor`,defaultPageSize:10,vendorTabs:[{key:`myVendor`,label:`My Vendors`},{key:`allVendor`,label:`All Vendors`}],vendorColumns:[{title:`Vendor Name`,dataIndex:`vendorName`,key:`vendorName`},{title:`Email`,dataIndex:`vendorEmail`,key:`vendorEmail`},{title:`Location`,dataIndex:`vendorLocation`,key:`vendorLocation`},{title:`Updated On`,dataIndex:`updatedOn`,key:`updatedOn`}]},OA={getVendorList:({jobId:e,limit:t,offset:n,type:r})=>dn({jobId:e,limit:t,offset:n,sortBy:`new`,type:r}),getMailDetails:e=>fn(e),submit:({jobId:e,toMail:t,ccMail:n,bccMail:r,subject:i,contents:a})=>mn({jobId:e,toMail:t,ccMail:n,bccMail:r,subject:i,contents:a})},kA=DA.vendorColumns.map(e=>({...e,render:e=>e||`-`}));function AA(){let e=(0,d.useNavigate)(),t=(0,d.useLocation)(),{selectedIds:n=[],selectedRecords:r=[],recipients:i=[],subject:a=``,onSend:u,moduleName:f=``,popupAction:p={}}=t.state??{},m=n[0]??r[0]?._id??r[0]?.id,[h,g]=(0,o.useState)({to:i.join(`, `),cc:``,bcc:``,subject:a,contents:``,showCc:!1,showBcc:!1}),[_,v]=(0,o.useState)(!m),[y,b]=(0,o.useState)(DA.defaultTab),[x,S]=(0,o.useState)(``),[C,w]=(0,o.useState)([]),[T,E]=(0,o.useState)(0),[D,O]=(0,o.useState)(0),[k,A]=(0,o.useState)(0),[j,M]=(0,o.useState)(1),[N,P]=(0,o.useState)(DA.defaultPageSize),[F,I]=(0,o.useState)(!1),[L,R]=(0,o.useState)([]);(0,o.useEffect)(()=>{if(!m)return;let e=!1;I(!0);let t=x?100:N,n=x?0:(j-1)*N;return OA.getVendorList({jobId:m,limit:t,offset:n,type:y}).then(t=>{if(e)return;let n=t?.data?.vendorList??t?.data??[],r=t?.data?.myVendorCount??0,i=t?.data?.allVendorCount??0;w(Array.isArray(n)?n:[]),E(r),O(i),A(y===`myVendor`?r:i)}).catch(()=>{e||(w([]),A(0))}).finally(()=>{e||I(!1)}),()=>{e=!0}},[m,y,j,N,x]),(0,o.useEffect)(()=>{m&&OA.getMailDetails(m).then(e=>g(t=>({...t,subject:e.subject||t.subject,contents:e.contents||t.contents,to:e.toMail?.length?Array.isArray(e.toMail)?e.toMail.join(`, `):String(e.toMail):t.to,cc:e.ccMail?.length?Array.isArray(e.ccMail)?e.ccMail.join(`, `):String(e.ccMail):t.cc}))).catch(()=>{}).finally(()=>v(!0))},[m]);let z=(0,o.useMemo)(()=>L.map(e=>C.find(t=>t.vendorId===e)?.vendorEmail??``).filter(Boolean),[L,C]),B=(0,o.useMemo)(()=>({...h,bcc:[...new Set([...GT(h.bcc),...z])].join(`, `),showBcc:h.showBcc||z.length>0}),[h,z]);function V(e){let t=new Set(z);g({...e,bcc:GT(e.bcc).filter(e=>!t.has(e)).join(`, `)})}let H=(GT(B.to).length||GT(B.bcc).length)&&KT(B.to)&&KT(B.cc)&&KT(B.bcc)&&B.subject.trim(),U=e=>e===`myVendor`?T:D;function ee(){e(-1)}function te(){H&&OA.submit({jobId:m,toMail:GT(B.to),ccMail:GT(B.cc),bccMail:GT(B.bcc),subject:B.subject,contents:B.contents}).then(t=>{t?.status===!0?(s.message.success(t?.data||`Mail sent successfully.`),typeof u==`function`&&u({...B,message:B.contents,selectedIds:n}),e(-1)):s.message.error(t?.message||t?.data||`Failed to send mail. Please try again.`)}).catch(e=>{s.message.error(e?.message||`Failed to send mail. Please try again.`)})}let ne=(0,o.useMemo)(()=>{if(!x)return C;let e=x.toLowerCase();return C.filter(t=>(t.vendorName??``).toLowerCase().includes(e)||(t.vendorEmail??``).toLowerCase().includes(e)||(t.vendorLocation??``).toLowerCase().includes(e))},[C,x]);return(0,l.jsx)(s.Drawer,{open:!0,placement:`right`,onClose:ee,closable:!1,rootClassName:`vendor-share`,width:`95%`,footer:(0,l.jsxs)(`div`,{className:`vendor-share__footer`,children:[(0,l.jsx)(s.Button,{onClick:ee,children:`Cancel`}),(0,l.jsx)(s.Button,{type:`primary`,disabled:!H,onClick:te,children:`Send`})]}),children:(0,l.jsxs)(`div`,{className:`vendor-share__body`,children:[(0,l.jsxs)(`div`,{className:`vendor-share__left`,children:[(0,l.jsxs)(`div`,{className:`vendor-share__vendor-header`,children:[(0,l.jsxs)(`div`,{className:`vendor-share__vendor-header-row`,children:[(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.CloseOutlined,{}),onClick:ee,size:`small`,style:{marginRight:8}}),(0,l.jsx)(`span`,{className:`dynamic-popup__header-icon-box`,children:(0,l.jsx)(c.TeamOutlined,{})}),(0,l.jsx)(`span`,{className:`dynamic-popup__header-label`,children:`Vendor List`}),(0,l.jsxs)(`div`,{className:`vendor-share__vendor-search`,children:[(0,l.jsx)(c.SearchOutlined,{className:`vendor-share__search-icon`}),(0,l.jsx)(s.Input,{variant:`borderless`,placeholder:`Search vendor`,value:x,onChange:e=>{S(e.target.value),M(1)},className:`vendor-share__search-input`})]})]}),(0,l.jsx)(`div`,{className:`vendor-share__vendor-tabs`,children:DA.vendorTabs.map(e=>(0,l.jsxs)(`span`,{className:`vendor-share__vendor-tab${y===e.key?` vendor-share__vendor-tab--active`:``}`,onClick:()=>{b(e.key),M(1),R([])},children:[e.label,` (`,U(e.key),`)`]},e.key))})]}),(0,l.jsx)(`div`,{className:`vendor-share__vendor-table-wrapper`,children:(0,l.jsx)(s.Table,{rowKey:e=>e.vendorId,columns:kA,dataSource:ne,loading:F,pagination:!1,size:`small`,rowSelection:{selectedRowKeys:L,onChange:e=>{e.length>DA.maxVendorSelect||R(e)}},scroll:{y:`calc(100vh - 340px)`}})}),(0,l.jsx)(`div`,{className:`vendor-share__vendor-footer`,children:(0,l.jsx)(Re,{current:j,pageSize:N,total:k,onChange:e=>M(e),onPageSizeChange:e=>P(e)})})]}),(0,l.jsx)(`div`,{className:`vendor-share__right`,children:(0,l.jsx)(iE,{value:B,onChange:V,moduleName:f,defaultTemplateId:p.defaultTemplateId??t.state?.defaultTemplateId??``,ready:_,contextRecords:r,title:`Share`,hint:`Select vendors or add email addresses`,bccHint:`Vendor emails are added automatically`,afterBcc:L.length>0?(0,l.jsxs)(`div`,{className:`vendor-share__selected-count`,children:[L.length,` / `,DA.maxVendorSelect,` Vendors selected`]}):null})})]})})}var jA={EMAIL:/^[a-zA-Z0-9._%+-]+@[a-zA-Z][a-zA-Z-]*\.[a-zA-Z]{2,}$/,PHONE:/^[0-9]{10}$/,PASSWORD:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,ALPHABETS:/^[A-Za-z ]+$/,ALPHANUMERIC:/^(?!\s)[A-Za-z0-9 ]+$/,NUMBER:/^[0-9]+$/,URL:/^(https?:\/\/)?(www\.)?([a-zA-Z0-9-]+\.)+(com|org|net|in|co|io|gov|edu)(\/[^\s]*)?$/i,CANDIDATE_ID:/^[A-Za-z0-9-]+$/,REMARKS:/^[A-Za-z0-9\s.,'"\-()!?/@#$%&]*$/,DESIGNATION:/^[a-zA-Z0-9\s,.\-&()]{2,100}$/,DOB:/^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/,COMPANY_NAME:/^[A-Za-z0-9\s&.,'()-]+$/,FIRST_NAME:/^[A-Z][a-zA-Z]*$/,FULL_NAME:/^[A-Z][a-zA-Z]*(?: [A-Z][a-zA-Z]*)*$/,NO_SPACES:/^\S+$/,STARTS_WITH_CAPITAL:/^[A-Z].*$/},MA={SINGLE_FILE_COUNT:1,MULTI_FILE_COUNT:5,MAX_FILE_SIZE:2,ALLOWED_FILE_TYPES:[`image/jpeg`,`image/png`,`application/pdf`]},NA={REQUIRED:e=>`Mandatory Field`,INVALID_EMAIL:`Please enter a valid email address.`,INVALID_PHONE:`Phone number must contain exactly 10 digits.`,INVALID_PASSWORD:`Password must contain uppercase, lowercase, number, special character and minimum 8 characters.`,INVALID_ALPHABETS:`Only alphabets and spaces are allowed.`,INVALID_ALPHANUMERIC:`Only letters, numbers and spaces are allowed.`,INVALID_NUMBER:`Only numbers are allowed.`,INVALID_URL:`Please enter a valid URL.`,INVALID_CANDIDATE_ID:e=>`${e} can contain only letters, numbers and hyphens.`,INVALID_REMARKS:`Remarks contain invalid characters.`,INVALID_DESIGNATION:`Designation contains invalid characters.`,INVALID_DOB:`DOB must be in MM/DD/YYYY format.`,INVALID_LINKEDIN:`Please enter a valid LinkedIn URL.`,INVALID_COMPANY_NAME:`Company name contains invalid characters.`,INVALID_FIRST_NAME:`First letter must be capital and spaces are not allowed.`,INVALID_FULL_NAME:`Each word must start with a capital letter.`,NO_SPACES_ALLOWED:`Spaces are not allowed.`,MUST_START_WITH_CAPITAL:`First letter must be capital.`,INVALID_FILE_TYPE:`Only JPG, PNG and PDF files are allowed.`,INVALID_FILE_SIZE:`File upload must be ${MA.MAX_FILE_SIZE} MB below.`,INVALID_FILE_TYPE:`Only JPG, PNG and PDF files are allowed.`,SINGLE_FILE_ONLY:`Only one file can be uploaded.`},PA={FIRST_NAME_MIN:3,FIRST_NAME_MAX:30},FA={REMARKS_MIN:10,REMARKS_MAX:250},IA={removeSpaces:(e=``)=>e.replace(/\s/g,``),capitalizeFirstLetter:(e=``)=>e.charAt(0).toUpperCase()+e.slice(1),capitalizeWords:(e=``)=>e.replace(/\b\w/g,e=>e.toUpperCase()),removeExtraSpaces:(e=``)=>e.replace(/\s+/g,` `).trim(),firstNameFormatter:(e=``)=>e.replace(/\s+/g,` `).trimStart().replace(/\b\w/g,e=>e.toUpperCase()),fullNameFormatter:(e=``)=>e.replace(/\s+/g,` `).trimStart().replace(/\b\w/g,e=>e.toUpperCase()),phoneFormatter:(e=``)=>e.replace(/\D/g,``).slice(0,10),dobFormatter:(e=``)=>{let t=e.replace(/\D/g,``);return t.length<=2?t:t.length<=4?`${t.slice(0,2)}/${t.slice(2)}`:`${t.slice(0,2)}/${t.slice(2,4)}/${t.slice(4,8)}`}},LA={required:(e=`Field`)=>({required:!0,message:NA.REQUIRED(e)}),email:()=>({pattern:jA.EMAIL,message:NA.INVALID_EMAIL}),phone:()=>({pattern:jA.PHONE,message:NA.INVALID_PHONE}),password:()=>({pattern:jA.PASSWORD,message:NA.INVALID_PASSWORD}),alphabets:()=>({pattern:jA.ALPHABETS,message:NA.INVALID_ALPHABETS}),alphanumeric:()=>({pattern:jA.ALPHANUMERIC,message:NA.INVALID_ALPHANUMERIC}),number:()=>({pattern:jA.NUMBER,message:NA.INVALID_NUMBER}),url:()=>({pattern:jA.URL,message:NA.INVALID_URL}),candidateId:(e=`ID`)=>({pattern:jA.CANDIDATE_ID,message:NA.INVALID_CANDIDATE_ID(e)}),remarks:()=>({pattern:jA.REMARKS,message:NA.INVALID_REMARKS,REMARKS_MIN:`Remarks must be at least ${FA.REMARKS_MIN} characters.`,REMARKS_MAX:`Remarks must not exceed ${FA.REMARKS_MAX} characters.`}),designation:()=>({pattern:jA.DESIGNATION,message:NA.INVALID_DESIGNATION}),dob:(e=!0)=>({validator:(t,n)=>{if(!n)return e?Promise.reject(Error(`Date of Birth is required.`)):Promise.resolve();if(!jA.DOB.test(n))return Promise.reject(Error(NA.INVALID_DOB));let r=(0,u.default)(n,`MM/DD/YYYY`,!0);if(!r.isValid())return Promise.reject(Error(NA.INVALID_DOB));let i=(0,u.default)().endOf(`day`);return r.isAfter(i)?Promise.reject(Error(`Date of Birth cannot be a future date.`)):i.diff(r,`year`)<21?Promise.reject(Error(`Age must be at least 21 years.`)):Promise.resolve()}}),linkedin:()=>({pattern:jA.LINKEDIN,message:NA.INVALID_LINKEDIN}),companyName:()=>({pattern:jA.COMPANY_NAME,message:NA.INVALID_COMPANY_NAME}),firstName:()=>({pattern:jA.FIRST_NAME,message:NA.INVALID_FIRST_NAME,FIRST_NAME_MIN:`First Name must be at least ${PA.FIRST_NAME_MIN} characters.`,FIRST_NAME_MAX:`First Name must not exceed ${PA.FIRST_NAME_MAX} characters.`}),firstNameMinLength:()=>({min:PA.FIRST_NAME_MIN,message:NA.FIRST_NAME_MIN}),firstNameMaxLength:()=>({max:PA.FIRST_NAME_MAX,message:NA.FIRST_NAME_MAX}),remarksMinLength:()=>({min:FA.REMARKS_MIN,message:NA.REMARKS_MIN}),remarksMaxLength:()=>({max:FA.REMARKS_MAX,message:NA.REMARKS_MAX}),fullName:()=>({pattern:jA.FULL_NAME,message:NA.INVALID_FULL_NAME}),noSpaces:()=>({pattern:jA.NO_SPACES,message:NA.NO_SPACES_ALLOWED}),startsWithCapital:()=>({pattern:jA.STARTS_WITH_CAPITAL,message:NA.MUST_START_WITH_CAPITAL}),fileUpload:()=>({validator:(e,t)=>{if(!t||t.length===0)return Promise.resolve();for(let e of t){let t=e.originFileObj||e;if(!(t.size/1024/1024<=MA.MAX_FILE_SIZE))return s.message.error(NA.INVALID_FILE_SIZE),Promise.reject(Error(NA.INVALID_FILE_SIZE));if(!MA.ALLOWED_FILE_TYPES.includes(t.type))return Promise.reject(Error(NA.INVALID_FILE_TYPE))}return Promise.resolve()}}),singleFileUpload:()=>({validator:(e,t)=>{if(!t||t.length===0)return Promise.resolve();if(t.length>MA.SINGLE_FILE_COUNT)return Promise.reject(Error(NA.SINGLE_FILE_ONLY));let n=t[0];return n.size/1024/1024<MA.MAX_FILE_SIZE?MA.ALLOWED_FILE_TYPES.includes(n.type)?Promise.resolve():Promise.reject(Error(NA.INVALID_FILE_TYPE)):Promise.reject(Error(NA.INVALID_FILE_SIZE))}}),multiFileUpload:()=>({validator:(e,t)=>{if(!t||t.length===0)return Promise.resolve();if(t.length>MA.MULTI_FILE_COUNT)return Promise.reject(Error(NA.INVALID_FILE_COUNT));for(let e of t){if(!(e.size/1024/1024<MA.MAX_FILE_SIZE))return Promise.reject(Error(NA.INVALID_FILE_SIZE));if(!MA.ALLOWED_FILE_TYPES.includes(e.type))return Promise.reject(Error(NA.INVALID_FILE_TYPE))}return Promise.resolve()}})},RA={beforeUpload:e=>[`image/jpeg`,`image/png`,`application/pdf`].includes(e.type)?e.size/1024/1024<=2?!1:(s.message.error(`File upload must be 2 MB below.`),s.Upload.LIST_IGNORE):(s.message.error(`Only JPG, PNG and PDF files are allowed.`),s.Upload.LIST_IGNORE)},zA=()=>{let[e]=s.Form.useForm();return(0,l.jsx)(`div`,{style:{padding:24},children:(0,l.jsxs)(s.Form,{form:e,layout:`vertical`,onFinish:e=>{console.log(`Form Values:`,e)},autoComplete:`off`,children:[(0,l.jsxs)(s.Row,{gutter:16,children:[(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Email`,name:`email`,rules:[LA.required(`Email`),LA.email()],children:(0,l.jsx)(s.Input,{})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Phone Number`,name:`phone`,rules:[LA.required(`Phone Number`),LA.phone()],validateTrigger:[`onBlur`,`onChange`],children:(0,l.jsx)(s.Input,{maxLength:10,onChange:t=>{e.setFieldsValue({phone:IA.phoneFormatter(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Password`,name:`password`,rules:[LA.required(`Password`),LA.password()],children:(0,l.jsx)(s.Input.Password,{})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Full Name`,name:`fullName`,rules:[LA.required(`Full Name`),LA.alphabets(),LA.firstNameMinLength(),LA.firstNameMaxLength()],children:(0,l.jsx)(s.Input,{onChange:t=>{e.setFieldsValue({fullName:IA.firstNameFormatter(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Username`,name:`username`,rules:[LA.required(`Username`),LA.alphanumeric()],children:(0,l.jsx)(s.Input,{onChange:t=>{e.setFieldsValue({username:IA.removeExtraSpaces(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Website URL`,name:`website`,rules:[LA.required(`Website URL`),LA.url()],children:(0,l.jsx)(s.Input,{onChange:t=>{e.setFieldsValue({website:IA.removeExtraSpaces(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`MSP Req ID`,name:`mspreqID`,rules:[LA.required(`MSP Req ID`),LA.candidateId(`MSP Req ID`)],children:(0,l.jsx)(s.Input,{onChange:t=>{e.setFieldsValue({mspreqID:IA.removeExtraSpaces(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Candidate ID`,name:`candidateId`,rules:[LA.required(`Candidate ID`),LA.candidateId(`Candidate ID`)],children:(0,l.jsx)(s.Input,{onChange:t=>{e.setFieldsValue({candidateId:IA.removeExtraSpaces(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:24,children:(0,l.jsx)(s.Form.Item,{label:`Remarks`,name:`remarks`,rules:[LA.required(`Remarks`),LA.remarks(),LA.remarksMinLength(),LA.remarksMaxLength()],children:(0,l.jsx)(s.Input.TextArea,{rows:4})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Designation`,name:`designation`,rules:[LA.required(`Designation`),LA.designation()],children:(0,l.jsx)(s.Input,{})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Date of Birth`,name:`dob`,rules:[LA.dob()],children:(0,l.jsx)(s.Input,{placeholder:`MM/DD/YYYY`,maxLength:10,onChange:t=>{e.setFieldsValue({dob:IA.dobFormatter(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Company Name`,name:`companyName`,rules:[LA.required(`Company Name`),LA.companyName()],children:(0,l.jsx)(s.Input,{})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{name:`contractType`,label:`Contract Type`,children:(0,l.jsxs)(s.Select,{showSearch:!0,allowClear:!0,filterOption:(e,t)=>(t?.label??``).toLowerCase().includes(e.toLowerCase()),children:[(0,l.jsx)(s.Select.Option,{value:`C2C`,label:`C2C`,children:`C2C`}),(0,l.jsx)(s.Select.Option,{value:`W2-Contract`,label:`W2-Contract`,children:`W2-Contract`}),(0,l.jsx)(s.Select.Option,{value:`W2-Fulltime`,label:`W2-Fulltime`,children:`W2-Fulltime`}),(0,l.jsx)(s.Select.Option,{value:`1099`,label:`1099`,children:`1099`})]})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{name:`candidateProposedRateCurrency`,label:`Currency`,children:(0,l.jsxs)(s.Select,{showSearch:!0,allowClear:!0,children:[(0,l.jsx)(s.Select.Option,{value:`$`,children:`$`}),(0,l.jsx)(s.Select.Option,{value:`₹`,children:`₹`}),(0,l.jsx)(s.Select.Option,{value:`€`,children:`€`}),(0,l.jsx)(s.Select.Option,{value:`zł`,children:`zł`}),(0,l.jsx)(s.Select.Option,{value:`£`,children:`£`}),(0,l.jsx)(s.Select.Option,{value:`kr`,children:`kr`}),(0,l.jsx)(s.Select.Option,{value:`Fr`,children:`Fr`}),(0,l.jsx)(s.Select.Option,{value:`kr`,children:`kr`})]})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Resume new`,name:`resume`,children:(0,l.jsx)(s.Upload,{beforeUpload:RA.beforeUpload,maxCount:1,children:(0,l.jsx)(s.Button,{children:`Upload Resume`})})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Documents`,name:`documents`,valuePropName:`fileList`,getValueFromEvent:e=>e?.fileList,rules:[LA.multiFileUpload()],children:(0,l.jsx)(s.Upload,{multiple:!0,beforeUpload:RA.beforeUpload,children:(0,l.jsx)(s.Button,{children:`Upload Documents`})})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Upload File`,name:`file`,valuePropName:`fileList`,getValueFromEvent:e=>e?.fileList,rules:[LA.fileUpload()],children:(0,l.jsx)(s.Upload,{beforeUpload:RA.beforeUpload,maxCount:1,children:(0,l.jsx)(s.Button,{children:`Upload`})})})})]}),(0,l.jsx)(s.Row,{children:(0,l.jsx)(s.Form.List,{name:`users`,children:(e,{add:t,remove:n})=>(0,l.jsxs)(l.Fragment,{children:[e.map(({key:e,name:t,...r})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{required:!0,...r,rules:[{required:!0,message:`First name is requried`}],name:[t,`first`],children:(0,l.jsx)(s.Input,{placeholder:`First Name`})})}),(0,l.jsx)(s.Col,{span:11,children:(0,l.jsx)(s.Form.Item,{...r,required:!0,name:[t,`last`],children:(0,l.jsx)(s.Input,{placeholder:`Last Name`})})}),(0,l.jsx)(s.Col,{span:1,children:(0,l.jsx)(c.MinusCircleOutlined,{onClick:()=>n(t)})})]})),(0,l.jsx)(s.Form.Item,{children:(0,l.jsx)(s.Button,{type:`dashed`,onClick:()=>t(),block:!0,icon:(0,l.jsx)(c.PlusOutlined,{}),children:`Add field`})})]})})}),(0,l.jsxs)(s.Form.Item,{children:[(0,l.jsx)(s.Button,{type:`primary`,htmlType:`submit`,children:`Submit`}),(0,l.jsx)(s.Button,{style:{marginLeft:10},onClick:()=>e.resetFields(),children:`Reset`})]})]})})};function BA(e){return(0,l.jsx)(wy,{children:(0,l.jsx)(BT,{...e})})}var{Text:VA}=s.Typography,HA=[{label:`Total Jobs`,value:1697,icon:`fileText`},{label:`Active Jobs`,value:1685,icon:`checkCircle`},{label:`My Jobs`,value:600,icon:`user`}],UA={fileText:(0,l.jsx)(c.FileTextOutlined,{}),checkCircle:(0,l.jsx)(c.CheckCircleOutlined,{}),user:(0,l.jsx)(c.UserOutlined,{}),filter:(0,l.jsx)(c.FilterOutlined,{})};function WA({stats:e=HA}){return(0,l.jsx)(s.Card,{children:(0,l.jsx)(s.Row,{gutter:[12,12],children:e.map(e=>(0,l.jsx)(s.Col,{xs:24,sm:24,md:8,lg:8,xl:8,children:(0,l.jsxs)(s.Card,{className:`stats-inner-card`,children:[(0,l.jsxs)(s.Space,{align:`center`,children:[UA[e.icon]??UA.fileText,(0,l.jsx)(VA,{children:e.label})]}),(0,l.jsx)(s.Statistic,{value:e.value})]})},e.label))})})}var{Text:GA}=s.Typography;function KA(e){return e?.USER_NAME??e?.user_name??e?.username??e?.name??e?.full_name??e?.fullName??e?.email??`User ${e?.USER_ID??e?.user_id??`?`}`}function qA(e){return{...e,key:e.USER_ID??e.user_id??e.userId??e.id??e._id,_name:KA(e),_email:e.email??e.EMAIL??e.user_email??``,_role:e.role_name??e.roleName??e.ROLE_NAME??``,_rawRef:e}}function JA(){let[e,t]=(0,o.useState)([]),[r,i]=(0,o.useState)(0),[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(1),[p,m]=(0,o.useState)(10),[h,g]=(0,o.useState)(``),_=(0,o.useCallback)(async({offset:e,limit:r,searchQuery:a}={})=>{u(!0);try{let o=await n.mr({offset:e,limit:r,searchQuery:a??``}),s=(o.users??[]).map(qA);t(s),i(o.total??s.length)}catch{s.message.error(`Failed to load users`)}finally{u(!1)}},[]);return(0,o.useEffect)(()=>{queueMicrotask(()=>{_({offset:(d-1)*p,limit:p,searchQuery:h})})},[_,d,p,h]),(0,l.jsx)(Z,{icon:(0,l.jsx)(c.TeamOutlined,{}),title:`Users`,style:{marginBottom:0},bodyStyle:{padding:0},children:(0,l.jsx)(vm,{listName:`Users`,dataSource:e,fields:[{label:`Name`,value:`_name`,width:220,render:(e,t)=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(GA,{strong:!0,style:{fontSize:13},children:e}),t._email&&(0,l.jsx)(`div`,{style:{fontSize:11,color:`var(--color-text-muted)`},children:t._email})]})},{label:`Role`,value:`_role`,width:180}],loading:a,total:r,current:d,pageSize:p,onPageChange:e=>f(e),onPageSizeChange:e=>{m(e),f(1)},onSearch:e=>{g(e),f(1)}})})}var{Text:YA}=s.Typography,XA=[{key:`job`,label:`Jobs`},{key:`candidate`,label:`Candidates`},{key:`submissions`,label:`Submissions`}],ZA=[{key:`listView`,label:`List View`},{key:`filter`,label:`Filter`},{key:`form`,label:`Form`}];function QA({field:e,index:t,onToggle:n,onReorder:r}){let i=(0,o.useRef)(null),[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(!1);function p(e){i.current=t,e.dataTransfer.effectAllowed=`move`,f(!0)}function m(){f(!1),u(!1)}function h(e){e.preventDefault(),u(!0)}function g(){u(!1)}function _(e){e.preventDefault(),u(!1),i.current!==null&&i.current!==t&&r(i.current,t),i.current=null}return(0,l.jsxs)(`div`,{draggable:!0,onDragStart:p,onDragEnd:m,onDragOver:h,onDragLeave:g,onDrop:_,className:`uss-field-row with-edit${a?` drag-over`:``}${d?` dragging`:``}`,children:[(0,l.jsx)(`span`,{className:`uss-drag-handle`,children:(0,l.jsx)(c.HolderOutlined,{})}),(0,l.jsxs)(`span`,{className:`uss-field-name`,children:[e.fieldName,(0,l.jsx)(`span`,{className:`uss-field-key`,children:e.fieldKey})]}),(0,l.jsx)(`span`,{className:`uss-toggle-cell`,children:(0,l.jsx)(s.Switch,{size:`small`,checked:e.isVisible,onChange:e=>n(t,`isVisible`,e)})}),(0,l.jsx)(`span`,{className:`uss-toggle-cell`,children:(0,l.jsx)(s.Switch,{size:`small`,checked:!!e.isEditable,onChange:e=>n(t,`isEditable`,e)})}),(0,l.jsx)(`span`,{className:`uss-toggle-cell`,children:(0,l.jsx)(s.Switch,{size:`small`,checked:!!e.ismandatory,onChange:e=>n(t,`ismandatory`,e)})})]})}function $A({team:e,configType:t}){let[r,i]=(0,o.useState)({}),[a,c]=(0,o.useState)(!1),[u,d]=(0,o.useState)({}),[f,p]=(0,o.useState)(`job`);(0,o.useEffect)(()=>{e&&(c(!0),n.Wr(e,t).then(i).catch(()=>s.message.error(`Failed to load field config`)).finally(()=>c(!1)))},[e,t]);let m=r[f]??[];function h(e,t){i(n=>({...n,[e]:typeof t==`function`?t(n[e]??[]):t}))}function g(e,t,n){h(f,r=>r.map((r,i)=>i===e?{...r,[t]:n}:r))}function _(e,t){h(f,n=>{let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),r.map((e,t)=>({...e,order:t}))})}async function v(){let r=f;d(e=>({...e,[r]:!0}));try{await n.hi(e,r,m,t),s.message.success(`Saved`)}catch{s.message.error(`Save failed`)}finally{d(e=>({...e,[r]:!1}))}}return(0,l.jsxs)(s.Spin,{spinning:a,children:[(0,l.jsx)(s.Tabs,{size:`small`,activeKey:f,onChange:p,items:XA.map(e=>({key:e.key,label:e.label}))}),(0,l.jsxs)(`div`,{className:`uss-field-header with-edit`,children:[(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{children:`Field`}),(0,l.jsx)(`span`,{style:{textAlign:`center`},children:`Visible`}),(0,l.jsx)(`span`,{style:{textAlign:`center`},children:`Editable`}),(0,l.jsx)(`span`,{style:{textAlign:`center`},children:`Mandatory`})]}),(0,l.jsxs)(`div`,{className:`uss-field-list`,children:[m.length===0&&!a&&(0,l.jsx)(`div`,{className:`uss-empty`,children:`No fields found.`}),m.map((e,t)=>(0,l.jsx)(QA,{field:e,index:t,onToggle:g,onReorder:_},e.fieldKey??t))]}),(0,l.jsx)(`div`,{className:`uss-modal-footer`,children:(0,l.jsxs)(s.Button,{type:`primary`,size:`small`,loading:u[f],onClick:v,children:[`Save `,XA.find(e=>e.key===f)?.label]})})]})}function ej(){let[e,t]=(0,o.useState)(null),[r,i]=(0,o.useState)(!1),[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(`listView`),[p,m]=(0,o.useState)([]),[h,g]=(0,o.useState)(0),[_,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(``),[x,S]=(0,o.useState)(!1),C=(0,o.useCallback)(async()=>{v(!0);try{let e=await n.pr();m(e.teams),g(e.total)}catch{s.message.error(`Failed to load teams`)}finally{v(!1)}},[]);(0,o.useEffect)(()=>{C()},[C]);function w(e){t(e),f(`listView`),i(!0)}function T(e){t(e),b(e.teamName??``),u(!0)}async function E(){if(!y.trim()){s.message.warning(`Team name is required`);return}S(!0);try{await n.mi(e,{teamName:y.trim(),managerId:e.managerId,memberIds:e.memberIds}),s.message.success(`Team updated`),u(!1),C()}catch{s.message.error(`Failed to update team`)}finally{S(!1)}}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Z,{icon:(0,l.jsx)(c.TeamOutlined,{}),title:`Teams`,style:{marginBottom:0},bodyStyle:{padding:0},children:(0,l.jsx)(vm,{listName:`Teams`,dataSource:p,fields:[{label:`Team Name`,value:`teamName`,width:200},{label:`Manager`,value:`manager`,width:200},{label:`Members`,value:`memberCount`,width:90,sorter:!1},{label:`Actions`,value:`_actions`,width:160,sorter:!1,render:(e,t)=>(0,l.jsxs)(`div`,{style:{display:`flex`,gap:4},children:[(0,l.jsx)(s.Button,{size:`small`,type:`link`,onClick:()=>T(t),children:`Edit`}),(0,l.jsx)(s.Button,{size:`small`,type:`link`,onClick:()=>w(t),children:`Configure`})]})}],loading:_,total:h})}),(0,l.jsx)(s.Modal,{open:a,onCancel:()=>u(!1),title:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.TeamOutlined,{style:{color:`var(--color-brand)`,marginRight:6}}),`Edit Team`]}),width:420,footer:null,destroyOnClose:!0,children:(0,l.jsxs)(`div`,{className:`uss-edit-team-body`,style:{paddingTop:12},children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`uss-edit-team-label`,children:`Team Name`}),(0,l.jsx)(s.Input,{value:y,onChange:e=>b(e.target.value),onPressEnter:E,placeholder:`Enter team name`})]}),(0,l.jsxs)(`div`,{className:`uss-modal-footer`,children:[(0,l.jsx)(s.Button,{onClick:()=>u(!1),children:`Cancel`}),(0,l.jsx)(s.Button,{type:`primary`,loading:x,onClick:E,children:`Save`})]})]})}),(0,l.jsxs)(s.Modal,{className:`uss-modal`,open:r,onCancel:()=>i(!1),title:(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(c.TeamOutlined,{style:{color:`var(--color-brand)`}}),(0,l.jsxs)(`span`,{children:[`Configure: `,e?.teamName]})]}),width:720,footer:null,destroyOnClose:!0,children:[(0,l.jsx)(`div`,{style:{marginBottom:12},children:(0,l.jsx)(`div`,{className:`uss-config-toggle`,children:ZA.map(e=>(0,l.jsx)(`button`,{className:`uss-config-btn${d===e.key?` active`:``}`,onClick:()=>f(e.key),children:e.label},e.key))})}),e&&(0,l.jsx)($A,{team:e,configType:d},`${e?.teamId}-${d}`)]})]})}var tj=[`view`,`add`,`edit`,`delete`],nj={view:`View`,add:`Add`,edit:`Edit`,delete:`Delete`,sourcing:`Sourcing`,assign:`Assign`,share:`Share`,change_status:`Status`,my_jobs:`My Jobs`,all_jobs:`All Jobs`,po_msa:`PO MSA`,reApprove:`ReApprove`,sendApprove:`Send Approve`};function rj(e){return nj[e]??e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function ij(e){let t=tj.filter(t=>e.includes(t)),n=e.filter(e=>!tj.includes(e)).sort();return[...t,...n]}function aj(e){let t=new Set;return Object.values(e).forEach(({permissions:e})=>Object.keys(e??{}).forEach(e=>t.add(e))),ij([...t])}function oj(e){let t=0,n=0;return Object.entries(e).forEach(([e,{permissions:r}])=>{Object.entries(r??{}).forEach(([r,{value:i}])=>{Pb(e,r)&&(n++,i===`1`&&t++)})}),{enabled:t,total:n}}function sj(e={}){if(!e||typeof e!=`object`)return e;let t=Object.keys(e).find(e=>String(e).trim().toLowerCase()===`onboarding`);if(!t)return e;let n=e[t]??{},r={...n.permissions??{}};for(let e of[`sendApprove`,`reApprove`])Object.keys(r).some(t=>t.toLowerCase()===e.toLowerCase())||(r[e]={id:0,value:`0`});return{...e,[t]:{...n,permissions:r}}}function cj({value:e,onSave:t,className:n}){let[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(e);(0,o.useEffect)(()=>{s(e)},[e]);function u(){i(!1);let n=a.trim();n&&n!==e?t(n):s(e)}return r?(0,l.jsx)(`input`,{autoFocus:!0,className:`perm-inline-input${n?` ${n}`:``}`,value:a,style:{width:Math.max(48,a.length*8)},onChange:e=>s(e.target.value),onBlur:u,onKeyDown:t=>{t.key===`Enter`&&u(),t.key===`Escape`&&(i(!1),s(e)),t.stopPropagation()},onClick:e=>e.stopPropagation()}):(0,l.jsxs)(`span`,{className:`perm-editable-name${n?` ${n}`:``}`,onDoubleClick:e=>{e.stopPropagation(),i(!0)},children:[e,(0,l.jsx)(c.EditOutlined,{className:`perm-name-edit-icon`})]})}function lj({entry:e,label:t,onToggle:n,onLabelSave:r}){let[i,a]=(0,o.useState)(!1),[u,d]=(0,o.useState)(t),f=e?.value===`1`,p=!!e;(0,o.useEffect)(()=>{d(t)},[t]);function m(){a(!1);let e=u.trim();e&&e!==t?r(e):d(t)}return(0,l.jsx)(s.Tooltip,{title:p?f?`Click to disable`:`Click to enable`:`Not applicable for this module`,children:(0,l.jsxs)(`div`,{className:`perm-action-pill${f?` on`:``}${p?``:` na`}`,onClick:()=>{!i&&p&&n()},children:[(0,l.jsx)(`span`,{className:`perm-action-pill-dot${f?` on`:``}`}),i?(0,l.jsx)(`input`,{autoFocus:!0,className:`perm-pill-input`,value:u,style:{width:Math.max(36,u.length*7)},onChange:e=>d(e.target.value),onBlur:m,onKeyDown:e=>{e.key===`Enter`&&m(),e.key===`Escape`&&(a(!1),d(t)),e.stopPropagation()},onClick:e=>e.stopPropagation()}):(0,l.jsx)(`span`,{className:`perm-action-pill-label`,onDoubleClick:e=>{e.stopPropagation(),a(!0)},children:t}),f&&!i&&(0,l.jsx)(c.CheckOutlined,{className:`perm-action-pill-check`})]})})}function uj({menuName:e,menuData:t,permKeys:n,onChange:r,displayName:i,actionLabels:a,onModuleLabelSave:o,onActionLabelSave:s}){let c=t?.permissions??{},u=n.filter(t=>Pb(e,t)),d=u.filter(e=>c[e]?.value===`1`).length,f=u.filter(e=>c[e]).length,p=f>0&&d===f;return(0,l.jsxs)(`div`,{className:`perm-module-card${p?` all-on`:d>0&&!p?` some-on`:``}`,children:[(0,l.jsxs)(`div`,{className:`perm-module-card-header`,children:[(0,l.jsx)(cj,{value:i,onSave:t=>o(e,t),className:`perm-module-card-name`}),f>0&&(0,l.jsxs)(`span`,{className:`perm-module-card-badge${d>0?` active`:``}`,children:[d,`/`,f]})]}),(0,l.jsx)(`div`,{className:`perm-module-card-body`,children:u.map(t=>(0,l.jsx)(lj,{entry:c[t],label:a[t]??rj(t),onToggle:()=>r(e,t),onLabelSave:e=>s(t,e)},t))})]})}function dj({role:e,moduleLabels:t={},actionLabels:r={},onModuleLabelSave:i=()=>{},onActionLabelSave:a=()=>{}}){let[u,d]=(0,o.useState)({}),[f,p]=(0,o.useState)({}),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)(!1),b=n.zr(e);(0,o.useEffect)(()=>{b&&(h(!0),y(!1),n.Hr(b).then(e=>{let t=sj(e);d(t),p(t)}).catch(()=>s.message.error(`Failed to load permissions`)).finally(()=>h(!1)))},[b]);function x(e,t){y(!0),p(n=>{let r=n[e]??{menuId:u[e]?.menuId??0,permissions:{}},i=r.permissions?.[t]??{id:0,value:`0`};return{...n,[e]:{...r,permissions:{...r.permissions,[t]:{...i,value:i.value===`1`?`0`:`1`}}}}})}async function S(){_(!0);try{await n.fi(b,f),d(f),y(!1),s.message.success(`Permissions saved`)}catch(e){s.message.error(e?.message||`Save failed`)}finally{_(!1)}}let C=(0,o.useMemo)(()=>Object.keys(f).sort(),[f]),w=(0,o.useMemo)(()=>aj(f),[f]),{enabled:T,total:E}=(0,o.useMemo)(()=>oj(f),[f]);return(0,l.jsxs)(s.Spin,{spinning:m,children:[(0,l.jsxs)(`div`,{className:`perm-panel-header`,children:[(0,l.jsxs)(`div`,{className:`perm-panel-title`,children:[(0,l.jsx)(c.LockOutlined,{style:{color:`var(--color-brand)`,marginRight:6}}),(0,l.jsx)(`span`,{children:e?.roleName}),!m&&E>0&&(0,l.jsxs)(s.Tag,{color:`blue`,style:{marginLeft:8,fontSize:11},children:[T,`/`,E,` enabled`]})]}),(0,l.jsx)(s.Button,{type:`primary`,size:`small`,icon:(0,l.jsx)(c.UnlockOutlined,{}),loading:g,disabled:!v,onClick:S,children:`Save Changes`})]}),(0,l.jsxs)(`div`,{className:`perm-hint`,children:[(0,l.jsx)(c.InfoCircleOutlined,{className:`perm-hint-icon`}),(0,l.jsxs)(`span`,{children:[`Click a pill to toggle. `,(0,l.jsx)(`strong`,{children:`Double-click`}),` a module name or action label to rename it — labels are saved locally.`]})]}),C.length===0&&!m?(0,l.jsx)(`div`,{className:`perm-empty`,children:`No permission entries found for this role.`}):(0,l.jsx)(`div`,{className:`perm-cards-grid`,children:C.map(e=>(0,l.jsx)(uj,{menuName:e,menuData:f[e],permKeys:w,onChange:x,displayName:t[e]??e,actionLabels:r,onModuleLabelSave:i,onActionLabelSave:a},e))})]})}var{Text:fj}=s.Typography,pj=[{key:`listView`,label:`List View`},{key:`filter`,label:`Filter`},{key:`form`,label:`Form`},{key:`permissions`,label:`Permissions`}];function mj(e){return String(e||``).replace(/[-_]/g,` `).replace(/\b\w/g,e=>e.toUpperCase()).trim()}function hj(e){return String(e||``).trim().toLowerCase()}function gj(e){return e?.key||e?.collectionName||e?.value||``}function _j(e=[],t=[]){let n=[],r=new Set,i=new Set,a=new Set;return e.forEach(e=>{let t=gj(e);if(!t)return;let o=hj(e.key||t),s=hj(e.collectionName);e.seeded&&(i.add(o),s&&i.add(s)),s&&a.add(s),r.add(t),n.push({label:e.label||mj(t),value:t,disabled:!!e.seeded})}),t.forEach(e=>{let t=String(e||``).trim();if(!t||r.has(t))return;let o=hj(t);a.has(o)||i.has(o)||(r.add(t),n.push({label:mj(t),value:t,disabled:!1}))}),n}function vj(){let[e,t]=(0,o.useState)(null),[r,i]=(0,o.useState)(!1),[a,u]=(0,o.useState)(`listView`),[d,f]=(0,o.useState)([]),[p,m]=(0,o.useState)(0),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)([]),[y,b]=(0,o.useState)([]),[x,S]=(0,o.useState)(!1),[C,w]=(0,o.useState)(!1),T=(0,o.useMemo)(()=>_.filter(e=>!e.disabled),[_]),E=!x&&T.length===0,D=(0,o.useCallback)(async()=>{g(!0);try{let e=await n.fr();f(e.roles),m(e.total)}catch{s.message.error(`Failed to load roles`)}finally{g(!1)}},[]),O=(0,o.useCallback)(async()=>{S(!0);try{let[e,t]=await Promise.all([n.wr(),n.gr()]),r=_j(e.modules,t),i=new Set(r.filter(e=>!e.disabled).map(e=>e.value));v(r),b(e=>e.filter(e=>i.has(e)))}catch{s.message.error(`Failed to load seed status`)}finally{S(!1)}},[]);(0,o.useEffect)(()=>{D()},[D]),(0,o.useEffect)(()=>{O()},[O]);async function k(){if(y.length===0){s.message.warning(E?`All modules already seeded.`:`Select at least one module to seed.`);return}w(!0);try{await n.ri(y),s.message.success(`Role field config seeded`),b([]),await O()}catch(e){s.message.error(e?.message||`Seed failed`)}finally{w(!1)}}function A(e,n=`listView`){t(e),u(n),i(!0)}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(Z,{icon:(0,l.jsx)(c.AppstoreOutlined,{}),title:`Field Config Seed`,style:{marginBottom:12},children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`},children:[(0,l.jsx)(`div`,{style:{minWidth:320,flex:1},children:(0,l.jsx)(s.Select,{mode:`multiple`,allowClear:!0,showSearch:!0,value:y,options:_,placeholder:E?`All modules already seeded`:`Select modules or collections to seed`,disabled:x||C||E,loading:x,onChange:b,style:{width:`100%`}})}),(0,l.jsx)(s.Button,{type:`primary`,loading:C,disabled:x||y.length===0,onClick:k,children:`Seed Field Config`})]}),(0,l.jsx)(fj,{type:`secondary`,style:{display:`block`,marginTop:8,fontSize:12},children:E?`Seed is disabled because all configured modules already have role field config data.`:`Already seeded modules are disabled. New modules or collections can still be seeded.`})]}),(0,l.jsx)(Z,{icon:(0,l.jsx)(c.SafetyOutlined,{}),title:`Roles`,style:{marginBottom:0},bodyStyle:{padding:0},children:(0,l.jsx)(vm,{listName:`Roles`,dataSource:d,fields:[{label:`Role Name`,value:`roleName`,width:200},{label:`Description`,value:`description`,width:240},{label:`Users`,value:`userCount`,width:70,sorter:!1},{label:`Actions`,value:`_configure`,width:200,sorter:!1,render:(e,t)=>(0,l.jsxs)(s.Space,{size:2,children:[(0,l.jsx)(s.Button,{size:`small`,type:`link`,onClick:()=>A(t),children:`Configure`}),(0,l.jsx)(s.Button,{size:`small`,type:`link`,icon:(0,l.jsx)(c.LockOutlined,{}),onClick:()=>A(t,`permissions`),children:`Permissions`})]})}],loading:h,total:p})}),(0,l.jsxs)(s.Modal,{className:`uss-modal`,open:r,onCancel:()=>i(!1),title:(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(c.SafetyOutlined,{style:{color:`var(--color-brand)`}}),(0,l.jsxs)(`span`,{children:[`Configure: `,e?.roleName]})]}),width:720,footer:null,destroyOnClose:!0,children:[(0,l.jsx)(`div`,{style:{marginBottom:12},children:(0,l.jsx)(`div`,{className:`uss-config-toggle`,children:pj.map(e=>(0,l.jsx)(`button`,{className:`uss-config-btn${a===e.key?` active`:``}`,onClick:()=>u(e.key),children:e.label},e.key))})}),e&&(a===`permissions`?(0,l.jsx)(dj,{role:e},e?.roleId):(0,l.jsx)(Zb,{role:e,configType:a},`${e?.roleId}-${a}`))]})]})}var yj=`perm-module-labels`,bj=`perm-action-labels`;function xj(e){try{return JSON.parse(localStorage.getItem(e)??`{}`)}catch{return{}}}function Sj(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function Cj({label:e,onSave:t,onDelete:n,loading:r}){let[i,a]=(0,o.useState)(!1),[u,d]=(0,o.useState)(e);function f(){a(!1);let n=u.trim();n&&n!==e?t(n):d(e)}return(0,l.jsxs)(`div`,{className:`perm-manage-row`,children:[i?(0,l.jsx)(`input`,{autoFocus:!0,className:`perm-inline-input`,value:u,style:{flex:1,minWidth:0},onChange:e=>d(e.target.value),onBlur:f,onKeyDown:t=>{t.key===`Enter`&&f(),t.key===`Escape`&&(a(!1),d(e))}}):(0,l.jsx)(`span`,{className:`perm-manage-row-label`,children:e}),(0,l.jsxs)(`div`,{className:`perm-manage-row-actions`,children:[(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.EditOutlined,{}),onClick:()=>{d(e),a(!0)},loading:r}),(0,l.jsx)(s.Popconfirm,{title:`Delete this item?`,onConfirm:n,okText:`Delete`,cancelText:`Cancel`,okType:`danger`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.DeleteOutlined,{}),danger:!0})})]})]})}function wj({open:e,onClose:t}){let[r,i]=(0,o.useState)(`modules`),[a,u]=(0,o.useState)([]),[d,f]=(0,o.useState)(!1),[p,m]=(0,o.useState)(``),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)([]),[y,b]=(0,o.useState)(!1),[x,S]=(0,o.useState)(``),[C,w]=(0,o.useState)(``),[T,E]=(0,o.useState)(!1);(0,o.useEffect)(()=>{e&&(D(),O())},[e]);async function D(){f(!0);try{u(await n.jr())}catch{s.message.error(`Failed to load modules`)}finally{f(!1)}}async function O(){b(!0);try{v(await n.Ar())}catch{s.message.error(`Failed to load actions`)}finally{b(!1)}}async function k(){let e=p.trim();if(!e){s.message.warning(`Enter a module name`);return}g(!0);try{let t=await n.Jn({menuName:e});u(e=>[...e,t]),m(``),s.message.success(`Module added`)}catch{s.message.error(`Failed to add module`)}finally{g(!1)}}async function A(e,t){try{await n.ci(e,{menuName:t}),u(n=>n.map(n=>n.MENUID===e?{...n,MENUNAME:t}:n))}catch{s.message.error(`Failed to update module`)}}async function j(e){try{await n.rr(e),u(t=>t.filter(t=>t.MENUID!==e)),s.message.success(`Module deleted`)}catch{s.message.error(`Failed to delete module`)}}async function M(){let e=x.trim(),t=C.trim().toLowerCase().replace(/\s+/g,`_`);if(!e||!t){s.message.warning(`Enter both name and key`);return}E(!0);try{let r=await n.qn({permissionName:e,permissionKey:t});v(e=>[...e,r]),S(``),w(``),s.message.success(`Action added`)}catch(e){s.message.error(e?.message?.includes(`409`)||e?.status===409?`Permission key already exists`:`Failed to add action`)}finally{E(!1)}}async function N(e,t){try{await n.si(e,{permissionName:t}),v(n=>n.map(n=>n.permissionId===e?{...n,permissionName:t}:n))}catch{s.message.error(`Failed to update action`)}}async function P(e){try{await n.nr(e),v(t=>t.filter(t=>t.permissionId!==e)),s.message.success(`Action deleted`)}catch{s.message.error(`Failed to delete action`)}}let F=[{key:`modules`,label:`Modules`,children:(0,l.jsxs)(s.Spin,{spinning:d,children:[(0,l.jsxs)(`div`,{className:`perm-manage-add-row`,children:[(0,l.jsx)(s.Input,{placeholder:`Module name`,value:p,onChange:e=>m(e.target.value),onPressEnter:k,style:{flex:1},size:`small`}),(0,l.jsx)(s.Button,{type:`primary`,size:`small`,icon:(0,l.jsx)(c.PlusOutlined,{}),loading:h,onClick:k,children:`Add`})]}),(0,l.jsxs)(`div`,{className:`perm-manage-list`,children:[a.length===0&&!d&&(0,l.jsx)(`div`,{className:`perm-empty`,style:{paddingTop:24},children:`No modules found`}),a.map(e=>(0,l.jsx)(Cj,{label:e.MENUNAME,onSave:t=>A(e.MENUID,t),onDelete:()=>j(e.MENUID)},e.MENUID))]})]})},{key:`actions`,label:`Actions`,children:(0,l.jsxs)(s.Spin,{spinning:y,children:[(0,l.jsxs)(`div`,{className:`perm-manage-add-row`,children:[(0,l.jsx)(s.Input,{placeholder:`Action name (e.g. Approve)`,value:x,onChange:e=>S(e.target.value),style:{flex:1},size:`small`}),(0,l.jsx)(s.Input,{placeholder:`Key (e.g. approve)`,value:C,onChange:e=>w(e.target.value),onPressEnter:M,style:{width:140},size:`small`}),(0,l.jsx)(s.Button,{type:`primary`,size:`small`,icon:(0,l.jsx)(c.PlusOutlined,{}),loading:T,onClick:M,children:`Add`})]}),(0,l.jsxs)(`div`,{className:`perm-manage-list`,children:[_.length===0&&!y&&(0,l.jsx)(`div`,{className:`perm-empty`,style:{paddingTop:24},children:`No actions found`}),_.map(e=>(0,l.jsx)(Cj,{label:`${e.permissionName} (${e.permissionKey})`,onSave:t=>N(e.permissionId,t),onDelete:()=>P(e.permissionId)},e.permissionId))]})]})}];return(0,l.jsx)(s.Modal,{open:e,onCancel:t,title:(0,l.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(c.SettingOutlined,{style:{color:`var(--color-brand)`}}),`Manage Modules & Actions`]}),width:520,footer:null,destroyOnClose:!0,children:(0,l.jsx)(s.Tabs,{activeKey:r,onChange:i,size:`small`,items:F})})}function Tj(){let[e,t]=(0,o.useState)([]),[r,i]=(0,o.useState)(!1),[a,u]=(0,o.useState)(null),[d,f]=(0,o.useState)(``),[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(()=>xj(yj)),[_,v]=(0,o.useState)(()=>xj(bj)),y=(0,o.useCallback)((e,t)=>{g(n=>{let r={...n,[e]:t};return Sj(yj,r),r})},[]),b=(0,o.useCallback)((e,t)=>{v(n=>{let r={...n,[e]:t};return Sj(bj,r),r})},[]);function x(){g({}),v({}),Sj(yj,{}),Sj(bj,{}),s.message.success(`Labels reset to defaults`)}let S=(0,o.useCallback)(async()=>{i(!0);try{let{roles:e}=await n.fr();t(e),e.length>0&&u(e[0])}catch{s.message.error(`Failed to load roles`)}finally{i(!1)}},[]);(0,o.useEffect)(()=>{S()},[S]);let C=(0,o.useMemo)(()=>{let t=d.trim().toLowerCase();return t?e.filter(e=>e.roleName.toLowerCase().includes(t)):e},[e,d]),w=Object.keys(h).length>0||Object.keys(_).length>0;return(0,l.jsxs)(`div`,{className:`perm-page`,children:[(0,l.jsxs)(Z,{className:`perm-left-card`,icon:(0,l.jsx)(c.SafetyOutlined,{}),title:`Roles`,bodyStyle:{padding:0},children:[(0,l.jsx)(`div`,{className:`perm-role-search`,children:(0,l.jsx)(s.Input,{prefix:(0,l.jsx)(c.SearchOutlined,{}),placeholder:`Search roles…`,allowClear:!0,size:`small`,value:d,onChange:e=>f(e.target.value)})}),(0,l.jsx)(s.Spin,{spinning:r,children:(0,l.jsxs)(`div`,{className:`perm-role-list`,children:[C.length===0&&!r&&(0,l.jsx)(`div`,{className:`perm-role-empty`,children:`No roles found`}),C.map(e=>{let t=a?.roleId===e.roleId,n=e.description&&e.description!==`N/A`?e.description:e.roleType===0?`Default role`:`Custom role`;return(0,l.jsxs)(`div`,{className:`perm-role-item${t?` active`:``}`,onClick:()=>u(e),children:[(0,l.jsx)(`div`,{className:`perm-role-item-name`,children:e.roleName}),(0,l.jsx)(`div`,{className:`perm-role-item-desc`,children:n})]},e.roleId)})]})})]}),(0,l.jsx)(Z,{className:`perm-right-card`,icon:(0,l.jsx)(c.LockOutlined,{}),title:`Module Permissions`,extra:(0,l.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[w&&(0,l.jsx)(`button`,{className:`perm-reset-btn`,onClick:x,children:`Reset labels`}),(0,l.jsx)(s.Button,{size:`small`,icon:(0,l.jsx)(c.SettingOutlined,{}),onClick:()=>m(!0),children:`Manage`})]}),bodyStyle:{padding:`12px 16px`},children:a?(0,l.jsx)(dj,{role:a,moduleLabels:h,actionLabels:_,onModuleLabelSave:y,onActionLabelSave:b},a.roleId):(0,l.jsx)(`div`,{className:`perm-empty`,children:`Select a role from the left to manage its permissions.`})}),(0,l.jsx)(wj,{open:p,onClose:()=>m(!1)})]})}var{Title:Ej,Text:Dj}=s.Typography,Oj=[{label:`In Progress`,value:107,sub:`Under review`,color:`blue`},{label:`Hired`,value:2,sub:`Onboarded`,color:`green`},{label:`Project Completed`,value:2,sub:`Project cycle closed`,color:`purple`},{label:`Archive`,value:2,sub:`No longer active`,color:`peach`}];function kj({items:e=Oj}){return(0,l.jsx)(s.Card,{className:`onboarding-card`,title:(0,l.jsx)(Ej,{level:5,children:`Onboarding`}),extra:(0,l.jsx)(s.Button,{type:`link`,children:`View all`}),children:(0,l.jsx)(s.Row,{gutter:[12,12],children:e.map(e=>(0,l.jsx)(s.Col,{xs:12,sm:6,md:6,lg:12,xl:12,children:(0,l.jsxs)(`div`,{className:`onboarding-item ${e.color}`,children:[(0,l.jsx)(Dj,{className:`onboarding-item-label`,children:e.label}),(0,l.jsx)(s.Statistic,{value:e.value,className:`onboarding-stat`}),(0,l.jsx)(`div`,{className:`onboarding-item-footer`,children:(0,l.jsx)(Dj,{className:`onboarding-item-sub`,children:e.sub})})]})},e.label))})})}var{Text:Aj,Title:jj}=s.Typography,Mj=[{group:`Dashboard`,items:[{id:`dashboard`,label:`Admin Dashboard`,icon:(0,l.jsx)(c.DashboardOutlined,{})}]},{group:`Settings`,items:[{id:`org`,label:`Organization`,icon:(0,l.jsx)(c.BankOutlined,{}),heading:`Organization Settings`,desc:`Manage your company profile and location details`,cards:[{label:`Company Information`,icon:(0,l.jsx)(c.BankOutlined,{}),desc:`Manage company profile, address and business details.`},{label:`Location`,icon:(0,l.jsx)(c.BuildOutlined,{}),desc:`Manage office locations, branches and regions.`}]},{id:`users`,label:`Users`,icon:(0,l.jsx)(c.UserOutlined,{}),heading:`Users`,desc:`Manage platform users and configure their field views.`,component:`users`},{id:`teams`,label:`Teams`,icon:(0,l.jsx)(c.TeamOutlined,{}),heading:`Teams`,desc:`Organize users into teams and configure field visibility per team.`,component:`teams`},{id:`roles`,label:`Roles`,icon:(0,l.jsx)(c.SafetyOutlined,{}),heading:`Roles`,desc:`Control permissions and configure field visibility per role.`,component:`roles`},{id:`permissions`,label:`Permissions`,icon:(0,l.jsx)(c.LockOutlined,{}),heading:`Permissions`,desc:`Manage module-wise action permissions (view, add, edit, delete, and more) per role.`,component:`permissions`},{id:`templates`,label:`Templates`,icon:(0,l.jsx)(c.FileTextOutlined,{}),heading:`Templates`,desc:`Email and signature templates for communications`,component:`templates`},{id:`ai-services`,label:`AI Services`,icon:(0,l.jsx)(c.ThunderboltOutlined,{}),heading:`AI Services`,desc:`Register the AI/automation backends (base URL + auth) that admin-configured AI Actions call.`,component:`ai-services`},{id:`bgc-integration`,label:`Integrations`,icon:(0,l.jsx)(c.SafetyOutlined,{}),heading:`Integrations`,desc:`Manage manual and API integrations used across application workflows.`,component:`bgc-integration`}]},{group:`Clients`,items:[{id:`clients`,label:`Clients`,icon:(0,l.jsx)(c.BankOutlined,{}),heading:`Clients`,desc:`Manage client accounts and settings`,cards:[{label:`Clients`,icon:(0,l.jsx)(c.BankOutlined,{}),desc:`Manage client companies and account details.`}]}]},{group:`Forms`,items:[{id:`form-groups`,label:`Form Groups`,icon:(0,l.jsx)(c.AppstoreAddOutlined,{}),heading:`Form Groups`,desc:`Define field groups for module add/edit forms with validations and dropdown sources.`,component:`form-groups`},{id:`detail-groups`,label:`Detail Groups`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),heading:`Detail Groups`,desc:`Customize the detail view per module: labels, prefix/suffix, colour, capitalization, reference lookups and merged fields.`,component:`detail-groups`},{id:`row-actions`,label:`Actions`,icon:(0,l.jsx)(c.ToolOutlined,{}),heading:`Actions`,desc:`Configure which action buttons appear per row in each module's list view, scoped per role.`,component:`row-actions`}]},{group:`Master`,items:[{id:`jobs`,label:`Jobs`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),heading:`Jobs Master`,desc:`Configure job sources and status types`,cards:[{label:`Sources`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),desc:`Manage job source master values.`},{label:`Job Status`,icon:(0,l.jsx)(c.CheckCircleOutlined,{}),desc:`Configure job workflow status.`}]},{id:`candidates`,label:`Candidates`,icon:(0,l.jsx)(c.UserOutlined,{}),heading:`Candidates Master`,desc:`Skills, sources and work authorization settings`,cards:[{label:`Sources`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),desc:`Manage candidate source values.`},{label:`Skills`,icon:(0,l.jsx)(c.SettingOutlined,{}),desc:`Manage skill master data.`},{label:`Work Authorization`,icon:(0,l.jsx)(c.SafetyOutlined,{}),desc:`Manage visa and authorization types.`}]},{id:`submissions`,label:`Submissions`,icon:(0,l.jsx)(c.FileTextOutlined,{}),heading:`Submissions Master`,desc:`Rejection reasons and submission status configuration`,cards:[{label:`Rejection Reasons`,icon:(0,l.jsx)(c.FileTextOutlined,{}),desc:`Manage common rejection reasons.`},{label:`Client Submission Status`,icon:(0,l.jsx)(c.CheckCircleOutlined,{}),desc:`Manage client submission statuses.`}]},{id:`clientmaster`,label:`Client Master`,icon:(0,l.jsx)(c.BankOutlined,{}),heading:`Client Master`,desc:`Payment terms, client types and contact types`,cards:[{label:`Payment Terms`,icon:(0,l.jsx)(c.FileTextOutlined,{}),desc:`Manage billing and payment terms.`},{label:`Client Type`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),desc:`Classify client business types.`},{label:`Client Contact Type`,icon:(0,l.jsx)(c.TeamOutlined,{}),desc:`Manage client contact categories.`}]}]}],Nj=[{label:`Sourced`,count:312,color:`#378ADD`,pct:35},{label:`Screened`,count:223,color:`#7F77DD`,pct:25},{label:`Interview`,count:161,color:`#1D9E75`,pct:18},{label:`Offered`,count:107,color:`#EF9F27`,pct:12},{label:`Rejected`,count:89,color:`#E24B4A`,pct:10}],Pj=[{name:`Tcs`,jobs:14,candidates:86},{name:`Empasis`,jobs:9,candidates:64},{name:`NovaSystems`,jobs:7,candidates:51},{name:`Brightwave`,jobs:5,candidates:38}],Fj=[{text:`New candidate Ravi Kumar added to Java Developer role`,time:`2 min ago`,color:`#378ADD`},{text:`Submission approved by Acme Corp for Sr. React Dev`,time:`18 min ago`,color:`#1D9E75`},{text:`User Priya S. added to Recruiters team`,time:`1 hr ago`,color:`#7F77DD`},{text:`Job Data Analyst — TechFlow moved to archived`,time:`3 hr ago`,color:`#EF9F27`},{text:`Candidate rejected — work authorization mismatch`,time:`5 hr ago`,color:`#E24B4A`}];function Ij(){return(0,l.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,l.jsxs)(Z,{icon:(0,l.jsx)(c.DashboardOutlined,{}),title:`Admin Dashboard`,children:[(0,l.jsx)(`div`,{className:`admin-accent-bar`}),(0,l.jsx)(jj,{level:5,children:`Admin Dashboard`}),(0,l.jsx)(Aj,{type:`secondary`,children:`Overview of jobs, candidates, onboarding and recent activity`})]}),(0,l.jsx)(`div`,{className:`admin-dashboard-stats`,children:(0,l.jsx)(WA,{stats:[{label:`Total Jobs`,value:1697,icon:`fileText`},{label:`Active Jobs`,value:1685,icon:`checkCircle`},{label:`My Jobs`,value:600,icon:`user`},{label:`Total Candidates`,value:4320,icon:`team`},{label:`Submissions`,value:892,icon:`fileText`}]})}),(0,l.jsxs)(`div`,{className:`admin-dashboard-mid-row`,children:[(0,l.jsx)(kj,{}),(0,l.jsxs)(Z,{icon:(0,l.jsx)(c.AppstoreOutlined,{}),title:`Candidate Pipeline`,children:[(0,l.jsx)(Aj,{type:`secondary`,style:{fontSize:12},children:`By stage (892 total)`}),(0,l.jsx)(`div`,{className:`admin-pipeline-bar`,children:Nj.map(e=>(0,l.jsx)(`div`,{className:`admin-pipeline-seg`,style:{width:`${e.pct}%`,background:e.color}},e.label))}),(0,l.jsx)(`div`,{className:`admin-pipeline-legend`,children:Nj.map(e=>(0,l.jsxs)(`div`,{className:`admin-pipeline-legend-item`,children:[(0,l.jsx)(`span`,{className:`admin-pipeline-dot`,style:{background:e.color}}),e.label,` `,e.count]},e.label))}),(0,l.jsx)(`div`,{className:`admin-divider`}),(0,l.jsx)(Aj,{strong:!0,style:{fontSize:12},children:`Submission status`}),(0,l.jsxs)(`div`,{className:`admin-sub-status-list`,style:{marginTop:6},children:[(0,l.jsxs)(`div`,{className:`admin-sub-status-item`,children:[(0,l.jsx)(Aj,{style:{fontSize:13},children:`Pending client review`}),(0,l.jsx)(`span`,{className:`admin-badge warn`,children:`312`})]}),(0,l.jsxs)(`div`,{className:`admin-sub-status-item`,children:[(0,l.jsx)(Aj,{style:{fontSize:13},children:`Client approved`}),(0,l.jsx)(`span`,{className:`admin-badge success`,children:`248`})]}),(0,l.jsxs)(`div`,{className:`admin-sub-status-item`,children:[(0,l.jsx)(Aj,{style:{fontSize:13},children:`Rejected`}),(0,l.jsx)(`span`,{className:`admin-badge danger`,children:`89`})]})]})]})]}),(0,l.jsxs)(`div`,{className:`admin-dashboard-bottom-row`,children:[(0,l.jsx)(Z,{icon:(0,l.jsx)(c.BankOutlined,{}),title:`Top Clients`,extra:(0,l.jsx)(s.Button,{type:`link`,size:`small`,children:`View all`}),children:Pj.map(e=>(0,l.jsxs)(`div`,{className:`admin-client-row`,children:[(0,l.jsxs)(`div`,{className:`admin-client-left`,children:[(0,l.jsx)(`div`,{className:`admin-client-icon`,children:(0,l.jsx)(c.BankOutlined,{})}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`admin-client-name`,children:e.name}),(0,l.jsxs)(`div`,{className:`admin-client-sub`,children:[e.jobs,` open jobs`]})]})]}),(0,l.jsxs)(`div`,{className:`admin-client-right`,children:[(0,l.jsx)(`div`,{className:`admin-client-val`,children:e.candidates}),(0,l.jsx)(`div`,{className:`admin-client-sub`,children:`candidates`})]})]},e.name))}),(0,l.jsx)(Z,{icon:(0,l.jsx)(c.BellOutlined,{}),title:`Recent Activity`,children:Fj.map((e,t)=>(0,l.jsxs)(`div`,{className:`admin-activity-row`,children:[(0,l.jsx)(`div`,{className:`admin-activity-dot`,style:{background:e.color}}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`admin-activity-text`,children:e.text}),(0,l.jsx)(`div`,{className:`admin-activity-time`,children:e.time})]})]},t))})]}),(0,l.jsx)(Z,{icon:(0,l.jsx)(c.SettingOutlined,{}),title:`Admin Configuration Overview`,extra:(0,l.jsx)(s.Button,{type:`link`,size:`small`,children:`Manage`}),children:(0,l.jsxs)(s.Row,{gutter:[24,0],children:[(0,l.jsxs)(s.Col,{span:8,children:[(0,l.jsx)(Aj,{type:`secondary`,style:{fontSize:12,fontWeight:500},children:`Settings`}),[[`Organization`,2],[`User Settings`,4],[`Templates`,2]].map(([e,t])=>(0,l.jsxs)(`div`,{className:`admin-cfg-overview-row`,children:[(0,l.jsx)(Aj,{style:{fontSize:12},children:e}),(0,l.jsxs)(`span`,{className:`admin-badge info`,children:[t,` items`]})]},e))]}),(0,l.jsxs)(s.Col,{span:8,children:[(0,l.jsx)(Aj,{type:`secondary`,style:{fontSize:12,fontWeight:500},children:`Master`}),[[`Jobs`,2],[`Candidates`,3],[`Submissions`,2]].map(([e,t])=>(0,l.jsxs)(`div`,{className:`admin-cfg-overview-row`,children:[(0,l.jsx)(Aj,{style:{fontSize:12},children:e}),(0,l.jsxs)(`span`,{className:`admin-badge info`,children:[t,` items`]})]},e))]}),(0,l.jsxs)(s.Col,{span:8,children:[(0,l.jsx)(Aj,{type:`secondary`,style:{fontSize:12,fontWeight:500},children:`System`}),[[`Total Groups`,4],[`Total Modules`,9],[`Config Items`,19]].map(([e,t])=>(0,l.jsxs)(`div`,{className:`admin-cfg-overview-row`,children:[(0,l.jsx)(Aj,{style:{fontSize:12},children:e}),(0,l.jsx)(Aj,{strong:!0,style:{fontSize:12},children:t})]},e))]})]})})]})}function Lj({activeSection:e,activeGroup:t,filteredCards:n,searchText:r,setSearchText:i,allItems:a,handleNav:o}){return(0,l.jsxs)(s.Row,{gutter:[16,16],children:[(0,l.jsx)(s.Col,{span:24,children:(0,l.jsxs)(Z,{icon:e?.icon,title:e?.heading,extra:(0,l.jsx)(s.Input,{className:`admin-search`,prefix:(0,l.jsx)(c.SearchOutlined,{}),placeholder:`Search settings…`,allowClear:!0,value:r,onChange:e=>i(e.target.value)}),children:[(0,l.jsx)(`div`,{className:`admin-accent-bar`}),(0,l.jsx)(jj,{level:5,children:e?.heading}),(0,l.jsx)(Aj,{type:`secondary`,children:e?.desc})]})}),(0,l.jsx)(s.Col,{xs:24,xl:16,style:{alignSelf:`flex-start`},children:(0,l.jsx)(Z,{icon:(0,l.jsx)(c.AppstoreOutlined,{}),title:`Configuration Items`,extra:(0,l.jsxs)(Aj,{type:`secondary`,children:[n.length,` item`,n.length===1?``:`s`]}),children:(0,l.jsx)(s.Row,{gutter:[14,14],children:n.length>0?n.map(e=>(0,l.jsx)(s.Col,{xs:24,sm:12,xl:8,children:(0,l.jsxs)(`div`,{className:`admin-config-item`,children:[(0,l.jsx)(`div`,{className:`admin-config-top-bar`}),(0,l.jsxs)(`div`,{className:`admin-config-body`,children:[(0,l.jsx)(`div`,{className:`admin-config-icon`,children:e.icon}),(0,l.jsxs)(`div`,{className:`admin-config-text`,children:[(0,l.jsx)(`span`,{className:`admin-config-label`,children:e.label}),(0,l.jsx)(`span`,{className:`admin-config-desc`,children:e.desc})]})]}),(0,l.jsx)(`div`,{className:`admin-config-divider`}),(0,l.jsx)(s.Button,{type:`link`,size:`small`,className:`admin-config-manage`,icon:(0,l.jsx)(c.RightOutlined,{}),iconPosition:`end`,children:`Manage`})]})},e.label)):(0,l.jsx)(s.Col,{span:24,children:(0,l.jsx)(`div`,{className:`admin-config-empty`,children:(0,l.jsx)(s.Empty,{description:`No settings found`,image:s.Empty.PRESENTED_IMAGE_SIMPLE})})})})})}),(0,l.jsx)(s.Col,{xs:24,xl:8,style:{alignSelf:`flex-start`},children:(0,l.jsxs)(Z,{icon:(0,l.jsx)(c.FileTextOutlined,{}),title:`Section Overview`,children:[(0,l.jsx)(`div`,{className:`admin-overview-list`,children:Mj.filter(e=>e.group!==`Dashboard`).map(e=>{let n=e.group===t?.group;return(0,l.jsxs)(`div`,{className:`admin-overview-item${n?` active`:``}`,onClick:()=>{let t=e.items[0];t&&o(t.id)},children:[(0,l.jsxs)(`div`,{className:`admin-overview-left`,children:[(0,l.jsx)(`div`,{className:`admin-overview-icon`,children:e.items[0]?.icon}),(0,l.jsxs)(`div`,{className:`admin-overview-text`,children:[(0,l.jsx)(`span`,{className:`admin-overview-name`,children:e.group}),(0,l.jsxs)(`span`,{className:`admin-overview-sub`,children:[e.items.length,` module`,e.items.length===1?``:`s`]})]})]}),(0,l.jsx)(`span`,{className:`admin-overview-count${n?` active`:``}`,children:e.items.length})]},e.group)})}),(0,l.jsxs)(`div`,{className:`admin-overview-footer`,children:[(0,l.jsx)(`span`,{className:`admin-overview-footer-label`,children:`Total configuration items`}),(0,l.jsx)(`span`,{className:`admin-overview-footer-value`,children:a.filter(e=>e.cards).reduce((e,t)=>e+t.cards.length,0)})]})]})})]})}function Rj(){let[e,t]=(0,o.useState)(`dashboard`),[n,r]=(0,o.useState)(``),i=(0,o.useMemo)(()=>Mj.flatMap(e=>e.items),[]),a=(0,o.useMemo)(()=>i.find(t=>t.id===e),[i,e]),u=(0,o.useMemo)(()=>Mj.find(t=>t.items.some(t=>t.id===e)),[e]),d=(0,o.useMemo)(()=>{if(!a?.cards)return[];let e=n.trim().toLowerCase();return e?a.cards.filter(t=>t.label.toLowerCase().includes(e)||t.desc.toLowerCase().includes(e)):a.cards},[a,n]),f=(0,o.useMemo)(()=>Mj.map(e=>({key:e.group,type:`group`,label:e.group,children:e.items.map(e=>({key:e.id,icon:e.icon,label:e.label}))})),[]),p=e=>{t(e),r(``)};return e===`dashboard`||a?.heading,(0,l.jsxs)(`main`,{className:`admin-page`,children:[(0,l.jsx)(`div`,{className:`admin-breadcrumb`,children:(0,l.jsx)(s.Breadcrumb,{items:[{title:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.HomeOutlined,{}),` Home`]})},{title:`Admin`}]})}),(0,l.jsxs)(s.Row,{gutter:[16,16],className:`admin-wrapper`,children:[(0,l.jsx)(s.Col,{xs:24,lg:6,xl:5,children:(0,l.jsxs)(Z,{title:`Admin Console`,icon:(0,l.jsx)(c.SettingOutlined,{}),children:[(0,l.jsxs)(`div`,{className:`admin-sidebar-banner`,children:[(0,l.jsx)(`span`,{className:`admin-sidebar-banner-title`,children:`Admin Panel`}),(0,l.jsx)(`span`,{className:`admin-sidebar-banner-sub`,children:`Configuration Center`}),(0,l.jsxs)(s.Row,{gutter:[8,0],children:[(0,l.jsx)(s.Col,{span:12,children:(0,l.jsxs)(`div`,{className:`admin-sidebar-pill`,children:[(0,l.jsx)(`span`,{className:`admin-sidebar-pill-label`,children:`Groups`}),(0,l.jsx)(`span`,{className:`admin-sidebar-pill-value`,children:Mj.length})]})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsxs)(`div`,{className:`admin-sidebar-pill`,children:[(0,l.jsx)(`span`,{className:`admin-sidebar-pill-label`,children:`Modules`}),(0,l.jsx)(`span`,{className:`admin-sidebar-pill-value`,children:i.length})]})})]})]}),(0,l.jsx)(s.Menu,{mode:`inline`,selectedKeys:[e],items:f,onClick:({key:e})=>p(e),className:`admin-sidebar-menu`})]})}),(0,l.jsx)(s.Col,{xs:24,lg:18,xl:19,children:e===`dashboard`?(0,l.jsx)(Ij,{}):a?.component===`form-groups`?(0,l.jsx)(qS,{}):a?.component===`detail-groups`?(0,l.jsx)(bC,{}):a?.component===`row-actions`?(0,l.jsx)(lw,{}):a?.component===`users`?(0,l.jsx)(JA,{}):a?.component===`teams`?(0,l.jsx)(ej,{}):a?.component===`roles`?(0,l.jsx)(vj,{}):a?.component===`permissions`?(0,l.jsx)(Tj,{}):a?.component===`templates`?(0,l.jsx)(xw,{}):a?.component===`ai-services`?(0,l.jsx)(Tw,{}):a?.component===`bgc-integration`?(0,l.jsx)(jw,{}):(0,l.jsx)(Lj,{activeSection:a,activeGroup:u,filteredCards:d,searchText:n,setSearchText:r,allItems:i,handleNav:p})})]})]})}var{Title:zj}=s.Typography;function Bj(){let e=(0,d.useNavigate)(),{state:t}=(0,d.useLocation)(),n=t?.moduleName||`stickyNotes`,r=t?.title||`Sticky Notes`,i={...t?.request,params:{...t?.request?.params,limit:200,offset:0}};return(0,l.jsxs)(`div`,{children:[(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.ArrowLeftOutlined,{}),onClick:()=>e(-1),style:{marginBottom:12},children:`Back`}),(0,l.jsx)(Pt,{moduleName:n,title:r,columns:4,request:i,viewAll:!1})]})}var{Text:Vj,Title:Hj}=s.Typography,Uj=10485760,Wj=`/templates/test_cases_flow_template.base64.txt`,Gj=`test_cases_flow_template.xlsx`,Kj=`module | subModule | step_order | description | actions | key | value | expected | scenario`,qj={idle:0,module_set:1,encoding:1,validating:2,preview:3,inserting:3,done:4,error:1},Jj=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/addTestCase`},{label:`Bulk upload`,href:`/bulk-upload`}];function Yj(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]),r.onerror=n,r.readAsDataURL(e)})}function Xj(e){return e.filter(e=>e.row_status===`valid`).map(e=>{let t={...e};return delete t.row_status,delete t.errors,t})}function Zj(e){return e.flatMap(e=>(e.errors??[]).map(t=>({id:e.id,...t})))}function Qj({errors:e}){return(0,l.jsx)(`div`,{className:`bulk-tooltip-errors`,children:(e??[]).map((e,t)=>(0,l.jsx)(`div`,{children:e.message},`${e.field}-${t}`))})}function $j({errors:e,expanded:t,onToggle:n,onSummaryClick:r}){return e.length===0?null:(0,l.jsxs)(`div`,{className:`bulk-error-banner`,children:[(0,l.jsxs)(`div`,{className:`bulk-error-summary`,children:[(0,l.jsxs)(`button`,{type:`button`,className:`bulk-error-summary-main`,onClick:r,"aria-label":`Scroll to first invalid row`,children:[(0,l.jsx)(c.ExclamationCircleOutlined,{className:`bulk-error-icon`}),(0,l.jsxs)(`span`,{children:[e.length,` validation error(s) found`]})]}),(0,l.jsx)(s.Button,{type:`link`,onClick:n,"aria-expanded":t,children:t?`Hide Errors`:`View Errors`})]}),t&&(0,l.jsx)(`div`,{className:`bulk-error-list`,role:`region`,"aria-label":`Validation error details`,children:e.map((e,t)=>(0,l.jsxs)(`div`,{className:`bulk-error-line`,children:[(0,l.jsxs)(`span`,{className:`bulk-row-chip`,children:[`Row `,e.id]}),(0,l.jsx)(`span`,{children:e.message})]},`${e.id}-${e.field}-${t}`))})]})}function eM({rows:e,view:t,onViewChange:n,onConfirm:r,onReset:i,saving:a,firstInvalidRowId:o,firstInvalidRowRef:u}){let d=e.filter(e=>e.row_status===`invalid`),f=t===`errors`?d:e,p=d.length>0||a;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s.Row,{justify:`space-between`,align:`middle`,gutter:[16,16],className:`bulk-table-toolbar`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsxs)(s.Space.Compact,{children:[(0,l.jsx)(s.Button,{type:t===`all`?`primary`:`default`,onClick:()=>n(`all`),children:`All rows`}),(0,l.jsx)(s.Button,{type:t===`errors`?`primary`:`default`,onClick:()=>n(`errors`),children:`Errors only`})]})}),(0,l.jsx)(s.Col,{children:(0,l.jsxs)(Vj,{type:`secondary`,children:[e.length,` row(s)`]})})]}),(0,l.jsx)(`div`,{className:`bulk-table-wrap`,children:(0,l.jsxs)(`table`,{className:`bulk-preview-table`,children:[(0,l.jsx)(`thead`,{children:(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`th`,{className:`bulk-col-row`,children:`Row`}),(0,l.jsx)(`th`,{className:`bulk-col-flow`,children:`Submodule`}),(0,l.jsx)(`th`,{className:`bulk-col-description`,children:`Description`}),(0,l.jsx)(`th`,{className:`bulk-col-keyword`,children:`Action`}),(0,l.jsx)(`th`,{className:`bulk-col-target`,children:`Key`}),(0,l.jsx)(`th`,{className:`bulk-col-status`,children:`Status`}),(0,l.jsx)(`th`,{className:`bulk-col-error`,children:`Error`})]})}),(0,l.jsx)(`tbody`,{children:f.map(e=>{let t=e.errors??[],n=e.row_status===`invalid`;return(0,l.jsxs)(`tr`,{ref:n&&e.id===o?u:null,className:n?`bulk-row-invalid`:``,children:[(0,l.jsx)(`td`,{children:e.id}),(0,l.jsx)(`td`,{title:e.submodule,children:e.submodule}),(0,l.jsx)(`td`,{title:e.description,children:e.description?e.description:(0,l.jsx)(`span`,{className:`bulk-empty-text`,children:`-empty-`})}),(0,l.jsx)(`td`,{children:(0,l.jsx)(`code`,{className:`bulk-code-chip`,children:e.actions})}),(0,l.jsx)(`td`,{title:e.key,children:e.key}),(0,l.jsx)(`td`,{children:n?(0,l.jsx)(s.Tag,{color:`red`,children:`Error`}):(0,l.jsx)(s.Tag,{color:`green`,children:`Valid`})}),(0,l.jsx)(`td`,{children:n?(0,l.jsx)(s.Tooltip,{title:(0,l.jsx)(Qj,{errors:t}),placement:`left`,children:(0,l.jsxs)(`button`,{type:`button`,className:`bulk-error-info`,"aria-label":`View ${t.length} error(s) for row ${e.id}`,children:[(0,l.jsx)(c.InfoCircleOutlined,{}),(0,l.jsx)(s.Badge,{count:t.length,size:`small`})]})}):(0,l.jsx)(`span`,{className:`bulk-error-none`,children:`-`})})]},`${e.id}-${e.step_order}`)})})]})}),(0,l.jsxs)(s.Space,{className:`bulk-actions`,children:[(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.ReloadOutlined,{}),onClick:i,children:`Reset`}),(0,l.jsx)(s.Button,{type:`primary`,icon:(0,l.jsx)(c.SaveOutlined,{}),loading:a,disabled:p,onClick:r,children:d.length>0?`Fix ${d.length} error(s) to proceed`:`Save to database`})]})]})}function tM(){let e=(0,d.useNavigate)(),r=(0,o.useMemo)(()=>t.l(),[]),i=(0,o.useRef)(null),a=(0,o.useRef)(null),[u,f]=(0,o.useState)([]),[p,m]=(0,o.useState)(``),[h,g]=(0,o.useState)(`idle`),[_,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(null),[x,S]=(0,o.useState)([]),[C,w]=(0,o.useState)(`all`),[T,E]=(0,o.useState)(null),[D,O]=(0,o.useState)(null),[k,A]=(0,o.useState)(!1),j=u.map(e=>({value:e.modulename,label:e.modulename})),M=Zj(x),N=h===`encoding`||h===`validating`,P=!!p&&!N,F=qj[h]??0,I=x.find(e=>e.row_status===`invalid`)?.id,L=(0,o.useCallback)(()=>{m(``),g(`idle`),v(!1),b(null),S([]),w(`all`),E(null),O(null),i.current&&(i.current.value=``)},[]);(0,o.useEffect)(()=>{async function e(){try{let e=await Vy({project:r?.name??``,activeOnly:!0});f(e?.items??[])}catch(e){console.error(e),s.message.error(`Unable to load modules.`)}}e()},[r?.name]);let R=e=>{m(e??``),S([]),O(null),E(null),b(null),A(!1),g(e?`module_set`:`idle`)},z=async e=>{if(!e||!P)return;let t=e.name.split(`.`).pop()?.toLowerCase();if(![`xlsx`,`csv`].includes(t)){g(`module_set`),E({message:`Invalid file type. Please upload an Excel .xlsx or CSV .csv file.`});return}if(e.size>Uj){g(`module_set`),E({message:`File must be 10 MB or smaller.`});return}E(null),S([]),O(null),b({name:e.name,size:e.size}),g(`encoding`);try{let n=await Yj(e);g(`validating`);let i=await Iy({filename:e.name,project:r?.name??``,module:p,file_base64:n,file_type:t});S(i?.rows??[]),w(`all`),g(`preview`)}catch(e){console.error(e),E(e.payload??{code:`NETWORK_ERROR`,message:e.message||`Could not reach the server.`}),g(`error`)}},B=async()=>{try{let e=await fetch(Wj);if(!e.ok)throw Error(`Template file not found (${e.status})`);let t=(await e.text()).trim(),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e+=1)r[e]=n.charCodeAt(e);let i=new Blob([r],{type:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=Gj,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a),s.message.success(`Sample template downloaded.`)}catch(e){console.error(e),s.message.error(`Unable to download sample template.`)}},V=async()=>{g(`inserting`),E(null);try{let t=await Ly({project:r?.name??``,module:p,uploaded_by:localStorage.getItem(`user_Email`)??``,rows:Xj(x)});O(t),g(`done`),s.message.success(`Bulk upload saved. Redirecting to view test cases...`),window.setTimeout(()=>e(`/viewTestCase`),900)}catch(e){console.error(e),E(e.payload??{code:`NETWORK_ERROR`,message:e.message||`Could not reach the server.`}),g(`preview`)}},H=(0,o.useCallback)(()=>{a.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[]),U=[`bulk-dropzone`,_?`bulk-dropzone-dragging`:``,y?`bulk-dropzone-has-file`:``,T&&h!==`preview`?`bulk-dropzone-error`:``,p?``:`bulk-dropzone-disabled`].filter(Boolean).join(` `);return(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:Jj})}),r?.name&&(0,l.jsx)(s.Col,{children:(0,l.jsx)(Vj,{strong:!0,children:r.name})})]}),(0,l.jsxs)(`div`,{className:`zt-page zt-page-wide bulk-page`,children:[(0,l.jsxs)(`div`,{className:`bulk-header`,children:[(0,l.jsx)(Hj,{level:3,children:`Bulk upload test cases`}),(0,l.jsxs)(s.Space,{direction:`vertical`,size:4,children:[(0,l.jsx)(Vj,{type:`secondary`,children:Kj}),(0,l.jsx)(Vj,{type:`secondary`,children:`Use the sample template for the required columns. Uploaded rows are saved as Active by default.`})]})]}),(0,l.jsx)(`div`,{className:`bulk-stepbar`,children:[`Select`,`Upload`,`Validate`,`Save`].map((e,t)=>(0,l.jsxs)(`span`,{className:t<F?`bulk-step-active`:``,children:[t+1,` `,e]},e))}),(0,l.jsx)(s.Card,{className:`v1-card zt-fall`,title:`1. Module selector`,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,optionFilterProp:`label`,className:`bulk-module-select`,placeholder:`Choose a module`,options:j,value:p||void 0,onChange:R})}),p&&(0,l.jsxs)(s.Card,{className:`v1-card zt-fall`,title:`2. File upload`,extra:(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.DownloadOutlined,{}),onClick:B,children:`Download Sample Template`}),children:[(0,l.jsx)(s.Alert,{type:`info`,showIcon:!0,message:`First time uploading?`,description:`Download the sample template, keep the column names unchanged, fill your test steps, and upload either .xlsx or .csv.`,className:`bulk-inline-alert`}),(0,l.jsxs)(`button`,{type:`button`,className:U,disabled:!P,onClick:()=>i.current?.click(),onDragOver:e=>{e.preventDefault(),P&&v(!0)},onDragLeave:()=>v(!1),onDrop:e=>{e.preventDefault(),v(!1),z(e.dataTransfer.files?.[0])},children:[(0,l.jsx)(c.CloudUploadOutlined,{className:`bulk-upload-icon`}),y?(0,l.jsxs)(`span`,{className:`bulk-file-chip`,children:[y.name,` - `,Math.ceil(y.size/1024),` KB`]}):(0,l.jsx)(`span`,{children:`Drag & drop here, or click to browse`})]}),(0,l.jsx)(`input`,{ref:i,hidden:!0,type:`file`,accept:`.xlsx,.csv`,onChange:e=>z(e.target.files?.[0])}),N&&(0,l.jsx)(s.Progress,{percent:h===`encoding`?45:82,showInfo:!1,size:`small`}),T&&h!==`preview`&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:T.message,className:`bulk-inline-alert`})]}),x.length>0&&(0,l.jsxs)(s.Card,{className:`v1-card zt-fall`,title:`3. Validation result`,children:[(0,l.jsx)($j,{errors:M,expanded:k,onToggle:()=>A(e=>!e),onSummaryClick:H}),T&&h===`preview`&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:T.message,className:`bulk-inline-alert`}),(0,l.jsx)(eM,{rows:x,view:C,onViewChange:w,onConfirm:V,onReset:L,saving:h===`inserting`,firstInvalidRowId:I,firstInvalidRowRef:a})]}),D&&h===`done`&&(0,l.jsxs)(s.Card,{className:`v1-card zt-fall`,title:`4. Upload complete`,children:[(0,l.jsxs)(s.Row,{gutter:[16,16],className:`bulk-metrics`,children:[(0,l.jsx)(s.Col,{xs:24,md:8,children:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Vj,{children:`Total`}),(0,l.jsx)(`strong`,{children:x.length})]})}),(0,l.jsx)(s.Col,{xs:24,md:8,children:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Vj,{children:`Inserted`}),(0,l.jsx)(`strong`,{children:D.inserted??0})]})}),(0,l.jsx)(s.Col,{xs:24,md:8,children:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Vj,{children:`Failed`}),(0,l.jsx)(`strong`,{children:D.failed??0})]})})]}),(0,l.jsx)(s.Alert,{type:`success`,showIcon:!0,icon:(0,l.jsx)(c.CheckCircleOutlined,{}),message:`${D.inserted??0} test cases saved to database - module: ${p}`,className:`bulk-inline-alert`}),(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.ReloadOutlined,{}),onClick:L,children:`Upload another file`})]})]})]})}var nM=[{value:`navigate`,label:`Navigate`},{value:`fill`,label:`Fill`},{value:`click`,label:`Click`},{value:`select`,label:`Select`},{value:`press_key`,label:`Press Key`},{value:`type_and_select`,label:`Type and Select`},{value:`type_and_select_modal`,label:`Type and Select (Modal)`},{value:`upload_file`,label:`Upload File`},{value:`check_checkbox`,label:`Check Checkbox`},{value:`check_filter_checkbox`,label:`Check Filter Checkbox`},{value:`select_page_size`,label:`Select Page Size`},{value:`check_n_checkboxes`,label:`Check N Checkboxes`},{value:`store_text`,label:`Store Text`},{value:`reset_session`,label:`Reset Session`},{value:`switch_to_new_tab`,label:`Switch To New Tab`},{value:`close_tab`,label:`Close Tab`},{value:`assert_visible`,label:`Assert Visible`},{value:`assert_hidden`,label:`Assert Hidden`},{value:`assert_text`,label:`Assert Text`},{value:`assert_url`,label:`Assert URL`},{value:`assert_body_contains`,label:`Assert Body Contains`},{value:`assert_button_disabled`,label:`Assert Button Disabled`},{value:`assert_field_error`,label:`Assert Field Error`},{value:`assert_field_accepted`,label:`Assert Field Accepted`},{value:`assert_children_disabled`,label:`Assert Children Disabled`},{value:`assert_children_visible`,label:`Assert Children Visible`},{value:`assert_element_count`,label:`Assert Element Count`},{value:`assert_toast`,label:`Assert Toast`},{value:`assert_toast_success`,label:`Assert Toast Success`},{value:`assert_toast_error`,label:`Assert Toast Error`},{value:`wait_for_visible`,label:`Wait For Visible`},{value:`wait_for_hidden`,label:`Wait For Hidden`},{value:`wait_for_text`,label:`Wait For Text`}],{Text:rM}=s.Typography,iM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/test-cases`}],aM={tags:`regression`,active:1},oM={module:{dbName:`Modules`,formField:`module`,label:`Module`}};function sM(e=[]){return e.map(e=>({value:e,label:e}))}function cM(e=``){return String(e??``).trim()}function lM(e=``){return cM(e).toLowerCase()}function uM(e=[]){let t=new Map;return e.forEach(e=>{let n=cM(e?.flow),r=n.toLowerCase();n&&!t.has(r)&&t.set(r,n)}),Array.from(t.values()).map(e=>({value:e,label:e}))}function dM(e=[],t,n){let r=cM(t).toLowerCase(),i=cM(n).toLowerCase();return e.reduce((e,t)=>{let n=cM(t?.module).toLowerCase(),a=cM(t?.flow).toLowerCase();if(n!==r||a!==i)return e;let o=Number(t?.step_order)||0;return Math.max(e,o)},0)+1}function fM({icon:e,title:t}){return(0,l.jsxs)(s.Space,{size:10,align:`center`,children:[(0,l.jsx)(`div`,{className:`v1-section-icon-box`,children:e}),(0,l.jsx)(rM,{strong:!0,className:`v1-section-label`,children:t})]})}function pM(){let[e]=s.Form.useForm(),[t]=s.Form.useForm(),[r,i]=(0,o.useState)([]),[a,u]=(0,o.useState)([]),[f,p]=(0,o.useState)([]),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)({open:!1,typeKey:`module`}),[b,x]=(0,o.useState)(!1),[S,C]=(0,o.useState)(!1),[w,T]=(0,o.useState)(!1),E=(0,d.useNavigate)(),D=oM[v.typeKey],O=(0,o.useMemo)(()=>sM(r),[r]),k=s.Form.useWatch(`module`,e),A=s.Form.useWatch(`flow`,e),j=!!cM(k),M=!!cM(A),N=!j,P=!j||!M,F=(e,t=[])=>{e===`module`&&i(t)},I=async()=>{h(!0);try{let e=await jy(oM.module.dbName);i(e?.items??[])}catch(e){console.error(`Unable to load testing options:`,e),s.message.error(`Unable to load testing options.`)}finally{h(!1)}},L=(0,o.useCallback)(async t=>{let n=cM(t);if(u([]),p([]),e.setFieldsValue({step_order:void 0}),n){_(!0);try{let e=await Fy({limit:1e4,offset:0,module:n}),t=Array.isArray(e?.items)?e.items:[];u(t),p(uM(t))}catch(e){console.error(`Unable to load flows:`,e),s.message.error(`Unable to load flows.`)}finally{_(!1)}}},[e]),R=(0,o.useCallback)(async(t,n,r)=>{let i=cM(t),a=cM(n);if(!i||!a){e.setFieldsValue({step_order:void 0});return}C(!0);try{e.setFieldsValue({step_order:dM(r,i,a)})}catch(e){console.error(`Unable to load step order:`,e),s.message.error(`Unable to load step order.`)}finally{C(!1)}},[e]);(0,o.useEffect)(()=>{Promise.resolve().then(I)},[]),(0,o.useEffect)(()=>{Promise.resolve().then(()=>L(k))},[L,k]),(0,o.useEffect)(()=>{Promise.resolve().then(()=>R(k,A,a))},[a,R,A,k]);let z=async t=>{let n={module:cM(t.module),flow:cM(t.flow),step_order:Number(t.step_order),description:cM(t.description),keyword:lM(t.keyword),target:cM(t.target),value:cM(t.value),expected:cM(t.expected),tags:t.tags?cM(t.tags):aM.tags,active:Number(t.active)};T(!0);try{await Py(n),s.message.success(`Test case details saved successfully.`),e.resetFields(),u([]),p([])}catch(e){console.error(`Unable to save test case:`,e),s.message.error(`Unable to save test case.`)}finally{T(!1)}},B=(t,n)=>{e.setFieldsValue({[t]:cM(n)})},V=t=>{e.setFieldsValue({module:cM(t),flow:void 0,step_order:void 0,keyword:void 0,description:void 0,target:void 0,tags:aM.tags,value:void 0,expected:void 0})},H=t=>{e.setFieldsValue({flow:cM(t),step_order:void 0})},U=e=>{let n=oM[e];y({open:!0,typeKey:e}),t.setFieldsValue({name:``,type:n.label})},ee=()=>{y(e=>({...e,open:!1})),t.resetFields()},te=async()=>{try{let n=cM((await t.validateFields()).name),r=await My({name:n,type:D.dbName});F(v.typeKey,r?.items??[]),e.setFieldsValue({[D.formField]:n}),s.message.success(`${D.label} added successfully.`),ee()}catch(e){if(e?.errorFields)return;console.error(`Unable to save testing option:`,e),s.message.error(`Unable to add ${D.label.toLowerCase()}.`)}finally{x(!1)}};return(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:iM})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`link`,onClick:()=>E(`/zinnext-home`),children:`View Table`})})]}),(0,l.jsx)(`div`,{className:`v1-page`,children:(0,l.jsxs)(`div`,{className:`v1-page-inner`,children:[(0,l.jsx)(`div`,{className:`v1-page-header`,children:(0,l.jsxs)(s.Space,{align:`center`,size:10,children:[(0,l.jsx)(c.ProfileOutlined,{className:`v1-outer-icon`}),(0,l.jsx)(`div`,{children:(0,l.jsx)(rM,{strong:!0,style:{fontSize:16},children:`Add Test Case`})})]})}),(0,l.jsx)(Z,{children:(0,l.jsxs)(s.Form,{form:e,className:`v1-form`,layout:`vertical`,colon:!1,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),initialValues:aM,onFinish:z,autoComplete:`off`,children:[(0,l.jsx)(s.Card,{className:`v1-card`,title:(0,l.jsx)(fM,{icon:(0,l.jsx)(c.FileTextOutlined,{}),title:`Test Case Details`}),extra:(0,l.jsx)(rM,{type:`secondary`,className:`v1-card-subtitle`,children:`Module, flow, step order and execution data`}),children:(0,l.jsxs)(s.Row,{gutter:[24,0],children:[(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsxs)(s.Space.Compact,{style:{width:`100%`},children:[(0,l.jsx)(s.Form.Item,{label:`Module`,name:`module`,style:{flex:1},children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,loading:m,optionFilterProp:`label`,placeholder:`Select module`,options:O,onChange:V})}),(0,l.jsx)(s.Button,{"aria-label":`Add module`,icon:(0,l.jsx)(c.PlusOutlined,{}),style:{marginTop:30},onClick:()=>U(`module`)})]})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Flow`,name:`flow`,children:(0,l.jsx)(s.AutoComplete,{maxLength:100,allowClear:!0,disabled:N,options:f,placeholder:g?`Loading flows`:`Enter flow`,onChange:H,filterOption:(e,t)=>t?.value?.toLowerCase().includes(e.toLowerCase())})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Step Order`,name:`step_order`,validateTrigger:[`onBlur`,`onChange`],children:(0,l.jsx)(s.Input,{maxLength:10,disabled:!0,placeholder:S?`Loading step order`:`Step order`})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Action`,name:`keyword`,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,disabled:P,optionFilterProp:`label`,placeholder:`Select action`,options:nM,onChange:t=>e.setFieldsValue({keyword:lM(t)})})})}),(0,l.jsx)(s.Col,{xs:24,children:(0,l.jsx)(s.Form.Item,{label:`Description`,name:`description`,children:(0,l.jsx)(s.Input.TextArea,{rows:3,maxLength:255,disabled:P,placeholder:`Enter description`,showCount:!0,onBlur:e=>B(`description`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Key`,name:`target`,children:(0,l.jsx)(s.Input,{maxLength:255,disabled:P,placeholder:`Enter target`,onBlur:e=>B(`target`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Tags`,name:`tags`,children:(0,l.jsx)(s.Input,{maxLength:200,disabled:P,placeholder:`Enter tags`,prefix:(0,l.jsx)(c.TagsOutlined,{className:`v1-input-icon`}),onBlur:e=>B(`tags`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Value`,name:`value`,children:(0,l.jsx)(s.Input.TextArea,{rows:4,disabled:P,placeholder:`Enter value`,onBlur:e=>B(`value`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Expected`,name:`expected`,children:(0,l.jsx)(s.Input.TextArea,{rows:4,disabled:P,placeholder:`Enter expected result`,onBlur:e=>B(`expected`,e.target.value)})})})]})}),(0,l.jsx)(`div`,{className:`v1-form-actions`,children:(0,l.jsx)(s.Form.Item,{children:(0,l.jsxs)(s.Space,{children:[(0,l.jsx)(s.Button,{type:`primary`,htmlType:`submit`,loading:w,disabled:P,children:`Submit`}),(0,l.jsx)(s.Button,{onClick:()=>{e.resetFields(),u([]),p([])},children:`Reset`})]})})})]})}),(0,l.jsx)(s.Modal,{title:`Add ${D.label}`,open:v.open,confirmLoading:b,okText:`Add`,onCancel:ee,onOk:()=>{x(!0),te()},destroyOnHidden:!0,children:(0,l.jsxs)(s.Form,{form:t,layout:`vertical`,colon:!1,className:`v1-form`,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),children:[(0,l.jsx)(s.Form.Item,{label:`Name`,name:`name`,children:(0,l.jsx)(s.Input,{maxLength:100,placeholder:`Enter ${D.label.toLowerCase()} name`,onBlur:e=>{t.setFieldsValue({name:cM(e.target.value)})}})}),(0,l.jsx)(s.Form.Item,{label:`Type`,name:`type`,children:(0,l.jsx)(s.Input,{disabled:!0})})]})})]})})]})}var{Text:mM}=s.Typography,hM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/addTestCase`}];function gM(e=``){return String(e??``).trim()}function _M(e=[],t){return e.map(e=>({value:e.id,label:e[t]}))}var vM=[{label:`Step`,value:`step_order`,width:70},{label:`Action`,value:`actions`,width:140},{label:`Key`,value:`key`,width:160,ellipsis:!0},{label:`Value`,value:`value`,ellipsis:!0},{label:`Description`,value:`description`,ellipsis:!0},{label:`Scenario`,value:`scenario`,width:110,render:e=>e===1?(0,l.jsx)(s.Tag,{color:`green`,children:`Positive`}):(0,l.jsx)(s.Tag,{color:`red`,children:`Negative`})}],yM={key:!1,value:!1,expected:!1};function bM(e,t){return t?e[t]??yM:yM}function xM(e,t){e.setFields(t.map(e=>({name:e,errors:[]})))}function SM(){let[e]=s.Form.useForm(),r=(0,d.useNavigate)(),[i]=(0,d.useSearchParams)(),a=i.get(`edit`),u=!!a,f=(0,o.useMemo)(()=>t.l(),[]),[p,m]=(0,o.useState)([]),[h,g]=(0,o.useState)([]),[_,v]=(0,o.useState)([]),[y,b]=(0,o.useState)(nM),[x,S]=(0,o.useState)({}),[C,w]=(0,o.useState)(!1),[T,E]=(0,o.useState)(!1),[D,O]=(0,o.useState)(!1),[k,A]=(0,o.useState)(!1),[j,M]=(0,o.useState)(!1),N=s.Form.useWatch(`module`,e),P=s.Form.useWatch(`submodule`,e),F=s.Form.useWatch(`actions`,e),I=!!N,L=!!P,R=(0,o.useMemo)(()=>bM(x,F),[x,F]),z=(0,o.useMemo)(()=>_M(p,`modulename`),[p]),B=(0,o.useMemo)(()=>_M(h,`submodulename`),[h]),V=(0,o.useMemo)(()=>p.find(e=>e.id===N)?.modulename??``,[p,N]),H=(0,o.useMemo)(()=>h.find(e=>e.id===P)?.submodulename??``,[P,h]),U=(0,o.useCallback)(async()=>{try{let e=await Ny();Array.isArray(e?.options)&&e.options.length>0&&b(e.options),e?.rules&&typeof e.rules==`object`&&S(e.rules)}catch(e){console.error(`Unable to load action field rules:`,e),s.message.error(`Unable to load action validation rules.`)}},[]),ee=(0,o.useCallback)(async e=>{if(!e){m([]);return}w(!0);try{let t=await Vy({project:e,activeOnly:!0});m(t?.items??[])}catch(e){console.error(`Unable to load modules:`,e),s.message.error(`Unable to load modules.`)}finally{w(!1)}},[]),te=(0,o.useCallback)(async(e,t)=>{if(!e||!t){g([]);return}E(!0);try{let n=await Wy({project:e,module:t,activeOnly:!0});g(n?.items??[])}catch(e){console.error(`Unable to load submodules:`,e),s.message.error(`Unable to load submodules.`)}finally{E(!1)}},[]),ne=(0,o.useCallback)(async(t,n,r,i=``)=>{if(!t||!n||!r){v([]),e.setFieldsValue({step_order:void 0});return}O(!0);try{let[a,o]=await Promise.all([qy({product_parent_ID:t,module_parent_ID:n,submodule_parent_ID:r,actions:i,limit:1e3}),Xy({product_parent_ID:t,module_parent_ID:n,submodule_parent_ID:r})]);v(a?.items??[]),e.setFieldsValue({step_order:o?.step_order??1})}catch(e){console.error(`Unable to load flows:`,e),s.message.error(`Unable to load flows.`)}finally{O(!1)}},[e]),re=(0,o.useCallback)(async(e=``)=>{if(!(!f?.id||!N||!P)){O(!0);try{let t=await qy({product_parent_ID:f.id,module_parent_ID:N,submodule_parent_ID:P,actions:e,limit:1e3});v(t?.items??[])}catch(e){console.error(`Unable to load action flows:`,e),s.message.error(`Unable to load action steps.`)}finally{O(!1)}}},[f?.id,N,P]),ie=(0,o.useCallback)(async()=>{if(!(!a||!f?.name)){M(!0);try{let t=await Yy(a);await te(f.name,t.module);let n=await qy({product_parent_ID:t.product_parent_ID,module_parent_ID:t.module_parent_ID,submodule_parent_ID:t.submodule_parent_ID,limit:1e3});v(n?.items??[]),e.setFieldsValue({module:t.module_parent_ID,submodule:t.submodule_parent_ID,step_order:t.step_order,actions:t.actions,key:t.key,value:t.value,expected:t.expected,description:t.description,scenario:t.scenario===1,active:Number(t.active)!==0})}catch(e){console.error(`Unable to load test flow:`,e),s.message.error(`Unable to load test flow for edit.`),r(`/viewTestCase`)}finally{M(!1)}}},[a,e,te,r,f?.name]);return(0,o.useEffect)(()=>{if(!f){r(`/select-project`,{replace:!0});return}Promise.resolve().then(async()=>{await U(),await ee(f.name),a&&await ie()})},[f,r,U,ee,a,ie]),f?(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:hM})}),(0,l.jsx)(s.Col,{children:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.ProjectOutlined,{}),(0,l.jsx)(mM,{strong:!0,children:f.name})]})})]}),(0,l.jsx)(`div`,{className:`zt-page`,children:(0,l.jsxs)(s.Form,{form:e,layout:`vertical`,colon:!1,className:`v1-form`,initialValues:{scenario:!0,active:!0},onFinish:async t=>{let n={product_parent_ID:Number(f?.id),module_parent_ID:Number(t.module),submodule_parent_ID:Number(t.submodule),description:gM(t.description),actions:gM(t.actions),key:gM(t.key),value:gM(t.value),expected:gM(t.expected),scenario:+!!t.scenario,active:+!!t.active};A(!0);try{if(u){await Zy(a,{...n,step_order:Number(t.step_order)}),s.message.success(`Test case updated successfully.`),r(`/viewTestCase`);return}await Jy(n),s.message.success(`Step saved (#${t.step_order}).`),e.setFieldsValue({actions:void 0,key:void 0,value:void 0,expected:void 0,description:void 0}),await ne(n.product_parent_ID,n.module_parent_ID,n.submodule_parent_ID)}catch(e){console.error(`Unable to save test case:`,e),s.message.error(u?`Unable to update test case.`:`Unable to save step.`)}finally{A(!1)}},autoComplete:`off`,disabled:j,children:[(0,l.jsx)(s.Card,{className:`v1-card zt-fall`,title:(0,l.jsxs)(s.Space,{size:8,className:`zt-section-title`,children:[(0,l.jsx)(`span`,{className:`zt-step-tag`,children:`1`}),(0,l.jsx)(`span`,{children:`Module & Submodule`})]}),children:(0,l.jsxs)(s.Row,{gutter:[24,0],align:`bottom`,children:[(0,l.jsx)(s.Col,{xs:24,md:6,children:(0,l.jsx)(s.Form.Item,{label:`Module`,name:`module`,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,optionFilterProp:`label`,loading:C,placeholder:`Select module`,options:z,onChange:t=>{let n=p.find(e=>e.id===t)?.modulename??``;e.setFieldsValue({module:t,submodule:void 0,step_order:void 0,actions:void 0,key:void 0,value:void 0,expected:void 0}),xM(e,[`actions`,`key`,`value`,`expected`]),g([]),v([]),te(f?.name,n)}})})}),(0,l.jsx)(s.Col,{xs:24,md:6,children:(0,l.jsx)(s.Form.Item,{label:`Submodule`,name:`submodule`,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,optionFilterProp:`label`,disabled:!I,loading:T,placeholder:I?`Select submodule`:`Select module first`,options:B,onChange:t=>{e.setFieldsValue({submodule:t,actions:void 0,key:void 0,value:void 0,expected:void 0}),xM(e,[`actions`,`key`,`value`,`expected`]),ne(f?.id,N,t)}})})}),(0,l.jsx)(s.Col,{xs:24,md:6,children:(0,l.jsx)(s.Form.Item,{label:`Scenario`,name:`scenario`,valuePropName:`checked`,children:(0,l.jsx)(s.Switch,{disabled:!L,checkedChildren:`Positive`,unCheckedChildren:`Negative`})})}),(0,l.jsx)(s.Col,{xs:24,md:6,children:(0,l.jsx)(s.Form.Item,{label:`Active`,name:`active`,valuePropName:`checked`,children:(0,l.jsx)(s.Switch,{checkedChildren:`Active`,unCheckedChildren:`Inactive`})})})]})}),L&&(0,l.jsxs)(s.Card,{className:`v1-card zt-fall`,title:(0,l.jsxs)(s.Space,{size:8,className:`zt-section-title`,children:[(0,l.jsx)(`span`,{className:`zt-step-tag`,children:`2`}),(0,l.jsx)(c.FileTextOutlined,{}),(0,l.jsx)(`span`,{children:`Step Details`})]}),extra:(0,l.jsxs)(mM,{type:`secondary`,children:[V,` / `,H]}),children:[(0,l.jsxs)(s.Row,{gutter:[24,0],children:[(0,l.jsx)(s.Col,{xs:24,md:6,children:(0,l.jsx)(s.Form.Item,{label:`Step Order`,name:`step_order`,children:(0,l.jsx)(s.Input,{disabled:!0,placeholder:D?`Loading…`:`Auto`})})}),(0,l.jsx)(s.Col,{xs:24,md:18,children:(0,l.jsx)(s.Form.Item,{label:`Action`,name:`actions`,rules:[{required:!0,message:`Mandatory Field`}],children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,optionFilterProp:`label`,placeholder:`Select action`,options:y,onChange:t=>{let n=bM(x,t);e.setFieldsValue({actions:t,key:n.key?e.getFieldValue(`key`):void 0,value:n.value?e.getFieldValue(`value`):void 0,expected:n.expected?e.getFieldValue(`expected`):void 0}),xM(e,[`key`,`value`,`expected`]),re(t||``)}})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Key`,name:`key`,rules:[{required:R.key,message:`Key is required for this action`}],children:(0,l.jsx)(s.Input,{maxLength:255,disabled:F&&!R.key,placeholder:F?R.key?`Required — Enter selector / locator`:`Not needed for this action`:`Select an action first`})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Value`,name:`value`,rules:[{required:R.value,message:`Value is required for this action`}],children:(0,l.jsx)(s.Input.TextArea,{rows:1,autoSize:{minRows:1,maxRows:4},disabled:F&&!R.value,placeholder:F?R.value?`Required — Enter value`:`Not needed for this action`:`Select an action first`})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Expected`,name:`expected`,rules:[{required:R.expected,message:`Expected result is required for this action`}],children:(0,l.jsx)(s.Input.TextArea,{rows:2,disabled:F&&!R.expected,placeholder:F?R.expected?`Required — Enter expected result`:`Not needed for this action`:`Select an action first`})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Description`,name:`description`,children:(0,l.jsx)(s.Input.TextArea,{rows:2,maxLength:255,showCount:!0,placeholder:`Enter description`})})})]}),(0,l.jsxs)(s.Space,{className:`zt-actions`,children:[(0,l.jsx)(s.Button,{onClick:()=>{if(u){r(`/viewTestCase`);return}e.resetFields(),g([]),v([]),E(!1),O(!1)},children:`Cancel`}),(0,l.jsx)(s.Button,{type:`primary`,htmlType:`submit`,loading:k||j,children:u?`Update Test Case`:`Save & Continue`})]})]},`${N}-${P}`),L&&(0,l.jsx)(s.Card,{className:`v1-card zt-fall`,title:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.TableOutlined,{}),(0,l.jsx)(`span`,{children:`Added Steps`})]}),extra:(0,l.jsx)(s.Tag,{children:F?`${_.length} ${F} step(s)`:`${_.length} step(s)`}),children:(0,l.jsx)(vm,{listName:`Added Steps`,loading:D,fields:vM,dataSource:_,current:1,pageSize:Math.max(_.length,1),total:_.length,rowSelection:!1,className:`zt-list-plain zt-list-static`})})]})})]}):null}var{Text:CM}=s.Typography,wM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/addTestCase`},{label:`Manage Modules`,href:`/manageModules`}];function TM(){let e=(0,d.useNavigate)(),r=(0,o.useMemo)(()=>t.l(),[]),[i,a]=(0,o.useState)([]),[u,f]=(0,o.useState)({}),[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(``),[y,b]=(0,o.useState)(!1),[x,S]=(0,o.useState)(1),[C,w]=(0,o.useState)(10),T=(0,o.useCallback)(async e=>{if(!e){a([]);return}m(!0);try{let[t,n]=await Promise.all([Vy({project:e}),Wy({project:e})]);a(t?.items??[]);let r={};(n?.items??[]).forEach(e=>{let t=e.modulename;r[t]=(r[t]??0)+1}),f(r)}catch(e){console.error(e),s.message.error(`Unable to load modules.`)}finally{m(!1)}},[]);(0,o.useEffect)(()=>{if(!r){e(`/select-project`,{replace:!0});return}Promise.resolve().then(()=>T(r.name))},[r,e,T]);let E=async(e,t)=>{try{await Uy(e.id,+!!t),a(n=>n.map(n=>n.id===e.id?{...n,active:+!!t}:n)),s.message.success(`Module ${t?`activated`:`deactivated`}.`)}catch(e){console.error(e),s.message.error(`Unable to update module status.`)}},D=async()=>{let e=_.trim();if(!e){s.message.warning(`Enter a module name.`);return}b(!0);try{await Hy({project:r.name,modulename:e}),s.message.success(`Module added.`),g(!1),v(``),S(1),T(r.name)}catch(e){console.error(e),s.message.error(`Unable to add module (maybe it already exists).`)}finally{b(!1)}},O=t=>{e(`/test-cases/zinnext/submodules?module=${encodeURIComponent(t.modulename)}`)};return r?(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:wM})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`link`,onClick:()=>e(`/addTestCase`),children:`Back to Form`})})]}),(0,l.jsxs)(`div`,{className:`zt-page`,children:[(0,l.jsx)(s.Card,{className:`v1-card zt-bar`,children:(0,l.jsxs)(s.Row,{gutter:[16,16],align:`middle`,justify:`space-between`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.ProjectOutlined,{}),(0,l.jsx)(`span`,{children:`Project:`}),(0,l.jsx)(CM,{strong:!0,children:r.name})]})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`primary`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>g(!0),children:`Add Module`})})]})}),(0,l.jsx)(s.Card,{className:`v1-card zt-fall`,title:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.AppstoreOutlined,{}),(0,l.jsx)(`span`,{children:`Modules`})]}),children:(0,l.jsx)(vm,{listName:`Modules`,loading:p,fields:[{label:`Module`,value:`modulename`},{label:`Submodules`,value:`submoduleCount`,width:140,render:(e,t)=>(0,l.jsxs)(s.Button,{type:`link`,className:`zt-count-link`,onClick:()=>O(t),children:[u[t.modulename]??0,` submodule(s)`]})},{label:`Active`,value:`active`,width:120,render:(e,t)=>(0,l.jsx)(s.Switch,{checked:e===1,checkedChildren:`On`,unCheckedChildren:`Off`,onChange:e=>E(t,e)})}],dataSource:i,current:x,pageSize:C,total:i.length,onPageChange:S,onPageSizeChange:e=>{S(1),w(e)},rowSelection:!1,className:`zt-list-plain`})})]}),(0,l.jsx)(s.Modal,{title:`Add Module`,open:h,confirmLoading:y,okText:`Add`,onOk:D,onCancel:()=>{g(!1),v(``)},destroyOnHidden:!0,children:(0,l.jsxs)(s.Space,{direction:`vertical`,className:`zt-modal-stack`,children:[(0,l.jsxs)(CM,{type:`secondary`,children:[`Project: `,(0,l.jsx)(`b`,{children:r.name})]}),(0,l.jsx)(s.Input,{placeholder:`Enter module name`,maxLength:100,value:_,onChange:e=>v(e.target.value),onPressEnter:D})]})})]}):null}var{Text:EM}=s.Typography,DM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/addTestCase`},{label:`Manage Modules`,href:`/manageModules`},{label:`Manage Submodules`,href:`/test-cases/zinnext/submodules`}];function OM(){let e=(0,d.useNavigate)(),[r]=(0,d.useSearchParams)(),i=(0,o.useMemo)(()=>t.l(),[]),a=r.get(`module`)??``,[u,f]=(0,o.useState)([]),[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(``),[y,b]=(0,o.useState)(!1),[x,S]=(0,o.useState)(1),[C,w]=(0,o.useState)(10),T=(0,o.useCallback)(async(e,t)=>{if(!e||!t){f([]);return}m(!0);try{let n=await Wy({project:e,module:t});f(n?.items??[])}catch(e){console.error(e),s.message.error(`Unable to load submodules.`)}finally{m(!1)}},[]);(0,o.useEffect)(()=>{if(!i){e(`/select-project`,{replace:!0});return}if(!a){e(`/manageModules`,{replace:!0});return}Promise.resolve().then(()=>T(i.name,a))},[i,a,e,T]);let E=async(e,t)=>{try{await Ky(e.id,+!!t),f(n=>n.map(n=>n.id===e.id?{...n,active:+!!t}:n)),s.message.success(`Submodule ${t?`activated`:`deactivated`}.`)}catch(e){console.error(e),s.message.error(`Unable to update submodule status.`)}},D=async()=>{let e=_.trim();if(!e){s.message.warning(`Enter a submodule name.`);return}b(!0);try{await Gy({project:i.name,modulename:a,submodulename:e}),s.message.success(`Submodule added.`),g(!1),v(``),S(1),T(i.name,a)}catch(e){console.error(e),s.message.error(`Unable to add submodule (maybe it already exists).`)}finally{b(!1)}};return!i||!a?null:(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:DM})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`link`,onClick:()=>e(`/manageModules`),children:`Back to Modules`})})]}),(0,l.jsxs)(`div`,{className:`zt-page`,children:[(0,l.jsx)(s.Card,{className:`v1-card zt-bar`,children:(0,l.jsxs)(s.Row,{gutter:[16,16],align:`middle`,justify:`space-between`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsxs)(s.Space,{size:16,wrap:!0,className:`zt-section-title`,children:[(0,l.jsxs)(s.Space,{size:6,children:[(0,l.jsx)(c.ProjectOutlined,{}),(0,l.jsx)(`span`,{children:`Project:`}),(0,l.jsx)(EM,{strong:!0,children:i.name})]}),(0,l.jsxs)(s.Space,{size:6,children:[(0,l.jsx)(c.AppstoreOutlined,{}),(0,l.jsx)(`span`,{children:`Module:`}),(0,l.jsx)(EM,{strong:!0,children:a})]})]})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`primary`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>g(!0),children:`Add Submodule`})})]})}),(0,l.jsx)(s.Card,{className:`v1-card zt-fall`,title:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.AppstoreOutlined,{}),(0,l.jsx)(`span`,{children:`Submodules`})]}),children:(0,l.jsx)(vm,{listName:`Submodules`,loading:p,fields:[{label:`Submodule`,value:`submodulename`},{label:`Active`,value:`active`,width:120,render:(e,t)=>(0,l.jsx)(s.Switch,{checked:e===1,checkedChildren:`On`,unCheckedChildren:`Off`,onChange:e=>E(t,e)})}],dataSource:u,current:x,pageSize:C,total:u.length,onPageChange:S,onPageSizeChange:e=>{S(1),w(e)},rowSelection:!1,className:`zt-list-plain`})})]}),(0,l.jsx)(s.Modal,{title:`Add Submodule`,open:h,confirmLoading:y,okText:`Add`,onOk:D,onCancel:()=>{g(!1),v(``)},destroyOnHidden:!0,children:(0,l.jsxs)(s.Space,{direction:`vertical`,className:`zt-modal-stack`,children:[(0,l.jsxs)(EM,{type:`secondary`,children:[`Project: `,(0,l.jsx)(`b`,{children:i.name}),` \xA0|\xA0 Module: `,(0,l.jsx)(`b`,{children:a})]}),(0,l.jsx)(s.Input,{placeholder:`Enter submodule name`,maxLength:100,value:_,onChange:e=>v(e.target.value),onPressEnter:D})]})})]})}var{Text:kM}=s.Typography,AM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/addTestCase`},{label:`Table`,href:`/viewTestCase`}];function jM(){let e=(0,d.useNavigate)(),[r,i]=(0,o.useState)([]),[a,u]=(0,o.useState)(0),[f,p]=(0,o.useState)(!1),m=(0,o.useMemo)(()=>t.l(),[]),[h,g]=(0,o.useState)(``),[_,v]=(0,o.useState)(1),[y,b]=(0,o.useState)(20),[x,S]=(0,o.useState)(null),C=(0,o.useCallback)(async(e={})=>{p(!0);try{let t=await qy({product_parent_ID:e.project??m?.id??``,search:e.search??h??``,limit:e.pageSize??y,offset:((e.page??_)-1)*(e.pageSize??y)});i(t?.items??[]),u(t?.total??0)}catch(e){console.error(e),s.message.error(`Unable to load test flows.`)}finally{p(!1)}},[m?.id,h,_,y]),w=e=>{s.Modal.confirm({title:`Delete Test Case`,icon:(0,l.jsx)(c.ExclamationCircleOutlined,{}),content:`Are you sure you want to delete this test case?`,okText:`Delete`,okButtonProps:{danger:!0,loading:x===e.id},cancelText:`Cancel`,async onOk(){S(e.id);try{await Qy(e.id),s.message.success(`Test case deleted successfully.`);let t=r.length===1&&_>1?_-1:_;v(t),await C({page:t})}catch(e){throw console.error(`Unable to delete test flow:`,e),s.message.error(`Unable to delete test case.`),e}finally{S(null)}}})};return(0,o.useEffect)(()=>{Promise.resolve().then(()=>{if(!m?.id){e(`/select-project`,{replace:!0});return}C({page:1})})},[]),(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:AM})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`link`,onClick:()=>e(`/addTestCase`),children:`Back to Form`})})]}),(0,l.jsx)(`div`,{className:`zt-page zt-page-wide`,children:(0,l.jsxs)(s.Card,{className:`v1-card`,title:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.TableOutlined,{}),(0,l.jsx)(`span`,{children:`Test Flows`})]}),extra:(0,l.jsxs)(kM,{type:`secondary`,children:[a,` row(s)`]}),children:[(0,l.jsxs)(s.Space,{wrap:!0,className:`zt-toolbar`,children:[(0,l.jsx)(s.Input.Search,{allowClear:!0,className:`zt-search-filter`,placeholder:`Search module / key / description`,value:h,onChange:e=>g(e.target.value),onSearch:()=>{v(1),C({page:1})}}),(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.ReloadOutlined,{}),onClick:()=>C(),children:`Refresh`})]}),(0,l.jsx)(vm,{listName:`Test Flows`,loading:f,fields:[{label:`Actions`,value:`rowActions`,width:112,fixed:`left`,sorter:!1,render:(t,n)=>(0,l.jsxs)(s.Space,{size:4,className:`zt-row-actions`,children:[(0,l.jsx)(s.Tooltip,{title:`Edit`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.EditOutlined,{}),onClick:()=>e(`/addTestCase?edit=${n.id}`)})}),(0,l.jsx)(s.Tooltip,{title:`Delete`,children:(0,l.jsx)(s.Button,{danger:!0,type:`text`,size:`small`,icon:(0,l.jsx)(c.DeleteOutlined,{}),loading:x===n.id,onClick:()=>w(n)})})]})},{label:`ID`,value:`id`,width:70,fixed:`left`},{label:`Project`,value:`project`,width:130},{label:`Module`,value:`module`,width:130},{label:`Submodule`,value:`submodule`,width:140},{label:`Step`,value:`step_order`,width:70},{label:`Action`,value:`actions`,width:140},{label:`Key`,value:`key`,width:160,ellipsis:!0},{label:`Value`,value:`value`,width:200,ellipsis:!0},{label:`Expected`,value:`expected`,width:180,ellipsis:!0},{label:`Description`,value:`description`,width:180,ellipsis:!0},{label:`Scenario`,value:`scenario`,width:110,render:e=>e===1?(0,l.jsx)(s.Tag,{color:`green`,children:`Positive`}):(0,l.jsx)(s.Tag,{color:`red`,children:`Negative`})},{label:`Active`,value:`active`,width:90,render:e=>e===1?(0,l.jsx)(s.Tag,{color:`blue`,children:`Active`}):(0,l.jsx)(s.Tag,{children:`Inactive`})}],dataSource:r,current:_,pageSize:y,total:a,onPageChange:e=>{v(e),C({page:e})},onPageSizeChange:e=>{v(1),b(e),C({page:1,pageSize:e})},rowSelection:!1,className:`zt-list-plain`})]})})]})}var MM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/test-cases`}];function NM(){return(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsx)(n.t,{items:MM}),(0,l.jsx)(Lo,{moduleName:`test-flows`,rowKey:`id`})]})}var{Text:PM}=s.Typography,FM=[{label:`Home`,href:`/`},{label:`LMS Cases`,href:`/lms-cases`}],IM={tags:`regression`,active:1},LM={module:{dbName:`Modules`,formField:`module`,label:`Module`}},RM={key:!1,value:!1,expected:!1};function zM(e,t){return t?e[t]??RM:RM}function BM(e,t){e.setFields(t.map(e=>({name:e,errors:[]})))}function VM(e=[]){return e.map(e=>({value:e,label:e}))}function HM(e=``){return String(e??``).trim()}function UM(e=[]){let t=new Map;return e.forEach(e=>{let n=HM(e?.flow),r=n.toLowerCase();n&&!t.has(r)&&t.set(r,n)}),Array.from(t.values()).map(e=>({value:e,label:e}))}function WM(e=[],t,n){let r=HM(t).toLowerCase(),i=HM(n).toLowerCase();return e.reduce((e,t)=>{let n=HM(t?.module).toLowerCase(),a=HM(t?.flow).toLowerCase();if(n!==r||a!==i)return e;let o=Number(t?.step_order)||0;return Math.max(e,o)},0)+1}function GM({icon:e,title:t}){return(0,l.jsxs)(s.Space,{size:10,align:`center`,children:[(0,l.jsx)(`div`,{className:`v1-section-icon-box`,children:e}),(0,l.jsx)(PM,{strong:!0,className:`v1-section-label`,children:t})]})}function KM(){let[e]=s.Form.useForm(),[t]=s.Form.useForm(),[r,i]=(0,o.useState)([]),[a,u]=(0,o.useState)([]),[f,p]=(0,o.useState)([]),[m,h]=(0,o.useState)(nM),[g,_]=(0,o.useState)({}),[v,y]=(0,o.useState)(!1),[b,x]=(0,o.useState)(!1),[S,C]=(0,o.useState)({open:!1,typeKey:`module`}),[w,T]=(0,o.useState)(!1),[E,D]=(0,o.useState)(!1),[O,k]=(0,o.useState)(!1),A=(0,d.useNavigate)(),j=LM[S.typeKey],M=(0,o.useMemo)(()=>VM(r),[r]),N=s.Form.useWatch(`module`,e),P=s.Form.useWatch(`flow`,e),F=s.Form.useWatch(`keyword`,e),I=!!HM(N),L=!!HM(P),R=!I,z=!I||!L,B=(0,o.useMemo)(()=>zM(g,F),[g,F]),V=(e,t=[])=>{e===`module`&&i(t)},H=async()=>{y(!0);try{let e=await jy(LM.module.dbName);i(e?.items??[])}catch(e){console.error(`Unable to load testing options:`,e),s.message.error(`Unable to load testing options.`)}finally{y(!1)}},U=async()=>{try{let e=await Ny();Array.isArray(e?.options)&&e.options.length>0&&h(e.options),e?.rules&&typeof e.rules==`object`&&_(e.rules)}catch(e){console.error(`Unable to load action field rules:`,e),s.message.error(`Unable to load action validation rules.`)}},ee=(0,o.useCallback)(async t=>{let n=HM(t);if(u([]),p([]),e.setFieldsValue({step_order:void 0}),n){x(!0);try{let e=await zy({limit:1e4,offset:0,module:n}),t=Array.isArray(e?.items)?e.items:[];u(t),p(UM(t))}catch(e){console.error(`Unable to load flows:`,e),s.message.error(`Unable to load flows.`)}finally{x(!1)}}},[e]),te=(0,o.useCallback)(async(t,n,r)=>{let i=HM(t),a=HM(n);if(!i||!a){e.setFieldsValue({step_order:void 0});return}D(!0);try{e.setFieldsValue({step_order:WM(r,i,a)})}catch(e){console.error(`Unable to load step order:`,e),s.message.error(`Unable to load step order.`)}finally{D(!1)}},[e]);(0,o.useEffect)(()=>{Promise.resolve().then(async()=>{await Promise.all([H(),U()])})},[]),(0,o.useEffect)(()=>{Promise.resolve().then(()=>ee(N))},[ee,N]),(0,o.useEffect)(()=>{Promise.resolve().then(()=>te(N,P,a))},[a,te,P,N]);let ne=async t=>{let n={module:HM(t.module),flow:HM(t.flow),step_order:Number(t.step_order),description:HM(t.description),keyword:HM(t.keyword),target:HM(t.target),value:HM(t.value),expected:HM(t.expected),tags:t.tags?HM(t.tags):IM.tags,active:Number(t.active)};k(!0);try{await Ry(n),s.message.success(`LMS case details saved successfully.`),e.resetFields(),u([]),p([])}catch(e){console.error(`Unable to save LMS case:`,e),s.message.error(`Unable to save LMS case.`)}finally{k(!1)}},re=(t,n)=>{e.setFieldsValue({[t]:HM(n)})},ie=t=>{e.setFieldsValue({module:HM(t),flow:void 0,step_order:void 0,keyword:void 0,description:void 0,target:void 0,tags:IM.tags,value:void 0,expected:void 0}),BM(e,[`keyword`,`target`,`value`,`expected`])},ae=t=>{e.setFieldsValue({flow:HM(t),step_order:void 0,keyword:void 0,target:void 0,value:void 0,expected:void 0}),BM(e,[`keyword`,`target`,`value`,`expected`])},W=t=>{let n=zM(g,t);e.setFieldsValue({keyword:HM(t),target:n.key?e.getFieldValue(`target`):void 0,value:n.value?e.getFieldValue(`value`):void 0,expected:n.expected?e.getFieldValue(`expected`):void 0}),BM(e,[`target`,`value`,`expected`])},oe=e=>{let n=LM[e];C({open:!0,typeKey:e}),t.setFieldsValue({name:``,type:n.label})},se=()=>{C(e=>({...e,open:!1})),t.resetFields()},ce=async()=>{try{let n=HM((await t.validateFields()).name),r=await My({name:n,type:j.dbName});V(S.typeKey,r?.items??[]),e.setFieldsValue({[j.formField]:n}),s.message.success(`${j.label} added successfully.`),se()}catch(e){if(e?.errorFields)return;console.error(`Unable to save testing option:`,e),s.message.error(`Unable to add ${j.label.toLowerCase()}.`)}finally{T(!1)}};return(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:FM})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`link`,onClick:()=>A(`/lms-home`),children:`View Table`})})]}),(0,l.jsx)(`div`,{className:`v1-page`,children:(0,l.jsxs)(`div`,{className:`v1-page-inner`,children:[(0,l.jsx)(`div`,{className:`v1-page-header`,children:(0,l.jsxs)(s.Space,{align:`center`,size:10,children:[(0,l.jsx)(c.ProfileOutlined,{className:`v1-outer-icon`}),(0,l.jsx)(`div`,{children:(0,l.jsx)(PM,{strong:!0,style:{fontSize:16},children:`Add LMS Case`})})]})}),(0,l.jsx)(Z,{children:(0,l.jsxs)(s.Form,{form:e,className:`v1-form`,layout:`vertical`,colon:!1,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),initialValues:IM,onFinish:ne,autoComplete:`off`,children:[(0,l.jsx)(s.Card,{className:`v1-card`,title:(0,l.jsx)(GM,{icon:(0,l.jsx)(c.FileTextOutlined,{}),title:`LMS Case Details`}),extra:(0,l.jsx)(PM,{type:`secondary`,className:`v1-card-subtitle`,children:`Module, flow, step order and execution data`}),children:(0,l.jsxs)(s.Row,{gutter:[24,0],children:[(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsxs)(s.Space.Compact,{style:{width:`100%`},children:[(0,l.jsx)(s.Form.Item,{label:`Module`,name:`module`,style:{flex:1},children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,loading:v,optionFilterProp:`label`,placeholder:`Select module`,options:M,onChange:ie})}),(0,l.jsx)(s.Button,{"aria-label":`Add module`,icon:(0,l.jsx)(c.PlusOutlined,{}),style:{marginTop:30},onClick:()=>oe(`module`)})]})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Flow`,name:`flow`,children:(0,l.jsx)(s.AutoComplete,{maxLength:100,allowClear:!0,disabled:R,options:f,placeholder:b?`Loading flows`:`Enter flow`,onChange:ae,filterOption:(e,t)=>t?.value?.toLowerCase().includes(e.toLowerCase())})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Step Order`,name:`step_order`,validateTrigger:[`onBlur`,`onChange`],children:(0,l.jsx)(s.Input,{maxLength:10,disabled:!0,placeholder:E?`Loading step order`:`Step order`})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Action`,name:`keyword`,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,disabled:z,optionFilterProp:`label`,placeholder:`Select action`,options:m,onChange:W})})}),(0,l.jsx)(s.Col,{xs:24,children:(0,l.jsx)(s.Form.Item,{label:`Description`,name:`description`,children:(0,l.jsx)(s.Input.TextArea,{rows:3,maxLength:255,disabled:z,placeholder:`Enter description`,showCount:!0,onBlur:e=>re(`description`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Key`,name:`target`,rules:[{required:B.key,message:`Key is required for this action`}],children:(0,l.jsx)(s.Input,{maxLength:255,disabled:z||!!F&&!B.key,placeholder:z?`Select module and flow first`:F?B.key?`Required — Enter selector / locator`:`Not needed for this action`:`Select an action first`,onBlur:e=>re(`target`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Tags`,name:`tags`,children:(0,l.jsx)(s.Input,{maxLength:200,disabled:z,placeholder:`Enter tags`,prefix:(0,l.jsx)(c.TagsOutlined,{className:`v1-input-icon`}),onBlur:e=>re(`tags`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Value`,name:`value`,rules:[{required:B.value,message:`Value is required for this action`}],children:(0,l.jsx)(s.Input.TextArea,{rows:4,disabled:z||!!F&&!B.value,placeholder:z?`Select module and flow first`:F?B.value?`Required — Enter value`:`Not needed for this action`:`Select an action first`,onBlur:e=>re(`value`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Expected`,name:`expected`,rules:[{required:B.expected,message:`Expected result is required for this action`}],children:(0,l.jsx)(s.Input.TextArea,{rows:4,disabled:z||!!F&&!B.expected,placeholder:z?`Select module and flow first`:F?B.expected?`Required — Enter expected result`:`Not needed for this action`:`Select an action first`,onBlur:e=>re(`expected`,e.target.value)})})})]})}),(0,l.jsx)(`div`,{className:`v1-form-actions`,children:(0,l.jsx)(s.Form.Item,{children:(0,l.jsxs)(s.Space,{children:[(0,l.jsx)(s.Button,{type:`primary`,htmlType:`submit`,loading:O,disabled:z,children:`Submit`}),(0,l.jsx)(s.Button,{onClick:()=>{e.resetFields(),u([]),p([])},children:`Reset`})]})})})]})}),(0,l.jsx)(s.Modal,{title:`Add ${j.label}`,open:S.open,confirmLoading:w,okText:`Add`,onCancel:se,onOk:()=>{T(!0),ce()},destroyOnHidden:!0,children:(0,l.jsxs)(s.Form,{form:t,layout:`vertical`,colon:!1,className:`v1-form`,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),children:[(0,l.jsx)(s.Form.Item,{label:`Name`,name:`name`,children:(0,l.jsx)(s.Input,{maxLength:100,placeholder:`Enter ${j.label.toLowerCase()} name`,onBlur:e=>{t.setFieldsValue({name:HM(e.target.value)})}})}),(0,l.jsx)(s.Form.Item,{label:`Type`,name:`type`,children:(0,l.jsx)(s.Input,{disabled:!0})})]})})]})})]})}var qM=[{label:`Home`,href:`/`},{label:`LMS Cases`,href:`/lms-cases`}];function JM(){return(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsx)(n.t,{items:qM}),(0,l.jsx)(Lo,{moduleName:`lms-flows`,rowKey:`id`})]})}var YM=[`referenceId`,`ReferenceId`,`candidateId`,`CandidateId`,`entityId`,`EntityId`,`id`,`Id`,`_id`];function XM(e=YM){return function(t){if(!t||typeof t!=`object`)return``;for(let n of e){let e=t[n];if(e!=null&&e!==``)return String(e)}return``}}function ZM(e,t=YM){if(!e||typeof e!=`object`)return[];let n=[];for(let r of t){let t=e[r];t!=null&&t!==``&&n.push(String(t))}return n}var QM=XM();function $M(e){return typeof e==`function`?e:typeof e==`string`?XM([e]):Array.isArray(e)?XM(e):QM}function eN(e,t,n){return!t||typeof t!=`object`?e:{...t,...e,id:e?.id??t?.id??n}}function tN(e,t,n={}){return{status:`success`,total:t,data:{data:e,...n}}}var nN=[`fields`,`fieldConfig`,`tabs`,`tabField`,`actionRules`,`actions`,`columnActions`];function rN(e){let t=e?.data??e,n={};for(let r of nN){let i=e?.[r]??t?.[r];i==null||Array.isArray(i)&&i.length===0||(n[r]=i)}return n}var iN=e=>String(e??``).replace(/[^a-zA-Z0-9]/g,``).toLowerCase();function aN(e,t,n){let r=(Array.isArray(n)?n:[n]).map(iN).filter(Boolean),i=r.length?e.findIndex(e=>r.includes(iN(e?.value))||r.includes(iN(e?.label))):-1;if(i===-1)return[...e,...t];let a=Number(e[i]?.order),o=Number.isFinite(a)?t.map((e,n)=>e.order==null||e.order===``?{...e,order:a+(n+1)/(t.length+1)}:e):t;return[...e.slice(0,i+1),...o,...e.slice(i+1)]}var oN=(e,t)=>ri(e,t).rows,sN=(e,t)=>{let{rows:n,total:r}=ri(e,t);return{rows:n,total:r}};function cN(e,t){return function(n,r,i,a={}){return e(t??n,r,i,a)}}function lN(e){return!e||typeof e!=`object`||typeof(e.fetchByKeys??e.fetch??e.function)!=`function`?null:{...e,fetchByKeys:typeof e.fetchByKeys==`function`?e.fetchByKeys:null,fetch:typeof e.fetch==`function`?e.fetch:null,function:typeof e.function==`function`?e.function:null,extractRows:typeof e.extractRows==`function`?e.extractRows:oN,mergeRow:typeof e.mergeRow==`function`?e.mergeRow:eN,fetchById:typeof e.fetchById==`function`?e.fetchById:null}}function uN({fetchSecondaryByKeys:e,fetchSecondary:t,extractSecondaryRows:n,fetchSecondaryById:r,secondaryKey:i,mergeRow:a,secondaryFetchLimit:o}){return!e&&!t&&!r?[]:[lN({key:i,fetchByKeys:e?(t,n,r)=>e(t,n,r):null,function:t?({moduleName:e,options:n})=>t(e,o,0,n):null,extractRows:n,fetchById:r,mergeRow:a})].filter(Boolean)}function dN(e){if(typeof e==`function`)return t=>{let n=e(t);return n==null||n===``?[]:[String(n)]};let t=typeof e==`string`?[e]:Array.isArray(e)&&e.length?e:YM;return e=>ZM(e,t)}function fN(e,t){let n=new Map;return e.forEach(e=>{for(let r of t(e))n.has(r)||n.set(r,e)}),n}function pN({moduleName:e,limit:t,offset:n,options:r,keys:i,primaryResponse:a,primaryRows:o,pageRows:s,total:c,source:l}){return{moduleName:e,limit:t,offset:n,options:r,keys:i,primaryResponse:a,primaryRows:o,pageRows:s,total:c,source:l}}async function mN(e,t){if(typeof e.args==`function`){let n=e.args(t);return(e.fetch??e.function??e.fetchByKeys)(...Array.isArray(n)?n:[n])}if(Array.isArray(e.args))return(e.fetch??e.function??e.fetchByKeys)(...e.args);if(e.fetchByKeys&&Array.isArray(t.keys))return e.fetchByKeys(t.moduleName,t.keys,t.options,t);let n=e.fetch??e.function;return typeof n==`function`?n(t):null}function hN({fetchPrimaryPage:e,extractPrimaryPage:t=sN,fetchSecondaryByKeys:n,joinSources:r=[],fetchPrimary:i,extractPrimaryRows:a=oN,fetchSecondary:o,extractSecondaryRows:s=oN,fetchSecondaryById:c,primaryKey:l,secondaryKey:u,mergeRow:d=eN,secondaryFetchLimit:f=200,extraFields:p=[],extraFieldsAfter:m}){let h=Array.isArray(r)&&r.length?r.map(lN).filter(Boolean):uN({fetchSecondaryByKeys:n,fetchSecondary:o,extractSecondaryRows:s,fetchSecondaryById:c,secondaryKey:u,mergeRow:d,secondaryFetchLimit:f}),g=0;async function _(e,t,n,r){if(!e.fetchById||!r)return null;try{let i=await e.fetchById(n,r);return i&&t(i).includes(String(r))?i:null}catch(e){return console.error(`[mergedListApi] per-id join lookup failed for "${r}"`,e),null}}async function v(e,t,n,r,i){if(!n)return e;let a=t.extractRows(n,r)??[],o=$M(t.primaryKey??l),s=dN(t.key),c=fN(a,s);return Promise.all(e.map(async e=>{let n=o(e),a=c.get(n)??(i()?null:await _(t,s,r,n));return t.mergeRow(e,a,n)}))}async function y(e,t,n,r){let i=e;for(let e of t)i=await v(i,e.source,e.response,n,r);return i}function b(e,t,n){let r={};for(let e of n){if(!e)continue;let t=rN(e);for(let e of Object.keys(t))r[e]??(r[e]=t[e])}return p.length&&(r.fields=aN(r.fields??[],p,m)),tN(e,t,r)}async function x({moduleName:e,limit:t,offset:n,options:r,primaryResponse:i,primaryRows:a,pageRows:o,total:s}){return Promise.all(h.map(async c=>{try{let u=$M(c.primaryKey??l),d=[...new Set(o.map(u).filter(Boolean))];return c.fetchByKeys&&d.length===0?{source:c,response:null}:{source:c,response:await mN(c,pN({moduleName:e,limit:t,offset:n,options:r,keys:d,primaryResponse:i,primaryRows:a,pageRows:o,total:s,source:c}))}}catch(e){return console.error(`[mergedListApi] join fetch failed — rendering page without that join`,e),{source:c,response:null}}}))}async function S(n,r,i,a,o){let s=await e(n,r,i,a),c=t(s,n)??{},l=Array.isArray(c.rows)?c.rows:[],u=Number.isFinite(Number(c.total))?Number(c.total):l.length,d=await x({moduleName:n,limit:r,offset:i,options:a,primaryResponse:s,primaryRows:l,pageRows:l,total:u});return b(await y(l,d,n,o),u,[s,...d.map(e=>e.response)])}async function C(e,t,n,r,o){let s=await i(e,t,n,r),c=a(s,e)??[],l=c.length,u=c.slice(n,n+t),d=await x({moduleName:e,limit:t,offset:n,options:r,primaryResponse:s,primaryRows:c,pageRows:u,total:l});return b(await y(u,d,e,o),l,[s,...d.map(e=>e.response)])}return async function(t,n=10,r=0,i={}){let a=++g,o=()=>a!==g;return e?S(t,n,r,i,o):C(t,n,r,i,o)}}function gN(e,t,n={}){return hN({fetchPrimary:()=>ZO(e,t),extractPrimaryRows:YO,fetchSecondary:On,fetchSecondaryById:QO,secondaryFetchLimit:n.moduleFetchLimit??200})}function _N(e){let t=String(e??``).trim().split(/[^a-zA-Z0-9]+/).filter(Boolean);return t.length?`${t.map((e,t)=>t===0?e.toLowerCase():e[0].toUpperCase()+e.slice(1).toLowerCase()).join(``)}Count`:``}function vN(e){let t=Array.isArray(e?.stages)?e.stages:[];if(!t.length)return e;let n={};for(let e of t){let t=_N(e?.stageName);t&&(n[t]=Number(e?.count)||0)}return{...n,...e}}var yN=e=>{let t=Number(e?.targetSubmission??e?.targetSubmissions);return Number.isFinite(t)&&t>0?t:null};function bN({submittedCountField:e=`submittedCount`,progressField:t=`targetSubmissionProgress`}={}){return function(n,r,i){let a=eN(n,r,i),o=yN(a);return o!=null&&(a[t]=`${Number(a?.[e])||0} of ${o}`),a}}function xN(e={}){let t=bN();return hN({primaryKey:`_id`,extraFields:e.extraFields,extraFieldsAfter:e.extraFieldsAfter,fetchPrimaryPage:On,joinSources:[{key:`entityId`,fetchByKeys:(e,t,n,r)=>{let i=Math.max(1,Number(r?.limit)||10);return XO(Math.floor((Number(r?.offset)||0)/i)+1,i)},extractRows:e=>(e?.items??[]).map(vN),mergeRow:(e,n,r)=>{let i=t(e,n,r);return n?._id&&(i.workflowId=n._id),i}}]})}async function SN(e,t=10,n=0,r={},i={}){return ri(await xN(i)(e,t,n,r),e)}async function CN(e,t,n,r=10,i=0,a={}){return ri(await gN(e,t)(n,r,i,a),n)}typeof window<`u`&&(window.__CORE_THEME_BUILD__=`2026-08-25T14:17:14.693Z`);var wN=BA,TN=tb(Rj),EN=tb(Bj),DN=tb(tM),ON=tb(pM),kN=tb(SM),AN=tb(TM),jN=tb(OM),MN=tb(jM),NN=tb(NM),PN=tb(KM),FN=tb(JM);exports.ADMIN_API_URL=t.v,exports.ADMIN_APP_ID=t.y,exports.APP_ID=t.b,exports.AUTH_URL=t.x,exports.ActivityNotesCard=Mc,exports.ActivityTab=Dc,exports.AddBatchCandidatePopup=xA,exports.AddFormV1=uc,exports.AdminDashboard=BA,exports.AdminDashboardContent=BT,exports.AdminPage=wN,exports.AppAlert=dc,exports.AppButton=n.lt,exports.AppShell=wy,exports.ApprovalActionBar=Vg,exports.AssigneeAvatars=Nc,exports.AuthGuard=_y,exports.BILLING_STATUS_FLOW=Hd,exports.BOOLEAN_API_KEYS=Dh,exports.BOOLEAN_PARSEABLE_API_KEYS=Nm,exports.BULK_UPLOAD_DEFAULT_ACCEPT=Pc,exports.BULK_UPLOAD_DEFAULT_MAX_SIZE_MB=Fc,exports.Breadcrumb=n.t,exports.BulkUploadPage=DN,exports.BulkUploadPanel=Uc,exports.CANDIDATES_URL=t.S,exports.CONTRACT_C2C=d_,exports.CONTRACT_W2=u_,exports.CORE_URL=t.C,exports.CURRENCY_SYMBOLS=Zl,exports.CalendarCard=A,exports.CoreThemeAdminApp=WT,exports.CoreThemeAdminRoutes=UT,exports.CustomPagination=Re,exports.DEFAULT_HOURS_POLICY=lg,exports.DayLogModal=Ng,exports.DescriptionBlock=nl,exports.DetailHeaderCard=Gf,exports.DetailViewPage=Qf,exports.DetailViewV1=Vu,exports.DocumentViewer=n.Cn,exports.DynamicCards=Pt,exports.DynamicPopup=lO,exports.DynamicPopupRoute=EA,exports.DynamicTabs=P,exports.EditFormV1=Xp,exports.FIELD_TYPE_REGISTRY=mh,exports.FINANCE_APPROVAL_CONFIG=n_,exports.FINANCE_TYPE_CFO=Yg,exports.FINANCE_TYPE_ONBOARDING_MANAGER=Jg,exports.FINANCE_TYPE_ONBOARDING_MANAGER_REAPPROVE=Qg,exports.FINANCE_TYPE_ONLY_FINANCE=Xg,exports.FINANCE_TYPE_SUBMISSION_MANAGER=qg,exports.FINANCE_TYPE_SUBMISSION_MANAGER_REAPPROVE=Zg,exports.FileListCard=gv,exports.FinanceApprovalPanel=Y_,exports.FinanceAvatar=wf,exports.FinanceBadge=Of,exports.FinanceDayCell=Ug,exports.FinanceDivider=gf,exports.FinanceEmployeeCell=Tf,exports.FinanceEmptyState=pf,exports.FinanceEquation=_f,exports.FinanceHistoryTimeline=xf,exports.FinanceHoursGrid=ff,exports.FinanceKpiRow=df,exports.FinanceLine=hf,exports.FinanceListToolbar=cg,exports.FinanceMarginBadge=kf,exports.FinanceMoneyCell=Df,exports.FinanceRecordsTable=Mf,exports.FinanceRowChevron=Af,exports.FinanceSection=mf,exports.FinanceStatusPill=uf,exports.FinanceTextCell=Ef,exports.FinanceTimesheetAnalysis=Gg,exports.FinanceWorkflowSteps=vf,exports.GATEWAY_URL=t.w,exports.HOURS_MESSAGES=ug,exports.Header=Gv,exports.HierarchyUserFilter=zt,exports.JOBS_URL=t.T,exports.LegacyAdminPage=TN,exports.ListView=Lo,exports.LmsHomePage=FN,exports.LmsTestForm=PN,exports.Login=Ty,exports.MailPopup=yE,exports.ManageModules=AN,exports.ManageSubmodules=jN,exports.ModuleRowActions=am,exports.NotesPanel=Bg,exports.NotesTab=jc,exports.PAYROLL_STATUS_FLOW=Ud,exports.POPUP_CONFIGS=fA,exports.PYOPS_URL=t.E,exports.ParamCardView=fm,exports.ParamListView=vm,exports.PeriodBadgeTag=Sg,exports.PreviewPopup=XE,exports.ProjectSelect=eb,exports.ProofUploadPreview=zg,exports.QuickLogBar=Ig,exports.QuickLogSelectionBar=Pg,exports.RejectionReasonModal=Fg,exports.SUBMISSIONS_URL=t.D,exports.SearchBuilderV1=$h,exports.Sidebar=py,exports.StatusBadge=tg,exports.StatusBadgeTag=xg,exports.StickyNotesFullPage=EN,exports.StylishDynamicTabs=rg,exports.TemplateEditor=ag,exports.TestForm=ON,exports.TestingHomePage=NN,exports.TimelineGroups=yc,exports.TimesheetDayCell=Ag,exports.TipTapEditor=n.wn,exports.UserForm=zA,exports.VendorShareDrawer=AA,exports.ViewSummaryWidget=ki,exports.WizardPopup=nD,exports.ZINNEXT_URL=t.O,exports.ZinnextTableView=MN,exports.ZinnextTestForm=kN,exports.appNow=n.On,exports.applyIntegrationStatus=n.Wn,exports.approveSubmission=ye,exports.buildAcceptAttr=Bc,exports.buildBooleanRequest=Mh,exports.buildCsv=rf,exports.buildDailyRows=Zd,exports.buildDayGradient=Og,exports.buildRateHistoryEntries=I_,exports.buildWeeklyRollup=ef,exports.clearSelectedProject=t.i,exports.colors=n.Dn,exports.computeFinance=O_,exports.computeHoursPolicy=gg,exports.computeMarginBand=tf,exports.conditionMatches=n.i,exports.configureCoreTheme=t.k,exports.configuredFieldLabel=n.a,exports.createAllWorkflowsListFetcher=xN,exports.createMergedListFetcher=hN,exports.createModuleListFetchAdapter=cN,exports.createWorkflowStageListFetcher=gN,exports.currencySymbol=Ql,exports.defaultMergeRow=eN,exports.deleteIntegrationConfig=n.tr,exports.deriveDayStats=Xd,exports.describeCapacity=vg,exports.downloadCsv=cf,exports.evaluateShowIfWith=n.o,exports.findEmployerRow=S_,exports.flattenGroups=b_,exports.formatAmount=iu,exports.formatApp=n.kn,exports.formatAppDateTime=n.An,exports.formatFileSize=zc,exports.formatFinanceMoney=L_,exports.formatHours=Nd,exports.formatMoney=au,exports.formatPercent=Fd,exports.formatRate=ou,exports.getActivity=n.un,exports.getAllWorkflowsModuleList=SN,exports.getAppTimeZone=n.jn,exports.getApprovalDate=zd,exports.getBgcIntegrationConfig=n.vr,exports.getBgcIntegrationSummary=n.yr,exports.getBillingActionStates=Wd,exports.getBooleanEligibleTypes=bh,exports.getCurrentRoleName=t.c,exports.getFieldLabel=of,exports.getFieldType=gh,exports.getFileExtension=Rc,exports.getFinanceApprovalConfig=s_,exports.getFormGroupsRaw=av,exports.getIntegrationConfig=n.Tr,exports.getIntegrationConfigs=n.Er,exports.getIntegrationSummary=n.Dr,exports.getModuleConfig=Fe,exports.getModuleDataDetail=n.fn,exports.getPayrollActionStates=Gd,exports.getPeriodBadgeConfig=Le,exports.getSelectedProject=t.l,exports.getStoredToken=t.u,exports.getStoredUser=t.d,exports.getUserRoles=t.f,exports.getVMSApprove=be,exports.getValueStyle=sf,exports.getWorkflowStageModuleList=CN,exports.getWorkflowSteps=Kd,exports.humanizeEvent=Rd,Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return cs}}),exports.indexFieldConfig=af,exports.initialsOf=Id,exports.insertTokenAtCursor=Lm,exports.isBooleanEligible=_h,exports.isBooleanParsable=Fm,exports.isTester=t.p,exports.logout=t.h,exports.marginIncludesReferral=l_,exports.matchLocationTax=D_,Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return op}}),exports.normalizeContract=w_,Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Wc}}),exports.rateUnitLabel=eu,exports.rateUnitShort=nu,exports.reconcileHours=_g,exports.registerFieldType=hh,exports.rejectSubmission=Se,exports.resolveActivityMeta=wc,exports.resolveAndCompute=k_,exports.resolveDayKind=mg,exports.resolveFinanceInputs=E_,exports.resolveMergeKey=QM,exports.resolveMergedListKey=QM,exports.resolveRejectionReason=c_,exports.resolveSubmissionFinance=ov,exports.saveBgcIntegrationConfig=n.Yr,exports.saveIntegrationConfig=n.Qr,exports.setSelectedProject=t._,exports.showIfConditions=n.c,exports.stageCountKey=_N,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Ey}}),exports.testIntegrationConnection=n.ii,exports.toApp=n.Nn,exports.toNumber=ru,exports.tzLabel=n.Pn,exports.tzShortLabel=n.Fn,exports.useDropdownFields=Wn,exports.useDropdownValues=Ai,exports.useEditForm=_v,exports.useFieldConfig=Gn,exports.useFilterFields=Kn,exports.useMenuPermission=tr,exports.useModuleActions=Qp,exports.useRecordRefresh=Yf,exports.validateBooleanQuery=Im,exports.validateBulkFile=Vc,exports.withAdminAppId=t.A,exports.withAppId=t.j,exports.withAuthGuard=tb;
12
+ `))}function ME(e){let t=e.match(/^([A-Za-z][A-Za-z&/ ]{1,28}?)\s*:\s*(\S.+)$/);if(!t)return null;let n=t[1].trim(),r=t[2].trim();return n.split(/\s+/).length>3||r.length>60?null:{fieldKey:n.toLowerCase().replace(/\s+/g,`-`),fieldLabel:DE(n),value:r}}function NE(e){let t=e.toLowerCase().replace(/[\s:.\-–—]+$/,``).trim();return CE.has(t)?wE.test(t)?`education`:TE.test(t)?`keySkills`:`overview`:null}function PE(e){let t=[],n={overview:[],keySkills:[],education:[]},r=`overview`;return e.forEach(e=>{let i=NE(e);if(i){r=i;return}if(r===`overview`){let n=ME(e);if(n){t.push(n);return}}n[r].push(e)}),{meta:t,overview:OE(n.overview),keySkills:OE(n.keySkills),education:OE(n.education)}}function FE(e){let t=[...SE].sort((e,t)=>t.length-e.length),n=RegExp(`\\b(${t.map(EE).join(`|`)})\\b\\s*:?`,`gi`),r=[...e.matchAll(n)];if(!r.length)return{meta:[],overview:OE(jE(e)),keySkills:[],education:[]};let i={overview:[],keySkills:[],education:[]},a=e.slice(0,r[0].index).trim();return a&&i.overview.push(...jE(a)),r.forEach((t,n)=>{let a=t[1].trim().toLowerCase(),o=t.index+t[0].length,s=n+1<r.length?r[n+1].index:e.length,c=jE(e.slice(o,s).trim());if(!c.length)return;let l=wE.test(a)?`education`:TE.test(a)?`keySkills`:`overview`;i[l].push(...c)}),{meta:[],overview:OE(i.overview),keySkills:OE(i.keySkills),education:OE(i.education)}}function IE(e){let t=kE(e);if(!t)return{meta:[],overview:[],keySkills:[],education:[]};let n=AE(t);return n.length>=4?PE(n):FE(t)}function LE({items:e}){return(0,l.jsx)(`ul`,{className:`jdv-ats-bullets`,children:e.map((e,t)=>(0,l.jsx)(`li`,{className:`jdv-ats-bullet-item`,children:e},t))})}function RE({raw:e=``,meta:t=[]}){let[n,r]=(0,o.useState)(!1),i=(0,o.useMemo)(()=>IE(e),[e]),a=t.length?t:i.meta,s=[];if(i.overview.length&&s.push({key:`overview`,title:`Overview`,items:i.overview}),i.keySkills.length&&s.push({key:`keySkills`,title:`Key Skills`,items:i.keySkills,card:!0,icon:`🛠️`}),i.education.length&&s.push({key:`education`,title:`Education`,items:i.education,card:!0,icon:`🎓`}),!a.length&&!s.length)return(0,l.jsx)(bE,{type:`secondary`,children:`No description available.`});let c=n?s:s.slice(0,xE),u=s.length-xE;return(0,l.jsxs)(`div`,{className:`jdv-ats-desc`,children:[a.length>0&&(0,l.jsx)(`div`,{className:`jdv-ats-meta-grid`,children:a.map(({fieldKey:e,fieldLabel:t,value:n})=>(0,l.jsxs)(`div`,{className:`jdv-ats-meta-row`,children:[(0,l.jsx)(`span`,{className:`jdv-ats-meta-key`,children:t}),(0,l.jsx)(`span`,{className:`jdv-ats-meta-val`,children:n})]},e??t))}),(0,l.jsx)(`div`,{className:`jdv-ats-sections`,children:c.map(e=>e.card?(0,l.jsxs)(`div`,{className:`education-block`,children:[(0,l.jsxs)(`div`,{className:`education-header`,children:[(0,l.jsx)(`span`,{children:e.icon}),(0,l.jsx)(`span`,{children:e.title})]}),(0,l.jsx)(`ul`,{className:`education-list`,children:e.items.map((e,t)=>(0,l.jsx)(`li`,{className:`education-list-item`,children:e},t))})]},e.key):(0,l.jsxs)(`div`,{className:`jdv-ats-section`,children:[(0,l.jsx)(`div`,{className:`jdv-ats-section-hd`,children:(0,l.jsx)(`span`,{children:e.title})}),(0,l.jsx)(LE,{items:e.items})]},e.key))}),u>0&&(0,l.jsx)(`span`,{className:`jdv-desc-toggle`,onClick:()=>r(e=>!e),children:n?`Show less`:`Show more (${u} more section${u>1?`s`:``})`})]})}var{Text:zE}=s.Typography;function BE(e){return e?e.trim().split(/\s+/).slice(0,2).map(e=>e[0].toUpperCase()).join(``):`?`}function VE(e){return e?e.name?e.name:e.fullName?e.fullName:e.firstName||e.lastName?[e.firstName,e.lastName].filter(Boolean).join(` `):e.candidateName??e.clientName??e.jobTitle??``:``}function HE(e){return e?e.email??e.emailId??e.emailAddress??``:``}function UE(e){return e?e.status?e.status:e.stage?e.stage:typeof e.isActive==`boolean`?e.isActive?`Active`:`Inactive`:``:``}function WE(e){return e==null||e===``?`-`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.join(`, `):typeof e==`object`?e.label??e.name??Object.values(e).join(` `):String(e)}var GE=[`jobDescription`,`description`,`rawDescription`,`jobDescriptionText`];function KE(e){return String(e??``).toLowerCase()===`job`}function qE(e){let t=GE.includes(e.field),n=/description/i.test(e.label??``);return t||n}function JE({record:e}){let t=VE(e),n=HE(e),r=UE(e);return!t&&!n?null:(0,l.jsxs)(`div`,{className:`preview-profile-card`,children:[(0,l.jsxs)(`div`,{className:`preview-profile-card__info`,children:[(0,l.jsx)(s.Avatar,{className:`preview-profile-card__avatar`,children:BE(t)}),(0,l.jsxs)(`div`,{className:`preview-profile-card__text`,children:[t&&(0,l.jsx)(`span`,{className:`preview-profile-card__name`,children:t}),n&&(0,l.jsx)(`span`,{className:`preview-profile-card__email`,children:n})]})]}),r&&(0,l.jsx)(s.Tag,{className:`preview-profile-card__status`,children:r})]})}function YE({fields:e,moduleName:t,centralDocuments:r=[]}){let[i,a]=(0,o.useState)([]),[s,c]=(0,o.useState)(0),[u,d]=(0,o.useState)(!1);if(!e?.length)return null;function f(e){let t=String(e?.type??``).trim().toLowerCase(),n=`${e?.field??``} ${e?.label??``}`;return[`file`,`document`,`upload`].includes(t)||/resume|cv|document|attachment/i.test(n)}function p(e,t){a(e),c(t),d(!0)}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`preview-field-grid`,children:e.map(e=>{let i=e.value,a=Array.isArray(i)&&i.length>0,o=KE(t)&&qE(e)&&typeof i==`string`&&i.trim(),s=f(e)?r.filter(t=>{let n=String(t?.fieldName??t?.field??t?.formField??t?.key??``).trim().toLowerCase(),r=String(e?.field??``).trim().toLowerCase();if(n&&r&&n===r)return!0;let i=`${e?.field??``} ${e?.label??``}`;return/resume|cv/i.test(i)?/resume|cv/i.test(`${n} ${t?.fileName??``} ${t?.name??``}`):!1}).map(t=>({name:t?.fileName||t?.name||t?.uploadedFileName||t?.originalName||e?.label||`Document`,url:t?.fileUrl||t?.downloadUrl||t?.signedUrl||t?.url||``,type:t?.mimeType||t?.contentType||t?.type})).filter(e=>e.url):[],c=f(e)?s.length?s:n.Lt(i).filter(e=>e.url):[];return c.length?(0,l.jsxs)(`div`,{className:`preview-field-card preview-field-card--documents`,children:[(0,l.jsx)(`span`,{className:`preview-field-card__label`,children:e.label}),(0,l.jsx)(`div`,{className:`preview-document-list`,children:c.map((e,t)=>(0,l.jsxs)(`button`,{type:`button`,className:`preview-document-link`,onClick:()=>p(c,t),title:`Preview ${e.name||`document`}`,children:[(0,l.jsx)(`span`,{className:`preview-document-link__icon`,"aria-hidden":`true`,children:`▣`}),(0,l.jsx)(`span`,{className:`preview-document-link__name`,children:e.name||`Document ${t+1}`}),(0,l.jsx)(`span`,{className:`preview-document-link__action`,children:`Preview`})]},`${e.url}-${t}`))})]},e.field??e.label):a?i.map((t,n)=>(0,l.jsxs)(`div`,{className:`preview-field-card`,children:[(0,l.jsxs)(`span`,{className:`preview-field-card__label`,children:[e.label,i.length>1?` (${n+1})`:``]}),(0,l.jsx)(`span`,{className:`preview-field-card__value`,children:WE(t)})]},`${e.field??e.label}-${n}`)):o?(0,l.jsxs)(`div`,{className:`preview-field-card preview-field-card--description`,children:[(0,l.jsx)(`span`,{className:`preview-field-card__label`,children:e.label}),(0,l.jsx)(`div`,{className:`preview-field-card__description`,children:(0,l.jsx)(RE,{raw:i})})]},e.field??e.label):(0,l.jsxs)(`div`,{className:`preview-field-card`,children:[(0,l.jsx)(`span`,{className:`preview-field-card__label`,children:e.label}),(0,l.jsx)(`span`,{className:`preview-field-card__value`,children:WE(i)})]},e.field??e.label)})}),(0,l.jsx)(n.Cn,{documents:i,open:u,onClose:()=>d(!1),initialIndex:s})]})}function XE(){let e=(0,d.useNavigate)(),{moduleName:t=``,record:r=null}=(0,d.useLocation)().state??{},i=r?.id??r?._id,[c,u]=(0,o.useState)([]),[f,p]=(0,o.useState)(!!(t&&i)),[m,h]=(0,o.useState)(null),[g,_]=(0,o.useState)([]),[v,y]=(0,o.useState)(0),b=(0,o.useRef)(null),x=(0,o.useRef)(null),S=(0,o.useRef)([]),C=(0,o.useRef)([]);(0,o.useEffect)(()=>{if(!t||!i)return;let e=!1;return Promise.all([a.r({module:t,id:i}),n.gn(t,i).catch(()=>({data:[]}))]).then(([t,n])=>{e||(u(Array.isArray(t)?t:[]),_(Array.isArray(n)?n:n?.data??[]),p(!1))}).catch(t=>{e||(h(t.message||`Failed to load preview`),_([]),p(!1))}),()=>{e=!0}},[t,i]);function w(){e(-1)}function T(e,t){return e?.label??e?.name??`Section ${t+1}`}function E(e){let t=b.current,n=C.current[e];if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=(t.querySelector(`.preview-stepper-wrap`)?.offsetHeight??0)+12,o=t.scrollTop+i.top-r.top-a;y(e),t.scrollTo({top:Math.max(0,o),behavior:`smooth`})}function D(){let e=b.current;if(!e||!C.current.length)return;let t=e.getBoundingClientRect().top+(e.querySelector(`.preview-stepper-wrap`)?.offsetHeight??0)+24,n=0;C.current.forEach((e,r)=>{e&&e.getBoundingClientRect().top<=t&&(n=r)}),y(e=>e===n?e:n)}(0,o.useEffect)(()=>{let e=x.current,t=S.current[v];if(!e||!t)return;let n=t.offsetLeft-(e.clientWidth-t.offsetWidth)/2,r=Math.max(0,e.scrollWidth-e.clientWidth);e.scrollTo({left:Math.min(Math.max(0,n),r),behavior:`smooth`})},[v,c.length]);function O(){return c.length?(0,l.jsx)(`div`,{ref:x,className:`preview-stepper-wrap`,"aria-label":`Preview sections`,children:(0,l.jsx)(`div`,{className:`preview-stepper`,children:c.map((e,t)=>(0,l.jsxs)(`div`,{className:`preview-stepper__segment`,children:[(0,l.jsxs)(`button`,{type:`button`,className:`preview-stepper__item`,ref:e=>{S.current[t]=e},onClick:()=>E(t),"aria-current":v===t?`step`:void 0,title:`Go to ${T(e,t)}`,children:[(0,l.jsx)(`span`,{className:[`preview-stepper__circle`,t<v?`preview-stepper__circle--done`:``,t===v?`preview-stepper__circle--active`:``].filter(Boolean).join(` `),children:t+1}),(0,l.jsx)(`span`,{className:[`preview-stepper__label`,t===v?`preview-stepper__label--active`:``].filter(Boolean).join(` `),children:T(e,t)})]}),t<c.length-1&&(0,l.jsx)(`span`,{className:[`preview-stepper__line`,t<v?`preview-stepper__line--done`:``].filter(Boolean).join(` `),"aria-hidden":`true`})]},e.name??e.id??t))})}):null}let k=(0,l.jsxs)(`div`,{className:`preview-modal-header`,children:[(0,l.jsx)(`span`,{className:`preview-modal-module`,children:t.toUpperCase()}),(0,l.jsx)(`span`,{className:`preview-modal-title`,children:t?` Details`:`Preview`})]}),A=(0,l.jsx)(`div`,{className:`wizard-footer preview-scroll-footer`,children:(0,l.jsx)(`div`,{className:`wizard-footer-nav`,children:(0,l.jsx)(s.Button,{onClick:w,children:`Close`})})});function j(){return!t||!i?(0,l.jsx)(`div`,{className:`job-preview-content job-preview-status`,children:`Preview id is missing.`}):f?(0,l.jsx)(`div`,{className:`job-preview-content job-preview-status`,children:(0,l.jsx)(s.Spin,{size:`small`})}):m?(0,l.jsx)(`div`,{className:`job-preview-content job-preview-status job-preview-error`,children:m}):c.length?(0,l.jsx)(`div`,{className:`preview-section-list`,children:c.map((e,n)=>(0,l.jsxs)(`section`,{ref:e=>{C.current[n]=e},className:`preview-section-card`,"data-section-index":n,children:[(0,l.jsxs)(`div`,{className:`preview-section-card__header`,children:[(0,l.jsx)(`span`,{className:`preview-section-card__number`,children:n+1}),(0,l.jsx)(`span`,{className:`preview-section-card__title`,children:T(e,n)})]}),(0,l.jsx)(`div`,{className:`preview-section-card__body`,children:e.fields?.length>0?(0,l.jsx)(YE,{fields:e.fields,moduleName:t,centralDocuments:g}):(0,l.jsx)(zE,{type:`secondary`,children:`No fields in this group.`})})]},e.name??e.id??n))}):(0,l.jsx)(`div`,{className:`job-preview-content job-preview-status`,children:`No form groups found.`})}return(0,l.jsx)(s.Modal,{centered:!0,className:`wizard-modal preview-modal preview-scroll-modal`,footer:A,open:!0,title:k,width:`min(900px, calc(100vw - 32px))`,onCancel:w,maskClosable:!1,children:(0,l.jsxs)(`div`,{ref:b,className:`wizard-body preview-scroll-body`,onScroll:D,children:[!f&&!m&&c.length>0&&O(),r&&(0,l.jsx)(JE,{record:r}),j()]})})}var{Text:ZE}=s.Typography,{TextArea:QE}=s.Input,$E=[{key:`basic`,title:`Basic Info`,description:`General details`,fields:[{name:`firstName`,label:`First Name`,type:`input`,required:!0,placeholder:`Enter first name`,span:12},{name:`lastName`,label:`Last Name`,type:`input`,required:!0,placeholder:`Enter last name`,span:12},{name:`email`,label:`Email Address`,type:`input`,required:!0,placeholder:`Enter email address`,rules:[{type:`email`,message:`Please enter a valid email`}]},{name:`phone`,label:`Phone`,type:`input`,placeholder:`Enter phone number`}]},{key:`details`,title:`Details`,description:`Additional info`,fields:[{name:`role`,label:`Role`,type:`select`,required:!0,placeholder:`Select a role`,span:12,options:[{label:`Developer`,value:`developer`},{label:`Designer`,value:`designer`},{label:`Manager`,value:`manager`},{label:`Analyst`,value:`analyst`}]},{name:`department`,label:`Department`,type:`select`,placeholder:`Select department`,span:12,options:[{label:`Engineering`,value:`engineering`},{label:`Product`,value:`product`},{label:`Operations`,value:`operations`},{label:`Finance`,value:`finance`}]},{name:`notes`,label:`Notes`,type:`textarea`,placeholder:`Any additional notes...`}]},{key:`confirm`,title:`Confirm`,description:`Review & submit`,isReview:!0}];function eD(e){switch(e.type){case`select`:return(0,l.jsx)(s.Select,{placeholder:e.placeholder,options:e.options,style:{width:`100%`}});case`textarea`:return(0,l.jsx)(QE,{rows:3,placeholder:e.placeholder});case`number`:return(0,l.jsx)(s.InputNumber,{placeholder:e.placeholder,style:{width:`100%`}});default:return(0,l.jsx)(s.Input,{type:e.inputType||`text`,placeholder:e.placeholder})}}function tD({steps:e,form:t}){let n=t.getFieldsValue(),r=e.filter(e=>!e.isReview);return r.some(e=>(e.fields||[]).some(e=>n[e.name]!==void 0&&n[e.name]!==``))?(0,l.jsxs)(`div`,{className:`wizard-review-content`,children:[r.map(e=>(0,l.jsxs)(`div`,{className:`wizard-review-section`,children:[(0,l.jsx)(ZE,{className:`wizard-review-section-title`,children:e.title}),(0,l.jsx)(`div`,{className:`wizard-review-grid`,children:(e.fields||[]).map(e=>{let t=n[e.name],r=t===void 0||t===``||t===null?`—`:String(t);return(0,l.jsxs)(`div`,{className:`wizard-review-row`,children:[(0,l.jsx)(`span`,{className:`wizard-review-label`,children:e.label}),(0,l.jsx)(`span`,{className:`wizard-review-separator`,children:`:`}),(0,l.jsx)(`span`,{className:`wizard-review-value`,children:r})]},e.name)})})]},e.key)),(0,l.jsxs)(`div`,{className:`wizard-review-confirm-note`,children:[(0,l.jsx)(c.CheckCircleOutlined,{className:`wizard-review-confirm-icon`}),(0,l.jsx)(ZE,{type:`secondary`,children:`Please review the information above before submitting.`})]})]}):(0,l.jsx)(`div`,{className:`wizard-review-empty`,children:(0,l.jsx)(ZE,{type:`secondary`,children:`No data entered yet.`})})}function nD(){let[e]=s.Form.useForm(),t=(0,d.useNavigate)(),{title:n=`Wizard`,moduleName:r=``,steps:i=$E,onSubmit:a}=(0,d.useLocation)().state??{},[c,u]=(0,o.useState)(0),f=i[c],p=c===i.length-1,m=c===0;function h(){t(-1)}function g(){let t=(f.fields||[]).map(e=>e.name);e.validateFields(t.length>0?t:void 0).then(()=>{u(e=>e+1)})}function _(){u(e=>e-1)}function v(){let n=e.getFieldsValue();typeof a==`function`&&a(n),t(-1)}let y=i.map((e,t)=>({title:e.title,description:e.description,status:t<c?`finish`:t===c?`process`:`wait`})),b=r?`${n} — ${r}`:n;return(0,l.jsxs)(s.Modal,{open:!0,title:b,footer:(0,l.jsxs)(`div`,{className:`wizard-footer`,children:[(0,l.jsx)(s.Button,{onClick:h,children:`Cancel`}),(0,l.jsxs)(`div`,{className:`wizard-footer-nav`,children:[!m&&(0,l.jsx)(s.Button,{onClick:_,children:`Back`}),p?(0,l.jsx)(s.Button,{type:`primary`,onClick:v,children:`Submit`}):(0,l.jsx)(s.Button,{type:`primary`,onClick:g,children:`Next`})]})]}),onCancel:h,width:`min(680px, calc(100vw - 32px))`,centered:!0,className:`wizard-modal`,children:[(0,l.jsx)(`div`,{className:`wizard-steps-container`,children:(0,l.jsx)(s.Steps,{current:c,items:y,size:`small`,className:`wizard-steps`})}),(0,l.jsx)(`div`,{className:`wizard-body`,children:(0,l.jsxs)(s.Form,{form:e,layout:`vertical`,children:[i.filter(e=>!e.isReview).map((e,t)=>(0,l.jsx)(`div`,{style:{display:t===c?`block`:`none`},children:(0,l.jsx)(s.Row,{gutter:16,children:(e.fields||[]).map(e=>(0,l.jsx)(s.Col,{span:e.span||24,children:(0,l.jsx)(s.Form.Item,{name:e.name,label:e.label,rules:[...e.required?[{required:!0,message:`${e.label} is required`}]:[],...e.rules||[]],children:eD(e)})},e.name))})},e.key)),f.isReview&&(0,l.jsx)(tD,{steps:i,form:e})]})})]})}function rD({titleText:e,titleIcon:t}){let n=t===`delete`;return(0,l.jsxs)(`span`,{className:`dynamic-popup__header`,children:[(0,l.jsx)(`span`,{className:`dynamic-popup__header-icon-box${n?` dynamic-popup__header-icon-box--danger`:``}`,children:n?(0,l.jsx)(c.DeleteOutlined,{}):(0,l.jsx)(c.AppstoreOutlined,{})}),(0,l.jsx)(`span`,{className:`dynamic-popup__header-label`,children:e})]})}function iD({note:e,description:t,showSelectedCount:r,count:i,itemLabel:a,bodyText:o,deleteError:s}){return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(n.Tn,{variant:`body`,color:`secondary`,className:`dynamic-popup__note`,children:e}),t&&(0,l.jsx)(n.Tn,{variant:`body`,className:`dynamic-popup__description`,children:t}),r&&i>0&&(0,l.jsxs)(n.Tn,{variant:`body`,className:`dynamic-popup__selected-count`,children:[`Changing status for `,(0,l.jsx)(`strong`,{children:i}),` selected `,a,`.`]}),o&&(0,l.jsx)(n.Tn,{variant:`body`,children:o}),s&&(0,l.jsx)(n.Tn,{variant:`caption`,color:`danger`,className:`dynamic-popup__error`,children:s})]})}function aD({footerNote:e}){return e?(0,l.jsx)(n.Tn,{variant:`caption`,color:`secondary`,className:`dynamic-popup__footer-note`,children:e}):null}function oD(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>t?.[n]??``).trim()}function sD(e){return String(e).replace(/\(\s*\)/g,``).replace(/\s+/g,` `).replace(/(^|\s)([-–—·|])(?=\s*\2)/g,``).replace(/^[\s\-–—·|]+/,``).replace(/[\s\-–—·|]+$/,``).trim()}function cD(e){if(!e)return!1;let t=new Date(e).getTime();return Number.isNaN(t)||t<=0?!1:t<=Date.now()+864e5}function lD(e){if(!cD(e))return``;let t=new Date(e),n=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date,i=Math.round((n(r)-n(t))/864e5);if(i<=0)return`Today`;if(i===1)return`Yesterday`;if(i<=30)return`${i} days ago`;let a=(r.getFullYear()-t.getFullYear())*12+(r.getMonth()-t.getMonth());if(r.getDate()<t.getDate()&&--a,a=Math.max(1,a),a<12)return`${a} month${a===1?``:`s`} ago`;let o=Math.floor(a/12);return`${o} year${o===1?``:`s`} ago`}function uD(e){let t=Array.isArray(e?.submissionHistory)?e.submissionHistory:[],n=[e?.lastSubmittedAt,e?.submittedAt,e?.updatedAt,...t.map(e=>e?.submittedAt||e?.updatedAt)].filter(Boolean);return n.length?n.reduce((e,t)=>new Date(t)>new Date(e)?t:e):null}function dD(e){let t=Array.isArray(e?.submissionHistory)?e.submissionHistory:[],n=[e?.lastSubmittedAt,e?.submittedAt,...t.map(e=>e?.submittedAt)].filter(Boolean);return n.length?n.reduce((e,t)=>new Date(t)>new Date(e)?t:e):null}function fD(e,t){if(typeof e==`string`)return{label:e,value:e};if(e?.label!==void 0&&e?.value!==void 0&&!t?.labelTemplate&&!t?.valueKey)return e;let{labelKey:n,valueKey:r,labelTemplate:i}=t??{},a=i?.includes(`{lastdate}`)?{...e,lastdate:lD(uD(e))}:e,o=(i?sD(oD(i,a)):null)||(n?e?.[n]:null)||e?.name||e?.fullName||e?.candidateName||e?.title||e?.displayName||e?.text||e?.applicantReferenceId||e?.applicantRefrenceId||String(Object.values(e||{})[0]??``),s=(r?e?.[r]:null)??e?.id??e?._id??e?.applicantReferenceId??e?.applicantRefrenceId??String(Object.values(e||{})[0]??``),c=e?.disabled===!0||e?.disable===!0,l=String(e?.optionNote??``).trim(),u={label:l?`${String(o)} — ${l}`:String(o),value:String(s),_raw:e};if(c&&(u.disabled=!0),l&&(u.title=l),e?.isSubmitted===!0||e?.alreadySubmitted===!0){u.alreadySubmitted=!0,u.existingSubmissionId=String(e?.existingSubmissionId??e?.jobSubmissionId??e?.submissionId??``);let t=e?.submittedAt||dD(e);t&&(u.submittedAt=t)}if(e?.isFromSubmission===!0&&e?.submissionId){u.isFromSubmission=!0,u.priorSubmissionId=String(e.submissionId);let t=e?.lastSubmittedAt||dD(e);t&&(u.priorSubmittedAt=t)}return u}function pD(e,t){return(t?.[e.optionsKey]??e.defaultOptions??[]).map(t=>fD(t,e))}function mD(e={}){return{selectedIds:[],selectedRecords:[],moduleName:``,removedIds:[],...e}}var hD=`DD MMM YYYY`,gD=`DD MMM YYYY, h:mm A`;function _D(e,t){if(e==null||e===``)return``;let n=(0,u.default)(e);return n.isValid()?t===`relative`?lD(e)||(cD(e)?n.format(hD):`Not updated`):cD(e)?n.format(hD):``:String(e)}function vD(e,t){return e?String(e).includes(`{`)?sD(oD(e,t)):String(t?.[e]??e).trim():``}function yD(e){if(e?.alreadySubmitted){let t=e?.submittedAt?(0,u.default)(e.submittedAt):null;return{tone:`blocked`,tooltip:t?.isValid()?`Already submitted to this job on ${t.format(gD)}`:`Already submitted to this job — a candidate can only be submitted once per job`}}if(e?.isFromSubmission){let t=e?.priorSubmittedAt?(0,u.default)(e.priorSubmittedAt):null;return{tone:`history`,tooltip:t?.isValid()?`Previously submitted on ${t.format(gD)} — this form will prefill from it`:`Submitted to another job before — this form will prefill from it`}}return null}function bD(e,t){return e?.alreadySubmitted||!e?.disabled?``:String(t?.message??e?.title??``).trim()}function xD({meta:e}){return(0,l.jsx)(`div`,{className:`dynamic-popup__option-dates`,children:e.map(e=>(0,l.jsxs)(o.Fragment,{children:[(0,l.jsx)(`span`,{className:`dynamic-popup__option-date-label`,children:e.label}),(0,l.jsx)(`span`,{className:`dynamic-popup__option-date-value`,children:e.text})]},e.label))})}function SD({option:e,layout:t}){let n=e?._raw??e??{},r=vD(t.id,n),i=vD(t.title,n)||String(e?.label??``),a=vD(t.subtitle,n),o=vD(t.titleAccent?.key,n),u=vD(t.titleAccent?.toneKey,n),d=t.titleAccent?.prefix??``,f=(t.meta??[]).map(e=>({label:e.label,text:_D(n?.[e.key],e.type)})).filter(e=>e.text),p=bD(e,n),m=yD(e);return(0,l.jsxs)(`div`,{className:`dynamic-popup__option`,children:[(0,l.jsx)(`span`,{className:`dynamic-popup__option-tick${m?` dynamic-popup__option-tick--${m.tone}`:``}`,children:m&&(0,l.jsx)(s.Tooltip,{title:m.tooltip,placement:`topLeft`,children:(0,l.jsx)(c.CheckCircleFilled,{"aria-label":m.tooltip})})}),(0,l.jsxs)(`div`,{className:`dynamic-popup__option-main`,children:[(0,l.jsxs)(`div`,{className:`dynamic-popup__option-head`,children:[r&&(0,l.jsx)(`span`,{className:`dynamic-popup__option-id`,children:r}),(0,l.jsxs)(`span`,{className:`dynamic-popup__option-title`,children:[(0,l.jsx)(`span`,{className:`dynamic-popup__option-title-text`,children:i}),o&&(0,l.jsx)(`span`,{className:`dynamic-popup__option-title-accent${u?` dynamic-popup__option-title-accent--${u}`:``}`,children:`${d}${o}`})]}),p&&(0,l.jsx)(`span`,{className:`dynamic-popup__option-flag`,children:p})]}),a&&(0,l.jsx)(`div`,{className:`dynamic-popup__option-sub`,children:a})]}),e?.alreadySubmitted?(0,l.jsx)(`span`,{className:`dynamic-popup__option-onjob`,children:`On this job`}):f.length>0&&(0,l.jsx)(xD,{meta:f})]})}var{Text:CD}=s.Typography,{TextArea:wD}=s.Input,TD=[{label:`$`,value:`$`},{label:`EUR`,value:`EUR`},{label:`GBP`,value:`GBP`},{label:`INR`,value:`INR`}],ED=[{label:`Hourly`,value:`Hourly`},{label:`Daily`,value:`Daily`},{label:`Weekly`,value:`Weekly`},{label:`Monthly`,value:`Monthly`},{label:`Yearly`,value:`Yearly`}];function DD(e=[]){return e.map(e=>{if(!e||typeof e!=`object`)return e;let t=[e.value,e.user_id,e.userId,e.USER_ID,e.legacyUserId,e.id,e._id].find(e=>e!=null&&String(e).trim()!==``),n=t==null?``:String(t).trim();return{...e,value:n}}).filter(e=>typeof e!=`object`||!e||String(e.value??``).trim()!==``)}function OD({field:e,value:t,onChange:n}){return(0,l.jsx)(s.Input,{value:t,onChange:n,placeholder:e.placeholder,maxLength:e.maxLength,prefix:(0,l.jsx)(c.CrownOutlined,{})})}function kD({field:e,value:t,onChange:n}){return(0,l.jsx)(wD,{value:t,onChange:n,rows:e.rows??5,placeholder:e.placeholder})}function AD({field:e,options:t,value:n,onChange:r}){let i=DD(t);return(0,l.jsx)(s.Select,{showSearch:!0,value:n,onChange:r,options:i,placeholder:e.placeholder,className:`dynamic-popup__field-select`,optionFilterProp:`label`,prefix:(0,l.jsx)(c.CrownOutlined,{})})}function jD({field:e,options:t,value:n,onChange:r}){let i=DD(t);return(0,l.jsx)(s.Select,{mode:`multiple`,showSearch:!0,value:n,onChange:r,options:i,placeholder:e.placeholder,className:`dynamic-popup__field-select`,optionFilterProp:`label`,prefix:(0,l.jsx)(c.CrownOutlined,{})})}function MD({field:e,options:t,onSearch:n,value:r,onChange:i,popupContext:a}){let o=DD(t),u=e.optionLayout,d=new Map(o.map(e=>[String(e?.value??``),e]));async function f(t,n){let r=n??d.get(String(t??``));(typeof e.onSelectGuard!=`function`||await e.onSelectGuard({value:t,option:r,field:e,popupContext:a,confirm:s.Modal.confirm})!==!1)&&i?.(t)}return(0,l.jsx)(s.Select,{showSearch:!0,filterOption:!1,notFoundContent:e.notFoundContent??null,value:r,onChange:f,options:o,placeholder:e.placeholder,onSearch:n,className:`dynamic-popup__field-select${u?` dynamic-popup__field-select--rich`:``}`,popupClassName:u?`dynamic-popup__option-dropdown`:void 0,listHeight:u?340:void 0,optionLabelProp:`label`,optionRender:u?e=>(0,l.jsx)(SD,{option:e?.data??e,layout:u}):void 0,prefix:(0,l.jsx)(c.CrownOutlined,{})})}function ND({field:e,mentionOpts:t,onMentionSearch:n,value:r,onChange:i}){let a=Number(e.maxLength)>0?Number(e.maxLength):void 0,o=String(r??``).length;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Mentions,{value:r,onChange:i,rows:e.rows??5,placeholder:e.placeholder,prefix:`@`,options:t,onSearch:n,maxLength:a,className:`dynamic-popup__mention-textarea`}),a?(0,l.jsxs)(`div`,{className:`dynamic-popup__char-count`,style:{textAlign:`right`,fontSize:12,marginTop:4,color:o>a*.9?`#b45309`:`#8c8c8c`},children:[o,` / `,a]}):null]})}function PD({field:e={},value:t={},onChange:n}){let r=t.period??`Hourly`,i=t.isRange??!1;function a(e){n?.({...t,...e})}(0,o.useEffect)(()=>{let e={};t.currency??(e.currency=`$`),t.period??(e.period=`Hourly`),Object.keys(e).length&&n?.({...t,...e})},[]);let c=Number(i?t.maxAmount:t.amount),u=i&&t.minAmount!=null&&t.maxAmount!=null&&Number(t.maxAmount)<=Number(t.minAmount),d=e.rateCeiling!=null&&Number.isFinite(c)&&c>Number(e.rateCeiling);return(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(s.Space.Compact,{style:{width:`100%`},children:[i?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.InputNumber,{controls:!1,placeholder:`From`,value:t.minAmount,onChange:e=>a({minAmount:e}),style:{flex:1}}),(0,l.jsx)(s.InputNumber,{controls:!1,placeholder:`To`,value:t.maxAmount,onChange:e=>a({maxAmount:e}),style:{flex:1}})]}):(0,l.jsx)(s.InputNumber,{controls:!1,placeholder:`0`,value:t.amount,onChange:e=>a({amount:e}),style:{flex:2}}),(0,l.jsx)(s.Select,{value:t.currency??`$`,options:TD,onChange:e=>a({currency:e}),style:{width:80}}),(0,l.jsx)(s.Select,{value:r,options:ED,onChange:e=>a({period:e}),style:{width:110}})]}),(u||d)&&(0,l.jsxs)(`div`,{style:{marginTop:4},children:[u&&(0,l.jsx)(CD,{type:`danger`,style:{fontSize:12,display:`block`},children:`To rate must be greater than From rate.`}),d&&(0,l.jsxs)(CD,{type:`danger`,style:{fontSize:12,display:`block`},children:[`Rate must not exceed the client rate (`,e.rateCeiling,`).`]})]}),(0,l.jsxs)(s.Space,{size:`small`,style:{marginTop:8},children:[(0,l.jsx)(s.Switch,{checked:i,onChange:e=>a({isRange:e})}),(0,l.jsx)(`span`,{children:`Range`})]})]})}function FD({field:e,value:t,onChange:n}){return(0,l.jsx)(s.DatePicker,{value:t,onChange:n,placeholder:e.placeholder??`Select date`,style:{width:`100%`},format:`YYYY-MM-DD`})}function ID({field:e,checked:t,onChange:n}){return(0,l.jsx)(s.Checkbox,{checked:t,onChange:n,children:e.checkboxLabel})}function LD({field:e,value:t,onChange:n}){return(0,l.jsx)(s.InputNumber,{value:t,onChange:n,min:e.min,max:e.max,placeholder:e.placeholder,style:{width:`100%`}})}function RD({options:e,value:t,onChange:n}){return(0,l.jsx)(s.Radio.Group,{value:t,onChange:n,options:e})}var zD={input:OD,text:OD,textarea:kD,select:AD,"multi-select":jD,"search-select":MD,"mention-textarea":ND,"candidate-rate":PD,"priority-checkbox":ID,"date-picker":FD,number:LD,radio:RD};function BD(e){return e===`priority-checkbox`?{valuePropName:`checked`}:{}}var VD=new Set([`input`,`text`,`textarea`,`mention-textarea`]);function HD({form:e,fields:t,initialValues:r,dynamicOptions:i,popupContext:a,extraData:o,removedIds:c,setRemovedIds:u,showAlreadyAssigned:d,onValuesChange:f,getSearchHandler:p,getMentionSearchHandler:m,mentionOptions:h}){let g=(o?.recruitersData??[]).filter(e=>{let t=String(e?.user_id??e?.id??e?.userId??``);return t&&!c.includes(t)}),_=d&&o,v=new Set(d?g.map(e=>String(e?.user_id??e?.id??e?.userId??``).trim()).filter(Boolean):[]),y=e=>v.size===0||!Array.isArray(e)?e:e.filter(e=>!v.has(String((e&&typeof e==`object`?e.value??e.id:e)??``).trim()));return!t.length&&!_?null:(0,l.jsxs)(l.Fragment,{children:[_&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`dynamic-popup__already-assigned`,children:[(0,l.jsx)(n.Tn,{variant:`caption`,color:`secondary`,children:`Already Assigned People`}),(0,l.jsx)(`div`,{style:{marginTop:6,display:`flex`,flexWrap:`wrap`,gap:6},children:g.length===0?(0,l.jsx)(n.Tn,{variant:`caption`,color:`secondary`,children:`No one is currently assigned to this job.`}):g.map(e=>{let t=String(e?.user_id??e?.id??e?.userId??``),n=e?.name??e?.user_name??e?.userName??e?.email??`Assigned user`;return(0,l.jsx)(s.Tag,{closable:!0,onClose:()=>{t&&u(e=>Array.from(new Set([...e,t])))},children:n},t||n)})})]}),(0,l.jsx)(s.Divider,{style:{margin:`12px 0`}})]}),t.length>0&&(0,l.jsx)(s.Form,{form:e,layout:`vertical`,initialValues:r,onValuesChange:(e,t)=>f(t),children:UD(t).map(e=>WD(e,e=>{let t=y(i[e.name]??pD(e,a)),r=p(e),o=m(e),c=h[e.name]??[],u=BD(e.type),d=zD[e.type],f=[];return e.required&&f.push({required:!0,message:`${e.label||`This field`} is required`}),typeof e.validator==`function`&&f.push({validator:(t,n)=>{let r=e.validator(n,a);return r?Promise.reject(Error(r)):Promise.resolve()}}),VD.has(e.type)&&f.push(n.an({label:e.label,field:e.name,type:e.type})),(0,l.jsx)(s.Form.Item,{name:e.name,label:e.label,rules:f,...u,children:d?(0,l.jsx)(d,{field:e,options:t,onSearch:r,mentionOpts:c,onMentionSearch:o,popupContext:a}):null},e.name)}))})]})}function UD(e){let t=[];for(let n of e){let e=t[t.length-1];n.inlineRow&&e?.inlineRow===n.inlineRow?e.fields.push(n):t.push({inlineRow:n.inlineRow,fields:[n]})}return t.map(e=>e.fields)}function WD(e,t){return e.length===1?t(e[0]):(0,l.jsx)(`div`,{style:{display:`flex`,gap:8,alignItems:`flex-start`},children:e.map((e,n)=>(0,l.jsx)(`div`,{style:{flex:n===0?2:1,minWidth:0},children:t(e)},e.name))},`row-${e.map(e=>e.name).join(`-`)}`)}function GD(e){return[`select`,`multi-select`,`search-select`,`radio`].includes(e?.type)&&e?.dataSource===`master`&&e?.masterName}function KD(e){let t=e?.data??e;return Array.isArray(t)?t:Array.isArray(t?.data)?t.data:Array.isArray(t?.items)?t.items:Array.isArray(t?.rows)?t.rows:Array.isArray(t?.records)?t.records:[]}function qD(e){let t=String(e?.masterName??``).trim().toLowerCase();return t===`clientsubmissions`||t===`clientsubmissionstatus`}function JD(e){if(e==null)return null;if(typeof e==`string`){let t=e.trim();return t?{label:t,value:t,_raw:{name:t}}:null}let t=String(e?.name??e?.clientSubmissionStatusText??e?.label??e?.text??``).trim();if(!t)return null;let n=Number(e?.id??e?.uniqueId??e?.clientSubmissionStatusId??e?.value??0)||0;return{label:t,value:t,_raw:{...e,...n>0?{id:n,uniqueId:n}:{},name:t,type:String(e?.type??e?.clientSubmissionStatusType??``).trim(),isInitialStatus:e?.isInitialStatus===!0,isTerminalStatus:e?.isTerminalStatus===!0,allowedNextStatusIds:Array.isArray(e?.allowedNextStatusIds)?e.allowedNextStatusIds.map(Number).filter(e=>Number.isInteger(e)&&e>0):[]}}}function YD(e,t){return qD(t)?JD(e):fD(e,t)}function XD(e){let t=e?.clientSubmissionStatus,n=Number((t&&typeof t==`object`?t?.clientSubmissionStatusId??t?.id??t?.uniqueId:void 0)??e?.clientSubmissionStatusId??e?.clientStatusId??e?.[`clientSubmissionStatus.clientSubmissionStatusId`]??0)||0,r=t&&typeof t==`object`?t?.clientSubmissionStatusText??t?.name??t?.text??t?.label:t;return{id:n,text:String(r??e?.clientSubmissionStatusText??e?.clientStatus??e?.clientStatusText??e?.[`clientSubmissionStatus.clientSubmissionStatusText`]??``).trim()}}function ZD(e){let t=Number(e?.id??0)||0,n=String(e?.text??``).trim();return n&&n.toLowerCase()===`not submitted`?!0:t<=0&&!n}function QD(e){return Number(e?._raw?.id??e?._raw?.uniqueId??0)||0}function $D(e){let t=e?._raw?.allowedNextStatusIds;return Array.isArray(t)?t.map(Number).filter(e=>Number.isInteger(e)&&e>0):[]}function eO(e){let t=e?.data??e;return t?Array.isArray(t)?t[0]??null:t?.record&&typeof t.record==`object`?t.record:t?.data&&typeof t.data==`object`&&!Array.isArray(t.data)?t.data:typeof t==`object`?t:null:null}function tO(e){return(Array.isArray(e?.selectedRecords)?e.selectedRecords.filter(Boolean):[]).some(e=>!ZD(XD(e)))?!0:!ZD(XD(e??{}))}async function nO(e,n){if(tO(e))return e;let r=e?.selectedIds?.[0]??e?.selectedRecords?.[0]?._id??e?.selectedRecords?.[0]?.id;if(!r)return e;let i=String(e?.moduleName??`submissions`).trim()||`submissions`,a=new URLSearchParams({module:i,id:String(r)});n&&a.set(`app_id`,n);try{let r=eO(await t.o(t.x,`/module-data-detail?${a.toString()}`,{headers:n?{"X-App-Id":n}:void 0}));if(!r)return e;let i=Array.isArray(e?.selectedRecords)?e.selectedRecords:[];return{...e,selectedRecords:i.length?i.map((e,t)=>t===0?{...e,...r}:e):[r]}}catch(t){return console.warn(`[DynamicPopup] Could not load selected submission detail for client status transition:`,t),e}}function rO(e,t){if(!Array.isArray(e)||!e.length)return[];if(!e.some(e=>e?._raw?.isInitialStatus===!0||e?._raw?.isTerminalStatus===!0||Array.isArray(e?._raw?.allowedNextStatusIds)))return e;let n=Array.isArray(t?.selectedRecords)?t.selectedRecords.filter(Boolean):[],r={clientSubmissionStatus:t?.clientSubmissionStatus,clientSubmissionStatusId:t?.clientSubmissionStatusId,clientSubmissionStatusText:t?.clientSubmissionStatusText,clientStatus:t?.clientStatus,clientStatusId:t?.clientStatusId,clientStatusText:t?.clientStatusText,"clientSubmissionStatus.clientSubmissionStatusId":t?.[`clientSubmissionStatus.clientSubmissionStatusId`],"clientSubmissionStatus.clientSubmissionStatusText":t?.[`clientSubmissionStatus.clientSubmissionStatusText`]},i=n.length?n:[r];return e.filter(t=>i.every(n=>{let i=XD(n);if(ZD(i)){let e=XD(r);ZD(e)||(i=e)}if(ZD(i))return t?._raw?.isInitialStatus===!0;let a=e.find(e=>{let t=QD(e),n=String(e?.label??``).trim();return i.id>0&&t===i.id||i.text&&n.toLowerCase()===i.text.toLowerCase()});return!a||a?._raw?.isTerminalStatus===!0?!1:$D(a).includes(QD(t))}))}function iO({open:e,config:n,api:r,fields:i,popupContext:a,formValues:s}){let[c,l]=(0,o.useState)({}),[u,d]=(0,o.useState)(null);return(0,o.useEffect)(()=>{e||(l({}),d(null))},[e]),(0,o.useEffect)(()=>{if(!e||!n||!r.getOptions)return;let t=new AbortController;return i.forEach(e=>{!e.fetchOptionsKey||e.fetchOptionsParamKey||Promise.resolve(r.getOptions(e,void 0,a)).then(n=>{t.signal.aborted||l(t=>({...t,[e.name]:n}))}).catch(n=>{t.signal.aborted||console.error(`[DynamicPopup] Failed to load options for field "${e.name}":`,n)})}),()=>t.abort()},[e,r,n,i,a]),(0,o.useEffect)(()=>{if(!e||!n)return;let r=i.filter(GD);if(!r.length)return;let o=new AbortController;return r.forEach(e=>{let n=new URLSearchParams({masterName:e.masterName,offset:`0`,limit:String(e.limit??50)}),r=String(t.b??``).trim();r&&n.set(`app_id`,r),t.o(t.x,`/masters/dropdown?${n.toString()}`,{headers:r?{"X-App-Id":r}:void 0}).then(async t=>{if(o.signal.aborted)return;let n=KD(t).map(t=>YD(t,e)).filter(Boolean),i=a;if(qD(e)&&(i=await nO(a,r)),o.signal.aborted)return;let s=qD(e)?rO(n,i):n;l(t=>({...t,[e.name]:s}))}).catch(t=>{o.signal.aborted||console.error(`[DynamicPopup] Failed to load master options for field "${e.name}":`,t)})}),()=>o.abort()},[e,n,i,a]),(0,o.useEffect)(()=>{if(!e||!n||!r.getOptions)return;let t=i.filter(e=>e.fetchOptionsKey&&e.fetchOptionsParamKey);if(!t.length)return;let o=new AbortController;return t.forEach(e=>{let t=s[e.fetchOptionsParamKey]??a[e.fetchOptionsParamKey],n={[e.fetchOptionsParamKey]:t};Promise.resolve(r.getOptions(e,n,a)).then(t=>{o.signal.aborted||l(n=>({...n,[e.name]:t}))}).catch(t=>{o.signal.aborted||console.error(`[DynamicPopup] Failed to load param-dependent options for "${e.name}":`,t)})}),()=>o.abort()},[e,r,n,i,s,a]),(0,o.useEffect)(()=>{if(!e||!n||!r.loadExtraData)return;let t=new AbortController;return Promise.resolve(r.loadExtraData(a)).then(e=>{t.signal.aborted||d(e)}).catch(e=>{t.signal.aborted||(console.error(`[DynamicPopup] Failed to load extra data:`,e),d(null))}),()=>t.abort()},[e,r,n,a]),{dynamicOptions:c,setDynamicOptions:l,extraData:u}}var aO=500,oO=3;function sO({api:e,open:t,fields:n=[],popupContext:r,setDynamicOptions:i}){let[a,s]=(0,o.useState)({}),c=(0,o.useRef)({}),l=(0,o.useRef)({}),u=(0,o.useRef)({}),d=(0,o.useCallback)((t,n)=>{let a=e.searchOptions??e.searchFetcher;if(typeof a!=`function`)return;l.current[t.name]?.abort();let o=new AbortController;return l.current[t.name]=o,Promise.resolve(a(t,n,r)).then(e=>{if(o.signal.aborted)return;let n=Array.isArray(e)?e:e?.items??e?.list??[];i(e=>({...e,[t.name]:n.map(e=>fD(e,t))}))}).catch(e=>{o.signal.aborted||console.error(`[DynamicPopup] Search failed for field "${t.name}":`,e)}),o},[e,r,i]),f=n.filter(e=>(e.searchFetchKey||e.searchFetcher)&&e.preloadOptions!==!1),p=f.map(e=>e.name).join(`|`),m=(0,o.useRef)({runSearch:d,preloadFields:f});(0,o.useEffect)(()=>{m.current={runSearch:d,preloadFields:f}}),(0,o.useEffect)(()=>{if(!t||!p)return;let{runSearch:e,preloadFields:n}=m.current,r=n.map(t=>e(t,``)).filter(Boolean);return()=>r.forEach(e=>e.abort())},[t,p]);function h(t){if(!t.searchFetchKey&&!t.searchFetcher||typeof(e.searchOptions??e.searchFetcher)!=`function`)return;let n=t.searchMinLength??oO;return e=>{clearTimeout(c.current[t.name]);let r=e.length<n?``:e;c.current[t.name]=setTimeout(()=>{d(t,r)},aO)}}function g(t){let n=e.getMentionOptions??e.mentionFetcher;if(typeof n==`function`)return e=>{u.current[t.name]?.abort();let i=new AbortController;u.current[t.name]=i,Promise.resolve(n(t,e,r)).then(e=>{if(i.signal.aborted)return;let n=Array.isArray(e)?e:e?.items??e?.list??[];s(e=>({...e,[t.name]:n.map(e=>({value:e.user_name??e.userName??e.username??String(e),label:e.user_name??e.userName??e.username??String(e)}))}))}).catch(e=>{i.signal.aborted||console.error(`[DynamicPopup] Mention search failed for field "${t.name}":`,e)})}}return{mentionOptions:a,getSearchHandler:h,getMentionSearchHandler:g}}function cO({form:e,config:t,api:n,popupContext:r,resolvedIds:i,dynamicOptions:a,extraData:c,removedIds:l,removalOnlySubmit:u=!1,fields:d,onClose:f,onSubmit:p}){let[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(null);async function v(e){let t={resolvedIds:i,dynamicOptions:a,extraData:c,removedIds:l};if(typeof n.submit==`function`)return n.submit(e,r,t);if(typeof p==`function`)return p(e,r,t)}function y(){if(t){if(!d.length){if(t.mode===`delete`&&typeof n.deleteItems==`function`){h(!0),_(null),Promise.resolve(n.deleteItems(i,r)).then(()=>{s.message.success(t.successMessage||`Deleted successfully`),f({success:!0})}).catch(e=>{let t=e?.message||`Delete failed. Please try again.`;_(t),h(!1),s.message.error(t)});return}if(typeof n.onOk==`function`){h(!0),Promise.resolve(n.onOk(r)).then(()=>f({success:!0})).catch(e=>{let t=e?.message||`Failed. Please try again.`;s.message.error(t),h(!1)});return}if(typeof n.submit==`function`){h(!0),Promise.resolve(v({})).then(e=>{e?.navigated||(s.message.success(t.successMessage||`Saved successfully`),f({success:!0}))}).catch(e=>{s.message.error(e?.message||`Failed. Please try again.`)}).finally(()=>h(!1));return}f();return}if(u){h(!0),Promise.resolve(v(e.getFieldsValue())).then(e=>{e?.navigated||(s.message.success(t.successMessage||`Saved successfully`),f({success:!0}))}).catch(e=>{s.message.error(e?.message||`Failed. Please try again.`)}).finally(()=>h(!1));return}e.validateFields().then(async e=>{h(!0);try{if((await v(e))?.navigated)return;s.message.success(t.successMessage||`Saved successfully`),f({success:!0})}catch(e){s.message.error(e?.message||`Failed. Please try again.`)}finally{h(!1)}}).catch(()=>{})}}function b(){h(!1),_(null)}return{handleOk:y,confirming:m,deleteError:g,resetSubmitState:b}}function lO({open:e=!0,config:t,context:n={},onClose:r,onSubmit:i,api:a={}}){let[c]=s.Form.useForm(),[d,f]=(0,o.useState)({}),[p,m]=(0,o.useState)([]),h=s.Form.useWatch([],c,{preserve:!0})??{},g=(0,o.useMemo)(()=>mD(n),[n]),{selectedIds:_=[],selectedRecords:v=[],moduleName:y=``}=g,b=(0,o.useMemo)(()=>_.map((e,t)=>{let n=v[t];return n?.id??n?._id??e}),[_,v]),x=(0,o.useMemo)(()=>t?typeof t.getFields==`function`?t.getFields(g):t.fields??[]:[],[t,g]),S=(0,o.useMemo)(()=>{let e={};return x.forEach(t=>{let n=g[t.initialValueKey];!t.initialValueKey||n===void 0||(e[t.name]=t.type===`date-picker`?(0,u.default)(n):n)}),e},[x,g]),{dynamicOptions:C,setDynamicOptions:w,extraData:T}=iO({open:e,config:t,api:a,fields:x,popupContext:g,formValues:d}),{mentionOptions:E,getSearchHandler:D,getMentionSearchHandler:O}=sO({api:a,open:e,fields:x,popupContext:g,setDynamicOptions:w});function k(e){typeof r==`function`&&r(e)}let A=x.filter(e=>e.required),j=A.every(e=>{let t=h[e.name];return!(t==null||t===``||Array.isArray(t)&&t.length===0||typeof t==`object`&&!Array.isArray(t)&&Object.keys(t).length===0)}),M=(g.removedIds??[]).length,N=p.length>M,P=A.some(e=>{let t=h[e.name];return!(t==null||t===``||Array.isArray(t)&&t.length===0)}),{handleOk:F,confirming:I,deleteError:L,resetSubmitState:R}=cO({form:c,config:t,api:a,popupContext:g,resolvedIds:b,dynamicOptions:C,extraData:T,removedIds:p,removalOnlySubmit:!!t?.allowRemovalOnlySubmit&&N&&!P,fields:x,onClose:k,onSubmit:i});(0,o.useEffect)(()=>{e&&(c.resetFields(),f(S??{}),m(g.removedIds??[]),R())},[e,S]);let z=!!t?.autoSubmitWhenNoFields&&x.length===0;(0,o.useEffect)(()=>{!e||!z||F()},[e,z]);let B=_.length,V=String(y).replace(/s$/i,``),H=B===1?V:y,U=v[0]??{},ee=t?.getTitleText?t.getTitleText(B,H,U,g):t?.title,te=B===1?U.jobTitle??U.title??U.name??U.fullName??U.candidateName??null:null,ne=t?.getBodyText?t.getBodyText(B,V,H,te,g):t?.bodyText??null,re=typeof t?.getNote==`function`?t.getNote(g):t?.note,ie=t?.disabledUntilFilled&&!j&&!N;if(!t||!e||z)return null;let ae=t.component;return ae?(0,l.jsx)(s.Modal,{open:e,title:t.title||t.getTitleText?(0,l.jsx)(rD,{titleText:ee,titleIcon:t.titleIcon}):null,footer:null,width:t.width??760,centered:!0,maskClosable:!1,onCancel:()=>k(),className:`dynamic-popup${t.className?` ${t.className}`:``}`,children:(0,l.jsx)(ae,{context:g,selectedIds:b,selectedRecords:v,moduleName:y,onClose:k})}):(0,l.jsxs)(s.Modal,{open:e,title:(0,l.jsx)(rD,{titleText:ee,titleIcon:t.titleIcon}),okText:t.okText||`OK`,cancelText:t.cancelText??`Cancel`,onOk:F,onCancel:()=>k(),okButtonProps:{danger:t.okButtonDanger,disabled:ie,loading:I},cancelButtonProps:{disabled:I},closable:!I,maskClosable:!1,width:t.width??480,centered:!0,className:`dynamic-popup${t.className?` ${t.className}`:``}`,children:[(0,l.jsx)(iD,{note:re,description:t.description,showSelectedCount:t.showSelectedCount,count:B,itemLabel:H,bodyText:ne,deleteError:L}),(0,l.jsx)(aD,{footerNote:t.footerNote}),(0,l.jsx)(HD,{form:c,fields:x,initialValues:S,dynamicOptions:C,popupContext:g,extraData:T,removedIds:p,setRemovedIds:m,showAlreadyAssigned:t.showAlreadyAssigned,onValuesChange:f,getSearchHandler:D,getMentionSearchHandler:O,mentionOptions:E})]})}var uO={mode:`delete`,getTitleText:(e,t)=>`Delete ${e>0?`${e} `:``}${t}`,titleIcon:`delete`,okText:`Delete`,okButtonDanger:!0,width:420,getBodyText:(e,t,n,r)=>r?`Are you sure you want to delete the ${r} ${t}?`:e>1?`Are you sure you want to delete ${e} selected ${n}?`:`Are you sure you want to delete this ${t}?`,footerNote:`This action cannot be undone.`,fields:[]},dO={deleteItems:async(e,t)=>{await re(t.moduleName,e)}},fO=new Map;async function pO(e){return e?(fO.has(e)||fO.set(e,a.r({module:e}).catch(t=>(fO.delete(e),console.warn(`[in-progress gate] could not read ${e} form groups:`,t),[]))),fO.get(e)):[]}function mO(e=[],t){return e.some(e=>{let r=n.C(e,t);return r&&r.severity!==`allow`})}async function hO({targetModule:e,sourceModule:t,recordId:r,region:i}={}){let o={severity:`allow`,message:``,group:null};if(!e||!t||!r)return o;let s=i??n.zn().region;try{let i=await pO(e);if(!mO(i,s))return o;let c=await a.r({module:t,id:r}),l={};for(let e of c){let t=e?.payloadKey||e?.name;t&&Array.isArray(e?.rows)&&(l[t]=e.rows)}return n.D(i,s,l)}catch(e){return console.warn(`[in-progress gate] check skipped:`,e),o}}var gO=`Already submitted`,_O=`submissions`,vO=`candidates`,yO=864e5,bO=90,xO=`This candidate was created or last updated more than 90 days ago. Only candidates created or updated within the last 90 days can be selected. Please update this candidate first.`,SO=[`createdAt`,`createdDate`,`dateCreated`,`created_on`,`createdOn`],CO=[`updatedAt`,`updatedDate`,`lastUpdatedAt`,`lastUpdatedDate`,`modifiedAt`,`modifiedDate`];function wO(e,t){for(let n of t){let t=e?.[n];if(!t)continue;let r=new Date(t);if(!Number.isNaN(r.getTime()))return r}return null}function TO(e){return wO(e,SO)}function EO(e){return wO(e,CO)}function DO(e){if(!(e instanceof Date)||Number.isNaN(e.getTime()))return null;let t=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();return Math.max(0,Math.floor((t(new Date)-t(e))/yO))}function OO(e){return e===null?``:e<=14?`green`:e<=89?`yellow`:`red`}function kO(e,t=bO){if(!e)return!1;let n=Date.now()-t*yO,r=TO(e),i=EO(e),a=r&&r.getTime()>=n,o=i&&i.getTime()>=n;return!a&&!o}function AO(e){let t=TO(e);if(!t)return{createdAgo:``,createdAgoTone:``};let n=lD(t);return n?{createdAgo:n,createdAgoTone:OO(DO(t))}:{createdAgo:``,createdAgoTone:``}}function jO(e){return{...e,...AO(e),isStaleCandidate:kO(e)}}function MO(e){return String(e?.applicantId??e?._id??e?.id??``)}var NO=null;async function PO(){return NO||=n.Nr(vO).then(e=>e?.strategies?.duplicateCheck?.editRoute??``).catch(()=>``),NO}async function FO(e){let t=MO(e);if(!t)return``;let n=await PO();return n?n.replace(/:(_?id)\b/g,encodeURIComponent(t)):``}async function IO({option:e,popupContext:t,confirm:n}){let r=e?._raw??e??{},i=MO(r);if(i){let e=await hO({targetModule:_O,sourceModule:vO,recordId:i});if(e.severity===`block`)return new Promise(t=>{n({title:`This candidate cannot be submitted`,content:e.message,okText:`Pick someone else`,cancelText:`Close`,onOk:()=>t(!1),onCancel:()=>t(!1)})})}if(!kO(r))return!0;let a=t?.navigate;return!a||!i?!1:new Promise(e=>{n({title:`Candidate update required`,content:xO,okText:`OK`,cancelText:`Cancel`,onOk:async()=>{let t=await FO(r);t&&a(t),e(!1)},onCancel:()=>e(!1)})})}function LO(e,t,n){return{...e,label:`${e.label} - ${gO}`,disabled:!0,title:`${gO}${t?` (submission ${t})`:``}`,alreadySubmitted:!0,existingSubmissionId:t||``,...n?{submittedAt:n}:{}}}var RO={searchOptions:async(e,t,n)=>{if(e.searchFetchKey===`quickSubmitJobList`){let e=n.selectedRecords?.[0]??{},r=e.id??e._id??n.selectedIds?.[0],i,a=!0;try{i=await we({searchQuery:t,candidateId:r})}catch{a=!1;let e=await Rn({searchQuery:t,candidateId:r});i=Array.isArray(e?.data)?e.data:[]}let o=i.map(e=>({label:[e.jobReferenceId??e.clientJobReferenceId,e.jobTitle].filter(Boolean).join(` - `)||String(e._id??``),value:e._id??``,_raw:e}));if(a)return o.map(e=>{if(e._raw?.isSubmitted||e._raw?.alreadySubmitted)return LO(e,e._raw?.jobSubmissionId||``,e._raw?.submittedAt||``);if(e._raw?.disable){let t=String(e._raw?.message??``).trim();return{...e,disabled:!0,label:t?`${e.label} - ${t}`:e.label,title:t}}return e});let s=await Ee({applicantId:r,jobIds:o.map(e=>e.value)}).catch(()=>new Map);return o.map(e=>{let t=s.get(String(e.value));return t?LO(e,t.submissionId,t.submittedAt):e})}if(e.searchFetchKey===`quickSubmitCandidates`){let e=n.selectedRecords?.[0]??{},r=n.jobId??e.jobId??e.id??e._id??n.selectedIds?.[0],i,a=new Map;try{i=await Te({search:t,jobId:r})}catch{let e=await Uo({isFromSubmission:n.isFromSubmission,jobId:r,submissionId:n.submissionId,search:t});i=Array.isArray(e)?e:[],a=await Ee({jobId:r,applicantIds:i.map(MO)}).catch(()=>new Map)}return i.map(e=>jO(e)).map(e=>{let t=a.get(MO(e));if(!(t||e?.isSubmitted===!0||e?.alreadySubmitted===!0))return e;let n=t?.submissionId||e?.jobSubmissionId||``,r=t?.submittedAt||e?.submittedAt||``;return{...e,disabled:!0,optionNote:gO,isSubmitted:!0,alreadySubmitted:!0,existingSubmissionId:n,...r?{submittedAt:r}:{}}})}return[]},submit:async(e,t,n)=>{let{navigate:r,selectedRecords:i=[],selectedIds:a=[],moduleName:o}=t,s=i[0]??{},c,l;t.jobId?(c=t.jobId,l=s.id??s._id??a[0]??``):o===`candidate`?(c=e.jobId??``,l=s.id??s._id??a[0]??``):(c=s.jobId??s.id??s._id??a[0]??``,l=e.candidate??``);let u=n?.dynamicOptions?.candidate?.find(e=>MO(e?._raw)===String(l)),d=n?.dynamicOptions?.jobId?.find(e=>String(e?.value)===String(c)),f=u?._raw?.isSubmitted||u?._raw?.alreadySubmitted||d?.alreadySubmitted||d?._raw?.isSubmitted||d?._raw?.alreadySubmitted;if(!c||!l)throw Error(`Select both a job and a candidate to quick submit.`);if(kO(u?._raw))throw Error(xO);let p=await hO({targetModule:_O,sourceModule:vO,recordId:l});if(p.severity===`block`)throw Error(p.message);let m=f,h=u?._raw?.existingSubmissionId||u?._raw?.jobSubmissionId||d?.existingSubmissionId||d?._raw?.jobSubmissionId||``;try{let e=await Ce({jobId:c,applicantId:l});m||=!!e?.exists,h=e?.submissionId||h}catch(e){throw Error(`Could not verify existing submissions (${e?.message??`request failed`}). Please try again.`,{cause:e})}if(m)throw Error(`This candidate is already submitted for this job${h?` (submission ${h})`:``}.`);let g=new URLSearchParams;l&&g.set(`candidateId`,l);let _=u?.priorSubmissionId||u?._raw?.submissionId||d?.priorSubmissionId||d?._raw?.submissionId||``;_?(g.set(`submissionId`,String(_)),g.set(`isFromSubmission`,`true`)):g.set(`isFromSubmission`,`false`);let v=Bo(Ho({jobId:c,applicantId:l}).catch(()=>[]));return r(`/submission-create/${c}?${g.toString()}`,{state:{relevantSkillsToken:v}}),{navigated:!0}}},zO={title:`Submit`,okText:`Submit`,width:640,disabledUntilFilled:!0,autoSubmitWhenNoFields:!0,getNote:e=>e.moduleName===`candidate`?`Note: Select a job to submit this candidate.`:`Note: Select a candidate to submit for this job`,getFields:e=>e.jobId?[]:e.moduleName===`candidate`?[{name:`jobId`,label:`Job list`,type:`search-select`,required:!0,placeholder:`Search Job ID / job name - or pick a recent job`,searchFetchKey:`quickSubmitJobList`,optionLayout:{id:`{jobReferenceId}`,title:`{jobTitle}`,subtitle:`{clientJobReferenceId}`,meta:[{label:`Created`,key:`createdAt`,type:`date`},{label:`Updated`,key:`updatedAt`,type:`relative`}]}}]:[{name:`candidate`,label:`Candidate`,type:`search-select`,required:!0,placeholder:`Search candidate name / email - or pick a recent candidate`,optionsKey:`candidateOptions`,searchFetchKey:`quickSubmitCandidates`,labelTemplate:`{applicantRefrenceId} - {firstName} {lastName} - {createdAgo}`,valueKey:`applicantId`,optionLayout:{id:`{applicantRefrenceId}`,title:`{firstName} {lastName}`,titleAccent:{key:`createdAgo`,toneKey:`createdAgoTone`,prefix:` - `},subtitle:`{designation} - {email}`,meta:[{label:`Created`,key:`createdAt`,type:`date`},{label:`Updated`,key:`updatedAt`,type:`relative`}]},onSelectGuard:IO}]},BO={title:`Add Notes & Share`,okText:`Save & Share`,width:480,fields:[{name:`notes`,label:`Notes`,type:`mention-textarea`,required:!0,rows:5,maxLength:2e3,placeholder:`Add your notes on the job. Use '@' to mention someone.`,mentionFetchKey:`mentionUsers`}]},VO=e=>e?.data??e;async function HO({relatedId:e,notes:n,title:r,notesFor:i}){return VO(await bn(t.x,`/notes`,{method:`POST`,body:JSON.stringify({relatedId:e,notes:n,title:r,notesFor:i})}))}var UO={getMentionOptions:async(e,t)=>ae(t),submit:async(e,t)=>{let n=Array.isArray(t.selectedIds)?t.selectedIds[0]:t.selectedIds;if(!n)throw Error(`Please select a record before adding a note.`);await HO({relatedId:String(n),notes:e.notes,notesFor:t.moduleName})}},WO={name:`jobId`,label:`Job Title / ID`,type:`search-select`,required:!0,placeholder:`Minimum 3 characters`,searchFetchKey:`tagToJobJobList`,valueKey:`_id`,labelTemplate:`{jobReferenceId} - {jobTitle}`},GO={name:`hiringStage`,label:`Hiring stage`,type:`select`,required:!0,optionsKey:`hiringStageOptions`,defaultOptions:[{label:`Shortlisted`,value:`shortlisted`},{label:`Pipeline`,value:`pipeline`}],initialValueKey:`hiringStage`},KO={title:`Tag to Job`,okText:`Tag`,width:480,disabledUntilFilled:!0,autoSubmitWhenNoFields:!0,getFields:e=>e.jobId&&e.hiringStage?[]:e.jobId?[GO]:[WO,GO]},qO=e=>e?.data??e;function JO(e){return Array.isArray(e)&&e.every(e=>e&&typeof e==`object`&&`Key`in e)?e.reduce((e,{Key:t,Value:n})=>(e[t]=n,e),{}):e}function YO(e){return e?Array.isArray(e.data)?e.data.map(JO):e.stage&&Array.isArray(e.stage.data)?e.stage.data.map(JO):Array.isArray(e)?e.map(JO):[]:[]}async function XO(e=1,n=10){let r=await t.o(t.x,`/workflow/list/all?page=${e}&limit=${n}`),i=qO(r),a=Array.isArray(i)?i:i?.data??[];return{items:a,total:Number(r?.total??i?.total)||a.length,page:e,limit:n}}async function ZO(e,n){let r=qO(await t.o(t.x,`/workflow/${e}/stage/${n}`));return Array.isArray(r)?{data:r}:r}async function QO(e,n){if(!e||!n)return null;try{let r=new URLSearchParams({module:e,limit:`1`,offset:`0`,scope:`allJobs`,filters:JSON.stringify([{field:`_id`,op:`in`,values:[String(n)],operator:`and`}])}),i=qO(await t.o(t.x,`/module-data-list?${r}`));if(Array.isArray(i))return i[0]??null;if(i?.data&&Array.isArray(i.data))return i.data[0]??null;let a=i?.rows??i?.records??i?.items??i?.list;return Array.isArray(a)?a[0]??null:i??null}catch(t){return console.error(`[getModuleRecordById] failed: ${e}/${n}`,t),null}}async function $O(e){return qO(await t.o(t.T,`/source/workflow-instance`,{method:`POST`,body:JSON.stringify(e)}))}var ek={pipeline:`pipeline`,goodfited:`goodfited`,contacted:`contacted`,submitted:`submitted`,shortlisted:`shortlisted`,interviewinprogress:`interviewInprogress`,selected:`selected`};function tk(e,...t){for(let n of t){let t=String(n).split(`.`).reduce((e,t)=>e?.[t],e);if(t!=null&&t!==``)return t}}function nk(e){let t=String(e??``).trim();return t?ek[t.toLowerCase()]??t:``}function rk(e,t){let n=tk(e,`candidateId`,`candidate_id`,`applicantId`,`applicantID`,`applicantReferenceId`,`applicantRefrenceId`,`_id`,`id`)??t;if(!n)return null;let r=(tk(e,`candidateName`,`candidate_name`,`fullName`,`name`)??[tk(e,`firstName`,`first_name`),tk(e,`lastName`,`last_name`)].filter(Boolean).join(` `))||void 0,i={candidateId:String(n),candidateName:r,phone:tk(e,`phone`,`phoneNumber`,`phone_number`,`mobile`,`mobileNumber`,`mobile_number`),source:tk(e,`source`,`sourceType`,`candidateSource`,`profileSource`),submittedAt:tk(e,`submittedAt`,`lastSubmittedAt`,`updatedAt`),remarks:tk(e,`remarks`,`comment`,`comments`,`notes`),assignedRecruiter:tk(e,`assignedRecruiter`,`recruiterName`,`ownerName`,`assignedToName`),screeningStatus:tk(e,`screeningStatus`,`screening.status`,`screeningResult`),screeningScore:tk(e,`screeningScore`,`screening.score`,`score`),assignedDate:tk(e,`assignedDate`,`assignedAt`,`createdAt`)};return Object.fromEntries(Object.entries(i).filter(([,e])=>e!=null&&e!==``))}var ik={searchOptions:async(e,t)=>e.searchFetchKey===`tagToJobJobList`?ie(t):[],submit:async(e,t)=>{let n=e.jobId??t.jobId,r=nk(e.hiringStage??t.hiringStage),i=Array.isArray(t.selectedIds)?t.selectedIds:[],a=Array.isArray(t.selectedRecords)?t.selectedRecords:[],o=Math.max(i.length,a.length,1);for(let e=0;e<o;e+=1){let t=i[e]?String(i[e]):``,o=rk(a[e]??{},t);await $O({jobId:n,module:`jobs`,currentStage:r,...o?{candidateDetails:o}:{}})}await ce({jobId:n,candidateIds:t.selectedIds,hiringStage:r})}},ak={title:`Change Status`,okText:`Apply`,width:420,showSelectedCount:!0,fields:[{name:`status`,label:`New Status`,type:`select`,required:!0,placeholder:`Select a status`,dataSource:`master`,masterName:`clientSubmissions`,labelKey:`name`,valueKey:`name`,initialValueKey:`currentStatus`,defaultOptions:[{label:`Active`,value:`active`},{label:`Inactive`,value:`inactive`},{label:`Pending`,value:`pending`},{label:`Closed`,value:`closed`}]}]};function ok(e,t){let n=String(e??``).trim().toLowerCase();return(Array.isArray(t?.status)?t.status:[]).find(e=>String(e?.value??``).trim().toLowerCase()===n||String(e?.label??``).trim().toLowerCase()===n||String(e?._raw?.name??``).trim().toLowerCase()===n)??null}var sk={submit:async(e,t,n)=>{let r=ok(e.status,n?.dynamicOptions),i=r?._raw??{},a={clientSubmissionStatusText:String(i.name??r?.label??e.status??``).trim(),clientSubmissionStatusId:Number(i.id??i.uniqueId??0)||0,clientSubmissionStatusType:String(i.type??``).trim()};await ne(t.moduleName,t.selectedIds,a)}},ck={getTitleText:e=>`Remove ${e>1?`${e} Candidates`:`Candidate`} from Shortlist`,titleIcon:`delete`,okText:`Remove`,okButtonDanger:!0,width:420,getBodyText:e=>e>1?`Are you sure you want to remove ${e} selected candidates from the shortlist?`:`Are you sure you want to remove this candidate from the shortlist?`,footerNote:`The candidate will be moved back to the pipeline.`,fields:[]},lk={onOk:async e=>{await De({jobId:e.jobId??e.selectedIds[0],candidateIds:e.selectedIds})}},uk={title:`Add to Groups`,description:`Select a group to add the selected candidate(s) to`,okText:`Add to Group`,width:480,disabledUntilFilled:!0,fields:[{name:`groupId`,label:`Group`,type:`select`,required:!0,placeholder:`Select a group`,fetchOptionsKey:`candidateGroups`}]},dk={getOptions:async e=>e.fetchOptionsKey===`candidateGroups`?le():[],submit:async(e,t,{dynamicOptions:n})=>{let r=(n.groupId??[]).find(t=>String(t.value)===String(e.groupId));await ue({candidateIds:t.selectedIds,groupId:e.groupId,groupName:r?.label??``})}},fk=[{title:`Name`,key:`name`,render:(e,t)=>t.name||`${t.first_name??``} ${t.last_name??``}`.trim()||t.user_name||`Assigned user`},{title:`Role`,dataIndex:`role_name`,key:`role`,render:e=>e||`-`},{title:`Reporting`,dataIndex:`reporting_name`,key:`reporting`,render:e=>e||`-`}];function pk({selectedIds:e,onClose:t}){let n=e?.[0],[r,i]=(0,o.useState)(!0),[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)({assignedUsers:[],totalSubmissions:0,message:``}),[p,m]=(0,o.useState)([]);(0,o.useEffect)(()=>{let e=!1;return i(!0),Promise.all([fe(n).catch(t=>(e||s.message.error(t?.message??`Failed to load self-assign details`),{assignedUsers:[],totalSubmissions:0,message:``})),he(n).catch(()=>({recruitersData:[]}))]).then(([t,n])=>{e||(f(t),m(Array.isArray(n?.recruitersData)?n.recruitersData:[]))}).finally(()=>{e||i(!1)}),()=>{e=!0}},[n]);let h=async()=>{u(!0);try{await de({jobIds:[n]}),s.message.success(`Job assigned successfully`),t?.({success:!0})}catch(e){s.message.error(e?.message??`Failed to assign job`)}finally{u(!1)}};if(r)return(0,l.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:48},children:(0,l.jsx)(s.Spin,{size:`large`})});let g=p.map(e=>({user_id:e.recruiterId??e.id??e.user_id,name:e.name??``,role_name:e.role_name??e.roleName??``,reporting_name:e.reporting_name??e.reportingName??``})),_=new Map(g.map(e=>[String(e.user_id??``),e])),v=(d.assignedUsers?.length??0)>0?d.assignedUsers.map(e=>{let t=e.user_id??e.userId??e.recruiterId??e.id,n=_.get(String(t??``))??{};return{...e,user_id:t,name:n.name||e.name||``,role_name:n.role_name||e.role_name||e.roleName||``,reporting_name:n.reporting_name||e.reporting_name||e.reportingName||``}}):g,y=v.length>0;return(0,l.jsxs)(`div`,{className:`self-assign-popup-body`,children:[y?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{style:{fontWeight:700,marginBottom:8},children:`Team Members Allocated`}),(0,l.jsx)(s.Table,{columns:fk,dataSource:v,pagination:!1,rowKey:e=>e.user_id??`${e.first_name}-${e.last_name}`,size:`small`,className:`mb-3 no-header-bg`,scroll:{y:200}}),(0,l.jsxs)(`div`,{className:`warning-card`,style:{display:`flex`,alignItems:`center`,gap:8,marginTop:12},children:[(0,l.jsx)(c.ExclamationCircleFilled,{style:{color:`#faad14`,fontSize:18}}),(0,l.jsx)(`div`,{style:{fontSize:13},children:`These users are already assigned to this job. Do you still want to assign yourself as well?`})]})]}):(0,l.jsx)(`div`,{style:{padding:`8px 0`},children:d.message||`No one is currently assigned to this job. Do you want to assign yourself?`}),(0,l.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,marginTop:24},children:[(0,l.jsx)(s.Button,{size:`small`,onClick:()=>t?.(),disabled:a,children:`No`}),(0,l.jsx)(s.Button,{type:`primary`,size:`small`,onClick:h,loading:a,children:`Yes`})]})]})}pk.propTypes={selectedIds:f.default.array,onClose:f.default.func};var mk={title:`Self Assign`,width:480,className:`self-assign-modal`,component:pk},hk={submit:async()=>{}};function gk(e={}){let t=Array.isArray(e.jobPayDetails)?e.jobPayDetails[e.jobPayDetails.length-1]:e.jobPayDetails??e.clientBudget??{},n=Number(t.clientBudgetEnd),r=Number(t.clientBudgetStart);return Number.isFinite(n)&&n>0?n:Number.isFinite(r)&&r>0?r:null}var _k={getTitleText:(e,t,n)=>{let r=n?.jobTitle||n?.title||``;return r?`Assign - ${r}`:`Assign`},okText:`Assign`,width:520,disabledUntilFilled:!0,showAlreadyAssigned:!0,allowRemovalOnlySubmit:!0,getFields:e=>(gk(e?.selectedRecords?.[0]??{}),[{name:`assignToUserId`,label:`Assign to`,type:`multi-select`,required:!0,placeholder:`Select recruiter(s)`,fetchOptionsKey:`assignToUsers`}])},vk={getOptions:async e=>e.fetchOptionsKey===`assignToUsers`?me():[],loadExtraData:async e=>he(e.selectedIds[0]),submit:async(e,t,{removedIds:n,extraData:r})=>{await K({jobIds:t.selectedIds,userId:e.assignToUserId,removedIds:n,existingRecruiters:r?.recruitersData})}},yk={title:`Add Sticky Notes`,getTitleText:(e,t,n,r)=>r.editingNoteId?`Edit Sticky Notes`:`Add Sticky Notes`,okText:`Save`,width:480,fields:[{name:`heading`,label:`Heading`,type:`input`,required:!0,placeholder:`Enter heading`,initialValueKey:`editingHeading`},{name:`targetDate`,label:`Target Date`,type:`date-picker`,required:!1,initialValueKey:`editingTargetDate`},{name:`comments`,label:`Comments`,type:`mention-textarea`,required:!0,rows:5,placeholder:`Enter your note here... Use '@' to mention someone.`,mentionFetchKey:`mentionUsers`,initialValueKey:`editingComments`}]},bk={getMentionOptions:async(e,t)=>ae(t),submit:async(e,t)=>{let n=e.targetDate?e.targetDate.toISOString():``;t.editingNoteId?await oe(t.editingNoteId,{title:e.heading,targetDate:n,notes:e.comments}):await W({relatedIds:t.selectedIds,module:t.moduleName,title:e.heading,targetDate:n,notes:e.comments}),window.dispatchEvent(new Event(`sticky-notes:refresh`))}},xk={title:`Move to Onboarding`,bodyText:`Are you sure you want to move this candidate to onboarding?`,okText:`Yes`,cancelText:`No`,width:420,successMessage:`Moved to onboarding successfully`,successNavigate:`/onboarding`,fields:[{name:`sendOnboardingEmail`,type:`priority-checkbox`,checkboxLabel:`Send Onboarding Email`}]},Sk={submit:async(e,t)=>{await ve({submissionId:t.selectedRecords?.[0]?.submissionId,isMail:e.sendOnboardingEmail})}};function Ck(e){return Array.isArray(e)?e[e.length-1]??{}:e&&typeof e==`object`?e:{}}var wk={USD:`$`,INR:`₹`,EUR:`€`,GBP:`£`};function Tk(e,t,n){let r=Ck(e?.[t])[n];if(r!=null&&r!==``)return r;let i=e?.[`${t}.${n}`];return i!=null&&i!==``?i:void 0}function Ek(e){let t=e.selectedRecords?.[0]??{},n=Tk(t,`candidateRate`,`candidateAcceptedRate`)??Tk(t,`candidateBudget`,`candidateBudgetStart`);if(n===void 0||Number(n)===0)return null;let r=Tk(t,`candidateRate`,`candidateAcceptedCurrency`)??Tk(t,`candidateBudget`,`candidateBudgetCurrency`);return{amount:n,symbol:Tk(t,`candidateRate`,`candidateAcceptedCurrencySymbol`)??Tk(t,`candidateBudget`,`candidateBudgetCurrencySymbol`)??wk[String(r??``).toUpperCase()]??(r||`$`),unit:Tk(t,`candidateRate`,`candidateAcceptedPayUnit`)??Tk(t,`candidateBudget`,`candidateBudgetUnit`)??``}}var Dk={title:`Approve Rate`,okText:`Approve`,width:520,className:`medium-modal`,successMessage:`Rate approved`,getBodyText:(e,t,n,r,i)=>{let a=Ek(i);return`Candidate Rate: ${a?`${a.symbol}${a.amount}${a.unit?`/${a.unit}`:``}`:`-`}`},fields:[{name:`candidateProposedRate`,label:`Proposed Rate`,type:`number`,required:!0,placeholder:`Amount`,min:0,inlineRow:`proposedRate`,validator:(e,t)=>{if(e==null||e===``)return;let n=Ek(t);if(n&&Number(e)<=Number(n.amount))return`Proposed rate must be greater than Candidate Rate`}},{name:`candidateProposedRateCurrency`,label:`Currency`,type:`select`,required:!0,inlineRow:`proposedRate`,defaultOptions:[{label:`$ USD`,value:`$`},{label:`₹ INR`,value:`₹`},{label:`€ EUR`,value:`€`}]},{name:`candidateProposedRateUnit`,label:`Unit`,type:`select`,required:!0,inlineRow:`proposedRate`,defaultOptions:[{label:`Year`,value:`yr`},{label:`Month`,value:`mo`},{label:`Week`,value:`wk`},{label:`Hour`,value:`hr`},{label:`Daily`,value:`day`}]},{name:`submitVia`,label:`Submit Via`,type:`radio`,required:!0,defaultOptions:[{label:`Mail`,value:`Mail`},{label:`VMS`,value:`VMS`}]}]},Ok={submit:async(e,t)=>{let n=t.selectedIds[0];if(await ye(n,{candidateProposedRate:e.candidateProposedRate,candidateProposedRateCurrency:e.candidateProposedRateCurrency,candidateProposedRateUnit:e.candidateProposedRateUnit,submitVia:e.submitVia}),e.submitVia===`VMS`)try{await be(n)}catch{s.message.warning(`Approved. VMS notification could not be sent — use Send Mail to notify the client.`)}else s.message.info(`Approved — use Send Mail to notify the client.`)}};async function kk(e,n={}){let r=t.u();if(!r){let e=Error(`Authentication required`);throw e.status=401,e}let i=await fetch(`${t.D}${e}`,{...n,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${r}`,...n.headers}});if(i.status===401&&t.h(),!i.ok){let e=Error(`API ${i.status}: ${i.statusText}`);throw e.status=i.status,e}return i.json()}async function Ak(e){let t=await kk(`/mail-form?${new URLSearchParams({submissionId:e,submissionType:`manager`}).toString()}`);return t.data??t}function jk(e){return Array.isArray(e)?e[e.length-1]:e}function Mk(e={}){let t=jk(e?.proposedRate)?.candidateProposedRate??e?.candidateProposedRate??e?.proposedRateValue,n=Number(t);return Number.isFinite(n)?n:0}function Nk(e,t={}){let n=jk((e?.record?.job??e?.job??t?.job??{})?.jobPayDetails)??{},r=e?.record?.submission??t??{},i=jk(r?.clientBudget)??r?.clientBudget??{},a=n?.clientBudgetEnd??n?.clientBudgetStart??i?.clientBudgetEnd??i?.clientBudgetStart,o=Number(a);return Number.isFinite(o)?o:0}function Pk(e={}){let t=String(e?.currencyRaw??``).trim().toUpperCase(),n=String(e?.currency??``).trim();return n&&!/^[A-Z]{3}$/i.test(n)?n:t===`USD`||n.toUpperCase()===`USD`?`$`:t===`INR`||n.toUpperCase()===`INR`?`₹`:t===`EUR`||n.toUpperCase()===`EUR`?`€`:t===`GBP`||n.toUpperCase()===`GBP`?`£`:n||t}function Fk(e={}){return String(e?.rateUnit??`hr`).trim().replace(/^\/+/,``)||`hr`}function Ik(e,t={}){let n=Number(e);return Number.isFinite(n)?`${Pk(t)}${n}/${Fk(t)}`:``}function Lk(e,t,n){if(n==null||n===``)return String(e??``);let r=String(e??``),i=String(n),a=!1,o=RegExp(`(<(?:td|th)[^>]*>[\\s\\S]*?${t}[\\s\\S]*?</(?:td|th)>\\s*<(?:td|th)[^>]*>)([\\s\\S]*?)(</(?:td|th)>)`,`gi`);r=r.replace(o,(e,t,n,r)=>(a=!0,`${t}${i}${r}`));let s=RegExp(`(<(?:strong|b)[^>]*>\\s*${t}\\s*:?\\s*</(?:strong|b)>\\s*)([\\s\\S]*?)(?=</(?:li|p|div)>)`,`gi`);if(r=r.replace(s,(e,t)=>(a=!0,`${t}${i}`)),!a){let e=RegExp(`(${t}\\s*:?[ \\t]*)([^<\\r\\n]*)`,`gi`);r=r.replace(e,(e,t)=>`${t}${i}`)}return r}function Rk(e,t,n,r,i){let a=Number(n?.proposedRate),o=Number.isFinite(a)?a:Mk(t),s=Number(n?.clientJobRate),c=Number.isFinite(s)&&s>0?s:Nk(r,i),l={proposedRate:o,jobBillRate:c},u=String(e??``).replace(/{{\.?((?:proposedRate)|(?:jobBillRate))}}/g,(e,t)=>{let n=l[t];return n==null?e:String(n)});return u=Lk(u,`(?:Proposed\\s*Rate|Pay\\s*Rate)`,Ik(o,n)),u=Lk(u,`(?:Job\\s*)?Bill\\s*Rate`,Ik(c,n)),u}function zk(...e){return e.map(e=>e==null?``:String(e).trim()).find(Boolean)??``}var Bk=(e,t)=>!!e&&e.toLowerCase()===zk(t).toLowerCase();function Vk(e,t,n){let r=zk(t.submittedBy);return zk(Bk(r,n)||Bk(r,e.submitSource)||Bk(r,e.supplierName)||Bk(r,e.source)||Bk(r,e.candidateSource)?``:r,e.signatureEmail)}function Hk(e,t={}){let n=t.employerName??e.supplierName??e.submitSource;return{client:t.clientName??e.clientName,role:t.jobTitle??e.jobTitle??e.designation,reqId:t.reqId??e.jobClientRefrenceId??e.mspReqId??e.submissionId,name:t.candidateName||[e.firstName,e.lastName].filter(Boolean).join(` `)||e.candidateFullName,location:t.jobLocation??e.city??e.currentLocation??e.jobLocation,vendor:n,submittedBy:Vk(e,t,n),submittedAt:t.createdAt??e.createdAt,email:t.email??e.email,employerLocation:t.employerLocation,employerName:t.employerName}}function Uk(e){let t=e?.$oid??e?._id?.$oid??e?._id??e?.id?.$oid??e?.id??e;if(t==null||typeof t==`object`)return``;let n=String(t).trim();return/^[a-f\d]{24}$/i.test(n)?n:``}function Wk(...e){for(let t of e){let e=[t?.jobId,t?.JobId,t?.job_id,t?.jobDetails?._id,t?.jobDetails?.id,t?.job?._id,t?.job?.id,t?.submission?.jobId,t?.submission?.JobId,t?.submission?.job_id,t?.submission?.jobDetails?._id,t?.submission?.jobDetails?.id,t?.submission?.job?._id,t?.submission?.job?.id,t?.recordMeta?.jobId,t?.recordMeta?.JobId,t?.recordMeta?.job_id,t?.submission?.recordMeta?.jobId,t?.submission?.recordMeta?.JobId,t?.submission?.recordMeta?.job_id].map(Uk).find(Boolean);if(e)return e}return``}function Gk(e){if(!e?.referralId)return{};let t=Number(e.referralRate??e.referalRate??0)||0,n=String(e.referralType??e.referalType??`RECURRING`).trim()||`RECURRING`,r=e.referralId??e.referalId;return{referralId:r,referalId:r,referralRate:t,referalRate:t,referralType:n,referalType:n,referralEnabled:!0,referalEnabled:!0,isReferralApplicable:!0,referralDetails:{referralId:r,referalId:r,referralRate:t,referalRate:t,referralType:n,referalType:n,referralEnabled:!0,referalEnabled:!0,isReferralApplicable:!0}}}function Kk(e=``){return String(e??``).replace(/map\[[^\]]*(?:resume|document|attachment|file)[^\]]*\]/gi,``).replace(/<p>\s*<\/p>/gi,``).replace(/(?:<br\s*\/?>\s*){3,}/gi,`<br><br>`).trim()}function qk(...e){for(let t of e){let e=[t?.candidateId,t?.applicantId,t?.candidate?._id,t?.candidate?.id,t?.submission?.candidateId,t?.submission?.applicantId,t?.recordMeta?.candidateId,t?.recordMeta?.applicantId].map(Uk).find(Boolean);if(e)return e}return``}async function Jk(e){let t=e?.fileUrl??e?.downloadUrl??e?.url;if(!t)return null;let n=await fetch(t);if(!n.ok)throw Error(`Unable to load ${e?.fileName||`resume`}`);let r=await n.blob(),i=e?.fileName??e?.uploadedFileName??e?.originalName??e?.uniqueName??`resume`;return new File([r],i,{type:e?.contentType||r.type||`application/octet-stream`})}async function Yk(e,r,i){let a=[],o=await n.gn(`submissions`,e,`resume`).catch(()=>({data:[]}));a.push(...o?.data??[]);let s=qk(r?.record?.submission,i,r?.record);if(!s){let n=await t.o(t.x,`/module/list?module=submissions&id=${encodeURIComponent(e)}`).catch(()=>({})),r=n?.data??n??{};s=qk((Array.isArray(r?.data)?r.data:Array.isArray(r)?r:[])[0])}if(s){let e=await n.gn(`candidates`,s,`resume`).catch(()=>({data:[]}));a.push(...e?.data??[])}let c=(await Promise.all(a.map(Jk))).filter(Boolean),l=new Set;return c.filter(e=>{let t=`${e.name}:${e.size}:${e.type}`;return!l.has(t)&&(l.add(t),!0)})}function Xk(e={}){return{to:(e.to??e.To??[]).map(e=>e.email??e.Email??e).filter(Boolean).join(`, `),cc:(e.cc??e.Cc??[]).map(e=>e.email??e.Email??e).filter(Boolean).join(`, `),bcc:(e.bcc??e.Bcc??[]).map(e=>e.email??e.Email??e).filter(Boolean).join(`, `),subject:e.subject??e.Subject??``,contents:Kk(e.content?.value??e.Content?.Value??e.contents??e.body??``)}}function Zk({context:e,selectedIds:t,selectedRecords:n,moduleName:r,onClose:i}){let a=n?.[0]??{},c=t?.[0]??y_(a),[u,d]=(0,o.useState)(null),[f,p]=(0,o.useState)(!0),[m,h]=(0,o.useState)([]),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)(`vms`),[b,x]=(0,o.useState)(null),[S,C]=(0,o.useState)(null),[w,T]=(0,o.useState)(!1),[E,D]=(0,o.useState)(!1),[O,k]=(0,o.useState)(!1),[A,j]=(0,o.useState)(!1),[M,N]=(0,o.useState)({to:``,cc:``,bcc:``,subject:``,contents:``,attachments:[],showCc:!1,showBcc:!1});(0,o.useEffect)(()=>{let e=!1;return ov(c,a).then(t=>{e||d(t)}).catch(t=>{e||(s.message.error(t?.message??`Unable to load finance details`),d({record:{submission:a},lookups:{},display:{}}))}).finally(()=>{e||p(!1)}),()=>{e=!0}},[c]),(0,o.useEffect)(()=>{let e=!1;return hv().then(t=>{e||h(t)}).catch(()=>{}),()=>{e=!0}},[]);let P=async()=>{if(b){if(v===`mail`){_(!1),D(!0),k(!0);try{let[e,t]=await Promise.all([Ak(c).then(Xk),Yk(c,u,a).catch(e=>(console.warn(`Unable to resolve resume attachment:`,e),[]))]),n=u?.record?.submission??a;N({to:Rk(e.to,n,b,u,a),cc:Rk(e.cc,n,b,u,a),bcc:Rk(e.bcc,n,b,u,a),subject:Rk(e.subject,n,b,u,a),contents:Rk(e.contents,n,b,u,a),attachments:t,showCc:!!e.cc,showBcc:!!e.bcc})}catch(e){s.message.error(e?.message??`Unable to prepare approval mail`)}finally{k(!1)}return}T(!0);try{await ye(c,{candidateProposedRate:b.proposedRate,candidateProposedRateCurrency:b.currencyRaw??b.currency,candidateProposedRateUnit:b.rateUnit,submitVia:`VMS`,...Gk(S)}),s.message.success(`Submission approved`),_(!1),x(null),C(null),i?.({success:!0})}catch(e){s.message.error(e?.message??`Unable to approve submission`)}finally{T(!1)}}},F=!O&&GT(M.to).length>0&&KT(M.to)&&KT(M.cc)&&KT(M.bcc)&&M.subject.trim()&&M.contents.trim(),I=async()=>{if(!b||!F||A)return;j(!0);let e={candidateProposedRate:b.proposedRate,candidateProposedRateCurrency:b.currencyRaw??b.currency,candidateProposedRateUnit:b.rateUnit};try{await ye(c,{...e,submitVia:`VMS`,...Gk(S)});let t=Wk(u?.record,a);if(!t)s.message.warning(`Submission approved, but job details were not available to send mail`);else try{await mn({jobId:t,toMail:GT(M.to),ccMail:GT(M.cc),bccMail:GT(M.bcc),subject:M.subject,contents:M.contents,attachments:M.attachments??[]}),s.message.success(`Approval mail sent and submission approved`)}catch(e){s.message.warning(e?.message?`Submission approved, but mail was not sent: ${e.message}`:`Submission approved, but mail was not sent`)}D(!1),x(null),C(null),i?.({success:!0})}catch(e){s.message.error(e?.message??`Unable to send approval mail`)}finally{j(!1)}},L=(0,o.useMemo)(()=>({submissionApprove:async({computed:e,referral:t})=>{x(e),C(t??null),y(`vms`),_(!0)},submissionReject:async()=>{e?.navigate?.(`/popup/reject`,{replace:!0,state:{background:e?.background??null,selectedIds:t,selectedRecords:n,moduleName:r}})}}),[e,t,n,r]);return f||!u?(0,l.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:48},children:(0,l.jsx)(s.Spin,{size:`large`})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Y_,{type:qg,record:u.record,lookups:u.lookups,identity:Hk(a,u.display),referralOptions:m,currentUserId:typeof localStorage<`u`?localStorage.getItem(`userId`)??void 0:void 0,actions:L,onClose:()=>i?.(),variant:`popup`}),(0,l.jsx)(s.Modal,{title:`Choose approval method`,open:g,okText:`Approve`,confirmLoading:w,onOk:P,onCancel:()=>{w||(_(!1),x(null),C(null))},children:(0,l.jsxs)(s.Radio.Group,{value:v,onChange:e=>y(e.target.value),style:{display:`grid`,gap:12},children:[(0,l.jsx)(s.Radio,{value:`vms`,children:`Via VMS`}),(0,l.jsx)(s.Radio,{value:`mail`,children:`Via Mail`})]})}),(0,l.jsx)(s.Drawer,{open:E,placement:`right`,onClose:()=>{A||D(!1)},closable:!1,rootClassName:`mail-popup`,width:620,maskClosable:!1,footer:(0,l.jsxs)(`div`,{className:`mail-popup__footer`,children:[(0,l.jsx)(s.Button,{onClick:()=>D(!1),disabled:A,children:`Cancel`}),(0,l.jsx)(s.Button,{type:`primary`,loading:A,disabled:!F,onClick:I,children:`Send`})]}),children:O?(0,l.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:48},children:(0,l.jsx)(s.Spin,{size:`large`})}):(0,l.jsx)(iE,{value:M,onChange:N,moduleName:`submissions`,ready:!O,title:`Submit Via Mail`,contextRecords:[u.record?.submission??a]})})]})}Zk.propTypes={context:f.default.object,selectedIds:f.default.array,selectedRecords:f.default.array,moduleName:f.default.string,onClose:f.default.func};var Qk={title:`Manager Approve`,width:780,className:`fa-modal manager-approve-modal`,component:Zk},$k={submit:async()=>{}};function eA(...e){return e.map(e=>e==null?``:String(e).trim()).find(Boolean)??``}var tA=(e,t)=>!!e&&e.toLowerCase()===eA(t).toLowerCase();function nA(e,t,n){let r=eA(t.submittedBy);return eA(tA(r,n)||tA(r,e.submitSource)||tA(r,e.supplierName)||tA(r,e.source)||tA(r,e.candidateSource)?``:r,e.signatureEmail)}function rA(e,t={}){let n=t.employerName??e.supplierName??e.submitSource;return{client:t.clientName??e.clientName,role:t.jobTitle??e.jobTitle??e.designation,reqId:t.reqId??e.jobClientRefrenceId??e.mspReqId??e.submissionId,name:t.candidateName||[e.firstName,e.lastName].filter(Boolean).join(` `)||e.candidateFullName,location:t.jobLocation??e.city??e.currentLocation??e.jobLocation,vendor:n,submittedBy:nA(e,t,n),submittedAt:t.createdAt??e.createdAt,email:t.email??e.email,employerLocation:t.employerLocation,employerName:t.employerName}}function iA(e){let t=Array.isArray(e)?e:[];for(let e=t.length-1;e>=0;--e)if(String(t[e]?.activityType??``).trim().toLowerCase()===`cfo rejected`)return t[e];return null}function aA(e){return String(e??``).toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}function oA({selectedIds:e,selectedRecords:t,onClose:r}){let i=t?.[0]??{},a=e?.[0]??y_(i),[c,u]=(0,o.useState)(null),[d,f]=(0,o.useState)(``),[p,m]=(0,o.useState)(!0);(0,o.useEffect)(()=>{let e=!1;return m(!0),Promise.all([ov(a,i),n.un(`submission`,a).catch(()=>[])]).then(([t,n])=>{if(e)return;let r=iA(n);f(y_(t?.meta?.workforceEngagementId??i?.onboarding?.workforceEngagementId??i?.workforceEngagementId));let a=t?.meta?.rejectReasonComments||r?.activityComments||``;u({...t,record:{...t.record,submission:{...t.record.submission,cfoRejectionReason:a?aA(a):``,cfoRejectedAt:t?.meta?.rejectedAt??r?.activityTime??null}}})}).catch(t=>{e||(s.message.error(t?.message??`Unable to load finance details`),u({record:{submission:i},lookups:{},display:{}}))}).finally(()=>{e||m(!1)}),()=>{e=!0}},[a]);let h=(0,o.useMemo)(()=>({submissionReapproveSend:async({computed:e})=>{await xe(d,{submissionId:a,billRate:e.proposedRate,payRate:e.employerRate,currency:e.currencyRaw??e.currency,rateUnit:e.rateUnit,vmsPercent:e.clientVmsPercent}),await ye(a,{candidateProposedRate:e.proposedRate,candidateProposedRateCurrency:e.currencyRaw??e.currency,candidateProposedRateUnit:e.rateUnit,submitVia:`Mail`,context:`resend`}),s.message.success(`Re-approved and sent for CFO approval`),r?.({success:!0})}}),[a,d,r]);return p||!c?(0,l.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:48},children:(0,l.jsx)(s.Spin,{size:`large`})}):(0,l.jsx)(Y_,{type:Zg,record:c.record,lookups:c.lookups,identity:rA(i,c.display),currentUserId:typeof localStorage<`u`?localStorage.getItem(`userId`)??void 0:void 0,actions:h,onClose:()=>r?.(),variant:`popup`})}oA.propTypes={selectedIds:f.default.array,selectedRecords:f.default.array,onClose:f.default.func};var sA={title:`Re-Approve`,width:780,className:`fa-modal manager-approve-modal`,component:oA},cA={submit:async()=>{}},lA=[{id:1,name:`Re-Submission`},{id:2,name:`Candidate doesn't fit into the profile`},{id:3,name:`Incomplete candidate details - (Re-Submission)`}],uA={title:`Reject`,okText:`Reject`,okButtonDanger:!0,width:480,successMessage:`Submission rejected successfully`,fields:[{name:`rejectReason`,label:`Rejection Reasons`,type:`select`,required:!0,placeholder:`Select rejection reasons`,defaultOptions:lA.map(e=>({label:e.name,value:e.id}))},{name:`rejectReasonComments`,label:`Comments`,type:`textarea`,required:!0,rows:4}]},dA={submit:async(e,t)=>{let n=lA.find(t=>String(t.id)===String(e.rejectReason));await Se({submissionId:t.selectedIds[0],rejectReasonId:e.rejectReason,rejectReason:n?.name??``,rejectReasonComments:e.rejectReasonComments})}},fA={delete:uO,"quick-submit":zO,"add-notes":BO,"tag-to-job":KO,"change-status":ak,"remove-from-shortlist":ck,"add-to-groups":uk,"self-assign":mk,"others-assign":_k,"sticky-notes":yk,"move-to-onboarding":xk,"approve-rate":Dk,"manager-approve":Qk,"manager-reapprove":sA,reject:uA},pA={delete:dO,"quick-submit":RO,"add-notes":UO,"tag-to-job":ik,"change-status":sk,"remove-from-shortlist":lk,"add-to-groups":dk,"self-assign":hk,"others-assign":vk,"sticky-notes":bk,"move-to-onboarding":Sk,"approve-rate":Ok,"manager-approve":$k,"manager-reapprove":cA,reject:dA};function mA(e){let t=e?.data??e;return Array.isArray(t)?t:t?.data??t?.rows??t?.records??t?.items??t?.list??[]}function hA(e,...t){for(let n of t){let t=String(n).split(`.`).reduce((e,t)=>e?.[t],e);if(t!=null&&t!==``)return t}return``}function gA(e){let t=String(hA(e,`isDeleted`,`deleted`)).toLowerCase(),n=String(hA(e,`assignmentStatus`,`status`)).toLowerCase();return t!==`true`&&t!==`1`&&![`removed`,`inactive`,`deleted`].includes(n)}function _A(e){let t=hA(e,`candidateName`,`candidate_name`,`fullName`,`name`);return t?String(t):[hA(e,`firstName`,`first_name`),hA(e,`lastName`,`last_name`)].filter(Boolean).join(` `)||`Unnamed candidate`}function vA(e){return String(hA(e,`candidateId`,`candidate_id`,`candidate._id`,`candidate.id`))}function yA(e){return String(hA(e,`workforceEngagementId`,`engagementId`,`_id`,`id`))}function bA(e){return String(hA(e,`batchName`,`name`,`title`,`batch_name`))}function xA({open:e=!0,context:r={},onClose:i}){let[a,c]=(0,o.useState)([]),[u,d]=(0,o.useState)([]),[f,p]=(0,o.useState)(``),[m,h]=(0,o.useState)(!0),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)(``),[b,x]=(0,o.useState)(new Map),S=String(r.selectedIds?.[0]??r.selectedRecords?.[0]?._id??r.selectedRecords?.[0]?.id??r.batchId??``);(0,o.useEffect)(()=>{if(!e)return;let t=!1;return Promise.resolve().then(()=>(t||h(!0),Promise.all([n.yn(`onboarding`,200,0),n.yn(`batchCandidates`,1e3,0).catch(()=>[])]))).then(([e,n])=>{t||(c(mA(e)),x(new Map(mA(n).filter(gA).map(e=>[String(hA(e,`candidateId`,`candidate_id`)),e]).filter(([e])=>e))))}).catch(e=>{t||y(e.message||`Unable to load onboarding candidates`)}).finally(()=>{t||h(!1)}),()=>{t=!0}},[e]);let C=(0,o.useMemo)(()=>{let e=f.trim().toLowerCase();return e?a.filter(t=>[_A(t),hA(t,`email`,`candidateEmail`,`candidate_email`),hA(t,`status`,`onboardingStatus`,`onboarding_status`)].some(t=>String(t).toLowerCase().includes(e))):a},[a,f]);async function w(){if(!S){y(`Select a batch before adding candidates`);return}let e=a.filter(e=>u.includes(yA(e)));if(!e.length)return;let o=e.map(e=>({record:e,assignment:b.get(vA(e))})).filter(e=>e.assignment);if(o.length){let e=o.map(({record:e})=>_A(e)).join(`, `);y(`${e} ${o.length===1?`is`:`are`} already added to a batch. Each candidate can be added to only one batch.`);return}_(!0),y(``);try{let{userId:a}=t.s(),o=bA(r.selectedRecords?.[0])||bA(r);await Promise.all(e.map(e=>n.Xn(`batchCandidates`,{schemaVersion:1,batchId:S,batchName:o,candidateId:vA(e),workforceEngagementId:yA(e),source:`ONBOARDING`,assignmentStatus:`ASSIGNED`,assignedAt:new Date().toISOString(),assignedBy:a??0,isDeleted:!1}))),s.message.success(`${e.length} candidate${e.length===1?``:`s`} added to the batch`),i?.({refresh:!0})}catch(e){y(e.message||`Unable to add candidates to the batch`)}finally{_(!1)}}return(0,l.jsxs)(s.Modal,{open:e,title:`Add Candidate to Batch`,okText:`Add`,onOk:w,onCancel:()=>i?.(),okButtonProps:{disabled:u.length===0||!S,loading:g},cancelButtonProps:{disabled:g},closable:!g,maskClosable:!1,width:760,centered:!0,children:[v&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:v,style:{marginBottom:12}}),(0,l.jsx)(s.Input.Search,{allowClear:!0,placeholder:`Search onboarding candidates`,value:f,onChange:e=>p(e.target.value),style:{marginBottom:12}}),(0,l.jsx)(s.Table,{rowKey:e=>yA(e),columns:[{title:`Candidate`,key:`candidate`,render:(e,t)=>_A(t)},{title:`Email`,key:`email`,render:(e,t)=>hA(t,`email`,`candidateEmail`,`candidate_email`)||`—`},{title:`Onboarding status`,key:`status`,render:(e,t)=>hA(t,`status`,`onboardingStatus`,`onboarding_status`)||`—`}],dataSource:C,loading:m,size:`small`,pagination:{pageSize:10,showSizeChanger:!1},rowSelection:{selectedRowKeys:u,onChange:d,getCheckboxProps:e=>{let t=b.get(vA(e));return{disabled:!vA(e)||!yA(e)||!!t,title:t?`Candidate is already added to a batch`:void 0}}},locale:{emptyText:m?`Loading candidates…`:`No onboarding candidates found`}})]})}var SA={text:`input`,string:`input`,textarea:`textarea`,date:`date-picker`,datepicker:`date-picker`,multiselect:`multi-select`,lookup:`search-select`};function CA(e){if(!e)return null;let t=[...e.groups??[]].sort((e,t)=>Number(e.order??0)-Number(t.order??0)).flatMap(e=>[...e.fields??[]].filter(e=>e.show!==0&&e.show!==!1).sort((e,t)=>Number(e.order??0)-Number(t.order??0)).map(e=>({...e,name:e.name??e.field,label:e.label??e.field,type:SA[String(e.type??`text`).toLowerCase()]??e.type??`input`,required:e.required??e.req===1,options:(e.options??[]).map(e=>({label:e.label??e.name??e.value,value:e.value??e.id??e.label}))}))),n=wA(e.successNavigate);return{title:e.label,fields:t,...n?{successNavigate:n}:{}}}function wA(e){let t=String(e??``).trim();return!t||!t.startsWith(`/`)||t.startsWith(`//`)||/^[a-z][a-z0-9+.-]*:/i.test(t)?null:t}function TA(e,t=[]){if(!e||!Array.isArray(t)||!t.length)return e;let n=new Map(t.filter(e=>e?.name).map(e=>[String(e.name),e]));return n.size?{...e,fields:(e.fields??[]).map(r=>{let i=n.get(String(r.name))??n.get(String(r.label))??(n.size===1&&(e.fields??[]).length===1?t[0]:null);if(!i)return r;let{name:a,...o}=i;return{...r,...o}})}:e}function EA({apiMap:e={},extraConfigs:r={}}){let i=(0,o.useMemo)(()=>({...pA,...e}),[e]),a=(0,o.useMemo)(()=>{let e={...fA};return Object.entries(r).forEach(([t,n])=>{e[t]={...e[t]??{},...n}}),e},[r]),{popupKey:s}=(0,d.useParams)(),c=(0,d.useNavigate)(),{state:u={}}=(0,d.useLocation)(),[f,p]=(0,o.useState)({key:``,config:null});(0,o.useEffect)(()=>{let e=!1;if(!s||!u.moduleName)return;let t=`${u.moduleName}:${s}`;return n.xr(u.moduleName,`popup`,s).then(n=>{e||p({key:t,config:CA(n[0])})}).catch(()=>{e||p({key:t,config:null})}),()=>{e=!0}},[s,u.moduleName]);let m=(0,o.useMemo)(()=>{let e=a[s],t=`${u.moduleName}:${s}`,n=f.key===t?f.config:null;return TA(n?{...e,...n}:e,u.popupAction?.popupFieldOverrides)},[f,a,s,u.moduleName,u.popupAction?.popupFieldOverrides]),h=(0,o.useMemo)(()=>({selectedIds:u.selectedIds??[],selectedRecords:u.selectedRecords??[],moduleName:u.moduleName??``,navigate:c,background:u.background??null,...u.popupContext??{}}),[c,u.selectedIds,u.selectedRecords,u.moduleName,u.popupContext,u.background]),g=(0,o.useMemo)(()=>{let e=u.popupAction;return e?.apiPath?{submit:(n,r)=>{let i=String(e.apiMethod||`POST`).toUpperCase();return t.o(t.x,e.apiPath.startsWith(`/`)?e.apiPath:`/${e.apiPath}`,{method:i,body:[`GET`,`DELETE`].includes(i)?void 0:JSON.stringify({...n,selectedIds:r.selectedIds,selectedRecords:r.selectedRecords,moduleName:r.moduleName})})}}:{}},[u.popupAction]),_=e=>{let t=u.background;if(e?.success&&m?.successNavigate){c(m.successNavigate,{replace:!0,state:{refreshTimestamp:Date.now()}});return}if(e?.success&&t?.pathname){c(`${t.pathname}${t.search??``}`,{replace:!0,state:{...t.state??{},refreshTimestamp:Date.now()}});return}c(-1)};return s===`add-batch-candidate`?(0,l.jsx)(xA,{open:!0,context:h,onClose:_}):(0,l.jsx)(lO,{open:!0,config:m,context:h,onClose:_,api:{...i[s]??{},...g}})}var DA={title:`Vendor Share`,maxVendorSelect:1e3,defaultTab:`myVendor`,defaultPageSize:10,vendorTabs:[{key:`myVendor`,label:`My Vendors`},{key:`allVendor`,label:`All Vendors`}],vendorColumns:[{title:`Vendor Name`,dataIndex:`vendorName`,key:`vendorName`},{title:`Email`,dataIndex:`vendorEmail`,key:`vendorEmail`},{title:`Location`,dataIndex:`vendorLocation`,key:`vendorLocation`},{title:`Updated On`,dataIndex:`updatedOn`,key:`updatedOn`}]},OA={getVendorList:({jobId:e,limit:t,offset:n,type:r})=>dn({jobId:e,limit:t,offset:n,sortBy:`new`,type:r}),getMailDetails:e=>fn(e),submit:({jobId:e,toMail:t,ccMail:n,bccMail:r,subject:i,contents:a})=>mn({jobId:e,toMail:t,ccMail:n,bccMail:r,subject:i,contents:a})},kA=DA.vendorColumns.map(e=>({...e,render:e=>e||`-`}));function AA(){let e=(0,d.useNavigate)(),t=(0,d.useLocation)(),{selectedIds:n=[],selectedRecords:r=[],recipients:i=[],subject:a=``,onSend:u,moduleName:f=``,popupAction:p={}}=t.state??{},m=n[0]??r[0]?._id??r[0]?.id,[h,g]=(0,o.useState)({to:i.join(`, `),cc:``,bcc:``,subject:a,contents:``,showCc:!1,showBcc:!1}),[_,v]=(0,o.useState)(!m),[y,b]=(0,o.useState)(DA.defaultTab),[x,S]=(0,o.useState)(``),[C,w]=(0,o.useState)([]),[T,E]=(0,o.useState)(0),[D,O]=(0,o.useState)(0),[k,A]=(0,o.useState)(0),[j,M]=(0,o.useState)(1),[N,P]=(0,o.useState)(DA.defaultPageSize),[F,I]=(0,o.useState)(!1),[L,R]=(0,o.useState)([]);(0,o.useEffect)(()=>{if(!m)return;let e=!1;I(!0);let t=x?100:N,n=x?0:(j-1)*N;return OA.getVendorList({jobId:m,limit:t,offset:n,type:y}).then(t=>{if(e)return;let n=t?.data?.vendorList??t?.data??[],r=t?.data?.myVendorCount??0,i=t?.data?.allVendorCount??0;w(Array.isArray(n)?n:[]),E(r),O(i),A(y===`myVendor`?r:i)}).catch(()=>{e||(w([]),A(0))}).finally(()=>{e||I(!1)}),()=>{e=!0}},[m,y,j,N,x]),(0,o.useEffect)(()=>{m&&OA.getMailDetails(m).then(e=>g(t=>({...t,subject:e.subject||t.subject,contents:e.contents||t.contents,to:e.toMail?.length?Array.isArray(e.toMail)?e.toMail.join(`, `):String(e.toMail):t.to,cc:e.ccMail?.length?Array.isArray(e.ccMail)?e.ccMail.join(`, `):String(e.ccMail):t.cc}))).catch(()=>{}).finally(()=>v(!0))},[m]);let z=(0,o.useMemo)(()=>L.map(e=>C.find(t=>t.vendorId===e)?.vendorEmail??``).filter(Boolean),[L,C]),B=(0,o.useMemo)(()=>({...h,bcc:[...new Set([...GT(h.bcc),...z])].join(`, `),showBcc:h.showBcc||z.length>0}),[h,z]);function V(e){let t=new Set(z);g({...e,bcc:GT(e.bcc).filter(e=>!t.has(e)).join(`, `)})}let H=(GT(B.to).length||GT(B.bcc).length)&&KT(B.to)&&KT(B.cc)&&KT(B.bcc)&&B.subject.trim(),U=e=>e===`myVendor`?T:D;function ee(){e(-1)}function te(){H&&OA.submit({jobId:m,toMail:GT(B.to),ccMail:GT(B.cc),bccMail:GT(B.bcc),subject:B.subject,contents:B.contents}).then(t=>{t?.status===!0?(s.message.success(t?.data||`Mail sent successfully.`),typeof u==`function`&&u({...B,message:B.contents,selectedIds:n}),e(-1)):s.message.error(t?.message||t?.data||`Failed to send mail. Please try again.`)}).catch(e=>{s.message.error(e?.message||`Failed to send mail. Please try again.`)})}let ne=(0,o.useMemo)(()=>{if(!x)return C;let e=x.toLowerCase();return C.filter(t=>(t.vendorName??``).toLowerCase().includes(e)||(t.vendorEmail??``).toLowerCase().includes(e)||(t.vendorLocation??``).toLowerCase().includes(e))},[C,x]);return(0,l.jsx)(s.Drawer,{open:!0,placement:`right`,onClose:ee,closable:!1,rootClassName:`vendor-share`,width:`95%`,footer:(0,l.jsxs)(`div`,{className:`vendor-share__footer`,children:[(0,l.jsx)(s.Button,{onClick:ee,children:`Cancel`}),(0,l.jsx)(s.Button,{type:`primary`,disabled:!H,onClick:te,children:`Send`})]}),children:(0,l.jsxs)(`div`,{className:`vendor-share__body`,children:[(0,l.jsxs)(`div`,{className:`vendor-share__left`,children:[(0,l.jsxs)(`div`,{className:`vendor-share__vendor-header`,children:[(0,l.jsxs)(`div`,{className:`vendor-share__vendor-header-row`,children:[(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.CloseOutlined,{}),onClick:ee,size:`small`,style:{marginRight:8}}),(0,l.jsx)(`span`,{className:`dynamic-popup__header-icon-box`,children:(0,l.jsx)(c.TeamOutlined,{})}),(0,l.jsx)(`span`,{className:`dynamic-popup__header-label`,children:`Vendor List`}),(0,l.jsxs)(`div`,{className:`vendor-share__vendor-search`,children:[(0,l.jsx)(c.SearchOutlined,{className:`vendor-share__search-icon`}),(0,l.jsx)(s.Input,{variant:`borderless`,placeholder:`Search vendor`,value:x,onChange:e=>{S(e.target.value),M(1)},className:`vendor-share__search-input`})]})]}),(0,l.jsx)(`div`,{className:`vendor-share__vendor-tabs`,children:DA.vendorTabs.map(e=>(0,l.jsxs)(`span`,{className:`vendor-share__vendor-tab${y===e.key?` vendor-share__vendor-tab--active`:``}`,onClick:()=>{b(e.key),M(1),R([])},children:[e.label,` (`,U(e.key),`)`]},e.key))})]}),(0,l.jsx)(`div`,{className:`vendor-share__vendor-table-wrapper`,children:(0,l.jsx)(s.Table,{rowKey:e=>e.vendorId,columns:kA,dataSource:ne,loading:F,pagination:!1,size:`small`,rowSelection:{selectedRowKeys:L,onChange:e=>{e.length>DA.maxVendorSelect||R(e)}},scroll:{y:`calc(100vh - 340px)`}})}),(0,l.jsx)(`div`,{className:`vendor-share__vendor-footer`,children:(0,l.jsx)(Re,{current:j,pageSize:N,total:k,onChange:e=>M(e),onPageSizeChange:e=>P(e)})})]}),(0,l.jsx)(`div`,{className:`vendor-share__right`,children:(0,l.jsx)(iE,{value:B,onChange:V,moduleName:f,defaultTemplateId:p.defaultTemplateId??t.state?.defaultTemplateId??``,ready:_,contextRecords:r,title:`Share`,hint:`Select vendors or add email addresses`,bccHint:`Vendor emails are added automatically`,afterBcc:L.length>0?(0,l.jsxs)(`div`,{className:`vendor-share__selected-count`,children:[L.length,` / `,DA.maxVendorSelect,` Vendors selected`]}):null})})]})})}var jA={EMAIL:/^[a-zA-Z0-9._%+-]+@[a-zA-Z][a-zA-Z-]*\.[a-zA-Z]{2,}$/,PHONE:/^[0-9]{10}$/,PASSWORD:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,ALPHABETS:/^[A-Za-z ]+$/,ALPHANUMERIC:/^(?!\s)[A-Za-z0-9 ]+$/,NUMBER:/^[0-9]+$/,URL:/^(https?:\/\/)?(www\.)?([a-zA-Z0-9-]+\.)+(com|org|net|in|co|io|gov|edu)(\/[^\s]*)?$/i,CANDIDATE_ID:/^[A-Za-z0-9-]+$/,REMARKS:/^[A-Za-z0-9\s.,'"\-()!?/@#$%&]*$/,DESIGNATION:/^[a-zA-Z0-9\s,.\-&()]{2,100}$/,DOB:/^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/,COMPANY_NAME:/^[A-Za-z0-9\s&.,'()-]+$/,FIRST_NAME:/^[A-Z][a-zA-Z]*$/,FULL_NAME:/^[A-Z][a-zA-Z]*(?: [A-Z][a-zA-Z]*)*$/,NO_SPACES:/^\S+$/,STARTS_WITH_CAPITAL:/^[A-Z].*$/},MA={SINGLE_FILE_COUNT:1,MULTI_FILE_COUNT:5,MAX_FILE_SIZE:2,ALLOWED_FILE_TYPES:[`image/jpeg`,`image/png`,`application/pdf`]},NA={REQUIRED:e=>`Mandatory Field`,INVALID_EMAIL:`Please enter a valid email address.`,INVALID_PHONE:`Phone number must contain exactly 10 digits.`,INVALID_PASSWORD:`Password must contain uppercase, lowercase, number, special character and minimum 8 characters.`,INVALID_ALPHABETS:`Only alphabets and spaces are allowed.`,INVALID_ALPHANUMERIC:`Only letters, numbers and spaces are allowed.`,INVALID_NUMBER:`Only numbers are allowed.`,INVALID_URL:`Please enter a valid URL.`,INVALID_CANDIDATE_ID:e=>`${e} can contain only letters, numbers and hyphens.`,INVALID_REMARKS:`Remarks contain invalid characters.`,INVALID_DESIGNATION:`Designation contains invalid characters.`,INVALID_DOB:`DOB must be in MM/DD/YYYY format.`,INVALID_LINKEDIN:`Please enter a valid LinkedIn URL.`,INVALID_COMPANY_NAME:`Company name contains invalid characters.`,INVALID_FIRST_NAME:`First letter must be capital and spaces are not allowed.`,INVALID_FULL_NAME:`Each word must start with a capital letter.`,NO_SPACES_ALLOWED:`Spaces are not allowed.`,MUST_START_WITH_CAPITAL:`First letter must be capital.`,INVALID_FILE_TYPE:`Only JPG, PNG and PDF files are allowed.`,INVALID_FILE_SIZE:`File upload must be ${MA.MAX_FILE_SIZE} MB below.`,INVALID_FILE_TYPE:`Only JPG, PNG and PDF files are allowed.`,SINGLE_FILE_ONLY:`Only one file can be uploaded.`},PA={FIRST_NAME_MIN:3,FIRST_NAME_MAX:30},FA={REMARKS_MIN:10,REMARKS_MAX:250},IA={removeSpaces:(e=``)=>e.replace(/\s/g,``),capitalizeFirstLetter:(e=``)=>e.charAt(0).toUpperCase()+e.slice(1),capitalizeWords:(e=``)=>e.replace(/\b\w/g,e=>e.toUpperCase()),removeExtraSpaces:(e=``)=>e.replace(/\s+/g,` `).trim(),firstNameFormatter:(e=``)=>e.replace(/\s+/g,` `).trimStart().replace(/\b\w/g,e=>e.toUpperCase()),fullNameFormatter:(e=``)=>e.replace(/\s+/g,` `).trimStart().replace(/\b\w/g,e=>e.toUpperCase()),phoneFormatter:(e=``)=>e.replace(/\D/g,``).slice(0,10),dobFormatter:(e=``)=>{let t=e.replace(/\D/g,``);return t.length<=2?t:t.length<=4?`${t.slice(0,2)}/${t.slice(2)}`:`${t.slice(0,2)}/${t.slice(2,4)}/${t.slice(4,8)}`}},LA={required:(e=`Field`)=>({required:!0,message:NA.REQUIRED(e)}),email:()=>({pattern:jA.EMAIL,message:NA.INVALID_EMAIL}),phone:()=>({pattern:jA.PHONE,message:NA.INVALID_PHONE}),password:()=>({pattern:jA.PASSWORD,message:NA.INVALID_PASSWORD}),alphabets:()=>({pattern:jA.ALPHABETS,message:NA.INVALID_ALPHABETS}),alphanumeric:()=>({pattern:jA.ALPHANUMERIC,message:NA.INVALID_ALPHANUMERIC}),number:()=>({pattern:jA.NUMBER,message:NA.INVALID_NUMBER}),url:()=>({pattern:jA.URL,message:NA.INVALID_URL}),candidateId:(e=`ID`)=>({pattern:jA.CANDIDATE_ID,message:NA.INVALID_CANDIDATE_ID(e)}),remarks:()=>({pattern:jA.REMARKS,message:NA.INVALID_REMARKS,REMARKS_MIN:`Remarks must be at least ${FA.REMARKS_MIN} characters.`,REMARKS_MAX:`Remarks must not exceed ${FA.REMARKS_MAX} characters.`}),designation:()=>({pattern:jA.DESIGNATION,message:NA.INVALID_DESIGNATION}),dob:(e=!0)=>({validator:(t,n)=>{if(!n)return e?Promise.reject(Error(`Date of Birth is required.`)):Promise.resolve();if(!jA.DOB.test(n))return Promise.reject(Error(NA.INVALID_DOB));let r=(0,u.default)(n,`MM/DD/YYYY`,!0);if(!r.isValid())return Promise.reject(Error(NA.INVALID_DOB));let i=(0,u.default)().endOf(`day`);return r.isAfter(i)?Promise.reject(Error(`Date of Birth cannot be a future date.`)):i.diff(r,`year`)<21?Promise.reject(Error(`Age must be at least 21 years.`)):Promise.resolve()}}),linkedin:()=>({pattern:jA.LINKEDIN,message:NA.INVALID_LINKEDIN}),companyName:()=>({pattern:jA.COMPANY_NAME,message:NA.INVALID_COMPANY_NAME}),firstName:()=>({pattern:jA.FIRST_NAME,message:NA.INVALID_FIRST_NAME,FIRST_NAME_MIN:`First Name must be at least ${PA.FIRST_NAME_MIN} characters.`,FIRST_NAME_MAX:`First Name must not exceed ${PA.FIRST_NAME_MAX} characters.`}),firstNameMinLength:()=>({min:PA.FIRST_NAME_MIN,message:NA.FIRST_NAME_MIN}),firstNameMaxLength:()=>({max:PA.FIRST_NAME_MAX,message:NA.FIRST_NAME_MAX}),remarksMinLength:()=>({min:FA.REMARKS_MIN,message:NA.REMARKS_MIN}),remarksMaxLength:()=>({max:FA.REMARKS_MAX,message:NA.REMARKS_MAX}),fullName:()=>({pattern:jA.FULL_NAME,message:NA.INVALID_FULL_NAME}),noSpaces:()=>({pattern:jA.NO_SPACES,message:NA.NO_SPACES_ALLOWED}),startsWithCapital:()=>({pattern:jA.STARTS_WITH_CAPITAL,message:NA.MUST_START_WITH_CAPITAL}),fileUpload:()=>({validator:(e,t)=>{if(!t||t.length===0)return Promise.resolve();for(let e of t){let t=e.originFileObj||e;if(!(t.size/1024/1024<=MA.MAX_FILE_SIZE))return s.message.error(NA.INVALID_FILE_SIZE),Promise.reject(Error(NA.INVALID_FILE_SIZE));if(!MA.ALLOWED_FILE_TYPES.includes(t.type))return Promise.reject(Error(NA.INVALID_FILE_TYPE))}return Promise.resolve()}}),singleFileUpload:()=>({validator:(e,t)=>{if(!t||t.length===0)return Promise.resolve();if(t.length>MA.SINGLE_FILE_COUNT)return Promise.reject(Error(NA.SINGLE_FILE_ONLY));let n=t[0];return n.size/1024/1024<MA.MAX_FILE_SIZE?MA.ALLOWED_FILE_TYPES.includes(n.type)?Promise.resolve():Promise.reject(Error(NA.INVALID_FILE_TYPE)):Promise.reject(Error(NA.INVALID_FILE_SIZE))}}),multiFileUpload:()=>({validator:(e,t)=>{if(!t||t.length===0)return Promise.resolve();if(t.length>MA.MULTI_FILE_COUNT)return Promise.reject(Error(NA.INVALID_FILE_COUNT));for(let e of t){if(!(e.size/1024/1024<MA.MAX_FILE_SIZE))return Promise.reject(Error(NA.INVALID_FILE_SIZE));if(!MA.ALLOWED_FILE_TYPES.includes(e.type))return Promise.reject(Error(NA.INVALID_FILE_TYPE))}return Promise.resolve()}})},RA={beforeUpload:e=>[`image/jpeg`,`image/png`,`application/pdf`].includes(e.type)?e.size/1024/1024<=2?!1:(s.message.error(`File upload must be 2 MB below.`),s.Upload.LIST_IGNORE):(s.message.error(`Only JPG, PNG and PDF files are allowed.`),s.Upload.LIST_IGNORE)},zA=()=>{let[e]=s.Form.useForm();return(0,l.jsx)(`div`,{style:{padding:24},children:(0,l.jsxs)(s.Form,{form:e,layout:`vertical`,onFinish:e=>{console.log(`Form Values:`,e)},autoComplete:`off`,children:[(0,l.jsxs)(s.Row,{gutter:16,children:[(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Email`,name:`email`,rules:[LA.required(`Email`),LA.email()],children:(0,l.jsx)(s.Input,{})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Phone Number`,name:`phone`,rules:[LA.required(`Phone Number`),LA.phone()],validateTrigger:[`onBlur`,`onChange`],children:(0,l.jsx)(s.Input,{maxLength:10,onChange:t=>{e.setFieldsValue({phone:IA.phoneFormatter(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Password`,name:`password`,rules:[LA.required(`Password`),LA.password()],children:(0,l.jsx)(s.Input.Password,{})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Full Name`,name:`fullName`,rules:[LA.required(`Full Name`),LA.alphabets(),LA.firstNameMinLength(),LA.firstNameMaxLength()],children:(0,l.jsx)(s.Input,{onChange:t=>{e.setFieldsValue({fullName:IA.firstNameFormatter(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Username`,name:`username`,rules:[LA.required(`Username`),LA.alphanumeric()],children:(0,l.jsx)(s.Input,{onChange:t=>{e.setFieldsValue({username:IA.removeExtraSpaces(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Website URL`,name:`website`,rules:[LA.required(`Website URL`),LA.url()],children:(0,l.jsx)(s.Input,{onChange:t=>{e.setFieldsValue({website:IA.removeExtraSpaces(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`MSP Req ID`,name:`mspreqID`,rules:[LA.required(`MSP Req ID`),LA.candidateId(`MSP Req ID`)],children:(0,l.jsx)(s.Input,{onChange:t=>{e.setFieldsValue({mspreqID:IA.removeExtraSpaces(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Candidate ID`,name:`candidateId`,rules:[LA.required(`Candidate ID`),LA.candidateId(`Candidate ID`)],children:(0,l.jsx)(s.Input,{onChange:t=>{e.setFieldsValue({candidateId:IA.removeExtraSpaces(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:24,children:(0,l.jsx)(s.Form.Item,{label:`Remarks`,name:`remarks`,rules:[LA.required(`Remarks`),LA.remarks(),LA.remarksMinLength(),LA.remarksMaxLength()],children:(0,l.jsx)(s.Input.TextArea,{rows:4})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Designation`,name:`designation`,rules:[LA.required(`Designation`),LA.designation()],children:(0,l.jsx)(s.Input,{})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Date of Birth`,name:`dob`,rules:[LA.dob()],children:(0,l.jsx)(s.Input,{placeholder:`MM/DD/YYYY`,maxLength:10,onChange:t=>{e.setFieldsValue({dob:IA.dobFormatter(t.target.value)})}})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Company Name`,name:`companyName`,rules:[LA.required(`Company Name`),LA.companyName()],children:(0,l.jsx)(s.Input,{})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{name:`contractType`,label:`Contract Type`,children:(0,l.jsxs)(s.Select,{showSearch:!0,allowClear:!0,filterOption:(e,t)=>(t?.label??``).toLowerCase().includes(e.toLowerCase()),children:[(0,l.jsx)(s.Select.Option,{value:`C2C`,label:`C2C`,children:`C2C`}),(0,l.jsx)(s.Select.Option,{value:`W2-Contract`,label:`W2-Contract`,children:`W2-Contract`}),(0,l.jsx)(s.Select.Option,{value:`W2-Fulltime`,label:`W2-Fulltime`,children:`W2-Fulltime`}),(0,l.jsx)(s.Select.Option,{value:`1099`,label:`1099`,children:`1099`})]})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{name:`candidateProposedRateCurrency`,label:`Currency`,children:(0,l.jsxs)(s.Select,{showSearch:!0,allowClear:!0,children:[(0,l.jsx)(s.Select.Option,{value:`$`,children:`$`}),(0,l.jsx)(s.Select.Option,{value:`₹`,children:`₹`}),(0,l.jsx)(s.Select.Option,{value:`€`,children:`€`}),(0,l.jsx)(s.Select.Option,{value:`zł`,children:`zł`}),(0,l.jsx)(s.Select.Option,{value:`£`,children:`£`}),(0,l.jsx)(s.Select.Option,{value:`kr`,children:`kr`}),(0,l.jsx)(s.Select.Option,{value:`Fr`,children:`Fr`}),(0,l.jsx)(s.Select.Option,{value:`kr`,children:`kr`})]})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Resume new`,name:`resume`,children:(0,l.jsx)(s.Upload,{beforeUpload:RA.beforeUpload,maxCount:1,children:(0,l.jsx)(s.Button,{children:`Upload Resume`})})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Documents`,name:`documents`,valuePropName:`fileList`,getValueFromEvent:e=>e?.fileList,rules:[LA.multiFileUpload()],children:(0,l.jsx)(s.Upload,{multiple:!0,beforeUpload:RA.beforeUpload,children:(0,l.jsx)(s.Button,{children:`Upload Documents`})})})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{label:`Upload File`,name:`file`,valuePropName:`fileList`,getValueFromEvent:e=>e?.fileList,rules:[LA.fileUpload()],children:(0,l.jsx)(s.Upload,{beforeUpload:RA.beforeUpload,maxCount:1,children:(0,l.jsx)(s.Button,{children:`Upload`})})})})]}),(0,l.jsx)(s.Row,{children:(0,l.jsx)(s.Form.List,{name:`users`,children:(e,{add:t,remove:n})=>(0,l.jsxs)(l.Fragment,{children:[e.map(({key:e,name:t,...r})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Col,{span:12,children:(0,l.jsx)(s.Form.Item,{required:!0,...r,rules:[{required:!0,message:`First name is requried`}],name:[t,`first`],children:(0,l.jsx)(s.Input,{placeholder:`First Name`})})}),(0,l.jsx)(s.Col,{span:11,children:(0,l.jsx)(s.Form.Item,{...r,required:!0,name:[t,`last`],children:(0,l.jsx)(s.Input,{placeholder:`Last Name`})})}),(0,l.jsx)(s.Col,{span:1,children:(0,l.jsx)(c.MinusCircleOutlined,{onClick:()=>n(t)})})]})),(0,l.jsx)(s.Form.Item,{children:(0,l.jsx)(s.Button,{type:`dashed`,onClick:()=>t(),block:!0,icon:(0,l.jsx)(c.PlusOutlined,{}),children:`Add field`})})]})})}),(0,l.jsxs)(s.Form.Item,{children:[(0,l.jsx)(s.Button,{type:`primary`,htmlType:`submit`,children:`Submit`}),(0,l.jsx)(s.Button,{style:{marginLeft:10},onClick:()=>e.resetFields(),children:`Reset`})]})]})})};function BA(e){return(0,l.jsx)(wy,{children:(0,l.jsx)(BT,{...e})})}var{Text:VA}=s.Typography,HA=[{label:`Total Jobs`,value:1697,icon:`fileText`},{label:`Active Jobs`,value:1685,icon:`checkCircle`},{label:`My Jobs`,value:600,icon:`user`}],UA={fileText:(0,l.jsx)(c.FileTextOutlined,{}),checkCircle:(0,l.jsx)(c.CheckCircleOutlined,{}),user:(0,l.jsx)(c.UserOutlined,{}),filter:(0,l.jsx)(c.FilterOutlined,{})};function WA({stats:e=HA}){return(0,l.jsx)(s.Card,{children:(0,l.jsx)(s.Row,{gutter:[12,12],children:e.map(e=>(0,l.jsx)(s.Col,{xs:24,sm:24,md:8,lg:8,xl:8,children:(0,l.jsxs)(s.Card,{className:`stats-inner-card`,children:[(0,l.jsxs)(s.Space,{align:`center`,children:[UA[e.icon]??UA.fileText,(0,l.jsx)(VA,{children:e.label})]}),(0,l.jsx)(s.Statistic,{value:e.value})]})},e.label))})})}var{Text:GA}=s.Typography;function KA(e){return e?.USER_NAME??e?.user_name??e?.username??e?.name??e?.full_name??e?.fullName??e?.email??`User ${e?.USER_ID??e?.user_id??`?`}`}function qA(e){return{...e,key:e.USER_ID??e.user_id??e.userId??e.id??e._id,_name:KA(e),_email:e.email??e.EMAIL??e.user_email??``,_role:e.role_name??e.roleName??e.ROLE_NAME??``,_rawRef:e}}function JA(){let[e,t]=(0,o.useState)([]),[r,i]=(0,o.useState)(0),[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(1),[p,m]=(0,o.useState)(10),[h,g]=(0,o.useState)(``),_=(0,o.useCallback)(async({offset:e,limit:r,searchQuery:a}={})=>{u(!0);try{let o=await n.mr({offset:e,limit:r,searchQuery:a??``}),s=(o.users??[]).map(qA);t(s),i(o.total??s.length)}catch{s.message.error(`Failed to load users`)}finally{u(!1)}},[]);return(0,o.useEffect)(()=>{queueMicrotask(()=>{_({offset:(d-1)*p,limit:p,searchQuery:h})})},[_,d,p,h]),(0,l.jsx)(Z,{icon:(0,l.jsx)(c.TeamOutlined,{}),title:`Users`,style:{marginBottom:0},bodyStyle:{padding:0},children:(0,l.jsx)(vm,{listName:`Users`,dataSource:e,fields:[{label:`Name`,value:`_name`,width:220,render:(e,t)=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(GA,{strong:!0,style:{fontSize:13},children:e}),t._email&&(0,l.jsx)(`div`,{style:{fontSize:11,color:`var(--color-text-muted)`},children:t._email})]})},{label:`Role`,value:`_role`,width:180}],loading:a,total:r,current:d,pageSize:p,onPageChange:e=>f(e),onPageSizeChange:e=>{m(e),f(1)},onSearch:e=>{g(e),f(1)}})})}var{Text:YA}=s.Typography,XA=[{key:`job`,label:`Jobs`},{key:`candidate`,label:`Candidates`},{key:`submissions`,label:`Submissions`}],ZA=[{key:`listView`,label:`List View`},{key:`filter`,label:`Filter`},{key:`form`,label:`Form`}];function QA({field:e,index:t,onToggle:n,onReorder:r}){let i=(0,o.useRef)(null),[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(!1);function p(e){i.current=t,e.dataTransfer.effectAllowed=`move`,f(!0)}function m(){f(!1),u(!1)}function h(e){e.preventDefault(),u(!0)}function g(){u(!1)}function _(e){e.preventDefault(),u(!1),i.current!==null&&i.current!==t&&r(i.current,t),i.current=null}return(0,l.jsxs)(`div`,{draggable:!0,onDragStart:p,onDragEnd:m,onDragOver:h,onDragLeave:g,onDrop:_,className:`uss-field-row with-edit${a?` drag-over`:``}${d?` dragging`:``}`,children:[(0,l.jsx)(`span`,{className:`uss-drag-handle`,children:(0,l.jsx)(c.HolderOutlined,{})}),(0,l.jsxs)(`span`,{className:`uss-field-name`,children:[e.fieldName,(0,l.jsx)(`span`,{className:`uss-field-key`,children:e.fieldKey})]}),(0,l.jsx)(`span`,{className:`uss-toggle-cell`,children:(0,l.jsx)(s.Switch,{size:`small`,checked:e.isVisible,onChange:e=>n(t,`isVisible`,e)})}),(0,l.jsx)(`span`,{className:`uss-toggle-cell`,children:(0,l.jsx)(s.Switch,{size:`small`,checked:!!e.isEditable,onChange:e=>n(t,`isEditable`,e)})}),(0,l.jsx)(`span`,{className:`uss-toggle-cell`,children:(0,l.jsx)(s.Switch,{size:`small`,checked:!!e.ismandatory,onChange:e=>n(t,`ismandatory`,e)})})]})}function $A({team:e,configType:t}){let[r,i]=(0,o.useState)({}),[a,c]=(0,o.useState)(!1),[u,d]=(0,o.useState)({}),[f,p]=(0,o.useState)(`job`);(0,o.useEffect)(()=>{e&&(c(!0),n.Wr(e,t).then(i).catch(()=>s.message.error(`Failed to load field config`)).finally(()=>c(!1)))},[e,t]);let m=r[f]??[];function h(e,t){i(n=>({...n,[e]:typeof t==`function`?t(n[e]??[]):t}))}function g(e,t,n){h(f,r=>r.map((r,i)=>i===e?{...r,[t]:n}:r))}function _(e,t){h(f,n=>{let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),r.map((e,t)=>({...e,order:t}))})}async function v(){let r=f;d(e=>({...e,[r]:!0}));try{await n.hi(e,r,m,t),s.message.success(`Saved`)}catch{s.message.error(`Save failed`)}finally{d(e=>({...e,[r]:!1}))}}return(0,l.jsxs)(s.Spin,{spinning:a,children:[(0,l.jsx)(s.Tabs,{size:`small`,activeKey:f,onChange:p,items:XA.map(e=>({key:e.key,label:e.label}))}),(0,l.jsxs)(`div`,{className:`uss-field-header with-edit`,children:[(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{children:`Field`}),(0,l.jsx)(`span`,{style:{textAlign:`center`},children:`Visible`}),(0,l.jsx)(`span`,{style:{textAlign:`center`},children:`Editable`}),(0,l.jsx)(`span`,{style:{textAlign:`center`},children:`Mandatory`})]}),(0,l.jsxs)(`div`,{className:`uss-field-list`,children:[m.length===0&&!a&&(0,l.jsx)(`div`,{className:`uss-empty`,children:`No fields found.`}),m.map((e,t)=>(0,l.jsx)(QA,{field:e,index:t,onToggle:g,onReorder:_},e.fieldKey??t))]}),(0,l.jsx)(`div`,{className:`uss-modal-footer`,children:(0,l.jsxs)(s.Button,{type:`primary`,size:`small`,loading:u[f],onClick:v,children:[`Save `,XA.find(e=>e.key===f)?.label]})})]})}function ej(){let[e,t]=(0,o.useState)(null),[r,i]=(0,o.useState)(!1),[a,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(`listView`),[p,m]=(0,o.useState)([]),[h,g]=(0,o.useState)(0),[_,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(``),[x,S]=(0,o.useState)(!1),C=(0,o.useCallback)(async()=>{v(!0);try{let e=await n.pr();m(e.teams),g(e.total)}catch{s.message.error(`Failed to load teams`)}finally{v(!1)}},[]);(0,o.useEffect)(()=>{C()},[C]);function w(e){t(e),f(`listView`),i(!0)}function T(e){t(e),b(e.teamName??``),u(!0)}async function E(){if(!y.trim()){s.message.warning(`Team name is required`);return}S(!0);try{await n.mi(e,{teamName:y.trim(),managerId:e.managerId,memberIds:e.memberIds}),s.message.success(`Team updated`),u(!1),C()}catch{s.message.error(`Failed to update team`)}finally{S(!1)}}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Z,{icon:(0,l.jsx)(c.TeamOutlined,{}),title:`Teams`,style:{marginBottom:0},bodyStyle:{padding:0},children:(0,l.jsx)(vm,{listName:`Teams`,dataSource:p,fields:[{label:`Team Name`,value:`teamName`,width:200},{label:`Manager`,value:`manager`,width:200},{label:`Members`,value:`memberCount`,width:90,sorter:!1},{label:`Actions`,value:`_actions`,width:160,sorter:!1,render:(e,t)=>(0,l.jsxs)(`div`,{style:{display:`flex`,gap:4},children:[(0,l.jsx)(s.Button,{size:`small`,type:`link`,onClick:()=>T(t),children:`Edit`}),(0,l.jsx)(s.Button,{size:`small`,type:`link`,onClick:()=>w(t),children:`Configure`})]})}],loading:_,total:h})}),(0,l.jsx)(s.Modal,{open:a,onCancel:()=>u(!1),title:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.TeamOutlined,{style:{color:`var(--color-brand)`,marginRight:6}}),`Edit Team`]}),width:420,footer:null,destroyOnClose:!0,children:(0,l.jsxs)(`div`,{className:`uss-edit-team-body`,style:{paddingTop:12},children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`uss-edit-team-label`,children:`Team Name`}),(0,l.jsx)(s.Input,{value:y,onChange:e=>b(e.target.value),onPressEnter:E,placeholder:`Enter team name`})]}),(0,l.jsxs)(`div`,{className:`uss-modal-footer`,children:[(0,l.jsx)(s.Button,{onClick:()=>u(!1),children:`Cancel`}),(0,l.jsx)(s.Button,{type:`primary`,loading:x,onClick:E,children:`Save`})]})]})}),(0,l.jsxs)(s.Modal,{className:`uss-modal`,open:r,onCancel:()=>i(!1),title:(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(c.TeamOutlined,{style:{color:`var(--color-brand)`}}),(0,l.jsxs)(`span`,{children:[`Configure: `,e?.teamName]})]}),width:720,footer:null,destroyOnClose:!0,children:[(0,l.jsx)(`div`,{style:{marginBottom:12},children:(0,l.jsx)(`div`,{className:`uss-config-toggle`,children:ZA.map(e=>(0,l.jsx)(`button`,{className:`uss-config-btn${d===e.key?` active`:``}`,onClick:()=>f(e.key),children:e.label},e.key))})}),e&&(0,l.jsx)($A,{team:e,configType:d},`${e?.teamId}-${d}`)]})]})}var tj=[`view`,`add`,`edit`,`delete`],nj={view:`View`,add:`Add`,edit:`Edit`,delete:`Delete`,sourcing:`Sourcing`,assign:`Assign`,share:`Share`,change_status:`Status`,my_jobs:`My Jobs`,all_jobs:`All Jobs`,po_msa:`PO MSA`,reApprove:`ReApprove`,sendApprove:`Send Approve`};function rj(e){return nj[e]??e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function ij(e){let t=tj.filter(t=>e.includes(t)),n=e.filter(e=>!tj.includes(e)).sort();return[...t,...n]}function aj(e){let t=new Set;return Object.values(e).forEach(({permissions:e})=>Object.keys(e??{}).forEach(e=>t.add(e))),ij([...t])}function oj(e){let t=0,n=0;return Object.entries(e).forEach(([e,{permissions:r}])=>{Object.entries(r??{}).forEach(([r,{value:i}])=>{Pb(e,r)&&(n++,i===`1`&&t++)})}),{enabled:t,total:n}}function sj(e={}){if(!e||typeof e!=`object`)return e;let t=Object.keys(e).find(e=>String(e).trim().toLowerCase()===`onboarding`);if(!t)return e;let n=e[t]??{},r={...n.permissions??{}};for(let e of[`sendApprove`,`reApprove`])Object.keys(r).some(t=>t.toLowerCase()===e.toLowerCase())||(r[e]={id:0,value:`0`});return{...e,[t]:{...n,permissions:r}}}function cj({value:e,onSave:t,className:n}){let[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(e);(0,o.useEffect)(()=>{s(e)},[e]);function u(){i(!1);let n=a.trim();n&&n!==e?t(n):s(e)}return r?(0,l.jsx)(`input`,{autoFocus:!0,className:`perm-inline-input${n?` ${n}`:``}`,value:a,style:{width:Math.max(48,a.length*8)},onChange:e=>s(e.target.value),onBlur:u,onKeyDown:t=>{t.key===`Enter`&&u(),t.key===`Escape`&&(i(!1),s(e)),t.stopPropagation()},onClick:e=>e.stopPropagation()}):(0,l.jsxs)(`span`,{className:`perm-editable-name${n?` ${n}`:``}`,onDoubleClick:e=>{e.stopPropagation(),i(!0)},children:[e,(0,l.jsx)(c.EditOutlined,{className:`perm-name-edit-icon`})]})}function lj({entry:e,label:t,onToggle:n,onLabelSave:r}){let[i,a]=(0,o.useState)(!1),[u,d]=(0,o.useState)(t),f=e?.value===`1`,p=!!e;(0,o.useEffect)(()=>{d(t)},[t]);function m(){a(!1);let e=u.trim();e&&e!==t?r(e):d(t)}return(0,l.jsx)(s.Tooltip,{title:p?f?`Click to disable`:`Click to enable`:`Not applicable for this module`,children:(0,l.jsxs)(`div`,{className:`perm-action-pill${f?` on`:``}${p?``:` na`}`,onClick:()=>{!i&&p&&n()},children:[(0,l.jsx)(`span`,{className:`perm-action-pill-dot${f?` on`:``}`}),i?(0,l.jsx)(`input`,{autoFocus:!0,className:`perm-pill-input`,value:u,style:{width:Math.max(36,u.length*7)},onChange:e=>d(e.target.value),onBlur:m,onKeyDown:e=>{e.key===`Enter`&&m(),e.key===`Escape`&&(a(!1),d(t)),e.stopPropagation()},onClick:e=>e.stopPropagation()}):(0,l.jsx)(`span`,{className:`perm-action-pill-label`,onDoubleClick:e=>{e.stopPropagation(),a(!0)},children:t}),f&&!i&&(0,l.jsx)(c.CheckOutlined,{className:`perm-action-pill-check`})]})})}function uj({menuName:e,menuData:t,permKeys:n,onChange:r,displayName:i,actionLabels:a,onModuleLabelSave:o,onActionLabelSave:s}){let c=t?.permissions??{},u=n.filter(t=>Pb(e,t)),d=u.filter(e=>c[e]?.value===`1`).length,f=u.filter(e=>c[e]).length,p=f>0&&d===f;return(0,l.jsxs)(`div`,{className:`perm-module-card${p?` all-on`:d>0&&!p?` some-on`:``}`,children:[(0,l.jsxs)(`div`,{className:`perm-module-card-header`,children:[(0,l.jsx)(cj,{value:i,onSave:t=>o(e,t),className:`perm-module-card-name`}),f>0&&(0,l.jsxs)(`span`,{className:`perm-module-card-badge${d>0?` active`:``}`,children:[d,`/`,f]})]}),(0,l.jsx)(`div`,{className:`perm-module-card-body`,children:u.map(t=>(0,l.jsx)(lj,{entry:c[t],label:a[t]??rj(t),onToggle:()=>r(e,t),onLabelSave:e=>s(t,e)},t))})]})}function dj({role:e,moduleLabels:t={},actionLabels:r={},onModuleLabelSave:i=()=>{},onActionLabelSave:a=()=>{}}){let[u,d]=(0,o.useState)({}),[f,p]=(0,o.useState)({}),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)(!1),b=n.zr(e);(0,o.useEffect)(()=>{b&&(h(!0),y(!1),n.Hr(b).then(e=>{let t=sj(e);d(t),p(t)}).catch(()=>s.message.error(`Failed to load permissions`)).finally(()=>h(!1)))},[b]);function x(e,t){y(!0),p(n=>{let r=n[e]??{menuId:u[e]?.menuId??0,permissions:{}},i=r.permissions?.[t]??{id:0,value:`0`};return{...n,[e]:{...r,permissions:{...r.permissions,[t]:{...i,value:i.value===`1`?`0`:`1`}}}}})}async function S(){_(!0);try{await n.fi(b,f),d(f),y(!1),s.message.success(`Permissions saved`)}catch(e){s.message.error(e?.message||`Save failed`)}finally{_(!1)}}let C=(0,o.useMemo)(()=>Object.keys(f).sort(),[f]),w=(0,o.useMemo)(()=>aj(f),[f]),{enabled:T,total:E}=(0,o.useMemo)(()=>oj(f),[f]);return(0,l.jsxs)(s.Spin,{spinning:m,children:[(0,l.jsxs)(`div`,{className:`perm-panel-header`,children:[(0,l.jsxs)(`div`,{className:`perm-panel-title`,children:[(0,l.jsx)(c.LockOutlined,{style:{color:`var(--color-brand)`,marginRight:6}}),(0,l.jsx)(`span`,{children:e?.roleName}),!m&&E>0&&(0,l.jsxs)(s.Tag,{color:`blue`,style:{marginLeft:8,fontSize:11},children:[T,`/`,E,` enabled`]})]}),(0,l.jsx)(s.Button,{type:`primary`,size:`small`,icon:(0,l.jsx)(c.UnlockOutlined,{}),loading:g,disabled:!v,onClick:S,children:`Save Changes`})]}),(0,l.jsxs)(`div`,{className:`perm-hint`,children:[(0,l.jsx)(c.InfoCircleOutlined,{className:`perm-hint-icon`}),(0,l.jsxs)(`span`,{children:[`Click a pill to toggle. `,(0,l.jsx)(`strong`,{children:`Double-click`}),` a module name or action label to rename it — labels are saved locally.`]})]}),C.length===0&&!m?(0,l.jsx)(`div`,{className:`perm-empty`,children:`No permission entries found for this role.`}):(0,l.jsx)(`div`,{className:`perm-cards-grid`,children:C.map(e=>(0,l.jsx)(uj,{menuName:e,menuData:f[e],permKeys:w,onChange:x,displayName:t[e]??e,actionLabels:r,onModuleLabelSave:i,onActionLabelSave:a},e))})]})}var{Text:fj}=s.Typography,pj=[{key:`listView`,label:`List View`},{key:`filter`,label:`Filter`},{key:`form`,label:`Form`},{key:`permissions`,label:`Permissions`}];function mj(e){return String(e||``).replace(/[-_]/g,` `).replace(/\b\w/g,e=>e.toUpperCase()).trim()}function hj(e){return String(e||``).trim().toLowerCase()}function gj(e){return e?.key||e?.collectionName||e?.value||``}function _j(e=[],t=[]){let n=[],r=new Set,i=new Set,a=new Set;return e.forEach(e=>{let t=gj(e);if(!t)return;let o=hj(e.key||t),s=hj(e.collectionName);e.seeded&&(i.add(o),s&&i.add(s)),s&&a.add(s),r.add(t),n.push({label:e.label||mj(t),value:t,disabled:!!e.seeded})}),t.forEach(e=>{let t=String(e||``).trim();if(!t||r.has(t))return;let o=hj(t);a.has(o)||i.has(o)||(r.add(t),n.push({label:mj(t),value:t,disabled:!1}))}),n}function vj(){let[e,t]=(0,o.useState)(null),[r,i]=(0,o.useState)(!1),[a,u]=(0,o.useState)(`listView`),[d,f]=(0,o.useState)([]),[p,m]=(0,o.useState)(0),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)([]),[y,b]=(0,o.useState)([]),[x,S]=(0,o.useState)(!1),[C,w]=(0,o.useState)(!1),T=(0,o.useMemo)(()=>_.filter(e=>!e.disabled),[_]),E=!x&&T.length===0,D=(0,o.useCallback)(async()=>{g(!0);try{let e=await n.fr();f(e.roles),m(e.total)}catch{s.message.error(`Failed to load roles`)}finally{g(!1)}},[]),O=(0,o.useCallback)(async()=>{S(!0);try{let[e,t]=await Promise.all([n.wr(),n.gr()]),r=_j(e.modules,t),i=new Set(r.filter(e=>!e.disabled).map(e=>e.value));v(r),b(e=>e.filter(e=>i.has(e)))}catch{s.message.error(`Failed to load seed status`)}finally{S(!1)}},[]);(0,o.useEffect)(()=>{D()},[D]),(0,o.useEffect)(()=>{O()},[O]);async function k(){if(y.length===0){s.message.warning(E?`All modules already seeded.`:`Select at least one module to seed.`);return}w(!0);try{await n.ri(y),s.message.success(`Role field config seeded`),b([]),await O()}catch(e){s.message.error(e?.message||`Seed failed`)}finally{w(!1)}}function A(e,n=`listView`){t(e),u(n),i(!0)}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(Z,{icon:(0,l.jsx)(c.AppstoreOutlined,{}),title:`Field Config Seed`,style:{marginBottom:12},children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`},children:[(0,l.jsx)(`div`,{style:{minWidth:320,flex:1},children:(0,l.jsx)(s.Select,{mode:`multiple`,allowClear:!0,showSearch:!0,value:y,options:_,placeholder:E?`All modules already seeded`:`Select modules or collections to seed`,disabled:x||C||E,loading:x,onChange:b,style:{width:`100%`}})}),(0,l.jsx)(s.Button,{type:`primary`,loading:C,disabled:x||y.length===0,onClick:k,children:`Seed Field Config`})]}),(0,l.jsx)(fj,{type:`secondary`,style:{display:`block`,marginTop:8,fontSize:12},children:E?`Seed is disabled because all configured modules already have role field config data.`:`Already seeded modules are disabled. New modules or collections can still be seeded.`})]}),(0,l.jsx)(Z,{icon:(0,l.jsx)(c.SafetyOutlined,{}),title:`Roles`,style:{marginBottom:0},bodyStyle:{padding:0},children:(0,l.jsx)(vm,{listName:`Roles`,dataSource:d,fields:[{label:`Role Name`,value:`roleName`,width:200},{label:`Description`,value:`description`,width:240},{label:`Users`,value:`userCount`,width:70,sorter:!1},{label:`Actions`,value:`_configure`,width:200,sorter:!1,render:(e,t)=>(0,l.jsxs)(s.Space,{size:2,children:[(0,l.jsx)(s.Button,{size:`small`,type:`link`,onClick:()=>A(t),children:`Configure`}),(0,l.jsx)(s.Button,{size:`small`,type:`link`,icon:(0,l.jsx)(c.LockOutlined,{}),onClick:()=>A(t,`permissions`),children:`Permissions`})]})}],loading:h,total:p})}),(0,l.jsxs)(s.Modal,{className:`uss-modal`,open:r,onCancel:()=>i(!1),title:(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(c.SafetyOutlined,{style:{color:`var(--color-brand)`}}),(0,l.jsxs)(`span`,{children:[`Configure: `,e?.roleName]})]}),width:720,footer:null,destroyOnClose:!0,children:[(0,l.jsx)(`div`,{style:{marginBottom:12},children:(0,l.jsx)(`div`,{className:`uss-config-toggle`,children:pj.map(e=>(0,l.jsx)(`button`,{className:`uss-config-btn${a===e.key?` active`:``}`,onClick:()=>u(e.key),children:e.label},e.key))})}),e&&(a===`permissions`?(0,l.jsx)(dj,{role:e},e?.roleId):(0,l.jsx)(Zb,{role:e,configType:a},`${e?.roleId}-${a}`))]})]})}var yj=`perm-module-labels`,bj=`perm-action-labels`;function xj(e){try{return JSON.parse(localStorage.getItem(e)??`{}`)}catch{return{}}}function Sj(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function Cj({label:e,onSave:t,onDelete:n,loading:r}){let[i,a]=(0,o.useState)(!1),[u,d]=(0,o.useState)(e);function f(){a(!1);let n=u.trim();n&&n!==e?t(n):d(e)}return(0,l.jsxs)(`div`,{className:`perm-manage-row`,children:[i?(0,l.jsx)(`input`,{autoFocus:!0,className:`perm-inline-input`,value:u,style:{flex:1,minWidth:0},onChange:e=>d(e.target.value),onBlur:f,onKeyDown:t=>{t.key===`Enter`&&f(),t.key===`Escape`&&(a(!1),d(e))}}):(0,l.jsx)(`span`,{className:`perm-manage-row-label`,children:e}),(0,l.jsxs)(`div`,{className:`perm-manage-row-actions`,children:[(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.EditOutlined,{}),onClick:()=>{d(e),a(!0)},loading:r}),(0,l.jsx)(s.Popconfirm,{title:`Delete this item?`,onConfirm:n,okText:`Delete`,cancelText:`Cancel`,okType:`danger`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.DeleteOutlined,{}),danger:!0})})]})]})}function wj({open:e,onClose:t}){let[r,i]=(0,o.useState)(`modules`),[a,u]=(0,o.useState)([]),[d,f]=(0,o.useState)(!1),[p,m]=(0,o.useState)(``),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)([]),[y,b]=(0,o.useState)(!1),[x,S]=(0,o.useState)(``),[C,w]=(0,o.useState)(``),[T,E]=(0,o.useState)(!1);(0,o.useEffect)(()=>{e&&(D(),O())},[e]);async function D(){f(!0);try{u(await n.jr())}catch{s.message.error(`Failed to load modules`)}finally{f(!1)}}async function O(){b(!0);try{v(await n.Ar())}catch{s.message.error(`Failed to load actions`)}finally{b(!1)}}async function k(){let e=p.trim();if(!e){s.message.warning(`Enter a module name`);return}g(!0);try{let t=await n.Jn({menuName:e});u(e=>[...e,t]),m(``),s.message.success(`Module added`)}catch{s.message.error(`Failed to add module`)}finally{g(!1)}}async function A(e,t){try{await n.ci(e,{menuName:t}),u(n=>n.map(n=>n.MENUID===e?{...n,MENUNAME:t}:n))}catch{s.message.error(`Failed to update module`)}}async function j(e){try{await n.rr(e),u(t=>t.filter(t=>t.MENUID!==e)),s.message.success(`Module deleted`)}catch{s.message.error(`Failed to delete module`)}}async function M(){let e=x.trim(),t=C.trim().toLowerCase().replace(/\s+/g,`_`);if(!e||!t){s.message.warning(`Enter both name and key`);return}E(!0);try{let r=await n.qn({permissionName:e,permissionKey:t});v(e=>[...e,r]),S(``),w(``),s.message.success(`Action added`)}catch(e){s.message.error(e?.message?.includes(`409`)||e?.status===409?`Permission key already exists`:`Failed to add action`)}finally{E(!1)}}async function N(e,t){try{await n.si(e,{permissionName:t}),v(n=>n.map(n=>n.permissionId===e?{...n,permissionName:t}:n))}catch{s.message.error(`Failed to update action`)}}async function P(e){try{await n.nr(e),v(t=>t.filter(t=>t.permissionId!==e)),s.message.success(`Action deleted`)}catch{s.message.error(`Failed to delete action`)}}let F=[{key:`modules`,label:`Modules`,children:(0,l.jsxs)(s.Spin,{spinning:d,children:[(0,l.jsxs)(`div`,{className:`perm-manage-add-row`,children:[(0,l.jsx)(s.Input,{placeholder:`Module name`,value:p,onChange:e=>m(e.target.value),onPressEnter:k,style:{flex:1},size:`small`}),(0,l.jsx)(s.Button,{type:`primary`,size:`small`,icon:(0,l.jsx)(c.PlusOutlined,{}),loading:h,onClick:k,children:`Add`})]}),(0,l.jsxs)(`div`,{className:`perm-manage-list`,children:[a.length===0&&!d&&(0,l.jsx)(`div`,{className:`perm-empty`,style:{paddingTop:24},children:`No modules found`}),a.map(e=>(0,l.jsx)(Cj,{label:e.MENUNAME,onSave:t=>A(e.MENUID,t),onDelete:()=>j(e.MENUID)},e.MENUID))]})]})},{key:`actions`,label:`Actions`,children:(0,l.jsxs)(s.Spin,{spinning:y,children:[(0,l.jsxs)(`div`,{className:`perm-manage-add-row`,children:[(0,l.jsx)(s.Input,{placeholder:`Action name (e.g. Approve)`,value:x,onChange:e=>S(e.target.value),style:{flex:1},size:`small`}),(0,l.jsx)(s.Input,{placeholder:`Key (e.g. approve)`,value:C,onChange:e=>w(e.target.value),onPressEnter:M,style:{width:140},size:`small`}),(0,l.jsx)(s.Button,{type:`primary`,size:`small`,icon:(0,l.jsx)(c.PlusOutlined,{}),loading:T,onClick:M,children:`Add`})]}),(0,l.jsxs)(`div`,{className:`perm-manage-list`,children:[_.length===0&&!y&&(0,l.jsx)(`div`,{className:`perm-empty`,style:{paddingTop:24},children:`No actions found`}),_.map(e=>(0,l.jsx)(Cj,{label:`${e.permissionName} (${e.permissionKey})`,onSave:t=>N(e.permissionId,t),onDelete:()=>P(e.permissionId)},e.permissionId))]})]})}];return(0,l.jsx)(s.Modal,{open:e,onCancel:t,title:(0,l.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,l.jsx)(c.SettingOutlined,{style:{color:`var(--color-brand)`}}),`Manage Modules & Actions`]}),width:520,footer:null,destroyOnClose:!0,children:(0,l.jsx)(s.Tabs,{activeKey:r,onChange:i,size:`small`,items:F})})}function Tj(){let[e,t]=(0,o.useState)([]),[r,i]=(0,o.useState)(!1),[a,u]=(0,o.useState)(null),[d,f]=(0,o.useState)(``),[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(()=>xj(yj)),[_,v]=(0,o.useState)(()=>xj(bj)),y=(0,o.useCallback)((e,t)=>{g(n=>{let r={...n,[e]:t};return Sj(yj,r),r})},[]),b=(0,o.useCallback)((e,t)=>{v(n=>{let r={...n,[e]:t};return Sj(bj,r),r})},[]);function x(){g({}),v({}),Sj(yj,{}),Sj(bj,{}),s.message.success(`Labels reset to defaults`)}let S=(0,o.useCallback)(async()=>{i(!0);try{let{roles:e}=await n.fr();t(e),e.length>0&&u(e[0])}catch{s.message.error(`Failed to load roles`)}finally{i(!1)}},[]);(0,o.useEffect)(()=>{S()},[S]);let C=(0,o.useMemo)(()=>{let t=d.trim().toLowerCase();return t?e.filter(e=>e.roleName.toLowerCase().includes(t)):e},[e,d]),w=Object.keys(h).length>0||Object.keys(_).length>0;return(0,l.jsxs)(`div`,{className:`perm-page`,children:[(0,l.jsxs)(Z,{className:`perm-left-card`,icon:(0,l.jsx)(c.SafetyOutlined,{}),title:`Roles`,bodyStyle:{padding:0},children:[(0,l.jsx)(`div`,{className:`perm-role-search`,children:(0,l.jsx)(s.Input,{prefix:(0,l.jsx)(c.SearchOutlined,{}),placeholder:`Search roles…`,allowClear:!0,size:`small`,value:d,onChange:e=>f(e.target.value)})}),(0,l.jsx)(s.Spin,{spinning:r,children:(0,l.jsxs)(`div`,{className:`perm-role-list`,children:[C.length===0&&!r&&(0,l.jsx)(`div`,{className:`perm-role-empty`,children:`No roles found`}),C.map(e=>{let t=a?.roleId===e.roleId,n=e.description&&e.description!==`N/A`?e.description:e.roleType===0?`Default role`:`Custom role`;return(0,l.jsxs)(`div`,{className:`perm-role-item${t?` active`:``}`,onClick:()=>u(e),children:[(0,l.jsx)(`div`,{className:`perm-role-item-name`,children:e.roleName}),(0,l.jsx)(`div`,{className:`perm-role-item-desc`,children:n})]},e.roleId)})]})})]}),(0,l.jsx)(Z,{className:`perm-right-card`,icon:(0,l.jsx)(c.LockOutlined,{}),title:`Module Permissions`,extra:(0,l.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[w&&(0,l.jsx)(`button`,{className:`perm-reset-btn`,onClick:x,children:`Reset labels`}),(0,l.jsx)(s.Button,{size:`small`,icon:(0,l.jsx)(c.SettingOutlined,{}),onClick:()=>m(!0),children:`Manage`})]}),bodyStyle:{padding:`12px 16px`},children:a?(0,l.jsx)(dj,{role:a,moduleLabels:h,actionLabels:_,onModuleLabelSave:y,onActionLabelSave:b},a.roleId):(0,l.jsx)(`div`,{className:`perm-empty`,children:`Select a role from the left to manage its permissions.`})}),(0,l.jsx)(wj,{open:p,onClose:()=>m(!1)})]})}var{Title:Ej,Text:Dj}=s.Typography,Oj=[{label:`In Progress`,value:107,sub:`Under review`,color:`blue`},{label:`Hired`,value:2,sub:`Onboarded`,color:`green`},{label:`Project Completed`,value:2,sub:`Project cycle closed`,color:`purple`},{label:`Archive`,value:2,sub:`No longer active`,color:`peach`}];function kj({items:e=Oj}){return(0,l.jsx)(s.Card,{className:`onboarding-card`,title:(0,l.jsx)(Ej,{level:5,children:`Onboarding`}),extra:(0,l.jsx)(s.Button,{type:`link`,children:`View all`}),children:(0,l.jsx)(s.Row,{gutter:[12,12],children:e.map(e=>(0,l.jsx)(s.Col,{xs:12,sm:6,md:6,lg:12,xl:12,children:(0,l.jsxs)(`div`,{className:`onboarding-item ${e.color}`,children:[(0,l.jsx)(Dj,{className:`onboarding-item-label`,children:e.label}),(0,l.jsx)(s.Statistic,{value:e.value,className:`onboarding-stat`}),(0,l.jsx)(`div`,{className:`onboarding-item-footer`,children:(0,l.jsx)(Dj,{className:`onboarding-item-sub`,children:e.sub})})]})},e.label))})})}var{Text:Aj,Title:jj}=s.Typography,Mj=[{group:`Dashboard`,items:[{id:`dashboard`,label:`Admin Dashboard`,icon:(0,l.jsx)(c.DashboardOutlined,{})}]},{group:`Settings`,items:[{id:`org`,label:`Organization`,icon:(0,l.jsx)(c.BankOutlined,{}),heading:`Organization Settings`,desc:`Manage your company profile and location details`,cards:[{label:`Company Information`,icon:(0,l.jsx)(c.BankOutlined,{}),desc:`Manage company profile, address and business details.`},{label:`Location`,icon:(0,l.jsx)(c.BuildOutlined,{}),desc:`Manage office locations, branches and regions.`}]},{id:`users`,label:`Users`,icon:(0,l.jsx)(c.UserOutlined,{}),heading:`Users`,desc:`Manage platform users and configure their field views.`,component:`users`},{id:`teams`,label:`Teams`,icon:(0,l.jsx)(c.TeamOutlined,{}),heading:`Teams`,desc:`Organize users into teams and configure field visibility per team.`,component:`teams`},{id:`roles`,label:`Roles`,icon:(0,l.jsx)(c.SafetyOutlined,{}),heading:`Roles`,desc:`Control permissions and configure field visibility per role.`,component:`roles`},{id:`permissions`,label:`Permissions`,icon:(0,l.jsx)(c.LockOutlined,{}),heading:`Permissions`,desc:`Manage module-wise action permissions (view, add, edit, delete, and more) per role.`,component:`permissions`},{id:`templates`,label:`Templates`,icon:(0,l.jsx)(c.FileTextOutlined,{}),heading:`Templates`,desc:`Email and signature templates for communications`,component:`templates`},{id:`ai-services`,label:`AI Services`,icon:(0,l.jsx)(c.ThunderboltOutlined,{}),heading:`AI Services`,desc:`Register the AI/automation backends (base URL + auth) that admin-configured AI Actions call.`,component:`ai-services`},{id:`bgc-integration`,label:`Integrations`,icon:(0,l.jsx)(c.SafetyOutlined,{}),heading:`Integrations`,desc:`Manage manual and API integrations used across application workflows.`,component:`bgc-integration`}]},{group:`Clients`,items:[{id:`clients`,label:`Clients`,icon:(0,l.jsx)(c.BankOutlined,{}),heading:`Clients`,desc:`Manage client accounts and settings`,cards:[{label:`Clients`,icon:(0,l.jsx)(c.BankOutlined,{}),desc:`Manage client companies and account details.`}]}]},{group:`Forms`,items:[{id:`form-groups`,label:`Form Groups`,icon:(0,l.jsx)(c.AppstoreAddOutlined,{}),heading:`Form Groups`,desc:`Define field groups for module add/edit forms with validations and dropdown sources.`,component:`form-groups`},{id:`detail-groups`,label:`Detail Groups`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),heading:`Detail Groups`,desc:`Customize the detail view per module: labels, prefix/suffix, colour, capitalization, reference lookups and merged fields.`,component:`detail-groups`},{id:`row-actions`,label:`Actions`,icon:(0,l.jsx)(c.ToolOutlined,{}),heading:`Actions`,desc:`Configure which action buttons appear per row in each module's list view, scoped per role.`,component:`row-actions`}]},{group:`Master`,items:[{id:`jobs`,label:`Jobs`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),heading:`Jobs Master`,desc:`Configure job sources and status types`,cards:[{label:`Sources`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),desc:`Manage job source master values.`},{label:`Job Status`,icon:(0,l.jsx)(c.CheckCircleOutlined,{}),desc:`Configure job workflow status.`}]},{id:`candidates`,label:`Candidates`,icon:(0,l.jsx)(c.UserOutlined,{}),heading:`Candidates Master`,desc:`Skills, sources and work authorization settings`,cards:[{label:`Sources`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),desc:`Manage candidate source values.`},{label:`Skills`,icon:(0,l.jsx)(c.SettingOutlined,{}),desc:`Manage skill master data.`},{label:`Work Authorization`,icon:(0,l.jsx)(c.SafetyOutlined,{}),desc:`Manage visa and authorization types.`}]},{id:`submissions`,label:`Submissions`,icon:(0,l.jsx)(c.FileTextOutlined,{}),heading:`Submissions Master`,desc:`Rejection reasons and submission status configuration`,cards:[{label:`Rejection Reasons`,icon:(0,l.jsx)(c.FileTextOutlined,{}),desc:`Manage common rejection reasons.`},{label:`Client Submission Status`,icon:(0,l.jsx)(c.CheckCircleOutlined,{}),desc:`Manage client submission statuses.`}]},{id:`clientmaster`,label:`Client Master`,icon:(0,l.jsx)(c.BankOutlined,{}),heading:`Client Master`,desc:`Payment terms, client types and contact types`,cards:[{label:`Payment Terms`,icon:(0,l.jsx)(c.FileTextOutlined,{}),desc:`Manage billing and payment terms.`},{label:`Client Type`,icon:(0,l.jsx)(c.AppstoreOutlined,{}),desc:`Classify client business types.`},{label:`Client Contact Type`,icon:(0,l.jsx)(c.TeamOutlined,{}),desc:`Manage client contact categories.`}]}]}],Nj=[{label:`Sourced`,count:312,color:`#378ADD`,pct:35},{label:`Screened`,count:223,color:`#7F77DD`,pct:25},{label:`Interview`,count:161,color:`#1D9E75`,pct:18},{label:`Offered`,count:107,color:`#EF9F27`,pct:12},{label:`Rejected`,count:89,color:`#E24B4A`,pct:10}],Pj=[{name:`Tcs`,jobs:14,candidates:86},{name:`Empasis`,jobs:9,candidates:64},{name:`NovaSystems`,jobs:7,candidates:51},{name:`Brightwave`,jobs:5,candidates:38}],Fj=[{text:`New candidate Ravi Kumar added to Java Developer role`,time:`2 min ago`,color:`#378ADD`},{text:`Submission approved by Acme Corp for Sr. React Dev`,time:`18 min ago`,color:`#1D9E75`},{text:`User Priya S. added to Recruiters team`,time:`1 hr ago`,color:`#7F77DD`},{text:`Job Data Analyst — TechFlow moved to archived`,time:`3 hr ago`,color:`#EF9F27`},{text:`Candidate rejected — work authorization mismatch`,time:`5 hr ago`,color:`#E24B4A`}];function Ij(){return(0,l.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,l.jsxs)(Z,{icon:(0,l.jsx)(c.DashboardOutlined,{}),title:`Admin Dashboard`,children:[(0,l.jsx)(`div`,{className:`admin-accent-bar`}),(0,l.jsx)(jj,{level:5,children:`Admin Dashboard`}),(0,l.jsx)(Aj,{type:`secondary`,children:`Overview of jobs, candidates, onboarding and recent activity`})]}),(0,l.jsx)(`div`,{className:`admin-dashboard-stats`,children:(0,l.jsx)(WA,{stats:[{label:`Total Jobs`,value:1697,icon:`fileText`},{label:`Active Jobs`,value:1685,icon:`checkCircle`},{label:`My Jobs`,value:600,icon:`user`},{label:`Total Candidates`,value:4320,icon:`team`},{label:`Submissions`,value:892,icon:`fileText`}]})}),(0,l.jsxs)(`div`,{className:`admin-dashboard-mid-row`,children:[(0,l.jsx)(kj,{}),(0,l.jsxs)(Z,{icon:(0,l.jsx)(c.AppstoreOutlined,{}),title:`Candidate Pipeline`,children:[(0,l.jsx)(Aj,{type:`secondary`,style:{fontSize:12},children:`By stage (892 total)`}),(0,l.jsx)(`div`,{className:`admin-pipeline-bar`,children:Nj.map(e=>(0,l.jsx)(`div`,{className:`admin-pipeline-seg`,style:{width:`${e.pct}%`,background:e.color}},e.label))}),(0,l.jsx)(`div`,{className:`admin-pipeline-legend`,children:Nj.map(e=>(0,l.jsxs)(`div`,{className:`admin-pipeline-legend-item`,children:[(0,l.jsx)(`span`,{className:`admin-pipeline-dot`,style:{background:e.color}}),e.label,` `,e.count]},e.label))}),(0,l.jsx)(`div`,{className:`admin-divider`}),(0,l.jsx)(Aj,{strong:!0,style:{fontSize:12},children:`Submission status`}),(0,l.jsxs)(`div`,{className:`admin-sub-status-list`,style:{marginTop:6},children:[(0,l.jsxs)(`div`,{className:`admin-sub-status-item`,children:[(0,l.jsx)(Aj,{style:{fontSize:13},children:`Pending client review`}),(0,l.jsx)(`span`,{className:`admin-badge warn`,children:`312`})]}),(0,l.jsxs)(`div`,{className:`admin-sub-status-item`,children:[(0,l.jsx)(Aj,{style:{fontSize:13},children:`Client approved`}),(0,l.jsx)(`span`,{className:`admin-badge success`,children:`248`})]}),(0,l.jsxs)(`div`,{className:`admin-sub-status-item`,children:[(0,l.jsx)(Aj,{style:{fontSize:13},children:`Rejected`}),(0,l.jsx)(`span`,{className:`admin-badge danger`,children:`89`})]})]})]})]}),(0,l.jsxs)(`div`,{className:`admin-dashboard-bottom-row`,children:[(0,l.jsx)(Z,{icon:(0,l.jsx)(c.BankOutlined,{}),title:`Top Clients`,extra:(0,l.jsx)(s.Button,{type:`link`,size:`small`,children:`View all`}),children:Pj.map(e=>(0,l.jsxs)(`div`,{className:`admin-client-row`,children:[(0,l.jsxs)(`div`,{className:`admin-client-left`,children:[(0,l.jsx)(`div`,{className:`admin-client-icon`,children:(0,l.jsx)(c.BankOutlined,{})}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`admin-client-name`,children:e.name}),(0,l.jsxs)(`div`,{className:`admin-client-sub`,children:[e.jobs,` open jobs`]})]})]}),(0,l.jsxs)(`div`,{className:`admin-client-right`,children:[(0,l.jsx)(`div`,{className:`admin-client-val`,children:e.candidates}),(0,l.jsx)(`div`,{className:`admin-client-sub`,children:`candidates`})]})]},e.name))}),(0,l.jsx)(Z,{icon:(0,l.jsx)(c.BellOutlined,{}),title:`Recent Activity`,children:Fj.map((e,t)=>(0,l.jsxs)(`div`,{className:`admin-activity-row`,children:[(0,l.jsx)(`div`,{className:`admin-activity-dot`,style:{background:e.color}}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`admin-activity-text`,children:e.text}),(0,l.jsx)(`div`,{className:`admin-activity-time`,children:e.time})]})]},t))})]}),(0,l.jsx)(Z,{icon:(0,l.jsx)(c.SettingOutlined,{}),title:`Admin Configuration Overview`,extra:(0,l.jsx)(s.Button,{type:`link`,size:`small`,children:`Manage`}),children:(0,l.jsxs)(s.Row,{gutter:[24,0],children:[(0,l.jsxs)(s.Col,{span:8,children:[(0,l.jsx)(Aj,{type:`secondary`,style:{fontSize:12,fontWeight:500},children:`Settings`}),[[`Organization`,2],[`User Settings`,4],[`Templates`,2]].map(([e,t])=>(0,l.jsxs)(`div`,{className:`admin-cfg-overview-row`,children:[(0,l.jsx)(Aj,{style:{fontSize:12},children:e}),(0,l.jsxs)(`span`,{className:`admin-badge info`,children:[t,` items`]})]},e))]}),(0,l.jsxs)(s.Col,{span:8,children:[(0,l.jsx)(Aj,{type:`secondary`,style:{fontSize:12,fontWeight:500},children:`Master`}),[[`Jobs`,2],[`Candidates`,3],[`Submissions`,2]].map(([e,t])=>(0,l.jsxs)(`div`,{className:`admin-cfg-overview-row`,children:[(0,l.jsx)(Aj,{style:{fontSize:12},children:e}),(0,l.jsxs)(`span`,{className:`admin-badge info`,children:[t,` items`]})]},e))]}),(0,l.jsxs)(s.Col,{span:8,children:[(0,l.jsx)(Aj,{type:`secondary`,style:{fontSize:12,fontWeight:500},children:`System`}),[[`Total Groups`,4],[`Total Modules`,9],[`Config Items`,19]].map(([e,t])=>(0,l.jsxs)(`div`,{className:`admin-cfg-overview-row`,children:[(0,l.jsx)(Aj,{style:{fontSize:12},children:e}),(0,l.jsx)(Aj,{strong:!0,style:{fontSize:12},children:t})]},e))]})]})})]})}function Lj({activeSection:e,activeGroup:t,filteredCards:n,searchText:r,setSearchText:i,allItems:a,handleNav:o}){return(0,l.jsxs)(s.Row,{gutter:[16,16],children:[(0,l.jsx)(s.Col,{span:24,children:(0,l.jsxs)(Z,{icon:e?.icon,title:e?.heading,extra:(0,l.jsx)(s.Input,{className:`admin-search`,prefix:(0,l.jsx)(c.SearchOutlined,{}),placeholder:`Search settings…`,allowClear:!0,value:r,onChange:e=>i(e.target.value)}),children:[(0,l.jsx)(`div`,{className:`admin-accent-bar`}),(0,l.jsx)(jj,{level:5,children:e?.heading}),(0,l.jsx)(Aj,{type:`secondary`,children:e?.desc})]})}),(0,l.jsx)(s.Col,{xs:24,xl:16,style:{alignSelf:`flex-start`},children:(0,l.jsx)(Z,{icon:(0,l.jsx)(c.AppstoreOutlined,{}),title:`Configuration Items`,extra:(0,l.jsxs)(Aj,{type:`secondary`,children:[n.length,` item`,n.length===1?``:`s`]}),children:(0,l.jsx)(s.Row,{gutter:[14,14],children:n.length>0?n.map(e=>(0,l.jsx)(s.Col,{xs:24,sm:12,xl:8,children:(0,l.jsxs)(`div`,{className:`admin-config-item`,children:[(0,l.jsx)(`div`,{className:`admin-config-top-bar`}),(0,l.jsxs)(`div`,{className:`admin-config-body`,children:[(0,l.jsx)(`div`,{className:`admin-config-icon`,children:e.icon}),(0,l.jsxs)(`div`,{className:`admin-config-text`,children:[(0,l.jsx)(`span`,{className:`admin-config-label`,children:e.label}),(0,l.jsx)(`span`,{className:`admin-config-desc`,children:e.desc})]})]}),(0,l.jsx)(`div`,{className:`admin-config-divider`}),(0,l.jsx)(s.Button,{type:`link`,size:`small`,className:`admin-config-manage`,icon:(0,l.jsx)(c.RightOutlined,{}),iconPosition:`end`,children:`Manage`})]})},e.label)):(0,l.jsx)(s.Col,{span:24,children:(0,l.jsx)(`div`,{className:`admin-config-empty`,children:(0,l.jsx)(s.Empty,{description:`No settings found`,image:s.Empty.PRESENTED_IMAGE_SIMPLE})})})})})}),(0,l.jsx)(s.Col,{xs:24,xl:8,style:{alignSelf:`flex-start`},children:(0,l.jsxs)(Z,{icon:(0,l.jsx)(c.FileTextOutlined,{}),title:`Section Overview`,children:[(0,l.jsx)(`div`,{className:`admin-overview-list`,children:Mj.filter(e=>e.group!==`Dashboard`).map(e=>{let n=e.group===t?.group;return(0,l.jsxs)(`div`,{className:`admin-overview-item${n?` active`:``}`,onClick:()=>{let t=e.items[0];t&&o(t.id)},children:[(0,l.jsxs)(`div`,{className:`admin-overview-left`,children:[(0,l.jsx)(`div`,{className:`admin-overview-icon`,children:e.items[0]?.icon}),(0,l.jsxs)(`div`,{className:`admin-overview-text`,children:[(0,l.jsx)(`span`,{className:`admin-overview-name`,children:e.group}),(0,l.jsxs)(`span`,{className:`admin-overview-sub`,children:[e.items.length,` module`,e.items.length===1?``:`s`]})]})]}),(0,l.jsx)(`span`,{className:`admin-overview-count${n?` active`:``}`,children:e.items.length})]},e.group)})}),(0,l.jsxs)(`div`,{className:`admin-overview-footer`,children:[(0,l.jsx)(`span`,{className:`admin-overview-footer-label`,children:`Total configuration items`}),(0,l.jsx)(`span`,{className:`admin-overview-footer-value`,children:a.filter(e=>e.cards).reduce((e,t)=>e+t.cards.length,0)})]})]})})]})}function Rj(){let[e,t]=(0,o.useState)(`dashboard`),[n,r]=(0,o.useState)(``),i=(0,o.useMemo)(()=>Mj.flatMap(e=>e.items),[]),a=(0,o.useMemo)(()=>i.find(t=>t.id===e),[i,e]),u=(0,o.useMemo)(()=>Mj.find(t=>t.items.some(t=>t.id===e)),[e]),d=(0,o.useMemo)(()=>{if(!a?.cards)return[];let e=n.trim().toLowerCase();return e?a.cards.filter(t=>t.label.toLowerCase().includes(e)||t.desc.toLowerCase().includes(e)):a.cards},[a,n]),f=(0,o.useMemo)(()=>Mj.map(e=>({key:e.group,type:`group`,label:e.group,children:e.items.map(e=>({key:e.id,icon:e.icon,label:e.label}))})),[]),p=e=>{t(e),r(``)};return e===`dashboard`||a?.heading,(0,l.jsxs)(`main`,{className:`admin-page`,children:[(0,l.jsx)(`div`,{className:`admin-breadcrumb`,children:(0,l.jsx)(s.Breadcrumb,{items:[{title:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.HomeOutlined,{}),` Home`]})},{title:`Admin`}]})}),(0,l.jsxs)(s.Row,{gutter:[16,16],className:`admin-wrapper`,children:[(0,l.jsx)(s.Col,{xs:24,lg:6,xl:5,children:(0,l.jsxs)(Z,{title:`Admin Console`,icon:(0,l.jsx)(c.SettingOutlined,{}),children:[(0,l.jsxs)(`div`,{className:`admin-sidebar-banner`,children:[(0,l.jsx)(`span`,{className:`admin-sidebar-banner-title`,children:`Admin Panel`}),(0,l.jsx)(`span`,{className:`admin-sidebar-banner-sub`,children:`Configuration Center`}),(0,l.jsxs)(s.Row,{gutter:[8,0],children:[(0,l.jsx)(s.Col,{span:12,children:(0,l.jsxs)(`div`,{className:`admin-sidebar-pill`,children:[(0,l.jsx)(`span`,{className:`admin-sidebar-pill-label`,children:`Groups`}),(0,l.jsx)(`span`,{className:`admin-sidebar-pill-value`,children:Mj.length})]})}),(0,l.jsx)(s.Col,{span:12,children:(0,l.jsxs)(`div`,{className:`admin-sidebar-pill`,children:[(0,l.jsx)(`span`,{className:`admin-sidebar-pill-label`,children:`Modules`}),(0,l.jsx)(`span`,{className:`admin-sidebar-pill-value`,children:i.length})]})})]})]}),(0,l.jsx)(s.Menu,{mode:`inline`,selectedKeys:[e],items:f,onClick:({key:e})=>p(e),className:`admin-sidebar-menu`})]})}),(0,l.jsx)(s.Col,{xs:24,lg:18,xl:19,children:e===`dashboard`?(0,l.jsx)(Ij,{}):a?.component===`form-groups`?(0,l.jsx)(qS,{}):a?.component===`detail-groups`?(0,l.jsx)(bC,{}):a?.component===`row-actions`?(0,l.jsx)(lw,{}):a?.component===`users`?(0,l.jsx)(JA,{}):a?.component===`teams`?(0,l.jsx)(ej,{}):a?.component===`roles`?(0,l.jsx)(vj,{}):a?.component===`permissions`?(0,l.jsx)(Tj,{}):a?.component===`templates`?(0,l.jsx)(xw,{}):a?.component===`ai-services`?(0,l.jsx)(Tw,{}):a?.component===`bgc-integration`?(0,l.jsx)(jw,{}):(0,l.jsx)(Lj,{activeSection:a,activeGroup:u,filteredCards:d,searchText:n,setSearchText:r,allItems:i,handleNav:p})})]})]})}var{Title:zj}=s.Typography;function Bj(){let e=(0,d.useNavigate)(),{state:t}=(0,d.useLocation)(),n=t?.moduleName||`stickyNotes`,r=t?.title||`Sticky Notes`,i={...t?.request,params:{...t?.request?.params,limit:200,offset:0}};return(0,l.jsxs)(`div`,{children:[(0,l.jsx)(s.Button,{type:`text`,icon:(0,l.jsx)(c.ArrowLeftOutlined,{}),onClick:()=>e(-1),style:{marginBottom:12},children:`Back`}),(0,l.jsx)(Pt,{moduleName:n,title:r,columns:4,request:i,viewAll:!1})]})}var{Text:Vj,Title:Hj}=s.Typography,Uj=10485760,Wj=`/templates/test_cases_flow_template.base64.txt`,Gj=`test_cases_flow_template.xlsx`,Kj=`module | subModule | step_order | description | actions | key | value | expected | scenario`,qj={idle:0,module_set:1,encoding:1,validating:2,preview:3,inserting:3,done:4,error:1},Jj=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/addTestCase`},{label:`Bulk upload`,href:`/bulk-upload`}];function Yj(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]),r.onerror=n,r.readAsDataURL(e)})}function Xj(e){return e.filter(e=>e.row_status===`valid`).map(e=>{let t={...e};return delete t.row_status,delete t.errors,t})}function Zj(e){return e.flatMap(e=>(e.errors??[]).map(t=>({id:e.id,...t})))}function Qj({errors:e}){return(0,l.jsx)(`div`,{className:`bulk-tooltip-errors`,children:(e??[]).map((e,t)=>(0,l.jsx)(`div`,{children:e.message},`${e.field}-${t}`))})}function $j({errors:e,expanded:t,onToggle:n,onSummaryClick:r}){return e.length===0?null:(0,l.jsxs)(`div`,{className:`bulk-error-banner`,children:[(0,l.jsxs)(`div`,{className:`bulk-error-summary`,children:[(0,l.jsxs)(`button`,{type:`button`,className:`bulk-error-summary-main`,onClick:r,"aria-label":`Scroll to first invalid row`,children:[(0,l.jsx)(c.ExclamationCircleOutlined,{className:`bulk-error-icon`}),(0,l.jsxs)(`span`,{children:[e.length,` validation error(s) found`]})]}),(0,l.jsx)(s.Button,{type:`link`,onClick:n,"aria-expanded":t,children:t?`Hide Errors`:`View Errors`})]}),t&&(0,l.jsx)(`div`,{className:`bulk-error-list`,role:`region`,"aria-label":`Validation error details`,children:e.map((e,t)=>(0,l.jsxs)(`div`,{className:`bulk-error-line`,children:[(0,l.jsxs)(`span`,{className:`bulk-row-chip`,children:[`Row `,e.id]}),(0,l.jsx)(`span`,{children:e.message})]},`${e.id}-${e.field}-${t}`))})]})}function eM({rows:e,view:t,onViewChange:n,onConfirm:r,onReset:i,saving:a,firstInvalidRowId:o,firstInvalidRowRef:u}){let d=e.filter(e=>e.row_status===`invalid`),f=t===`errors`?d:e,p=d.length>0||a;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s.Row,{justify:`space-between`,align:`middle`,gutter:[16,16],className:`bulk-table-toolbar`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsxs)(s.Space.Compact,{children:[(0,l.jsx)(s.Button,{type:t===`all`?`primary`:`default`,onClick:()=>n(`all`),children:`All rows`}),(0,l.jsx)(s.Button,{type:t===`errors`?`primary`:`default`,onClick:()=>n(`errors`),children:`Errors only`})]})}),(0,l.jsx)(s.Col,{children:(0,l.jsxs)(Vj,{type:`secondary`,children:[e.length,` row(s)`]})})]}),(0,l.jsx)(`div`,{className:`bulk-table-wrap`,children:(0,l.jsxs)(`table`,{className:`bulk-preview-table`,children:[(0,l.jsx)(`thead`,{children:(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`th`,{className:`bulk-col-row`,children:`Row`}),(0,l.jsx)(`th`,{className:`bulk-col-flow`,children:`Submodule`}),(0,l.jsx)(`th`,{className:`bulk-col-description`,children:`Description`}),(0,l.jsx)(`th`,{className:`bulk-col-keyword`,children:`Action`}),(0,l.jsx)(`th`,{className:`bulk-col-target`,children:`Key`}),(0,l.jsx)(`th`,{className:`bulk-col-status`,children:`Status`}),(0,l.jsx)(`th`,{className:`bulk-col-error`,children:`Error`})]})}),(0,l.jsx)(`tbody`,{children:f.map(e=>{let t=e.errors??[],n=e.row_status===`invalid`;return(0,l.jsxs)(`tr`,{ref:n&&e.id===o?u:null,className:n?`bulk-row-invalid`:``,children:[(0,l.jsx)(`td`,{children:e.id}),(0,l.jsx)(`td`,{title:e.submodule,children:e.submodule}),(0,l.jsx)(`td`,{title:e.description,children:e.description?e.description:(0,l.jsx)(`span`,{className:`bulk-empty-text`,children:`-empty-`})}),(0,l.jsx)(`td`,{children:(0,l.jsx)(`code`,{className:`bulk-code-chip`,children:e.actions})}),(0,l.jsx)(`td`,{title:e.key,children:e.key}),(0,l.jsx)(`td`,{children:n?(0,l.jsx)(s.Tag,{color:`red`,children:`Error`}):(0,l.jsx)(s.Tag,{color:`green`,children:`Valid`})}),(0,l.jsx)(`td`,{children:n?(0,l.jsx)(s.Tooltip,{title:(0,l.jsx)(Qj,{errors:t}),placement:`left`,children:(0,l.jsxs)(`button`,{type:`button`,className:`bulk-error-info`,"aria-label":`View ${t.length} error(s) for row ${e.id}`,children:[(0,l.jsx)(c.InfoCircleOutlined,{}),(0,l.jsx)(s.Badge,{count:t.length,size:`small`})]})}):(0,l.jsx)(`span`,{className:`bulk-error-none`,children:`-`})})]},`${e.id}-${e.step_order}`)})})]})}),(0,l.jsxs)(s.Space,{className:`bulk-actions`,children:[(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.ReloadOutlined,{}),onClick:i,children:`Reset`}),(0,l.jsx)(s.Button,{type:`primary`,icon:(0,l.jsx)(c.SaveOutlined,{}),loading:a,disabled:p,onClick:r,children:d.length>0?`Fix ${d.length} error(s) to proceed`:`Save to database`})]})]})}function tM(){let e=(0,d.useNavigate)(),r=(0,o.useMemo)(()=>t.l(),[]),i=(0,o.useRef)(null),a=(0,o.useRef)(null),[u,f]=(0,o.useState)([]),[p,m]=(0,o.useState)(``),[h,g]=(0,o.useState)(`idle`),[_,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(null),[x,S]=(0,o.useState)([]),[C,w]=(0,o.useState)(`all`),[T,E]=(0,o.useState)(null),[D,O]=(0,o.useState)(null),[k,A]=(0,o.useState)(!1),j=u.map(e=>({value:e.modulename,label:e.modulename})),M=Zj(x),N=h===`encoding`||h===`validating`,P=!!p&&!N,F=qj[h]??0,I=x.find(e=>e.row_status===`invalid`)?.id,L=(0,o.useCallback)(()=>{m(``),g(`idle`),v(!1),b(null),S([]),w(`all`),E(null),O(null),i.current&&(i.current.value=``)},[]);(0,o.useEffect)(()=>{async function e(){try{let e=await Vy({project:r?.name??``,activeOnly:!0});f(e?.items??[])}catch(e){console.error(e),s.message.error(`Unable to load modules.`)}}e()},[r?.name]);let R=e=>{m(e??``),S([]),O(null),E(null),b(null),A(!1),g(e?`module_set`:`idle`)},z=async e=>{if(!e||!P)return;let t=e.name.split(`.`).pop()?.toLowerCase();if(![`xlsx`,`csv`].includes(t)){g(`module_set`),E({message:`Invalid file type. Please upload an Excel .xlsx or CSV .csv file.`});return}if(e.size>Uj){g(`module_set`),E({message:`File must be 10 MB or smaller.`});return}E(null),S([]),O(null),b({name:e.name,size:e.size}),g(`encoding`);try{let n=await Yj(e);g(`validating`);let i=await Iy({filename:e.name,project:r?.name??``,module:p,file_base64:n,file_type:t});S(i?.rows??[]),w(`all`),g(`preview`)}catch(e){console.error(e),E(e.payload??{code:`NETWORK_ERROR`,message:e.message||`Could not reach the server.`}),g(`error`)}},B=async()=>{try{let e=await fetch(Wj);if(!e.ok)throw Error(`Template file not found (${e.status})`);let t=(await e.text()).trim(),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e+=1)r[e]=n.charCodeAt(e);let i=new Blob([r],{type:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=Gj,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a),s.message.success(`Sample template downloaded.`)}catch(e){console.error(e),s.message.error(`Unable to download sample template.`)}},V=async()=>{g(`inserting`),E(null);try{let t=await Ly({project:r?.name??``,module:p,uploaded_by:localStorage.getItem(`user_Email`)??``,rows:Xj(x)});O(t),g(`done`),s.message.success(`Bulk upload saved. Redirecting to view test cases...`),window.setTimeout(()=>e(`/viewTestCase`),900)}catch(e){console.error(e),E(e.payload??{code:`NETWORK_ERROR`,message:e.message||`Could not reach the server.`}),g(`preview`)}},H=(0,o.useCallback)(()=>{a.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[]),U=[`bulk-dropzone`,_?`bulk-dropzone-dragging`:``,y?`bulk-dropzone-has-file`:``,T&&h!==`preview`?`bulk-dropzone-error`:``,p?``:`bulk-dropzone-disabled`].filter(Boolean).join(` `);return(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:Jj})}),r?.name&&(0,l.jsx)(s.Col,{children:(0,l.jsx)(Vj,{strong:!0,children:r.name})})]}),(0,l.jsxs)(`div`,{className:`zt-page zt-page-wide bulk-page`,children:[(0,l.jsxs)(`div`,{className:`bulk-header`,children:[(0,l.jsx)(Hj,{level:3,children:`Bulk upload test cases`}),(0,l.jsxs)(s.Space,{direction:`vertical`,size:4,children:[(0,l.jsx)(Vj,{type:`secondary`,children:Kj}),(0,l.jsx)(Vj,{type:`secondary`,children:`Use the sample template for the required columns. Uploaded rows are saved as Active by default.`})]})]}),(0,l.jsx)(`div`,{className:`bulk-stepbar`,children:[`Select`,`Upload`,`Validate`,`Save`].map((e,t)=>(0,l.jsxs)(`span`,{className:t<F?`bulk-step-active`:``,children:[t+1,` `,e]},e))}),(0,l.jsx)(s.Card,{className:`v1-card zt-fall`,title:`1. Module selector`,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,optionFilterProp:`label`,className:`bulk-module-select`,placeholder:`Choose a module`,options:j,value:p||void 0,onChange:R})}),p&&(0,l.jsxs)(s.Card,{className:`v1-card zt-fall`,title:`2. File upload`,extra:(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.DownloadOutlined,{}),onClick:B,children:`Download Sample Template`}),children:[(0,l.jsx)(s.Alert,{type:`info`,showIcon:!0,message:`First time uploading?`,description:`Download the sample template, keep the column names unchanged, fill your test steps, and upload either .xlsx or .csv.`,className:`bulk-inline-alert`}),(0,l.jsxs)(`button`,{type:`button`,className:U,disabled:!P,onClick:()=>i.current?.click(),onDragOver:e=>{e.preventDefault(),P&&v(!0)},onDragLeave:()=>v(!1),onDrop:e=>{e.preventDefault(),v(!1),z(e.dataTransfer.files?.[0])},children:[(0,l.jsx)(c.CloudUploadOutlined,{className:`bulk-upload-icon`}),y?(0,l.jsxs)(`span`,{className:`bulk-file-chip`,children:[y.name,` - `,Math.ceil(y.size/1024),` KB`]}):(0,l.jsx)(`span`,{children:`Drag & drop here, or click to browse`})]}),(0,l.jsx)(`input`,{ref:i,hidden:!0,type:`file`,accept:`.xlsx,.csv`,onChange:e=>z(e.target.files?.[0])}),N&&(0,l.jsx)(s.Progress,{percent:h===`encoding`?45:82,showInfo:!1,size:`small`}),T&&h!==`preview`&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:T.message,className:`bulk-inline-alert`})]}),x.length>0&&(0,l.jsxs)(s.Card,{className:`v1-card zt-fall`,title:`3. Validation result`,children:[(0,l.jsx)($j,{errors:M,expanded:k,onToggle:()=>A(e=>!e),onSummaryClick:H}),T&&h===`preview`&&(0,l.jsx)(s.Alert,{type:`error`,showIcon:!0,message:T.message,className:`bulk-inline-alert`}),(0,l.jsx)(eM,{rows:x,view:C,onViewChange:w,onConfirm:V,onReset:L,saving:h===`inserting`,firstInvalidRowId:I,firstInvalidRowRef:a})]}),D&&h===`done`&&(0,l.jsxs)(s.Card,{className:`v1-card zt-fall`,title:`4. Upload complete`,children:[(0,l.jsxs)(s.Row,{gutter:[16,16],className:`bulk-metrics`,children:[(0,l.jsx)(s.Col,{xs:24,md:8,children:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Vj,{children:`Total`}),(0,l.jsx)(`strong`,{children:x.length})]})}),(0,l.jsx)(s.Col,{xs:24,md:8,children:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Vj,{children:`Inserted`}),(0,l.jsx)(`strong`,{children:D.inserted??0})]})}),(0,l.jsx)(s.Col,{xs:24,md:8,children:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(Vj,{children:`Failed`}),(0,l.jsx)(`strong`,{children:D.failed??0})]})})]}),(0,l.jsx)(s.Alert,{type:`success`,showIcon:!0,icon:(0,l.jsx)(c.CheckCircleOutlined,{}),message:`${D.inserted??0} test cases saved to database - module: ${p}`,className:`bulk-inline-alert`}),(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.ReloadOutlined,{}),onClick:L,children:`Upload another file`})]})]})]})}var nM=[{value:`navigate`,label:`Navigate`},{value:`fill`,label:`Fill`},{value:`click`,label:`Click`},{value:`select`,label:`Select`},{value:`press_key`,label:`Press Key`},{value:`type_and_select`,label:`Type and Select`},{value:`type_and_select_modal`,label:`Type and Select (Modal)`},{value:`upload_file`,label:`Upload File`},{value:`check_checkbox`,label:`Check Checkbox`},{value:`check_filter_checkbox`,label:`Check Filter Checkbox`},{value:`select_page_size`,label:`Select Page Size`},{value:`check_n_checkboxes`,label:`Check N Checkboxes`},{value:`store_text`,label:`Store Text`},{value:`reset_session`,label:`Reset Session`},{value:`switch_to_new_tab`,label:`Switch To New Tab`},{value:`close_tab`,label:`Close Tab`},{value:`assert_visible`,label:`Assert Visible`},{value:`assert_hidden`,label:`Assert Hidden`},{value:`assert_text`,label:`Assert Text`},{value:`assert_url`,label:`Assert URL`},{value:`assert_body_contains`,label:`Assert Body Contains`},{value:`assert_button_disabled`,label:`Assert Button Disabled`},{value:`assert_field_error`,label:`Assert Field Error`},{value:`assert_field_accepted`,label:`Assert Field Accepted`},{value:`assert_children_disabled`,label:`Assert Children Disabled`},{value:`assert_children_visible`,label:`Assert Children Visible`},{value:`assert_element_count`,label:`Assert Element Count`},{value:`assert_toast`,label:`Assert Toast`},{value:`assert_toast_success`,label:`Assert Toast Success`},{value:`assert_toast_error`,label:`Assert Toast Error`},{value:`wait_for_visible`,label:`Wait For Visible`},{value:`wait_for_hidden`,label:`Wait For Hidden`},{value:`wait_for_text`,label:`Wait For Text`}],{Text:rM}=s.Typography,iM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/test-cases`}],aM={tags:`regression`,active:1},oM={module:{dbName:`Modules`,formField:`module`,label:`Module`}};function sM(e=[]){return e.map(e=>({value:e,label:e}))}function cM(e=``){return String(e??``).trim()}function lM(e=``){return cM(e).toLowerCase()}function uM(e=[]){let t=new Map;return e.forEach(e=>{let n=cM(e?.flow),r=n.toLowerCase();n&&!t.has(r)&&t.set(r,n)}),Array.from(t.values()).map(e=>({value:e,label:e}))}function dM(e=[],t,n){let r=cM(t).toLowerCase(),i=cM(n).toLowerCase();return e.reduce((e,t)=>{let n=cM(t?.module).toLowerCase(),a=cM(t?.flow).toLowerCase();if(n!==r||a!==i)return e;let o=Number(t?.step_order)||0;return Math.max(e,o)},0)+1}function fM({icon:e,title:t}){return(0,l.jsxs)(s.Space,{size:10,align:`center`,children:[(0,l.jsx)(`div`,{className:`v1-section-icon-box`,children:e}),(0,l.jsx)(rM,{strong:!0,className:`v1-section-label`,children:t})]})}function pM(){let[e]=s.Form.useForm(),[t]=s.Form.useForm(),[r,i]=(0,o.useState)([]),[a,u]=(0,o.useState)([]),[f,p]=(0,o.useState)([]),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)({open:!1,typeKey:`module`}),[b,x]=(0,o.useState)(!1),[S,C]=(0,o.useState)(!1),[w,T]=(0,o.useState)(!1),E=(0,d.useNavigate)(),D=oM[v.typeKey],O=(0,o.useMemo)(()=>sM(r),[r]),k=s.Form.useWatch(`module`,e),A=s.Form.useWatch(`flow`,e),j=!!cM(k),M=!!cM(A),N=!j,P=!j||!M,F=(e,t=[])=>{e===`module`&&i(t)},I=async()=>{h(!0);try{let e=await jy(oM.module.dbName);i(e?.items??[])}catch(e){console.error(`Unable to load testing options:`,e),s.message.error(`Unable to load testing options.`)}finally{h(!1)}},L=(0,o.useCallback)(async t=>{let n=cM(t);if(u([]),p([]),e.setFieldsValue({step_order:void 0}),n){_(!0);try{let e=await Fy({limit:1e4,offset:0,module:n}),t=Array.isArray(e?.items)?e.items:[];u(t),p(uM(t))}catch(e){console.error(`Unable to load flows:`,e),s.message.error(`Unable to load flows.`)}finally{_(!1)}}},[e]),R=(0,o.useCallback)(async(t,n,r)=>{let i=cM(t),a=cM(n);if(!i||!a){e.setFieldsValue({step_order:void 0});return}C(!0);try{e.setFieldsValue({step_order:dM(r,i,a)})}catch(e){console.error(`Unable to load step order:`,e),s.message.error(`Unable to load step order.`)}finally{C(!1)}},[e]);(0,o.useEffect)(()=>{Promise.resolve().then(I)},[]),(0,o.useEffect)(()=>{Promise.resolve().then(()=>L(k))},[L,k]),(0,o.useEffect)(()=>{Promise.resolve().then(()=>R(k,A,a))},[a,R,A,k]);let z=async t=>{let n={module:cM(t.module),flow:cM(t.flow),step_order:Number(t.step_order),description:cM(t.description),keyword:lM(t.keyword),target:cM(t.target),value:cM(t.value),expected:cM(t.expected),tags:t.tags?cM(t.tags):aM.tags,active:Number(t.active)};T(!0);try{await Py(n),s.message.success(`Test case details saved successfully.`),e.resetFields(),u([]),p([])}catch(e){console.error(`Unable to save test case:`,e),s.message.error(`Unable to save test case.`)}finally{T(!1)}},B=(t,n)=>{e.setFieldsValue({[t]:cM(n)})},V=t=>{e.setFieldsValue({module:cM(t),flow:void 0,step_order:void 0,keyword:void 0,description:void 0,target:void 0,tags:aM.tags,value:void 0,expected:void 0})},H=t=>{e.setFieldsValue({flow:cM(t),step_order:void 0})},U=e=>{let n=oM[e];y({open:!0,typeKey:e}),t.setFieldsValue({name:``,type:n.label})},ee=()=>{y(e=>({...e,open:!1})),t.resetFields()},te=async()=>{try{let n=cM((await t.validateFields()).name),r=await My({name:n,type:D.dbName});F(v.typeKey,r?.items??[]),e.setFieldsValue({[D.formField]:n}),s.message.success(`${D.label} added successfully.`),ee()}catch(e){if(e?.errorFields)return;console.error(`Unable to save testing option:`,e),s.message.error(`Unable to add ${D.label.toLowerCase()}.`)}finally{x(!1)}};return(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:iM})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`link`,onClick:()=>E(`/zinnext-home`),children:`View Table`})})]}),(0,l.jsx)(`div`,{className:`v1-page`,children:(0,l.jsxs)(`div`,{className:`v1-page-inner`,children:[(0,l.jsx)(`div`,{className:`v1-page-header`,children:(0,l.jsxs)(s.Space,{align:`center`,size:10,children:[(0,l.jsx)(c.ProfileOutlined,{className:`v1-outer-icon`}),(0,l.jsx)(`div`,{children:(0,l.jsx)(rM,{strong:!0,style:{fontSize:16},children:`Add Test Case`})})]})}),(0,l.jsx)(Z,{children:(0,l.jsxs)(s.Form,{form:e,className:`v1-form`,layout:`vertical`,colon:!1,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),initialValues:aM,onFinish:z,autoComplete:`off`,children:[(0,l.jsx)(s.Card,{className:`v1-card`,title:(0,l.jsx)(fM,{icon:(0,l.jsx)(c.FileTextOutlined,{}),title:`Test Case Details`}),extra:(0,l.jsx)(rM,{type:`secondary`,className:`v1-card-subtitle`,children:`Module, flow, step order and execution data`}),children:(0,l.jsxs)(s.Row,{gutter:[24,0],children:[(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsxs)(s.Space.Compact,{style:{width:`100%`},children:[(0,l.jsx)(s.Form.Item,{label:`Module`,name:`module`,style:{flex:1},children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,loading:m,optionFilterProp:`label`,placeholder:`Select module`,options:O,onChange:V})}),(0,l.jsx)(s.Button,{"aria-label":`Add module`,icon:(0,l.jsx)(c.PlusOutlined,{}),style:{marginTop:30},onClick:()=>U(`module`)})]})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Flow`,name:`flow`,children:(0,l.jsx)(s.AutoComplete,{maxLength:100,allowClear:!0,disabled:N,options:f,placeholder:g?`Loading flows`:`Enter flow`,onChange:H,filterOption:(e,t)=>t?.value?.toLowerCase().includes(e.toLowerCase())})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Step Order`,name:`step_order`,validateTrigger:[`onBlur`,`onChange`],children:(0,l.jsx)(s.Input,{maxLength:10,disabled:!0,placeholder:S?`Loading step order`:`Step order`})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Action`,name:`keyword`,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,disabled:P,optionFilterProp:`label`,placeholder:`Select action`,options:nM,onChange:t=>e.setFieldsValue({keyword:lM(t)})})})}),(0,l.jsx)(s.Col,{xs:24,children:(0,l.jsx)(s.Form.Item,{label:`Description`,name:`description`,children:(0,l.jsx)(s.Input.TextArea,{rows:3,maxLength:255,disabled:P,placeholder:`Enter description`,showCount:!0,onBlur:e=>B(`description`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Key`,name:`target`,children:(0,l.jsx)(s.Input,{maxLength:255,disabled:P,placeholder:`Enter target`,onBlur:e=>B(`target`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Tags`,name:`tags`,children:(0,l.jsx)(s.Input,{maxLength:200,disabled:P,placeholder:`Enter tags`,prefix:(0,l.jsx)(c.TagsOutlined,{className:`v1-input-icon`}),onBlur:e=>B(`tags`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Value`,name:`value`,children:(0,l.jsx)(s.Input.TextArea,{rows:4,disabled:P,placeholder:`Enter value`,onBlur:e=>B(`value`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Expected`,name:`expected`,children:(0,l.jsx)(s.Input.TextArea,{rows:4,disabled:P,placeholder:`Enter expected result`,onBlur:e=>B(`expected`,e.target.value)})})})]})}),(0,l.jsx)(`div`,{className:`v1-form-actions`,children:(0,l.jsx)(s.Form.Item,{children:(0,l.jsxs)(s.Space,{children:[(0,l.jsx)(s.Button,{type:`primary`,htmlType:`submit`,loading:w,disabled:P,children:`Submit`}),(0,l.jsx)(s.Button,{onClick:()=>{e.resetFields(),u([]),p([])},children:`Reset`})]})})})]})}),(0,l.jsx)(s.Modal,{title:`Add ${D.label}`,open:v.open,confirmLoading:b,okText:`Add`,onCancel:ee,onOk:()=>{x(!0),te()},destroyOnHidden:!0,children:(0,l.jsxs)(s.Form,{form:t,layout:`vertical`,colon:!1,className:`v1-form`,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),children:[(0,l.jsx)(s.Form.Item,{label:`Name`,name:`name`,children:(0,l.jsx)(s.Input,{maxLength:100,placeholder:`Enter ${D.label.toLowerCase()} name`,onBlur:e=>{t.setFieldsValue({name:cM(e.target.value)})}})}),(0,l.jsx)(s.Form.Item,{label:`Type`,name:`type`,children:(0,l.jsx)(s.Input,{disabled:!0})})]})})]})})]})}var{Text:mM}=s.Typography,hM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/addTestCase`}];function gM(e=``){return String(e??``).trim()}function _M(e=[],t){return e.map(e=>({value:e.id,label:e[t]}))}var vM=[{label:`Step`,value:`step_order`,width:70},{label:`Action`,value:`actions`,width:140},{label:`Key`,value:`key`,width:160,ellipsis:!0},{label:`Value`,value:`value`,ellipsis:!0},{label:`Description`,value:`description`,ellipsis:!0},{label:`Scenario`,value:`scenario`,width:110,render:e=>e===1?(0,l.jsx)(s.Tag,{color:`green`,children:`Positive`}):(0,l.jsx)(s.Tag,{color:`red`,children:`Negative`})}],yM={key:!1,value:!1,expected:!1};function bM(e,t){return t?e[t]??yM:yM}function xM(e,t){e.setFields(t.map(e=>({name:e,errors:[]})))}function SM(){let[e]=s.Form.useForm(),r=(0,d.useNavigate)(),[i]=(0,d.useSearchParams)(),a=i.get(`edit`),u=!!a,f=(0,o.useMemo)(()=>t.l(),[]),[p,m]=(0,o.useState)([]),[h,g]=(0,o.useState)([]),[_,v]=(0,o.useState)([]),[y,b]=(0,o.useState)(nM),[x,S]=(0,o.useState)({}),[C,w]=(0,o.useState)(!1),[T,E]=(0,o.useState)(!1),[D,O]=(0,o.useState)(!1),[k,A]=(0,o.useState)(!1),[j,M]=(0,o.useState)(!1),N=s.Form.useWatch(`module`,e),P=s.Form.useWatch(`submodule`,e),F=s.Form.useWatch(`actions`,e),I=!!N,L=!!P,R=(0,o.useMemo)(()=>bM(x,F),[x,F]),z=(0,o.useMemo)(()=>_M(p,`modulename`),[p]),B=(0,o.useMemo)(()=>_M(h,`submodulename`),[h]),V=(0,o.useMemo)(()=>p.find(e=>e.id===N)?.modulename??``,[p,N]),H=(0,o.useMemo)(()=>h.find(e=>e.id===P)?.submodulename??``,[P,h]),U=(0,o.useCallback)(async()=>{try{let e=await Ny();Array.isArray(e?.options)&&e.options.length>0&&b(e.options),e?.rules&&typeof e.rules==`object`&&S(e.rules)}catch(e){console.error(`Unable to load action field rules:`,e),s.message.error(`Unable to load action validation rules.`)}},[]),ee=(0,o.useCallback)(async e=>{if(!e){m([]);return}w(!0);try{let t=await Vy({project:e,activeOnly:!0});m(t?.items??[])}catch(e){console.error(`Unable to load modules:`,e),s.message.error(`Unable to load modules.`)}finally{w(!1)}},[]),te=(0,o.useCallback)(async(e,t)=>{if(!e||!t){g([]);return}E(!0);try{let n=await Wy({project:e,module:t,activeOnly:!0});g(n?.items??[])}catch(e){console.error(`Unable to load submodules:`,e),s.message.error(`Unable to load submodules.`)}finally{E(!1)}},[]),ne=(0,o.useCallback)(async(t,n,r,i=``)=>{if(!t||!n||!r){v([]),e.setFieldsValue({step_order:void 0});return}O(!0);try{let[a,o]=await Promise.all([qy({product_parent_ID:t,module_parent_ID:n,submodule_parent_ID:r,actions:i,limit:1e3}),Xy({product_parent_ID:t,module_parent_ID:n,submodule_parent_ID:r})]);v(a?.items??[]),e.setFieldsValue({step_order:o?.step_order??1})}catch(e){console.error(`Unable to load flows:`,e),s.message.error(`Unable to load flows.`)}finally{O(!1)}},[e]),re=(0,o.useCallback)(async(e=``)=>{if(!(!f?.id||!N||!P)){O(!0);try{let t=await qy({product_parent_ID:f.id,module_parent_ID:N,submodule_parent_ID:P,actions:e,limit:1e3});v(t?.items??[])}catch(e){console.error(`Unable to load action flows:`,e),s.message.error(`Unable to load action steps.`)}finally{O(!1)}}},[f?.id,N,P]),ie=(0,o.useCallback)(async()=>{if(!(!a||!f?.name)){M(!0);try{let t=await Yy(a);await te(f.name,t.module);let n=await qy({product_parent_ID:t.product_parent_ID,module_parent_ID:t.module_parent_ID,submodule_parent_ID:t.submodule_parent_ID,limit:1e3});v(n?.items??[]),e.setFieldsValue({module:t.module_parent_ID,submodule:t.submodule_parent_ID,step_order:t.step_order,actions:t.actions,key:t.key,value:t.value,expected:t.expected,description:t.description,scenario:t.scenario===1,active:Number(t.active)!==0})}catch(e){console.error(`Unable to load test flow:`,e),s.message.error(`Unable to load test flow for edit.`),r(`/viewTestCase`)}finally{M(!1)}}},[a,e,te,r,f?.name]);return(0,o.useEffect)(()=>{if(!f){r(`/select-project`,{replace:!0});return}Promise.resolve().then(async()=>{await U(),await ee(f.name),a&&await ie()})},[f,r,U,ee,a,ie]),f?(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:hM})}),(0,l.jsx)(s.Col,{children:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.ProjectOutlined,{}),(0,l.jsx)(mM,{strong:!0,children:f.name})]})})]}),(0,l.jsx)(`div`,{className:`zt-page`,children:(0,l.jsxs)(s.Form,{form:e,layout:`vertical`,colon:!1,className:`v1-form`,initialValues:{scenario:!0,active:!0},onFinish:async t=>{let n={product_parent_ID:Number(f?.id),module_parent_ID:Number(t.module),submodule_parent_ID:Number(t.submodule),description:gM(t.description),actions:gM(t.actions),key:gM(t.key),value:gM(t.value),expected:gM(t.expected),scenario:+!!t.scenario,active:+!!t.active};A(!0);try{if(u){await Zy(a,{...n,step_order:Number(t.step_order)}),s.message.success(`Test case updated successfully.`),r(`/viewTestCase`);return}await Jy(n),s.message.success(`Step saved (#${t.step_order}).`),e.setFieldsValue({actions:void 0,key:void 0,value:void 0,expected:void 0,description:void 0}),await ne(n.product_parent_ID,n.module_parent_ID,n.submodule_parent_ID)}catch(e){console.error(`Unable to save test case:`,e),s.message.error(u?`Unable to update test case.`:`Unable to save step.`)}finally{A(!1)}},autoComplete:`off`,disabled:j,children:[(0,l.jsx)(s.Card,{className:`v1-card zt-fall`,title:(0,l.jsxs)(s.Space,{size:8,className:`zt-section-title`,children:[(0,l.jsx)(`span`,{className:`zt-step-tag`,children:`1`}),(0,l.jsx)(`span`,{children:`Module & Submodule`})]}),children:(0,l.jsxs)(s.Row,{gutter:[24,0],align:`bottom`,children:[(0,l.jsx)(s.Col,{xs:24,md:6,children:(0,l.jsx)(s.Form.Item,{label:`Module`,name:`module`,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,optionFilterProp:`label`,loading:C,placeholder:`Select module`,options:z,onChange:t=>{let n=p.find(e=>e.id===t)?.modulename??``;e.setFieldsValue({module:t,submodule:void 0,step_order:void 0,actions:void 0,key:void 0,value:void 0,expected:void 0}),xM(e,[`actions`,`key`,`value`,`expected`]),g([]),v([]),te(f?.name,n)}})})}),(0,l.jsx)(s.Col,{xs:24,md:6,children:(0,l.jsx)(s.Form.Item,{label:`Submodule`,name:`submodule`,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,optionFilterProp:`label`,disabled:!I,loading:T,placeholder:I?`Select submodule`:`Select module first`,options:B,onChange:t=>{e.setFieldsValue({submodule:t,actions:void 0,key:void 0,value:void 0,expected:void 0}),xM(e,[`actions`,`key`,`value`,`expected`]),ne(f?.id,N,t)}})})}),(0,l.jsx)(s.Col,{xs:24,md:6,children:(0,l.jsx)(s.Form.Item,{label:`Scenario`,name:`scenario`,valuePropName:`checked`,children:(0,l.jsx)(s.Switch,{disabled:!L,checkedChildren:`Positive`,unCheckedChildren:`Negative`})})}),(0,l.jsx)(s.Col,{xs:24,md:6,children:(0,l.jsx)(s.Form.Item,{label:`Active`,name:`active`,valuePropName:`checked`,children:(0,l.jsx)(s.Switch,{checkedChildren:`Active`,unCheckedChildren:`Inactive`})})})]})}),L&&(0,l.jsxs)(s.Card,{className:`v1-card zt-fall`,title:(0,l.jsxs)(s.Space,{size:8,className:`zt-section-title`,children:[(0,l.jsx)(`span`,{className:`zt-step-tag`,children:`2`}),(0,l.jsx)(c.FileTextOutlined,{}),(0,l.jsx)(`span`,{children:`Step Details`})]}),extra:(0,l.jsxs)(mM,{type:`secondary`,children:[V,` / `,H]}),children:[(0,l.jsxs)(s.Row,{gutter:[24,0],children:[(0,l.jsx)(s.Col,{xs:24,md:6,children:(0,l.jsx)(s.Form.Item,{label:`Step Order`,name:`step_order`,children:(0,l.jsx)(s.Input,{disabled:!0,placeholder:D?`Loading…`:`Auto`})})}),(0,l.jsx)(s.Col,{xs:24,md:18,children:(0,l.jsx)(s.Form.Item,{label:`Action`,name:`actions`,rules:[{required:!0,message:`Mandatory Field`}],children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,optionFilterProp:`label`,placeholder:`Select action`,options:y,onChange:t=>{let n=bM(x,t);e.setFieldsValue({actions:t,key:n.key?e.getFieldValue(`key`):void 0,value:n.value?e.getFieldValue(`value`):void 0,expected:n.expected?e.getFieldValue(`expected`):void 0}),xM(e,[`key`,`value`,`expected`]),re(t||``)}})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Key`,name:`key`,rules:[{required:R.key,message:`Key is required for this action`}],children:(0,l.jsx)(s.Input,{maxLength:255,disabled:F&&!R.key,placeholder:F?R.key?`Required — Enter selector / locator`:`Not needed for this action`:`Select an action first`})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Value`,name:`value`,rules:[{required:R.value,message:`Value is required for this action`}],children:(0,l.jsx)(s.Input.TextArea,{rows:1,autoSize:{minRows:1,maxRows:4},disabled:F&&!R.value,placeholder:F?R.value?`Required — Enter value`:`Not needed for this action`:`Select an action first`})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Expected`,name:`expected`,rules:[{required:R.expected,message:`Expected result is required for this action`}],children:(0,l.jsx)(s.Input.TextArea,{rows:2,disabled:F&&!R.expected,placeholder:F?R.expected?`Required — Enter expected result`:`Not needed for this action`:`Select an action first`})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Description`,name:`description`,children:(0,l.jsx)(s.Input.TextArea,{rows:2,maxLength:255,showCount:!0,placeholder:`Enter description`})})})]}),(0,l.jsxs)(s.Space,{className:`zt-actions`,children:[(0,l.jsx)(s.Button,{onClick:()=>{if(u){r(`/viewTestCase`);return}e.resetFields(),g([]),v([]),E(!1),O(!1)},children:`Cancel`}),(0,l.jsx)(s.Button,{type:`primary`,htmlType:`submit`,loading:k||j,children:u?`Update Test Case`:`Save & Continue`})]})]},`${N}-${P}`),L&&(0,l.jsx)(s.Card,{className:`v1-card zt-fall`,title:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.TableOutlined,{}),(0,l.jsx)(`span`,{children:`Added Steps`})]}),extra:(0,l.jsx)(s.Tag,{children:F?`${_.length} ${F} step(s)`:`${_.length} step(s)`}),children:(0,l.jsx)(vm,{listName:`Added Steps`,loading:D,fields:vM,dataSource:_,current:1,pageSize:Math.max(_.length,1),total:_.length,rowSelection:!1,className:`zt-list-plain zt-list-static`})})]})})]}):null}var{Text:CM}=s.Typography,wM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/addTestCase`},{label:`Manage Modules`,href:`/manageModules`}];function TM(){let e=(0,d.useNavigate)(),r=(0,o.useMemo)(()=>t.l(),[]),[i,a]=(0,o.useState)([]),[u,f]=(0,o.useState)({}),[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(``),[y,b]=(0,o.useState)(!1),[x,S]=(0,o.useState)(1),[C,w]=(0,o.useState)(10),T=(0,o.useCallback)(async e=>{if(!e){a([]);return}m(!0);try{let[t,n]=await Promise.all([Vy({project:e}),Wy({project:e})]);a(t?.items??[]);let r={};(n?.items??[]).forEach(e=>{let t=e.modulename;r[t]=(r[t]??0)+1}),f(r)}catch(e){console.error(e),s.message.error(`Unable to load modules.`)}finally{m(!1)}},[]);(0,o.useEffect)(()=>{if(!r){e(`/select-project`,{replace:!0});return}Promise.resolve().then(()=>T(r.name))},[r,e,T]);let E=async(e,t)=>{try{await Uy(e.id,+!!t),a(n=>n.map(n=>n.id===e.id?{...n,active:+!!t}:n)),s.message.success(`Module ${t?`activated`:`deactivated`}.`)}catch(e){console.error(e),s.message.error(`Unable to update module status.`)}},D=async()=>{let e=_.trim();if(!e){s.message.warning(`Enter a module name.`);return}b(!0);try{await Hy({project:r.name,modulename:e}),s.message.success(`Module added.`),g(!1),v(``),S(1),T(r.name)}catch(e){console.error(e),s.message.error(`Unable to add module (maybe it already exists).`)}finally{b(!1)}},O=t=>{e(`/test-cases/zinnext/submodules?module=${encodeURIComponent(t.modulename)}`)};return r?(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:wM})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`link`,onClick:()=>e(`/addTestCase`),children:`Back to Form`})})]}),(0,l.jsxs)(`div`,{className:`zt-page`,children:[(0,l.jsx)(s.Card,{className:`v1-card zt-bar`,children:(0,l.jsxs)(s.Row,{gutter:[16,16],align:`middle`,justify:`space-between`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.ProjectOutlined,{}),(0,l.jsx)(`span`,{children:`Project:`}),(0,l.jsx)(CM,{strong:!0,children:r.name})]})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`primary`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>g(!0),children:`Add Module`})})]})}),(0,l.jsx)(s.Card,{className:`v1-card zt-fall`,title:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.AppstoreOutlined,{}),(0,l.jsx)(`span`,{children:`Modules`})]}),children:(0,l.jsx)(vm,{listName:`Modules`,loading:p,fields:[{label:`Module`,value:`modulename`},{label:`Submodules`,value:`submoduleCount`,width:140,render:(e,t)=>(0,l.jsxs)(s.Button,{type:`link`,className:`zt-count-link`,onClick:()=>O(t),children:[u[t.modulename]??0,` submodule(s)`]})},{label:`Active`,value:`active`,width:120,render:(e,t)=>(0,l.jsx)(s.Switch,{checked:e===1,checkedChildren:`On`,unCheckedChildren:`Off`,onChange:e=>E(t,e)})}],dataSource:i,current:x,pageSize:C,total:i.length,onPageChange:S,onPageSizeChange:e=>{S(1),w(e)},rowSelection:!1,className:`zt-list-plain`})})]}),(0,l.jsx)(s.Modal,{title:`Add Module`,open:h,confirmLoading:y,okText:`Add`,onOk:D,onCancel:()=>{g(!1),v(``)},destroyOnHidden:!0,children:(0,l.jsxs)(s.Space,{direction:`vertical`,className:`zt-modal-stack`,children:[(0,l.jsxs)(CM,{type:`secondary`,children:[`Project: `,(0,l.jsx)(`b`,{children:r.name})]}),(0,l.jsx)(s.Input,{placeholder:`Enter module name`,maxLength:100,value:_,onChange:e=>v(e.target.value),onPressEnter:D})]})})]}):null}var{Text:EM}=s.Typography,DM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/addTestCase`},{label:`Manage Modules`,href:`/manageModules`},{label:`Manage Submodules`,href:`/test-cases/zinnext/submodules`}];function OM(){let e=(0,d.useNavigate)(),[r]=(0,d.useSearchParams)(),i=(0,o.useMemo)(()=>t.l(),[]),a=r.get(`module`)??``,[u,f]=(0,o.useState)([]),[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(``),[y,b]=(0,o.useState)(!1),[x,S]=(0,o.useState)(1),[C,w]=(0,o.useState)(10),T=(0,o.useCallback)(async(e,t)=>{if(!e||!t){f([]);return}m(!0);try{let n=await Wy({project:e,module:t});f(n?.items??[])}catch(e){console.error(e),s.message.error(`Unable to load submodules.`)}finally{m(!1)}},[]);(0,o.useEffect)(()=>{if(!i){e(`/select-project`,{replace:!0});return}if(!a){e(`/manageModules`,{replace:!0});return}Promise.resolve().then(()=>T(i.name,a))},[i,a,e,T]);let E=async(e,t)=>{try{await Ky(e.id,+!!t),f(n=>n.map(n=>n.id===e.id?{...n,active:+!!t}:n)),s.message.success(`Submodule ${t?`activated`:`deactivated`}.`)}catch(e){console.error(e),s.message.error(`Unable to update submodule status.`)}},D=async()=>{let e=_.trim();if(!e){s.message.warning(`Enter a submodule name.`);return}b(!0);try{await Gy({project:i.name,modulename:a,submodulename:e}),s.message.success(`Submodule added.`),g(!1),v(``),S(1),T(i.name,a)}catch(e){console.error(e),s.message.error(`Unable to add submodule (maybe it already exists).`)}finally{b(!1)}};return!i||!a?null:(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:DM})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`link`,onClick:()=>e(`/manageModules`),children:`Back to Modules`})})]}),(0,l.jsxs)(`div`,{className:`zt-page`,children:[(0,l.jsx)(s.Card,{className:`v1-card zt-bar`,children:(0,l.jsxs)(s.Row,{gutter:[16,16],align:`middle`,justify:`space-between`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsxs)(s.Space,{size:16,wrap:!0,className:`zt-section-title`,children:[(0,l.jsxs)(s.Space,{size:6,children:[(0,l.jsx)(c.ProjectOutlined,{}),(0,l.jsx)(`span`,{children:`Project:`}),(0,l.jsx)(EM,{strong:!0,children:i.name})]}),(0,l.jsxs)(s.Space,{size:6,children:[(0,l.jsx)(c.AppstoreOutlined,{}),(0,l.jsx)(`span`,{children:`Module:`}),(0,l.jsx)(EM,{strong:!0,children:a})]})]})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`primary`,icon:(0,l.jsx)(c.PlusOutlined,{}),onClick:()=>g(!0),children:`Add Submodule`})})]})}),(0,l.jsx)(s.Card,{className:`v1-card zt-fall`,title:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.AppstoreOutlined,{}),(0,l.jsx)(`span`,{children:`Submodules`})]}),children:(0,l.jsx)(vm,{listName:`Submodules`,loading:p,fields:[{label:`Submodule`,value:`submodulename`},{label:`Active`,value:`active`,width:120,render:(e,t)=>(0,l.jsx)(s.Switch,{checked:e===1,checkedChildren:`On`,unCheckedChildren:`Off`,onChange:e=>E(t,e)})}],dataSource:u,current:x,pageSize:C,total:u.length,onPageChange:S,onPageSizeChange:e=>{S(1),w(e)},rowSelection:!1,className:`zt-list-plain`})})]}),(0,l.jsx)(s.Modal,{title:`Add Submodule`,open:h,confirmLoading:y,okText:`Add`,onOk:D,onCancel:()=>{g(!1),v(``)},destroyOnHidden:!0,children:(0,l.jsxs)(s.Space,{direction:`vertical`,className:`zt-modal-stack`,children:[(0,l.jsxs)(EM,{type:`secondary`,children:[`Project: `,(0,l.jsx)(`b`,{children:i.name}),` \xA0|\xA0 Module: `,(0,l.jsx)(`b`,{children:a})]}),(0,l.jsx)(s.Input,{placeholder:`Enter submodule name`,maxLength:100,value:_,onChange:e=>v(e.target.value),onPressEnter:D})]})})]})}var{Text:kM}=s.Typography,AM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/addTestCase`},{label:`Table`,href:`/viewTestCase`}];function jM(){let e=(0,d.useNavigate)(),[r,i]=(0,o.useState)([]),[a,u]=(0,o.useState)(0),[f,p]=(0,o.useState)(!1),m=(0,o.useMemo)(()=>t.l(),[]),[h,g]=(0,o.useState)(``),[_,v]=(0,o.useState)(1),[y,b]=(0,o.useState)(20),[x,S]=(0,o.useState)(null),C=(0,o.useCallback)(async(e={})=>{p(!0);try{let t=await qy({product_parent_ID:e.project??m?.id??``,search:e.search??h??``,limit:e.pageSize??y,offset:((e.page??_)-1)*(e.pageSize??y)});i(t?.items??[]),u(t?.total??0)}catch(e){console.error(e),s.message.error(`Unable to load test flows.`)}finally{p(!1)}},[m?.id,h,_,y]),w=e=>{s.Modal.confirm({title:`Delete Test Case`,icon:(0,l.jsx)(c.ExclamationCircleOutlined,{}),content:`Are you sure you want to delete this test case?`,okText:`Delete`,okButtonProps:{danger:!0,loading:x===e.id},cancelText:`Cancel`,async onOk(){S(e.id);try{await Qy(e.id),s.message.success(`Test case deleted successfully.`);let t=r.length===1&&_>1?_-1:_;v(t),await C({page:t})}catch(e){throw console.error(`Unable to delete test flow:`,e),s.message.error(`Unable to delete test case.`),e}finally{S(null)}}})};return(0,o.useEffect)(()=>{Promise.resolve().then(()=>{if(!m?.id){e(`/select-project`,{replace:!0});return}C({page:1})})},[]),(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:AM})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`link`,onClick:()=>e(`/addTestCase`),children:`Back to Form`})})]}),(0,l.jsx)(`div`,{className:`zt-page zt-page-wide`,children:(0,l.jsxs)(s.Card,{className:`v1-card`,title:(0,l.jsxs)(s.Space,{size:6,className:`zt-section-title`,children:[(0,l.jsx)(c.TableOutlined,{}),(0,l.jsx)(`span`,{children:`Test Flows`})]}),extra:(0,l.jsxs)(kM,{type:`secondary`,children:[a,` row(s)`]}),children:[(0,l.jsxs)(s.Space,{wrap:!0,className:`zt-toolbar`,children:[(0,l.jsx)(s.Input.Search,{allowClear:!0,className:`zt-search-filter`,placeholder:`Search module / key / description`,value:h,onChange:e=>g(e.target.value),onSearch:()=>{v(1),C({page:1})}}),(0,l.jsx)(s.Button,{icon:(0,l.jsx)(c.ReloadOutlined,{}),onClick:()=>C(),children:`Refresh`})]}),(0,l.jsx)(vm,{listName:`Test Flows`,loading:f,fields:[{label:`Actions`,value:`rowActions`,width:112,fixed:`left`,sorter:!1,render:(t,n)=>(0,l.jsxs)(s.Space,{size:4,className:`zt-row-actions`,children:[(0,l.jsx)(s.Tooltip,{title:`Edit`,children:(0,l.jsx)(s.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(c.EditOutlined,{}),onClick:()=>e(`/addTestCase?edit=${n.id}`)})}),(0,l.jsx)(s.Tooltip,{title:`Delete`,children:(0,l.jsx)(s.Button,{danger:!0,type:`text`,size:`small`,icon:(0,l.jsx)(c.DeleteOutlined,{}),loading:x===n.id,onClick:()=>w(n)})})]})},{label:`ID`,value:`id`,width:70,fixed:`left`},{label:`Project`,value:`project`,width:130},{label:`Module`,value:`module`,width:130},{label:`Submodule`,value:`submodule`,width:140},{label:`Step`,value:`step_order`,width:70},{label:`Action`,value:`actions`,width:140},{label:`Key`,value:`key`,width:160,ellipsis:!0},{label:`Value`,value:`value`,width:200,ellipsis:!0},{label:`Expected`,value:`expected`,width:180,ellipsis:!0},{label:`Description`,value:`description`,width:180,ellipsis:!0},{label:`Scenario`,value:`scenario`,width:110,render:e=>e===1?(0,l.jsx)(s.Tag,{color:`green`,children:`Positive`}):(0,l.jsx)(s.Tag,{color:`red`,children:`Negative`})},{label:`Active`,value:`active`,width:90,render:e=>e===1?(0,l.jsx)(s.Tag,{color:`blue`,children:`Active`}):(0,l.jsx)(s.Tag,{children:`Inactive`})}],dataSource:r,current:_,pageSize:y,total:a,onPageChange:e=>{v(e),C({page:e})},onPageSizeChange:e=>{v(1),b(e),C({page:1,pageSize:e})},rowSelection:!1,className:`zt-list-plain`})]})})]})}var MM=[{label:`Home`,href:`/`},{label:`Test Cases`,href:`/test-cases`}];function NM(){return(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsx)(n.t,{items:MM}),(0,l.jsx)(Lo,{moduleName:`test-flows`,rowKey:`id`})]})}var{Text:PM}=s.Typography,FM=[{label:`Home`,href:`/`},{label:`LMS Cases`,href:`/lms-cases`}],IM={tags:`regression`,active:1},LM={module:{dbName:`Modules`,formField:`module`,label:`Module`}},RM={key:!1,value:!1,expected:!1};function zM(e,t){return t?e[t]??RM:RM}function BM(e,t){e.setFields(t.map(e=>({name:e,errors:[]})))}function VM(e=[]){return e.map(e=>({value:e,label:e}))}function HM(e=``){return String(e??``).trim()}function UM(e=[]){let t=new Map;return e.forEach(e=>{let n=HM(e?.flow),r=n.toLowerCase();n&&!t.has(r)&&t.set(r,n)}),Array.from(t.values()).map(e=>({value:e,label:e}))}function WM(e=[],t,n){let r=HM(t).toLowerCase(),i=HM(n).toLowerCase();return e.reduce((e,t)=>{let n=HM(t?.module).toLowerCase(),a=HM(t?.flow).toLowerCase();if(n!==r||a!==i)return e;let o=Number(t?.step_order)||0;return Math.max(e,o)},0)+1}function GM({icon:e,title:t}){return(0,l.jsxs)(s.Space,{size:10,align:`center`,children:[(0,l.jsx)(`div`,{className:`v1-section-icon-box`,children:e}),(0,l.jsx)(PM,{strong:!0,className:`v1-section-label`,children:t})]})}function KM(){let[e]=s.Form.useForm(),[t]=s.Form.useForm(),[r,i]=(0,o.useState)([]),[a,u]=(0,o.useState)([]),[f,p]=(0,o.useState)([]),[m,h]=(0,o.useState)(nM),[g,_]=(0,o.useState)({}),[v,y]=(0,o.useState)(!1),[b,x]=(0,o.useState)(!1),[S,C]=(0,o.useState)({open:!1,typeKey:`module`}),[w,T]=(0,o.useState)(!1),[E,D]=(0,o.useState)(!1),[O,k]=(0,o.useState)(!1),A=(0,d.useNavigate)(),j=LM[S.typeKey],M=(0,o.useMemo)(()=>VM(r),[r]),N=s.Form.useWatch(`module`,e),P=s.Form.useWatch(`flow`,e),F=s.Form.useWatch(`keyword`,e),I=!!HM(N),L=!!HM(P),R=!I,z=!I||!L,B=(0,o.useMemo)(()=>zM(g,F),[g,F]),V=(e,t=[])=>{e===`module`&&i(t)},H=async()=>{y(!0);try{let e=await jy(LM.module.dbName);i(e?.items??[])}catch(e){console.error(`Unable to load testing options:`,e),s.message.error(`Unable to load testing options.`)}finally{y(!1)}},U=async()=>{try{let e=await Ny();Array.isArray(e?.options)&&e.options.length>0&&h(e.options),e?.rules&&typeof e.rules==`object`&&_(e.rules)}catch(e){console.error(`Unable to load action field rules:`,e),s.message.error(`Unable to load action validation rules.`)}},ee=(0,o.useCallback)(async t=>{let n=HM(t);if(u([]),p([]),e.setFieldsValue({step_order:void 0}),n){x(!0);try{let e=await zy({limit:1e4,offset:0,module:n}),t=Array.isArray(e?.items)?e.items:[];u(t),p(UM(t))}catch(e){console.error(`Unable to load flows:`,e),s.message.error(`Unable to load flows.`)}finally{x(!1)}}},[e]),te=(0,o.useCallback)(async(t,n,r)=>{let i=HM(t),a=HM(n);if(!i||!a){e.setFieldsValue({step_order:void 0});return}D(!0);try{e.setFieldsValue({step_order:WM(r,i,a)})}catch(e){console.error(`Unable to load step order:`,e),s.message.error(`Unable to load step order.`)}finally{D(!1)}},[e]);(0,o.useEffect)(()=>{Promise.resolve().then(async()=>{await Promise.all([H(),U()])})},[]),(0,o.useEffect)(()=>{Promise.resolve().then(()=>ee(N))},[ee,N]),(0,o.useEffect)(()=>{Promise.resolve().then(()=>te(N,P,a))},[a,te,P,N]);let ne=async t=>{let n={module:HM(t.module),flow:HM(t.flow),step_order:Number(t.step_order),description:HM(t.description),keyword:HM(t.keyword),target:HM(t.target),value:HM(t.value),expected:HM(t.expected),tags:t.tags?HM(t.tags):IM.tags,active:Number(t.active)};k(!0);try{await Ry(n),s.message.success(`LMS case details saved successfully.`),e.resetFields(),u([]),p([])}catch(e){console.error(`Unable to save LMS case:`,e),s.message.error(`Unable to save LMS case.`)}finally{k(!1)}},re=(t,n)=>{e.setFieldsValue({[t]:HM(n)})},ie=t=>{e.setFieldsValue({module:HM(t),flow:void 0,step_order:void 0,keyword:void 0,description:void 0,target:void 0,tags:IM.tags,value:void 0,expected:void 0}),BM(e,[`keyword`,`target`,`value`,`expected`])},ae=t=>{e.setFieldsValue({flow:HM(t),step_order:void 0,keyword:void 0,target:void 0,value:void 0,expected:void 0}),BM(e,[`keyword`,`target`,`value`,`expected`])},W=t=>{let n=zM(g,t);e.setFieldsValue({keyword:HM(t),target:n.key?e.getFieldValue(`target`):void 0,value:n.value?e.getFieldValue(`value`):void 0,expected:n.expected?e.getFieldValue(`expected`):void 0}),BM(e,[`target`,`value`,`expected`])},oe=e=>{let n=LM[e];C({open:!0,typeKey:e}),t.setFieldsValue({name:``,type:n.label})},se=()=>{C(e=>({...e,open:!1})),t.resetFields()},ce=async()=>{try{let n=HM((await t.validateFields()).name),r=await My({name:n,type:j.dbName});V(S.typeKey,r?.items??[]),e.setFieldsValue({[j.formField]:n}),s.message.success(`${j.label} added successfully.`),se()}catch(e){if(e?.errorFields)return;console.error(`Unable to save testing option:`,e),s.message.error(`Unable to add ${j.label.toLowerCase()}.`)}finally{T(!1)}};return(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsxs)(s.Row,{align:`middle`,justify:`space-between`,className:`breadcrumb-action-wrapper`,children:[(0,l.jsx)(s.Col,{children:(0,l.jsx)(n.t,{items:FM})}),(0,l.jsx)(s.Col,{children:(0,l.jsx)(s.Button,{type:`link`,onClick:()=>A(`/lms-home`),children:`View Table`})})]}),(0,l.jsx)(`div`,{className:`v1-page`,children:(0,l.jsxs)(`div`,{className:`v1-page-inner`,children:[(0,l.jsx)(`div`,{className:`v1-page-header`,children:(0,l.jsxs)(s.Space,{align:`center`,size:10,children:[(0,l.jsx)(c.ProfileOutlined,{className:`v1-outer-icon`}),(0,l.jsx)(`div`,{children:(0,l.jsx)(PM,{strong:!0,style:{fontSize:16},children:`Add LMS Case`})})]})}),(0,l.jsx)(Z,{children:(0,l.jsxs)(s.Form,{form:e,className:`v1-form`,layout:`vertical`,colon:!1,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),initialValues:IM,onFinish:ne,autoComplete:`off`,children:[(0,l.jsx)(s.Card,{className:`v1-card`,title:(0,l.jsx)(GM,{icon:(0,l.jsx)(c.FileTextOutlined,{}),title:`LMS Case Details`}),extra:(0,l.jsx)(PM,{type:`secondary`,className:`v1-card-subtitle`,children:`Module, flow, step order and execution data`}),children:(0,l.jsxs)(s.Row,{gutter:[24,0],children:[(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsxs)(s.Space.Compact,{style:{width:`100%`},children:[(0,l.jsx)(s.Form.Item,{label:`Module`,name:`module`,style:{flex:1},children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,loading:v,optionFilterProp:`label`,placeholder:`Select module`,options:M,onChange:ie})}),(0,l.jsx)(s.Button,{"aria-label":`Add module`,icon:(0,l.jsx)(c.PlusOutlined,{}),style:{marginTop:30},onClick:()=>oe(`module`)})]})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Flow`,name:`flow`,children:(0,l.jsx)(s.AutoComplete,{maxLength:100,allowClear:!0,disabled:R,options:f,placeholder:b?`Loading flows`:`Enter flow`,onChange:ae,filterOption:(e,t)=>t?.value?.toLowerCase().includes(e.toLowerCase())})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Step Order`,name:`step_order`,validateTrigger:[`onBlur`,`onChange`],children:(0,l.jsx)(s.Input,{maxLength:10,disabled:!0,placeholder:E?`Loading step order`:`Step order`})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Action`,name:`keyword`,children:(0,l.jsx)(s.Select,{allowClear:!0,showSearch:!0,disabled:z,optionFilterProp:`label`,placeholder:`Select action`,options:m,onChange:W})})}),(0,l.jsx)(s.Col,{xs:24,children:(0,l.jsx)(s.Form.Item,{label:`Description`,name:`description`,children:(0,l.jsx)(s.Input.TextArea,{rows:3,maxLength:255,disabled:z,placeholder:`Enter description`,showCount:!0,onBlur:e=>re(`description`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Key`,name:`target`,rules:[{required:B.key,message:`Key is required for this action`}],children:(0,l.jsx)(s.Input,{maxLength:255,disabled:z||!!F&&!B.key,placeholder:z?`Select module and flow first`:F?B.key?`Required — Enter selector / locator`:`Not needed for this action`:`Select an action first`,onBlur:e=>re(`target`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Tags`,name:`tags`,children:(0,l.jsx)(s.Input,{maxLength:200,disabled:z,placeholder:`Enter tags`,prefix:(0,l.jsx)(c.TagsOutlined,{className:`v1-input-icon`}),onBlur:e=>re(`tags`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Value`,name:`value`,rules:[{required:B.value,message:`Value is required for this action`}],children:(0,l.jsx)(s.Input.TextArea,{rows:4,disabled:z||!!F&&!B.value,placeholder:z?`Select module and flow first`:F?B.value?`Required — Enter value`:`Not needed for this action`:`Select an action first`,onBlur:e=>re(`value`,e.target.value)})})}),(0,l.jsx)(s.Col,{xs:24,md:12,children:(0,l.jsx)(s.Form.Item,{label:`Expected`,name:`expected`,rules:[{required:B.expected,message:`Expected result is required for this action`}],children:(0,l.jsx)(s.Input.TextArea,{rows:4,disabled:z||!!F&&!B.expected,placeholder:z?`Select module and flow first`:F?B.expected?`Required — Enter expected result`:`Not needed for this action`:`Select an action first`,onBlur:e=>re(`expected`,e.target.value)})})})]})}),(0,l.jsx)(`div`,{className:`v1-form-actions`,children:(0,l.jsx)(s.Form.Item,{children:(0,l.jsxs)(s.Space,{children:[(0,l.jsx)(s.Button,{type:`primary`,htmlType:`submit`,loading:O,disabled:z,children:`Submit`}),(0,l.jsx)(s.Button,{onClick:()=>{e.resetFields(),u([]),p([])},children:`Reset`})]})})})]})}),(0,l.jsx)(s.Modal,{title:`Add ${j.label}`,open:S.open,confirmLoading:w,okText:`Add`,onCancel:se,onOk:()=>{T(!0),ce()},destroyOnHidden:!0,children:(0,l.jsxs)(s.Form,{form:t,layout:`vertical`,colon:!1,className:`v1-form`,requiredMark:(e,{required:t})=>(0,l.jsxs)(l.Fragment,{children:[e,t&&(0,l.jsx)(`span`,{className:`v1-required-mark`,children:` *`})]}),children:[(0,l.jsx)(s.Form.Item,{label:`Name`,name:`name`,children:(0,l.jsx)(s.Input,{maxLength:100,placeholder:`Enter ${j.label.toLowerCase()} name`,onBlur:e=>{t.setFieldsValue({name:HM(e.target.value)})}})}),(0,l.jsx)(s.Form.Item,{label:`Type`,name:`type`,children:(0,l.jsx)(s.Input,{disabled:!0})})]})})]})})]})}var qM=[{label:`Home`,href:`/`},{label:`LMS Cases`,href:`/lms-cases`}];function JM(){return(0,l.jsxs)(`main`,{className:`jobs-list-page`,children:[(0,l.jsx)(n.t,{items:qM}),(0,l.jsx)(Lo,{moduleName:`lms-flows`,rowKey:`id`})]})}var YM=[`referenceId`,`ReferenceId`,`candidateId`,`CandidateId`,`entityId`,`EntityId`,`id`,`Id`,`_id`];function XM(e=YM){return function(t){if(!t||typeof t!=`object`)return``;for(let n of e){let e=t[n];if(e!=null&&e!==``)return String(e)}return``}}function ZM(e,t=YM){if(!e||typeof e!=`object`)return[];let n=[];for(let r of t){let t=e[r];t!=null&&t!==``&&n.push(String(t))}return n}var QM=XM();function $M(e){return typeof e==`function`?e:typeof e==`string`?XM([e]):Array.isArray(e)?XM(e):QM}function eN(e,t,n){return!t||typeof t!=`object`?e:{...t,...e,id:e?.id??t?.id??n}}function tN(e,t,n={}){return{status:`success`,total:t,data:{data:e,...n}}}var nN=[`fields`,`fieldConfig`,`tabs`,`tabField`,`actionRules`,`actions`,`columnActions`];function rN(e){let t=e?.data??e,n={};for(let r of nN){let i=e?.[r]??t?.[r];i==null||Array.isArray(i)&&i.length===0||(n[r]=i)}return n}var iN=e=>String(e??``).replace(/[^a-zA-Z0-9]/g,``).toLowerCase();function aN(e,t,n){let r=(Array.isArray(n)?n:[n]).map(iN).filter(Boolean),i=r.length?e.findIndex(e=>r.includes(iN(e?.value))||r.includes(iN(e?.label))):-1;if(i===-1)return[...e,...t];let a=Number(e[i]?.order),o=Number.isFinite(a)?t.map((e,n)=>e.order==null||e.order===``?{...e,order:a+(n+1)/(t.length+1)}:e):t;return[...e.slice(0,i+1),...o,...e.slice(i+1)]}var oN=(e,t)=>ri(e,t).rows,sN=(e,t)=>{let{rows:n,total:r}=ri(e,t);return{rows:n,total:r}};function cN(e,t){return function(n,r,i,a={}){return e(t??n,r,i,a)}}function lN(e){return!e||typeof e!=`object`||typeof(e.fetchByKeys??e.fetch??e.function)!=`function`?null:{...e,fetchByKeys:typeof e.fetchByKeys==`function`?e.fetchByKeys:null,fetch:typeof e.fetch==`function`?e.fetch:null,function:typeof e.function==`function`?e.function:null,extractRows:typeof e.extractRows==`function`?e.extractRows:oN,mergeRow:typeof e.mergeRow==`function`?e.mergeRow:eN,fetchById:typeof e.fetchById==`function`?e.fetchById:null}}function uN({fetchSecondaryByKeys:e,fetchSecondary:t,extractSecondaryRows:n,fetchSecondaryById:r,secondaryKey:i,mergeRow:a,secondaryFetchLimit:o}){return!e&&!t&&!r?[]:[lN({key:i,fetchByKeys:e?(t,n,r)=>e(t,n,r):null,function:t?({moduleName:e,options:n})=>t(e,o,0,n):null,extractRows:n,fetchById:r,mergeRow:a})].filter(Boolean)}function dN(e){if(typeof e==`function`)return t=>{let n=e(t);return n==null||n===``?[]:[String(n)]};let t=typeof e==`string`?[e]:Array.isArray(e)&&e.length?e:YM;return e=>ZM(e,t)}function fN(e,t){let n=new Map;return e.forEach(e=>{for(let r of t(e))n.has(r)||n.set(r,e)}),n}function pN({moduleName:e,limit:t,offset:n,options:r,keys:i,primaryResponse:a,primaryRows:o,pageRows:s,total:c,source:l}){return{moduleName:e,limit:t,offset:n,options:r,keys:i,primaryResponse:a,primaryRows:o,pageRows:s,total:c,source:l}}async function mN(e,t){if(typeof e.args==`function`){let n=e.args(t);return(e.fetch??e.function??e.fetchByKeys)(...Array.isArray(n)?n:[n])}if(Array.isArray(e.args))return(e.fetch??e.function??e.fetchByKeys)(...e.args);if(e.fetchByKeys&&Array.isArray(t.keys))return e.fetchByKeys(t.moduleName,t.keys,t.options,t);let n=e.fetch??e.function;return typeof n==`function`?n(t):null}function hN({fetchPrimaryPage:e,extractPrimaryPage:t=sN,fetchSecondaryByKeys:n,joinSources:r=[],fetchPrimary:i,extractPrimaryRows:a=oN,fetchSecondary:o,extractSecondaryRows:s=oN,fetchSecondaryById:c,primaryKey:l,secondaryKey:u,mergeRow:d=eN,secondaryFetchLimit:f=200,extraFields:p=[],extraFieldsAfter:m}){let h=Array.isArray(r)&&r.length?r.map(lN).filter(Boolean):uN({fetchSecondaryByKeys:n,fetchSecondary:o,extractSecondaryRows:s,fetchSecondaryById:c,secondaryKey:u,mergeRow:d,secondaryFetchLimit:f}),g=0;async function _(e,t,n,r){if(!e.fetchById||!r)return null;try{let i=await e.fetchById(n,r);return i&&t(i).includes(String(r))?i:null}catch(e){return console.error(`[mergedListApi] per-id join lookup failed for "${r}"`,e),null}}async function v(e,t,n,r,i){if(!n)return e;let a=t.extractRows(n,r)??[],o=$M(t.primaryKey??l),s=dN(t.key),c=fN(a,s);return Promise.all(e.map(async e=>{let n=o(e),a=c.get(n)??(i()?null:await _(t,s,r,n));return t.mergeRow(e,a,n)}))}async function y(e,t,n,r){let i=e;for(let e of t)i=await v(i,e.source,e.response,n,r);return i}function b(e,t,n){let r={};for(let e of n){if(!e)continue;let t=rN(e);for(let e of Object.keys(t))r[e]??(r[e]=t[e])}return p.length&&(r.fields=aN(r.fields??[],p,m)),tN(e,t,r)}async function x({moduleName:e,limit:t,offset:n,options:r,primaryResponse:i,primaryRows:a,pageRows:o,total:s}){return Promise.all(h.map(async c=>{try{let u=$M(c.primaryKey??l),d=[...new Set(o.map(u).filter(Boolean))];return c.fetchByKeys&&d.length===0?{source:c,response:null}:{source:c,response:await mN(c,pN({moduleName:e,limit:t,offset:n,options:r,keys:d,primaryResponse:i,primaryRows:a,pageRows:o,total:s,source:c}))}}catch(e){return console.error(`[mergedListApi] join fetch failed — rendering page without that join`,e),{source:c,response:null}}}))}async function S(n,r,i,a,o){let s=await e(n,r,i,a),c=t(s,n)??{},l=Array.isArray(c.rows)?c.rows:[],u=Number.isFinite(Number(c.total))?Number(c.total):l.length,d=await x({moduleName:n,limit:r,offset:i,options:a,primaryResponse:s,primaryRows:l,pageRows:l,total:u});return b(await y(l,d,n,o),u,[s,...d.map(e=>e.response)])}async function C(e,t,n,r,o){let s=await i(e,t,n,r),c=a(s,e)??[],l=c.length,u=c.slice(n,n+t),d=await x({moduleName:e,limit:t,offset:n,options:r,primaryResponse:s,primaryRows:c,pageRows:u,total:l});return b(await y(u,d,e,o),l,[s,...d.map(e=>e.response)])}return async function(t,n=10,r=0,i={}){let a=++g,o=()=>a!==g;return e?S(t,n,r,i,o):C(t,n,r,i,o)}}function gN(e,t,n={}){return hN({fetchPrimary:()=>ZO(e,t),extractPrimaryRows:YO,fetchSecondary:On,fetchSecondaryById:QO,secondaryFetchLimit:n.moduleFetchLimit??200})}function _N(e){let t=String(e??``).trim().split(/[^a-zA-Z0-9]+/).filter(Boolean);return t.length?`${t.map((e,t)=>t===0?e.toLowerCase():e[0].toUpperCase()+e.slice(1).toLowerCase()).join(``)}Count`:``}function vN(e){let t=Array.isArray(e?.stages)?e.stages:[];if(!t.length)return e;let n={};for(let e of t){let t=_N(e?.stageName);t&&(n[t]=Number(e?.count)||0)}return{...n,...e}}var yN=e=>{let t=Number(e?.targetSubmission??e?.targetSubmissions);return Number.isFinite(t)&&t>0?t:null};function bN({submittedCountField:e=`submittedCount`,progressField:t=`targetSubmissionProgress`}={}){return function(n,r,i){let a=eN(n,r,i),o=yN(a);return o!=null&&(a[t]=`${Number(a?.[e])||0} of ${o}`),a}}function xN(e={}){let t=bN();return hN({primaryKey:`_id`,extraFields:e.extraFields,extraFieldsAfter:e.extraFieldsAfter,fetchPrimaryPage:On,joinSources:[{key:`entityId`,fetchByKeys:(e,t,n,r)=>{let i=Math.max(1,Number(r?.limit)||10);return XO(Math.floor((Number(r?.offset)||0)/i)+1,i)},extractRows:e=>(e?.items??[]).map(vN),mergeRow:(e,n,r)=>{let i=t(e,n,r);return n?._id&&(i.workflowId=n._id),i}}]})}async function SN(e,t=10,n=0,r={},i={}){return ri(await xN(i)(e,t,n,r),e)}async function CN(e,t,n,r=10,i=0,a={}){return ri(await gN(e,t)(n,r,i,a),n)}typeof window<`u`&&(window.__CORE_THEME_BUILD__=`2026-08-26T10:34:10.935Z`);var wN=BA,TN=tb(Rj),EN=tb(Bj),DN=tb(tM),ON=tb(pM),kN=tb(SM),AN=tb(TM),jN=tb(OM),MN=tb(jM),NN=tb(NM),PN=tb(KM),FN=tb(JM);exports.ADMIN_API_URL=t.v,exports.ADMIN_APP_ID=t.y,exports.APP_ID=t.b,exports.AUTH_URL=t.x,exports.ActivityNotesCard=Mc,exports.ActivityTab=Dc,exports.AddBatchCandidatePopup=xA,exports.AddFormV1=uc,exports.AdminDashboard=BA,exports.AdminDashboardContent=BT,exports.AdminPage=wN,exports.AppAlert=dc,exports.AppButton=n.lt,exports.AppShell=wy,exports.ApprovalActionBar=Vg,exports.AssigneeAvatars=Nc,exports.AuthGuard=_y,exports.BILLING_STATUS_FLOW=Hd,exports.BOOLEAN_API_KEYS=Dh,exports.BOOLEAN_PARSEABLE_API_KEYS=Nm,exports.BULK_UPLOAD_DEFAULT_ACCEPT=Pc,exports.BULK_UPLOAD_DEFAULT_MAX_SIZE_MB=Fc,exports.Breadcrumb=n.t,exports.BulkUploadPage=DN,exports.BulkUploadPanel=Uc,exports.CANDIDATES_URL=t.S,exports.CONTRACT_C2C=d_,exports.CONTRACT_W2=u_,exports.CORE_URL=t.C,exports.CURRENCY_SYMBOLS=Zl,exports.CalendarCard=A,exports.CoreThemeAdminApp=WT,exports.CoreThemeAdminRoutes=UT,exports.CustomPagination=Re,exports.DEFAULT_HOURS_POLICY=lg,exports.DayLogModal=Ng,exports.DescriptionBlock=nl,exports.DetailHeaderCard=Gf,exports.DetailViewPage=Qf,exports.DetailViewV1=Vu,exports.DocumentViewer=n.Cn,exports.DynamicCards=Pt,exports.DynamicPopup=lO,exports.DynamicPopupRoute=EA,exports.DynamicTabs=P,exports.EditFormV1=Xp,exports.FIELD_TYPE_REGISTRY=mh,exports.FINANCE_APPROVAL_CONFIG=n_,exports.FINANCE_TYPE_CFO=Yg,exports.FINANCE_TYPE_ONBOARDING_MANAGER=Jg,exports.FINANCE_TYPE_ONBOARDING_MANAGER_REAPPROVE=Qg,exports.FINANCE_TYPE_ONLY_FINANCE=Xg,exports.FINANCE_TYPE_SUBMISSION_MANAGER=qg,exports.FINANCE_TYPE_SUBMISSION_MANAGER_REAPPROVE=Zg,exports.FileListCard=gv,exports.FinanceApprovalPanel=Y_,exports.FinanceAvatar=wf,exports.FinanceBadge=Of,exports.FinanceDayCell=Ug,exports.FinanceDivider=gf,exports.FinanceEmployeeCell=Tf,exports.FinanceEmptyState=pf,exports.FinanceEquation=_f,exports.FinanceHistoryTimeline=xf,exports.FinanceHoursGrid=ff,exports.FinanceKpiRow=df,exports.FinanceLine=hf,exports.FinanceListToolbar=cg,exports.FinanceMarginBadge=kf,exports.FinanceMoneyCell=Df,exports.FinanceRecordsTable=Mf,exports.FinanceRowChevron=Af,exports.FinanceSection=mf,exports.FinanceStatusPill=uf,exports.FinanceTextCell=Ef,exports.FinanceTimesheetAnalysis=Gg,exports.FinanceWorkflowSteps=vf,exports.GATEWAY_URL=t.w,exports.HOURS_MESSAGES=ug,exports.Header=Gv,exports.HierarchyUserFilter=zt,exports.JOBS_URL=t.T,exports.LegacyAdminPage=TN,exports.ListView=Lo,exports.LmsHomePage=FN,exports.LmsTestForm=PN,exports.Login=Ty,exports.MailPopup=yE,exports.ManageModules=AN,exports.ManageSubmodules=jN,exports.ModuleRowActions=am,exports.NotesPanel=Bg,exports.NotesTab=jc,exports.PAYROLL_STATUS_FLOW=Ud,exports.POPUP_CONFIGS=fA,exports.PYOPS_URL=t.E,exports.ParamCardView=fm,exports.ParamListView=vm,exports.PeriodBadgeTag=Sg,exports.PreviewPopup=XE,exports.ProjectSelect=eb,exports.ProofUploadPreview=zg,exports.QuickLogBar=Ig,exports.QuickLogSelectionBar=Pg,exports.RejectionReasonModal=Fg,exports.SUBMISSIONS_URL=t.D,exports.SearchBuilderV1=$h,exports.Sidebar=py,exports.StatusBadge=tg,exports.StatusBadgeTag=xg,exports.StickyNotesFullPage=EN,exports.StylishDynamicTabs=rg,exports.TemplateEditor=ag,exports.TestForm=ON,exports.TestingHomePage=NN,exports.TimelineGroups=yc,exports.TimesheetDayCell=Ag,exports.TipTapEditor=n.wn,exports.UserForm=zA,exports.VendorShareDrawer=AA,exports.ViewSummaryWidget=ki,exports.WizardPopup=nD,exports.ZINNEXT_URL=t.O,exports.ZinnextTableView=MN,exports.ZinnextTestForm=kN,exports.appNow=n.On,exports.applyIntegrationStatus=n.Wn,exports.approveSubmission=ye,exports.buildAcceptAttr=Bc,exports.buildBooleanRequest=Mh,exports.buildCsv=rf,exports.buildDailyRows=Zd,exports.buildDayGradient=Og,exports.buildRateHistoryEntries=I_,exports.buildWeeklyRollup=ef,exports.clearSelectedProject=t.i,exports.colors=n.Dn,exports.computeFinance=O_,exports.computeHoursPolicy=gg,exports.computeMarginBand=tf,exports.conditionMatches=n.i,exports.configureCoreTheme=t.k,exports.configuredFieldLabel=n.a,exports.createAllWorkflowsListFetcher=xN,exports.createMergedListFetcher=hN,exports.createModuleListFetchAdapter=cN,exports.createWorkflowStageListFetcher=gN,exports.currencySymbol=Ql,exports.defaultMergeRow=eN,exports.deleteIntegrationConfig=n.tr,exports.deriveDayStats=Xd,exports.describeCapacity=vg,exports.downloadCsv=cf,exports.evaluateShowIfWith=n.o,exports.findEmployerRow=S_,exports.flattenGroups=b_,exports.formatAmount=iu,exports.formatApp=n.kn,exports.formatAppDateTime=n.An,exports.formatFileSize=zc,exports.formatFinanceMoney=L_,exports.formatHours=Nd,exports.formatMoney=au,exports.formatPercent=Fd,exports.formatRate=ou,exports.getActivity=n.un,exports.getAllWorkflowsModuleList=SN,exports.getAppTimeZone=n.jn,exports.getApprovalDate=zd,exports.getBgcIntegrationConfig=n.vr,exports.getBgcIntegrationSummary=n.yr,exports.getBillingActionStates=Wd,exports.getBooleanEligibleTypes=bh,exports.getCurrentRoleName=t.c,exports.getFieldLabel=of,exports.getFieldType=gh,exports.getFileExtension=Rc,exports.getFinanceApprovalConfig=s_,exports.getFormGroupsRaw=av,exports.getIntegrationConfig=n.Tr,exports.getIntegrationConfigs=n.Er,exports.getIntegrationSummary=n.Dr,exports.getModuleConfig=Fe,exports.getModuleDataDetail=n.fn,exports.getPayrollActionStates=Gd,exports.getPeriodBadgeConfig=Le,exports.getSelectedProject=t.l,exports.getStoredToken=t.u,exports.getStoredUser=t.d,exports.getUserRoles=t.f,exports.getVMSApprove=be,exports.getValueStyle=sf,exports.getWorkflowStageModuleList=CN,exports.getWorkflowSteps=Kd,exports.humanizeEvent=Rd,Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return cs}}),exports.indexFieldConfig=af,exports.initialsOf=Id,exports.insertTokenAtCursor=Lm,exports.isBooleanEligible=_h,exports.isBooleanParsable=Fm,exports.isTester=t.p,exports.logout=t.h,exports.marginIncludesReferral=l_,exports.matchLocationTax=D_,Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return op}}),exports.normalizeContract=w_,Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Wc}}),exports.rateUnitLabel=eu,exports.rateUnitShort=nu,exports.reconcileHours=_g,exports.registerFieldType=hh,exports.rejectSubmission=Se,exports.resolveActivityMeta=wc,exports.resolveAndCompute=k_,exports.resolveDayKind=mg,exports.resolveFinanceInputs=E_,exports.resolveMergeKey=QM,exports.resolveMergedListKey=QM,exports.resolveRejectionReason=c_,exports.resolveSubmissionFinance=ov,exports.saveBgcIntegrationConfig=n.Yr,exports.saveIntegrationConfig=n.Qr,exports.setSelectedProject=t._,exports.showIfConditions=n.c,exports.stageCountKey=_N,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Ey}}),exports.testIntegrationConnection=n.ii,exports.toApp=n.Nn,exports.toNumber=ru,exports.tzLabel=n.Pn,exports.tzShortLabel=n.Fn,exports.useDropdownFields=Wn,exports.useDropdownValues=Ai,exports.useEditForm=_v,exports.useFieldConfig=Gn,exports.useFilterFields=Kn,exports.useMenuPermission=tr,exports.useModuleActions=Qp,exports.useRecordRefresh=Yf,exports.validateBooleanQuery=Im,exports.validateBulkFile=Vc,exports.withAdminAppId=t.A,exports.withAppId=t.j,exports.withAuthGuard=tb;
13
13
  //# sourceMappingURL=index.cjs.map