@realtek/core-theme-live 0.0.455 → 0.0.456

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
1
  const e=require("./rolldown-runtime-Chgba0Kb.cjs"),t=require("./authApi-DiRtkJl2.cjs"),n=require("./diceCandidateMapper-BjMhHno3.cjs");let r=require("react");r=e.n(r,1);let i=require("antd"),a=require("@ant-design/icons"),o=require("react/jsx-runtime"),s=require("dayjs");s=e.n(s,1);let c=require("dayjs/plugin/utc");c=e.n(c,1);let l=require("dayjs/plugin/timezone");l=e.n(l,1);let u=require("react-router-dom"),d=require("@tiptap/react"),f=require("@tiptap/starter-kit");f=e.n(f,1);let p=require("@tiptap/extension-link");p=e.n(p,1);let m=require("@tiptap/extension-underline");m=e.n(m,1);let h=require("@tiptap/extension-table"),g=require("prop-types");g=e.n(g,1);let _=require("dompurify");_=e.n(_,1);var v=`/admin/field-config`,y=[{key:`clients`,apiModule:`clients`},{key:`job`,apiModule:`jobs`},{key:`candidate`,apiModule:`candidates`},{key:`submissions`,apiModule:`submissions`},{key:`onboarding`,apiModule:`onboarding`},{key:`billing`,apiModule:`billing`},{key:`payroll`,apiModule:`payroll`}];function b(...e){return e.find(Array.isArray)??[]}function x(e,t,n){return t.map(t=>e?.[t]).find(e=>e!=null&&e!==``)??n}function ee(e,t){return e?.total??e?.totalCount??e?.count??e?.recordsTotal??e?.meta?.total??e?.pagination?.total??t.length}function S(e,t){let n=x(e,[`label`,`Label`,`fieldName`,`field_name`,`name`,`fieldLabel`,`value`],`Field ${t+1}`),r=x(e,[`field`,`Field`,`fieldKey`,`field_key`,`key`,`value`,`fieldName`,`name`],n),i=x(e,[`isVisible`,`is_visible`,`visible`,`show`,`is_show`,`isShow`,`enabled`],!0),a=x(e,[`ismandatory`,`isMandatory`,`is_mandatory`,`mandatory`,`required`,`req`],!1),o=x(e,[`order`,`Order`,`sortOrder`,`position`],t);return{...e,fieldKey:r,fieldName:n,type:x(e,[`type`,`Type`],`text`),isVisible:typeof i==`string`?![`false`,`0`,`hide`,`hidden`,`no`].includes(i.toLowerCase()):!!i,ismandatory:typeof a==`string`?[`true`,`1`,`yes`,`required`].includes(a.toLowerCase()):!!a,order:typeof o==`number`?o:t,isLink:!!e.isLink,linkTemplate:e.linkTemplate??``,linkType:e.linkType??`internal`,linkTarget:e.linkTarget??`_self`,action:e.action??`navigate`,secondaryField:e.secondaryField??``,secondaryLabel:e.secondaryLabel??``,secondaryFields:Array.isArray(e.secondaryFields)?e.secondaryFields:[],secondarySeparator:e.secondarySeparator??``,lookup:e.lookup?{...e.lookup,projectFields:Array.isArray(e.lookup.projectFields)?e.lookup.projectFields:[]}:null,derived:e.derived??null,computed:e.computed?{...e.computed,operands:Array.isArray(e.computed.operands)?e.computed.operands:[]}:null,actionButtons:Array.isArray(e.actionButtons)?e.actionButtons:[],renderType:e.renderType??``,renderConfig:e.renderConfig?{...e.renderConfig,treatZeroAsEmpty:!!e.renderConfig.treatZeroAsEmpty,cleanEmptyTemplateSeparators:!!e.renderConfig.cleanEmptyTemplateSeparators}:null,valueStyles:Array.isArray(e.valueStyles)?e.valueStyles:[],commonStyle:e.commonStyle??null,displayTemplate:e.displayTemplate??``,defaultValue:e.defaultValue??``,dataSource:e.dataSource??`module`,groupName:e.groupName??``,filterGroupFields:Array.isArray(e.filterGroupFields)?e.filterGroupFields:[],filterGroupSeparator:e.filterGroupSeparator??` `,filterArrayLabelField:e.filterArrayLabelField??``,filterArrayValueField:e.filterArrayValueField??``}}function te(e){if(typeof e==`string`)return{key:e,apiModule:e};let t=x(e,[`key`,`moduleKey`,`value`,`module`,`apiModule`,`name`,`modulename`,`menuName`],``);return t?{key:t,apiModule:x(e,[`apiModule`,`api_module`,`module`,`value`,`key`,`name`,`modulename`,`menuName`],t)}:null}function C(e=y){let t=Array.isArray(e)&&e.length?e:y,n=new Set;return t.map(te).filter(Boolean).filter(e=>!n.has(e.key)&&(n.add(e.key),!0))}var w=`/admin/modules`;async function ne(){let e=await t.o(t.x,w),n=e?.data;return Array.isArray(n)?n:Array.isArray(e)?e:[]}async function re(e){let n=await t.o(t.x,`${w}/${encodeURIComponent(e)}/automations`),r=n?.data??n??{};return{gateway:r.gateway??null,strategies:r.strategies??null}}async function ie(e){let n=await t.o(t.x,`/admin/platform/${e}`),r=n?.data??n;return Array.isArray(r)?r:[]}async function ae(e,n){return t.o(t.x,`/admin/platform/${e}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)})}async function oe(e,n){return t.o(t.x,`/admin/platform/${e}/${encodeURIComponent(n)}`,{method:`DELETE`})}async function se(e,{gateway:n,strategies:r}){return t.o(t.x,`${w}/${encodeURIComponent(e)}/automations`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({gateway:n,strategies:r})})}async function ce(){let e=[];try{e=await kt()}catch{e=[]}let t=(Array.isArray(e)?e:[]).filter(e=>e?.isDeleted!==!0&&String(e?.status??`active`).toLowerCase()!==`inactive`&&String(e?.status??`active`).toLowerCase()!==`disabled`);return t.length>0?t:ne()}async function le(){let e;try{e=await ne()}catch{return{}}let t={},n=(e,n,r)=>{let i=String(e??``).trim().toLowerCase();!i||!n||(r||t[i]===void 0)&&(t[i]=n)};for(let t of Array.isArray(e)?e:[]){let e=String(t?.collectionName??``).trim();e&&n(t?.key,e,!0)}for(let t of Array.isArray(e)?e:[]){let e=String(t?.collectionName??``).trim(),r=String(t?.key??``).trim().toLowerCase();!e||!r||(r.endsWith(`s`)?n(r.slice(0,-1),e,!1):n(`${r}s`,e,!1))}return t}var T=`/admin/form-groups`,ue=`/admin/config-defaults`,de=`000000000000000000000000`;function fe(e){let t=String(e??``).trim();return t===``||t===de}function E(e={}){let t=new URLSearchParams;e.module&&t.set(`module`,e.module),e.clientId&&t.set(`clientId`,e.clientId),e.region&&t.set(`region`,e.region);let n=t.toString();return n?`?${n}`:``}async function pe(e=``,n={}){let r=`${T}${E({...n,module:e||n.module||``})}`,i=await t.o(t.x,r),a=i?.data;return Array.isArray(a)?a:a&&Array.isArray(a.groups)?a.groups:Array.isArray(i)?i:i&&Array.isArray(i.groups)?i.groups:[]}async function me(e=``,n={}){let r=E({...n,module:e||n.module||``}),i=await t.o(t.x,`${T}/preview-config${r}`);return i?.data??i??{}}async function he(e=``,n={},r={}){let i=E(r);return t.o(t.x,`${T}/preview-config${i}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:e,...n})})}async function ge({offset:e=0,limit:n=100,sortBy:r=`new`,searchvalue:i=``}={}){let a=new URLSearchParams({offset:String(e),limit:String(n),sortBy:r,searchvalue:i}),o=localStorage.getItem(`tenantId`)||``,s=localStorage.getItem(`businessId`)||``,c=localStorage.getItem(`businessUnitId`)||``;o&&a.set(`tenantId`,o),s&&a.set(`businessId`,s),c&&a.set(`businessUnitId`,c);let l=await t.o(t.x,`/client/view?${a.toString()}`),u=l?.data??l;return u?.clients??u?.Clients??u?.items??[]}async function _e(e){let n=await t.o(t.x,`/filter-dropdown-fields?module=${encodeURIComponent(e)}`),r=n?.data??n;return Array.isArray(r)?r:[]}async function ve(e,n={}){return t.o(t.x,`${T}${E(n)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function ye(e,n,r={}){return t.o(t.x,`${T}/${e}${E(r)}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)})}async function be(e,n={}){return t.o(t.x,`${T}/${e}${E(n)}`,{method:`DELETE`})}async function xe(e,n){return t.o(t.x,`${ue}/request-otp`,{method:`POST`,body:JSON.stringify({scope:e,action:n})})}async function Se(e,n,r){return t.o(t.x,`${ue}/apply`,{method:`POST`,body:JSON.stringify({scope:e,action:n,otp:r})})}var Ce=`/admin/detail-config`;async function we(e,n={}){let r=E({module:e,clientId:n.clientId}),i=await t.o(t.x,`${Ce}${r}`),a=i?.data??i??{};return{module:a.module??e,clientId:fe(a.clientId)?``:String(a.clientId),fields:Array.isArray(a.fields)?a.fields:[],merges:Array.isArray(a.merges)?a.merges:[],sourceFields:Array.isArray(a.sourceFields)?a.sourceFields:[],groups:Array.isArray(a.groups)?a.groups:[]}}async function Te({module:e,fields:n=[],merges:r=[],sourceFields:i=[],groups:a=[],clientId:o=``}){return t.o(t.x,Ce,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:e,fields:n,merges:r,sourceFields:i,groups:a,...o?{clientId:o}:{}})})}async function Ee({module:e,clientId:n=``,otp:r}){return t.o(t.x,`${Ce}/discover-fields`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:e,otp:r,...n?{clientId:n}:{}})})}var De=`/admin/detail-defaults`;async function Oe(){let e=await t.o(t.x,De);return e?.data??e??{}}async function ke(e){return t.o(t.x,De,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}var Ae=`/admin/ai-service-config`;async function je(){let e=await t.o(t.x,Ae);return e?.data??e??[]}async function Me(e){return t.o(t.x,Ae,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function Ne(e){return t.o(t.x,`${Ae}?serviceKey=${encodeURIComponent(e)}`,{method:`DELETE`})}async function Pe({baseUrl:e,authHeader:n,authValue:r}){let i=await t.o(t.x,`${Ae}/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({baseUrl:e,authHeader:n,authValue:r})});return i?.data??i}var Fe=`/admin/bgc-integration-config`;async function Ie(){let e=await t.o(t.x,Fe);return e?.data??e??{updateMethod:`MANUAL`,enabled:!0}}async function Le(e){return t.o(t.x,Fe,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function Re(){let e=await t.o(t.x,`/integration-config/bgc/summary`);return e?.data??e??{updateMethod:`MANUAL`,enabled:!0}}var D=`/admin/integration-config`;async function ze(){let e=await t.o(t.x,D);return e?.data??e??[]}async function Be(e){let n=await t.o(t.x,`${D}/${encodeURIComponent(e)}`);return n?.data??n}async function Ve(e){let n=e?.integrationKey,r=n?`${D}/${encodeURIComponent(n)}`:D;return t.o(t.x,r,{method:n?`PUT`:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function He(e){return t.o(t.x,`${D}/${encodeURIComponent(e)}`,{method:`DELETE`})}async function Ue(e){let n=await t.o(t.x,`${D}/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});return n?.data??n}async function We(e){let n=await t.o(t.x,`/integration-config/${encodeURIComponent(e)}/summary`);return n?.data??n}async function Ge(e,n,r){let i=await t.o(t.x,`/integration-config/${encodeURIComponent(e)}/apply-status/${encodeURIComponent(n)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});return i?.data??i}function Ke(e){return{key:e.role_id??e.id,roleId:e.role_id??e.id,roleName:e.role_name??`N/A`,description:e.role_description??`N/A`,userCount:e.user_count??0,roleType:e.role_type??0,raw:e}}function O(e){return e?.raw?.role_id??e?.roleId??e?.key}async function qe(){let e=await t.o(t.x,`/get-roles`),n=e.data??e,r=b(n?.zinnext_default).map(Ke),i=b(n?.custom_roles).map(Ke),a=[...r,...i];return{roles:a,total:a.length}}function Je(e){return{key:e.teamId,teamId:e.teamId,teamName:e.teamName??`N/A`,manager:e.reportingManager??`N/A`,managerId:e.reportingManagerId??0,memberCount:e.noOfTeamMembers??0,members:b(e.teamMembers),memberIds:b(e.teamMembersIds),raw:e}}function Ye(e){return e?.raw?.teamId??e?.teamId??e?.key}async function Xe({offset:e=0,limit:n=10,sortBy:r=`new`,search:i=``}={}){let a=new URLSearchParams({searchquery:i,sortBy:r,limit:String(n),offset:String(e)}),o=await t.o(t.x,`/get-teams?${a}`),s=o.data??o,c=b(s?.teams,s,o?.teams),l=s?.totalCount??s?.total??c.length;return{teams:c.map(Je),total:l}}async function Ze(e,{teamName:n,managerId:r,memberIds:i=[]}){let a=Ye(e);return t.o(t.x,`/team/edit?teamId=${a}`,{method:`PUT`,body:JSON.stringify({team_name:n,team_manager:r,other_team_members:i,reporting_team_member:[]})})}async function Qe(e,n,r,i=`listView`,a=!1){let o=new URLSearchParams({module:e,userId:`0`,[n]:String(r),configType:i});a&&(!i||i===`listView`)&&o.set(`includeMeta`,`1`);let s=await t.o(t.x,`${v}?${o}`),c=s.data??s,l=b(c,c?.visibleFields,s?.visibleFields);return a?{fields:l,dataVisibilityMode:c?.dataVisibilityMode??s?.dataVisibilityMode??`all`,dataOwnerField:c?.dataOwnerField??s?.dataOwnerField??`createdBy`}:l}async function $e(e,t=`listView`,n=y){let r=O(e),i=C(n),a=await Promise.all(i.map(async({key:e,apiModule:n})=>[e,(await Qe(n,`roleId`,r,t)).map((t,i)=>({...S(t,i),module:e,apiModule:n,roleId:r}))]));return Object.fromEntries(a)}async function et(e,t=`listView`,n=y){let r=O(e),i=C(n),a=await Promise.all(i.map(async({key:e,apiModule:n})=>{let i=await Qe(n,`roleId`,r,t,!0);return[e,{fields:i.fields.map((t,i)=>({...S(t,i),module:e,apiModule:n,roleId:r})),dataVisibilityMode:i.dataVisibilityMode??`all`,dataOwnerField:i.dataOwnerField??`createdBy`}]}));return Object.fromEntries(a)}async function tt(e,t=`listView`){let n=Ye(e),r=await Promise.all(y.map(async({key:e,apiModule:r})=>[e,(await Qe(r,`teamId`,n,t)).map((t,i)=>({...S(t,i),module:e,apiModule:r,teamId:n}))]));return Object.fromEntries(r)}function nt(e){if(!e?.lookup)return null;let t={...e.lookup},n=String(t.localField??``).trim()||String(e.fieldKey??``).trim(),r=String(t.valueField??t.foreignField??``).trim()||`_id`,i=String(t.displayField??t.projectField??``).trim(),a=String(t.displayField2??``).trim(),o=Array.isArray(t.projectFields)?t.projectFields.map(e=>String(e??``).trim()).filter(Boolean):[];return o.length===0&&(o=[i,a].filter(Boolean)),{...t,localField:n,valueField:r,displayField:i,...a?{displayField2:a}:{},projectFields:o}}function rt(e,t){let n=!t||t===`listView`;return e.map((e,r)=>{let i={label:e.fieldName,field:e.fieldKey,isVisible:e.isVisible,type:e.type??`text`,order:e.order??r};return n?Object.assign(i,{isLink:e.isLink??!1,linkTemplate:e.linkTemplate??``,linkType:e.linkType??`internal`,linkTarget:e.linkTarget??`_self`,action:e.action??`navigate`,secondaryField:e.secondaryField??``,secondaryLabel:e.secondaryLabel??``,secondaryFields:Array.isArray(e.secondaryFields)?e.secondaryFields:[],secondarySeparator:e.secondarySeparator??``,lookup:nt(e),actionButtons:e.actionButtons??[],derived:e.derived??null,computed:e.computed??null,renderType:e.renderType??``,valueStyles:Array.isArray(e.valueStyles)?e.valueStyles:[],commonStyle:e.commonStyle??null,displayTemplate:e.displayTemplate??``,defaultValue:e.defaultValue??``,renderConfig:e.renderConfig?{...e.renderConfig,treatZeroAsEmpty:!!e.renderConfig.treatZeroAsEmpty,cleanEmptyTemplateSeparators:!!e.renderConfig.cleanEmptyTemplateSeparators}:null}):(i.isEditable=e.isEditable??!1,i.ismandatory=e.ismandatory??e.isMandatory??!1,t===`filter`?(i.filterInputType=e.filterInputType??`dropdown`,i.isDefaultFilter=!!e.isDefaultFilter,i.dataSource=e.dataSource??`module`,e.dataSource===`group`&&(i.groupName=e.groupName??``),i.filterGroupFields=Array.isArray(e.filterGroupFields)?e.filterGroupFields:[],i.filterGroupSeparator=e.filterGroupSeparator??` `,i.filterArrayLabelField=e.filterArrayLabelField??``,i.filterArrayValueField=e.filterArrayValueField??``,e.lookup&&(i.lookup=e.lookup)):[`select`,`radio`,`checkbox`].includes(e.type)&&(i.dataSource=e.dataSource??`module`,e.dataSource===`group`&&(i.groupName=e.groupName??``))),i})}async function it(e,n,r,i=`listView`,a=y,o=``,s=`createdBy`,c=!1){let l=O(e),u=C(a).find(e=>e.key===n)?.apiModule??n;return t.o(t.x,`${v}/role`,{method:`PUT`,body:JSON.stringify({module:u,roleId:l,configType:i,updateAllRoles:c,visibleFields:rt(r,i),...(!i||i===`listView`)&&o?{dataVisibilityMode:o,dataOwnerField:String(s||`createdBy`).trim()||`createdBy`}:{}})})}var at=`/admin/role-form-permissions`;function ot(e){return`__group__:${e}`}async function st(e,n,r={}){let i=O(e),a=new URLSearchParams({module:n,roleId:String(i??``)});r.clientId&&a.set(`clientId`,r.clientId),r.region&&a.set(`region`,r.region);let o=await t.o(t.x,`${at}?${a}`),s=o?.data??o;return Array.isArray(s)?s:[]}async function ct(e,n,r){let i=O(e),a=[],o=0;for(let e of r){e.locked||a.push({label:e.label,field:ot(e.name),isVisible:e.enabled,isEditable:e.editable!==!1,order:o++});for(let t of e.fields??[])t.locked||a.push({label:t.label,field:t.field,isVisible:t.enabled,isEditable:t.editable!==!1,order:o++})}return t.o(t.x,`${v}/role`,{method:`PUT`,body:JSON.stringify({module:n,roleId:i,configType:`form`,visibleFields:a})})}async function lt(e,n,r,i=`listView`){let a=Ye(e),o=y.find(e=>e.key===n)?.apiModule??n;return t.o(t.x,`${v}/team`,{method:`PUT`,body:JSON.stringify({module:o,teamId:a,configType:i,visibleFields:rt(r,i)})})}async function ut({offset:e=0,limit:n=10,sortBy:r=`new`,searchQuery:i=``}={}){let a=new URLSearchParams({offset:String(e),limit:String(n),sortBy:r});i&&a.set(`searchquery`,i);let o=await t.o(t.x,`/get-all-users?${a}`),s=o.data??o,c=b(s,o.users,o.rows,o.items,o.records,s?.users,s?.data,s?.rows,s?.items,s?.records,s?.docs,s?.result,s?.results);return{users:c,total:ee({...o,...s},c)}}async function dt(e=[]){return t.o(t.x,`${v}/seed`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({collections:e})})}async function ft(){let e=await t.o(t.x,`${v}/seed-status`),n=e?.data??e??{};return{modules:Array.isArray(n.modules)?n.modules:[],seededModules:n.seededModules??{}}}async function pt(e){let n=localStorage.getItem(`authToken`),r=new FormData;r.append(`icon`,e);let i=await fetch(`${t.x}/admin/field-config/action-icon`,{method:`POST`,headers:{Authorization:`Bearer ${n}`},body:r});if(!i.ok){let e=Error(`Upload failed: ${i.status}`);throw e.status=i.status,e}let a=await i.json();return a.data??a}async function mt(){let[e,t,n]=await Promise.all([ce().catch(()=>[]),Et().catch(()=>[]),Jt().catch(()=>[])]),r=Array.isArray(e)?e:[],i=n.map(e=>String(e?.module??``).trim()).filter(Boolean);return[...r,...Array.isArray(t)?t:[],...i]}async function ht(e,{page:n=1,limit:r=100}={}){let i=new URLSearchParams({module:e,page:String(n),limit:String(r)}),a=await t.o(t.x,`/module/list?${i}`),o=a?.data??a??{};return{items:Array.isArray(o.data)?o.data:[],total:o.pagination?.total??0}}async function gt(e,n){return t.o(t.x,`/module/create?module=${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)})}async function _t(e,n,r){return t.o(t.x,`/module/update/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)})}async function vt(e,n){return t.o(t.x,`/module/delete/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`,{method:`DELETE`})}async function yt(e=``,n=50){let r=new URLSearchParams({search:e,limit:String(n),offset:`0`}),i=await t.o(t.x,`/admin/location-dropdown-values?${r}`),a=i?.data??i??[];return(Array.isArray(a)?a:[]).map(e=>{let t=typeof e==`string`?e:e.label??e.value??``;return{label:t,value:t}}).filter(e=>e.label)}async function bt(e,n,r=`_id`){let i=new URLSearchParams({collection:String(e),displayField:String(n),valueField:String(r)}),a=await t.o(t.x,`/admin/lookup-dropdown-values?${i}`),o=a?.data??a??[];return(Array.isArray(o)?o:[]).map(e=>({label:e.label??e.displayValue??e[n]??String(e.value??``),value:String(e.value??e._id??e.id??``)})).filter(e=>e.value&&e.label)}function xt(e){if(typeof e==`string`){let t=e.trim();return t?{field:t,locked:!0,forceShow:!0,forceReq:!0}:null}if(!e||typeof e!=`object`)return null;let t=String(e.field??``).trim();return t?{field:t,locked:e.locked===!0,forceShow:e.forceShow===!0,forceReq:e.forceReq===!0}:null}function St(e){let t=new Map;return(Array.isArray(e)?e:[]).forEach(e=>{let n=xt(e);n&&!t.has(n.field)&&t.set(n.field,n)}),t}async function Ct(e){let n=await t.o(t.x,`/admin/default-fields?module=${encodeURIComponent(e)}`),r=n?.data??n??{};return Array.isArray(r.fields)?r.fields:[]}async function wt(e,n,r){return t.o(t.x,`/admin/default-fields`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:e,fields:n,otp:r})})}async function Tt(e){let n=await t.o(t.x,`/email-verify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({email:e})}),r=n?.data??n??{};return{valid:!!r.valid,reason:r.reason??``,result:r.result??``,mailboxConfirmed:!!r.mailboxConfirmed,catchAll:!!r.catchAll,disposable:!!r.disposable,roleAddress:!!r.roleAddress,risk:r.risk??``,checks:Array.isArray(r.checks)?r.checks:[]}}async function Et(){let e=await t.o(t.x,`/admin/lookup/collections`),n=e.data??e;return Array.isArray(n)?n:[]}async function Dt(e){let n=await t.o(t.x,`/admin/lookup/collection-fields?collection=${encodeURIComponent(e)}`),r=n.data??n;return Array.isArray(r)?r:[]}async function Ot(e,n){let r=await t.o(t.x,`/admin/field-array-subfields?module=${encodeURIComponent(e)}&field=${encodeURIComponent(n)}`),i=r.data??r;return Array.isArray(i?.fields)?i.fields:[]}async function kt(){let e=await t.o(t.x,`/admin/menu-modules`);return b(e.data,e)}async function At({menuName:e,apiUrl:n=``,menuType:r=`menu`,parentMenuId:i=0,displayOrder:a=0}){let o=await t.o(t.x,`/admin/menu-modules`,{method:`POST`,body:JSON.stringify({menuName:e,apiUrl:n,menuType:r,parentMenuId:i,displayOrder:a})});return o.data??o}async function jt(e,{menuName:n}){let r=await t.o(t.x,`/admin/menu-modules/${e}`,{method:`PUT`,body:JSON.stringify({menuName:n})});return r.data??r}async function Mt(e){let n=await t.o(t.x,`/admin/menu-modules/${e}`,{method:`DELETE`});return n.data??n}async function Nt(){let e=await t.o(t.x,`/admin/menu-actions`);return b(e.data,e)}async function Pt({permissionName:e,permissionKey:n}){let r=await t.o(t.x,`/admin/menu-actions`,{method:`POST`,body:JSON.stringify({permissionName:e,permissionKey:n})});return r.data??r}async function Ft(e,{permissionName:n}){let r=await t.o(t.x,`/admin/menu-actions/${e}`,{method:`PUT`,body:JSON.stringify({permissionName:n})});return r.data??r}async function It(e){let n=await t.o(t.x,`/admin/menu-actions/${e}`,{method:`DELETE`});return n.data??n}function Lt(e){if(e&&typeof e==`object`&&!Array.isArray(e))return Lt(e.value??e.access_value??e.accessValue??e.permissionValue??e.enabled);if(e===!0||e===1||e===`1`)return`1`;let t=String(e??``).trim().toLowerCase();return t===`true`||t===`yes`||t===`active`?`1`:`0`}function Rt(e={}){return!e||typeof e!=`object`||Array.isArray(e)?e:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{...t,menuId:t?.menuId??t?.menu_id??0,permissions:Object.fromEntries(Object.entries(t?.permissions??{}).map(([e,t])=>[e,{...t&&typeof t==`object`&&!Array.isArray(t)?t:{},id:t?.id??t?.permission_id??t?.permissionId??0,value:Lt(t)}]))}]))}async function zt(e){let n=await t.o(t.x,`/get-role-details?roleid=${e}`);return n?.data??n??{}}async function Bt(e,n){return t.o(t.x,`/edit-role-details`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({roleId:e,menus:Rt(n)})})}var Vt=`/admin/custom-forms`;async function Ht(e=``,n=``,r=``){let i=new URLSearchParams;e&&i.append(`module`,e),n&&i.append(`formType`,n),r&&i.append(`action`,r);let a=`${Vt}?${i.toString()}`,o=await t.o(t.x,a),s=o?.data;return Array.isArray(s)?s:Array.isArray(o)?o:[]}async function Ut(e){return t.o(t.x,Vt,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function Wt(e,n){return t.o(t.x,`${Vt}/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)})}async function Gt(e){return t.o(t.x,`${Vt}/${e}`,{method:`DELETE`})}var Kt=`/admin/row-action-config`;function qt(e){return String(e??``).trim().toLowerCase()}async function Jt(e=``){let n=qt(e),r=n?`${Kt}?module=${encodeURIComponent(n)}`:Kt,i=await t.o(t.x,r),a=i?.data;return Array.isArray(a)?a:Array.isArray(i)?i:[]}async function Yt({module:e,roleId:n=0,rowActions:r=[]}){let i=qt(e);return t.o(t.x,Kt,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:i,roleId:n,rowActions:r})})}async function Xt(e,n=[]){return t.o(t.x,`${Kt}/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({rowActions:n})})}async function Zt(e){return t.o(t.x,`${Kt}/${e}`,{method:`DELETE`})}var Qt=`/admin/module-action-rules`;async function $t(e){let n=await t.o(t.x,`${Qt}?module=${encodeURIComponent(e)}`),r=n?.data;return Array.isArray(r)?r:Array.isArray(n)?n:[]}async function en({module:e,name:n,description:r=``,conditions:i=[],blockedActions:a=[],disabledActions:o=[],allowedActions:s=void 0,isActive:c=!0}){return t.o(t.x,Qt,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:e,name:n,description:r,conditions:i,blockedActions:a,disabledActions:o,allowedActions:s,isActive:c})})}async function tn(e,{name:n,description:r=``,conditions:i=[],blockedActions:a=[],disabledActions:o=[],allowedActions:s=void 0,isActive:c=!0}){return t.o(t.x,`${Qt}/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:n,description:r,conditions:i,blockedActions:a,disabledActions:o,allowedActions:s,isActive:c})})}async function nn(e){return t.o(t.x,`${Qt}/${e}`,{method:`DELETE`})}var rn=[{value:`self`,label:`Same page`},{value:`newTab`,label:`New tab`},{value:`popup`,label:`Popup`}],an=rn.map(e=>e.value);function on(e){return{self:`self`,newtab:`newTab`,popup:`popup`}[String(e??``).trim().toLowerCase()]||`popup`}var sn=`/popup/candidate-detail`;function cn(e,{href:t,navigate:n,location:r}={}){if(!t)return!1;let i=on(e);if(i===`self`)return!1;if(i===`newTab`)return window.open(t,`_blank`,`noopener`),!0;let a=String(t),o=(a.split(`/detailview/`)[1]??a.split(`/detail-view/`)[1])?.split(/[/?#]/)[0];if(!o||typeof n!=`function`)return!1;let s=r||(typeof window<`u`?{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash}:void 0);return n(`${sn}/${o}`,{state:{background:s}}),!0}var ln=Object.freeze({s3BaseUrl:`https://zinnext-devlopment-ap-south-1.s3.ap-south-1.amazonaws.com`.replace(/\/+$/,``),dateFormat:`DD MMM YYYY`,dateTimeFormat:`MMM DD, YYYY | hh:mm A`,showTimeZoneLabel:!0,timeZone:``,timeZoneAliases:{},region:``,booleanTrueLabel:`Yes`,booleanFalseLabel:`No`,emptyPlaceholder:`-`,emptyTexts:{},separator:` - `,documentNameOrder:[`name`,`documentName`,`uploadName`,`uploadedFileName`,`uniqueName`],phoneFormat:`3-3-4`,phoneCountryCode:``,candidateDetailViewMode:`popup`}),k={...ln},un=null;function A(){return k}function dn(e){if(!e||typeof e!=`object`)return{};let t={};if(e.s3BaseUrl&&(t.s3BaseUrl=String(e.s3BaseUrl).replace(/\/+$/,``)),e.dateFormat&&(t.dateFormat=e.dateFormat),e.dateTimeFormat&&(t.dateTimeFormat=e.dateTimeFormat),typeof e.showTimeZoneLabel==`boolean`&&(t.showTimeZoneLabel=e.showTimeZoneLabel),typeof e.timeZone==`string`&&(t.timeZone=e.timeZone.trim()),typeof e.region==`string`&&(t.region=e.region.trim()),e.timeZoneAliases&&typeof e.timeZoneAliases==`object`&&!Array.isArray(e.timeZoneAliases)&&(t.timeZoneAliases={...k.timeZoneAliases,...e.timeZoneAliases}),e.booleanTrueLabel&&(t.booleanTrueLabel=e.booleanTrueLabel),e.booleanFalseLabel&&(t.booleanFalseLabel=e.booleanFalseLabel),e.emptyPlaceholder&&(t.emptyPlaceholder=e.emptyPlaceholder),e.emptyTexts&&typeof e.emptyTexts==`object`&&!Array.isArray(e.emptyTexts)){let n={};Object.entries(e.emptyTexts).forEach(([e,t])=>{typeof t==`string`&&t.trim()!==``&&(n[e]=t.trim())}),Object.keys(n).length&&(t.emptyTexts={...k.emptyTexts,...n})}if(typeof e.separator==`string`&&e.separator!==``&&(t.separator=e.separator),typeof e.phoneFormat==`string`&&e.phoneFormat.trim()!==``&&(t.phoneFormat=e.phoneFormat.trim()),typeof e.phoneCountryCode==`string`&&(t.phoneCountryCode=e.phoneCountryCode.trim()),typeof e.phoneCountryCode==`string`&&(t.phoneCountryCode=e.phoneCountryCode.trim()),Array.isArray(e.documentNameOrder)&&e.documentNameOrder.length&&(t.documentNameOrder=e.documentNameOrder),an.includes(e.candidateDetailViewMode)&&(t.candidateDetailViewMode=e.candidateDetailViewMode),e.formDateFormats&&typeof e.formDateFormats==`object`&&!Array.isArray(e.formDateFormats)){let n={};Object.entries(e.formDateFormats).forEach(([e,t])=>{typeof t==`string`&&t.trim()!==``&&(n[e]=t.trim())}),t.formDateFormats=n}return t}function fn(e=pn()){let t=(String(e).match(/\d+/g)??[`3`,`3`,`4`]).map(Number).filter(e=>e>0),n=String(e).match(/\D+/)?.[0]??`-`,r=t.length?t:[3,3,4];return{groups:r,sep:n,total:r.reduce((e,t)=>e+t,0)}}function pn(){return k.phoneFormat||ln.phoneFormat}function mn(){return k.phoneCountryCode??ln.phoneCountryCode}function hn(e,t=pn()){let{total:n}=fn(t);return String(e??``).replace(/\D/g,``).slice(0,n)}function gn(e,t=pn()){let{groups:n,sep:r}=fn(t),i=hn(e,t);if(!i)return``;let a=[],o=0;for(let e of n){if(o>=i.length)break;a.push(i.slice(o,o+e)),o+=e}return a.join(r)}function _n(e){let t=dn(e);return Object.keys(t).forEach(e=>vn.add(e)),k={...k,...t},k}var vn=new Set;function yn(){return vn.has(`dateFormat`)?k.dateFormat:void 0}function bn(e){let t=k.formDateFormats,n=String(e??``).trim().toLowerCase();if(!t||!n)return;let r=n.endsWith(`s`)?n.slice(0,-1):n,i=Object.keys(t).find(e=>{let t=e.trim().toLowerCase();return t===n||t===r||t===`${r}s`});return i?t[i]:void 0}function xn(e=!1){return un&&!e||(un=Promise.resolve().then(()=>Oe()).then(e=>_n(e)).catch(()=>k)),un}s.default.extend(c.default),s.default.extend(l.default);var Sn=null;function Cn(){if(Sn===null)try{Sn=s.default.tz.guess()||`UTC`}catch{Sn=`UTC`}return Sn}function wn(e){let t=String(e??``).trim();if(!t||t!==`UTC`&&!t.includes(`/`))return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:t}),!0}catch{return!1}}function j(e=A()){let t=String(e?.timeZone??``).trim();return wn(t)?t:Cn()}function Tn(e){return(0,s.default)().tz(j(e))}function En(e,t){let n=(0,s.default)(e?.$date??e);return n.isValid()?n.tz(j(t)):n}function Dn(e,t,n=A()){let r=En(e,n);return r.isValid()?r.format(t||n?.dateFormat||`DD MMM YYYY`):``}function On(e=A(),t){let n=j(e),r=In(n,e);if(r&&r.includes(`/`)){let e=kn(n,t);if(e)return r.split(`/`).map(e=>e.trim()).find(t=>t.toUpperCase()===e.toUpperCase())||e}return r||kn(n,t)||n}function kn(e,t){try{let n=t===void 0?new Date:new Date((0,s.default)(t?.$date??t).valueOf());if(Number.isNaN(n.valueOf()))return``;let r=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`short`}).formatToParts(n).find(e=>e.type===`timeZoneName`)?.value??``;return/^[A-Za-z]+$/.test(r)?r:``}catch{return``}}function An(e,t=A()){let n=Dn(e,t?.dateTimeFormat||`MMM DD, YYYY | hh:mm A`,t);if(!n)return``;if(t?.showTimeZoneLabel===!1)return n;let r=On(t,e);return r?`${n} ${r}`:n}function jn(e){if(!e)return!1;if(e.tzAware===!0)return!0;if(e.tzAware===!1)return!1;let t=String(e.type??``).toLowerCase();return t===`datetime`||t===`time`||t===`datetime-local`}function Mn(e,t){if(e==null||e===``)return null;let n=(0,s.default)(e);if(!n.isValid())return null;let r=j(t);return s.default.tz(n.format(`YYYY-MM-DDTHH:mm:ss`),r)}function Nn(e=j()){try{let t=(0,s.default)().tz(e).utcOffset(),n=t<0?`-`:`+`,r=Math.abs(t);return`UTC${n}${String(Math.floor(r/60)).padStart(2,`0`)}:${String(r%60).padStart(2,`0`)}`}catch{return``}}function Pn(e=A()){let t=j(e);return`${In(t,e)||t} (${Nn(t)})`}var Fn=Object.freeze({UTC:`UTC`,"Asia/Kolkata":`IST`,"Asia/Calcutta":`IST`,"Asia/Dubai":`GST`,"America/New_York":`EST/EDT`,"America/Chicago":`CST/CDT`,"America/Denver":`MST/MDT`,"America/Los_Angeles":`PST/PDT`,"Europe/London":`GMT/BST`,"Europe/Berlin":`CET/CEST`,"Asia/Singapore":`SGT`,"Asia/Tokyo":`JST`,"Australia/Sydney":`AEST/AEDT`});function In(e,t=A()){return(t?.timeZoneAliases??{})[e]??Fn[e]??``}function Ln(e=A()){let t=[];try{t=Intl.supportedValuesOf(`timeZone`)??[]}catch{t=[]}let n=[`UTC`,...Object.keys(Fn),...Object.keys(e?.timeZoneAliases??{})];return[...new Set([...n,...t])].filter(wn).map(t=>{let n=0;try{n=(0,s.default)().tz(t).utcOffset()}catch{return null}let r=In(t,e),i=Nn(t);return{value:t,alias:r,offsetLabel:i,offsetMinutes:n,label:`${r?`${r} — `:``}${t} (${i})`}}).filter(Boolean).sort((e,t)=>e.offsetMinutes-t.offsetMinutes||e.value.localeCompare(t.value))}var M={brand:`#0053a5`,brandDark:`#1d4ed8`,brandDarker:`#1e40af`,brandHover:`#004f85`,brandSoft:`#dfedf7`,brandSofter:`#e7f2fa`,brandSubtle:`#edf8fe`,textPrimary:`#111827`,textSecondary:`#4b5563`,textMuted:`#6b7280`,textSubtle:`#010306`,textHeading:`#142235`,textDark:`#232a31`,textPlaceholder:`#a7b0bb`,textInverse:`#ffffff`,textLink:`#0053a5`,surfacePage:`#f5f6fa`,surfaceSoft:`#f8fafc`,surfaceSofter:`#f3f8fb`,surfaceCard:`#ffffff`,surfaceHover:`#eff6ff`,surfaceHoverLight:`#f8fcff`,surfaceHoverSoft:`#f5fbff`,surfaceSelected:`#dbeafe`,surfaceControl:`#f4f8fb`,surfaceRowAlt:`#fbfdff`,border:`#e6f0ff`,borderLight:`#eef3f8`,borderSofter:`#f0f0f0`,borderMuted:`#d8e4ef`,borderInput:`#d5dde5`,borderFocus:`#7dbce6`,borderHover:`#99c7e8`,controlBorder:`#77abd0`,controlBorderMuted:`#e7edf3`,controlAccent:`#4f9ac7`,iconMuted:`#d1d5db`,iconSubtle:`#9aa6b2`,iconNeutral:`#8c8c8c`,iconSoft:`#bbbbbb`,scrollbarThumb:`#c4ccd8`,scrollbarThumbLight:`#d1d5db`,danger:`#dc2626`,dangerSoft:`#ef4444`,dangerStrong:`#e11d24`,success:`#15803d`,successSoft:`#16a34a`,warning:`#f97316`,info:`#3b82f6`,transparent:`transparent`,statusNeutralBg:`#f1f3ee`,statusNeutralText:`#717b36`,statusProcessingBg:`#f6f4f7`,statusProcessingText:`#273048`,statusProcessingBorder:`#d4d8dd`,statusWarningBg:`#fff7ea`,statusWarningText:`#bf7328`,shadowMenu:`rgba(15, 35, 55, 0.08)`,shadowBadge:`rgba(26, 95, 145, 0.08)`,shadowTag:`rgba(39, 51, 70, 0.05)`,shadowAvatar:`rgba(57, 77, 103, 0.12)`,shadowDropdown:`0 6px 16px 0 rgba(0, 0, 0, .08), 0 3px 6px -4px rgba(0, 0, 0, .12), 0 9px 28px 8px rgba(0, 0, 0, .05)`,avatarBlueBg:`#eaf3ff`,avatarBlueText:`#142235`,avatarPurpleBg:`#f2eaff`,avatarMoreBg:`#eef6ff`,avatarMoreText:`#0053a5`,avatarNeutralBg:`#d9d9d9`,avatarNeutralText:`#555555`,avatarIndigo:`#6366f1`,avatarPurple:`#8b5cf6`,avatarBlue:`#3b82f6`,avatarGreen:`#10b981`,linkedIn:`#0077b5`};M.textPrimary,M.textSecondary,M.textMuted,M.textSubtle,M.textInverse,M.textLink,M.danger,M.success,M.danger,M.textLink,M.surfaceSoft,M.textSecondary,M.success,M.warning;var N={brand:`var(--color-brand)`,brandDark:`var(--color-brand-dark)`,brandDarker:`var(--color-brand-darker)`,brandHover:`var(--color-brand-hover)`,brandSoft:`var(--color-brand-soft)`,brandSofter:`var(--color-brand-softer)`,brandSubtle:`var(--color-brand-subtle)`,textPrimary:`var(--color-text-primary)`,textSecondary:`var(--color-text-secondary)`,textMuted:`var(--color-text-muted)`,textSubtle:`var(--color-text-subtle)`,textHeading:`var(--color-text-heading)`,textDark:`var(--color-text-dark)`,textPlaceholder:`var(--color-text-placeholder)`,textInverse:`var(--color-text-inverse)`,textLink:`var(--color-text-link)`,surfacePage:`var(--color-surface-page)`,surfaceSoft:`var(--color-surface-soft)`,surfaceSofter:`var(--color-surface-softer)`,surfaceCard:`var(--color-surface-card)`,surfaceHover:`var(--color-surface-hover)`,surfaceHoverLight:`var(--color-surface-hover-light)`,surfaceHoverSoft:`var(--color-surface-hover-soft)`,surfaceSelected:`var(--color-surface-selected)`,surfaceControl:`var(--color-surface-control)`,surfaceRowAlt:`var(--color-surface-row-alt)`,border:`var(--color-border)`,borderLight:`var(--color-border-light)`,borderSofter:`var(--color-border-softer)`,borderMuted:`var(--color-border-muted)`,borderInput:`var(--color-border-input)`,borderFocus:`var(--color-border-focus)`,borderHover:`var(--color-border-hover)`,controlBorder:`var(--color-control-border)`,controlBorderMuted:`var(--color-control-border-muted)`,controlAccent:`var(--color-control-accent)`,iconMuted:`var(--color-icon-muted)`,iconSubtle:`var(--color-icon-subtle)`,iconNeutral:`var(--color-icon-neutral)`,iconSoft:`var(--color-icon-soft)`,scrollbarThumb:`var(--color-scrollbar-thumb)`,scrollbarThumbLight:`var(--color-scrollbar-thumb-light)`,danger:`var(--color-danger)`,dangerSoft:`var(--color-danger-soft)`,dangerStrong:`var(--color-danger-strong)`,success:`var(--color-success)`,successSoft:`var(--color-success-soft)`,warning:`var(--color-warning)`,info:`var(--color-info)`,transparent:`var(--color-transparent)`,linkedIn:`var(--color-linkedin)`,statusNeutralBg:`var(--color-status-neutral-bg)`,statusNeutralText:`var(--color-status-neutral-text)`,statusProcessingBg:`var(--color-status-processing-bg)`,statusProcessingText:`var(--color-status-processing-text)`,statusProcessingBorder:`var(--color-status-processing-border)`,statusWarningBg:`var(--color-status-warning-bg)`,statusWarningText:`var(--color-status-warning-text)`,shadowMenu:`var(--color-shadow-menu)`,shadowBadge:`var(--color-shadow-badge)`,shadowTag:`var(--color-shadow-tag)`,shadowAvatar:`var(--color-shadow-avatar)`,shadowDropdown:`var(--color-shadow-dropdown)`,avatarBlueBg:`var(--color-avatar-blue-bg)`,avatarBlueText:`var(--color-avatar-blue-text)`,avatarPurpleBg:`var(--color-avatar-purple-bg)`,avatarMoreBg:`var(--color-avatar-more-bg)`,avatarMoreText:`var(--color-avatar-more-text)`},{Text:Rn,Title:zn,Paragraph:Bn,Link:Vn}=i.Typography,Hn={display:`h1`,h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,"section-title":`h3`,"card-title":`h4`,subtitle:`span`,body:`span`,"body-strong":`span`,label:`span`,caption:`span`,meta:`span`,metric:`span`,helper:`span`,link:`a`},Un={xs:`var(--font-size-xs)`,sm:`var(--font-size-sm)`,md:`var(--font-size-md)`,lg:`var(--font-size-lg)`,xl:`var(--font-size-xl)`,"2xl":`var(--font-size-2xl)`,"3xl":`var(--font-size-3xl)`,"4xl":`var(--font-size-4xl)`},Wn={regular:`var(--font-weight-regular)`,medium:`var(--font-weight-medium)`,semibold:`var(--font-weight-semibold)`,bold:`var(--font-weight-bold)`,extrabold:`var(--font-weight-extrabold)`},Gn={tight:`var(--line-height-tight)`,snug:`var(--line-height-snug)`,normal:`var(--line-height-normal)`,relaxed:`var(--line-height-relaxed)`},Kn={primary:N.textPrimary,secondary:N.textSecondary,muted:N.textMuted,subtle:N.textSubtle,inverse:N.textInverse,link:N.textLink,danger:N.danger,success:N.success};function qn(...e){return e.filter(Boolean).join(` `)}function Jn(e,t){if(e!=null)return t[e]||e}function Yn(e,t){return t===`link`||e===`a`?Vn:e===`p`?Bn:[`h1`,`h2`,`h3`,`h4`,`h5`].includes(e)?zn:Rn}function Xn(e,t){let n=e||Hn[t];if(n?.startsWith(`h`))return Number(n.slice(1))}function Zn({as:e,tag:t,variant:n=`body`,color:r,size:i,weight:a,lineHeight:s,align:c,truncate:l=!1,display:u,className:d,style:f,children:p,...m}){let h=t||e||Hn[n]||`span`,g=Yn(h,n),_=Xn(h,n),v={color:Jn(r,Kn),fontSize:Jn(i,Un),fontWeight:Jn(a,Wn),lineHeight:Jn(s,Gn),display:u,...f};return(0,o.jsx)(g,{..._?{level:_}:{},className:qn(`app-typography`,`app-typography--${n}`,r&&Kn[r]&&`app-typography--${r}`,c&&`app-typography--${c}`,l&&`app-typography--truncate`,d),style:v,...m,children:p})}var Qn=(e=``)=>e.trim().replace(/^\*\*(.*?)\*\*$/s,`$1`).replace(/^__(.*?)__$/s,`$1`),$n=(e=[])=>e.length>0&&e.every(e=>/^:?-{3,}:?$/.test(String(e).trim())),er=(e=``)=>{let t=String(e||``).replace(/\r\n?/g,`
2
2
  `).trim();if(!t)return null;let n=t.split(`
3
- `).filter(e=>e.trim().length>0);if(n.length<2)return null;if(n.some(e=>e.includes(` `))){let e=n.map(e=>e.split(` `).map(Qn)),t=Math.max(...e.map(e=>e.length));return t<2?null:{rows:e.map(e=>[...e,...Array(t-e.length).fill(``)]),hasHeaderRow:!0}}let r=n.filter(e=>e.includes(`|`)).map(e=>{let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(Qn)});if(r.length<2)return null;let i=r.findIndex($n),a=r.filter((e,t)=>t!==i),o=Math.max(...a.map(e=>e.length));return a.length<2||o<2?null:{rows:a.map(e=>[...e,...Array(o-e.length).fill(``)]),hasHeaderRow:i===1}},tr=(e,t,n)=>{let{table:r,tableRow:i,tableHeader:a,tableCell:o,paragraph:s}=e.nodes;if(!r||!i||!o||!s)return null;let c=t.map((t,r)=>{let c=n&&r===0&&a?a:o,l=t.map(t=>{let n=String(t??``),r=n?e.text(n):void 0;return c.create(null,s.create(null,r))});return i.create(null,l)});return r.create(null,c)};function P({onClick:e,active:t,disabled:n,title:r,children:i}){return(0,o.jsx)(`button`,{type:`button`,title:r,disabled:n,className:`tte-btn${t?` tte-btn--active`:``}`,onMouseDown:t=>{t.preventDefault(),e?.()},children:i})}function nr({editor:e,disabled:t}){return e?(0,o.jsxs)(`div`,{className:`tte-toolbar${t?` tte-toolbar--disabled`:``}`,children:[(0,o.jsxs)(`div`,{className:`tte-toolbar-group`,children:[(0,o.jsx)(P,{title:`Bold`,disabled:t,active:e.isActive(`bold`),onClick:()=>e.chain().focus().toggleBold().run(),children:(0,o.jsx)(`strong`,{children:`B`})}),(0,o.jsx)(P,{title:`Italic`,disabled:t,active:e.isActive(`italic`),onClick:()=>e.chain().focus().toggleItalic().run(),children:(0,o.jsx)(`em`,{children:`I`})}),(0,o.jsx)(P,{title:`Underline`,disabled:t,active:e.isActive(`underline`),onClick:()=>e.chain().focus().toggleUnderline().run(),children:(0,o.jsx)(`span`,{style:{textDecoration:`underline`},children:`U`})}),(0,o.jsx)(P,{title:`Strikethrough`,disabled:t,active:e.isActive(`strike`),onClick:()=>e.chain().focus().toggleStrike().run(),children:(0,o.jsx)(`s`,{children:`S`})})]}),(0,o.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,o.jsxs)(`div`,{className:`tte-toolbar-group`,children:[(0,o.jsx)(P,{title:`Bullet List`,disabled:t,active:e.isActive(`bulletList`),onClick:()=>e.chain().focus().toggleBulletList().run(),children:`≡`}),(0,o.jsx)(P,{title:`Ordered List`,disabled:t,active:e.isActive(`orderedList`),onClick:()=>e.chain().focus().toggleOrderedList().run(),children:`1.`})]}),(0,o.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,o.jsx)(`div`,{className:`tte-toolbar-group`,children:(0,o.jsx)(P,{title:`Link`,disabled:t,active:e.isActive(`link`),onClick:()=>{let t=window.prompt(`Enter URL`);if(!t){e.chain().focus().unsetLink().run();return}e.chain().focus().setLink({href:t}).run()},children:`🔗`})}),(0,o.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,o.jsxs)(`div`,{className:`tte-toolbar-group tte-table-tools`,children:[(0,o.jsx)(P,{title:`Insert 3 × 3 table`,disabled:t,active:e.isActive(`table`),onClick:()=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:`▦`}),e.isActive(`table`)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(P,{title:`Add column`,disabled:t||!e.can().addColumnAfter(),onClick:()=>e.chain().focus().addColumnAfter().run(),children:`C+`}),(0,o.jsx)(P,{title:`Delete column`,disabled:t||!e.can().deleteColumn(),onClick:()=>e.chain().focus().deleteColumn().run(),children:`C−`}),(0,o.jsx)(P,{title:`Add row`,disabled:t||!e.can().addRowAfter(),onClick:()=>e.chain().focus().addRowAfter().run(),children:`R+`}),(0,o.jsx)(P,{title:`Delete row`,disabled:t||!e.can().deleteRow(),onClick:()=>e.chain().focus().deleteRow().run(),children:`R−`}),(0,o.jsx)(P,{title:`Toggle header row`,disabled:t||!e.can().toggleHeaderRow(),onClick:()=>e.chain().focus().toggleHeaderRow().run(),children:`H`}),(0,o.jsx)(P,{title:`Delete table`,disabled:t||!e.can().deleteTable(),onClick:()=>e.chain().focus().deleteTable().run(),children:`🗑`})]})]}),(0,o.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,o.jsx)(`div`,{className:`tte-toolbar-group`,children:(0,o.jsx)(P,{title:`Clear formatting`,disabled:t,onClick:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),children:`✕`})})]}):null}function rr({value:e=``,onChange:t,disabled:n=!1,placeholder:i=``}){let a=(0,r.useRef)(e??``),s=(0,d.useEditor)({extensions:[f.default,m.default,p.default.configure({openOnClick:!1,HTMLAttributes:{rel:`noopener noreferrer`}}),h.Table.configure({resizable:!0,HTMLAttributes:{class:`email-template-table`}}),h.TableRow,h.TableHeader,h.TableCell],content:e,editable:!n,editorProps:{attributes:{class:`tte-content`},handlePaste:(e,t)=>{let n=er(t.clipboardData?.getData(`text/plain`)||``);if(!n)return!1;let r=tr(e.state.schema,n.rows,n.hasHeaderRow);if(!r)return!1;t.preventDefault();let i=e.state.tr.replaceSelectionWith(r,!1).scrollIntoView();return e.dispatch(i),!0}},onUpdate:({editor:e})=>{let n=e.getHTML(),r=n===`<p></p>`?``:n;a.current=r,t?.(r)}});return(0,r.useEffect)(()=>{if(!s||s.isDestroyed)return;let t=e||``;t!==(a.current||``)&&(a.current=t,s.commands.setContent(t,!1))},[e,s]),(0,r.useEffect)(()=>{s&&s.setEditable(!n)},[n,s]),(0,o.jsxs)(`div`,{className:`tte-wrapper${n?` tte-wrapper--disabled`:``}`,children:[(0,o.jsx)(nr,{editor:s,disabled:n}),(0,o.jsx)(d.EditorContent,{editor:s}),!e&&!s?.isFocused&&i&&(0,o.jsx)(`div`,{className:`tte-placeholder`,children:i})]})}var ir=/\{([A-Za-z0-9_.]+)\}/g,ar=e=>e==null||e===``||e===`_`;function or(e){return!!(e&&typeof e.path==`string`&&e.path.trim())}function sr(e,t,n={}){if(!or(e))return null;let r=n[String(e.service||`core`).toLowerCase()];if(!r)return null;let i=!1,a=e.path.trim().replace(ir,(e,n)=>{let r=typeof t==`function`?t(n):void 0;return ar(r)?(i=!0,``):encodeURIComponent(String(r))});return i?null:{base:r,path:a.startsWith(`/`)?a:`/${a}`}}function cr(e,t){let n=e&&typeof e==`object`&&`data`in e?e.data:e;return String(t||``).split(`.`).filter(Boolean).forEach(e=>{n=n==null?n:n[e]}),Array.isArray(n)?n:[]}function lr({routeParams:e={},searchParams:t,getFormValue:n}={}){return r=>{if(!ar(e[r]))return e[r];let i=t?.get?t.get(r):void 0;return ar(i)?typeof n==`function`?n(r):void 0:i}}function ur(e){let t=String(e??``).trim();if(!t)return{baseModule:``,nestedPath:``};let[n,...r]=t.split(`.`);return{baseModule:n.trim(),nestedPath:r.map(e=>e.trim()).filter(Boolean).join(`.`)}}function dr(e){return ur(e).baseModule}var fr=`test-flows`,pr=`lms-flows`;function mr(e){let t=(Array.isArray(e)?e:[e]).flat().map(e=>e&&typeof e==`object`?e.value??e.label??e.name??``:e).map(e=>String(e??``).trim().toLowerCase()).filter(Boolean);return t.includes(`dice`)?`dice`:t.includes(`internal`)?`internal`:t[0]||``}function hr(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function gr(e,t,n,r=``){let i=e?.count,a=t?.count,o=String(r??``).trim().toLowerCase();if(i&&typeof i==`object`){let e=hr(o?i[o]:void 0,i.total,i.searchCount,i.count);if(e!==void 0)return e}if(a&&typeof a==`object`){let e=hr(o?a[o]:void 0,a.total,a.searchCount,a.count);if(e!==void 0)return e}return hr(e?.total,typeof i==`object`?void 0:i,e?.totalCount,t?.total,typeof a==`object`?void 0:a,t?.totalCount,n.length)??0}function _r(e,t){let n={};return[e?.count,t?.count].forEach(e=>{!e||typeof e!=`object`||Object.entries(e).forEach(([e,t])=>{let r=Number(t);Number.isFinite(r)&&(n[String(e).trim().toLowerCase()]=r)})}),n}async function vr(e,n,r=``,i=50,a=0,o={}){let s=new URLSearchParams({module:dr(e),field:n,value:r,limit:String(i),offset:String(a)});return o.dataSource&&s.set(`dataSource`,o.dataSource),o.masterName&&s.set(`masterName`,o.masterName),o.groupName&&s.set(`groupName`,o.groupName),o.scope&&s.set(`scope`,o.scope),o.arrayLabelField&&s.set(`arrayLabelField`,o.arrayLabelField),o.arrayValueField&&s.set(`arrayValueField`,o.arrayValueField),t.t(t.x,`/filter-dropdown-values?${s}`)}async function yr(e,n=10,r=0,i={}){let{scope:a=``,sort:o=``,sortDir:s=``,filters:c=[]}=i;if(e===fr){let{getTestFlows:e}=await Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.t),t=await e({limit:n,offset:r}),i=Array.isArray(t?.items)?t.items:[],a=Number(t?.total)||0;return{items:i,total:a,limit:n,offset:r,tabs:[{key:`all`,title:`Test Cases`,count:a}]}}if(e===pr){let{getLmsFlows:e}=await Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.t),t=await e({limit:n,offset:r}),i=Array.isArray(t?.items)?t.items:[],a=Number(t?.total)||0;return{items:i,total:a,limit:n,offset:r,tabs:[{key:`all`,title:`LMS Cases`,count:a}]}}let l=new URLSearchParams({module:dr(e),limit:String(n),offset:String(r)}),u=String(a??``).trim();return u&&l.set(`scope`,u),o&&l.set(`sort`,o),s&&l.set(`sortDir`,s),Array.isArray(c)&&c.some(e=>e?.field)&&l.set(`filters`,JSON.stringify(c)),t.o(t.x,`/module-data-list?${l.toString()}`)}async function br(e,n){if(!e||!n)return null;try{let r=await t.o(t.x,`/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(n)}`),i=r?.data?.data??r?.data??r,a=Array.isArray(i)?i[0]:i;return a&&typeof a==`object`?a:null}catch{return null}}async function xr(e,n={},r={},i={}){let{limit:a=10,offset:o=0}=r,{sort:s=``,sortDir:c=``,scope:l=``,filters:u=[]}=i,d=mr(l||String(n.selectedSource??``).split(`,`)),f=new URLSearchParams;f.append(`module`,dr(e)),f.append(`limit`,String(a)),f.append(`offset`,String(o)),d&&(f.set(`scope`,d),console.log(`[searchModuleData] Adding scope to query:`,d)),s&&f.set(`sort`,s),c&&f.set(`sortDir`,c),Array.isArray(u)&&u.some(e=>e?.field)&&f.set(`filters`,JSON.stringify(u)),console.log(`[searchModuleData] Final query string:`,f.toString()),Object.entries(n).forEach(([e,t])=>{if(t==null||t===``)return;let n=t;n=typeof t==`object`?t.value??t.label??t.name??String(t):String(t),f.append(e,n)});let p=await t.o(t.x,`/module-data-list?${f.toString()}`),m=p?.data??p,h=Array.isArray(m)?m:m?.rows??m?.records??m?.items??m?.list??m?.data??[],g=gr(p,m,h,d),_=_r(p,m);d&&_[d]===void 0&&Number.isFinite(g)&&(_[d]=g);let v=h.some(e=>[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].flat().some(e=>String(e??``).trim().toLowerCase()===`dice`)||!!e?.customFields?.diceProfileData),y=h;if(v)try{let{transformDiceResponseToInternalFormat:e}=await Promise.resolve().then(()=>require("./diceCandidateMapper-BjMhHno3.cjs")).then(e=>e.t);y=e(p,p)?.data?.data??h}catch(e){console.error(`[searchModuleData] Dice transformation failed:`,e),y=h.map(wr)}else y=Array.isArray(h)?h.map(wr):[];return{rows:y,total:Number(g)||0,counts:_,tabs:p?.tabs??p?.tabList??m?.tabs??m?.tabList??[],fields:p?.fields??p?.fieldConfig??m?.fields??m?.fieldConfig??[],tabField:p?.tabField??m?.tabField??``,actionRules:m?.actionRules??[],actions:m?.actions??[],columnActions:m?.columnActions??[]}}function Sr(e,t){return String(t).split(`.`).reduce((e,t)=>e?.[t],e)}function Cr(e,t,n){let r=String(t).split(`.`).filter(Boolean);if(!r.length)return e;let i={...e},a=i,o=e;return r.slice(0,-1).forEach(e=>{let t=o?.[e],n=t&&typeof t==`object`&&!Array.isArray(t)?{...t}:{};a[e]=n,a=n,o=t}),a[r[r.length-1]]=n,i}function wr(e){if(!e||typeof e!=`object`)return e;let t=[`skills`,`technicalSkills`,`primarySkills`,`keySkills`,`customFields.diceProfileData.skills`],r=e,i=null;if(t.forEach(e=>{let t=Sr(r,e);if(t==null)return;let a=n.n(t);a.length===0&&Array.isArray(t)&&t.length>0||(i??=a,r=Cr(r,e,a))}),i&&Sr(r,`skills`)===void 0&&(r=Cr(r,`skills`,i)),[r?.sourceType,r?.profileSource,r?.selectedSource,r?.customFields?.sourceType,r?.customFields?.profileSource].flat().some(e=>String(e??``).trim().toLowerCase()===`dice`)||r?.customFields?.diceProfileData){let e=n.r(r),t=r?.candidateId??r?.customFields?.diceProfileData?.candidateId??``;r={...r,id:r?.id??e,diceId:e,candidateId:t}}return r}function Tr(e){return String(e??``).replace(/^__mw__.*?__/,``).replace(/\[\d+\]$/,``).trim()||`file`}async function Er(e,n,r=[],i={}){if(!e)throw Error(`moduleName is required to upload documents`);if(!n)throw Error(`refId (created record id) is required to upload documents`);if(!r.length)return{data:[],total:0};let a=await t.a(),o=new FormData;r.forEach(({formKey:e,file:t})=>{let n=t?.name??void 0;o.append(Tr(e),t,n)}),i&&Object.keys(i).length>0&&o.append(`metadata`,JSON.stringify(i));let s=new URLSearchParams({module:e,refId:String(n)}),c=await fetch(`${t.x}/documents/upload?${s.toString()}`,{method:`POST`,headers:{Authorization:`Bearer ${a}`},body:o}),l=(c.headers.get(`content-type`)||``).includes(`application/json`)?await c.json():await c.text();if(!c.ok){let e=Error(l?.error||l?.message||`API ${c.status}: ${c.statusText}`);throw e.status=c.status,e.data=l,e}return l?.data??l}async function Dr(e,n,r=``){if(!e)throw Error(`moduleName is required to fetch documents`);if(!n)throw Error(`refId is required to fetch documents`);let i=new URLSearchParams({module:e,refId:String(n)});r&&i.set(`fieldName`,r);let a=await t.o(t.x,`/documents?${i.toString()}`),o=a?.data??a??{};return{data:Array.isArray(o?.data)?o.data:Array.isArray(o)?o:[],total:o?.total??0}}async function Or(e){if(!e)return!1;try{return await t.o(t.x,`/documents/${encodeURIComponent(String(e))}`,{method:`DELETE`}),!0}catch{return!1}}function kr(){let e=Math.floor(Date.now()/1e3).toString(16).padStart(8,`0`).slice(0,8),t=new Uint8Array(8);if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`)crypto.getRandomValues(t);else for(let e=0;e<t.length;e+=1)t[e]=Math.floor(Math.random()*256);return`${e}${Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}`}function Ar(e){return(Array.isArray(e)?e:Array.isArray(e?.data)?e.data:[]).map(e=>String(e?.id??e?._id??``).trim()).filter(Boolean)}async function jr(e=[]){let t=Array.from(new Set((e||[]).map(e=>String(e||``).trim()).filter(Boolean)));t.length!==0&&await Promise.allSettled(t.map(e=>Or(e)))}var Mr={job:{fetchUrl:e=>`${t.T}/edit/detailed-view/${encodeURIComponent(e)}`},candidate:{fetchUrl:e=>`${t.S}/edit/detailed-view?_id=${encodeURIComponent(e)}`},candidates:{fetchUrl:e=>`${t.S}/edit/detailed-view?_id=${encodeURIComponent(e)}`},submission:{fetchUrl:e=>`${t.D}/edit/detailed-view?_id=${encodeURIComponent(e)}`}};async function Nr(e,n){let r=String(e??``).trim().toLowerCase();if(r===`job`||r===`jobs`){let{getJobDetailView:e}=await Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.r);return e(n)}if(r===`candidate`||r===`candidates`)return Fr(r===`candidate`?`candidate`:`candidates`,n);let i=new URLSearchParams({module:String(e??``),id:String(n)});return t.o(t.x,`/module-data-detail?${i.toString()}`)}async function Pr(e){let n=await t.o(t.x,`/module-actions?module=${encodeURIComponent(e)}`),r=n?.data??n??{};return{actions:Array.isArray(r.actions)?r.actions:[],actionRules:Array.isArray(r.actionRules)?r.actionRules:[]}}async function Fr(e,n){if(!e)throw Error(`module is required`);if(!n)throw Error(`id is required`);let r=Mr[e];if(!r)throw Error(`No edit config for module: ${e}`);let i=await t.a(),a=await fetch(r.fetchUrl(n),{method:`GET`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${i}`}});if(!a.ok)throw Error(`API ${a.status}: ${a.statusText}`);let o=await a.json();return o.data??o}async function Ir(e,n,r,i=[]){if(!e)throw Error(`module is required`);if(!n)throw Error(`id is required`);let a=await t.a(),o=new FormData;o.append(`json`,JSON.stringify(r)),(i??[]).forEach(({formKey:e,file:t})=>o.append(e,t));let s=await fetch(`${t.x}/module/update/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`,{method:`PUT`,headers:{Authorization:`Bearer ${a}`},body:o});if(!s.ok){let e=await s.text();console.error(`[updateRecord] Error response:`,e);let t=Error(Rr(e)||`API ${s.status}: ${s.statusText}`);throw t.status=s.status,t.response=Lr(e),t}let{invalidateFormGroupsCache:c}=await Promise.resolve().then(()=>require("./formGroupsCache-Bbz-28ws.cjs")).then(e=>e.n);c();let l=await s.json();return l.data??l}function Lr(e){let t=String(e??``).trim();if(!t.startsWith(`{`))return null;try{return JSON.parse(t)}catch{return null}}function Rr(e){let t=String(e??``).trim();if(!t.startsWith(`{`))return t;try{let e=JSON.parse(t),n=e?.error??e?.message;return typeof n==`string`&&n.trim()?n.trim():t}catch{return t}}var zr=e=>e?.data??e;async function Br(e,n){if(!e||!n)return[];let r=new URLSearchParams({module:e,id:String(n)}),i=zr(await t.o(t.x,`/module-activity?${r.toString()}`));return Array.isArray(i)?i:[]}async function Vr(e){if(!e)return[];let n=zr(await t.o(t.x,`/notes?relatedId=${encodeURIComponent(e)}`));return Array.isArray(n)?n:[]}async function Hr({relatedId:e,notes:n,title:r,notesFor:i}){return zr(await t.o(t.x,`/notes`,{method:`POST`,body:JSON.stringify({relatedId:e,notes:n,title:r,notesFor:i})}))}var Ur=(0,r.createContext)(void 0);function Wr(e,t){return(typeof e==`string`?e.trim():``)||bn(t)||yn()}function Gr(){let e=(0,r.useContext)(Ur);return Wr(e?.override,e?.moduleName)}function Kr(e,t){if(!e)return!0;let n=e.find(e=>e.name===t);return!n||n.enabled!==!1}function qr(e,t,n){if(!e)return!0;let r=e.find(e=>e.name===t);if(!r)return!0;let i=r.fields?.find(e=>e.field===n);return!i||i.locked?!0:i.enabled!==!1}function Jr(e,t,n){if(!e)return!0;let r=e.find(e=>e.name===t);if(!r)return!0;if(r.editable===!1)return!1;let i=r.fields?.find(e=>e.field===n);return!i||i.editable!==!1}var Yr=[`p`,`br`,`strong`,`b`,`em`,`i`,`u`,`s`,`ul`,`ol`,`li`,`blockquote`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`a`,`code`,`pre`],Xr=[`href`,`title`,`target`,`rel`],Zr=/[\u200B-\u200D\u2060\uFEFF]/g,Qr=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,$r=/^[\p{L}\p{M}\p{N} .'-]+$/u,ei=/^\+?[0-9 ()-]+$/,ti=/^-?(?:\d+|\d*\.\d+)$/,ni=[{re:/<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta|base|applet|frame|frameset)\b/i,message:`HTML/script content is not allowed`},{re:/\b(?:javascript|vbscript)\s*:|\bdata\s*:\s*text\/html/i,message:`Unsafe URL protocol is not allowed`},{re:/\bon[a-z]+\s*=/i,message:`HTML event handlers are not allowed`},{re:/["']?\$(?:where|gt|gte|lt|lte|ne|nin|regex|or|and|not|nor|expr|function|jsonSchema|accumulator)\b/i,message:`MongoDB operators are not allowed in input values`},{re:/(?:\.\.[/\\])|(?:%2e%2e|%5c)/i,message:`Path traversal is not allowed`},{re:/<\/?[a-zA-Z][a-zA-Z0-9]*(?:\s[^<>]*)?>/,message:`HTML tags are not allowed`,plainOnly:!0}];function ri(e){if(typeof document>`u`)return e;let t=document.createElement(`textarea`);return t.innerHTML=e,t.value}function ii(e){let t=String(e??``);for(let e=0;e<2;e+=1)try{let e=decodeURIComponent(t);if(e===t)break;t=e}catch{break}return t=ri(t).replace(/\\x([0-9a-f]{2})/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16))).replace(/\\u([0-9a-f]{4})/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16))),t.normalize(`NFC`)}function ai(e){return _.default.sanitize(String(e??``),{ALLOWED_TAGS:Yr,ALLOWED_ATTR:Xr,ALLOW_DATA_ATTR:!1,FORBID_TAGS:[`script`,`style`,`iframe`,`object`,`embed`,`svg`,`img`,`form`,`input`],FORBID_ATTR:[`style`,`src`,`srcset`]})}function oi(e){let t=(e.validations??[]).find(e=>e?.type===`max`),n=Number(e.validator?.maxLength??t?.value??e.maxLength);return Number.isFinite(n)&&n>0?n:e.type===`email`||e.formatter===`email`?255:e.formatter===`phone`||e.formatter===`digits`?32:e.formatter===`name`?100:e.type===`text-editor`?5e4:(e.type,5e3)}function si(e){return e.type===`textarea`||e.type===`text-editor`}function ci(e,t={}){if(typeof e!=`string`)return e;if(t.type===`text-editor`)return ai(e.normalize(`NFC`));let n=e.normalize(`NFC`).replace(Zr,``).replace(/\u00A0/g,` `).replace(Qr,``);return n=si(t)?n.replace(/\r\n?/g,`
4
- `).replace(/[ \t]{2,}/g,` `).trim():n.replace(/\s+/g,` `).trim(),n}function li(e,t={}){if(typeof e!=`string`||e===``)return null;let n=t.label||t.field||`Field`,r=ii(e);if(r.includes(`\0`)||r.includes(`\0`))return`${n} contains a null byte`;let i=t.type===`text-editor`,a=ni.find(({re:e,plainOnly:t})=>(!t||!i)&&e.test(r));if(a)return`${n}: ${a.message}`;let o=ci(e,t);return[...o].length>oi(t)?`${n} is too long`:t.formatter===`name`&&o&&!$r.test(o)?`${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods`:(t.formatter===`phone`||t.formatter===`digits`)&&o&&!ei.test(o)?`${n} contains invalid phone characters`:t.type===`number`&&o&&!ti.test(o)?`${n} must contain only a valid number`:(t.type===`url`||t.formatter===`url`)&&o&&!/^https?:\/\//i.test(o)?`${n} must use http:// or https://`:null}function ui(e){return{validator:(t,n)=>{let r=(Array.isArray(n)?n:[n]).map(t=>li(t,e)).find(Boolean);return r?Promise.reject(Error(r)):Promise.resolve()}}}function di(e=[]){let t=new Map;return e.forEach(e=>{(e.fields??[]).forEach(n=>{if(n.type===`file`)return;let r=n.payloadKey||n.field;if(!r)return;let i=e.addRow?`${e.payloadKey||e.name}[].${r}`:r;t.set(i,n)})}),t}function fi(e,t=[]){let n=di(t),r=(e,t=``)=>{if(typeof e==`string`){let r=n.get(t)??{},i=li(e,r);if(i)throw Error(i);return ci(e,r)}return Array.isArray(e)?e.map(e=>r(e,`${t}[]`)):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>{if(e.startsWith(`$`)||e.includes(`.`)||e.includes(`\0`))throw Error(`Unsafe object key: ${e}`);let i=t?`${t}.${e}`:e;return[e,r(n,i)]})):e};return r(e)}var pi=e=>e===!0||e===1||e===`1`||e===`true`;function mi(e){let t=e?.overrideCheckbox;return!t||typeof t!=`object`?null:gi(e).size>0?t:null}function hi(e){return String(e?.overrideCheckbox?.field??``).trim()||`${String(e?.field??``).replace(/\./g,`_`)}__override`}function gi(e){let t=e?.overrideCheckbox?.skipValidations,n=Array.isArray(t)?t:String(t??``).split(`,`);return new Set(n.map(e=>String(e??``).trim()).filter(Boolean))}function _i(e){return e?.overrideCheckbox?.store!==!1}function vi(e,t,n){let r=hi(e);if(typeof n==`function`){let e=n(r);if(Array.isArray(e)&&e.length)return[...e,r]}return Array.isArray(t)&&t.length>=3&&typeof t[1]==`number`?[t[0],t[1],r]:[r]}function yi(e,t){return n=>{let r=!1;try{r=pi(n?.getFieldValue?.(t))}catch{r=!1}return r?{}:e}}function bi(e,t,n,r){if(!mi(e))return r;let i=gi(e),a=vi(e,t,n);return e=>{let t=r(e),n=typeof e==`string`?e:e?.type;return i.has(n)?yi(t,a):t}}function xi(e){let t=mi(e)??{},n=e?.label??e?.field??`this field`;return{tone:t.tone??`overwrite`,title:t.confirmTitle||`Remove the validation on this field?`,body:t.confirmBody||`The check that keeps ${n} within its allowed limit will be turned off for this record, and a value above that limit will be accepted. The override is recorded against the record. Do you want to continue?`,okText:t.confirmOkText||`Yes, remove the limit`,cancelText:t.confirmCancelText||`Keep the limit`}}function Si(e){return String(e??``).normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,``)}function Ci(e){let t=new Map,n=(e,n)=>{let r=Si(e);r&&!t.has(r)&&t.set(r,n)};return(Array.isArray(e?.options)?e.options:[]).forEach(e=>{if(e==null)return;let t=typeof e==`object`?e.value:e;t!=null&&t!==``&&(n(t,t),typeof e==`object`&&e.label!==void 0&&n(e.label,t))}),Object.entries(e?.optionAliases??{}).forEach(([e,r])=>{let i=t.get(Si(r));i!==void 0&&n(e,i)}),t}var wi=e=>Array.isArray(e?.options)&&e.options.length>0;function Ti(e,t){if(t==null||t===``||typeof t==`object`)return t;let n=e.get(Si(t));return n===void 0?t:n}function Ei(e,t){if(!wi(e))return t;let n=Ci(e);return n.size===0?t:Array.isArray(t)?t.map(e=>Ti(n,e)):Ti(n,t)}function Di(e={}){let t=e?.defaultValue;if(t===void 0||t===``)return;if(e?.type===`time`)return Ai(t);if(e?.type===`date`)return Ni(t);if(e?.type!==`checkbox`)return t;let n=Array.isArray(e.options)?e.options:[];if(!n.length)return t;let r=n.map(e=>String(e&&typeof e==`object`?e.value:e));return(Array.isArray(t)?t:[t]).some(e=>r.includes(String(e)))?t:void 0}var Oi=/^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap]\.?\s?m\.?)?$/i,ki=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;function Ai(e){if(e==null||e===``)return;if(s.default.isDayjs(e))return e.isValid()?e:void 0;if(typeof e!=`string`)return;let t=e.trim(),n=t.match(Oi);if(n){let e=Number(n[1]),t=Number(n[2]),r=Number(n[3]??0),i=n[4]?.replace(/[.\s]/g,``).toLowerCase();if(i){if(e<1||e>12)return;e=e%12+(i===`pm`?12:0)}return e>23||t>59||r>59?void 0:(0,s.default)().hour(e).minute(t).second(r).millisecond(0)}if(ki.test(t)){let e=(0,s.default)(t);return e.isValid()?e:void 0}}var ji=/^today\s*(?:([+-])\s*(\d{1,4}))?$/i,Mi=/^\d{4}-\d{2}-\d{2}(?:[T ].*)?$/;function Ni(e,t=(0,s.default)()){if(e==null||e===``)return;if(s.default.isDayjs(e))return e.isValid()?e:void 0;if(e instanceof Date){let t=(0,s.default)(e);return t.isValid()?t:void 0}if(typeof e!=`string`)return;let n=e.trim(),r=n.match(ji);if(r){let e=r[2]?Number(r[2])*(r[1]===`-`?-1:1):0;return(0,s.default)(t).startOf(`day`).add(e,`day`)}if(Mi.test(n)){let e=(0,s.default)(n);return e.isValid()?e:void 0}}var Pi=`csvTags`,Fi=e=>e.toLowerCase();function Ii(e){let t=Array.isArray(e)?e:[e],n=[],r=new Set;return t.forEach(e=>{e!=null&&typeof e!=`object`&&String(e).split(`,`).forEach(e=>{let t=e.trim().replace(/\s+/g,` `);!t||r.has(Fi(t))||(r.add(Fi(t)),n.push(t))})}),n}function Li(e,t=`, `){return Ii(e).join(t||`, `)}var F=e=>e==null||e===``||Array.isArray(e)&&e.length===0,Ri=e=>e===!0||e===1||e===`1`,I=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!zi(e);function zi(e){return e&&typeof e==`object`&&typeof e.format==`function`&&typeof e.isValid==`function`}function Bi(e){return zi(e)||e instanceof Date}function Vi(e){return e instanceof Date?e.toISOString():zi(e)?e.isValid()?e.toISOString():null:e}function Hi(e,t){if(!jn(t))return Vi(e);let n=Mn(e);return n?n.toISOString():Vi(e)}function L(e,t){if(!t)return;let n=String(t).split(`.`),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}function R(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:L(e,t)}function z(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?!0:L(e,t)!==void 0}function B(e,t,n){let r=String(t).split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];I(i[t])||(i[t]={}),i=i[t]}return i[r[r.length-1]]=n,e}function Ui(e,t,n){let r=String(t).split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];I(i[t])||(i[t]={}),i=i[t]}let a=r[r.length-1];return i[a]=I(i[a])&&I(n)?{...n,...i[a]}:n,e}function Wi(e){let t=Array.isArray(e)?e:e==null?[]:[e];if(!t.length||t.some(e=>e?.originFileObj))return;let n=t.map(e=>e?.stored).filter(e=>e!=null);if(n.length)return n.length===1&&t.length===1?n[0]:n}function Gi(e,t){return Object.entries(t??{}).forEach(([t,n])=>{I(n)&&I(e[t])?Gi(e[t],n):e[t]=n}),e}function Ki(e,t){let n=e.options??e.values??[];for(let e of n)if(typeof e==`string`){if(e===t)return e}else if((e.value??e.id??e.name??e.label)===t)return e.label??e.name??e.value}function qi(e,t){if(I(e)){let n=(t.valueKey&&e[t.valueKey])??e.value??e.id??e._id??e.key??e.code;return{value:n,label:(t.displayKey&&e[t.displayKey])??e.label??e.name??e.text??e.title??n}}return{value:e,label:Ki(t,e)??e}}function Ji(e={}){if(e.dataType&&e.dataType!==`auto`)return e.dataType;if(e.multiSelect||e.mode===`multiple`||e.addRow)return`array`;if(e.type===`csvTags`)return`csv`;switch(e.type){case`number`:return`number`;case`date`:case`time`:return`date`;default:return`auto`}}function V(e,t,n={}){if(Bi(e)){if(t===`string`)return Hi(e,n);if(t===`number`){let t=zi(e)?e.valueOf():e.getTime();return Number.isNaN(t)?null:t}if(t===`date`||t===`auto`||!t)return Hi(e,n)}switch(t){case`string`:return e==null?``:String(e);case`csv`:return Li(e,n.csvSeparator);case`number`:{if(F(e))return null;let t=Number(e);return Number.isNaN(t)?null:t}case`boolean`:return e===!0||e===1||e===`1`||e===`true`;case`array`:{let t;return t=Array.isArray(e)?e:F(e)?[]:typeof e==`string`&&e.includes(`,`)?e.split(`,`).map(e=>e.trim()).filter(Boolean):[e],n.elementType?t.map(e=>V(e,n.elementType,{})).filter(e=>e!=null&&e!==``):t}case`object`:return I(e),e;case`date`:return Hi(e,n);case`custom`:case`auto`:case void 0:default:return e}}var Yi={firstChecked:e=>Array.isArray(e)?e[0]:e,csvToArray:e=>typeof e==`string`?e.split(`,`).map(e=>e.trim()).filter(Boolean):e,arrayToCsv:e=>Array.isArray(e)?e.join(`,`):e,trim:e=>typeof e==`string`?e.trim():e,upper:e=>typeof e==`string`?e.toUpperCase():e,lower:e=>typeof e==`string`?e.toLowerCase():e};function Xi(e,t){if(!t)return e;let n=t;if(typeof n==`string`){if(Yi[n])return Yi[n](e);try{n=JSON.parse(n)}catch{return e}}let r=e;if(n.name&&Yi[n.name]&&(r=Yi[n.name](r)),n.map&&typeof n.map==`object`){let e=String(Array.isArray(r)?r[0]:r);Object.prototype.hasOwnProperty.call(n.map,e)?r=n.map[e]:n.default!==void 0&&(r=n.default)}return r}var Zi=/\{\{\s*([\w.]+)\s*\}\}/g;function Qi(e,t){let[n,...r]=e.split(`.`),i;if(n===`value`)i=t.value;else if(n===`label`)i=t.label;else if(n===`raw`)i=t.raw;else return;return r.length?L(i,r.join(`.`)):i}function $i(e,t){if(typeof e==`string`){let n=e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);return n?Qi(n[1],t):e.replace(Zi,(e,n)=>{let r=Qi(n,t);return r==null?``:String(r)})}if(Array.isArray(e))return e.map(e=>$i(e,t));if(I(e)){let n={};return Object.entries(e).forEach(([e,r])=>{n[e]=$i(r,t)}),n}return e}function ea(e){if(!e)return null;if(typeof e==`string`)try{return JSON.parse(e)}catch{return null}return e}function ta(e,t){let n=e.payloadMode||`auto`,r=Ji(e),{value:i,label:a}=qi(t,e);switch(n){case`value`:return{kind:`scalar`,out:V(i,r,e)};case`label`:return{kind:`scalar`,out:V(a,e.dataType||`string`,e)};case`object`:{let t=e.valueKey||`id`,n=e.displayKey||`name`;return{kind:`scalar`,out:{[t]:V(i,e.elementType||`auto`,{}),[n]:a}}}case`custom`:case`template`:{let n=ea(e.payloadTemplate);if(!n)return{kind:`scalar`,out:V(i,r,e)};let o=$i(n,{value:V(i,e.elementType||`auto`,{}),label:a,raw:t});return{kind:e.payloadKey?`scalar`:`spread`,out:o}}default:return{kind:`scalar`,out:V(i,r,e)}}}function na(e={}){let t=e.defaultValue;if(t!==void 0&&t!==``)return e.type===`time`?Ai(t):e.type===`date`?Ni(t):t}function ra(e,t){if(e.payloadMode===`skip`)return{kind:`skip`};let n=t;if(F(n)){let t=na(e);t!==void 0&&(n=t)}return n=Xi(n,e.transformRule),F(n)&&e.omitEmpty?{kind:`skip`}:Array.isArray(n)&&(Ji(e)===`array`||e.payloadMode===`object`)&&e.payloadMode&&e.payloadMode!==`value`&&e.payloadMode!==`auto`?{kind:`scalar`,out:n.map(t=>ta(e,t).out)}:ta(e,n)}function ia(e={}){return!!e.richValue||[`label`,`object`,`custom`,`template`].includes(e.payloadMode)}function aa(e,t,n=[]){if(!ia(e)||t==null)return t;let r=e=>{if(I(e)&&e.value!==void 0)return e;let t=n.find(t=>String(t?.value??``)===String(e)||String(t?.label??``)===String(e));return{value:t?.value??e,label:t?.label??String(e)}};return Array.isArray(t)?t.map(r):r(t)}function oa(e,t,n){if(!e?.field)return!0;let r=z(t,e.field)?R(t,e.field):R(n??t,e.field),i=()=>String(e.value??``).split(`,`).map(e=>e.trim());switch(e.operator){case`eq`:return String(r??``)===String(e.value??``);case`neq`:return String(r??``)!==String(e.value??``);case`truthy`:return r!=null&&r!==``&&r!==!1;case`falsy`:return r==null||r===``||r===!1;case`notEmpty`:return Array.isArray(r)?r.length>0:!!r;case`in`:return i().includes(String(r??``));case`notIn`:return!i().includes(String(r??``));default:return!0}}function sa(e){let t=[];return e?.field&&t.push(e.field),Array.isArray(e?.conditions)&&e.conditions.forEach(e=>{e?.field&&t.push(e.field)}),t}function ca(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=>oa(e,t,n)),a=String(e.logic??`and`).toLowerCase()===`or`,o=a?i.some(Boolean):i.every(Boolean);if(e.field){let r=oa(e,t,n);o=a?o||r:o&&r}return o}return oa(e,t,n)}function la(e,t,n,r,i=new Set){let a=sa(e?.showIf);return!a.length||i.has(e.field)?!0:(i.add(e.field),ca(e.showIf,t,n)?a.every(e=>{let a=r?.get?.(e);return!a||la(a,t,n,r,i)}):!1)}function ua(e=[]){let t=new Map;return e.forEach(e=>(e.fields??[]).forEach(e=>{e?.field&&!t.has(e.field)&&t.set(e.field,e)})),t}function da(e={},{editing:t=!1}={}){let n={};return(e.fields??[]).forEach(e=>{if(!(!e.field||H(e))&&!(t&&!e.defaultOnEdit)&&e.defaultValue!==void 0&&e.defaultValue!==``){if(e.type===`time`){let t=Ai(e.defaultValue);t!==void 0&&(n[e.field]=t);return}if(e.type===`date`){let t=Ni(e.defaultValue);t!==void 0&&(n[e.field]=t);return}n[e.field]=e.defaultValue}}),n}function fa(e=[]){let t=[];return e.forEach(e=>{(e.fields??[]).forEach(n=>{t.push({field:n,group:e})})}),t}var pa=[`file`,`document`,`image`,`upload`,`attachment`];function H(e){return pa.includes(String(e?.type??``).trim().toLowerCase())}function ma(e=[]){return fa(e).map(({field:e})=>e).filter(H)}function ha(e){return String(e??``).trim().toLowerCase()}function ga(e,t){return!!t&&ha(e.moduleName)===t}function _a(e,t=[],n={}){let r=[],i=n.scope??`all`,a=ha(n.module),o=(e,t)=>{t!=null&&(Array.isArray(t)?t:[t]).forEach(t=>{let n=t?.originFileObj||t;(typeof File<`u`&&n instanceof File||typeof Blob<`u`&&n instanceof Blob)&&r.push({formKey:e,file:n})})};return(t??[]).forEach(t=>{let r=(t.fields??[]).filter(H);if(!r.length)return;let s=t.moduleName&&!ga(t,a),c=e=>s?`__mw__${t.moduleName}__${e}`:e;if(t.addRow){if(i===`flat`)return;let a=e[t.name];if(!Array.isArray(a))return;r.forEach(e=>{let t=e.fileKey??String(e.field).split(`.`)[0];a.forEach((r,i)=>{let a=c(n.indexed?`${t}[${i}]`:t);o(a,R(r,e.field))})});return}i!==`addRow`&&r.forEach(t=>{let n=c(t.fileKey??String(t.field).split(`.`)[0]);o(n,R(e,t.field))})}),r}function va(e,t,n={}){let r=I(n.base)?structuredClone(n.base):{};ma(t).forEach(e=>{(e.payloadKey||e.field)&&(xa(r,e.payloadKey||e.field),xa(r,e.field))});let i=ha(n.module),a=ua(t),o=new Map,s=e=>!e.moduleName||ga(e,i)?r:(o.has(e.moduleName)||o.set(e.moduleName,{}),o.get(e.moduleName));return(t??[]).forEach(t=>{let n=s(t),r=t.fields??[],i=t.toggleEnabled&&t.toggleField&&z(e,t.toggleField)?!!R(e,t.toggleField):!1;if(t.toggleEnabled&&t.toggleField&&z(e,t.toggleField)&&(B(n,t.toggleField,i),i&&t.addRow)){B(n,t.payloadKey||t.name,[]);return}if(t.addRow){let i=e[t.name];if(!Array.isArray(i))return;B(n,t.payloadKey||t.name,i.map(t=>ba(r,t,e,a)).filter(e=>e&&Object.keys(e).length>0));return}r.forEach(t=>ya(t,e,n,e,a))}),o.size>0&&(r.moduleWrites=Array.from(o,([e,t])=>({moduleName:e,data:t}))),fi(r,t)}function ya(e,t,n,r,i){if(mi(e)&&_i(e)){let r=hi(e);z(t,r)&&B(n,r,!!R(t,r))}if(H(e)){let i=Wi(R(t,e.field));if(i!==void 0){let a=r!==void 0&&r!==t;Ui(n,e.payloadKey||(a?e.field:e.fileKey||e.field),i)}return}if(sa(e.showIf).length&&!la(e,t,r,i)){(r===void 0||r===t)&&z(t,e.field)&&B(n,e.payloadKey||e.field,null);return}if(Array.isArray(e.subFields)&&e.subFields.length>0){if(!z(t,e.field))return;let a=R(t,e.field);if(!Array.isArray(a))return;let o=a.map(t=>ba(e.subFields,t,r,i)).filter(e=>e&&Object.keys(e).length>0);B(n,e.payloadKey||e.field,o);return}if(!z(t,e.field))return;if(Ri(e.addRow)&&(!Array.isArray(e.subFields)||e.subFields.length===0)){let r=R(t,e.field),i=Array.isArray(r)?r:F(r)?[]:[r],a=Ca(e),o=i.map(e=>ra(a,e)).filter(e=>e.kind!==`skip`).map(e=>e.out);B(n,e.payloadKey||e.field,o);return}let a=ra(e,R(t,e.field));if(a.kind!==`skip`){if(a.kind===`spread`&&I(a.out)){Gi(n,a.out);return}B(n,e.payloadKey||e.field,a.out)}}function ba(e,t,n,r){let i={};return e.forEach(e=>ya(e,t,i,n??t,r)),i}function xa(e,t){let n=String(t).split(`.`),r=e;for(let e=0;e<n.length-1;e+=1){if(!I(r[n[e]]))return;r=r[n[e]]}delete r[n[n.length-1]]}var Sa=new Set([`text`,`textarea`,`email`,`phone`,`tel`,`number`,`date`,`time`,`datetime`,`password`]);function U(e,t){let n=t=>(Array.isArray(e.emptyValues)?e.emptyValues:[]).some(e=>String(e)===String(t)),r=()=>e.defaultOnEdit?na(e):void 0;if(t==null)return r()??t;if(n(t)||F(t)&&r()!==void 0)return r();if(Sa.has(e.type)&&I(t)){let n=String(e.payloadKey||e.field||``).split(`.`).pop(),r=n?t[n]:void 0;if(r===void 0||I(r))return;t=r}if(e.type===`csvTags`)return Ii(t);if(e.type===`date`||e.type===`time`){if(!t||t===`0001-01-01T00:00:00Z`)return null;let e=(0,s.default)(t);return e.isValid()?e:null}t=Ei(e,t);let i=t=>I(t)?(e.valueKey&&t[e.valueKey])??t.id??t._id??t.value??t.userId??t.recruiterId:t,a=e.type!==`radio`&&Ji(e)===`array`,o=t=>{if(t==null||t===``||!Array.isArray(e.options))return t;let n=e.options.find(e=>String(e?.value??``).toLowerCase()===String(t).toLowerCase());return n?n.value:t};if(e.type===`select`||e.type===`radio`||e.type===`checkbox`){if(a)return(Array.isArray(t)?t:[t]).map(i).map(o).filter(e=>e!=null&&e!==``&&!n(e));let e=o(i(Array.isArray(t)?t[0]:t));return n(e)?r():e}return t}function Ca(e={}){return{...e,addRow:!1,multiSelect:!1,mode:void 0,dataType:void 0}}function wa(e,t){let n=Math.max(0,Number(e.minRows??0)||0),r=e.initialRows!==void 0&&e.initialRows!==``?Math.max(n,Math.max(0,Number(e.initialRows)||0)):n;if(Array.isArray(e.subFields)&&e.subFields.length>0){let i=[];Array.isArray(t)&&(i=t.map(t=>{let n={};return e.subFields.forEach(e=>{if(!e.field||H(e))return;let r=L(t??{},e.field)??(t??{})[e.field];r!=null&&(n[e.field]=U(e,r))}),n}));let a=i.length>0?n:Math.max(n,r);for(;i.length<a;)i.push({});return i}let i=Ca(e),a=[];if(Array.isArray(t))a=t.map(e=>U(i,e)).filter(e=>e!=null&&e!==``);else if(t!=null&&t!==``){let e=U(i,t);e!=null&&e!==``&&(a=[e])}let o=a.length>0?n:Math.max(n,r);for(;a.length<o;)a.push(void 0);return a}var Ta=e=>e===!0||e===1||e===`1`;function Ea(e=[]){let t=new Map;e.forEach(e=>{let n=e?.linkGroup;!Ta(e?.addRow)||!n||(t.has(n)||t.set(n,[]),t.get(n).push(e.name))});let n=new Map;return t.forEach((e,t)=>{e.length<2||n.set(t,{leaderName:e[0],memberNames:e})}),n}function Da(e,t){for(let n of e.values())if(n.memberNames.includes(t))return n;return null}function Oa(e,t={}){let n={...t};return e.forEach(({memberNames:e})=>{let t=Math.max(...e.map(e=>(n[e]??[]).length));e.forEach(e=>{let r=n[e]??[];r.length<t&&(n[e]=[...r,...Array.from({length:t-r.length},()=>({}))])})}),n}var ka={duplicate:{className:`fdd-tone-amber`,Icon:a.UserOutlined},overwrite:{className:`fdd-tone-amber`,Icon:a.ExclamationCircleFilled},suggestion:{className:`fdd-tone-blue`,Icon:a.InfoCircleFilled},file:{className:`fdd-tone-blue`,Icon:a.FileTextOutlined}};function Aa({tone:e=`suggestion`,title:t,body:n,facts:r=[],okText:a=`Continue`,cancelText:s=`Cancel`,danger:c=!1,footnote:l,altText:u}={}){let{className:d,Icon:f}=ka[e]??ka.suggestion,p=r.filter(e=>e&&e.value!==void 0&&e.value!==null&&String(e.value).trim()!==``);return new Promise(e=>{let r=!1,m=t=>{r||(r=!0,e(t))},h=i.Modal.confirm({...u?{footer:(e,{OkBtn:t,CancelBtn:n})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Button,{size:`large`,className:`fdd-alt-btn`,onClick:()=>{m(`alt`),h.destroy()},children:u}),(0,o.jsx)(n,{}),(0,o.jsx)(t,{})]})}:{},icon:null,centered:!0,width:u?600:480,className:`fdd-modal ${d}${u?` fdd-modal--three`:``}`,okText:a,cancelText:s,okButtonProps:{danger:c,size:`large`},cancelButtonProps:{size:`large`},content:(0,o.jsxs)(`div`,{className:`fdd`,children:[(0,o.jsxs)(`div`,{className:`fdd-head`,children:[(0,o.jsx)(`span`,{className:`fdd-icon`,"aria-hidden":`true`,children:(0,o.jsx)(f,{})}),(0,o.jsx)(`h3`,{className:`fdd-title`,children:t})]}),p.length>0&&(0,o.jsx)(`dl`,{className:`fdd-facts`,children:p.map(e=>(0,o.jsxs)(`div`,{className:`fdd-fact`,children:[(0,o.jsx)(`dt`,{children:e.label}),(0,o.jsx)(`dd`,{children:e.value})]},e.label))}),n&&(0,o.jsx)(`p`,{className:`fdd-body`,children:n}),l&&(0,o.jsx)(`p`,{className:`fdd-footnote`,children:l})]}),onOk:()=>m(!0),onCancel:()=>m(!1)})})}function ja({tone:e=`duplicate`,title:t,body:n,facts:r=[],okText:a=`Go back`}={}){let{className:s,Icon:c}=ka[e]??ka.suggestion,l=r.filter(e=>e&&String(e.value??``).trim()!==``);return new Promise(e=>{i.Modal.warning({icon:null,centered:!0,width:480,className:`fdd-modal ${s}`,okText:a,okButtonProps:{size:`large`},content:(0,o.jsxs)(`div`,{className:`fdd`,children:[(0,o.jsxs)(`div`,{className:`fdd-head`,children:[(0,o.jsx)(`span`,{className:`fdd-icon`,"aria-hidden":`true`,children:(0,o.jsx)(c,{})}),(0,o.jsx)(`h3`,{className:`fdd-title`,children:t})]}),l.length>0&&(0,o.jsx)(`dl`,{className:`fdd-facts`,children:l.map(e=>(0,o.jsxs)(`div`,{className:`fdd-fact`,children:[(0,o.jsx)(`dt`,{children:e.label}),(0,o.jsx)(`dd`,{children:e.value})]},e.label))}),n&&(0,o.jsx)(`p`,{className:`fdd-body`,children:n})]}),onOk:()=>e(!0)})})}async function Ma({module:e,group:n,field:r,actionKey:i,inputs:a={},files:o={}}){if(!e||!n||!r||!i)throw Error(`module, group, field and actionKey are required to run an AI action`);let s=await t.a(),c=new FormData;c.append(`json`,JSON.stringify({inputs:a})),Object.entries(o).forEach(([e,t])=>{t&&c.append(e,t)});let l=new URLSearchParams({module:e,group:n,field:r,action:i}),u=await fetch(`${t.x}/ai-action?${l.toString()}`,{method:`POST`,headers:{Authorization:`Bearer ${s}`},body:c}),{logout:d}=await Promise.resolve().then(()=>require("./authApi-DiRtkJl2.cjs")).then(e=>e.n);u.status===401&&d();let f=(u.headers.get(`content-type`)||``).includes(`application/json`)?await u.json():await u.text();if(!u.ok){let e=Error(f?.error||f?.message||`API ${u.status}: ${u.statusText}`);throw e.status=u.status,e.data=f,e}return f?.data??f}var Na=e=>e==null||e===``;function Pa(e,t){return String(t??``).split(`.`).filter(Boolean).reduce((e,t)=>e?.[t],e)}function Fa(e){let t=String(e??``).trim().replace(/[\s()-]/g,``);if(!t)return``;let n=t.replace(/^\+/,``);return/^\d{1,4}$/.test(n)?`+${n}`:``}function Ia(e){let t=String(e?.field??``).trim(),n=t.replace(/(number|no|phone|mobile|contact)$/i,``);return[...t?[`${t}CountryCode`,`${t}Code`]:[],...n&&n!==t?[`${n}CountryCode`]:[],`countryCode`,`phoneCountryCode`,`mobileCountryCode`,`contactCountryCode`,`dialCode`,`isdCode`]}function La(e,t,n=``){let r=e?.renderOptions?.countryCodeField??e?.countryCodeField,i=r?[r,...Ia(e)]:Ia(e);for(let e of i){let n=Fa(Pa(t,e));if(n)return n}return Fa(n)}function Ra(e){let t=String(e??``).trim(),n=t.match(/^(\+\d{1,4})[\s-]*(.*)$/);return n?{code:n[1],rest:n[2]}:{code:``,rest:t}}function za(e,t=``){if(Na(e))return``;let{code:n,rest:r}=Ra(e),i=n||Fa(t),a=gn(r)||r;return`${i?`${i} `:``}${a}`.trim()}function Ba(e,t,n){return za(t,La(e,n,mn()))}var Va=[{value:`auto`,label:`Default (auto)`},{value:`text`,label:`Text`},{value:`tag`,label:`Tag`},{value:`tags`,label:`Multi Tag (Skills)`},{value:`badge`,label:`Badge`},{value:`chip`,label:`Chip`},{value:`document`,label:`Document`},{value:`link`,label:`Link`},{value:`email`,label:`Email`},{value:`phone`,label:`Phone`},{value:`date`,label:`Date`},{value:`currency`,label:`Currency`},{value:`budget`,label:`Budget`},{value:`html`,label:`HTML`}],Ha=[{value:`preview`,label:`Preview (viewer)`},{value:`download`,label:`Download button`},{value:`link`,label:`Link (filename)`},{value:`tag`,label:`Tag`},{value:`text`,label:`Text (filename)`}],Ua=[{value:`none`,label:`None`},{value:`upper`,label:`UPPERCASE`},{value:`lower`,label:`lowercase`},{value:`title`,label:`Title Case`}],Wa=[`location`,`path`,`url`,`key`],Ga=[`location`,`filepath`,`path`,`url`,`key`],Ka=[`uploadedfilename`,`uploadname`,`originalname`,`displayname`,`documentname`,`filename`],qa=[`name`],Ja=e=>String(e).toLowerCase(),Ya=e=>e==null||e===``;function Xa(e,t){for(let n of t){let t=e[n];if(typeof t==`string`&&t)return t}return``}function Za(e,t){for(let n of t)for(let[t,r]of Object.entries(e))if(typeof r==`string`&&r&&Ja(t).endsWith(n))return r;return``}function Qa(e){if(!e)return``;let t=String(e).split(`?`)[0].split(`#`)[0];return decodeURIComponent(t.split(`/`).pop()||``)}function $a(e){if(!e)return``;let t=String(e);return/^https?:\/\//i.test(t)?t:``}function eo(e){let t=String(e??``).trim();return!t||/^https?:\/\//i.test(t)||t.startsWith(`blob:`)||t.startsWith(`data:`)?!1:t.includes(`/`)}function to(e){return typeof e==`string`?e.includes(`/`)?e:``:!e||typeof e!=`object`?``:Xa(e,Wa)||Za(e,Ga)}function no(e){return e?typeof e==`string`?Qa(e)||e:typeof e==`object`&&(Xa(e,A().documentNameOrder??[])||Za(e,Ka)||Qa(to(e))||Za(e,qa))||`Document`:`Document`}function ro(e){if(Ya(e))return[];let t=Array.isArray(e)?e:[e],n=[];for(let e of t)if(!Ya(e)){if(typeof e==`string`){let t=e.includes(`/`)?e:``;n.push({location:t,name:Qa(e)||e,url:$a(t),needsAuthFetch:eo(t)})}else if(typeof e==`object`){let t=to(e),r=e.fileUrl||e.downloadUrl||e.signedUrl||``;n.push({location:t,name:no(e),url:r||$a(t),documentId:e.id||e._id||e.documentId||``,needsAuthFetch:!r&&eo(t)})}}return n}function io(e){return e?.primaryField?e.primaryField:(e?.fields??[]).find(e=>e?.field)?.field??null}function ao(e,t){if(!Array.isArray(t)||t.length===0)return t;let n=io(e);if(!n)return t;let r=!1,i=t.map(e=>typeof e==`object`&&e&&!Array.isArray(e)?e:e==null||String(e).trim()===``?(r=!0,{}):(r=!0,{[n]:e}));return r?i:t}var oo=e=>e===!0||e===1||e===`1`,so=e=>e==null||e===``;function co(e){return String(e??``).split(`.`).map(e=>e.trim()).filter(Boolean)}function W(e,t,n){let r=Array.isArray(t)?t:co(t);if(!r.length)return e;let i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];(!i[t]||typeof i[t]!=`object`||Array.isArray(i[t]))&&(i[t]={}),i=i[t]}return i[r[r.length-1]]=n,e}function lo(e,t=[]){if(!(!e||typeof e!=`object`))for(let n of t){if(!n)continue;let t=L(e,n);if(!so(t))return t}}function uo(e,t){if(!e||typeof e!=`object`)return;let n=Object.entries(e),r=n.find(([e,n])=>t.test(e)&&!so(n));if(r)return r[1];for(let[,e]of n)if(e&&typeof e==`object`&&!Array.isArray(e)){let n=uo(e,t);if(!so(n))return n}}function fo(e,t){let n=Array.isArray(e)?e:e?[e]:[];if(!n.length)return;let r=n.map((e,n)=>{if(typeof e==`string`)return{uid:`${t.field}-${n}`,name:e,status:`done`};if(!e||typeof e!=`object`)return null;let r=lo(e,[t.fileUrlKey,t.locationKey])??uo(e,/(location|url|path)$/i)??``,i=lo(e,[t.fileNameKey])??uo(e,/(uploadName|uploadedFileName|fileName|name)$/i)??``;if(!r&&!i)return null;let a=r&&!String(r).startsWith(`http`)?$a(r):r;return{uid:String(e.id??e._id??e.uniqueName??e.documentCopyUniqueName??`${t.field}-${n}`),name:i||`file`,status:`done`,existing:!0,url:a||void 0,stored:e}}).filter(Boolean);return r.length?r:void 0}function po(e,t){if(!e||typeof e!=`object`)return;let n=lo(e,[t.fileNameKey,t.field])??uo(e,/(uploadName|uploadedFileName|fileName|name)$/i),r=lo(e,[t.fileUrlKey,t.locationKey])??uo(e,/(location|url|path)$/i)??``;if(!n&&!r)return;let i=r&&!String(r).startsWith(`http`)?$a(r):r,a=e.documentCopyUniqueName??e.uniqueName??n??`${t.field}-0`;return[{uid:String(a),name:n??`file`,status:`done`,existing:!0,url:i||void 0}]}function mo(e,t,n,r){(e.fields??[]).forEach(e=>{e?.verifyAction&&[e.verifyResultField,e.verifyTimestampField,...String(e.verifyLockedWhenFields??``).split(/[,\s]+/)].map(e=>String(e??``).trim()).filter(Boolean).forEach(e=>{if(L(n,e)!==void 0)return;let i=r(t,{field:e});i!=null&&W(n,e,i)})})}function ho(e){let t=Array.isArray(e.rows)?ao(e,e.rows):null,n=Math.max(0,Number(e.minRows??0)||0),r=(t,n,r)=>{let i={};return(e.fields??[]).forEach(e=>{if(!e.field)return;if(e.type===`file`){let r=n(t,e);r&&W(i,e.field,r);return}let a=r(t,e);if(a==null){let t=e.defaultOnEdit?na(e):void 0;t!==void 0&&W(i,e.field,t);return}W(i,e.field,oo(e.addRow)?wa(e,a):U(e,a))}),mo(e,t,i,r),i},i=da(e,{editing:!0});if(t&&t.length>0){let e=t.map(e=>r(e,(e,t)=>po(e,t),(e,t)=>L(e,t.field)));for(;e.length<n;)e.push({...i});return e}let a=r(e,(e,t)=>fo(t.value,t),(e,t)=>t.value),o=Object.keys(a).length>0?[a]:[];for(;o.length<n;)o.push({...i});return o}function go(e,t=[]){let n={};return t.forEach(e=>{e.toggleEnabled&&e.toggleField&&W(n,e.toggleField,!!e.toggleValue),!e.addRow&&(e.fields??[]).forEach(e=>{if(!e.field||e.addRow)return;let t=e.value,r=e.field;if(e.type===`file`){let i=fo(t,e);i&&W(n,r,i);return}if(t==null)return;if(e.type===`checkbox`&&Array.isArray(e.options)&&e.options.length>0){let i=e.transformRule?.map;if(i){let e=Object.entries(i).find(([,e])=>String(e)===String(t));W(n,r,e?[e[0]]:[])}else W(n,r,Ei(e,Array.isArray(t)?t:[t]));return}let i=e.splitDialCodeInto;if(i&&typeof t==`string`){let{code:a,rest:o}=Ra(t),s=Fa(a);s&&W(n,i,s),W(n,r,U(e,o||t));return}W(n,r,U(e,t))})}),Object.keys(n).length>0&&e.setFieldsValue(n),n}function _o(e){let t=document.createElement(`div`);return t.innerHTML=String(e??``),t.textContent||t.innerText||``}function vo(e,t){return t&&t===`stripHtml`?_o(e):e}function yo(e){return String(e??``).trim().split(/\s+/).filter(Boolean).length}function bo(e){return Object.values(e||{}).some(e=>e!=null&&e!==``)}function xo(e,t){if(e.kind===`file`)return Array.isArray(t)?t.length>0:!!t;let n=vo(t,e.transform),r=String(n??``).trim();if(!r)return!1;let i=Number(e.minWords)||0;return i>0?yo(r)>=i:!0}function So(e,t){let n=e.inputs||[];if(n.length===0)return!0;let r=new Map;n.forEach((e,t)=>{let n=e.group||`__solo_${t}`;r.has(n)||r.set(n,[]),r.get(n).push(e)});for(let e of r.values())if(e.some(e=>e.required||Number(e.minWords)>0)&&!e.some(e=>xo(e,t(e.sourceField))))return!1;return!0}function Co(e=[]){let t=[];return e.forEach(e=>{if(e?.addRow){e.name&&t.push(e.name);return}(e?.fields??[]).forEach(e=>{let n=e?.field??e?.name;n&&t.push(n)})}),t}function wo(e,t){return Co(t).some(t=>{let n=e.getFieldValue(t);return Array.isArray(n)?n.some(bo):n!=null&&n!==``})}function To(e,t=[],{includeUntouched:n=!1}={}){let r=e.getFieldsValue(!0)??{},i=new Set([t].flat().filter(Boolean)),a=n||typeof e.isFieldTouched!=`function`?()=>!0:t=>e.isFieldTouched(t),o=0;return Object.entries(r).forEach(([e,t])=>{if(!(i.has(e)||!a(e)||!Eo(t))){if(Array.isArray(t)){o+=t.filter(e=>e&&typeof e==`object`?bo(e):!!e).length;return}o+=1}}),o}function Eo(e){return e==null||e===``?!1:Array.isArray(e)?e.some(e=>e&&typeof e==`object`?bo(e):!!e):typeof e!=`object`||Object.values(e).some(e=>e!=null&&e!==``)}function Do(e,t=[],{includeUntouched:n=!1}={}){let r=e.getFieldsValue(!0)??{},i=new Set([t].flat().filter(Boolean)),a=Object.keys(r).filter(e=>!i.has(e));return n?a.some(e=>Eo(r[e])):typeof e.isFieldTouched==`function`?a.some(t=>e.isFieldTouched(t)&&Eo(r[t])):a.some(e=>Eo(r[e]))}function Oo(e=[]){let t={};return(e??[]).forEach(e=>{e?.addRow||(e?.fields??[]).forEach(e=>{let n=e?.field??e?.name;if(!n)return;let r=e?.value;r!=null&&r!==``&&(t[n]=r)})}),t}function ko(e,t,n){let r=e?.confirmWhen??`never`;return r===`never`?!1:r===`always`||wo(t,n)}var Ao=[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`],jo=`bottom-left`;function Mo(e=[]){let t={};return e.forEach(e=>{let n=Ao.includes(e.position)?e.position:jo;(t[n]??=[]).push(e)}),t}function No({form:e,groups:t,module:n,onApplied:a,onParsed:o,treatPrefilledAsData:s=!1}){let[c,l]=(0,r.useState)(null),[u,d]=(0,r.useState)(``),f=i.Form.useWatch(e=>e,e),p=(0,r.useCallback)(e=>So(e,e=>(f||{})[e]),[f]),m=(0,r.useCallback)(t=>{if(!Array.isArray(t)||t.length===0)return!1;let n=go(e,t.filter(e=>!e.addRow)),r=Object.keys(n).length>0;return t.forEach(t=>{if(!t.addRow||!Array.isArray(t.rows)||t.rows.length===0)return;let n=ho(t);if(n.length===0)return;r=!0;let i=()=>e.setFieldsValue({[t.name]:n}),a=(e.getFieldValue(t.name)||[]).filter(bo);if(a.length){let e=t.label||t.name;Aa({tone:`overwrite`,title:`Replace what's in ${e}?`,facts:[{label:`Section`,value:e},{label:`Rows you filled in`,value:a.length},{label:`Rows in the file`,value:n.length}],body:`Everything currently in ${e} will be removed and replaced with what the file says. The rest of the form is not affected.`,okText:`Replace them`,cancelText:`Keep mine`,danger:!0}).then(e=>{e&&i()})}else i()}),r},[e]);return{runAction:(0,r.useCallback)(async(t,r,c,u)=>{let f=c?.confirmWhen??`never`;if(c?.trigger===`upload`&&f!==`never`&&(f===`always`||Do(e,[r?.field],{includeUntouched:s}))){let t=c.confirmMessages??{},n=u?.name||e.getFieldValue(r?.field)?.slice?.(-1)?.[0]?.name,i=To(e,[r?.field],{includeUntouched:s});if(!await Aa({tone:`overwrite`,title:t.title||`Read this file and fill the form in?`,facts:[{label:`File`,value:n},{label:`You have filled in`,value:i?`${i} ${i===1?`answer`:`answers`}`:void 0}],body:t.body||`We can read the details out of this file and fill the form in for you. Where the file has an answer, it replaces what is currently in that box. Anything the file does not mention is left as you typed it.`,okText:t.ok||`Read it and fill in`,cancelText:t.cancel||`Keep what I typed`}))return}l(c.key),d(c.loadingText||`Reading ${c.label||`the file`}…`);try{let s={},l={};(c.inputs||[]).forEach(t=>{if(t.kind===`file`){let n=e.getFieldValue(t.sourceField),r=u??n?.[n.length-1]?.originFileObj;r&&(l[t.param]=r)}else{let n=e.getFieldValue(t.sourceField);n!=null&&n!==``&&(s[t.param]=vo(n,t.transform))}}),(c.inputs||[]).forEach(e=>{!e.group||e.kind!==`text`||(c.inputs||[]).some(t=>t.group===e.group&&t.kind===`file`&&l[t.param])&&delete s[e.param]});let d=await Ma({module:n,group:t,field:r.field,actionKey:c.key,inputs:s,files:l}),f=c.label||`AI action`,p=d?.groups;if(c?.trigger!==`upload`&&ko(c,e,p)){let e=c.confirmMessages??{},t=Co(p).length;if(!await Aa({tone:`overwrite`,title:e.title||`Fill the form in from ${f}?`,facts:[{label:`Source`,value:f},{label:`Boxes it would fill`,value:t||void 0}],body:e.body||`We found details you can use. Applying them will replace what you have already entered in those boxes.`,okText:e.ok||`Use these details`,cancelText:e.cancel||`Keep what I typed`}))return i.message.info(`${f} cancelled — your entries were kept.`),d}if(o){let e=await o({action:c,field:r,groupName:t,responseGroups:p,payload:Oo(p)});if(e===!1||e===`abort`)return d}let h=m(p);return h?i.message.success(`${f} completed successfully.`):i.message.info(`${f} completed, but no matching details were found.`),h&&a&&await a({action:c,field:r,groupName:t}),d}catch(e){i.message.error(e?.message||`${c.label||`AI action`} failed`);return}finally{l(null),d(``)}},[e,n,m,a,o,s]),loadingKey:c,loadingText:u,busy:c!==null,isActionEnabled:p}}function Po({position:e,actions:t,aiActions:n,groupName:r,field:a}){if(!t||t.length===0)return null;let s=e.endsWith(`center`)?`center`:e.endsWith(`right`)?`flex-end`:`flex-start`;return(0,o.jsx)(i.Space,{size:8,className:`v1-ai-action-buttons`,style:{width:`100%`,justifyContent:s},children:t.map(e=>(0,o.jsx)(i.Button,{size:`small`,loading:n.loadingKey===e.key,disabled:n.busy||!n.isActionEnabled(e),onClick:()=>n.runAction(r,a,e),children:e.label},e.key))})}function Fo(e){let t=String(e??``).trim(),n=/^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);if(!n)return!1;let[,r,i]=n;return/[A-Za-z]/.test(r)&&/[A-Za-z]/.test(i)}function Io(e=`Email`,t){return{validator:(n,r)=>r==null||r===``||Fo(r)?Promise.resolve():Promise.reject(Error(t??`Enter a valid ${e}; numeric-only email addresses are not allowed`))}}var Lo=[{label:`Only Numbers`,value:`onlyNumber`},{label:`Only Letters`,value:`onlyLetter`},{label:`Only Letters & Spaces`,value:`onlyLettersAndSpace`},{label:`Only Alphanumeric`,value:`onlyAlphanumeric`},{label:`Alphanumeric & Spaces`,value:`alphanumericSpace`},{label:`Letters, Numbers & Hyphen`,value:`onlyLettersNumberAndHyphen`},{label:`Letters, Numbers, Hyphen & Dot`,value:`onlyLettersNumberHyphenAndDot`},{label:`Contact Number (digits, (), -)`,value:`contactNumber`},{label:`Email (reject numeric-only address)`,value:`email`},{label:`Job Title (letters, nums, symbols)`,value:`jobTitle`},{label:`MSP / Ref ID (alphanumeric only)`,value:`mspRefId`},{label:`Location (letters, nums, , . -)`,value:`locationValidation`},{label:`Decimal / Range (number + dot)`,value:`decimalRange`},{label:`Budget (numbers, must be > 0)`,value:`budgetValidation`},{label:`Experience (numbers only)`,value:`experience`},{label:`Numeric — 2 digits max`,value:`numericTwoDigits`},{label:`Job Description (character count)`,value:`jobDescription`},{label:`Website URL`,value:`websiteUrl`}],Ro={onlyNumber:/^[0-9]$/,experience:/^[0-9]$/,numericTwoDigits:/^[0-9]$/,budgetValidation:/^[0-9]$/,onlyLetter:/^[a-zA-Z\s]$/,onlyLettersAndSpace:/^[a-zA-Z\s]$/,onlyAlphanumeric:/^[a-zA-Z0-9]$/,alphanumericSpace:/^[a-zA-Z0-9\s]$/,mspRefId:/^[a-zA-Z0-9]$/,onlyLettersNumberAndHyphen:/^[a-zA-Z0-9\s-]$/,locationValidation:/^[a-zA-Z0-9\s\-.,]$/,jobTitle:/^[a-zA-Z0-9\s\-.,/&+()*'"#@]$/,decimalRange:/^[0-9.]$/,contactNumber:/^[0-9()\-+\s]$/};function zo(e){return Ro[e]??null}function Bo(e,t={},n=`change`){if(!t?.type||e==null)return{cleaned:e??``,error:null};let r=String(e),{type:i,maxLength:a,maxChars:o}=t,s=t.title||`Field`,c,l=null,u=e=>n===`blur`?e.trim():e.replace(/^\s+/,``);switch(i){case`onlyNumber`:case`experience`:case`numericTwoDigits`:{let e=Number(a??(i===`numericTwoDigits`?2:10));c=r.replace(/[^0-9]/g,``),r!==c&&(l=`${s} allows only numbers.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLetter`:{let e=Number(a??50);c=r.replace(/[^a-zA-Z]/g,``),r!==c&&(l=`${s} allows only letters.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersAndSpace`:{let e=Number(a??55);c=u(r.replace(/[^a-zA-Z\s]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters and spaces.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyAlphanumeric`:case`mspRefId`:{let e=Number(a??50);c=u(r.replace(/[^a-zA-Z0-9]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters and numbers.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`alphanumericSpace`:{let e=Number(a??100);c=u(r.replace(/[^a-zA-Z0-9\s]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers and spaces.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersNumberAndHyphen`:{let e=Number(a??55);c=u(r.replace(/[^a-zA-Z0-9\s-]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers and hyphens.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersNumberHyphenAndDot`:{let e=Number(a??100);c=r.replace(/[^a-zA-Z0-9\-./#+[\]{}()\s]/g,``).slice(0,e),r!==c&&(l=`${s} allows only letters, numbers, hyphens and dots.`);break}case`contactNumber`:{let e=Number(a??15);c=r.replace(/[^0-9()\-+\s]/g,``).slice(0,e),r===c?c&&!/^(\+?[0-9]{1,3}[- ]?)?(\(?\d{1,4}\)?[- ]?)?[\d\-\s]{3,15}$/.test(c)&&(l=`${s} is not a valid phone number format.`):l=`${s} allows only digits, parentheses () and hyphens.`;break}case`locationValidation`:{let e=Number(a??100);c=u(r.replace(/[^a-zA-Z0-9\s\-.,]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers, spaces, commas, dots and hyphens.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`jobTitle`:{let e=Number(a??80);c=u(r.replace(/[^a-zA-Z0-9\s\-/&.,()+#@'"*]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers, spaces and common symbols.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`decimalRange`:{let e=r.replace(/[^0-9.]/g,``);if((e.match(/\./g)||[]).length>1){let t=e.indexOf(`.`);e=e.slice(0,t+1)+e.slice(t+1).replace(/\./g,``),l=`${s} can have only one decimal point.`}let t=e.replace(/\./g,``),n=Number(a??10);t.length>n&&(e=e.slice(0,n+ +!!e.includes(`.`)),l=`${s} cannot exceed ${n} digits.`),c=e,!l&&r!==c&&(l=`${s} allows only numbers and one dot.`);break}case`budgetValidation`:{let e=Number(a??10);c=r.replace(/[^0-9]/g,``).slice(0,e);let t=Number(c);r===c?c&&t<=0&&(l=`${s} must be greater than 0.`):l=`${s} allows only numbers.`;break}case`jobDescription`:{let e=Number(o??a??1500);r.replace(/<[^>]+>/g,` `).replace(/&nbsp;/g,` `).replace(/\s+/g,` `).trim().length>e&&(l=`${s} cannot exceed ${e} characters.`),c=r;break}case`email`:c=n===`blur`?r.trim():r,c&&!Fo(c)&&(l=`${s} must be a valid email address; numeric-only email addresses are not allowed.`);break;case`websiteUrl`:c=n===`blur`?r.trim():r,c&&!/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/i.test(c)&&(l=`${s} must be a valid URL.`);break;default:c=r}return{cleaned:c,error:l}}var Vo=`This value is already present`;function Ho(e){return typeof e==`string`?e:e?.type??e?.rule??e?.name}function Uo(e){if(Ho(e)!==`unique`)return null;if(typeof e==`string`)return{message:Vo,normalizer:`trim`,skipBlank:!0,validateOn:`blur`};let t=e.value&&typeof e.value==`object`?e.value:e,n=String(t.validateOn??`blur`).toLowerCase();return{message:typeof e.message==`string`&&e.message.trim()?e.message.trim():Vo,collectionField:t.collectionField??``,normalizer:String(t.normalizer??`trim`),skipBlank:t.skipBlank!==!1,validateOn:[`blur`,`change`,`submit`].includes(n)?n:`blur`}}function Wo(e){let t=e?.validations??e?.validation??e?.rules??[];if(!Array.isArray(t))return null;for(let e of t){let t=Uo(e);if(t)return t}return null}function Go(e=[]){let t=[];return(Array.isArray(e)?e:[]).forEach(e=>{(e?.fields??[]).forEach(e=>{let n=Wo(e);!n||!e?.field||t.push({field:e.field,label:e.label??e.field,rule:n})})}),t}function Ko(e){return e==null?!0:typeof e==`number`?Number.isNaN(e):typeof e==`boolean`?!1:Array.isArray(e)?e.length===0:String(e).trim()===``}function qo(e,t=`trim`){if(e==null)return``;let n=String(e);switch(String(t)){case`exact`:return n;case`lower`:case`trimLower`:case`email`:return n.trim().toLowerCase();case`digitsOnly`:return n.replace(/\D+/g,``);default:return n.trim()}}function Jo(e,t){return!(!e||e.skipBlank!==!1&&Ko(t))}function Yo(e){return!e||e.validateOn===`submit`?[]:e.validateOn===`change`?[`onChange`,`onBlur`]:[`onBlur`]}var G={SKIPPED:`skipped`,AVAILABLE:`available`,DUPLICATE:`duplicate`,STALE:`stale`,ERROR:`error`};function Xo({module:e,field:t,recordId:n,normalized:r}){return`${e}${t}${n??``}${r}`}function Zo({checkFieldUnique:e,onPendingChange:t}={}){let n=new Map,r=new Map,i=0,a=0;function o(e){a=e,typeof t==`function`&&t(a)}async function s({module:t,field:s,rule:c,value:l,recordId:u,clientId:d,region:f}={}){if(!c||!t||!s||typeof e!=`function`||!Jo(c,l))return{status:G.SKIPPED};let p=Xo({module:t,field:s,recordId:u,normalized:qo(l,c.normalizer)});if(n.has(p))return n.get(p);i+=1;let m=i;r.set(s,m),o(a+1);try{let i=await e({module:t,field:s,value:l,recordId:u,clientId:d,region:f});if(r.get(s)!==m)return{status:G.STALE};let a=i?.available===!1?{status:G.DUPLICATE,message:Qo(i)||c.message||Vo}:{status:G.AVAILABLE};return n.set(p,a),a}catch(e){return r.get(s)===m?{status:G.ERROR,error:e}:{status:G.STALE}}finally{o(Math.max(0,a-1))}}return{check:s,isPending:()=>a>0,pendingCount:()=>a,reset:()=>{n.clear(),r.clear()}}}function Qo(e){return(e?.errors??[]).find(e=>e?.message)?.message||e?.message||``}var $o=`__uniqueRule`;function es({field:e,validation:t,context:n}){let r=Uo(t);if(!r)return{validator:()=>Promise.resolve()};let i=e?.field??``;return!n?.checker||!n?.module||!i?{validator:()=>Promise.resolve()}:{[$o]:r,validateTrigger:Yo(r),validator:async(e,t)=>{let a=await n.checker.check({module:n.module,field:i,rule:r,value:t,recordId:n.recordId,clientId:n.clientId,region:n.region});return a.status===G.DUPLICATE?Promise.reject(Error(a.message||r.message)):Promise.resolve()}}}function ts(e=[]){let t=Array.isArray(e)?e:[];if(!t.some(e=>e&&e[$o]))return t;let n=t.filter(e=>e&&!e[$o]&&!e.warningOnly);return t.map(e=>{if(!e||!e[$o])return e;let t=e.validator;return{...e,validator:async(e,r)=>await ns(n,r,e)?Promise.resolve():t(e,r)}})}async function ns(e=[],t,n={}){for(let r of e)if(!(!r||typeof r==`string`)){if(r.required&&Ko(t)||!Ko(t)&&(r.pattern instanceof RegExp&&!new RegExp(r.pattern.source,r.pattern.flags).test(String(t))||r.len!=null&&String(t).length!==Number(r.len)))return!0;if(typeof r.validator==`function`)try{await r.validator(n,t)}catch{return!0}}return!1}function rs(e){let t=String(e??``).trim();if(!t.startsWith(`{`))return null;try{return JSON.parse(t)}catch{return null}}function is(e){if(!e)return null;if(typeof e==`string`)return rs(e);let t=[e.data,e.response,e,rs(e.message)];for(let e of t)if(!(!e||typeof e!=`object`)&&(Array.isArray(e.errors)||e.code===`DUPLICATE_VALUE`))return e;return null}function as({field:e,group:t,rowIndex:n}){let r=String(e??``),i=Number(n);return t&&Number.isInteger(i)&&i>=0?[String(t),i,...r.split(`.`)]:r}function os(e,{uniqueRules:t=[]}={}){let n=is(e);if(n){let e=(Array.isArray(n.errors)?n.errors:[]).filter(e=>e?.field).map(e=>{let t={field:e.field,name:as(e),message:e.message||n.message||Vo};return Array.isArray(t.name)&&(t.group=String(e.group),t.rowIndex=Number(e.rowIndex)),t});if(e.length)return e}let r=String((n&&(n.message||n.error))??(typeof e==`string`?e:e?.message)??``).trim();if(!r)return[];let i=e?.status===409||n?.code===`DUPLICATE_VALUE`,a=t.filter(e=>String(e?.rule?.message??``).trim().toLowerCase()===r.toLowerCase());return a.length&&(i||a.length===1)?a.map(e=>({field:e.field,name:e.field,message:r})):[]}var ss=e=>e===!0||e===1||e===`1`||typeof e==`string`&&e.trim().toLowerCase()===`true`;function cs(e){return!!(e&&typeof e==`object`&&ss(e.warningOnly))}function ls({label:e,message:t,rule:n}){let r={pattern:new RegExp(n.pattern??n.value,n.flags),message:t??`Enter valid ${e}`};return cs(n)&&(r.warningOnly=!0),r}function us(e){return cs(e)}function ds(e,t){return e?.type===`pattern`&&t?.warningOnly===!0&&(e.warningOnly=!0),e}function fs(e){return typeof e==`string`?e.toUpperCase():e}async function ps({module:e,field:n,value:r,recordId:i,clientId:a,region:o}={}){if(!e||!n)throw Error(`module and field are required to check uniqueness`);let s={field:n,value:r??``};i&&(s.recordId=String(i)),a&&(s.clientId=String(a)),o&&(s.region=String(o));try{let n=await t.o(t.x,`/module/validate-unique?module=${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),r=n?.available!==!1;return{available:r,duplicate:!r,message:n?.message??``,errors:Array.isArray(n?.errors)?n.errors:[],response:n}}catch(e){if(e?.status===409){let t=e.response??e.data??{};return{available:!1,duplicate:!0,message:t?.message??e.message??``,errors:Array.isArray(t?.errors)?t.errors:[],response:t}}throw e}}async function ms({module:e,payload:n,excludeId:r}={}){if(!e||!n)return{duplicate:!1};try{let i=await t.o(t.x,`/module/duplicate-check?module=${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({payload:n,...r?{excludeId:r}:{}})});return i?.data??i??{duplicate:!1}}catch{return{duplicate:!1}}}var hs=[`jpg`,`jpeg`,`png`,`gif`,`webp`,`bmp`,`svg`,`avif`],gs=[`mp4`,`webm`,`ogg`,`ogv`,`mov`,`m4v`],_s=[`pdf`,`doc`,`docx`],vs=[{label:`Any file`,value:`any`},{label:`Resume (pdf, doc, docx)`,value:`resume`},{label:`Documents & Images (pdf, doc, images)`,value:`documents`},{label:`Images only`,value:`images`},{label:`Videos only`,value:`videos`},{label:`Images & Videos`,value:`imagesAndVideos`}],ys={resume:{exts:_s,maxSizeMB:2,hint:`PDF, DOC or DOCX`,error:`Only PDF, DOC, and DOCX resume files are supported.`},documents:{exts:[..._s,...hs],hint:`PDF, DOC or image files`,error:`Only document (PDF/DOC) or image files are allowed`},images:{exts:hs,hint:`Image files`,error:`Only image files are allowed`},videos:{exts:gs,hint:`Video files`,error:`Only video files are allowed`},imagesAndVideos:{exts:[...hs,...gs],hint:`Image or video files`,error:`Only image or video files are allowed`}};function bs(e){let t=String(e?.field??e?.payloadKey??``).toLowerCase();return t?t.includes(`resume`)||t.includes(`cv`)||t.includes(`curriculumvitae`):!1}function xs(e){let t=String(e?.accept??``).trim();return t&&t!==`any`?ys[t]??null:!t&&bs(e)?ys.resume:ys[t]??null}var Ss=new Set([`of`,`and`,`the`,`to`,`for`,`in`,`a`,`an`]),Cs={addresses:`address`,branches:`branch`,batches:`batch`,categories:`category`,companies:`company`,countries:`country`,entries:`entry`,people:`person`,statuses:`status`};function ws(e){let t=String(e??``).trim();if(!t)return``;if(t.length>1&&t===t.toUpperCase()&&/[A-Z]/.test(t))return t;let n=t.toLowerCase();return Cs[n]?Cs[n]:/[^aeiou]ies$/i.test(t)?t.slice(0,-3)+`y`:/(s|x|z|ch|sh)es$/i.test(t)?t.slice(0,-2):/[^s]s$/i.test(t)?t.slice(0,-1):t}function K(e){let t=String(e??``).trim();if(!t)return``;let n=t.replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_\-.]+/g,` `).split(/\s+/).filter(Boolean);if(!n.length)return``;let r=ws(n[n.length-1]);return[...n.slice(0,-1),r].map((e,t)=>{let n=e.toLowerCase();return e.length>1&&e===e.toUpperCase()?e:t>0&&Ss.has(n)?n:n.charAt(0).toUpperCase()+n.slice(1)}).join(` `)}function Ts(e,t){let n=String(e?.quickCreateLabel??``).trim();if(n&&n.toLowerCase()!==`add more`)return n;let r=K(e?.quickCreateModule||t);return r?`Add New ${r}`:`Add New`}function Es(e,t){let n=String(e?.quickEditLabel??``).trim();if(n&&n.toLowerCase()!==`add more`)return n;let r=K(e?.quickEditModule||t);return r?`Edit ${r}`:`Edit`}function Ds(e,t,n){let r=K((e===`create`?t?.quickCreateModule:t?.quickEditModule)||n);return e===`create`?String(t?.quickCreateTitle??``).trim()||(r?`Add New ${r}`:Ts(t,n)):String(t?.quickEditTitle??``).trim()||(r?`Edit ${r}`:Es(t,n))}function Os({children:e,className:t=``,icon:n,to:r,variant:a=`default`,...s}){let c=(0,o.jsx)(i.Button,{className:`app-button app-button--${a} ${t}`.trim(),icon:n,...s,children:e});return r?(0,o.jsx)(u.Link,{className:`app-button-link`,to:r,children:c}):c}function ks(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.name||e.user_name||e.userName||e.username||e.email||``}function As(e){let t={};return(Array.isArray(e)?e:[]).forEach(e=>{let n=ks(e);n&&[e.legacyUserId,e.userId,e.user_id,e._id,e.id].forEach(e=>{if(e==null||e===``)return;let r=String(typeof e==`object`?e.$oid??e.id??``:e);r&&t[r]===void 0&&(t[r]=n)})}),t}var js=new Map;function Ms(e){let n=String(e??``).trim();if(!n)return Promise.resolve(``);if(js.has(n))return js.get(n);let r=t.o(t.x,`/get-detailed-view?userId=${encodeURIComponent(n)}`).then(e=>ks(e?.data??e??null)).catch(()=>``);return js.set(n,r),r}var q=e=>e==null?``:String(e).trim();function Ns(e){let t=e?.quickCreateNotice;return!t||typeof t!=`object`||t.enabled===!1?null:{enabled:!0,title:q(t.title)||`New record created`,message:q(t.message)||`A new client has been created successfully. Please contact your Organization Admin to configure the required forms, workflows, permissions, and client-specific details before proceeding with further operations.`,showCreator:t.showCreator!==!1,showRecordName:t.showRecordName!==!1,recordNameField:q(t.recordNameField),recordLabel:q(t.recordLabel)||`Record name`,creatorLabel:q(t.creatorLabel)||`Created by`}}var Ps=[`clientName`,`companyName`,`name`,`title`,`fullName`,`displayName`,`label`,`employerName`,`vendorName`],Fs=(e,t)=>{if(!(!e||!t))return String(t).split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e)},Is=e=>typeof e==`string`||typeof e==`number`?q(e):e&&typeof e==`object`?q(e.label??e.name??e.title??``):``;function Ls(e,{recordNameField:t=``,displayField:n=``}={}){if(!e||typeof e!=`object`)return``;for(let r of[t,n,...Ps]){if(!r)continue;let t=Is(Fs(e,r));if(t)return t}let r=Object.keys(e).find(t=>/name$/i.test(t)&&typeof e[t]==`string`&&e[t].trim());return r?q(e[r]):``}function Rs(e){if(!e||typeof e!=`object`)return``;let t=[e.createdBy,e.created_by,e.createdById,e.createdUserId,e.recordMeta?.createdBy,e.ownerId];for(let e of t){if(e==null||e===``)continue;if(typeof e==`object`){let t=q(e.$oid??e.userId??e._id??e.id);if(t)return t;continue}let t=q(e);if(t)return t}return``}function zs(e=t.d){try{return ks(e())||``}catch{return``}}var Bs=(e,n)=>t.o(t.x,`/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(n)}`).then(e=>{let t=e?.data?.data??e?.data??[];return Array.isArray(t)?t[0]:t});async function Vs({module:e,recordId:n,notice:r,displayField:i=``,deps:a={}}={}){let{fetchRecord:o=Bs,fetchUserNameFn:s=Ms,getUser:c=t.d}=a,l=null;if(e&&n)try{l=await o(e,n)}catch{l=null}let u=r?.showRecordName===!1?``:Ls(l,{recordNameField:r?.recordNameField,displayField:i}),d=``;if(r?.showCreator!==!1){let e=Rs(l);if(e)try{d=q(await s(e))}catch{d=``}d||=zs(c)}return{recordName:u,creatorName:d}}var Hs=(e,t)=>e?.quickCreate?e.quickCreateOnType===!0||e.quickCreateOnType!==!1&&t===`submissions`&&e.quickCreateModule===`employers`:!1;function Us(e){return String(e??``).trim().replace(/\s+/g,` `)}var Ws=e=>Us(e).toLowerCase();function Gs(e,t){let n=Ws(e);return!n||!Array.isArray(t)?null:t.find(e=>Ws(e?.label)===n)??null}function Ks({text:e,disabled:t=!1,modalOpen:n=!1}){return t||n?!1:Us(e).length>=3}var qs=(0,r.lazy)(()=>Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.i)),Js=(0,r.lazy)(()=>Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.n)),Ys=e=>e==null||e===``,Xs=e=>typeof e==`string`&&e.includes(`.`)?e.split(`.`):[e];function Zs(e,t,n,r,i){let a=e.quickEditIdFrom;if(a){let e=Array.isArray(n)&&n.length>=3&&typeof n[1]==`number`?[...n.slice(0,2),...Xs(a)]:Xs(a),i=t?.getFieldValue?.(e);return Ys(i)&&(i=r?.[a]),Ys(i)?null:i}return i&&typeof i==`object`?i.value??null:Ys(i)?null:i}function Qs({field:e,form:t,name:n,moduleName:s,scopeValues:c,ownValue:l,onDone:u}){let[d,f]=(0,r.useState)(null),[p,m]=(0,r.useState)(null),h=!!e?.quickCreate,g=!!e?.quickEdit,_=e?.quickCreateModule||e?.lookupCollection||``,v=e?.quickEditModule||e?.lookupCollection||``,y=(0,r.useMemo)(()=>g?Zs(e,t,n,c,l):null,[g,e,t,n,c,l]);if(!h&&!g)return{footer:null,modal:null,openCreateWith:null,isModalOpen:!1};let b=Hs(e,s),x=()=>f(null),ee=()=>{if(e?.quickCreateOnClick){e.quickCreateOnClick(),document.activeElement?.blur?.();return}if(e?.quickCreateRoute){window.open(e.quickCreateRoute,`_blank`,`noopener,noreferrer`);return}_&&f({mode:`create`,module:_})},S=e=>{d||!_||f({mode:`create`,module:_,prefill:e??null})},te=()=>v&&y&&f({mode:`edit`,module:v,recordId:String(y)}),C=t=>{let n=Ns(e);n&&(m({...n,recordName:``,creatorName:``}),Vs({module:_,recordId:t,notice:n,displayField:e?.displayField||``}).then(({recordName:e,creatorName:t})=>{m(n=>n&&{...n,recordName:e,creatorName:t})}).catch(()=>{}))},w=h&&!b,ne=!w&&!g?null:(0,o.jsx)(`div`,{className:`v1-quick-actions`,role:`presentation`,onMouseDown:e=>e.preventDefault(),style:{display:`flex`,gap:8,padding:`6px 8px`,borderTop:`1px solid rgba(0,0,0,0.06)`},children:(0,o.jsxs)(i.Space,{size:8,children:[w&&(0,o.jsx)(i.Button,{type:`link`,size:`small`,icon:(0,o.jsx)(a.PlusOutlined,{}),onClick:ee,style:{paddingLeft:0},children:Ts(e,_)}),g&&(0,o.jsx)(i.Button,{type:`link`,size:`small`,icon:(0,o.jsx)(a.EditOutlined,{}),onClick:te,disabled:!y,title:y?void 0:`Choose a ${K(v)||`record`} above first, then edit it here`,children:Es(e,v)})]})}),re=d?(0,o.jsx)(i.Modal,{open:!0,title:Ds(d.mode,e,d.mode===`create`?_:v),width:`min(1080px, 96vw)`,footer:null,destroyOnClose:!0,maskClosable:!1,onCancel:x,styles:{body:{maxHeight:`78vh`,overflowY:`auto`}},children:(0,o.jsx)(r.Suspense,{fallback:(0,o.jsx)(`div`,{style:{padding:48,textAlign:`center`},children:(0,o.jsx)(i.Spin,{})}),children:d.mode===`create`?(0,o.jsx)(qs,{moduleName:d.module,embedded:!0,breadcrumbItems:[],initialRecord:d.prefill??void 0,onCancel:x,onSuccess:e=>{x(),C(e),u?.(`create`,e)}}):(0,o.jsx)(Js,{moduleName:d.module,recordId:d.recordId,embedded:!0,breadcrumbItems:[],onCancel:x,onSuccess:e=>{x(),u?.(`edit`,e)}})})}):null,ie=p?(0,o.jsxs)(i.Modal,{open:!0,title:(0,o.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[(0,o.jsx)(a.ExclamationCircleFilled,{style:{color:`#faad14`}}),p.title]}),width:`min(520px, 94vw)`,maskClosable:!1,onCancel:()=>m(null),footer:(0,o.jsx)(Os,{variant:`primary`,type:`primary`,onClick:()=>m(null),children:`OK`}),children:[(0,o.jsx)(`p`,{style:{marginTop:0,marginBottom:16},children:p.message}),(p.recordName||p.creatorName)&&(0,o.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`auto 1fr`,gap:`6px 12px`,padding:`10px 12px`,borderRadius:6,background:`rgba(0,0,0,0.03)`},children:[p.recordName&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`span`,{style:{color:`rgba(0,0,0,0.55)`},children:p.recordLabel}),(0,o.jsx)(`strong`,{children:p.recordName})]}),p.creatorName&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`span`,{style:{color:`rgba(0,0,0,0.55)`},children:p.creatorLabel}),(0,o.jsx)(`strong`,{children:p.creatorName})]})]})]}):null;return{footer:ne,modal:re||ie?(0,o.jsxs)(o.Fragment,{children:[re,ie]}):null,openCreateWith:S,isModalOpen:!!d}}var $s=e=>e==null||e===``||Array.isArray(e)&&e.length===0;function ec(e,t,n){let r=String(t??``).includes(`.`)?String(t).split(`.`):[t];if(typeof n==`function`){let e=n(t);return Array.isArray(e)&&e.length?[...e,...r]:r}return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),...r]:r}function tc({label:e,message:t,rule:n={},value:r,form:i,name:a,prefixFor:o}){let s=n.field??n.compareField??r;return{validator:async(n,r)=>{if(!s||$s(r))return Promise.resolve();let c=i?.getFieldValue?.(ec(a,s,o));if($s(c))return Promise.resolve();let l=Number(c),u=Number(r);return Number.isNaN(l)||Number.isNaN(u)||u<=l?Promise.resolve():Promise.reject(Error(t??`${e} must not exceed ${s}`))}}}function nc(e={},t,n){let r=e.field??e.compareField??e.value;return r?ec(t,r,n):null}function rc(e,t){let n=String(t).split(`.`).filter(Boolean);if(!Array.isArray(e))return n.length>1?n:t;if(n.length>1){if(e.length>=3&&typeof e[1]==`number`){let t=e.slice(0,2),r=n[0]===String(e[0])?n.slice(1):n;return[...t,...r]}return n}let r=[...e];return r[r.length-1]=n[0],r}function ic(e,t,n){let r=e?.getFieldValue?.(rc(t,n));return r!=null&&r!==``?r:e?.getFieldValue?.(n)}function ac(e){return String(e??``).split(`,`).map(e=>e.trim()).filter(Boolean)}function oc(e,t){for(let n of e??[]){let e=t(n);if(e==null||e===``)continue;let r=Number(e);if(!(!Number.isFinite(r)||r<=0))return{field:n,maximum:r}}return null}function sc({input:e,compareFields:t,readValue:n}){let r={ok:!0,field:null,maximum:null};if(e==null||e===``)return r;let i=oc(t,n);if(!i)return r;let a=Number(e);return Number.isFinite(a)?{ok:a<=i.maximum,field:i.field,maximum:i.maximum}:r}var cc={candidates:[`applicantId`]};function lc(e){let t=String(e??``).trim();if(!t)return[];let n=t.endsWith(`s`)?t.slice(0,-1):t;return[...new Set([`${n}Id`,`${t}Id`,...cc[t]??[]])]}function uc(e,t){if(!t)return``;let n=e=>e&&typeof e==`object`?e.id??e.value??``:e??``;for(let r of lc(e)){let e=String(n(t[r])||``);if(e)return e}return``}function dc(e,t){let n=new Set;return(e??[]).forEach(e=>(e.fields??[]).forEach(e=>{e?.prefillFromModule&&n.add(t(e.prefillFromModule))})),[...n]}function fc(e){return e?.payloadMode===`skip`}function pc(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:[]}function mc(e){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))})}),t}function hc(e,t){if(!e||!t)return;let n=e;for(let e of String(t).split(`.`)){if(n==null)return;if(Array.isArray(n)){if(!n.length)return;let t=[...n].reverse().find(t=>t&&typeof t==`object`&&t[e]!==void 0&&t[e]!==null);n=t?t[e]:void 0;continue}n=n[e]}return n}function gc(e,t){if(!(!e||!t))for(let n of[t.prefillFrom,t.field,t.payloadKey]){if(!n)continue;let t=e[n];if(t??=L(e,n),t??=hc(e,n),t!=null)return t}}function _c({form:e,field:t,flagPath:n,fieldPath:r,disabled:a}){let s=mi(t),c=i.Form.useWatch(n,e);if(!s)return null;let l=s.label||`Allow beyond the limit`,u=()=>{setTimeout(()=>{e?.validateFields?.([r]).catch(()=>{})})},d=async r=>{if(!r.target.checked){e.setFieldValue(n,!1),u();return}let i=await Aa(xi(t));e.setFieldValue(n,!!i),u()},f=s.help?`${l} — ${s.help}`:l;return(0,o.jsx)(i.Tooltip,{title:f,children:(0,o.jsx)(`span`,{className:`v1-override-wrap`,children:(0,o.jsx)(i.Checkbox,{className:`v1-override-checkbox`,checked:!!c,disabled:a,onChange:d,"aria-label":f})})})}var vc=e=>String(e??``);function yc(e){let t=new Set,n=[];return(Array.isArray(e)?e:[]).forEach(e=>{let r=e?.field;!r||t.has(r)||(t.add(r),n.push(r))}),n}function bc(e,t,n,r){return yc(e).map(e=>({field:e,path:n(t,e,r)}))}function xc(e,t={}){return!e||!e.field?!1:vc(t[e.field])===vc(e.value)}function Sc({rules:e,watched:t={},current:n,lastApplied:r,clearOnMismatch:i=!0,initial:a=!1}={}){let o=(Array.isArray(e)?e:[]).find(e=>xc(e,t));return o?o.clearValue?a?{action:`none`}:{action:`clear`}:{action:`set`,value:o.setValue}:i&&r!==void 0&&vc(n)===vc(r)?{action:`clear`}:{action:`none`}}var Cc=[`daysUntil`],wc=e=>e==null||e===``,Tc=e=>String(e??``);function Ec(e){return!!(e&&Cc.includes(e.type)&&e.field)}function Dc(e){if(wc(e))return null;let t=s.default.isDayjs(e)?e:(0,s.default)(e?.$date??e);return t.isValid()?t.format(`YYYY-MM-DD`):null}function Oc(e,t){let n=Dc(e),r=Dc(t??(0,s.default)());if(!(!n||!r))return Math.max(0,(0,s.default)(n).diff((0,s.default)(r),`day`))}function kc(e,t,n){if(Ec(e))switch(e.type){case`daysUntil`:return Oc(t,n);default:return}}function Ac(e,t,n,r){let i=Object.entries(e?.setFields||{}).filter(([e])=>!!e).map(([e,i])=>({field:e,path:n(t,e,r),value:i}));return{source:n(t,e.field,r),setFields:i}}function jc({cfg:e,sourceValue:t,previousSource:n,current:r,lastApplied:i,today:a}={}){if(!Ec(e)||wc(t)||Dc(t)===Dc(n))return{action:`none`};let o=kc(e,t,a);if(o===void 0)return{action:`none`};if(wc(n)){let e=i!==void 0&&Tc(r)===Tc(i);if(!wc(r)&&!e)return{action:`none`}}return Tc(r)===Tc(o)?{action:`none`}:{action:`set`,value:o}}function Mc({form:e,config:t,sourcePath:n,targetPath:a,setFields:o=[]}){let s=i.Form.useWatch(n,{form:e,preserve:!0}),c=(0,r.useRef)(void 0),l=(0,r.useRef)(void 0),u=s?.format?s.format(`YYYY-MM-DD`):String(s??``);return(0,r.useEffect)(()=>{let n=jc({cfg:t,sourceValue:s,previousSource:c.current,current:e.getFieldValue(a),lastApplied:l.current,today:Tn()});c.current=s,n.action===`set`&&(e.setFieldValue(a,n.value),l.current=n.value,o.forEach(({path:t,value:n})=>e.setFieldValue(t,n)))},[u]),null}var J=e=>String(e??``).trim().toLowerCase();function Nc(e){let t=Array.isArray(e)?e:[e],n=[];return t.forEach(e=>{if(e!=null&&e!==``){if(typeof e==`object`){[e.value,e.id,e._id,e.label,e.name].forEach(e=>{e!=null&&e!==``&&n.push(J(e))});return}n.push(J(e))}}),n}function Pc(e=[],t){let n=Nc(t);if(!n.length||!Array.isArray(e)||e.length===0)return e;let r=new Set(n),i=e.filter(e=>e==null?!1:typeof e==`object`?r.has(J(e.value))||r.has(J(e.label)):r.has(J(e)));return i.length>0?i:e}function Fc(e){let t=[];return[e?.setValue,e?.setValueLabel].forEach(e=>{e!=null&&e!==``&&t.push(J(e))}),t}function Ic(e,t={}){let n=Array.isArray(e)?e:[],r=new Set,i=new Set;return n.forEach(e=>{if(!e||e.clearValue)return;let n=Fc(e);if(!n.length)return;let a=xc(e,t)?i:r;n.forEach(e=>a.add(e))}),i.forEach(e=>r.delete(e)),[...r]}function Lc(e=[],t,n){let r=Ic(t,n);if(!r.length||!Array.isArray(e)||e.length===0)return e;let i=new Set(r);return e.filter(e=>e==null?!0:typeof e==`object`?!(i.has(J(e.value))||i.has(J(e.label))):!i.has(J(e)))}function Rc(e,t={},n){let r=Array.isArray(e)?e:[];if(n==null||n===``)return[];let i=J(n),a=[],o=new Set;return r.forEach(e=>{if(!e||e.clearValue)return;let{setValue:n,setValueLabel:r}=e;n!=null&&n!==``&&r&&J(n)===i&&xc(e,t)&&(o.has(J(n))||(o.add(J(n)),a.push({value:n,label:r})))}),a}var zc=new Set([`select`,`radio`,`checkbox`]),Bc=3e5,Vc=1e4,Hc=e=>e===!1||e===0||e===`0`||e===`false`,Uc=e=>e===!0||e===1||e===`1`||e===`true`,Wc=e=>e==null||e===``;function Gc(e){let t=e?.options??e?.values;return Array.isArray(t)?t:[]}function Kc(e){return String(e?.dataSource??``).trim().toLowerCase()}function qc(e){if(!e||!zc.has(e.type)||Hc(e.enforceOptions)||Uc(e.allowCustomValues)||e.mode===`tags`)return!1;let t=Kc(e);return t===`master`?!0:t===``||t===`static`?Gc(e).length>0:!1}function Jc(e){return(Array.isArray(e)?e:[e]).map(e=>e&&typeof e==`object`?e.value??e.id??e.label:e).filter(e=>!Wc(e)&&typeof e!=`object`&&typeof e!=`boolean`)}function Yc(e){return e==null?null:typeof e==`object`?{label:e.label??e.name??e.value,value:e.value??e.id??e.name??e.label}:{label:String(e),value:e}}var Xc=new Map;function Zc(e,t){return[t,e.field,e.masterName,e.groupName].map(e=>e??``).join(`|`)}async function Qc(e,t){let n=Zc(e,t),r=Xc.get(n);if(r&&Date.now()-r.at<Bc)return r.promise;let i=Promise.resolve(vr(t,e.field,``,Vc,0,{dataSource:`master`,masterName:e.masterName,groupName:e.groupName})).then(e=>{let t=Array.isArray(e)?e:e?.data??[];return(Array.isArray(t)?t:[]).map(Yc).filter(Boolean)});return Xc.set(n,{at:Date.now(),promise:i}),i.catch(()=>Xc.delete(n)),i}async function $c(e,{moduleName:t}={}){return Kc(e)===`master`?Qc(e,t):Gc(e).map(Yc).filter(Boolean)}function el(e){let t=new Map;return e.forEach(e=>{[[e.label,e.label],[e.value,e.value]].forEach(([e,n])=>{let r=Si(e);r&&!t.has(r)&&t.set(r,n)})}),t}async function tl(e,t,{moduleName:n,constraintValue:r}={}){let i=Jc(t);if(!i.length)return{offList:[],snaps:new Map,options:[]};let a=await $c(e,{moduleName:n});e.optionsFromField&&(a=Pc(a,r));let o=Kc(e)===`master`,s=o?el(a):Ci({options:a,optionAliases:e.optionAliases}),c=new Set(a.flatMap(e=>o?[String(e.value),String(e.label)]:[String(e.value)])),l=[],u=new Map;return i.forEach(e=>{if(c.has(String(e)))return;let t=s.get(Si(e));t===void 0?l.push(String(e)):u.set(e,t)}),{offList:l,snaps:u,options:a}}function nl(e,t){let n=e.label||e.field||`this field`;if(e.optionsMismatchMessage)return e.optionsMismatchMessage;let r=t.map(e=>`"${e}"`).join(`, `);return t.length===1?`${r} is not in the ${n} list. Please choose an option from the dropdown.`:`${r} are not in the ${n} list. Please choose options from the dropdown.`}function rl(e=[],t=[]){let n=t[0];return e.find(e=>e?.name===n||e?.payloadKey===n)??e.find(e=>(e?.fields??[]).some(e=>e?.field===n))}var il=new WeakMap;function al(e){let t=il.get(e);return t||(t={entries:new Map,listeners:new Set,snapshot:[]},il.set(e,t)),t}var ol=e=>JSON.stringify(Array.isArray(e)?e:[e]);function sl(e){e.snapshot=[...e.entries.values()],e.listeners.forEach(e=>e())}function cl(e,t,n){if(!e)return;let r=al(e),i=ol(t);if(n){let e=r.entries.get(i);if(e&&e.message===n.message)return;r.entries.set(i,{...n,path:Array.isArray(t)?t:[t]})}else if(r.entries.has(i))r.entries.delete(i);else return;sl(r)}function ll(e){return e?al(e).snapshot:[]}function ul(e){return(0,r.useSyncExternalStore)(t=>{if(!e)return()=>{};let n=al(e);return n.listeners.add(t),()=>n.listeners.delete(t)},()=>ll(e),()=>ll(e))}function dl(e,t,n){if(!n)return;let r=String(n).split(`.`).map(e=>e.trim()).filter(Boolean);if(Array.isArray(t)&&t.length>=3&&typeof t[1]==`number`){let n=e.getFieldValue([t[0],t[1],...r]);if(!Wc(n))return n}return e.getFieldValue(r)}function fl({field:e,form:t,name:n,moduleName:r}){return{validator:async(i,a)=>{if(!Jc(a).length){cl(t,n,null);return}let o;try{o=await tl(e,a,{moduleName:r,constraintValue:dl(t,n,e.optionsFromField)})}catch(r){console.warn(`[optionMembership] could not load options for "${e.field}"`,r),cl(t,n,null);return}if(!o.offList.length){cl(t,n,null);return}let s=nl(e,o.offList);throw cl(t,n,{field:e.field,label:e.label||e.field,values:o.offList,message:s}),Error(s)}}}function pl(e,t,{labeled:n=!1,options:r=[]}={}){if(!t?.size)return;let i=e=>r.find(t=>String(t.value)===String(e))??r.find(t=>String(t.label)===String(e)),a=e=>{let r=e&&typeof e==`object`?e.value:e;if(!t.has(r))return e;let a=t.get(r);if(!n)return a;let o=i(a);return{value:o?.value??a,label:o?.label??String(a)}};return Array.isArray(e)?e.map(a):a(e)}function ml({field:e,form:t,name:n,moduleName:i,value:a,constraintValue:o,enabled:s=!0}){let c=!!(s&&t&&n!==void 0&&qc(e)),l=c?JSON.stringify(Jc(a)):`[]`,u=c&&e.optionsFromField?JSON.stringify(o??null):``,d=ol(n);(0,r.useEffect)(()=>{if(!c||l===`[]`)return;let r=!1;return tl(e,t.getFieldValue(n),{moduleName:i,constraintValue:o}).then(({offList:i,snaps:a,options:o})=>{if(r)return;let s=pl(t.getFieldValue(n),a,{labeled:ia(e),options:o});s!==void 0&&t.setFieldValue(n,s),(i.length||s!==void 0||t.getFieldError(n).length)&&t.validateFields([n]).catch(()=>{})}).catch(()=>{}),()=>{r=!0}},[c,l,u,d,i,t]),(0,r.useEffect)(()=>{if(c)return()=>cl(t,n,null)},[c,d,t])}function hl(e,t){let n=rl(e,t),r=n?.label||n?.name,i=t.length>=3&&typeof t[1]==`number`;return r?i?`${r} #${t[1]+1}`:r:``}function gl({form:e,groups:t,onJump:n}){let r=ul(e);if(!r.length)return null;let a=r.length;return(0,o.jsx)(i.Alert,{type:`error`,showIcon:!0,className:`v1-option-mismatch-banner`,style:{marginBottom:16},message:`${a} ${a===1?`field has a value`:`fields have values`} that ${a===1?`is`:`are`} not in the dropdown list`,description:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`div`,{style:{marginBottom:6},children:`Choose a valid option for each of these before saving. The value that was read is still shown in the field so you can pick the closest match.`}),(0,o.jsx)(`ul`,{style:{margin:0,paddingInlineStart:18},children:r.map(e=>{let r=hl(t,e.path);return(0,o.jsxs)(`li`,{children:[(0,o.jsxs)(i.Typography.Link,{onClick:()=>n?.(e.path),children:[r?`${r} → `:``,e.label]}),`: `,e.values.map(e=>`"${e}"`).join(`, `)]},JSON.stringify(e.path))})})]})})}var _l=64;function vl(e){if(String(e??``).trim()!==`currentUserId`)return``;try{return typeof localStorage>`u`?``:String(localStorage.getItem(`userId`)??``).trim()}catch{return``}}var Y=e=>String(e??``).trim().toLowerCase(),yl=e=>e!=null&&String(e).trim()!==``;function bl(e){let t=Array.isArray(e)?e:String(e??``).split(`,`);return new Set(t.map(Y).filter(e=>e!==``))}function xl(e,t){return!t||!Array.isArray(e)||e.length===0?!1:e.some(e=>yl(e?.extraData?.[t]))}function Sl(e,t,n){let r=e?.extraData?.[t];if(!yl(n))return r===!0;let i=bl(n);return i.size===0?r===!0:i.has(Y(r))}function Cl(e,t){let n=new Map;return(Array.isArray(e)?e:[]).forEach(e=>{let r=Y(e?.value);r&&n.set(r,Y(e?.extraData?.[t]))}),n}function wl(e,t,n){let r=Y(n);if(!r)return!1;let i=new Set,a=Y(e);if(!a)return!1;i.add(a);for(let e=0;e<_l;e+=1){let e=t.get(a);if(!e)return!1;if(e===r)return!0;if(i.has(e))return!1;i.add(e),a=e}return!1}function Tl(e={}){let t=[],n=e=>{let n=String(e??``).trim();n&&!t.includes(n)&&t.push(n)};return(Array.isArray(e.extraFields)?e.extraFields:[]).forEach(n),n(e.optionsRequireExtraField),n(e.optionsHierarchyParentField),t}function El(e,t={},n={}){if(!Array.isArray(e)||e.length===0)return e;let r=n.source?`[${n.source}]`:`[optionRowFilters]`,i=t.field??t.label??`(unnamed field)`,a=typeof n.warn==`function`?n.warn:e=>{typeof console<`u`&&console.warn(e)},o=e,s=String(t.optionsRequireExtraField??``).trim();s&&(xl(o,s)?o=o.filter(e=>Sl(e,s,t.optionsRequireExtraValue)):a(`${r} "${i}": option filter SKIPPED — no option carried extraData["${s}"], so the value filter could not be applied (the lookup API returned no such extra field). Showing the unfiltered list; this is NOT "nothing matched".`));let c=String(t.optionsHierarchyParentField??``).trim();if(c){let n=String(t.optionsHierarchySelfFrom??``).trim()||`currentUserId`,s=vl(n);if(!s)a(`${r} "${i}": hierarchy filter SKIPPED — identity "${n}" could not be resolved (no signed-in user id available). Showing the list unrestricted by reporting line.`);else if(!xl(e,c))a(`${r} "${i}": hierarchy filter SKIPPED — no option carried extraData["${c}"], so the reporting chain could not be walked (the lookup API returned no such extra field). Showing the list unrestricted by reporting line; this is NOT "nobody reports to you".`);else{let t=Cl(e,c);o=o.filter(e=>wl(e?.value,t,s))}}return o}var Dl=e=>e==null||String(e).trim()===``,Ol=e=>e===!0||e===1||e===`1`||e===`true`;function kl(e){return Dl(e?.tooltip)?Ol(e?.infoEnabled)&&!Dl(e?.infoText)?String(e.infoText):``:String(e.tooltip)}var Al=e=>e==null||typeof e==`string`&&e.trim()===``;function jl(e,t={},n=()=>void 0){let{optionKey:r}=t,i=(e?n(e,r):void 0)??e?.extraData?.[r]??null,{fallback:a}=t;return Al(i)&&a!=null&&a!==``?a:i}var Ml=Symbol(`parentFilterUnseen`),Nl=e=>e==null||e===``,Pl=(e,t)=>String(e??``)===String(t??``);function Fl({previous:e,next:t,currentValue:n,scoped:r=!0}){return!(!r||e===Ml||Pl(e,t)||Nl(e)||Nl(n))}function Il(e){return e==null?!0:typeof e==`object`?Il(e.permission??e.allowed??e.value):e!==!1&&e!==0&&e!==`0`}function Ll(e,t){let n=String(t??``).trim().toLowerCase();if(!(!n||!e||typeof e!=`object`))for(let[t,r]of Object.entries(e)){let e=String(t).trim().toLowerCase();if(e===n||e===`${n}s`||`${e}s`===n)return r&&typeof r==`object`?r:void 0}}function Rl(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=`${t}Access`;if(Object.prototype.hasOwnProperty.call(e,n))return e[n]}function zl(e,t){if(!e)return!0;try{let n=JSON.parse(localStorage.getItem(`menuPermission`)||`{}`),[r,i]=String(e).split(`.`),a=i??r,o=i?[r,t]:[t];for(let e of o){let t=Ll(n,e);if(t)return Il(Rl(t,a))}return!0}catch{return!0}}function Bl(e){return(e??[]).filter(e=>e?.afterSubmit?.mode).sort((e,t)=>(e.order??0)-(t.order??0))[0]?.afterSubmit??null}function Vl(e,t,n){let r=String(e??``).trim();return!r||!r.startsWith(`/`)||r.startsWith(`//`)||/^[a-z][a-z0-9+.-]*:/i.test(r)?null:r.replace(/:([A-Za-z_][\w]*)/g,(e,r)=>{let i=r===`id`?t:n?.[r];return encodeURIComponent(i??``)})}function Hl(e=typeof window<`u`?window:void 0){let t=e?.history?.state?.idx;return typeof t==`number`&&t>0}function Ul({cancelPath:e,cancelPathPriority:t=!1,fallbackPath:n=`/`,win:r=typeof window<`u`?window:void 0}={}){return t&&e?{path:e}:Hl(r)?{back:!0}:e?{path:e}:{path:n}}function Wl(e,t={}){let n=Ul(t);return n.back?e(-1):e(n.path),n}var X=e=>e==null?``:String(e).trim();function Gl(e,t){let n=e?.regionRules;if(!n||typeof n!=`object`)return e??{};let r=X(t),i=n[r]??n[r.toUpperCase()]??n.default;return!i||typeof i!=`object`?e??{}:{...e,...i}}function Kl(e){return e?.allowInProgress!==!1}function ql(e){return Kl(e)?``:Xl(e)?e?.inProgressWarningMessage||e?.inProgressMessage||`In this region an unfinished qualification is not usually accepted when a candidate is put forward for a role. You can still record it here — just be aware it will have to be completed before they can be submitted.`:e?.inProgressMessage||`This one needs to be finished before the application can go ahead. Please untick “still ongoing”, or remove the row.`}function Jl(e){return Kl(e)?`allow`:X(e?.inProgressSeverity).toLowerCase()===`warn`?`warn`:`block`}function Yl(e){return Jl(e)===`block`}function Xl(e){return Jl(e)===`warn`}function Zl(e){if(!Yl(e))return null;let t=ql(e);return{validator:(e,n)=>n===!0?Promise.reject(Error(t)):Promise.resolve()}}function Ql(e,t={}){let n=t.tieBreak??`endDate`,r=t.field??`startDate`;for(let t of[n,r]){let n=e?.[t];if(n==null||n===``)continue;let r=(0,s.default)(n);if(r.isValid())return r.valueOf()}return null}function $l(e,t={}){let n=t.inProgressField??`currentStudyingHere`;return!!e?.[n]}function eu(e=[],t={}){let n=(t.direction??`desc`)===`desc`;return e.map((e,n)=>({index:n,key:Ql(e,t),ongoing:t.inProgressFirst!==!1&&$l(e,t)})).slice().sort((e,t)=>e.ongoing===t.ongoing?e.key===null&&t.key===null?e.index-t.index:e.key===null?1:t.key===null?-1:e.key===t.key?e.index-t.index:n?t.key-e.key:e.key-t.key:e.ongoing?-1:1).map(e=>e.index)}function tu(e,t,n={}){if(!Array.isArray(e)||e.length<2||t==null||t<0||t>=e.length)return null;let r=eu(e,n).indexOf(t);return r===-1||r===t?null:{from:t,to:r,reason:$l(e[t],n)?`inProgress`:`outOfOrder`}}var nu=Object.freeze({inProgress:`You’ve marked this one as still ongoing, so it’s the most recent. Shall we move it to the top? This list reads best newest first.`,outOfOrder:`These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.`,ok:`Yes, move it up`,keep:`No, leave it here`});function ru(e,t={}){let n={...nu,...t.messages??{}};return n[e]??n.outOfOrder}function iu(e,t={}){let n=t.levelField??`qualification`,r=X(e?.[n]);if(!r)return null;let i=t.levels??{},a=i[r]??i[r.toLowerCase()]??i[r.toUpperCase()];return Number.isFinite(Number(a))?Number(a):au(r,t)}function au(e,t){let n=Array.isArray(t?.levelPatterns)?t.levelPatterns:[],r=e.toLowerCase();for(let e of n){let t=X(e?.match);if(!t)continue;let n;try{n=new RegExp(t,`i`)}catch{continue}if(n.test(r)&&Number.isFinite(Number(e.level)))return Number(e.level)}return null}function ou(e,t={}){return X((t?.levelLabels??{})[e])||X(e)}function su(e=[],t={}){if(!t||t.requireBelow===!1)return[];let n=t.levels??{},r=t.requiredLevels??[];if(!r.length)return[];let i=e.map(e=>iu(e,t)).filter(e=>e!==null);if(!i.length)return[];let a=Math.max(...i),o=[];return r.forEach(e=>{let t=typeof e==`object`?e.label:e,r=typeof e==`object`&&Number.isFinite(Number(e.level))?Number(e.level):Number(n[t]);Number.isFinite(r)&&(r>=a||i.includes(r)||o.push(t))}),o}function cu(e,t={}){let n=su(e,t);if(!n.length)return``;let r=n.map(e=>ou(e,t)).join(`, `);return(t.message||`You’ve added a higher qualification but not the {missing} below it. Please add that too.`).replace(`{missing}`,r)}async function lu({group:e,rows:t,rowIndex:n,move:r,confirm:i}){let a=e?.orderBy;if(!a||a.confirmMove===!1||typeof r!=`function`)return!1;let o=tu(t,n,a);if(!o)return!1;let s={...nu,...a.messages??{}};return await i({reason:o.reason,title:o.reason===`inProgress`?`This looks like the most recent one`:`These dates make this the most recent one`,body:ru(o.reason,a),okText:s.ok,cancelText:s.keep,from:o.from,to:o.to})?(r(o.from,o.to),!0):!1}function uu(e,t){let n=Gl(e,t),r=n?.orderBy?.inProgressField;return r?{name:n.name,label:n.label??n.name,rowsKey:n.payloadKey||n.name,inProgressField:r,severity:Jl(n),message:ql(n)}:null}function du(e=[],t,n){if(!n)return{severity:`allow`,message:``,group:null};let r=null;for(let i of e){let e=uu(i,t);if(!(!e||e.severity===`allow`)&&fu(n,e.rowsKey).some(t=>$l(t,e))){if(e.severity===`block`)return{severity:`block`,message:e.message,group:e};r??={severity:`warn`,message:e.message,group:e}}}return r??{severity:`allow`,message:``,group:null}}function fu(e,t){let n=e?.[t];return Array.isArray(n)?n:Array.isArray(n?.rows)?n.rows:[]}function pu(e){return String(e?.severity??``).toLowerCase()===`block`?`block`:`warn`}function mu(e=[],t={}){let n=null;for(let r of e){let e=r?.levelRule;if(!e)continue;let i=hu(t,r);if(!i.length)continue;let a=cu(i,e);if(a){if(pu(e)===`block`)return{severity:`block`,message:a,group:r};n??={severity:`warn`,message:a,group:r}}}return n??{severity:`allow`,message:``,group:null}}function hu(e,t){for(let n of[t?.name,t?.payloadKey]){if(!n)continue;let t=e?.[n];if(Array.isArray(t))return t}return[]}function gu(e,t){return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),t]:[t]}function _u(e,t){let n=e?.field,r=[];e?.clearGroupOnChange&&(t instanceof Set?[...t]:t??[]).forEach(e=>{e&&e!==n&&r.push(e)});let i=e?.linkedClearField;return Array.isArray(i)?i.forEach(e=>{e&&e!==n&&r.push(e)}):typeof i==`string`&&i.trim()&&i.trim()!==n&&r.push(i.trim()),[...new Set(r)]}function vu(e,t,n,r){let i=_u(t,r).map(e=>gu(n,e));return i.forEach(t=>e.setFieldValue(t,null)),i}function yu(e){return(Array.isArray(e)?e:[e]).map(e=>e&&typeof e==`object`?e.value??e.key??e.id:e).filter(e=>e!=null&&e!==``)}function bu(e,t=[]){let n=new Set((t??[]).map(e=>String(e?.value))),r=[];for(let t of yu(e)){let e=String(t);!n.has(e)&&!r.includes(e)&&r.push(e)}return r}async function xu(e,n){if(!e?.lookupCollection||!n?.length)return[];let r=new URLSearchParams({collection:e.lookupCollection,displayField:e.displayField??``,valueField:e.valueField??`_id`,values:n.join(`,`)});e.displayField2&&r.set(`displayField2`,e.displayField2);let i=await t.o(t.x,`/admin/lookup-dropdown-values?${r}`),a=i?.data??i??[];return Array.isArray(a)?a:[]}function Su(e=[],t=[]){if(!t.length)return e;let n=new Set((e??[]).map(e=>String(e?.value))),r=t.filter(e=>!n.has(String(e?.value))).map(e=>({...e,resolvedOnly:!0}));return r.length?[...e,...r]:e}var Cu=e=>e==null||e===``||Array.isArray(e)&&e.length===0||e===!1;function wu(e){let t=e?.requireAnyOf;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim()!==``):[]}function Tu(e){return!e||typeof e!=`object`?!1:Object.values(e).some(e=>!Cu(e))}function Eu({field:e,getRow:t}){let n=wu(e);if(n.length===0||!n.includes(e?.field))return;let r=e.requireAnyOfMessage||`Select at least one of ${n.join(`, `)}.`;return{validator:async()=>{let e=t?.()??{};return Tu(e)?n.some(t=>!Cu(e[t]))?Promise.resolve():Promise.reject(Error(r)):Promise.resolve()}}}function Du(e,t=[]){let n=wu(e);return n.length===0?t:t.map(t=>n.includes(t?.field)?{...t,requireAnyOf:n,requireAnyOfMessage:e.requireAnyOfMessage}:t)}var Z=e=>e==null||e===``;function Ou(e){if(!e)return null;if(typeof e.valueOf==`function`){let t=e.valueOf();return Number.isNaN(t)?null:t}let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function Q(e){if(!e)return null;let t=(0,s.default)(e);return t.isValid()?t.startOf(`day`).valueOf():null}function ku(e){if(!e)return null;let t=(0,s.default)(e);return t.isValid()?t.hour()*60+t.minute():null}var Au={d:`day`,day:`day`,days:`day`,w:`week`,week:`week`,weeks:`week`,m:`month`,mo:`month`,month:`month`,months:`month`,y:`year`,yr:`year`,year:`year`,years:`year`};function ju(e){if(e==null||e===``)return null;if(typeof e==`object`&&!Array.isArray(e)){let t=Number(e.value??e.count??e.amount);return!Number.isFinite(t)||t<=0?null:{value:t,unit:Au[String(e.unit??`month`).toLowerCase()]??`month`}}let t=String(e).trim().toLowerCase();if(!t)return null;let n=t.match(/^(\d+(?:\.\d+)?)\s*([a-z]*)$/);if(!n)return null;let r=Number(n[1]);return!Number.isFinite(r)||r<=0?null:{value:r,unit:Au[n[2]]??`month`}}function Mu(e,t){let n=e?.minGapFrom??e?.gapFrom;if(n&&typeof t==`function`){let e=ju(t(n));if(e)return e}return ju(e?.minGap)}function Nu(e,t,n,r){if(t===null)return null;let i=Mu(n,r),a=(0,s.default)(t);return i&&(a=e===`dateAfterField`?a.add(i.value,i.unit):a.subtract(i.value,i.unit)),a.startOf(`day`).valueOf()}function Pu(e,t,n,r,i){if(t===null||n===null)return!1;let a=Nu(e,n,r,i);if(a===null)return!1;let o=!!r?.strict&&!Mu(r,i);return e===`dateAfterField`?o?t<=a:t<a:o?t>=a:t>a}function Fu(e,t,n,r){if(n?.message)return n.message;let i=n?.value??n?.compareField??n?.field??`the paired date`,a=Mu(n,r);if(a){let n=a.value===1?a.unit:`${a.unit}s`;return e===`dateAfterField`?`${t} must be at least ${a.value} ${n} after ${i}`:`${t} must be at least ${a.value} ${n} before ${i}`}return n?.strict?e===`dateAfterField`?`${t} must be after ${i}`:`${t} must be before ${i}`:e===`dateAfterField`?`${t} must be on or after ${i}`:`${t} must be on or before ${i}`}function Iu({type:e,label:t,rule:n,readSibling:r}){return{validator:async(i,a)=>{let o=n?.value??n?.compareField??n?.field;if(!o||Z(a))return Promise.resolve();let s=r(o);if(Z(s))return Promise.resolve();let c=Q(a),l=Q(s);return c===null||l===null?Promise.resolve():Pu(e,c,l,n,r)?Promise.reject(Error(Fu(e,t,n,r))):Promise.resolve()}}}function Lu(e,t,{rows:n,rowIndex:r}={}){if(e===null||!t||!Array.isArray(n)||r==null||(t.mode??`newestFirst`)!==`newestFirst`)return!1;let i=t.startField??`startDate`,a=t.endField??`endDate`,o=n[r-1];if(o){let t=Q(o[i]);if(t!==null&&e>=t)return!0}let s=n[r+1];if(s){let t=Q(s[a])??Q(s[i]);if(t!==null&&e<=t)return!0}return!1}function Ru(e,t=`above`,n=void 0){let r=e?.messages??{},i=t===`below`;return(n===`start`?i?r.belowStart:r.aboveStart:n===`end`?i?r.belowEnd:r.aboveEnd:void 0)||(i?r.below||`Start date must be after the end date of the entry below it.`:n===`end`?r.above||`End date must be before the start date of the entry above it.`:r.above||`This period overlaps the entry above it. Please adjust the dates.`)}function zu({field:e,readSibling:t,rows:n,rowIndex:r,now:i=Tn}){let a=e?.validations??e?.validation??e?.rules??[],o=[];for(let e of a){let n=typeof e==`string`?{type:e}:e,r=n?.type;if(r===`noPastDate`&&o.push(e=>e?Q(e)<i().startOf(`day`).valueOf():!1),r===`noFutureDate`&&o.push(e=>e?Q(e)>i().startOf(`day`).valueOf():!1),r===`minAge`){let e=Number(n?.value??18);o.push(t=>t?Q(t)>i().subtract(e,`year`).startOf(`day`).valueOf():!1)}if(r===`dateAfterField`||r===`dateBeforeField`){let e=n?.value??n?.compareField??n?.field;if(!e)continue;o.push(i=>{if(!i)return!1;let a=t(e);return!Z(a)&&Pu(r,Q(i),Q(a),n,t)})}}return e?.rowHierarchy&&Array.isArray(n)&&r!=null&&o.push(t=>t?Lu(Q(t),e.rowHierarchy,{rows:n,rowIndex:r}):!1),o.length?e=>o.some(t=>t(e)):void 0}function Bu(e,t=Tn,n=void 0,r=void 0){if(!Z(n)&&Q(n)!==null)return;let i,a=e?.validations??e?.validation??e?.rules??[];for(let e of a){let n=typeof e==`string`?{type:e}:e;if(n?.type===`minAge`){i=t().subtract(Number(n?.value??18),`year`);break}if(n?.type===`noFutureDate`||n?.type===`noPastDate`){i=t();break}}if(typeof r!=`function`)return i;let o=(0,s.default)(i??t()),c=Vu(o,r);return!c||c.isSame(o,`month`)?i:c}function Vu(e,t,n=240){let r=(0,s.default)(e).startOf(`day`);if(!r.isValid()||typeof t!=`function`)return null;let i=e=>{try{return!t(e)}catch{return!1}},a=e=>{let t=null,n=1/0,a=e.startOf(`month`),o=a.daysInMonth();for(let e=0;e<o;e+=1){let o=a.add(e,`day`);if(!i(o))continue;let s=Math.abs(o.diff(r,`day`));s<n&&(t=o,n=s)}return t?{day:t,gap:n}:null};for(let e=0;e<=n;e+=1){let t=(e===0?[a(r)]:[a(r.subtract(e,`month`)),a(r.add(e,`month`))]).filter(Boolean);if(t.length)return t.reduce((e,t)=>t.gap<e.gap?t:e).day}return null}function Hu({field:e,name:t,rows:n}){if(!Array.isArray(t)||t.length===0)return[];let r=t[t.length-1],i=t.length>=3&&typeof t[1]==`number`,a=new Set,o=e?.validations??e?.validation??e?.rules??[];for(let e of o){let t=typeof e==`string`?{type:e}:e;if(t?.type===`dateBeforeField`||t?.type===`dateAfterField`){let e=t?.value??t?.compareField??t?.field;e&&a.add(e)}}let s=e?.rowHierarchy,c=s?.startField??`startDate`,l=s?.endField??`endDate`;s&&(a.add(c),a.add(l));let u=[];for(let e of a)e!==r&&u.push(i?[t[0],t[1],e]:[...t.slice(0,-1),e]);if(s&&i&&Array.isArray(n))for(let e of[t[1]-1,t[1]+1])e<0||e>=n.length||(u.push([t[0],e,c]),u.push([t[0],e,l]));return u}function Uu({field:e,rows:t,rowIndex:n}){let r=e?.rowHierarchy;return{validator:async(i,a)=>{if(!r||Z(a)||!Array.isArray(t)||n==null)return Promise.resolve();let o=Q(a);if(o===null||!Lu(o,r,{rows:t,rowIndex:n}))return Promise.resolve();let s=r.startField??`startDate`,c=t[n-1],l=c?Q(c[s]):null,u=l!==null&&o>=l?`above`:`below`,d=r.endField??`endDate`,f=e?.field,p=f===s?`start`:f===d?`end`:void 0;return Promise.reject(Error(Ru(r,u,p)))}}}function Wu(e){return(e??[]).filter(e=>e?.submitMessages&&typeof e.submitMessages==`object`).sort((e,t)=>(e.order??0)-(t.order??0))[0]?.submitMessages??null}function $(e){let t=String(e??``).trim();return t?t.charAt(0).toUpperCase()+t.slice(1):`Record`}function Gu(e,t){return String(e).replaceAll("${module}",$(t)).replaceAll("${moduleName}",$(t))}function Ku(e,t,n){let r=Wu(e);if(r?.suppress)return null;let i=n===`edit`?r?.editSuccess:r?.addSuccess;return i&&String(i).trim()?Gu(i,t):n===`edit`?`${$(t)} has Updated successfully`:`${$(t)} has added successfully`}function qu(e,t,n,r){let i=Wu(e),a=n===`edit`?i?.editError:i?.addError;return a&&String(a).trim()?Gu(a,t):r&&String(r).trim()?String(r):n===`edit`?`Failed to update ${$(t)}`:`Failed to create ${$(t)}`}function Ju({errorFields:e}={},t,{root:n=document}={}){if(!e?.length)return;let r=e[0]?.name;setTimeout(()=>{if(t?.scrollToField&&r!==void 0)try{t.scrollToField(r,{behavior:`smooth`,block:`center`})}catch{}let e=(n??document).querySelector(`.ant-form-item-has-error`);if(!e)return;let i=e.querySelector(`input, textarea, select, .ProseMirror`),a=i??e;a.scrollIntoView({behavior:`smooth`,block:`center`}),setTimeout(()=>{i?.focus?.({preventScroll:!0}),a.style.boxShadow=`0 0 0 3px rgba(255, 77, 79, 0.3)`,setTimeout(()=>{a.style.boxShadow=``},1200)},350)},60)}function Yu(e){return Array.isArray(e)?e.map(e=>String(e??``).trim()):String(e??``).split(`,`).map(e=>e.trim())}function Xu(e,t){if(!e?.field)return!1;switch(e.operator??`eq`){case`eq`:return String(t??``)===String(e.value??``);case`neq`:return String(t??``)!==String(e.value??``);case`truthy`:return t!=null&&t!==``&&t!==!1;case`falsy`:return t==null||t===``||t===!1;case`notEmpty`:return Array.isArray(t)?t.length>0:!!t;case`in`:return Yu(e.value).includes(String(t??``));case`notIn`:return!Yu(e.value).includes(String(t??``));default:return!1}}function Zu(e,t,n=!1){let r=n?e?.combineLabel??e?.label:e?.label,i=e?.labelWhen;return Xu(i,t)&&i?.label?i.label:r}function Qu(e){return e?[...e.field?[e]:[],...(e.conditions??[]).filter(e=>e?.field)]:[]}function $u(e,t){let n=Qu(e);if(!n.length)return!0;let r=n.map(e=>Xu(e,t(e.field)));return e.logic===`or`?r.some(Boolean):r.every(Boolean)}function ed(e){let t=e?.colWhen;return t?(Array.isArray(t)?t:[t]).filter(e=>e?.field&&Number(e?.col)>0):[]}function td(e,t,n){for(let t of ed(e))if(Xu(t,n(t)))return Number(t.col);return t}function nd(e,t){return e?.field?t==null?[e.field]:[...Array.isArray(t)?t:[t],e.field]:[`__noop_conditional_label__`]}function rd(e,t){return n=>{if(!e||!n)return;let r=Array.isArray(t)&&t.length>1?[...t.slice(0,-1),n]:[n],i=e.getFieldValue(r);return i===void 0?e.getFieldValue([n]):i}}function id(e,t,n){let r=e?.requiredWhen;return!r||!t||!r.field&&!(r.conditions??[]).some(e=>e?.field)?!1:$u(r,rd(t,n))}function ad(e,t,n){return{validator:(r,i)=>{if(!id(e,t,n)||!(i==null||i===``||Array.isArray(i)&&i.length===0))return Promise.resolve();let a=e?.label??e?.field??`This field`;return Promise.reject(Error(e?.requiredWhen?.message??`${a} is required`))}}}function od({items:e=[]}){let t=e.map((t,n)=>({title:n===e.length-1?(0,o.jsx)(Zn,{variant:`body`,weight:`medium`,color:`link`,children:t.label}):(0,o.jsxs)(u.Link,{to:t.href,children:[(0,o.jsx)(Zn,{variant:`body`,color:`secondary`,children:t.label}),t.dropdown&&(0,o.jsx)(a.DownOutlined,{})]})}));return(0,o.jsx)(i.Breadcrumb,{items:t})}var sd=e=>String(e??``).trim().replace(/\s+/g,` `).toLowerCase();function cd(e=[]){let t=new Map;for(let n of e){if(n==null)continue;let e=typeof n==`object`?n.value:n;if(e!=null&&e!==``)for(let r of[n?.label,e]){let n=sd(r);n&&!t.has(n)&&t.set(n,e)}}return t}function ld(e,t){if(!Array.isArray(e)){let n=ld([e],t);return n.length?n[0]:e}let n=cd(t),r=new Set,i=[];for(let t of e){let e=typeof t==`object`&&t?t.value:t,a=n.get(sd(e))??e,o=sd(a);o&&r.has(o)||(o&&r.add(o),i.push(a))}return i}function ud(e,t=[]){if(!e)return[];let n=new Set;for(let r of t)for(let t of r?.fields??[])if(t?.field){if(t.field===e)for(let e of t.autofillFrom??[])e?.targetField&&n.add(e.targetField);t.lookupFilterValueFrom===e&&n.add(t.field);for(let r of t.prefillWhen??[])r?.field===e&&n.add(t.field)}return n.delete(e),[...n]}function dd(e,t=[]){return e?.blockWhileResolving?ud(e.field,t).length>0:!1}function fd(e){let t=String(e?.label??``).trim();return t?`Applying ${t}…`:`Applying your selection…`}function pd(e,t=[]){if(!e?.field)return[];let n=new Set(ud(e.field,t));if(n.size===0)return[];let r=[];for(let e of t){let t=e?.name??e?.id;t&&(e.fields??[]).some(e=>e?.field&&n.has(e.field))&&r.push(t)}return r}function md(e){return String(e?.blockScope??``).toLowerCase()===`group`}var hd=(0,r.lazy)(()=>Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.n)),gd=(0,r.lazy)(()=>Promise.resolve().then(()=>require("./DocumentViewer-DE0kSU2d.cjs")).then(e=>e.n));function _d(e){let t=String(e??``).split(`.`).pop()?.toLowerCase();return t===`pdf`?(0,o.jsx)(a.FilePdfOutlined,{className:`v1-file-chip__icon`}):t===`doc`||t===`docx`?(0,o.jsx)(a.FileWordOutlined,{className:`v1-file-chip__icon`}):(0,o.jsx)(a.FileOutlined,{className:`v1-file-chip__icon`})}function vd({field:e,recordMeta:t,onLinkedRecordUpdated:n}){let s=e?.linkedModule,c=e?.linkedFileField,l=(0,r.useMemo)(()=>{let n=uc(s,t);if(n)return n;let r=e?.linkedIdField,i=r?t?.[r]:``;return i?String(i):``},[s,t,e?.linkedIdField]),[u,d]=(0,r.useState)({loading:!1,fileValue:null}),[f,p]=(0,r.useState)(!1),[m,h]=(0,r.useState)(!1),[g,_]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(!l||!s)return;let e=!1;return queueMicrotask(()=>{e||d(e=>({...e,loading:!0}))}),br(s,l).then(t=>{e||d({loading:!1,fileValue:t?.[c]??null})}),()=>{e=!0}},[l,s,c,g]);let v=(0,r.useMemo)(()=>ro(u.fileValue),[u.fileValue])[0],y=!!v,b=e?.label??`File`,x=K(s)||`record`;if(!l)return(0,o.jsx)(`div`,{className:`v1-linked-file v1-linked-file--empty`,children:(0,o.jsx)(`span`,{children:e?.unlinkedText??`Not available until the ${x} is set.`})});if(u.loading)return(0,o.jsx)(`div`,{className:`v1-linked-file v1-linked-file--loading`,children:(0,o.jsx)(i.Spin,{size:`small`})});let ee=v?{...v,url:v.needsAuthFetch?``:v.url,authSource:v.needsAuthFetch?{module:s,refId:l,fieldName:c}:void 0}:null,S=()=>h(!1),te=e?.emptyText??`No ${b.toLowerCase()} on file yet`,C=e?.reuploadLabel??`${y?`Reupload`:`Upload`} in ${x}`,w=e?.reuploadWarning??`The ${b.toLowerCase()} belongs to the ${x.toLowerCase()}, not to this record. Changing it here updates the ${x.toLowerCase()} everywhere it is used.`;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`div`,{className:`v1-linked-file-row ${y?``:`v1-linked-file--empty`}`,children:[(0,o.jsxs)(`button`,{type:`button`,className:`v1-linked-file v1-file-chip`,disabled:!y,onClick:()=>y&&p(!0),title:y?`Preview or download ${v.name}`:te,children:[y?_d(v.name):(0,o.jsx)(a.FileOutlined,{className:`v1-file-chip__icon`}),(0,o.jsx)(`span`,{className:`v1-file-chip__name`,children:y?v.name:te}),y&&(0,o.jsx)(a.EyeOutlined,{className:`v1-file-chip__action`,"aria-hidden":`true`})]}),(0,o.jsxs)(`button`,{type:`button`,className:`v1-linked-file__edit-btn`,onClick:()=>h(!0),title:w,children:[(0,o.jsx)(a.EditOutlined,{}),` `,C]})]}),f&&ee&&(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(gd,{open:f,onClose:()=>p(!1),documents:[ee]})}),m&&(0,o.jsxs)(i.Modal,{open:!0,title:C,width:`min(1080px, 96vw)`,footer:null,destroyOnClose:!0,maskClosable:!1,onCancel:S,styles:{body:{maxHeight:`78vh`,overflowY:`auto`}},children:[(0,o.jsx)(i.Alert,{type:`warning`,showIcon:!0,message:w,style:{marginBottom:16}}),(0,o.jsx)(r.Suspense,{fallback:(0,o.jsx)(`div`,{style:{padding:48,textAlign:`center`},children:(0,o.jsx)(i.Spin,{})}),children:(0,o.jsx)(hd,{moduleName:s,recordId:l,embedded:!0,breadcrumbItems:[],onCancel:S,onSuccess:()=>{S(),_(e=>e+1),n?.(l)}})})]})]})}vd.propTypes={field:g.default.shape({label:g.default.string,linkedModule:g.default.string,linkedFileField:g.default.string,linkedIdField:g.default.string,emptyText:g.default.string,unlinkedText:g.default.string,reuploadLabel:g.default.string,reuploadWarning:g.default.string}).isRequired,recordMeta:g.default.object,onLinkedRecordUpdated:g.default.func},vd.defaultProps={recordMeta:void 0,onLinkedRecordUpdated:void 0},Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return Tl}}),Object.defineProperty(exports,"$i",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"$n",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(exports,"$r",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,"$t",{enumerable:!0,get:function(){return os}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return xu}}),Object.defineProperty(exports,"Ai",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,"An",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"Ar",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return Qs}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return mu}}),Object.defineProperty(exports,"Bi",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"Bn",{enumerable:!0,get:function(){return vi}}),Object.defineProperty(exports,"Br",{enumerable:!0,get:function(){return on}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return Es}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Bu}}),Object.defineProperty(exports,"Ci",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"Cn",{enumerable:!0,get:function(){return Da}}),Object.defineProperty(exports,"Cr",{enumerable:!0,get:function(){return An}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return sc}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Hu}}),Object.defineProperty(exports,"Di",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"Dn",{enumerable:!0,get:function(){return wa}}),Object.defineProperty(exports,"Dr",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return nc}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"Ei",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"En",{enumerable:!0,get:function(){return va}}),Object.defineProperty(exports,"Er",{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return rc}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return uu}}),Object.defineProperty(exports,"Fi",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,"Fn",{enumerable:!0,get:function(){return ia}}),Object.defineProperty(exports,"Fr",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return Ms}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return Vl}}),Object.defineProperty(exports,"Gi",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"Gn",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(exports,"Gr",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,"Gt",{enumerable:!0,get:function(){return ls}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return Gl}}),Object.defineProperty(exports,"Hi",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,"Hn",{enumerable:!0,get:function(){return ai}}),Object.defineProperty(exports,"Hr",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return xs}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return Kl}}),Object.defineProperty(exports,"Ii",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"In",{enumerable:!0,get:function(){return Pi}}),Object.defineProperty(exports,"Ir",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return As}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return Ml}}),Object.defineProperty(exports,"Ji",{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,"Jn",{enumerable:!0,get:function(){return Ur}}),Object.defineProperty(exports,"Jr",{enumerable:!0,get:function(){return en}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return fs}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return Il}}),Object.defineProperty(exports,"Ki",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"Kn",{enumerable:!0,get:function(){return Jr}}),Object.defineProperty(exports,"Kr",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return us}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Yl}}),Object.defineProperty(exports,"Li",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"Ln",{enumerable:!0,get:function(){return Ii}}),Object.defineProperty(exports,"Lr",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return Os}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return bu}}),Object.defineProperty(exports,"Mi",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,"Mn",{enumerable:!0,get:function(){return da}}),Object.defineProperty(exports,"Mr",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return Gs}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return vu}}),Object.defineProperty(exports,"Ni",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"Nn",{enumerable:!0,get:function(){return Ca}}),Object.defineProperty(exports,"Nr",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return Hs}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Du}}),Object.defineProperty(exports,"Oi",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,"On",{enumerable:!0,get:function(){return _a}}),Object.defineProperty(exports,"Or",{enumerable:!0,get:function(){return On}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return tc}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Zl}}),Object.defineProperty(exports,"Pi",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"Pn",{enumerable:!0,get:function(){return aa}}),Object.defineProperty(exports,"Pr",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return Us}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return El}}),Object.defineProperty(exports,"Qi",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"Qn",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(exports,"Qr",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"Qt",{enumerable:!0,get:function(){return Zo}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return ql}}),Object.defineProperty(exports,"Ri",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"Rn",{enumerable:!0,get:function(){return Di}}),Object.defineProperty(exports,"Rr",{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Uu}}),Object.defineProperty(exports,"Si",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"Sn",{enumerable:!0,get:function(){return Ea}}),Object.defineProperty(exports,"Sr",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return hc}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return ku}}),Object.defineProperty(exports,"Ti",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"Tn",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"Tr",{enumerable:!0,get:function(){return Ln}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return ic}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return Wl}}),Object.defineProperty(exports,"Ui",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,"Un",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(exports,"Ur",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return ms}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return lu}}),Object.defineProperty(exports,"Vi",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"Vn",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(exports,"Vr",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return vs}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return Bl}}),Object.defineProperty(exports,"Wi",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"Wn",{enumerable:!0,get:function(){return li}}),Object.defineProperty(exports,"Wr",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"Wt",{enumerable:!0,get:function(){return ps}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return jl}}),Object.defineProperty(exports,"Xi",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"Xn",{enumerable:!0,get:function(){return Hr}}),Object.defineProperty(exports,"Xr",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"Xt",{enumerable:!0,get:function(){return es}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return Fl}}),Object.defineProperty(exports,"Yi",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"Yn",{enumerable:!0,get:function(){return Gr}}),Object.defineProperty(exports,"Yr",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return ts}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return kl}}),Object.defineProperty(exports,"Zi",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"Zn",{enumerable:!0,get:function(){return Br}}),Object.defineProperty(exports,"Zr",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return Go}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return Ju}}),Object.defineProperty(exports,"_a",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,"_i",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return ro}}),Object.defineProperty(exports,"_r",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return uc}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return dd}}),Object.defineProperty(exports,"aa",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"ai",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"an",{enumerable:!0,get:function(){return Po}}),Object.defineProperty(exports,"ar",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return ul}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return zu}}),Object.defineProperty(exports,"ba",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"bi",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"bn",{enumerable:!0,get:function(){return Aa}}),Object.defineProperty(exports,"br",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return fc}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return id}}),Object.defineProperty(exports,"ca",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"ci",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return go}}),Object.defineProperty(exports,"cr",{enumerable:!0,get:function(){return Er}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return Lc}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return nd}}),Object.defineProperty(exports,"da",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(exports,"di",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"dn",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"dr",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return Ec}}),Object.defineProperty(exports,"ea",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"ei",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return Lo}}),Object.defineProperty(exports,"er",{enumerable:!0,get:function(){return Vr}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return gl}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Xu}}),Object.defineProperty(exports,"fa",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,"fi",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"fn",{enumerable:!0,get:function(){return ao}}),Object.defineProperty(exports,"fr",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return yc}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Qu}}),Object.defineProperty(exports,"ga",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,"gi",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"gn",{enumerable:!0,get:function(){return $a}}),Object.defineProperty(exports,"gr",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return dc}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return td}}),Object.defineProperty(exports,"ha",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"hi",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,"hn",{enumerable:!0,get:function(){return Ua}}),Object.defineProperty(exports,"hr",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return _c}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return fd}}),Object.defineProperty(exports,"ia",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"ii",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"in",{enumerable:!0,get:function(){return Fo}}),Object.defineProperty(exports,"ir",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return ml}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Su}}),Object.defineProperty(exports,"ji",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,"jn",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"jr",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return Ks}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Eu}}),Object.defineProperty(exports,"ki",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,"kn",{enumerable:!0,get:function(){return Ji}}),Object.defineProperty(exports,"kr",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return ec}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return ad}}),Object.defineProperty(exports,"la",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"li",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"ln",{enumerable:!0,get:function(){return ho}}),Object.defineProperty(exports,"lr",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return Mc}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return $u}}),Object.defineProperty(exports,"ma",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"mi",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"mn",{enumerable:!0,get:function(){return Va}}),Object.defineProperty(exports,"mr",{enumerable:!0,get:function(){return lr}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return Sc}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return md}}),Object.defineProperty(exports,"na",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(exports,"ni",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,"nn",{enumerable:!0,get:function(){return zo}}),Object.defineProperty(exports,"nr",{enumerable:!0,get:function(){return Ir}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ld}}),Object.defineProperty(exports,"oa",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"oi",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,"on",{enumerable:!0,get:function(){return Mo}}),Object.defineProperty(exports,"or",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return Pc}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Zu}}),Object.defineProperty(exports,"pa",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(exports,"pi",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"pn",{enumerable:!0,get:function(){return Ha}}),Object.defineProperty(exports,"pr",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return bc}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return zl}}),Object.defineProperty(exports,"qi",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,"qn",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(exports,"qr",{enumerable:!0,get:function(){return At}}),Object.defineProperty(exports,"qt",{enumerable:!0,get:function(){return ds}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return pd}}),Object.defineProperty(exports,"ra",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"ri",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return Io}}),Object.defineProperty(exports,"rr",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return qc}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return od}}),Object.defineProperty(exports,"sa",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"si",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return No}}),Object.defineProperty(exports,"sr",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return Rc}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return vd}}),Object.defineProperty(exports,"ta",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"ti",{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,"tn",{enumerable:!0,get:function(){return Bo}}),Object.defineProperty(exports,"tr",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return rl}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return ed}}),Object.defineProperty(exports,"ua",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(exports,"ui",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return co}}),Object.defineProperty(exports,"ur",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return Ac}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return qu}}),Object.defineProperty(exports,"va",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"vi",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"vn",{enumerable:!0,get:function(){return Ia}}),Object.defineProperty(exports,"vr",{enumerable:!0,get:function(){return Zn}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return pc}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return Ou}}),Object.defineProperty(exports,"wi",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"wn",{enumerable:!0,get:function(){return Oa}}),Object.defineProperty(exports,"wr",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return ac}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return Iu}}),Object.defineProperty(exports,"xa",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(exports,"xi",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,"xn",{enumerable:!0,get:function(){return ja}}),Object.defineProperty(exports,"xr",{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return gc}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Ku}}),Object.defineProperty(exports,"ya",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"yi",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"yn",{enumerable:!0,get:function(){return Ba}}),Object.defineProperty(exports,"yr",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return mc}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return du}}),Object.defineProperty(exports,"zi",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"zn",{enumerable:!0,get:function(){return mi}}),Object.defineProperty(exports,"zr",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return Ts}});
5
- //# sourceMappingURL=LinkedRecordFileField-6mf81qoS.cjs.map
3
+ `).filter(e=>e.trim().length>0);if(n.length<2)return null;if(n.some(e=>e.includes(` `))){let e=n.map(e=>e.split(` `).map(Qn)),t=Math.max(...e.map(e=>e.length));return t<2?null:{rows:e.map(e=>[...e,...Array(t-e.length).fill(``)]),hasHeaderRow:!0}}let r=n.filter(e=>e.includes(`|`)).map(e=>{let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(Qn)});if(r.length<2)return null;let i=r.findIndex($n),a=r.filter((e,t)=>t!==i),o=Math.max(...a.map(e=>e.length));return a.length<2||o<2?null:{rows:a.map(e=>[...e,...Array(o-e.length).fill(``)]),hasHeaderRow:i===1}},tr=(e,t,n)=>{let{table:r,tableRow:i,tableHeader:a,tableCell:o,paragraph:s}=e.nodes;if(!r||!i||!o||!s)return null;let c=t.map((t,r)=>{let c=n&&r===0&&a?a:o,l=t.map(t=>{let n=String(t??``),r=n?e.text(n):void 0;return c.create(null,s.create(null,r))});return i.create(null,l)});return r.create(null,c)};function P({onClick:e,active:t,disabled:n,title:r,children:i}){return(0,o.jsx)(`button`,{type:`button`,title:r,disabled:n,className:`tte-btn${t?` tte-btn--active`:``}`,onMouseDown:t=>{t.preventDefault(),e?.()},children:i})}function nr({editor:e,disabled:t}){return e?(0,o.jsxs)(`div`,{className:`tte-toolbar${t?` tte-toolbar--disabled`:``}`,children:[(0,o.jsxs)(`div`,{className:`tte-toolbar-group`,children:[(0,o.jsx)(P,{title:`Bold`,disabled:t,active:e.isActive(`bold`),onClick:()=>e.chain().focus().toggleBold().run(),children:(0,o.jsx)(`strong`,{children:`B`})}),(0,o.jsx)(P,{title:`Italic`,disabled:t,active:e.isActive(`italic`),onClick:()=>e.chain().focus().toggleItalic().run(),children:(0,o.jsx)(`em`,{children:`I`})}),(0,o.jsx)(P,{title:`Underline`,disabled:t,active:e.isActive(`underline`),onClick:()=>e.chain().focus().toggleUnderline().run(),children:(0,o.jsx)(`span`,{style:{textDecoration:`underline`},children:`U`})}),(0,o.jsx)(P,{title:`Strikethrough`,disabled:t,active:e.isActive(`strike`),onClick:()=>e.chain().focus().toggleStrike().run(),children:(0,o.jsx)(`s`,{children:`S`})})]}),(0,o.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,o.jsxs)(`div`,{className:`tte-toolbar-group`,children:[(0,o.jsx)(P,{title:`Bullet List`,disabled:t,active:e.isActive(`bulletList`),onClick:()=>e.chain().focus().toggleBulletList().run(),children:`≡`}),(0,o.jsx)(P,{title:`Ordered List`,disabled:t,active:e.isActive(`orderedList`),onClick:()=>e.chain().focus().toggleOrderedList().run(),children:`1.`})]}),(0,o.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,o.jsx)(`div`,{className:`tte-toolbar-group`,children:(0,o.jsx)(P,{title:`Link`,disabled:t,active:e.isActive(`link`),onClick:()=>{let t=window.prompt(`Enter URL`);if(!t){e.chain().focus().unsetLink().run();return}e.chain().focus().setLink({href:t}).run()},children:`🔗`})}),(0,o.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,o.jsxs)(`div`,{className:`tte-toolbar-group tte-table-tools`,children:[(0,o.jsx)(P,{title:`Insert 3 × 3 table`,disabled:t,active:e.isActive(`table`),onClick:()=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:`▦`}),e.isActive(`table`)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(P,{title:`Add column`,disabled:t||!e.can().addColumnAfter(),onClick:()=>e.chain().focus().addColumnAfter().run(),children:`C+`}),(0,o.jsx)(P,{title:`Delete column`,disabled:t||!e.can().deleteColumn(),onClick:()=>e.chain().focus().deleteColumn().run(),children:`C−`}),(0,o.jsx)(P,{title:`Add row`,disabled:t||!e.can().addRowAfter(),onClick:()=>e.chain().focus().addRowAfter().run(),children:`R+`}),(0,o.jsx)(P,{title:`Delete row`,disabled:t||!e.can().deleteRow(),onClick:()=>e.chain().focus().deleteRow().run(),children:`R−`}),(0,o.jsx)(P,{title:`Toggle header row`,disabled:t||!e.can().toggleHeaderRow(),onClick:()=>e.chain().focus().toggleHeaderRow().run(),children:`H`}),(0,o.jsx)(P,{title:`Delete table`,disabled:t||!e.can().deleteTable(),onClick:()=>e.chain().focus().deleteTable().run(),children:`🗑`})]})]}),(0,o.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,o.jsx)(`div`,{className:`tte-toolbar-group`,children:(0,o.jsx)(P,{title:`Clear formatting`,disabled:t,onClick:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),children:`✕`})})]}):null}function rr({value:e=``,onChange:t,disabled:n=!1,placeholder:i=``}){let a=(0,r.useRef)(e??``),s=(0,d.useEditor)({extensions:[f.default,m.default,p.default.configure({openOnClick:!1,HTMLAttributes:{rel:`noopener noreferrer`}}),h.Table.configure({resizable:!0,HTMLAttributes:{class:`email-template-table`}}),h.TableRow,h.TableHeader,h.TableCell],content:e,editable:!n,editorProps:{attributes:{class:`tte-content`},handlePaste:(e,t)=>{let n=er(t.clipboardData?.getData(`text/plain`)||``);if(!n)return!1;let r=tr(e.state.schema,n.rows,n.hasHeaderRow);if(!r)return!1;t.preventDefault();let i=e.state.tr.replaceSelectionWith(r,!1).scrollIntoView();return e.dispatch(i),!0}},onUpdate:({editor:e})=>{let n=e.getHTML(),r=n===`<p></p>`?``:n;a.current=r,t?.(r)}});return(0,r.useEffect)(()=>{if(!s||s.isDestroyed)return;let t=e||``;t!==(a.current||``)&&(a.current=t,s.commands.setContent(t,!1))},[e,s]),(0,r.useEffect)(()=>{s&&s.setEditable(!n)},[n,s]),(0,o.jsxs)(`div`,{className:`tte-wrapper${n?` tte-wrapper--disabled`:``}`,children:[(0,o.jsx)(nr,{editor:s,disabled:n}),(0,o.jsx)(d.EditorContent,{editor:s}),!e&&!s?.isFocused&&i&&(0,o.jsx)(`div`,{className:`tte-placeholder`,children:i})]})}var ir=/\{([A-Za-z0-9_.]+)\}/g,ar=e=>e==null||e===``||e===`_`;function or(e){return!!(e&&typeof e.path==`string`&&e.path.trim())}function sr(e,t,n={}){if(!or(e))return null;let r=n[String(e.service||`core`).toLowerCase()];if(!r)return null;let i=!1,a=e.path.trim().replace(ir,(e,n)=>{let r=typeof t==`function`?t(n):void 0;return ar(r)?(i=!0,``):encodeURIComponent(String(r))});return i?null:{base:r,path:a.startsWith(`/`)?a:`/${a}`}}function cr(e,t){let n=e&&typeof e==`object`&&`data`in e?e.data:e;return String(t||``).split(`.`).filter(Boolean).forEach(e=>{n=n==null?n:n[e]}),Array.isArray(n)?n:[]}function lr({routeParams:e={},searchParams:t,getFormValue:n}={}){return r=>{if(!ar(e[r]))return e[r];let i=t?.get?t.get(r):void 0;return ar(i)?typeof n==`function`?n(r):void 0:i}}function ur(e){let t=String(e??``).trim();if(!t)return{baseModule:``,nestedPath:``};let[n,...r]=t.split(`.`);return{baseModule:n.trim(),nestedPath:r.map(e=>e.trim()).filter(Boolean).join(`.`)}}function dr(e){return ur(e).baseModule}var fr=`test-flows`,pr=`lms-flows`;function mr(e){let t=(Array.isArray(e)?e:[e]).flat().map(e=>e&&typeof e==`object`?e.value??e.label??e.name??``:e).map(e=>String(e??``).trim().toLowerCase()).filter(Boolean);return t.includes(`dice`)?`dice`:t.includes(`internal`)?`internal`:t[0]||``}function hr(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function gr(e,t,n,r=``){let i=e?.count,a=t?.count,o=String(r??``).trim().toLowerCase();if(i&&typeof i==`object`){let e=hr(o?i[o]:void 0,i.total,i.searchCount,i.count);if(e!==void 0)return e}if(a&&typeof a==`object`){let e=hr(o?a[o]:void 0,a.total,a.searchCount,a.count);if(e!==void 0)return e}return hr(e?.total,typeof i==`object`?void 0:i,e?.totalCount,t?.total,typeof a==`object`?void 0:a,t?.totalCount,n.length)??0}function _r(e,t){let n={};return[e?.count,t?.count].forEach(e=>{!e||typeof e!=`object`||Object.entries(e).forEach(([e,t])=>{let r=Number(t);Number.isFinite(r)&&(n[String(e).trim().toLowerCase()]=r)})}),n}async function vr(e,n,r=``,i=50,a=0,o={}){let s=new URLSearchParams({module:dr(e),field:n,value:r,limit:String(i),offset:String(a)});return o.dataSource&&s.set(`dataSource`,o.dataSource),o.masterName&&s.set(`masterName`,o.masterName),o.groupName&&s.set(`groupName`,o.groupName),o.scope&&s.set(`scope`,o.scope),o.arrayLabelField&&s.set(`arrayLabelField`,o.arrayLabelField),o.arrayValueField&&s.set(`arrayValueField`,o.arrayValueField),t.t(t.x,`/filter-dropdown-values?${s}`)}async function yr(e,n=10,r=0,i={}){let{scope:a=``,sort:o=``,sortDir:s=``,filters:c=[]}=i;if(e===fr){let{getTestFlows:e}=await Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.t),t=await e({limit:n,offset:r}),i=Array.isArray(t?.items)?t.items:[],a=Number(t?.total)||0;return{items:i,total:a,limit:n,offset:r,tabs:[{key:`all`,title:`Test Cases`,count:a}]}}if(e===pr){let{getLmsFlows:e}=await Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.t),t=await e({limit:n,offset:r}),i=Array.isArray(t?.items)?t.items:[],a=Number(t?.total)||0;return{items:i,total:a,limit:n,offset:r,tabs:[{key:`all`,title:`LMS Cases`,count:a}]}}let l=new URLSearchParams({module:dr(e),limit:String(n),offset:String(r)}),u=String(a??``).trim();return u&&l.set(`scope`,u),o&&l.set(`sort`,o),s&&l.set(`sortDir`,s),Array.isArray(c)&&c.some(e=>e?.field)&&l.set(`filters`,JSON.stringify(c)),t.o(t.x,`/module-data-list?${l.toString()}`)}async function br(e,n){if(!e||!n)return null;try{let r=await t.o(t.x,`/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(n)}`),i=r?.data?.data??r?.data??r,a=Array.isArray(i)?i[0]:i;return a&&typeof a==`object`?a:null}catch{return null}}async function xr(e,n={},r={},i={}){let{limit:a=10,offset:o=0}=r,{sort:s=``,sortDir:c=``,scope:l=``,filters:u=[]}=i,d=mr(l||String(n.selectedSource??``).split(`,`)),f=new URLSearchParams;f.append(`module`,dr(e)),f.append(`limit`,String(a)),f.append(`offset`,String(o)),d&&(f.set(`scope`,d),console.log(`[searchModuleData] Adding scope to query:`,d)),s&&f.set(`sort`,s),c&&f.set(`sortDir`,c),Array.isArray(u)&&u.some(e=>e?.field)&&f.set(`filters`,JSON.stringify(u)),console.log(`[searchModuleData] Final query string:`,f.toString()),Object.entries(n).forEach(([e,t])=>{if(t==null||t===``)return;let n=t;n=typeof t==`object`?t.value??t.label??t.name??String(t):String(t),f.append(e,n)});let p=await t.o(t.x,`/module-data-list?${f.toString()}`),m=p?.data??p,h=Array.isArray(m)?m:m?.rows??m?.records??m?.items??m?.list??m?.data??[],g=gr(p,m,h,d),_=_r(p,m);d&&_[d]===void 0&&Number.isFinite(g)&&(_[d]=g);let v=h.some(e=>[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].flat().some(e=>String(e??``).trim().toLowerCase()===`dice`)||!!e?.customFields?.diceProfileData),y=h;if(v)try{let{transformDiceResponseToInternalFormat:e}=await Promise.resolve().then(()=>require("./diceCandidateMapper-BjMhHno3.cjs")).then(e=>e.t);y=e(p,p)?.data?.data??h}catch(e){console.error(`[searchModuleData] Dice transformation failed:`,e),y=h.map(wr)}else y=Array.isArray(h)?h.map(wr):[];return{rows:y,total:Number(g)||0,counts:_,tabs:p?.tabs??p?.tabList??m?.tabs??m?.tabList??[],fields:p?.fields??p?.fieldConfig??m?.fields??m?.fieldConfig??[],tabField:p?.tabField??m?.tabField??``,actionRules:m?.actionRules??[],actions:m?.actions??[],columnActions:m?.columnActions??[]}}function Sr(e,t){return String(t).split(`.`).reduce((e,t)=>e?.[t],e)}function Cr(e,t,n){let r=String(t).split(`.`).filter(Boolean);if(!r.length)return e;let i={...e},a=i,o=e;return r.slice(0,-1).forEach(e=>{let t=o?.[e],n=t&&typeof t==`object`&&!Array.isArray(t)?{...t}:{};a[e]=n,a=n,o=t}),a[r[r.length-1]]=n,i}function wr(e){if(!e||typeof e!=`object`)return e;let t=[`skills`,`technicalSkills`,`primarySkills`,`keySkills`,`customFields.diceProfileData.skills`],r=e,i=null;if(t.forEach(e=>{let t=Sr(r,e);if(t==null)return;let a=n.n(t);a.length===0&&Array.isArray(t)&&t.length>0||(i??=a,r=Cr(r,e,a))}),i&&Sr(r,`skills`)===void 0&&(r=Cr(r,`skills`,i)),[r?.sourceType,r?.profileSource,r?.selectedSource,r?.customFields?.sourceType,r?.customFields?.profileSource].flat().some(e=>String(e??``).trim().toLowerCase()===`dice`)||r?.customFields?.diceProfileData){let e=n.r(r),t=r?.candidateId??r?.customFields?.diceProfileData?.candidateId??``;r={...r,id:r?.id??e,diceId:e,candidateId:t}}return r}function Tr(e){return String(e??``).replace(/^__mw__.*?__/,``).replace(/\[\d+\]$/,``).trim()||`file`}async function Er(e,n,r=[],i={}){if(!e)throw Error(`moduleName is required to upload documents`);if(!n)throw Error(`refId (created record id) is required to upload documents`);if(!r.length)return{data:[],total:0};let a=await t.a(),o=new FormData;r.forEach(({formKey:e,file:t})=>{let n=t?.name??void 0;o.append(Tr(e),t,n)}),i&&Object.keys(i).length>0&&o.append(`metadata`,JSON.stringify(i));let s=new URLSearchParams({module:e,refId:String(n)}),c;try{c=await fetch(`${t.x}/documents/upload?${s.toString()}`,{method:`POST`,headers:{Authorization:`Bearer ${a}`},body:o})}catch(e){let t=Error(`Unable to connect to the server. Please check your network connection.`);throw t.originalError=e,t}let l=(c.headers.get(`content-type`)||``).includes(`application/json`)?await c.json():await c.text();if(!c.ok){let e=(typeof l==`object`?l?.error||l?.message:l)||`Server returned status ${c.status}`,t=Error(e);throw t.status=c.status,t.data=l,t}return l?.data??l}async function Dr(e,n,r=``){if(!e)throw Error(`moduleName is required to fetch documents`);if(!n)throw Error(`refId is required to fetch documents`);let i=new URLSearchParams({module:e,refId:String(n)});r&&i.set(`fieldName`,r);let a=await t.o(t.x,`/documents?${i.toString()}`),o=a?.data??a??{};return{data:Array.isArray(o?.data)?o.data:Array.isArray(o)?o:[],total:o?.total??0}}async function Or(e){if(!e)return!1;try{return await t.o(t.x,`/documents/${encodeURIComponent(String(e))}`,{method:`DELETE`}),!0}catch{return!1}}function kr(){let e=Math.floor(Date.now()/1e3).toString(16).padStart(8,`0`).slice(0,8),t=new Uint8Array(8);if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`)crypto.getRandomValues(t);else for(let e=0;e<t.length;e+=1)t[e]=Math.floor(Math.random()*256);return`${e}${Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}`}function Ar(e){return(Array.isArray(e)?e:Array.isArray(e?.data)?e.data:[]).map(e=>String(e?.id??e?._id??``).trim()).filter(Boolean)}async function jr(e=[]){let t=Array.from(new Set((e||[]).map(e=>String(e||``).trim()).filter(Boolean)));t.length!==0&&await Promise.allSettled(t.map(e=>Or(e)))}var Mr={job:{fetchUrl:e=>`${t.T}/edit/detailed-view/${encodeURIComponent(e)}`},candidate:{fetchUrl:e=>`${t.S}/edit/detailed-view?_id=${encodeURIComponent(e)}`},candidates:{fetchUrl:e=>`${t.S}/edit/detailed-view?_id=${encodeURIComponent(e)}`},submission:{fetchUrl:e=>`${t.D}/edit/detailed-view?_id=${encodeURIComponent(e)}`}};async function Nr(e,n){let r=String(e??``).trim().toLowerCase();if(r===`job`||r===`jobs`){let{getJobDetailView:e}=await Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.r);return e(n)}if(r===`candidate`||r===`candidates`)return Fr(r===`candidate`?`candidate`:`candidates`,n);let i=new URLSearchParams({module:String(e??``),id:String(n)});return t.o(t.x,`/module-data-detail?${i.toString()}`)}async function Pr(e){let n=await t.o(t.x,`/module-actions?module=${encodeURIComponent(e)}`),r=n?.data??n??{};return{actions:Array.isArray(r.actions)?r.actions:[],actionRules:Array.isArray(r.actionRules)?r.actionRules:[]}}async function Fr(e,n){if(!e)throw Error(`module is required`);if(!n)throw Error(`id is required`);let r=Mr[e];if(!r)throw Error(`No edit config for module: ${e}`);let i=await t.a(),a=await fetch(r.fetchUrl(n),{method:`GET`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${i}`}});if(!a.ok)throw Error(`API ${a.status}: ${a.statusText}`);let o=await a.json();return o.data??o}async function Ir(e,n,r,i=[]){if(!e)throw Error(`module is required`);if(!n)throw Error(`id is required`);let a=await t.a(),o=new FormData;o.append(`json`,JSON.stringify(r)),(i??[]).forEach(({formKey:e,file:t})=>o.append(e,t));let s;try{s=await fetch(`${t.x}/module/update/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`,{method:`PUT`,headers:{Authorization:`Bearer ${a}`},body:o})}catch(e){let t=Error(`Unable to connect to the server. Please check your network connection.`);throw t.originalError=e,t}if(!s.ok){let e=await s.text();console.error(`[updateRecord] Error response:`,e);let t=Error(Rr(e)||`API ${s.status}: ${s.statusText}`);throw t.status=s.status,t.response=Lr(e),t}let{invalidateFormGroupsCache:c}=await Promise.resolve().then(()=>require("./formGroupsCache-Bbz-28ws.cjs")).then(e=>e.n);c();let l=await s.json();return l.data??l}function Lr(e){let t=String(e??``).trim();if(!t.startsWith(`{`))return null;try{return JSON.parse(t)}catch{return null}}function Rr(e){let t=String(e??``).trim();if(!t.startsWith(`{`))return t;try{let e=JSON.parse(t),n=e?.error??e?.message;return typeof n==`string`&&n.trim()?n.trim():t}catch{return t}}var zr=e=>e?.data??e;async function Br(e,n){if(!e||!n)return[];let r=new URLSearchParams({module:e,id:String(n)}),i=zr(await t.o(t.x,`/module-activity?${r.toString()}`));return Array.isArray(i)?i:[]}async function Vr(e){if(!e)return[];let n=zr(await t.o(t.x,`/notes?relatedId=${encodeURIComponent(e)}`));return Array.isArray(n)?n:[]}async function Hr({relatedId:e,notes:n,title:r,notesFor:i}){return zr(await t.o(t.x,`/notes`,{method:`POST`,body:JSON.stringify({relatedId:e,notes:n,title:r,notesFor:i})}))}var Ur=(0,r.createContext)(void 0);function Wr(e,t){return(typeof e==`string`?e.trim():``)||bn(t)||yn()}function Gr(){let e=(0,r.useContext)(Ur);return Wr(e?.override,e?.moduleName)}function Kr(e,t){if(!e)return!0;let n=e.find(e=>e.name===t);return!n||n.enabled!==!1}function qr(e,t,n){if(!e)return!0;let r=e.find(e=>e.name===t);if(!r)return!0;let i=r.fields?.find(e=>e.field===n);return!i||i.locked?!0:i.enabled!==!1}function Jr(e,t,n){if(!e)return!0;let r=e.find(e=>e.name===t);if(!r)return!0;if(r.editable===!1)return!1;let i=r.fields?.find(e=>e.field===n);return!i||i.editable!==!1}var Yr=[`p`,`br`,`strong`,`b`,`em`,`i`,`u`,`s`,`ul`,`ol`,`li`,`blockquote`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`a`,`code`,`pre`],Xr=[`href`,`title`,`target`,`rel`],Zr=/[\u200B-\u200D\u2060\uFEFF]/g,Qr=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,$r=/^[\p{L}\p{M}\p{N} .'-]+$/u,ei=/^\+?[0-9 ()-]+$/,ti=/^-?(?:\d+|\d*\.\d+)$/,ni=[{re:/<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta|base|applet|frame|frameset)\b/i,message:`HTML/script content is not allowed`},{re:/\b(?:javascript|vbscript)\s*:|\bdata\s*:\s*text\/html/i,message:`Unsafe URL protocol is not allowed`},{re:/\bon[a-z]+\s*=/i,message:`HTML event handlers are not allowed`},{re:/["']?\$(?:where|gt|gte|lt|lte|ne|nin|regex|or|and|not|nor|expr|function|jsonSchema|accumulator)\b/i,message:`MongoDB operators are not allowed in input values`},{re:/(?:\.\.[/\\])|(?:%2e%2e|%5c)/i,message:`Path traversal is not allowed`},{re:/<\/?[a-zA-Z][a-zA-Z0-9]*(?:\s[^<>]*)?>/,message:`HTML tags are not allowed`,plainOnly:!0}];function ri(e){if(typeof document>`u`)return e;let t=document.createElement(`textarea`);return t.innerHTML=e,t.value}function ii(e){let t=String(e??``);for(let e=0;e<2;e+=1)try{let e=decodeURIComponent(t);if(e===t)break;t=e}catch{break}return t=ri(t).replace(/\\x([0-9a-f]{2})/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16))).replace(/\\u([0-9a-f]{4})/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16))),t.normalize(`NFC`)}function ai(e){return _.default.sanitize(String(e??``),{ALLOWED_TAGS:Yr,ALLOWED_ATTR:Xr,ALLOW_DATA_ATTR:!1,FORBID_TAGS:[`script`,`style`,`iframe`,`object`,`embed`,`svg`,`img`,`form`,`input`],FORBID_ATTR:[`style`,`src`,`srcset`]})}function oi(e){let t=(e.validations??[]).find(e=>e?.type===`max`),n=Number(e.validator?.maxLength??t?.value??e.maxLength);return Number.isFinite(n)&&n>0?n:e.type===`email`||e.formatter===`email`?255:e.formatter===`phone`||e.formatter===`digits`?32:e.formatter===`name`?100:e.type===`text-editor`?5e4:(e.type,5e3)}function si(e){return e.type===`textarea`||e.type===`text-editor`}function ci(e,t={}){if(typeof e!=`string`)return e;if(t.type===`text-editor`)return ai(e.normalize(`NFC`));let n=e.normalize(`NFC`).replace(Zr,``).replace(/\u00A0/g,` `).replace(Qr,``);return n=si(t)?n.replace(/\r\n?/g,`
4
+ `).replace(/[ \t]{2,}/g,` `).trim():n.replace(/\s+/g,` `).trim(),n}function li(e,t={}){if(typeof e!=`string`||e===``)return null;let n=t.label||t.field||`Field`,r=ii(e);if(r.includes(`\0`)||r.includes(`\0`))return`${n} contains a null byte`;let i=t.type===`text-editor`,a=ni.find(({re:e,plainOnly:t})=>(!t||!i)&&e.test(r));if(a)return`${n}: ${a.message}`;let o=ci(e,t);return[...o].length>oi(t)?`${n} is too long`:t.formatter===`name`&&o&&!$r.test(o)?`${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods`:(t.formatter===`phone`||t.formatter===`digits`)&&o&&!ei.test(o)?`${n} contains invalid phone characters`:t.type===`number`&&o&&!ti.test(o)?`${n} must contain only a valid number`:(t.type===`url`||t.formatter===`url`)&&o&&!/^https?:\/\//i.test(o)?`${n} must use http:// or https://`:null}function ui(e){return{validator:(t,n)=>{let r=(Array.isArray(n)?n:[n]).map(t=>li(t,e)).find(Boolean);return r?Promise.reject(Error(r)):Promise.resolve()}}}function di(e=[]){let t=new Map;return e.forEach(e=>{(e.fields??[]).forEach(n=>{if(n.type===`file`)return;let r=n.payloadKey||n.field;if(!r)return;let i=e.addRow?`${e.payloadKey||e.name}[].${r}`:r;t.set(i,n)})}),t}function fi(e,t=[]){let n=di(t),r=(e,t=``)=>{if(typeof e==`string`){let r=n.get(t)??{},i=li(e,r);if(i)throw Error(i);return ci(e,r)}return Array.isArray(e)?e.map(e=>r(e,`${t}[]`)):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>{if(e.startsWith(`$`)||e.includes(`.`)||e.includes(`\0`))throw Error(`Unsafe object key: ${e}`);let i=t?`${t}.${e}`:e;return[e,r(n,i)]})):e};return r(e)}var pi=e=>e===!0||e===1||e===`1`||e===`true`;function mi(e){let t=e?.overrideCheckbox;return!t||typeof t!=`object`?null:gi(e).size>0?t:null}function hi(e){return String(e?.overrideCheckbox?.field??``).trim()||`${String(e?.field??``).replace(/\./g,`_`)}__override`}function gi(e){let t=e?.overrideCheckbox?.skipValidations,n=Array.isArray(t)?t:String(t??``).split(`,`);return new Set(n.map(e=>String(e??``).trim()).filter(Boolean))}function _i(e){return e?.overrideCheckbox?.store!==!1}function vi(e,t,n){let r=hi(e);if(typeof n==`function`){let e=n(r);if(Array.isArray(e)&&e.length)return[...e,r]}return Array.isArray(t)&&t.length>=3&&typeof t[1]==`number`?[t[0],t[1],r]:[r]}function yi(e,t){return n=>{let r=!1;try{r=pi(n?.getFieldValue?.(t))}catch{r=!1}return r?{}:e}}function bi(e,t,n,r){if(!mi(e))return r;let i=gi(e),a=vi(e,t,n);return e=>{let t=r(e),n=typeof e==`string`?e:e?.type;return i.has(n)?yi(t,a):t}}function xi(e){let t=mi(e)??{},n=e?.label??e?.field??`this field`;return{tone:t.tone??`overwrite`,title:t.confirmTitle||`Remove the validation on this field?`,body:t.confirmBody||`The check that keeps ${n} within its allowed limit will be turned off for this record, and a value above that limit will be accepted. The override is recorded against the record. Do you want to continue?`,okText:t.confirmOkText||`Yes, remove the limit`,cancelText:t.confirmCancelText||`Keep the limit`}}function Si(e){return String(e??``).normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,``)}function Ci(e){let t=new Map,n=(e,n)=>{let r=Si(e);r&&!t.has(r)&&t.set(r,n)};return(Array.isArray(e?.options)?e.options:[]).forEach(e=>{if(e==null)return;let t=typeof e==`object`?e.value:e;t!=null&&t!==``&&(n(t,t),typeof e==`object`&&e.label!==void 0&&n(e.label,t))}),Object.entries(e?.optionAliases??{}).forEach(([e,r])=>{let i=t.get(Si(r));i!==void 0&&n(e,i)}),t}var wi=e=>Array.isArray(e?.options)&&e.options.length>0;function Ti(e,t){if(t==null||t===``||typeof t==`object`)return t;let n=e.get(Si(t));return n===void 0?t:n}function Ei(e,t){if(!wi(e))return t;let n=Ci(e);return n.size===0?t:Array.isArray(t)?t.map(e=>Ti(n,e)):Ti(n,t)}function Di(e={}){let t=e?.defaultValue;if(t===void 0||t===``)return;if(e?.type===`time`)return Ai(t);if(e?.type===`date`)return Ni(t);if(e?.type!==`checkbox`)return t;let n=Array.isArray(e.options)?e.options:[];if(!n.length)return t;let r=n.map(e=>String(e&&typeof e==`object`?e.value:e));return(Array.isArray(t)?t:[t]).some(e=>r.includes(String(e)))?t:void 0}var Oi=/^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap]\.?\s?m\.?)?$/i,ki=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;function Ai(e){if(e==null||e===``)return;if(s.default.isDayjs(e))return e.isValid()?e:void 0;if(typeof e!=`string`)return;let t=e.trim(),n=t.match(Oi);if(n){let e=Number(n[1]),t=Number(n[2]),r=Number(n[3]??0),i=n[4]?.replace(/[.\s]/g,``).toLowerCase();if(i){if(e<1||e>12)return;e=e%12+(i===`pm`?12:0)}return e>23||t>59||r>59?void 0:(0,s.default)().hour(e).minute(t).second(r).millisecond(0)}if(ki.test(t)){let e=(0,s.default)(t);return e.isValid()?e:void 0}}var ji=/^today\s*(?:([+-])\s*(\d{1,4}))?$/i,Mi=/^\d{4}-\d{2}-\d{2}(?:[T ].*)?$/;function Ni(e,t=(0,s.default)()){if(e==null||e===``)return;if(s.default.isDayjs(e))return e.isValid()?e:void 0;if(e instanceof Date){let t=(0,s.default)(e);return t.isValid()?t:void 0}if(typeof e!=`string`)return;let n=e.trim(),r=n.match(ji);if(r){let e=r[2]?Number(r[2])*(r[1]===`-`?-1:1):0;return(0,s.default)(t).startOf(`day`).add(e,`day`)}if(Mi.test(n)){let e=(0,s.default)(n);return e.isValid()?e:void 0}}var Pi=`csvTags`,Fi=e=>e.toLowerCase();function Ii(e){let t=Array.isArray(e)?e:[e],n=[],r=new Set;return t.forEach(e=>{e!=null&&typeof e!=`object`&&String(e).split(`,`).forEach(e=>{let t=e.trim().replace(/\s+/g,` `);!t||r.has(Fi(t))||(r.add(Fi(t)),n.push(t))})}),n}function Li(e,t=`, `){return Ii(e).join(t||`, `)}var F=e=>e==null||e===``||Array.isArray(e)&&e.length===0,Ri=e=>e===!0||e===1||e===`1`,I=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!zi(e);function zi(e){return e&&typeof e==`object`&&typeof e.format==`function`&&typeof e.isValid==`function`}function Bi(e){return zi(e)||e instanceof Date}function Vi(e){return e instanceof Date?e.toISOString():zi(e)?e.isValid()?e.toISOString():null:e}function Hi(e,t){if(!jn(t))return Vi(e);let n=Mn(e);return n?n.toISOString():Vi(e)}function L(e,t){if(!t)return;let n=String(t).split(`.`),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}function R(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:L(e,t)}function z(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?!0:L(e,t)!==void 0}function B(e,t,n){let r=String(t).split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];I(i[t])||(i[t]={}),i=i[t]}return i[r[r.length-1]]=n,e}function Ui(e,t,n){let r=String(t).split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];I(i[t])||(i[t]={}),i=i[t]}let a=r[r.length-1];return i[a]=I(i[a])&&I(n)?{...n,...i[a]}:n,e}function Wi(e){let t=Array.isArray(e)?e:e==null?[]:[e];if(!t.length||t.some(e=>e?.originFileObj))return;let n=t.map(e=>e?.stored).filter(e=>e!=null);if(n.length)return n.length===1&&t.length===1?n[0]:n}function Gi(e,t){return Object.entries(t??{}).forEach(([t,n])=>{I(n)&&I(e[t])?Gi(e[t],n):e[t]=n}),e}function Ki(e,t){let n=e.options??e.values??[];for(let e of n)if(typeof e==`string`){if(e===t)return e}else if((e.value??e.id??e.name??e.label)===t)return e.label??e.name??e.value}function qi(e,t){if(I(e)){let n=(t.valueKey&&e[t.valueKey])??e.value??e.id??e._id??e.key??e.code;return{value:n,label:(t.displayKey&&e[t.displayKey])??e.label??e.name??e.text??e.title??n}}return{value:e,label:Ki(t,e)??e}}function Ji(e={}){if(e.dataType&&e.dataType!==`auto`)return e.dataType;if(e.multiSelect||e.mode===`multiple`||e.addRow)return`array`;if(e.type===`csvTags`)return`csv`;switch(e.type){case`number`:return`number`;case`date`:case`time`:return`date`;default:return`auto`}}function V(e,t,n={}){if(Bi(e)){if(t===`string`)return Hi(e,n);if(t===`number`){let t=zi(e)?e.valueOf():e.getTime();return Number.isNaN(t)?null:t}if(t===`date`||t===`auto`||!t)return Hi(e,n)}switch(t){case`string`:return e==null?``:String(e);case`csv`:return Li(e,n.csvSeparator);case`number`:{if(F(e))return null;let t=Number(e);return Number.isNaN(t)?null:t}case`boolean`:return e===!0||e===1||e===`1`||e===`true`;case`array`:{let t;return t=Array.isArray(e)?e:F(e)?[]:typeof e==`string`&&e.includes(`,`)?e.split(`,`).map(e=>e.trim()).filter(Boolean):[e],n.elementType?t.map(e=>V(e,n.elementType,{})).filter(e=>e!=null&&e!==``):t}case`object`:return I(e),e;case`date`:return Hi(e,n);case`custom`:case`auto`:case void 0:default:return e}}var Yi={firstChecked:e=>Array.isArray(e)?e[0]:e,csvToArray:e=>typeof e==`string`?e.split(`,`).map(e=>e.trim()).filter(Boolean):e,arrayToCsv:e=>Array.isArray(e)?e.join(`,`):e,trim:e=>typeof e==`string`?e.trim():e,upper:e=>typeof e==`string`?e.toUpperCase():e,lower:e=>typeof e==`string`?e.toLowerCase():e};function Xi(e,t){if(!t)return e;let n=t;if(typeof n==`string`){if(Yi[n])return Yi[n](e);try{n=JSON.parse(n)}catch{return e}}let r=e;if(n.name&&Yi[n.name]&&(r=Yi[n.name](r)),n.map&&typeof n.map==`object`){let e=String(Array.isArray(r)?r[0]:r);Object.prototype.hasOwnProperty.call(n.map,e)?r=n.map[e]:n.default!==void 0&&(r=n.default)}return r}var Zi=/\{\{\s*([\w.]+)\s*\}\}/g;function Qi(e,t){let[n,...r]=e.split(`.`),i;if(n===`value`)i=t.value;else if(n===`label`)i=t.label;else if(n===`raw`)i=t.raw;else return;return r.length?L(i,r.join(`.`)):i}function $i(e,t){if(typeof e==`string`){let n=e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);return n?Qi(n[1],t):e.replace(Zi,(e,n)=>{let r=Qi(n,t);return r==null?``:String(r)})}if(Array.isArray(e))return e.map(e=>$i(e,t));if(I(e)){let n={};return Object.entries(e).forEach(([e,r])=>{n[e]=$i(r,t)}),n}return e}function ea(e){if(!e)return null;if(typeof e==`string`)try{return JSON.parse(e)}catch{return null}return e}function ta(e,t){let n=e.payloadMode||`auto`,r=Ji(e),{value:i,label:a}=qi(t,e);switch(n){case`value`:return{kind:`scalar`,out:V(i,r,e)};case`label`:return{kind:`scalar`,out:V(a,e.dataType||`string`,e)};case`object`:{let t=e.valueKey||`id`,n=e.displayKey||`name`;return{kind:`scalar`,out:{[t]:V(i,e.elementType||`auto`,{}),[n]:a}}}case`custom`:case`template`:{let n=ea(e.payloadTemplate);if(!n)return{kind:`scalar`,out:V(i,r,e)};let o=$i(n,{value:V(i,e.elementType||`auto`,{}),label:a,raw:t});return{kind:e.payloadKey?`scalar`:`spread`,out:o}}default:return{kind:`scalar`,out:V(i,r,e)}}}function na(e={}){let t=e.defaultValue;if(t!==void 0&&t!==``)return e.type===`time`?Ai(t):e.type===`date`?Ni(t):t}function ra(e,t){if(e.payloadMode===`skip`)return{kind:`skip`};let n=t;if(F(n)){let t=na(e);t!==void 0&&(n=t)}return n=Xi(n,e.transformRule),F(n)&&e.omitEmpty?{kind:`skip`}:Array.isArray(n)&&(Ji(e)===`array`||e.payloadMode===`object`)&&e.payloadMode&&e.payloadMode!==`value`&&e.payloadMode!==`auto`?{kind:`scalar`,out:n.map(t=>ta(e,t).out)}:ta(e,n)}function ia(e={}){return!!e.richValue||[`label`,`object`,`custom`,`template`].includes(e.payloadMode)}function aa(e,t,n=[]){if(!ia(e)||t==null)return t;let r=e=>{if(I(e)&&e.value!==void 0)return e;let t=n.find(t=>String(t?.value??``)===String(e)||String(t?.label??``)===String(e));return{value:t?.value??e,label:t?.label??String(e)}};return Array.isArray(t)?t.map(r):r(t)}function oa(e,t,n){if(!e?.field)return!0;let r=z(t,e.field)?R(t,e.field):R(n??t,e.field),i=()=>String(e.value??``).split(`,`).map(e=>e.trim());switch(e.operator){case`eq`:return String(r??``)===String(e.value??``);case`neq`:return String(r??``)!==String(e.value??``);case`truthy`:return r!=null&&r!==``&&r!==!1;case`falsy`:return r==null||r===``||r===!1;case`notEmpty`:return Array.isArray(r)?r.length>0:!!r;case`in`:return i().includes(String(r??``));case`notIn`:return!i().includes(String(r??``));default:return!0}}function sa(e){let t=[];return e?.field&&t.push(e.field),Array.isArray(e?.conditions)&&e.conditions.forEach(e=>{e?.field&&t.push(e.field)}),t}function ca(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=>oa(e,t,n)),a=String(e.logic??`and`).toLowerCase()===`or`,o=a?i.some(Boolean):i.every(Boolean);if(e.field){let r=oa(e,t,n);o=a?o||r:o&&r}return o}return oa(e,t,n)}function la(e,t,n,r,i=new Set){let a=sa(e?.showIf);return!a.length||i.has(e.field)?!0:(i.add(e.field),ca(e.showIf,t,n)?a.every(e=>{let a=r?.get?.(e);return!a||la(a,t,n,r,i)}):!1)}function ua(e=[]){let t=new Map;return e.forEach(e=>(e.fields??[]).forEach(e=>{e?.field&&!t.has(e.field)&&t.set(e.field,e)})),t}function da(e={},{editing:t=!1}={}){let n={};return(e.fields??[]).forEach(e=>{if(!(!e.field||H(e))&&!(t&&!e.defaultOnEdit)&&e.defaultValue!==void 0&&e.defaultValue!==``){if(e.type===`time`){let t=Ai(e.defaultValue);t!==void 0&&(n[e.field]=t);return}if(e.type===`date`){let t=Ni(e.defaultValue);t!==void 0&&(n[e.field]=t);return}n[e.field]=e.defaultValue}}),n}function fa(e=[]){let t=[];return e.forEach(e=>{(e.fields??[]).forEach(n=>{t.push({field:n,group:e})})}),t}var pa=[`file`,`document`,`image`,`upload`,`attachment`];function H(e){return pa.includes(String(e?.type??``).trim().toLowerCase())}function ma(e=[]){return fa(e).map(({field:e})=>e).filter(H)}function ha(e){return String(e??``).trim().toLowerCase()}function ga(e,t){return!!t&&ha(e.moduleName)===t}function _a(e,t=[],n={}){let r=[],i=n.scope??`all`,a=ha(n.module),o=(e,t)=>{t!=null&&(Array.isArray(t)?t:[t]).forEach(t=>{let n=t?.originFileObj||t;(typeof File<`u`&&n instanceof File||typeof Blob<`u`&&n instanceof Blob)&&r.push({formKey:e,file:n})})};return(t??[]).forEach(t=>{let r=(t.fields??[]).filter(H);if(!r.length)return;let s=t.moduleName&&!ga(t,a),c=e=>s?`__mw__${t.moduleName}__${e}`:e;if(t.addRow){if(i===`flat`)return;let a=e[t.name];if(!Array.isArray(a))return;r.forEach(e=>{let t=e.fileKey??String(e.field).split(`.`)[0];a.forEach((r,i)=>{let a=c(n.indexed?`${t}[${i}]`:t);o(a,R(r,e.field))})});return}i!==`addRow`&&r.forEach(t=>{let n=c(t.fileKey??String(t.field).split(`.`)[0]);o(n,R(e,t.field))})}),r}function va(e,t,n={}){let r=I(n.base)?structuredClone(n.base):{};ma(t).forEach(e=>{(e.payloadKey||e.field)&&(xa(r,e.payloadKey||e.field),xa(r,e.field))});let i=ha(n.module),a=ua(t),o=new Map,s=e=>!e.moduleName||ga(e,i)?r:(o.has(e.moduleName)||o.set(e.moduleName,{}),o.get(e.moduleName));return(t??[]).forEach(t=>{let n=s(t),r=t.fields??[],i=t.toggleEnabled&&t.toggleField&&z(e,t.toggleField)?!!R(e,t.toggleField):!1;if(t.toggleEnabled&&t.toggleField&&z(e,t.toggleField)&&(B(n,t.toggleField,i),i&&t.addRow)){B(n,t.payloadKey||t.name,[]);return}if(t.addRow){let i=e[t.name];if(!Array.isArray(i))return;B(n,t.payloadKey||t.name,i.map(t=>ba(r,t,e,a)).filter(e=>e&&Object.keys(e).length>0));return}r.forEach(t=>ya(t,e,n,e,a))}),o.size>0&&(r.moduleWrites=Array.from(o,([e,t])=>({moduleName:e,data:t}))),fi(r,t)}function ya(e,t,n,r,i){if(mi(e)&&_i(e)){let r=hi(e);z(t,r)&&B(n,r,!!R(t,r))}if(H(e)){let i=Wi(R(t,e.field));if(i!==void 0){let a=r!==void 0&&r!==t;Ui(n,e.payloadKey||(a?e.field:e.fileKey||e.field),i)}return}if(sa(e.showIf).length&&!la(e,t,r,i)){(r===void 0||r===t)&&z(t,e.field)&&B(n,e.payloadKey||e.field,null);return}if(Array.isArray(e.subFields)&&e.subFields.length>0){if(!z(t,e.field))return;let a=R(t,e.field);if(!Array.isArray(a))return;let o=a.map(t=>ba(e.subFields,t,r,i)).filter(e=>e&&Object.keys(e).length>0);B(n,e.payloadKey||e.field,o);return}if(!z(t,e.field))return;if(Ri(e.addRow)&&(!Array.isArray(e.subFields)||e.subFields.length===0)){let r=R(t,e.field),i=Array.isArray(r)?r:F(r)?[]:[r],a=Ca(e),o=i.map(e=>ra(a,e)).filter(e=>e.kind!==`skip`).map(e=>e.out);B(n,e.payloadKey||e.field,o);return}let a=ra(e,R(t,e.field));if(a.kind!==`skip`){if(a.kind===`spread`&&I(a.out)){Gi(n,a.out);return}B(n,e.payloadKey||e.field,a.out)}}function ba(e,t,n,r){let i={};return e.forEach(e=>ya(e,t,i,n??t,r)),i}function xa(e,t){let n=String(t).split(`.`),r=e;for(let e=0;e<n.length-1;e+=1){if(!I(r[n[e]]))return;r=r[n[e]]}delete r[n[n.length-1]]}var Sa=new Set([`text`,`textarea`,`email`,`phone`,`tel`,`number`,`date`,`time`,`datetime`,`password`]);function U(e,t){let n=t=>(Array.isArray(e.emptyValues)?e.emptyValues:[]).some(e=>String(e)===String(t)),r=()=>e.defaultOnEdit?na(e):void 0;if(t==null)return r()??t;if(n(t)||F(t)&&r()!==void 0)return r();if(Sa.has(e.type)&&I(t)){let n=String(e.payloadKey||e.field||``).split(`.`).pop(),r=n?t[n]:void 0;if(r===void 0||I(r))return;t=r}if(e.type===`csvTags`)return Ii(t);if(e.type===`date`||e.type===`time`){if(!t||t===`0001-01-01T00:00:00Z`)return null;let e=(0,s.default)(t);return e.isValid()?e:null}t=Ei(e,t);let i=t=>I(t)?(e.valueKey&&t[e.valueKey])??t.id??t._id??t.value??t.userId??t.recruiterId:t,a=e.type!==`radio`&&Ji(e)===`array`,o=t=>{if(t==null||t===``||!Array.isArray(e.options))return t;let n=e.options.find(e=>String(e?.value??``).toLowerCase()===String(t).toLowerCase());return n?n.value:t};if(e.type===`select`||e.type===`radio`||e.type===`checkbox`){if(a)return(Array.isArray(t)?t:[t]).map(i).map(o).filter(e=>e!=null&&e!==``&&!n(e));let e=o(i(Array.isArray(t)?t[0]:t));return n(e)?r():e}return t}function Ca(e={}){return{...e,addRow:!1,multiSelect:!1,mode:void 0,dataType:void 0}}function wa(e,t){let n=Math.max(0,Number(e.minRows??0)||0),r=e.initialRows!==void 0&&e.initialRows!==``?Math.max(n,Math.max(0,Number(e.initialRows)||0)):n;if(Array.isArray(e.subFields)&&e.subFields.length>0){let i=[];Array.isArray(t)&&(i=t.map(t=>{let n={};return e.subFields.forEach(e=>{if(!e.field||H(e))return;let r=L(t??{},e.field)??(t??{})[e.field];r!=null&&(n[e.field]=U(e,r))}),n}));let a=i.length>0?n:Math.max(n,r);for(;i.length<a;)i.push({});return i}let i=Ca(e),a=[];if(Array.isArray(t))a=t.map(e=>U(i,e)).filter(e=>e!=null&&e!==``);else if(t!=null&&t!==``){let e=U(i,t);e!=null&&e!==``&&(a=[e])}let o=a.length>0?n:Math.max(n,r);for(;a.length<o;)a.push(void 0);return a}var Ta=e=>e===!0||e===1||e===`1`;function Ea(e=[]){let t=new Map;e.forEach(e=>{let n=e?.linkGroup;!Ta(e?.addRow)||!n||(t.has(n)||t.set(n,[]),t.get(n).push(e.name))});let n=new Map;return t.forEach((e,t)=>{e.length<2||n.set(t,{leaderName:e[0],memberNames:e})}),n}function Da(e,t){for(let n of e.values())if(n.memberNames.includes(t))return n;return null}function Oa(e,t={}){let n={...t};return e.forEach(({memberNames:e})=>{let t=Math.max(...e.map(e=>(n[e]??[]).length));e.forEach(e=>{let r=n[e]??[];r.length<t&&(n[e]=[...r,...Array.from({length:t-r.length},()=>({}))])})}),n}var ka={duplicate:{className:`fdd-tone-amber`,Icon:a.UserOutlined},overwrite:{className:`fdd-tone-amber`,Icon:a.ExclamationCircleFilled},suggestion:{className:`fdd-tone-blue`,Icon:a.InfoCircleFilled},file:{className:`fdd-tone-blue`,Icon:a.FileTextOutlined}};function Aa({tone:e=`suggestion`,title:t,body:n,facts:r=[],okText:a=`Continue`,cancelText:s=`Cancel`,danger:c=!1,footnote:l,altText:u}={}){let{className:d,Icon:f}=ka[e]??ka.suggestion,p=r.filter(e=>e&&e.value!==void 0&&e.value!==null&&String(e.value).trim()!==``);return new Promise(e=>{let r=!1,m=t=>{r||(r=!0,e(t))},h=i.Modal.confirm({...u?{footer:(e,{OkBtn:t,CancelBtn:n})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Button,{size:`large`,className:`fdd-alt-btn`,onClick:()=>{m(`alt`),h.destroy()},children:u}),(0,o.jsx)(n,{}),(0,o.jsx)(t,{})]})}:{},icon:null,centered:!0,width:u?600:480,className:`fdd-modal ${d}${u?` fdd-modal--three`:``}`,okText:a,cancelText:s,okButtonProps:{danger:c,size:`large`},cancelButtonProps:{size:`large`},content:(0,o.jsxs)(`div`,{className:`fdd`,children:[(0,o.jsxs)(`div`,{className:`fdd-head`,children:[(0,o.jsx)(`span`,{className:`fdd-icon`,"aria-hidden":`true`,children:(0,o.jsx)(f,{})}),(0,o.jsx)(`h3`,{className:`fdd-title`,children:t})]}),p.length>0&&(0,o.jsx)(`dl`,{className:`fdd-facts`,children:p.map(e=>(0,o.jsxs)(`div`,{className:`fdd-fact`,children:[(0,o.jsx)(`dt`,{children:e.label}),(0,o.jsx)(`dd`,{children:e.value})]},e.label))}),n&&(0,o.jsx)(`p`,{className:`fdd-body`,children:n}),l&&(0,o.jsx)(`p`,{className:`fdd-footnote`,children:l})]}),onOk:()=>m(!0),onCancel:()=>m(!1)})})}function ja({tone:e=`duplicate`,title:t,body:n,facts:r=[],okText:a=`Go back`}={}){let{className:s,Icon:c}=ka[e]??ka.suggestion,l=r.filter(e=>e&&String(e.value??``).trim()!==``);return new Promise(e=>{i.Modal.warning({icon:null,centered:!0,width:480,className:`fdd-modal ${s}`,okText:a,okButtonProps:{size:`large`},content:(0,o.jsxs)(`div`,{className:`fdd`,children:[(0,o.jsxs)(`div`,{className:`fdd-head`,children:[(0,o.jsx)(`span`,{className:`fdd-icon`,"aria-hidden":`true`,children:(0,o.jsx)(c,{})}),(0,o.jsx)(`h3`,{className:`fdd-title`,children:t})]}),l.length>0&&(0,o.jsx)(`dl`,{className:`fdd-facts`,children:l.map(e=>(0,o.jsxs)(`div`,{className:`fdd-fact`,children:[(0,o.jsx)(`dt`,{children:e.label}),(0,o.jsx)(`dd`,{children:e.value})]},e.label))}),n&&(0,o.jsx)(`p`,{className:`fdd-body`,children:n})]}),onOk:()=>e(!0)})})}async function Ma({module:e,group:n,field:r,actionKey:i,inputs:a={},files:o={}}){if(!e||!n||!r||!i)throw Error(`module, group, field and actionKey are required to run an AI action`);let s=await t.a(),c=new FormData;c.append(`json`,JSON.stringify({inputs:a})),Object.entries(o).forEach(([e,t])=>{t&&c.append(e,t)});let l=new URLSearchParams({module:e,group:n,field:r,action:i}),u=await fetch(`${t.x}/ai-action?${l.toString()}`,{method:`POST`,headers:{Authorization:`Bearer ${s}`},body:c}),{logout:d}=await Promise.resolve().then(()=>require("./authApi-DiRtkJl2.cjs")).then(e=>e.n);u.status===401&&d();let f=(u.headers.get(`content-type`)||``).includes(`application/json`)?await u.json():await u.text();if(!u.ok){let e=Error(f?.error||f?.message||`API ${u.status}: ${u.statusText}`);throw e.status=u.status,e.data=f,e}return f?.data??f}var Na=e=>e==null||e===``;function Pa(e,t){return String(t??``).split(`.`).filter(Boolean).reduce((e,t)=>e?.[t],e)}function Fa(e){let t=String(e??``).trim().replace(/[\s()-]/g,``);if(!t)return``;let n=t.replace(/^\+/,``);return/^\d{1,4}$/.test(n)?`+${n}`:``}function Ia(e){let t=String(e?.field??``).trim(),n=t.replace(/(number|no|phone|mobile|contact)$/i,``);return[...t?[`${t}CountryCode`,`${t}Code`]:[],...n&&n!==t?[`${n}CountryCode`]:[],`countryCode`,`phoneCountryCode`,`mobileCountryCode`,`contactCountryCode`,`dialCode`,`isdCode`]}function La(e,t,n=``){let r=e?.renderOptions?.countryCodeField??e?.countryCodeField,i=r?[r,...Ia(e)]:Ia(e);for(let e of i){let n=Fa(Pa(t,e));if(n)return n}return Fa(n)}function Ra(e){let t=String(e??``).trim(),n=t.match(/^(\+\d{1,4})[\s-]*(.*)$/);return n?{code:n[1],rest:n[2]}:{code:``,rest:t}}function za(e,t=``){if(Na(e))return``;let{code:n,rest:r}=Ra(e),i=n||Fa(t),a=gn(r)||r;return`${i?`${i} `:``}${a}`.trim()}function Ba(e,t,n){return za(t,La(e,n,mn()))}var Va=[{value:`auto`,label:`Default (auto)`},{value:`text`,label:`Text`},{value:`tag`,label:`Tag`},{value:`tags`,label:`Multi Tag (Skills)`},{value:`badge`,label:`Badge`},{value:`chip`,label:`Chip`},{value:`document`,label:`Document`},{value:`link`,label:`Link`},{value:`email`,label:`Email`},{value:`phone`,label:`Phone`},{value:`date`,label:`Date`},{value:`currency`,label:`Currency`},{value:`budget`,label:`Budget`},{value:`html`,label:`HTML`}],Ha=[{value:`preview`,label:`Preview (viewer)`},{value:`download`,label:`Download button`},{value:`link`,label:`Link (filename)`},{value:`tag`,label:`Tag`},{value:`text`,label:`Text (filename)`}],Ua=[{value:`none`,label:`None`},{value:`upper`,label:`UPPERCASE`},{value:`lower`,label:`lowercase`},{value:`title`,label:`Title Case`}],Wa=[`location`,`path`,`url`,`key`],Ga=[`location`,`filepath`,`path`,`url`,`key`],Ka=[`uploadedfilename`,`uploadname`,`originalname`,`displayname`,`documentname`,`filename`],qa=[`name`],Ja=e=>String(e).toLowerCase(),Ya=e=>e==null||e===``;function Xa(e,t){for(let n of t){let t=e[n];if(typeof t==`string`&&t)return t}return``}function Za(e,t){for(let n of t)for(let[t,r]of Object.entries(e))if(typeof r==`string`&&r&&Ja(t).endsWith(n))return r;return``}function Qa(e){if(!e)return``;let t=String(e).split(`?`)[0].split(`#`)[0];return decodeURIComponent(t.split(`/`).pop()||``)}function $a(e){if(!e)return``;let t=String(e);return/^https?:\/\//i.test(t)?t:``}function eo(e){let t=String(e??``).trim();return!t||/^https?:\/\//i.test(t)||t.startsWith(`blob:`)||t.startsWith(`data:`)?!1:t.includes(`/`)}function to(e){return typeof e==`string`?e.includes(`/`)?e:``:!e||typeof e!=`object`?``:Xa(e,Wa)||Za(e,Ga)}function no(e){return e?typeof e==`string`?Qa(e)||e:typeof e==`object`&&(Xa(e,A().documentNameOrder??[])||Za(e,Ka)||Qa(to(e))||Za(e,qa))||`Document`:`Document`}function ro(e){if(Ya(e))return[];let t=Array.isArray(e)?e:[e],n=[];for(let e of t)if(!Ya(e)){if(typeof e==`string`){let t=e.includes(`/`)?e:``;n.push({location:t,name:Qa(e)||e,url:$a(t),needsAuthFetch:eo(t)})}else if(typeof e==`object`){let t=to(e),r=e.fileUrl||e.downloadUrl||e.signedUrl||``;n.push({location:t,name:no(e),url:r||$a(t),documentId:e.id||e._id||e.documentId||``,needsAuthFetch:!r&&eo(t)})}}return n}function io(e){return e?.primaryField?e.primaryField:(e?.fields??[]).find(e=>e?.field)?.field??null}function ao(e,t){if(!Array.isArray(t)||t.length===0)return t;let n=io(e);if(!n)return t;let r=!1,i=t.map(e=>typeof e==`object`&&e&&!Array.isArray(e)?e:e==null||String(e).trim()===``?(r=!0,{}):(r=!0,{[n]:e}));return r?i:t}var oo=e=>e===!0||e===1||e===`1`,so=e=>e==null||e===``;function co(e){return String(e??``).split(`.`).map(e=>e.trim()).filter(Boolean)}function W(e,t,n){let r=Array.isArray(t)?t:co(t);if(!r.length)return e;let i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];(!i[t]||typeof i[t]!=`object`||Array.isArray(i[t]))&&(i[t]={}),i=i[t]}return i[r[r.length-1]]=n,e}function lo(e,t=[]){if(!(!e||typeof e!=`object`))for(let n of t){if(!n)continue;let t=L(e,n);if(!so(t))return t}}function uo(e,t){if(!e||typeof e!=`object`)return;let n=Object.entries(e),r=n.find(([e,n])=>t.test(e)&&!so(n));if(r)return r[1];for(let[,e]of n)if(e&&typeof e==`object`&&!Array.isArray(e)){let n=uo(e,t);if(!so(n))return n}}function fo(e,t){let n=Array.isArray(e)?e:e?[e]:[];if(!n.length)return;let r=n.map((e,n)=>{if(typeof e==`string`)return{uid:`${t.field}-${n}`,name:e,status:`done`};if(!e||typeof e!=`object`)return null;let r=lo(e,[t.fileUrlKey,t.locationKey])??uo(e,/(location|url|path)$/i)??``,i=lo(e,[t.fileNameKey])??uo(e,/(uploadName|uploadedFileName|fileName|name)$/i)??``;if(!r&&!i)return null;let a=r&&!String(r).startsWith(`http`)?$a(r):r;return{uid:String(e.id??e._id??e.uniqueName??e.documentCopyUniqueName??`${t.field}-${n}`),name:i||`file`,status:`done`,existing:!0,url:a||void 0,stored:e}}).filter(Boolean);return r.length?r:void 0}function po(e,t){if(!e||typeof e!=`object`)return;let n=lo(e,[t.fileNameKey,t.field])??uo(e,/(uploadName|uploadedFileName|fileName|name)$/i),r=lo(e,[t.fileUrlKey,t.locationKey])??uo(e,/(location|url|path)$/i)??``;if(!n&&!r)return;let i=r&&!String(r).startsWith(`http`)?$a(r):r,a=e.documentCopyUniqueName??e.uniqueName??n??`${t.field}-0`;return[{uid:String(a),name:n??`file`,status:`done`,existing:!0,url:i||void 0}]}function mo(e,t,n,r){(e.fields??[]).forEach(e=>{e?.verifyAction&&[e.verifyResultField,e.verifyTimestampField,...String(e.verifyLockedWhenFields??``).split(/[,\s]+/)].map(e=>String(e??``).trim()).filter(Boolean).forEach(e=>{if(L(n,e)!==void 0)return;let i=r(t,{field:e});i!=null&&W(n,e,i)})})}function ho(e){let t=Array.isArray(e.rows)?ao(e,e.rows):null,n=Math.max(0,Number(e.minRows??0)||0),r=(t,n,r)=>{let i={};return(e.fields??[]).forEach(e=>{if(!e.field)return;if(e.type===`file`){let r=n(t,e);r&&W(i,e.field,r);return}let a=r(t,e);if(a==null){let t=e.defaultOnEdit?na(e):void 0;t!==void 0&&W(i,e.field,t);return}W(i,e.field,oo(e.addRow)?wa(e,a):U(e,a))}),mo(e,t,i,r),i},i=da(e,{editing:!0});if(t&&t.length>0){let e=t.map(e=>r(e,(e,t)=>po(e,t),(e,t)=>L(e,t.field)));for(;e.length<n;)e.push({...i});return e}let a=r(e,(e,t)=>fo(t.value,t),(e,t)=>t.value),o=Object.keys(a).length>0?[a]:[];for(;o.length<n;)o.push({...i});return o}function go(e,t=[]){let n={};return t.forEach(e=>{e.toggleEnabled&&e.toggleField&&W(n,e.toggleField,!!e.toggleValue),!e.addRow&&(e.fields??[]).forEach(e=>{if(!e.field||e.addRow)return;let t=e.value,r=e.field;if(e.type===`file`){let i=fo(t,e);i&&W(n,r,i);return}if(t==null)return;if(e.type===`checkbox`&&Array.isArray(e.options)&&e.options.length>0){let i=e.transformRule?.map;if(i){let e=Object.entries(i).find(([,e])=>String(e)===String(t));W(n,r,e?[e[0]]:[])}else W(n,r,Ei(e,Array.isArray(t)?t:[t]));return}let i=e.splitDialCodeInto;if(i&&typeof t==`string`){let{code:a,rest:o}=Ra(t),s=Fa(a);s&&W(n,i,s),W(n,r,U(e,o||t));return}W(n,r,U(e,t))})}),Object.keys(n).length>0&&e.setFieldsValue(n),n}function _o(e){let t=document.createElement(`div`);return t.innerHTML=String(e??``),t.textContent||t.innerText||``}function vo(e,t){return t&&t===`stripHtml`?_o(e):e}function yo(e){return String(e??``).trim().split(/\s+/).filter(Boolean).length}function bo(e){return Object.values(e||{}).some(e=>e!=null&&e!==``)}function xo(e,t){if(e.kind===`file`)return Array.isArray(t)?t.length>0:!!t;let n=vo(t,e.transform),r=String(n??``).trim();if(!r)return!1;let i=Number(e.minWords)||0;return i>0?yo(r)>=i:!0}function So(e,t){let n=e.inputs||[];if(n.length===0)return!0;let r=new Map;n.forEach((e,t)=>{let n=e.group||`__solo_${t}`;r.has(n)||r.set(n,[]),r.get(n).push(e)});for(let e of r.values())if(e.some(e=>e.required||Number(e.minWords)>0)&&!e.some(e=>xo(e,t(e.sourceField))))return!1;return!0}function Co(e=[]){let t=[];return e.forEach(e=>{if(e?.addRow){e.name&&t.push(e.name);return}(e?.fields??[]).forEach(e=>{let n=e?.field??e?.name;n&&t.push(n)})}),t}function wo(e,t){return Co(t).some(t=>{let n=e.getFieldValue(t);return Array.isArray(n)?n.some(bo):n!=null&&n!==``})}function To(e,t=[],{includeUntouched:n=!1}={}){let r=e.getFieldsValue(!0)??{},i=new Set([t].flat().filter(Boolean)),a=n||typeof e.isFieldTouched!=`function`?()=>!0:t=>e.isFieldTouched(t),o=0;return Object.entries(r).forEach(([e,t])=>{if(!(i.has(e)||!a(e)||!Eo(t))){if(Array.isArray(t)){o+=t.filter(e=>e&&typeof e==`object`?bo(e):!!e).length;return}o+=1}}),o}function Eo(e){return e==null||e===``?!1:Array.isArray(e)?e.some(e=>e&&typeof e==`object`?bo(e):!!e):typeof e!=`object`||Object.values(e).some(e=>e!=null&&e!==``)}function Do(e,t=[],{includeUntouched:n=!1}={}){let r=e.getFieldsValue(!0)??{},i=new Set([t].flat().filter(Boolean)),a=Object.keys(r).filter(e=>!i.has(e));return n?a.some(e=>Eo(r[e])):typeof e.isFieldTouched==`function`?a.some(t=>e.isFieldTouched(t)&&Eo(r[t])):a.some(e=>Eo(r[e]))}function Oo(e=[]){let t={};return(e??[]).forEach(e=>{e?.addRow||(e?.fields??[]).forEach(e=>{let n=e?.field??e?.name;if(!n)return;let r=e?.value;r!=null&&r!==``&&(t[n]=r)})}),t}function ko(e,t,n){let r=e?.confirmWhen??`never`;return r===`never`?!1:r===`always`||wo(t,n)}var Ao=[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`],jo=`bottom-left`;function Mo(e=[]){let t={};return e.forEach(e=>{let n=Ao.includes(e.position)?e.position:jo;(t[n]??=[]).push(e)}),t}function No({form:e,groups:t,module:n,onApplied:a,onParsed:o,treatPrefilledAsData:s=!1}){let[c,l]=(0,r.useState)(null),[u,d]=(0,r.useState)(``),f=i.Form.useWatch(e=>e,e),p=(0,r.useCallback)(e=>So(e,e=>(f||{})[e]),[f]),m=(0,r.useCallback)(t=>{if(!Array.isArray(t)||t.length===0)return!1;let n=go(e,t.filter(e=>!e.addRow)),r=Object.keys(n).length>0;return t.forEach(t=>{if(!t.addRow||!Array.isArray(t.rows)||t.rows.length===0)return;let n=ho(t);if(n.length===0)return;r=!0;let i=()=>e.setFieldsValue({[t.name]:n}),a=(e.getFieldValue(t.name)||[]).filter(bo);if(a.length){let e=t.label||t.name;Aa({tone:`overwrite`,title:`Replace what's in ${e}?`,facts:[{label:`Section`,value:e},{label:`Rows you filled in`,value:a.length},{label:`Rows in the file`,value:n.length}],body:`Everything currently in ${e} will be removed and replaced with what the file says. The rest of the form is not affected.`,okText:`Replace them`,cancelText:`Keep mine`,danger:!0}).then(e=>{e&&i()})}else i()}),r},[e]);return{runAction:(0,r.useCallback)(async(t,r,c,u)=>{let f=c?.confirmWhen??`never`;if(c?.trigger===`upload`&&f!==`never`&&(f===`always`||Do(e,[r?.field],{includeUntouched:s}))){let t=c.confirmMessages??{},n=u?.name||e.getFieldValue(r?.field)?.slice?.(-1)?.[0]?.name,i=To(e,[r?.field],{includeUntouched:s});if(!await Aa({tone:`overwrite`,title:t.title||`Read this file and fill the form in?`,facts:[{label:`File`,value:n},{label:`You have filled in`,value:i?`${i} ${i===1?`answer`:`answers`}`:void 0}],body:t.body||`We can read the details out of this file and fill the form in for you. Where the file has an answer, it replaces what is currently in that box. Anything the file does not mention is left as you typed it.`,okText:t.ok||`Read it and fill in`,cancelText:t.cancel||`Keep what I typed`}))return}l(c.key),d(c.loadingText||`Reading ${c.label||`the file`}…`);try{let s={},l={};(c.inputs||[]).forEach(t=>{if(t.kind===`file`){let n=e.getFieldValue(t.sourceField),r=u??n?.[n.length-1]?.originFileObj;r&&(l[t.param]=r)}else{let n=e.getFieldValue(t.sourceField);n!=null&&n!==``&&(s[t.param]=vo(n,t.transform))}}),(c.inputs||[]).forEach(e=>{!e.group||e.kind!==`text`||(c.inputs||[]).some(t=>t.group===e.group&&t.kind===`file`&&l[t.param])&&delete s[e.param]});let d=await Ma({module:n,group:t,field:r.field,actionKey:c.key,inputs:s,files:l}),f=c.label||`AI action`,p=d?.groups;if(c?.trigger!==`upload`&&ko(c,e,p)){let e=c.confirmMessages??{},t=Co(p).length;if(!await Aa({tone:`overwrite`,title:e.title||`Fill the form in from ${f}?`,facts:[{label:`Source`,value:f},{label:`Boxes it would fill`,value:t||void 0}],body:e.body||`We found details you can use. Applying them will replace what you have already entered in those boxes.`,okText:e.ok||`Use these details`,cancelText:e.cancel||`Keep what I typed`}))return i.message.info(`${f} cancelled — your entries were kept.`),d}if(o){let e=await o({action:c,field:r,groupName:t,responseGroups:p,payload:Oo(p)});if(e===!1||e===`abort`)return d}let h=m(p);return h?i.message.success(`${f} completed successfully.`):i.message.info(`${f} completed, but no matching details were found.`),h&&a&&await a({action:c,field:r,groupName:t}),d}catch(e){i.message.error(e?.message||`${c.label||`AI action`} failed`);return}finally{l(null),d(``)}},[e,n,m,a,o,s]),loadingKey:c,loadingText:u,busy:c!==null,isActionEnabled:p}}function Po({position:e,actions:t,aiActions:n,groupName:r,field:a}){if(!t||t.length===0)return null;let s=e.endsWith(`center`)?`center`:e.endsWith(`right`)?`flex-end`:`flex-start`;return(0,o.jsx)(i.Space,{size:8,className:`v1-ai-action-buttons`,style:{width:`100%`,justifyContent:s},children:t.map(e=>(0,o.jsx)(i.Button,{size:`small`,loading:n.loadingKey===e.key,disabled:n.busy||!n.isActionEnabled(e),onClick:()=>n.runAction(r,a,e),children:e.label},e.key))})}function Fo(e){let t=String(e??``).trim(),n=/^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);if(!n)return!1;let[,r,i]=n;return/[A-Za-z]/.test(r)&&/[A-Za-z]/.test(i)}function Io(e=`Email`,t){return{validator:(n,r)=>r==null||r===``||Fo(r)?Promise.resolve():Promise.reject(Error(t??`Enter a valid ${e}; numeric-only email addresses are not allowed`))}}var Lo=[{label:`Only Numbers`,value:`onlyNumber`},{label:`Only Letters`,value:`onlyLetter`},{label:`Only Letters & Spaces`,value:`onlyLettersAndSpace`},{label:`Only Alphanumeric`,value:`onlyAlphanumeric`},{label:`Alphanumeric & Spaces`,value:`alphanumericSpace`},{label:`Letters, Numbers & Hyphen`,value:`onlyLettersNumberAndHyphen`},{label:`Letters, Numbers, Hyphen & Dot`,value:`onlyLettersNumberHyphenAndDot`},{label:`Contact Number (digits, (), -)`,value:`contactNumber`},{label:`Email (reject numeric-only address)`,value:`email`},{label:`Job Title (letters, nums, symbols)`,value:`jobTitle`},{label:`MSP / Ref ID (alphanumeric only)`,value:`mspRefId`},{label:`Location (letters, nums, , . -)`,value:`locationValidation`},{label:`Decimal / Range (number + dot)`,value:`decimalRange`},{label:`Budget (numbers, must be > 0)`,value:`budgetValidation`},{label:`Experience (numbers only)`,value:`experience`},{label:`Numeric — 2 digits max`,value:`numericTwoDigits`},{label:`Job Description (character count)`,value:`jobDescription`},{label:`Website URL`,value:`websiteUrl`}],Ro={onlyNumber:/^[0-9]$/,experience:/^[0-9]$/,numericTwoDigits:/^[0-9]$/,budgetValidation:/^[0-9]$/,onlyLetter:/^[a-zA-Z\s]$/,onlyLettersAndSpace:/^[a-zA-Z\s]$/,onlyAlphanumeric:/^[a-zA-Z0-9]$/,alphanumericSpace:/^[a-zA-Z0-9\s]$/,mspRefId:/^[a-zA-Z0-9]$/,onlyLettersNumberAndHyphen:/^[a-zA-Z0-9\s-]$/,locationValidation:/^[a-zA-Z0-9\s\-.,]$/,jobTitle:/^[a-zA-Z0-9\s\-.,/&+()*'"#@]$/,decimalRange:/^[0-9.]$/,contactNumber:/^[0-9()\-+\s]$/};function zo(e){return Ro[e]??null}function Bo(e,t={},n=`change`){if(!t?.type||e==null)return{cleaned:e??``,error:null};let r=String(e),{type:i,maxLength:a,maxChars:o}=t,s=t.title||`Field`,c,l=null,u=e=>n===`blur`?e.trim():e.replace(/^\s+/,``);switch(i){case`onlyNumber`:case`experience`:case`numericTwoDigits`:{let e=Number(a??(i===`numericTwoDigits`?2:10));c=r.replace(/[^0-9]/g,``),r!==c&&(l=`${s} allows only numbers.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLetter`:{let e=Number(a??50);c=r.replace(/[^a-zA-Z]/g,``),r!==c&&(l=`${s} allows only letters.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersAndSpace`:{let e=Number(a??55);c=u(r.replace(/[^a-zA-Z\s]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters and spaces.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyAlphanumeric`:case`mspRefId`:{let e=Number(a??50);c=u(r.replace(/[^a-zA-Z0-9]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters and numbers.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`alphanumericSpace`:{let e=Number(a??100);c=u(r.replace(/[^a-zA-Z0-9\s]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers and spaces.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersNumberAndHyphen`:{let e=Number(a??55);c=u(r.replace(/[^a-zA-Z0-9\s-]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers and hyphens.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersNumberHyphenAndDot`:{let e=Number(a??100);c=r.replace(/[^a-zA-Z0-9\-./#+[\]{}()\s]/g,``).slice(0,e),r!==c&&(l=`${s} allows only letters, numbers, hyphens and dots.`);break}case`contactNumber`:{let e=Number(a??15);c=r.replace(/[^0-9()\-+\s]/g,``).slice(0,e),r===c?c&&!/^(\+?[0-9]{1,3}[- ]?)?(\(?\d{1,4}\)?[- ]?)?[\d\-\s]{3,15}$/.test(c)&&(l=`${s} is not a valid phone number format.`):l=`${s} allows only digits, parentheses () and hyphens.`;break}case`locationValidation`:{let e=Number(a??100);c=u(r.replace(/[^a-zA-Z0-9\s\-.,]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers, spaces, commas, dots and hyphens.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`jobTitle`:{let e=Number(a??80);c=u(r.replace(/[^a-zA-Z0-9\s\-/&.,()+#@'"*]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers, spaces and common symbols.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`decimalRange`:{let e=r.replace(/[^0-9.]/g,``);if((e.match(/\./g)||[]).length>1){let t=e.indexOf(`.`);e=e.slice(0,t+1)+e.slice(t+1).replace(/\./g,``),l=`${s} can have only one decimal point.`}let t=e.replace(/\./g,``),n=Number(a??10);t.length>n&&(e=e.slice(0,n+ +!!e.includes(`.`)),l=`${s} cannot exceed ${n} digits.`),c=e,!l&&r!==c&&(l=`${s} allows only numbers and one dot.`);break}case`budgetValidation`:{let e=Number(a??10);c=r.replace(/[^0-9]/g,``).slice(0,e);let t=Number(c);r===c?c&&t<=0&&(l=`${s} must be greater than 0.`):l=`${s} allows only numbers.`;break}case`jobDescription`:{let e=Number(o??a??1500);r.replace(/<[^>]+>/g,` `).replace(/&nbsp;/g,` `).replace(/\s+/g,` `).trim().length>e&&(l=`${s} cannot exceed ${e} characters.`),c=r;break}case`email`:c=n===`blur`?r.trim():r,c&&!Fo(c)&&(l=`${s} must be a valid email address; numeric-only email addresses are not allowed.`);break;case`websiteUrl`:c=n===`blur`?r.trim():r,c&&!/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/i.test(c)&&(l=`${s} must be a valid URL.`);break;default:c=r}return{cleaned:c,error:l}}var Vo=`This value is already present`;function Ho(e){return typeof e==`string`?e:e?.type??e?.rule??e?.name}function Uo(e){if(Ho(e)!==`unique`)return null;if(typeof e==`string`)return{message:Vo,normalizer:`trim`,skipBlank:!0,validateOn:`blur`};let t=e.value&&typeof e.value==`object`?e.value:e,n=String(t.validateOn??`blur`).toLowerCase();return{message:typeof e.message==`string`&&e.message.trim()?e.message.trim():Vo,collectionField:t.collectionField??``,normalizer:String(t.normalizer??`trim`),skipBlank:t.skipBlank!==!1,validateOn:[`blur`,`change`,`submit`].includes(n)?n:`blur`}}function Wo(e){let t=e?.validations??e?.validation??e?.rules??[];if(!Array.isArray(t))return null;for(let e of t){let t=Uo(e);if(t)return t}return null}function Go(e=[]){let t=[];return(Array.isArray(e)?e:[]).forEach(e=>{(e?.fields??[]).forEach(e=>{let n=Wo(e);!n||!e?.field||t.push({field:e.field,label:e.label??e.field,rule:n})})}),t}function Ko(e){return e==null?!0:typeof e==`number`?Number.isNaN(e):typeof e==`boolean`?!1:Array.isArray(e)?e.length===0:String(e).trim()===``}function qo(e,t=`trim`){if(e==null)return``;let n=String(e);switch(String(t)){case`exact`:return n;case`lower`:case`trimLower`:case`email`:return n.trim().toLowerCase();case`digitsOnly`:return n.replace(/\D+/g,``);default:return n.trim()}}function Jo(e,t){return!(!e||e.skipBlank!==!1&&Ko(t))}function Yo(e){return!e||e.validateOn===`submit`?[]:e.validateOn===`change`?[`onChange`,`onBlur`]:[`onBlur`]}var G={SKIPPED:`skipped`,AVAILABLE:`available`,DUPLICATE:`duplicate`,STALE:`stale`,ERROR:`error`};function Xo({module:e,field:t,recordId:n,normalized:r}){return`${e}${t}${n??``}${r}`}function Zo({checkFieldUnique:e,onPendingChange:t}={}){let n=new Map,r=new Map,i=0,a=0;function o(e){a=e,typeof t==`function`&&t(a)}async function s({module:t,field:s,rule:c,value:l,recordId:u,clientId:d,region:f}={}){if(!c||!t||!s||typeof e!=`function`||!Jo(c,l))return{status:G.SKIPPED};let p=Xo({module:t,field:s,recordId:u,normalized:qo(l,c.normalizer)});if(n.has(p))return n.get(p);i+=1;let m=i;r.set(s,m),o(a+1);try{let i=await e({module:t,field:s,value:l,recordId:u,clientId:d,region:f});if(r.get(s)!==m)return{status:G.STALE};let a=i?.available===!1?{status:G.DUPLICATE,message:Qo(i)||c.message||Vo}:{status:G.AVAILABLE};return n.set(p,a),a}catch(e){return r.get(s)===m?{status:G.ERROR,error:e}:{status:G.STALE}}finally{o(Math.max(0,a-1))}}return{check:s,isPending:()=>a>0,pendingCount:()=>a,reset:()=>{n.clear(),r.clear()}}}function Qo(e){return(e?.errors??[]).find(e=>e?.message)?.message||e?.message||``}var $o=`__uniqueRule`;function es({field:e,validation:t,context:n}){let r=Uo(t);if(!r)return{validator:()=>Promise.resolve()};let i=e?.field??``;return!n?.checker||!n?.module||!i?{validator:()=>Promise.resolve()}:{[$o]:r,validateTrigger:Yo(r),validator:async(e,t)=>{let a=await n.checker.check({module:n.module,field:i,rule:r,value:t,recordId:n.recordId,clientId:n.clientId,region:n.region});return a.status===G.DUPLICATE?Promise.reject(Error(a.message||r.message)):Promise.resolve()}}}function ts(e=[]){let t=Array.isArray(e)?e:[];if(!t.some(e=>e&&e[$o]))return t;let n=t.filter(e=>e&&!e[$o]&&!e.warningOnly);return t.map(e=>{if(!e||!e[$o])return e;let t=e.validator;return{...e,validator:async(e,r)=>await ns(n,r,e)?Promise.resolve():t(e,r)}})}async function ns(e=[],t,n={}){for(let r of e)if(!(!r||typeof r==`string`)){if(r.required&&Ko(t)||!Ko(t)&&(r.pattern instanceof RegExp&&!new RegExp(r.pattern.source,r.pattern.flags).test(String(t))||r.len!=null&&String(t).length!==Number(r.len)))return!0;if(typeof r.validator==`function`)try{await r.validator(n,t)}catch{return!0}}return!1}function rs(e){let t=String(e??``).trim();if(!t.startsWith(`{`))return null;try{return JSON.parse(t)}catch{return null}}function is(e){if(!e)return null;if(typeof e==`string`)return rs(e);let t=[e.data,e.response,e,rs(e.message)];for(let e of t)if(!(!e||typeof e!=`object`)&&(Array.isArray(e.errors)||e.code===`DUPLICATE_VALUE`))return e;return null}function as({field:e,group:t,rowIndex:n}){let r=String(e??``),i=Number(n);return t&&Number.isInteger(i)&&i>=0?[String(t),i,...r.split(`.`)]:r}function os(e,{uniqueRules:t=[]}={}){let n=is(e);if(n){let e=(Array.isArray(n.errors)?n.errors:[]).filter(e=>e?.field).map(e=>{let t={field:e.field,name:as(e),message:e.message||n.message||Vo};return Array.isArray(t.name)&&(t.group=String(e.group),t.rowIndex=Number(e.rowIndex)),t});if(e.length)return e}let r=String((n&&(n.message||n.error))??(typeof e==`string`?e:e?.message)??``).trim();if(!r)return[];let i=e?.status===409||n?.code===`DUPLICATE_VALUE`,a=t.filter(e=>String(e?.rule?.message??``).trim().toLowerCase()===r.toLowerCase());return a.length&&(i||a.length===1)?a.map(e=>({field:e.field,name:e.field,message:r})):[]}var ss=e=>e===!0||e===1||e===`1`||typeof e==`string`&&e.trim().toLowerCase()===`true`;function cs(e){return!!(e&&typeof e==`object`&&ss(e.warningOnly))}function ls({label:e,message:t,rule:n}){let r={pattern:new RegExp(n.pattern??n.value,n.flags),message:t??`Enter valid ${e}`};return cs(n)&&(r.warningOnly=!0),r}function us(e){return cs(e)}function ds(e,t){return e?.type===`pattern`&&t?.warningOnly===!0&&(e.warningOnly=!0),e}function fs(e){return typeof e==`string`?e.toUpperCase():e}async function ps({module:e,field:n,value:r,recordId:i,clientId:a,region:o}={}){if(!e||!n)throw Error(`module and field are required to check uniqueness`);let s={field:n,value:r??``};i&&(s.recordId=String(i)),a&&(s.clientId=String(a)),o&&(s.region=String(o));try{let n=await t.o(t.x,`/module/validate-unique?module=${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),r=n?.available!==!1;return{available:r,duplicate:!r,message:n?.message??``,errors:Array.isArray(n?.errors)?n.errors:[],response:n}}catch(e){if(e?.status===409){let t=e.response??e.data??{};return{available:!1,duplicate:!0,message:t?.message??e.message??``,errors:Array.isArray(t?.errors)?t.errors:[],response:t}}throw e}}async function ms({module:e,payload:n,excludeId:r}={}){if(!e||!n)return{duplicate:!1};try{let i=await t.o(t.x,`/module/duplicate-check?module=${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({payload:n,...r?{excludeId:r}:{}})});return i?.data??i??{duplicate:!1}}catch{return{duplicate:!1}}}var hs=[`jpg`,`jpeg`,`png`,`gif`,`webp`,`bmp`,`svg`,`avif`],gs=[`mp4`,`webm`,`ogg`,`ogv`,`mov`,`m4v`],_s=[`pdf`,`doc`,`docx`],vs=[{label:`Any file`,value:`any`},{label:`Resume (pdf, doc, docx)`,value:`resume`},{label:`Documents & Images (pdf, doc, images)`,value:`documents`},{label:`Images only`,value:`images`},{label:`Videos only`,value:`videos`},{label:`Images & Videos`,value:`imagesAndVideos`}],ys={resume:{exts:_s,maxSizeMB:2,hint:`PDF, DOC or DOCX`,error:`Only PDF, DOC, and DOCX resume files are supported.`},documents:{exts:[..._s,...hs],hint:`PDF, DOC or image files`,error:`Only document (PDF/DOC) or image files are allowed`},images:{exts:hs,hint:`Image files`,error:`Only image files are allowed`},videos:{exts:gs,hint:`Video files`,error:`Only video files are allowed`},imagesAndVideos:{exts:[...hs,...gs],hint:`Image or video files`,error:`Only image or video files are allowed`}};function bs(e){let t=String(e?.field??e?.payloadKey??``).toLowerCase();return t?t.includes(`resume`)||t.includes(`cv`)||t.includes(`curriculumvitae`):!1}function xs(e){let t=String(e?.accept??``).trim();return t&&t!==`any`?ys[t]??null:!t&&bs(e)?ys.resume:ys[t]??null}var Ss=new Set([`of`,`and`,`the`,`to`,`for`,`in`,`a`,`an`]),Cs={addresses:`address`,branches:`branch`,batches:`batch`,categories:`category`,companies:`company`,countries:`country`,entries:`entry`,people:`person`,statuses:`status`};function ws(e){let t=String(e??``).trim();if(!t)return``;if(t.length>1&&t===t.toUpperCase()&&/[A-Z]/.test(t))return t;let n=t.toLowerCase();return Cs[n]?Cs[n]:/[^aeiou]ies$/i.test(t)?t.slice(0,-3)+`y`:/(s|x|z|ch|sh)es$/i.test(t)?t.slice(0,-2):/[^s]s$/i.test(t)?t.slice(0,-1):t}function K(e){let t=String(e??``).trim();if(!t)return``;let n=t.replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_\-.]+/g,` `).split(/\s+/).filter(Boolean);if(!n.length)return``;let r=ws(n[n.length-1]);return[...n.slice(0,-1),r].map((e,t)=>{let n=e.toLowerCase();return e.length>1&&e===e.toUpperCase()?e:t>0&&Ss.has(n)?n:n.charAt(0).toUpperCase()+n.slice(1)}).join(` `)}function Ts(e,t){let n=String(e?.quickCreateLabel??``).trim();if(n&&n.toLowerCase()!==`add more`)return n;let r=K(e?.quickCreateModule||t);return r?`Add New ${r}`:`Add New`}function Es(e,t){let n=String(e?.quickEditLabel??``).trim();if(n&&n.toLowerCase()!==`add more`)return n;let r=K(e?.quickEditModule||t);return r?`Edit ${r}`:`Edit`}function Ds(e,t,n){let r=K((e===`create`?t?.quickCreateModule:t?.quickEditModule)||n);return e===`create`?String(t?.quickCreateTitle??``).trim()||(r?`Add New ${r}`:Ts(t,n)):String(t?.quickEditTitle??``).trim()||(r?`Edit ${r}`:Es(t,n))}function Os({children:e,className:t=``,icon:n,to:r,variant:a=`default`,...s}){let c=(0,o.jsx)(i.Button,{className:`app-button app-button--${a} ${t}`.trim(),icon:n,...s,children:e});return r?(0,o.jsx)(u.Link,{className:`app-button-link`,to:r,children:c}):c}function ks(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.name||e.user_name||e.userName||e.username||e.email||``}function As(e){let t={};return(Array.isArray(e)?e:[]).forEach(e=>{let n=ks(e);n&&[e.legacyUserId,e.userId,e.user_id,e._id,e.id].forEach(e=>{if(e==null||e===``)return;let r=String(typeof e==`object`?e.$oid??e.id??``:e);r&&t[r]===void 0&&(t[r]=n)})}),t}var js=new Map;function Ms(e){let n=String(e??``).trim();if(!n)return Promise.resolve(``);if(js.has(n))return js.get(n);let r=t.o(t.x,`/get-detailed-view?userId=${encodeURIComponent(n)}`).then(e=>ks(e?.data??e??null)).catch(()=>``);return js.set(n,r),r}var q=e=>e==null?``:String(e).trim();function Ns(e){let t=e?.quickCreateNotice;return!t||typeof t!=`object`||t.enabled===!1?null:{enabled:!0,title:q(t.title)||`New record created`,message:q(t.message)||`A new client has been created successfully. Please contact your Organization Admin to configure the required forms, workflows, permissions, and client-specific details before proceeding with further operations.`,showCreator:t.showCreator!==!1,showRecordName:t.showRecordName!==!1,recordNameField:q(t.recordNameField),recordLabel:q(t.recordLabel)||`Record name`,creatorLabel:q(t.creatorLabel)||`Created by`}}var Ps=[`clientName`,`companyName`,`name`,`title`,`fullName`,`displayName`,`label`,`employerName`,`vendorName`],Fs=(e,t)=>{if(!(!e||!t))return String(t).split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e)},Is=e=>typeof e==`string`||typeof e==`number`?q(e):e&&typeof e==`object`?q(e.label??e.name??e.title??``):``;function Ls(e,{recordNameField:t=``,displayField:n=``}={}){if(!e||typeof e!=`object`)return``;for(let r of[t,n,...Ps]){if(!r)continue;let t=Is(Fs(e,r));if(t)return t}let r=Object.keys(e).find(t=>/name$/i.test(t)&&typeof e[t]==`string`&&e[t].trim());return r?q(e[r]):``}function Rs(e){if(!e||typeof e!=`object`)return``;let t=[e.createdBy,e.created_by,e.createdById,e.createdUserId,e.recordMeta?.createdBy,e.ownerId];for(let e of t){if(e==null||e===``)continue;if(typeof e==`object`){let t=q(e.$oid??e.userId??e._id??e.id);if(t)return t;continue}let t=q(e);if(t)return t}return``}function zs(e=t.d){try{return ks(e())||``}catch{return``}}var Bs=(e,n)=>t.o(t.x,`/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(n)}`).then(e=>{let t=e?.data?.data??e?.data??[];return Array.isArray(t)?t[0]:t});async function Vs({module:e,recordId:n,notice:r,displayField:i=``,deps:a={}}={}){let{fetchRecord:o=Bs,fetchUserNameFn:s=Ms,getUser:c=t.d}=a,l=null;if(e&&n)try{l=await o(e,n)}catch{l=null}let u=r?.showRecordName===!1?``:Ls(l,{recordNameField:r?.recordNameField,displayField:i}),d=``;if(r?.showCreator!==!1){let e=Rs(l);if(e)try{d=q(await s(e))}catch{d=``}d||=zs(c)}return{recordName:u,creatorName:d}}var Hs=(e,t)=>e?.quickCreate?e.quickCreateOnType===!0||e.quickCreateOnType!==!1&&t===`submissions`&&e.quickCreateModule===`employers`:!1;function Us(e){return String(e??``).trim().replace(/\s+/g,` `)}var Ws=e=>Us(e).toLowerCase();function Gs(e,t){let n=Ws(e);return!n||!Array.isArray(t)?null:t.find(e=>Ws(e?.label)===n)??null}function Ks({text:e,disabled:t=!1,modalOpen:n=!1}){return t||n?!1:Us(e).length>=3}var qs=(0,r.lazy)(()=>Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.i)),Js=(0,r.lazy)(()=>Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.n)),Ys=e=>e==null||e===``,Xs=e=>typeof e==`string`&&e.includes(`.`)?e.split(`.`):[e];function Zs(e,t,n,r,i){let a=e.quickEditIdFrom;if(a){let e=Array.isArray(n)&&n.length>=3&&typeof n[1]==`number`?[...n.slice(0,2),...Xs(a)]:Xs(a),i=t?.getFieldValue?.(e);return Ys(i)&&(i=r?.[a]),Ys(i)?null:i}return i&&typeof i==`object`?i.value??null:Ys(i)?null:i}function Qs({field:e,form:t,name:n,moduleName:s,scopeValues:c,ownValue:l,onDone:u}){let[d,f]=(0,r.useState)(null),[p,m]=(0,r.useState)(null),h=!!e?.quickCreate,g=!!e?.quickEdit,_=e?.quickCreateModule||e?.lookupCollection||``,v=e?.quickEditModule||e?.lookupCollection||``,y=(0,r.useMemo)(()=>g?Zs(e,t,n,c,l):null,[g,e,t,n,c,l]);if(!h&&!g)return{footer:null,modal:null,openCreateWith:null,isModalOpen:!1};let b=Hs(e,s),x=()=>f(null),ee=()=>{if(e?.quickCreateOnClick){e.quickCreateOnClick(),document.activeElement?.blur?.();return}if(e?.quickCreateRoute){window.open(e.quickCreateRoute,`_blank`,`noopener,noreferrer`);return}_&&f({mode:`create`,module:_})},S=e=>{d||!_||f({mode:`create`,module:_,prefill:e??null})},te=()=>v&&y&&f({mode:`edit`,module:v,recordId:String(y)}),C=t=>{let n=Ns(e);n&&(m({...n,recordName:``,creatorName:``}),Vs({module:_,recordId:t,notice:n,displayField:e?.displayField||``}).then(({recordName:e,creatorName:t})=>{m(n=>n&&{...n,recordName:e,creatorName:t})}).catch(()=>{}))},w=h&&!b,ne=!w&&!g?null:(0,o.jsx)(`div`,{className:`v1-quick-actions`,role:`presentation`,onMouseDown:e=>e.preventDefault(),style:{display:`flex`,gap:8,padding:`6px 8px`,borderTop:`1px solid rgba(0,0,0,0.06)`},children:(0,o.jsxs)(i.Space,{size:8,children:[w&&(0,o.jsx)(i.Button,{type:`link`,size:`small`,icon:(0,o.jsx)(a.PlusOutlined,{}),onClick:ee,style:{paddingLeft:0},children:Ts(e,_)}),g&&(0,o.jsx)(i.Button,{type:`link`,size:`small`,icon:(0,o.jsx)(a.EditOutlined,{}),onClick:te,disabled:!y,title:y?void 0:`Choose a ${K(v)||`record`} above first, then edit it here`,children:Es(e,v)})]})}),re=d?(0,o.jsx)(i.Modal,{open:!0,title:Ds(d.mode,e,d.mode===`create`?_:v),width:`min(1080px, 96vw)`,footer:null,destroyOnClose:!0,maskClosable:!1,onCancel:x,styles:{body:{maxHeight:`78vh`,overflowY:`auto`}},children:(0,o.jsx)(r.Suspense,{fallback:(0,o.jsx)(`div`,{style:{padding:48,textAlign:`center`},children:(0,o.jsx)(i.Spin,{})}),children:d.mode===`create`?(0,o.jsx)(qs,{moduleName:d.module,embedded:!0,breadcrumbItems:[],initialRecord:d.prefill??void 0,onCancel:x,onSuccess:e=>{x(),C(e),u?.(`create`,e)}}):(0,o.jsx)(Js,{moduleName:d.module,recordId:d.recordId,embedded:!0,breadcrumbItems:[],onCancel:x,onSuccess:e=>{x(),u?.(`edit`,e)}})})}):null,ie=p?(0,o.jsxs)(i.Modal,{open:!0,title:(0,o.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[(0,o.jsx)(a.ExclamationCircleFilled,{style:{color:`#faad14`}}),p.title]}),width:`min(520px, 94vw)`,maskClosable:!1,onCancel:()=>m(null),footer:(0,o.jsx)(Os,{variant:`primary`,type:`primary`,onClick:()=>m(null),children:`OK`}),children:[(0,o.jsx)(`p`,{style:{marginTop:0,marginBottom:16},children:p.message}),(p.recordName||p.creatorName)&&(0,o.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`auto 1fr`,gap:`6px 12px`,padding:`10px 12px`,borderRadius:6,background:`rgba(0,0,0,0.03)`},children:[p.recordName&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`span`,{style:{color:`rgba(0,0,0,0.55)`},children:p.recordLabel}),(0,o.jsx)(`strong`,{children:p.recordName})]}),p.creatorName&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`span`,{style:{color:`rgba(0,0,0,0.55)`},children:p.creatorLabel}),(0,o.jsx)(`strong`,{children:p.creatorName})]})]})]}):null;return{footer:ne,modal:re||ie?(0,o.jsxs)(o.Fragment,{children:[re,ie]}):null,openCreateWith:S,isModalOpen:!!d}}var $s=e=>e==null||e===``||Array.isArray(e)&&e.length===0;function ec(e,t,n){let r=String(t??``).includes(`.`)?String(t).split(`.`):[t];if(typeof n==`function`){let e=n(t);return Array.isArray(e)&&e.length?[...e,...r]:r}return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),...r]:r}function tc({label:e,message:t,rule:n={},value:r,form:i,name:a,prefixFor:o}){let s=n.field??n.compareField??r;return{validator:async(n,r)=>{if(!s||$s(r))return Promise.resolve();let c=i?.getFieldValue?.(ec(a,s,o));if($s(c))return Promise.resolve();let l=Number(c),u=Number(r);return Number.isNaN(l)||Number.isNaN(u)||u<=l?Promise.resolve():Promise.reject(Error(t??`${e} must not exceed ${s}`))}}}function nc(e={},t,n){let r=e.field??e.compareField??e.value;return r?ec(t,r,n):null}function rc(e,t){let n=String(t).split(`.`).filter(Boolean);if(!Array.isArray(e))return n.length>1?n:t;if(n.length>1){if(e.length>=3&&typeof e[1]==`number`){let t=e.slice(0,2),r=n[0]===String(e[0])?n.slice(1):n;return[...t,...r]}return n}let r=[...e];return r[r.length-1]=n[0],r}function ic(e,t,n){let r=e?.getFieldValue?.(rc(t,n));return r!=null&&r!==``?r:e?.getFieldValue?.(n)}function ac(e){return String(e??``).split(`,`).map(e=>e.trim()).filter(Boolean)}function oc(e,t){for(let n of e??[]){let e=t(n);if(e==null||e===``)continue;let r=Number(e);if(!(!Number.isFinite(r)||r<=0))return{field:n,maximum:r}}return null}function sc({input:e,compareFields:t,readValue:n}){let r={ok:!0,field:null,maximum:null};if(e==null||e===``)return r;let i=oc(t,n);if(!i)return r;let a=Number(e);return Number.isFinite(a)?{ok:a<=i.maximum,field:i.field,maximum:i.maximum}:r}var cc={candidates:[`applicantId`]};function lc(e){let t=String(e??``).trim();if(!t)return[];let n=t.endsWith(`s`)?t.slice(0,-1):t;return[...new Set([`${n}Id`,`${t}Id`,...cc[t]??[]])]}function uc(e,t){if(!t)return``;let n=e=>e&&typeof e==`object`?e.id??e.value??``:e??``;for(let r of lc(e)){let e=String(n(t[r])||``);if(e)return e}return``}function dc(e,t){let n=new Set;return(e??[]).forEach(e=>(e.fields??[]).forEach(e=>{e?.prefillFromModule&&n.add(t(e.prefillFromModule))})),[...n]}function fc(e){return e?.payloadMode===`skip`}function pc(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:[]}function mc(e){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))})}),t}function hc(e,t){if(!e||!t)return;let n=e;for(let e of String(t).split(`.`)){if(n==null)return;if(Array.isArray(n)){if(!n.length)return;let t=[...n].reverse().find(t=>t&&typeof t==`object`&&t[e]!==void 0&&t[e]!==null);n=t?t[e]:void 0;continue}n=n[e]}return n}function gc(e,t){if(!(!e||!t))for(let n of[t.prefillFrom,t.field,t.payloadKey]){if(!n)continue;let t=e[n];if(t??=L(e,n),t??=hc(e,n),t!=null)return t}}function _c({form:e,field:t,flagPath:n,fieldPath:r,disabled:a}){let s=mi(t),c=i.Form.useWatch(n,e);if(!s)return null;let l=s.label||`Allow beyond the limit`,u=()=>{setTimeout(()=>{e?.validateFields?.([r]).catch(()=>{})})},d=async r=>{if(!r.target.checked){e.setFieldValue(n,!1),u();return}let i=await Aa(xi(t));e.setFieldValue(n,!!i),u()},f=s.help?`${l} — ${s.help}`:l;return(0,o.jsx)(i.Tooltip,{title:f,children:(0,o.jsx)(`span`,{className:`v1-override-wrap`,children:(0,o.jsx)(i.Checkbox,{className:`v1-override-checkbox`,checked:!!c,disabled:a,onChange:d,"aria-label":f})})})}var vc=e=>String(e??``);function yc(e){let t=new Set,n=[];return(Array.isArray(e)?e:[]).forEach(e=>{let r=e?.field;!r||t.has(r)||(t.add(r),n.push(r))}),n}function bc(e,t,n,r){return yc(e).map(e=>({field:e,path:n(t,e,r)}))}function xc(e,t={}){return!e||!e.field?!1:vc(t[e.field])===vc(e.value)}function Sc({rules:e,watched:t={},current:n,lastApplied:r,clearOnMismatch:i=!0,initial:a=!1}={}){let o=(Array.isArray(e)?e:[]).find(e=>xc(e,t));return o?o.clearValue?a?{action:`none`}:{action:`clear`}:{action:`set`,value:o.setValue}:i&&r!==void 0&&vc(n)===vc(r)?{action:`clear`}:{action:`none`}}var Cc=[`daysUntil`],wc=e=>e==null||e===``,Tc=e=>String(e??``);function Ec(e){return!!(e&&Cc.includes(e.type)&&e.field)}function Dc(e){if(wc(e))return null;let t=s.default.isDayjs(e)?e:(0,s.default)(e?.$date??e);return t.isValid()?t.format(`YYYY-MM-DD`):null}function Oc(e,t){let n=Dc(e),r=Dc(t??(0,s.default)());if(!(!n||!r))return Math.max(0,(0,s.default)(n).diff((0,s.default)(r),`day`))}function kc(e,t,n){if(Ec(e))switch(e.type){case`daysUntil`:return Oc(t,n);default:return}}function Ac(e,t,n,r){let i=Object.entries(e?.setFields||{}).filter(([e])=>!!e).map(([e,i])=>({field:e,path:n(t,e,r),value:i}));return{source:n(t,e.field,r),setFields:i}}function jc({cfg:e,sourceValue:t,previousSource:n,current:r,lastApplied:i,today:a}={}){if(!Ec(e)||wc(t)||Dc(t)===Dc(n))return{action:`none`};let o=kc(e,t,a);if(o===void 0)return{action:`none`};if(wc(n)){let e=i!==void 0&&Tc(r)===Tc(i);if(!wc(r)&&!e)return{action:`none`}}return Tc(r)===Tc(o)?{action:`none`}:{action:`set`,value:o}}function Mc({form:e,config:t,sourcePath:n,targetPath:a,setFields:o=[]}){let s=i.Form.useWatch(n,{form:e,preserve:!0}),c=(0,r.useRef)(void 0),l=(0,r.useRef)(void 0),u=s?.format?s.format(`YYYY-MM-DD`):String(s??``);return(0,r.useEffect)(()=>{let n=jc({cfg:t,sourceValue:s,previousSource:c.current,current:e.getFieldValue(a),lastApplied:l.current,today:Tn()});c.current=s,n.action===`set`&&(e.setFieldValue(a,n.value),l.current=n.value,o.forEach(({path:t,value:n})=>e.setFieldValue(t,n)))},[u]),null}var J=e=>String(e??``).trim().toLowerCase();function Nc(e){let t=Array.isArray(e)?e:[e],n=[];return t.forEach(e=>{if(e!=null&&e!==``){if(typeof e==`object`){[e.value,e.id,e._id,e.label,e.name].forEach(e=>{e!=null&&e!==``&&n.push(J(e))});return}n.push(J(e))}}),n}function Pc(e=[],t){let n=Nc(t);if(!n.length||!Array.isArray(e)||e.length===0)return e;let r=new Set(n),i=e.filter(e=>e==null?!1:typeof e==`object`?r.has(J(e.value))||r.has(J(e.label)):r.has(J(e)));return i.length>0?i:e}function Fc(e){let t=[];return[e?.setValue,e?.setValueLabel].forEach(e=>{e!=null&&e!==``&&t.push(J(e))}),t}function Ic(e,t={}){let n=Array.isArray(e)?e:[],r=new Set,i=new Set;return n.forEach(e=>{if(!e||e.clearValue)return;let n=Fc(e);if(!n.length)return;let a=xc(e,t)?i:r;n.forEach(e=>a.add(e))}),i.forEach(e=>r.delete(e)),[...r]}function Lc(e=[],t,n){let r=Ic(t,n);if(!r.length||!Array.isArray(e)||e.length===0)return e;let i=new Set(r);return e.filter(e=>e==null?!0:typeof e==`object`?!(i.has(J(e.value))||i.has(J(e.label))):!i.has(J(e)))}function Rc(e,t={},n){let r=Array.isArray(e)?e:[];if(n==null||n===``)return[];let i=J(n),a=[],o=new Set;return r.forEach(e=>{if(!e||e.clearValue)return;let{setValue:n,setValueLabel:r}=e;n!=null&&n!==``&&r&&J(n)===i&&xc(e,t)&&(o.has(J(n))||(o.add(J(n)),a.push({value:n,label:r})))}),a}var zc=new Set([`select`,`radio`,`checkbox`]),Bc=3e5,Vc=1e4,Hc=e=>e===!1||e===0||e===`0`||e===`false`,Uc=e=>e===!0||e===1||e===`1`||e===`true`,Wc=e=>e==null||e===``;function Gc(e){let t=e?.options??e?.values;return Array.isArray(t)?t:[]}function Kc(e){return String(e?.dataSource??``).trim().toLowerCase()}function qc(e){if(!e||!zc.has(e.type)||Hc(e.enforceOptions)||Uc(e.allowCustomValues)||e.mode===`tags`)return!1;let t=Kc(e);return t===`master`?!0:t===``||t===`static`?Gc(e).length>0:!1}function Jc(e){return(Array.isArray(e)?e:[e]).map(e=>e&&typeof e==`object`?e.value??e.id??e.label:e).filter(e=>!Wc(e)&&typeof e!=`object`&&typeof e!=`boolean`)}function Yc(e){return e==null?null:typeof e==`object`?{label:e.label??e.name??e.value,value:e.value??e.id??e.name??e.label}:{label:String(e),value:e}}var Xc=new Map;function Zc(e,t){return[t,e.field,e.masterName,e.groupName].map(e=>e??``).join(`|`)}async function Qc(e,t){let n=Zc(e,t),r=Xc.get(n);if(r&&Date.now()-r.at<Bc)return r.promise;let i=Promise.resolve(vr(t,e.field,``,Vc,0,{dataSource:`master`,masterName:e.masterName,groupName:e.groupName})).then(e=>{let t=Array.isArray(e)?e:e?.data??[];return(Array.isArray(t)?t:[]).map(Yc).filter(Boolean)});return Xc.set(n,{at:Date.now(),promise:i}),i.catch(()=>Xc.delete(n)),i}async function $c(e,{moduleName:t}={}){return Kc(e)===`master`?Qc(e,t):Gc(e).map(Yc).filter(Boolean)}function el(e){let t=new Map;return e.forEach(e=>{[[e.label,e.label],[e.value,e.value]].forEach(([e,n])=>{let r=Si(e);r&&!t.has(r)&&t.set(r,n)})}),t}async function tl(e,t,{moduleName:n,constraintValue:r}={}){let i=Jc(t);if(!i.length)return{offList:[],snaps:new Map,options:[]};let a=await $c(e,{moduleName:n});e.optionsFromField&&(a=Pc(a,r));let o=Kc(e)===`master`,s=o?el(a):Ci({options:a,optionAliases:e.optionAliases}),c=new Set(a.flatMap(e=>o?[String(e.value),String(e.label)]:[String(e.value)])),l=[],u=new Map;return i.forEach(e=>{if(c.has(String(e)))return;let t=s.get(Si(e));t===void 0?l.push(String(e)):u.set(e,t)}),{offList:l,snaps:u,options:a}}function nl(e,t){let n=e.label||e.field||`this field`;if(e.optionsMismatchMessage)return e.optionsMismatchMessage;let r=t.map(e=>`"${e}"`).join(`, `);return t.length===1?`${r} is not in the ${n} list. Please choose an option from the dropdown.`:`${r} are not in the ${n} list. Please choose options from the dropdown.`}function rl(e=[],t=[]){let n=t[0];return e.find(e=>e?.name===n||e?.payloadKey===n)??e.find(e=>(e?.fields??[]).some(e=>e?.field===n))}var il=new WeakMap;function al(e){let t=il.get(e);return t||(t={entries:new Map,listeners:new Set,snapshot:[]},il.set(e,t)),t}var ol=e=>JSON.stringify(Array.isArray(e)?e:[e]);function sl(e){e.snapshot=[...e.entries.values()],e.listeners.forEach(e=>e())}function cl(e,t,n){if(!e)return;let r=al(e),i=ol(t);if(n){let e=r.entries.get(i);if(e&&e.message===n.message)return;r.entries.set(i,{...n,path:Array.isArray(t)?t:[t]})}else if(r.entries.has(i))r.entries.delete(i);else return;sl(r)}function ll(e){return e?al(e).snapshot:[]}function ul(e){return(0,r.useSyncExternalStore)(t=>{if(!e)return()=>{};let n=al(e);return n.listeners.add(t),()=>n.listeners.delete(t)},()=>ll(e),()=>ll(e))}function dl(e,t,n){if(!n)return;let r=String(n).split(`.`).map(e=>e.trim()).filter(Boolean);if(Array.isArray(t)&&t.length>=3&&typeof t[1]==`number`){let n=e.getFieldValue([t[0],t[1],...r]);if(!Wc(n))return n}return e.getFieldValue(r)}function fl({field:e,form:t,name:n,moduleName:r}){return{validator:async(i,a)=>{if(!Jc(a).length){cl(t,n,null);return}let o;try{o=await tl(e,a,{moduleName:r,constraintValue:dl(t,n,e.optionsFromField)})}catch(r){console.warn(`[optionMembership] could not load options for "${e.field}"`,r),cl(t,n,null);return}if(!o.offList.length){cl(t,n,null);return}let s=nl(e,o.offList);throw cl(t,n,{field:e.field,label:e.label||e.field,values:o.offList,message:s}),Error(s)}}}function pl(e,t,{labeled:n=!1,options:r=[]}={}){if(!t?.size)return;let i=e=>r.find(t=>String(t.value)===String(e))??r.find(t=>String(t.label)===String(e)),a=e=>{let r=e&&typeof e==`object`?e.value:e;if(!t.has(r))return e;let a=t.get(r);if(!n)return a;let o=i(a);return{value:o?.value??a,label:o?.label??String(a)}};return Array.isArray(e)?e.map(a):a(e)}function ml({field:e,form:t,name:n,moduleName:i,value:a,constraintValue:o,enabled:s=!0}){let c=!!(s&&t&&n!==void 0&&qc(e)),l=c?JSON.stringify(Jc(a)):`[]`,u=c&&e.optionsFromField?JSON.stringify(o??null):``,d=ol(n);(0,r.useEffect)(()=>{if(!c||l===`[]`)return;let r=!1;return tl(e,t.getFieldValue(n),{moduleName:i,constraintValue:o}).then(({offList:i,snaps:a,options:o})=>{if(r)return;let s=pl(t.getFieldValue(n),a,{labeled:ia(e),options:o});s!==void 0&&t.setFieldValue(n,s),(i.length||s!==void 0||t.getFieldError(n).length)&&t.validateFields([n]).catch(()=>{})}).catch(()=>{}),()=>{r=!0}},[c,l,u,d,i,t]),(0,r.useEffect)(()=>{if(c)return()=>cl(t,n,null)},[c,d,t])}function hl(e,t){let n=rl(e,t),r=n?.label||n?.name,i=t.length>=3&&typeof t[1]==`number`;return r?i?`${r} #${t[1]+1}`:r:``}function gl({form:e,groups:t,onJump:n}){let r=ul(e);if(!r.length)return null;let a=r.length;return(0,o.jsx)(i.Alert,{type:`error`,showIcon:!0,className:`v1-option-mismatch-banner`,style:{marginBottom:16},message:`${a} ${a===1?`field has a value`:`fields have values`} that ${a===1?`is`:`are`} not in the dropdown list`,description:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`div`,{style:{marginBottom:6},children:`Choose a valid option for each of these before saving. The value that was read is still shown in the field so you can pick the closest match.`}),(0,o.jsx)(`ul`,{style:{margin:0,paddingInlineStart:18},children:r.map(e=>{let r=hl(t,e.path);return(0,o.jsxs)(`li`,{children:[(0,o.jsxs)(i.Typography.Link,{onClick:()=>n?.(e.path),children:[r?`${r} → `:``,e.label]}),`: `,e.values.map(e=>`"${e}"`).join(`, `)]},JSON.stringify(e.path))})})]})})}var _l=64;function vl(e){if(String(e??``).trim()!==`currentUserId`)return``;try{return typeof localStorage>`u`?``:String(localStorage.getItem(`userId`)??``).trim()}catch{return``}}var Y=e=>String(e??``).trim().toLowerCase(),yl=e=>e!=null&&String(e).trim()!==``;function bl(e){let t=Array.isArray(e)?e:String(e??``).split(`,`);return new Set(t.map(Y).filter(e=>e!==``))}function xl(e,t){return!t||!Array.isArray(e)||e.length===0?!1:e.some(e=>yl(e?.extraData?.[t]))}function Sl(e,t,n){let r=e?.extraData?.[t];if(!yl(n))return r===!0;let i=bl(n);return i.size===0?r===!0:i.has(Y(r))}function Cl(e,t){let n=new Map;return(Array.isArray(e)?e:[]).forEach(e=>{let r=Y(e?.value);r&&n.set(r,Y(e?.extraData?.[t]))}),n}function wl(e,t,n){let r=Y(n);if(!r)return!1;let i=new Set,a=Y(e);if(!a)return!1;i.add(a);for(let e=0;e<_l;e+=1){let e=t.get(a);if(!e)return!1;if(e===r)return!0;if(i.has(e))return!1;i.add(e),a=e}return!1}function Tl(e={}){let t=[],n=e=>{let n=String(e??``).trim();n&&!t.includes(n)&&t.push(n)};return(Array.isArray(e.extraFields)?e.extraFields:[]).forEach(n),n(e.optionsRequireExtraField),n(e.optionsHierarchyParentField),t}function El(e,t={},n={}){if(!Array.isArray(e)||e.length===0)return e;let r=n.source?`[${n.source}]`:`[optionRowFilters]`,i=t.field??t.label??`(unnamed field)`,a=typeof n.warn==`function`?n.warn:e=>{typeof console<`u`&&console.warn(e)},o=e,s=String(t.optionsRequireExtraField??``).trim();s&&(xl(o,s)?o=o.filter(e=>Sl(e,s,t.optionsRequireExtraValue)):a(`${r} "${i}": option filter SKIPPED — no option carried extraData["${s}"], so the value filter could not be applied (the lookup API returned no such extra field). Showing the unfiltered list; this is NOT "nothing matched".`));let c=String(t.optionsHierarchyParentField??``).trim();if(c){let n=String(t.optionsHierarchySelfFrom??``).trim()||`currentUserId`,s=vl(n);if(!s)a(`${r} "${i}": hierarchy filter SKIPPED — identity "${n}" could not be resolved (no signed-in user id available). Showing the list unrestricted by reporting line.`);else if(!xl(e,c))a(`${r} "${i}": hierarchy filter SKIPPED — no option carried extraData["${c}"], so the reporting chain could not be walked (the lookup API returned no such extra field). Showing the list unrestricted by reporting line; this is NOT "nobody reports to you".`);else{let t=Cl(e,c);o=o.filter(e=>wl(e?.value,t,s))}}return o}var Dl=e=>e==null||String(e).trim()===``,Ol=e=>e===!0||e===1||e===`1`||e===`true`;function kl(e){return Dl(e?.tooltip)?Ol(e?.infoEnabled)&&!Dl(e?.infoText)?String(e.infoText):``:String(e.tooltip)}var Al=e=>e==null||typeof e==`string`&&e.trim()===``;function jl(e,t={},n=()=>void 0){let{optionKey:r}=t,i=(e?n(e,r):void 0)??e?.extraData?.[r]??null,{fallback:a}=t;return Al(i)&&a!=null&&a!==``?a:i}var Ml=Symbol(`parentFilterUnseen`),Nl=e=>e==null||e===``,Pl=(e,t)=>String(e??``)===String(t??``);function Fl({previous:e,next:t,currentValue:n,scoped:r=!0}){return!(!r||e===Ml||Pl(e,t)||Nl(e)||Nl(n))}function Il(e){return e==null?!0:typeof e==`object`?Il(e.permission??e.allowed??e.value):e!==!1&&e!==0&&e!==`0`}function Ll(e,t){let n=String(t??``).trim().toLowerCase();if(!(!n||!e||typeof e!=`object`))for(let[t,r]of Object.entries(e)){let e=String(t).trim().toLowerCase();if(e===n||e===`${n}s`||`${e}s`===n)return r&&typeof r==`object`?r:void 0}}function Rl(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=`${t}Access`;if(Object.prototype.hasOwnProperty.call(e,n))return e[n]}function zl(e,t){if(!e)return!0;try{let n=JSON.parse(localStorage.getItem(`menuPermission`)||`{}`),[r,i]=String(e).split(`.`),a=i??r,o=i?[r,t]:[t];for(let e of o){let t=Ll(n,e);if(t)return Il(Rl(t,a))}return!0}catch{return!0}}function Bl(e){return(e??[]).filter(e=>e?.afterSubmit?.mode).sort((e,t)=>(e.order??0)-(t.order??0))[0]?.afterSubmit??null}function Vl(e,t,n){let r=String(e??``).trim();return!r||!r.startsWith(`/`)||r.startsWith(`//`)||/^[a-z][a-z0-9+.-]*:/i.test(r)?null:r.replace(/:([A-Za-z_][\w]*)/g,(e,r)=>{let i=r===`id`?t:n?.[r];return encodeURIComponent(i??``)})}function Hl(e=typeof window<`u`?window:void 0){let t=e?.history?.state?.idx;return typeof t==`number`&&t>0}function Ul({cancelPath:e,cancelPathPriority:t=!1,fallbackPath:n=`/`,win:r=typeof window<`u`?window:void 0}={}){return t&&e?{path:e}:Hl(r)?{back:!0}:e?{path:e}:{path:n}}function Wl(e,t={}){let n=Ul(t);return n.back?e(-1):e(n.path),n}var X=e=>e==null?``:String(e).trim();function Gl(e,t){let n=e?.regionRules;if(!n||typeof n!=`object`)return e??{};let r=X(t),i=n[r]??n[r.toUpperCase()]??n.default;return!i||typeof i!=`object`?e??{}:{...e,...i}}function Kl(e){return e?.allowInProgress!==!1}function ql(e){return Kl(e)?``:Xl(e)?e?.inProgressWarningMessage||e?.inProgressMessage||`In this region an unfinished qualification is not usually accepted when a candidate is put forward for a role. You can still record it here — just be aware it will have to be completed before they can be submitted.`:e?.inProgressMessage||`This one needs to be finished before the application can go ahead. Please untick “still ongoing”, or remove the row.`}function Jl(e){return Kl(e)?`allow`:X(e?.inProgressSeverity).toLowerCase()===`warn`?`warn`:`block`}function Yl(e){return Jl(e)===`block`}function Xl(e){return Jl(e)===`warn`}function Zl(e){if(!Yl(e))return null;let t=ql(e);return{validator:(e,n)=>n===!0?Promise.reject(Error(t)):Promise.resolve()}}function Ql(e,t={}){let n=t.tieBreak??`endDate`,r=t.field??`startDate`;for(let t of[n,r]){let n=e?.[t];if(n==null||n===``)continue;let r=(0,s.default)(n);if(r.isValid())return r.valueOf()}return null}function $l(e,t={}){let n=t.inProgressField??`currentStudyingHere`;return!!e?.[n]}function eu(e=[],t={}){let n=(t.direction??`desc`)===`desc`;return e.map((e,n)=>({index:n,key:Ql(e,t),ongoing:t.inProgressFirst!==!1&&$l(e,t)})).slice().sort((e,t)=>e.ongoing===t.ongoing?e.key===null&&t.key===null?e.index-t.index:e.key===null?1:t.key===null?-1:e.key===t.key?e.index-t.index:n?t.key-e.key:e.key-t.key:e.ongoing?-1:1).map(e=>e.index)}function tu(e,t,n={}){if(!Array.isArray(e)||e.length<2||t==null||t<0||t>=e.length)return null;let r=eu(e,n).indexOf(t);return r===-1||r===t?null:{from:t,to:r,reason:$l(e[t],n)?`inProgress`:`outOfOrder`}}var nu=Object.freeze({inProgress:`You’ve marked this one as still ongoing, so it’s the most recent. Shall we move it to the top? This list reads best newest first.`,outOfOrder:`These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.`,ok:`Yes, move it up`,keep:`No, leave it here`});function ru(e,t={}){let n={...nu,...t.messages??{}};return n[e]??n.outOfOrder}function iu(e,t={}){let n=t.levelField??`qualification`,r=X(e?.[n]);if(!r)return null;let i=t.levels??{},a=i[r]??i[r.toLowerCase()]??i[r.toUpperCase()];return Number.isFinite(Number(a))?Number(a):au(r,t)}function au(e,t){let n=Array.isArray(t?.levelPatterns)?t.levelPatterns:[],r=e.toLowerCase();for(let e of n){let t=X(e?.match);if(!t)continue;let n;try{n=new RegExp(t,`i`)}catch{continue}if(n.test(r)&&Number.isFinite(Number(e.level)))return Number(e.level)}return null}function ou(e,t={}){return X((t?.levelLabels??{})[e])||X(e)}function su(e=[],t={}){if(!t||t.requireBelow===!1)return[];let n=t.levels??{},r=t.requiredLevels??[];if(!r.length)return[];let i=e.map(e=>iu(e,t)).filter(e=>e!==null);if(!i.length)return[];let a=Math.max(...i),o=[];return r.forEach(e=>{let t=typeof e==`object`?e.label:e,r=typeof e==`object`&&Number.isFinite(Number(e.level))?Number(e.level):Number(n[t]);Number.isFinite(r)&&(r>=a||i.includes(r)||o.push(t))}),o}function cu(e,t={}){let n=su(e,t);if(!n.length)return``;let r=n.map(e=>ou(e,t)).join(`, `);return(t.message||`You’ve added a higher qualification but not the {missing} below it. Please add that too.`).replace(`{missing}`,r)}async function lu({group:e,rows:t,rowIndex:n,move:r,confirm:i}){let a=e?.orderBy;if(!a||a.confirmMove===!1||typeof r!=`function`)return!1;let o=tu(t,n,a);if(!o)return!1;let s={...nu,...a.messages??{}};return await i({reason:o.reason,title:o.reason===`inProgress`?`This looks like the most recent one`:`These dates make this the most recent one`,body:ru(o.reason,a),okText:s.ok,cancelText:s.keep,from:o.from,to:o.to})?(r(o.from,o.to),!0):!1}function uu(e,t){let n=Gl(e,t),r=n?.orderBy?.inProgressField;return r?{name:n.name,label:n.label??n.name,rowsKey:n.payloadKey||n.name,inProgressField:r,severity:Jl(n),message:ql(n)}:null}function du(e=[],t,n){if(!n)return{severity:`allow`,message:``,group:null};let r=null;for(let i of e){let e=uu(i,t);if(!(!e||e.severity===`allow`)&&fu(n,e.rowsKey).some(t=>$l(t,e))){if(e.severity===`block`)return{severity:`block`,message:e.message,group:e};r??={severity:`warn`,message:e.message,group:e}}}return r??{severity:`allow`,message:``,group:null}}function fu(e,t){let n=e?.[t];return Array.isArray(n)?n:Array.isArray(n?.rows)?n.rows:[]}function pu(e){return String(e?.severity??``).toLowerCase()===`block`?`block`:`warn`}function mu(e=[],t={}){let n=null;for(let r of e){let e=r?.levelRule;if(!e)continue;let i=hu(t,r);if(!i.length)continue;let a=cu(i,e);if(a){if(pu(e)===`block`)return{severity:`block`,message:a,group:r};n??={severity:`warn`,message:a,group:r}}}return n??{severity:`allow`,message:``,group:null}}function hu(e,t){for(let n of[t?.name,t?.payloadKey]){if(!n)continue;let t=e?.[n];if(Array.isArray(t))return t}return[]}function gu(e,t){return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),t]:[t]}function _u(e,t){let n=e?.field,r=[];e?.clearGroupOnChange&&(t instanceof Set?[...t]:t??[]).forEach(e=>{e&&e!==n&&r.push(e)});let i=e?.linkedClearField;return Array.isArray(i)?i.forEach(e=>{e&&e!==n&&r.push(e)}):typeof i==`string`&&i.trim()&&i.trim()!==n&&r.push(i.trim()),[...new Set(r)]}function vu(e,t,n,r){let i=_u(t,r).map(e=>gu(n,e));return i.forEach(t=>e.setFieldValue(t,null)),i}function yu(e){return(Array.isArray(e)?e:[e]).map(e=>e&&typeof e==`object`?e.value??e.key??e.id:e).filter(e=>e!=null&&e!==``)}function bu(e,t=[]){let n=new Set((t??[]).map(e=>String(e?.value))),r=[];for(let t of yu(e)){let e=String(t);!n.has(e)&&!r.includes(e)&&r.push(e)}return r}async function xu(e,n){if(!e?.lookupCollection||!n?.length)return[];let r=new URLSearchParams({collection:e.lookupCollection,displayField:e.displayField??``,valueField:e.valueField??`_id`,values:n.join(`,`)});e.displayField2&&r.set(`displayField2`,e.displayField2);let i=await t.o(t.x,`/admin/lookup-dropdown-values?${r}`),a=i?.data??i??[];return Array.isArray(a)?a:[]}function Su(e=[],t=[]){if(!t.length)return e;let n=new Set((e??[]).map(e=>String(e?.value))),r=t.filter(e=>!n.has(String(e?.value))).map(e=>({...e,resolvedOnly:!0}));return r.length?[...e,...r]:e}var Cu=e=>e==null||e===``||Array.isArray(e)&&e.length===0||e===!1;function wu(e){let t=e?.requireAnyOf;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim()!==``):[]}function Tu(e){return!e||typeof e!=`object`?!1:Object.values(e).some(e=>!Cu(e))}function Eu({field:e,getRow:t}){let n=wu(e);if(n.length===0||!n.includes(e?.field))return;let r=e.requireAnyOfMessage||`Select at least one of ${n.join(`, `)}.`;return{validator:async()=>{let e=t?.()??{};return Tu(e)?n.some(t=>!Cu(e[t]))?Promise.resolve():Promise.reject(Error(r)):Promise.resolve()}}}function Du(e,t=[]){let n=wu(e);return n.length===0?t:t.map(t=>n.includes(t?.field)?{...t,requireAnyOf:n,requireAnyOfMessage:e.requireAnyOfMessage}:t)}var Z=e=>e==null||e===``;function Ou(e){if(!e)return null;if(typeof e.valueOf==`function`){let t=e.valueOf();return Number.isNaN(t)?null:t}let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function Q(e){if(!e)return null;let t=(0,s.default)(e);return t.isValid()?t.startOf(`day`).valueOf():null}function ku(e){if(!e)return null;let t=(0,s.default)(e);return t.isValid()?t.hour()*60+t.minute():null}var Au={d:`day`,day:`day`,days:`day`,w:`week`,week:`week`,weeks:`week`,m:`month`,mo:`month`,month:`month`,months:`month`,y:`year`,yr:`year`,year:`year`,years:`year`};function ju(e){if(e==null||e===``)return null;if(typeof e==`object`&&!Array.isArray(e)){let t=Number(e.value??e.count??e.amount);return!Number.isFinite(t)||t<=0?null:{value:t,unit:Au[String(e.unit??`month`).toLowerCase()]??`month`}}let t=String(e).trim().toLowerCase();if(!t)return null;let n=t.match(/^(\d+(?:\.\d+)?)\s*([a-z]*)$/);if(!n)return null;let r=Number(n[1]);return!Number.isFinite(r)||r<=0?null:{value:r,unit:Au[n[2]]??`month`}}function Mu(e,t){let n=e?.minGapFrom??e?.gapFrom;if(n&&typeof t==`function`){let e=ju(t(n));if(e)return e}return ju(e?.minGap)}function Nu(e,t,n,r){if(t===null)return null;let i=Mu(n,r),a=(0,s.default)(t);return i&&(a=e===`dateAfterField`?a.add(i.value,i.unit):a.subtract(i.value,i.unit)),a.startOf(`day`).valueOf()}function Pu(e,t,n,r,i){if(t===null||n===null)return!1;let a=Nu(e,n,r,i);if(a===null)return!1;let o=!!r?.strict&&!Mu(r,i);return e===`dateAfterField`?o?t<=a:t<a:o?t>=a:t>a}function Fu(e,t,n,r){if(n?.message)return n.message;let i=n?.value??n?.compareField??n?.field??`the paired date`,a=Mu(n,r);if(a){let n=a.value===1?a.unit:`${a.unit}s`;return e===`dateAfterField`?`${t} must be at least ${a.value} ${n} after ${i}`:`${t} must be at least ${a.value} ${n} before ${i}`}return n?.strict?e===`dateAfterField`?`${t} must be after ${i}`:`${t} must be before ${i}`:e===`dateAfterField`?`${t} must be on or after ${i}`:`${t} must be on or before ${i}`}function Iu({type:e,label:t,rule:n,readSibling:r}){return{validator:async(i,a)=>{let o=n?.value??n?.compareField??n?.field;if(!o||Z(a))return Promise.resolve();let s=r(o);if(Z(s))return Promise.resolve();let c=Q(a),l=Q(s);return c===null||l===null?Promise.resolve():Pu(e,c,l,n,r)?Promise.reject(Error(Fu(e,t,n,r))):Promise.resolve()}}}function Lu(e,t,{rows:n,rowIndex:r}={}){if(e===null||!t||!Array.isArray(n)||r==null||(t.mode??`newestFirst`)!==`newestFirst`)return!1;let i=t.startField??`startDate`,a=t.endField??`endDate`,o=n[r-1];if(o){let t=Q(o[i]);if(t!==null&&e>=t)return!0}let s=n[r+1];if(s){let t=Q(s[a])??Q(s[i]);if(t!==null&&e<=t)return!0}return!1}function Ru(e,t=`above`,n=void 0){let r=e?.messages??{},i=t===`below`;return(n===`start`?i?r.belowStart:r.aboveStart:n===`end`?i?r.belowEnd:r.aboveEnd:void 0)||(i?r.below||`Start date must be after the end date of the entry below it.`:n===`end`?r.above||`End date must be before the start date of the entry above it.`:r.above||`This period overlaps the entry above it. Please adjust the dates.`)}function zu({field:e,readSibling:t,rows:n,rowIndex:r,now:i=Tn}){let a=e?.validations??e?.validation??e?.rules??[],o=[];for(let e of a){let n=typeof e==`string`?{type:e}:e,r=n?.type;if(r===`noPastDate`&&o.push(e=>e?Q(e)<i().startOf(`day`).valueOf():!1),r===`noFutureDate`&&o.push(e=>e?Q(e)>i().startOf(`day`).valueOf():!1),r===`minAge`){let e=Number(n?.value??18);o.push(t=>t?Q(t)>i().subtract(e,`year`).startOf(`day`).valueOf():!1)}if(r===`dateAfterField`||r===`dateBeforeField`){let e=n?.value??n?.compareField??n?.field;if(!e)continue;o.push(i=>{if(!i)return!1;let a=t(e);return!Z(a)&&Pu(r,Q(i),Q(a),n,t)})}}return e?.rowHierarchy&&Array.isArray(n)&&r!=null&&o.push(t=>t?Lu(Q(t),e.rowHierarchy,{rows:n,rowIndex:r}):!1),o.length?e=>o.some(t=>t(e)):void 0}function Bu(e,t=Tn,n=void 0,r=void 0){if(!Z(n)&&Q(n)!==null)return;let i,a=e?.validations??e?.validation??e?.rules??[];for(let e of a){let n=typeof e==`string`?{type:e}:e;if(n?.type===`minAge`){i=t().subtract(Number(n?.value??18),`year`);break}if(n?.type===`noFutureDate`||n?.type===`noPastDate`){i=t();break}}if(typeof r!=`function`)return i;let o=(0,s.default)(i??t()),c=Vu(o,r);return!c||c.isSame(o,`month`)?i:c}function Vu(e,t,n=240){let r=(0,s.default)(e).startOf(`day`);if(!r.isValid()||typeof t!=`function`)return null;let i=e=>{try{return!t(e)}catch{return!1}},a=e=>{let t=null,n=1/0,a=e.startOf(`month`),o=a.daysInMonth();for(let e=0;e<o;e+=1){let o=a.add(e,`day`);if(!i(o))continue;let s=Math.abs(o.diff(r,`day`));s<n&&(t=o,n=s)}return t?{day:t,gap:n}:null};for(let e=0;e<=n;e+=1){let t=(e===0?[a(r)]:[a(r.subtract(e,`month`)),a(r.add(e,`month`))]).filter(Boolean);if(t.length)return t.reduce((e,t)=>t.gap<e.gap?t:e).day}return null}function Hu({field:e,name:t,rows:n}){if(!Array.isArray(t)||t.length===0)return[];let r=t[t.length-1],i=t.length>=3&&typeof t[1]==`number`,a=new Set,o=e?.validations??e?.validation??e?.rules??[];for(let e of o){let t=typeof e==`string`?{type:e}:e;if(t?.type===`dateBeforeField`||t?.type===`dateAfterField`){let e=t?.value??t?.compareField??t?.field;e&&a.add(e)}}let s=e?.rowHierarchy,c=s?.startField??`startDate`,l=s?.endField??`endDate`;s&&(a.add(c),a.add(l));let u=[];for(let e of a)e!==r&&u.push(i?[t[0],t[1],e]:[...t.slice(0,-1),e]);if(s&&i&&Array.isArray(n))for(let e of[t[1]-1,t[1]+1])e<0||e>=n.length||(u.push([t[0],e,c]),u.push([t[0],e,l]));return u}function Uu({field:e,rows:t,rowIndex:n}){let r=e?.rowHierarchy;return{validator:async(i,a)=>{if(!r||Z(a)||!Array.isArray(t)||n==null)return Promise.resolve();let o=Q(a);if(o===null||!Lu(o,r,{rows:t,rowIndex:n}))return Promise.resolve();let s=r.startField??`startDate`,c=t[n-1],l=c?Q(c[s]):null,u=l!==null&&o>=l?`above`:`below`,d=r.endField??`endDate`,f=e?.field,p=f===s?`start`:f===d?`end`:void 0;return Promise.reject(Error(Ru(r,u,p)))}}}function Wu(e){return(e??[]).filter(e=>e?.submitMessages&&typeof e.submitMessages==`object`).sort((e,t)=>(e.order??0)-(t.order??0))[0]?.submitMessages??null}function $(e){let t=String(e??``).trim();return t?t.charAt(0).toUpperCase()+t.slice(1):`Record`}function Gu(e,t){return String(e).replaceAll("${module}",$(t)).replaceAll("${moduleName}",$(t))}function Ku(e,t,n){let r=Wu(e);if(r?.suppress)return null;let i=n===`edit`?r?.editSuccess:r?.addSuccess;return i&&String(i).trim()?Gu(i,t):n===`edit`?`${$(t)} has Updated successfully`:`${$(t)} has added successfully`}function qu(e,t,n){if(!e)return``;let r=``;if(typeof e==`string`){let i=e.trim();if(i.startsWith(`{`)&&i.endsWith(`}`))try{return qu(JSON.parse(i),t,n)}catch{}r=i}else if(e instanceof Error)r=e.message||``;else if(typeof e==`object`){let t=e?.response?.data??e?.data??e;typeof t==`string`?r=t:t?.error&&typeof t.error==`string`?r=t.error:t?.message&&typeof t.message==`string`?r=t.message:Array.isArray(t?.errors)&&t.errors.length>0?r=t.errors.map(e=>typeof e==`string`?e:e?.message||e?.msg||JSON.stringify(e)).filter(Boolean).join(`, `):t?.errors&&typeof t.errors==`object`?r=Object.values(t.errors).flat().map(e=>typeof e==`string`?e:e?.message||JSON.stringify(e)).filter(Boolean).join(`, `):e?.message&&typeof e.message==`string`&&(r=e.message)}if(!r||typeof r!=`string`)return``;if(r=r.replace(/^API\s+\d+:\s*/i,``).replace(/^Error:\s*/i,``).trim(),/failed to fetch/i.test(r)||/network\s*error/i.test(r)||/load failed/i.test(r)||/network request failed/i.test(r))return`Unable to connect to the server. Please check your network connection.`;if(/E11000\s+duplicate\s+key/i.test(r)){let e=r.match(/dup key:\s*(\{.*?\})/);return e?`Duplicate record detected: A record with ${e[1]} already exists.`:`A record with these unique details already exists.`}return r}function Ju(e,t,n,r){let i=qu(r,t,n);if(i&&String(i).trim())return i;let a=Wu(e),o=n===`edit`?a?.editError:a?.addError;return o&&String(o).trim()?Gu(o,t):n===`edit`?`Failed to update ${$(t)}`:`Failed to create ${$(t)}`}function Yu({errorFields:e}={},t,{root:n=document}={}){if(!e?.length)return;let r=e[0]?.name;setTimeout(()=>{if(t?.scrollToField&&r!==void 0)try{t.scrollToField(r,{behavior:`smooth`,block:`center`})}catch{}let e=(n??document).querySelector(`.ant-form-item-has-error`);if(!e)return;let i=e.querySelector(`input, textarea, select, .ProseMirror`),a=i??e;a.scrollIntoView({behavior:`smooth`,block:`center`}),setTimeout(()=>{i?.focus?.({preventScroll:!0}),a.style.boxShadow=`0 0 0 3px rgba(255, 77, 79, 0.3)`,setTimeout(()=>{a.style.boxShadow=``},1200)},350)},60)}function Xu(e){return Array.isArray(e)?e.map(e=>String(e??``).trim()):String(e??``).split(`,`).map(e=>e.trim())}function Zu(e,t){if(!e?.field)return!1;switch(e.operator??`eq`){case`eq`:return String(t??``)===String(e.value??``);case`neq`:return String(t??``)!==String(e.value??``);case`truthy`:return t!=null&&t!==``&&t!==!1;case`falsy`:return t==null||t===``||t===!1;case`notEmpty`:return Array.isArray(t)?t.length>0:!!t;case`in`:return Xu(e.value).includes(String(t??``));case`notIn`:return!Xu(e.value).includes(String(t??``));default:return!1}}function Qu(e,t,n=!1){let r=n?e?.combineLabel??e?.label:e?.label,i=e?.labelWhen;return Zu(i,t)&&i?.label?i.label:r}function $u(e){return e?[...e.field?[e]:[],...(e.conditions??[]).filter(e=>e?.field)]:[]}function ed(e,t){let n=$u(e);if(!n.length)return!0;let r=n.map(e=>Zu(e,t(e.field)));return e.logic===`or`?r.some(Boolean):r.every(Boolean)}function td(e){let t=e?.colWhen;return t?(Array.isArray(t)?t:[t]).filter(e=>e?.field&&Number(e?.col)>0):[]}function nd(e,t,n){for(let t of td(e))if(Zu(t,n(t)))return Number(t.col);return t}function rd(e,t){return e?.field?t==null?[e.field]:[...Array.isArray(t)?t:[t],e.field]:[`__noop_conditional_label__`]}function id(e,t){return n=>{if(!e||!n)return;let r=Array.isArray(t)&&t.length>1?[...t.slice(0,-1),n]:[n],i=e.getFieldValue(r);return i===void 0?e.getFieldValue([n]):i}}function ad(e,t,n){let r=e?.requiredWhen;return!r||!t||!r.field&&!(r.conditions??[]).some(e=>e?.field)?!1:ed(r,id(t,n))}function od(e,t,n){return{validator:(r,i)=>{if(!ad(e,t,n)||!(i==null||i===``||Array.isArray(i)&&i.length===0))return Promise.resolve();let a=e?.label??e?.field??`This field`;return Promise.reject(Error(e?.requiredWhen?.message??`${a} is required`))}}}function sd({items:e=[]}){let t=e.map((t,n)=>({title:n===e.length-1?(0,o.jsx)(Zn,{variant:`body`,weight:`medium`,color:`link`,children:t.label}):(0,o.jsxs)(u.Link,{to:t.href,children:[(0,o.jsx)(Zn,{variant:`body`,color:`secondary`,children:t.label}),t.dropdown&&(0,o.jsx)(a.DownOutlined,{})]})}));return(0,o.jsx)(i.Breadcrumb,{items:t})}var cd=e=>String(e??``).trim().replace(/\s+/g,` `).toLowerCase();function ld(e=[]){let t=new Map;for(let n of e){if(n==null)continue;let e=typeof n==`object`?n.value:n;if(e!=null&&e!==``)for(let r of[n?.label,e]){let n=cd(r);n&&!t.has(n)&&t.set(n,e)}}return t}function ud(e,t){if(!Array.isArray(e)){let n=ud([e],t);return n.length?n[0]:e}let n=ld(t),r=new Set,i=[];for(let t of e){let e=typeof t==`object`&&t?t.value:t,a=n.get(cd(e))??e,o=cd(a);o&&r.has(o)||(o&&r.add(o),i.push(a))}return i}function dd(e,t=[]){if(!e)return[];let n=new Set;for(let r of t)for(let t of r?.fields??[])if(t?.field){if(t.field===e)for(let e of t.autofillFrom??[])e?.targetField&&n.add(e.targetField);t.lookupFilterValueFrom===e&&n.add(t.field);for(let r of t.prefillWhen??[])r?.field===e&&n.add(t.field)}return n.delete(e),[...n]}function fd(e,t=[]){return e?.blockWhileResolving?dd(e.field,t).length>0:!1}function pd(e){let t=String(e?.label??``).trim();return t?`Applying ${t}…`:`Applying your selection…`}function md(e,t=[]){if(!e?.field)return[];let n=new Set(dd(e.field,t));if(n.size===0)return[];let r=[];for(let e of t){let t=e?.name??e?.id;t&&(e.fields??[]).some(e=>e?.field&&n.has(e.field))&&r.push(t)}return r}function hd(e){return String(e?.blockScope??``).toLowerCase()===`group`}var gd=(0,r.lazy)(()=>Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.n)),_d=(0,r.lazy)(()=>Promise.resolve().then(()=>require("./DocumentViewer-DE0kSU2d.cjs")).then(e=>e.n));function vd(e){let t=String(e??``).split(`.`).pop()?.toLowerCase();return t===`pdf`?(0,o.jsx)(a.FilePdfOutlined,{className:`v1-file-chip__icon`}):t===`doc`||t===`docx`?(0,o.jsx)(a.FileWordOutlined,{className:`v1-file-chip__icon`}):(0,o.jsx)(a.FileOutlined,{className:`v1-file-chip__icon`})}function yd({field:e,recordMeta:t,onLinkedRecordUpdated:n}){let s=e?.linkedModule,c=e?.linkedFileField,l=(0,r.useMemo)(()=>{let n=uc(s,t);if(n)return n;let r=e?.linkedIdField,i=r?t?.[r]:``;return i?String(i):``},[s,t,e?.linkedIdField]),[u,d]=(0,r.useState)({loading:!1,fileValue:null}),[f,p]=(0,r.useState)(!1),[m,h]=(0,r.useState)(!1),[g,_]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(!l||!s)return;let e=!1;return queueMicrotask(()=>{e||d(e=>({...e,loading:!0}))}),br(s,l).then(t=>{e||d({loading:!1,fileValue:t?.[c]??null})}),()=>{e=!0}},[l,s,c,g]);let v=(0,r.useMemo)(()=>ro(u.fileValue),[u.fileValue])[0],y=!!v,b=e?.label??`File`,x=K(s)||`record`;if(!l)return(0,o.jsx)(`div`,{className:`v1-linked-file v1-linked-file--empty`,children:(0,o.jsx)(`span`,{children:e?.unlinkedText??`Not available until the ${x} is set.`})});if(u.loading)return(0,o.jsx)(`div`,{className:`v1-linked-file v1-linked-file--loading`,children:(0,o.jsx)(i.Spin,{size:`small`})});let ee=v?{...v,url:v.needsAuthFetch?``:v.url,authSource:v.needsAuthFetch?{module:s,refId:l,fieldName:c}:void 0}:null,S=()=>h(!1),te=e?.emptyText??`No ${b.toLowerCase()} on file yet`,C=e?.reuploadLabel??`${y?`Reupload`:`Upload`} in ${x}`,w=e?.reuploadWarning??`The ${b.toLowerCase()} belongs to the ${x.toLowerCase()}, not to this record. Changing it here updates the ${x.toLowerCase()} everywhere it is used.`;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`div`,{className:`v1-linked-file-row ${y?``:`v1-linked-file--empty`}`,children:[(0,o.jsxs)(`button`,{type:`button`,className:`v1-linked-file v1-file-chip`,disabled:!y,onClick:()=>y&&p(!0),title:y?`Preview or download ${v.name}`:te,children:[y?vd(v.name):(0,o.jsx)(a.FileOutlined,{className:`v1-file-chip__icon`}),(0,o.jsx)(`span`,{className:`v1-file-chip__name`,children:y?v.name:te}),y&&(0,o.jsx)(a.EyeOutlined,{className:`v1-file-chip__action`,"aria-hidden":`true`})]}),(0,o.jsxs)(`button`,{type:`button`,className:`v1-linked-file__edit-btn`,onClick:()=>h(!0),title:w,children:[(0,o.jsx)(a.EditOutlined,{}),` `,C]})]}),f&&ee&&(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(_d,{open:f,onClose:()=>p(!1),documents:[ee]})}),m&&(0,o.jsxs)(i.Modal,{open:!0,title:C,width:`min(1080px, 96vw)`,footer:null,destroyOnClose:!0,maskClosable:!1,onCancel:S,styles:{body:{maxHeight:`78vh`,overflowY:`auto`}},children:[(0,o.jsx)(i.Alert,{type:`warning`,showIcon:!0,message:w,style:{marginBottom:16}}),(0,o.jsx)(r.Suspense,{fallback:(0,o.jsx)(`div`,{style:{padding:48,textAlign:`center`},children:(0,o.jsx)(i.Spin,{})}),children:(0,o.jsx)(gd,{moduleName:s,recordId:l,embedded:!0,breadcrumbItems:[],onCancel:S,onSuccess:()=>{S(),_(e=>e+1),n?.(l)}})})]})]})}yd.propTypes={field:g.default.shape({label:g.default.string,linkedModule:g.default.string,linkedFileField:g.default.string,linkedIdField:g.default.string,emptyText:g.default.string,unlinkedText:g.default.string,reuploadLabel:g.default.string,reuploadWarning:g.default.string}).isRequired,recordMeta:g.default.object,onLinkedRecordUpdated:g.default.func},yd.defaultProps={recordMeta:void 0,onLinkedRecordUpdated:void 0},Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return Tl}}),Object.defineProperty(exports,"$i",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"$n",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(exports,"$r",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,"$t",{enumerable:!0,get:function(){return os}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return xu}}),Object.defineProperty(exports,"Ai",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,"An",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"Ar",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return Qs}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return mu}}),Object.defineProperty(exports,"Bi",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"Bn",{enumerable:!0,get:function(){return vi}}),Object.defineProperty(exports,"Br",{enumerable:!0,get:function(){return on}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return Es}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Bu}}),Object.defineProperty(exports,"Ci",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"Cn",{enumerable:!0,get:function(){return Da}}),Object.defineProperty(exports,"Cr",{enumerable:!0,get:function(){return An}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return sc}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Hu}}),Object.defineProperty(exports,"Di",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"Dn",{enumerable:!0,get:function(){return wa}}),Object.defineProperty(exports,"Dr",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return nc}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"Ei",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"En",{enumerable:!0,get:function(){return va}}),Object.defineProperty(exports,"Er",{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return rc}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return uu}}),Object.defineProperty(exports,"Fi",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,"Fn",{enumerable:!0,get:function(){return ia}}),Object.defineProperty(exports,"Fr",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return Ms}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return Vl}}),Object.defineProperty(exports,"Gi",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"Gn",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(exports,"Gr",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,"Gt",{enumerable:!0,get:function(){return ls}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return Gl}}),Object.defineProperty(exports,"Hi",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,"Hn",{enumerable:!0,get:function(){return ai}}),Object.defineProperty(exports,"Hr",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return xs}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return Kl}}),Object.defineProperty(exports,"Ii",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"In",{enumerable:!0,get:function(){return Pi}}),Object.defineProperty(exports,"Ir",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return As}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return Ml}}),Object.defineProperty(exports,"Ji",{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,"Jn",{enumerable:!0,get:function(){return Ur}}),Object.defineProperty(exports,"Jr",{enumerable:!0,get:function(){return en}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return fs}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return Il}}),Object.defineProperty(exports,"Ki",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"Kn",{enumerable:!0,get:function(){return Jr}}),Object.defineProperty(exports,"Kr",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return us}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Yl}}),Object.defineProperty(exports,"Li",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"Ln",{enumerable:!0,get:function(){return Ii}}),Object.defineProperty(exports,"Lr",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return Os}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return bu}}),Object.defineProperty(exports,"Mi",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,"Mn",{enumerable:!0,get:function(){return da}}),Object.defineProperty(exports,"Mr",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return Gs}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return vu}}),Object.defineProperty(exports,"Ni",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"Nn",{enumerable:!0,get:function(){return Ca}}),Object.defineProperty(exports,"Nr",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return Hs}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Du}}),Object.defineProperty(exports,"Oi",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,"On",{enumerable:!0,get:function(){return _a}}),Object.defineProperty(exports,"Or",{enumerable:!0,get:function(){return On}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return tc}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Zl}}),Object.defineProperty(exports,"Pi",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"Pn",{enumerable:!0,get:function(){return aa}}),Object.defineProperty(exports,"Pr",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return Us}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return El}}),Object.defineProperty(exports,"Qi",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"Qn",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(exports,"Qr",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"Qt",{enumerable:!0,get:function(){return Zo}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return ql}}),Object.defineProperty(exports,"Ri",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"Rn",{enumerable:!0,get:function(){return Di}}),Object.defineProperty(exports,"Rr",{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Uu}}),Object.defineProperty(exports,"Si",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"Sn",{enumerable:!0,get:function(){return Ea}}),Object.defineProperty(exports,"Sr",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return hc}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return ku}}),Object.defineProperty(exports,"Ti",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"Tn",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"Tr",{enumerable:!0,get:function(){return Ln}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return ic}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return Wl}}),Object.defineProperty(exports,"Ui",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,"Un",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(exports,"Ur",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return ms}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return lu}}),Object.defineProperty(exports,"Vi",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"Vn",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(exports,"Vr",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return vs}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return Bl}}),Object.defineProperty(exports,"Wi",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"Wn",{enumerable:!0,get:function(){return li}}),Object.defineProperty(exports,"Wr",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"Wt",{enumerable:!0,get:function(){return ps}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return jl}}),Object.defineProperty(exports,"Xi",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"Xn",{enumerable:!0,get:function(){return Hr}}),Object.defineProperty(exports,"Xr",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"Xt",{enumerable:!0,get:function(){return es}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return Fl}}),Object.defineProperty(exports,"Yi",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"Yn",{enumerable:!0,get:function(){return Gr}}),Object.defineProperty(exports,"Yr",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return ts}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return kl}}),Object.defineProperty(exports,"Zi",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"Zn",{enumerable:!0,get:function(){return Br}}),Object.defineProperty(exports,"Zr",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return Go}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return Yu}}),Object.defineProperty(exports,"_a",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,"_i",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return ro}}),Object.defineProperty(exports,"_r",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return uc}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return fd}}),Object.defineProperty(exports,"aa",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"ai",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"an",{enumerable:!0,get:function(){return Po}}),Object.defineProperty(exports,"ar",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return ul}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return zu}}),Object.defineProperty(exports,"ba",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"bi",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"bn",{enumerable:!0,get:function(){return Aa}}),Object.defineProperty(exports,"br",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return fc}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ad}}),Object.defineProperty(exports,"ca",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"ci",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return go}}),Object.defineProperty(exports,"cr",{enumerable:!0,get:function(){return Er}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return Lc}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return rd}}),Object.defineProperty(exports,"da",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(exports,"di",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"dn",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"dr",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return Ec}}),Object.defineProperty(exports,"ea",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"ei",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return Lo}}),Object.defineProperty(exports,"er",{enumerable:!0,get:function(){return Vr}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return gl}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Zu}}),Object.defineProperty(exports,"fa",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,"fi",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"fn",{enumerable:!0,get:function(){return ao}}),Object.defineProperty(exports,"fr",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return yc}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return $u}}),Object.defineProperty(exports,"ga",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,"gi",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"gn",{enumerable:!0,get:function(){return $a}}),Object.defineProperty(exports,"gr",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return dc}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return nd}}),Object.defineProperty(exports,"ha",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"hi",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,"hn",{enumerable:!0,get:function(){return Ua}}),Object.defineProperty(exports,"hr",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return _c}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return pd}}),Object.defineProperty(exports,"ia",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"ii",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"in",{enumerable:!0,get:function(){return Fo}}),Object.defineProperty(exports,"ir",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return ml}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Su}}),Object.defineProperty(exports,"ji",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,"jn",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"jr",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return Ks}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Eu}}),Object.defineProperty(exports,"ki",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,"kn",{enumerable:!0,get:function(){return Ji}}),Object.defineProperty(exports,"kr",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return ec}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return od}}),Object.defineProperty(exports,"la",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"li",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"ln",{enumerable:!0,get:function(){return ho}}),Object.defineProperty(exports,"lr",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return Mc}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return ed}}),Object.defineProperty(exports,"ma",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"mi",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"mn",{enumerable:!0,get:function(){return Va}}),Object.defineProperty(exports,"mr",{enumerable:!0,get:function(){return lr}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return Sc}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return hd}}),Object.defineProperty(exports,"na",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(exports,"ni",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,"nn",{enumerable:!0,get:function(){return zo}}),Object.defineProperty(exports,"nr",{enumerable:!0,get:function(){return Ir}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ud}}),Object.defineProperty(exports,"oa",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"oi",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,"on",{enumerable:!0,get:function(){return Mo}}),Object.defineProperty(exports,"or",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return Pc}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Qu}}),Object.defineProperty(exports,"pa",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(exports,"pi",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"pn",{enumerable:!0,get:function(){return Ha}}),Object.defineProperty(exports,"pr",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return bc}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return zl}}),Object.defineProperty(exports,"qi",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,"qn",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(exports,"qr",{enumerable:!0,get:function(){return At}}),Object.defineProperty(exports,"qt",{enumerable:!0,get:function(){return ds}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return md}}),Object.defineProperty(exports,"ra",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"ri",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return Io}}),Object.defineProperty(exports,"rr",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return qc}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return sd}}),Object.defineProperty(exports,"sa",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"si",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return No}}),Object.defineProperty(exports,"sr",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return Rc}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return yd}}),Object.defineProperty(exports,"ta",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"ti",{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,"tn",{enumerable:!0,get:function(){return Bo}}),Object.defineProperty(exports,"tr",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return rl}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return td}}),Object.defineProperty(exports,"ua",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(exports,"ui",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return co}}),Object.defineProperty(exports,"ur",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return Ac}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Ju}}),Object.defineProperty(exports,"va",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"vi",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"vn",{enumerable:!0,get:function(){return Ia}}),Object.defineProperty(exports,"vr",{enumerable:!0,get:function(){return Zn}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return pc}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return Ou}}),Object.defineProperty(exports,"wi",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"wn",{enumerable:!0,get:function(){return Oa}}),Object.defineProperty(exports,"wr",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return ac}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return Iu}}),Object.defineProperty(exports,"xa",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(exports,"xi",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,"xn",{enumerable:!0,get:function(){return ja}}),Object.defineProperty(exports,"xr",{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return gc}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Ku}}),Object.defineProperty(exports,"ya",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"yi",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"yn",{enumerable:!0,get:function(){return Ba}}),Object.defineProperty(exports,"yr",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return mc}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return du}}),Object.defineProperty(exports,"zi",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"zn",{enumerable:!0,get:function(){return mi}}),Object.defineProperty(exports,"zr",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return Ts}});
5
+ //# sourceMappingURL=LinkedRecordFileField-BFYJ7iq4.cjs.map