@attabot/complaint-app 1.0.0 → 1.0.2

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,2 +1,12 @@
1
- (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("react-router-dom"),require("axios"),require("js-cookie")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-router-dom","axios","js-cookie"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.ComplaintApp={},n["react/jsx-runtime"],n.React,n.ReactRouterDOM,n.axios,n.Cookies))})(this,(function(n,e,u,F,se,T){"use strict";var Q=typeof document<"u"?document.currentScript:null;const aa={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let P="";try{if(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Q&&Q.tagName.toUpperCase()==="SCRIPT"&&Q.src||new URL("complaint-app.umd.js",document.baseURI).href}<"u"&&aa?.VITE_API_URL)P=void 0;else{const a=typeof process<"u"?process:null;a?.env?.VITE_API_URL&&(P=a.env.VITE_API_URL)}}catch{}const oe=a=>{P=a||"",j.defaults.baseURL=P},de=a=>{a?T.set("token",a,{secure:!0,sameSite:"Strict"}):T.remove("token")},ra=()=>T.get("token")||null,j=se.create({baseURL:P,transformRequest:[function(a,r){const t=ra();return t?r.Authorization=`Bearer ${t}`:delete r.Authorization,a==null||typeof a=="string"?a:JSON.stringify(a)}],headers:{Accept:"application/json","Content-Type":"application/json"}});let Z=!1,J=null;j.interceptors.response.use(a=>a,async a=>{const r=a.config,t=a.response;if(t&&(t.status===401||t.status===402)){const l=T.get("refreshToken");if(l)try{Z||(Z=!0,J=se.post(`${P}/api/v1/auth/refresh`,{},{headers:{Authorization:`Bearer ${l}`}}));const c=await J,{token:i,refreshToken:h}=c.data;return T.set("token",i,{secure:!0,sameSite:"Strict"}),h&&T.set("refreshToken",h),r.headers.Authorization=`Bearer ${i}`,j(r)}catch{T.remove("token"),T.remove("refreshToken")}finally{Z=!1,J=null}}return Promise.reject(a)});const ta=u.createContext(null),he=({children:a,apiUrl:r,authToken:t})=>(u.useEffect(()=>{r&&oe(r)},[r]),u.useEffect(()=>{de(t||null)},[t]),e.jsx(ta.Provider,{value:{apiUrl:r,authToken:t},children:a})),k={mode:"light",colors:{primary:"#2D64B8",primaryHover:"#2557A3",text:"#111827",textSecondary:"#6B7280",textMuted:"#9CA3AF",border:"#E5E7EB",borderLight:"#F3F4F6",background:"#F5F5F5",surface:"#FFFFFF",white:"#FFFFFF",onPrimary:"#FFFFFF",activeBg:"#ECFDF5",activeBorder:"#A7F3D0",activeText:"#059669",inactiveBg:"#F3F4F6",inactiveBorder:"#D1D5DB",inactiveText:"#6B7280",link:"#2D64B8",divider:"#E5E7EB",accentBorder:"#C5D7F0",accentBg:"#EEF4FB",stepDone:"#D6E4F7",success:"#22C55E",danger:"#EF4444",secondaryBtn:"#D1D5DB",secondaryBtnHover:"#C4C9D1",inputBg:"#FFFFFF",tableHeadBg:"#EEF4FB",sidebarBg:"#FAFBFD",overlay:"rgba(16, 24, 40, 0.06)"},radii:{sm:"6px",md:"8px",lg:"12px",xl:"16px",pill:"999px"},spacing:{xs:"4px",sm:"8px",md:"12px",lg:"16px",xl:"24px",xxl:"32px"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',h1Size:"28px",h2Size:"16px",bodySize:"14px",labelSize:"13px",valueSize:"22px",smallSize:"13px"},shadow:{card:"0 1px 2px rgba(16, 24, 40, 0.04)",settings:"0 1px 3px rgba(16, 24, 40, 0.06)"}},U={mode:"dark",colors:{primary:"#5B8DEF",primaryHover:"#7BA3F3",text:"#F3F4F6",textSecondary:"#A1A1AA",textMuted:"#71717A",border:"#3F3F46",borderLight:"#27272A",background:"#0F1115",surface:"#18181B",white:"#FFFFFF",onPrimary:"#FFFFFF",activeBg:"#052E1C",activeBorder:"#166534",activeText:"#4ADE80",inactiveBg:"#27272A",inactiveBorder:"#3F3F46",inactiveText:"#A1A1AA",link:"#7BA3F3",divider:"#3F3F46",accentBorder:"#2A3A55",accentBg:"#1A2333",stepDone:"#1E3A5F",success:"#22C55E",danger:"#F87171",secondaryBtn:"#3F3F46",secondaryBtnHover:"#52525B",inputBg:"#18181B",tableHeadBg:"#1A2333",sidebarBg:"#12141A",overlay:"rgba(0, 0, 0, 0.35)"},radii:{sm:"6px",md:"8px",lg:"12px",xl:"16px",pill:"999px"},spacing:{xs:"4px",sm:"8px",md:"12px",lg:"16px",xl:"24px",xxl:"32px"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',h1Size:"28px",h2Size:"16px",bodySize:"14px",labelSize:"13px",valueSize:"22px",smallSize:"13px"},shadow:{card:"0 1px 2px rgba(0, 0, 0, 0.35)",settings:"0 1px 3px rgba(0, 0, 0, 0.4)"}},pe={light:k,dark:U};function I(a){return a!=null&&typeof a=="object"&&!Array.isArray(a)}function $(a,r){if(!I(r))return a;const t={...a};return Object.keys(r).forEach(l=>{const c=r[l];I(c)&&I(a[l])?t[l]=$(a[l],c):c!==void 0&&(t[l]=c)}),t}function fe(a){return!a||!I(a)?{light:k,dark:U}:I(a.light)||I(a.dark)?{light:$(k,a.light||{}),dark:$(U,a.dark||{})}:{light:$(k,a),dark:$(U,a)}}function ge(a,r=!1){const t=fe(a);return{...r?t.dark:t.light,mode:r?"dark":"light",__pack:t}}const la={primary:"--ca-primary",primaryHover:"--ca-primary-hover",text:"--ca-text",textSecondary:"--ca-text-secondary",textMuted:"--ca-text-muted",border:"--ca-border",borderLight:"--ca-border-light",background:"--ca-bg",surface:"--ca-surface",white:"--ca-white",onPrimary:"--ca-on-primary",activeBg:"--ca-active-bg",activeBorder:"--ca-active-border",activeText:"--ca-active-text",inactiveBg:"--ca-inactive-bg",inactiveBorder:"--ca-inactive-border",inactiveText:"--ca-inactive-text",link:"--ca-link",divider:"--ca-divider",accentBorder:"--ca-accent-border",accentBg:"--ca-accent-bg",stepDone:"--ca-step-done",success:"--ca-success",danger:"--ca-danger",secondaryBtn:"--ca-secondary-btn",secondaryBtnHover:"--ca-secondary-btn-hover",inputBg:"--ca-input-bg",tableHeadBg:"--ca-table-head-bg",sidebarBg:"--ca-sidebar-bg",overlay:"--ca-overlay"},ca={sm:"--ca-radius-sm",md:"--ca-radius-md",lg:"--ca-radius-lg",xl:"--ca-radius-xl",pill:"--ca-radius-pill"},na={fontFamily:"--ca-font",h1Size:"--ca-h1-size",h2Size:"--ca-h2-size",bodySize:"--ca-body-size",labelSize:"--ca-label-size",valueSize:"--ca-value-size",smallSize:"--ca-small-size"},ia={card:"--ca-shadow-card",settings:"--ca-shadow-settings"};function ue(a){const r={};return a?.colors&&Object.entries(la).forEach(([t,l])=>{a.colors[t]!=null&&(r[l]=a.colors[t])}),a?.radii&&Object.entries(ca).forEach(([t,l])=>{a.radii[t]!=null&&(r[l]=a.radii[t])}),a?.typography&&Object.entries(na).forEach(([t,l])=>{a.typography[t]!=null&&(r[l]=a.typography[t])}),a?.shadow&&Object.entries(ia).forEach(([t,l])=>{a.shadow[t]!=null&&(r[l]=a.shadow[t])}),r["--ca-on-primary"]&&!r["--ca-white"]&&(r["--ca-white"]=r["--ca-on-primary"]),r}const ve=u.createContext({darkMode:!1,theme:null,themeFile:pe,cssVars:{}});function be({theme:a,darkMode:r=!1,children:t}){const l=u.useMemo(()=>{const c=ge(a,!!r),i=ue(c);return{darkMode:!!r,theme:c,themeFile:c.__pack,cssVars:i,mode:c.mode}},[a,r]);return e.jsx(ve.Provider,{value:l,children:t})}function ye(){return u.useContext(ve)}function S({children:a,variant:r="primary",size:t="md",startIcon:l,endIcon:c,className:i="",type:h="button",disabled:o=!1,onClick:p,...g}){const d=["ca-btn",`ca-btn--${r}`,t==="sm"?"ca-btn--sm":"",t==="lg"?"ca-btn--lg":"",i].filter(Boolean).join(" ");return e.jsxs("button",{type:h,className:d,disabled:o,onClick:p,...g,children:[l?e.jsx("span",{className:"ca-btn__icon",children:l}):null,a,c?e.jsx("span",{className:"ca-btn__icon",children:c}):null]})}function X({size:a=16,color:r="currentColor",...t}){return e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...t,children:e.jsx("path",{d:"M12 5v14M5 12h14",stroke:r,strokeWidth:"2",strokeLinecap:"round"})})}const _e={h1:"ca-h1",h2:"ca-h2",body:"ca-body",label:"ca-label",value:"ca-value",small:"ca-small",link:"ca-link"},sa={h1:"h1",h2:"h2",body:"p",label:"span",value:"span",small:"span",link:"button"};function A({variant:a="body",as:r,className:t="",children:l,...c}){const i=r||sa[a]||"p",h=_e[a]||_e.body;return e.jsx(i,{className:`${h} ${t}`.trim(),...c,children:l})}function R(a){return e.jsx(A,{variant:"h1",...a})}function D(a){return e.jsx(A,{variant:"h2",...a})}function w(a){return e.jsx(A,{variant:"body",...a})}function G(a){return e.jsx(A,{variant:"label",...a})}function me(a){return e.jsx(A,{variant:"value",...a})}function Se(a){return e.jsx(A,{variant:"link",type:"button",...a})}function we({title:a="Complaint Management",description:r,actionLabel:t="Create New Form",onAction:l,className:c=""}){return e.jsxs("header",{className:`ca-page-header ${c}`.trim(),children:[e.jsxs("div",{className:"ca-page-header__text",children:[e.jsx(R,{children:a}),r?e.jsx(w,{children:r}):null]}),e.jsx("div",{className:"ca-page-header__actions",children:e.jsx(S,{startIcon:e.jsx(X,{}),onClick:l,children:t})})]})}function ee({status:a="inactive",label:r,className:t=""}){const c=String(a).toLowerCase()==="active",i=r??(c?"Active":"Inactive");return e.jsx("span",{className:`ca-badge ca-badge--${c?"active":"inactive"} ${t}`.trim(),children:i})}function Ne({title:a,status:r,statusLabel:t,titleAsLink:l=!1,onTitleClick:c,className:i=""}){return e.jsxs("div",{className:`ca-system-card__header ${i}`.trim(),children:[e.jsx("div",{className:"ca-system-card__title-wrap",children:l?e.jsx("button",{type:"button",className:"ca-h2 ca-h2--link",onClick:c,children:a}):e.jsx(D,{children:a})}),e.jsx(ee,{status:r,label:t})]})}function V({size:a=16,color:r="currentColor",...t}){return e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...t,children:e.jsx("path",{d:"M9 6l6 6-6 6",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Fe({updatedOn:a,configureLabel:r="Configure",onConfigure:t,className:l=""}){return e.jsxs("div",{className:`ca-system-card__footer ${l}`.trim(),children:[e.jsx(A,{variant:"small",as:"span",children:a?`Updated on ${a}`:""}),e.jsx(S,{size:"sm",onClick:t,endIcon:e.jsx(V,{size:14,color:"#fff"}),children:r})]})}function ke({label:a,value:r,className:t=""}){const l=r==null?"—":typeof r=="number"?String(r).padStart(2,"0"):r;return e.jsxs("div",{className:`ca-data-point ${t}`.trim(),children:[e.jsx(G,{children:a}),e.jsx(me,{children:l})]})}function Ce({className:a=""}){return e.jsx("div",{className:`ca-divider ${a}`.trim(),role:"separator","aria-orientation":"vertical"})}function Te({id:a,title:r,status:t="inactive",statusLabel:l,description:c,descriptionHref:i,departments:h,workflows:o,fields:p,formsFilled:g,updatedOn:d,titleAsLink:s=!1,onTitleClick:f,onDescriptionClick:b,onConfigure:v,className:y=""}){const _=()=>{v?.({id:a,title:r,status:t,departments:h,workflows:o,fields:p,formsFilled:g,updatedOn:d})},z=()=>{if(b){b({id:a,title:r,descriptionHref:i});return}i&&typeof window<"u"&&window.open(i,"_blank","noopener,noreferrer")},H=[{label:"Departments",value:h},{label:"Workflows",value:o},{label:"Fields",value:p},{label:"Forms Filled",value:g}];return e.jsxs("article",{className:`ca-system-card ${y}`.trim(),children:[e.jsx(Ne,{title:r,status:t,statusLabel:l,titleAsLink:s,onTitleClick:()=>f?.({id:a,title:r})}),c?e.jsx(Se,{onClick:z,children:c}):null,e.jsx("div",{className:"ca-system-card__stats",children:H.map((C,q)=>e.jsxs(u.Fragment,{children:[q>0?e.jsx(Ce,{}):null,e.jsx(ke,{label:C.label,value:C.value})]},C.label))}),e.jsx(Fe,{updatedOn:d,onConfigure:_})]})}function Ae({systems:a=[],onConfigure:r,onTitleClick:t,onDescriptionClick:l,emptyMessage:c="No systems found.",className:i=""}){return a.length?e.jsx("div",{className:`ca-system-grid ${i}`.trim(),children:a.map(h=>e.jsx(Te,{...h,onConfigure:r,onTitleClick:t,onDescriptionClick:l},h.id??h.title))}):e.jsx("div",{className:`ca-system-grid ${i}`.trim(),children:e.jsx("div",{className:"ca-empty",children:e.jsx(w,{children:c})})})}function B({value:a,onChange:r,placeholder:t,type:l="text",icon:c,className:i="",inputClassName:h="",...o}){return e.jsxs("div",{className:`ca-input-wrap ${i}`.trim(),children:[c?e.jsx("span",{className:"ca-input-wrap__icon",children:c}):null,e.jsx("input",{type:l,className:`ca-input ${c?"ca-input--with-icon":""} ${h}`.trim(),value:a,onChange:r,placeholder:t,...o})]})}function De({size:a=18,color:r="currentColor",...t}){return e.jsxs("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...t,children:[e.jsx("path",{d:"M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15Z",stroke:r,strokeWidth:"1.75"}),e.jsx("path",{d:"M16.5 16.5 21 21",stroke:r,strokeWidth:"1.75",strokeLinecap:"round"})]})}function Be({value:a,onChange:r,onSearch:t,placeholder:l="Search",className:c=""}){const i=h=>{h.key==="Enter"&&t&&t(a)};return e.jsx("div",{className:`ca-search ${c}`.trim(),children:e.jsx(B,{value:a,onChange:r,onKeyDown:i,placeholder:l,icon:e.jsx(De,{}),"aria-label":l})})}function Ee({text:a="Loading",fullScreen:r=!1}){return e.jsxs("div",{className:"ca-loading",style:r?{minHeight:"calc(100vh - 80px)"}:void 0,role:"status","aria-live":"polite",children:[e.jsx("span",{className:"ca-loading__spinner"}),e.jsxs("span",{children:[a,"…"]})]})}const Me=[{id:"qms",title:"QMS - Query Management System",status:"active",description:"Description of the template",departments:3,workflows:12,fields:55,formsFilled:234,updatedOn:"12 Mar 2024",titleAsLink:!0},{id:"cms",title:"CMS - Complaint Management System",status:"active",description:"Description of the template",departments:5,workflows:8,fields:42,formsFilled:189,updatedOn:"08 Mar 2024"},{id:"fms",title:"FMS - Feedback Management System",status:"inactive",description:"Description of the template",departments:2,workflows:4,fields:28,formsFilled:56,updatedOn:"01 Feb 2024"},{id:"rms",title:"RMS - Request Management System",status:"active",description:"Description of the template",departments:4,workflows:10,fields:61,formsFilled:312,updatedOn:"20 Mar 2024"}],xe="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.";function Le(a=[]){return a.map((r,t)=>({id:r.id??r._id??`system-${t}`,title:r.title??r.name??"Untitled",status:r.status??"inactive",statusLabel:r.statusLabel,description:r.description??r.templateDescription,descriptionHref:r.descriptionHref??r.url,departments:r.departments??r.departmentCount??0,workflows:r.workflows??r.workflowCount??0,fields:r.fields??r.fieldCount??0,formsFilled:r.formsFilled??r.formFilledCount??r.forms_filled??0,updatedOn:r.updatedOn??r.updatedAt??r.updated_on,titleAsLink:!!(r.titleAsLink??r.isLink)}))}function ae({title:a="Complaint Management",description:r=xe,systems:t,systemsEndpoint:l,useDemoData:c=!0,createLabel:i="Create New Form",onCreateForm:h,onConfigure:o,onTitleClick:p,onDescriptionClick:g,onSearch:d}){const s=F.useNavigate(),[f,b]=u.useState(""),[v,y]=u.useState(null),[_,z]=u.useState(null),[H,C]=u.useState(l&&!t?"loading":"idle");u.useEffect(()=>{if(!l||t)return;const m=new AbortController;return j.get(l,{signal:m.signal}).then(N=>{const W=N?.data,xa=Array.isArray(W)?W:W?.data??W?.systems??W?.results??[];y(Le(xa)),z(null),C("success")}).catch(N=>{m.signal.aborted||(z(N?.message||"Failed to load systems"),y([]),C("error"))}),()=>m.abort()},[l,t]);const q=u.useMemo(()=>t?Le(t):v||(c?Me:[]),[t,v,c]),Da=u.useMemo(()=>{const m=f.trim().toLowerCase();return m?q.filter(N=>`${N.title} ${N.description??""} ${N.status??""}`.toLowerCase().includes(m)):q},[q,f]),Ba=m=>{const N=m.target.value;b(N),d?.(N)},Ea=m=>{o?.(m),s(`/settings/${m.id??"new"}?step=1`)},Ma=H==="loading";return e.jsxs(e.Fragment,{children:[e.jsx(we,{title:a,description:r,actionLabel:i,onAction:h}),e.jsx(Be,{value:f,onChange:Ba,placeholder:"Search"}),Ma?e.jsx(Ee,{text:"Loading systems"}):_?e.jsx("div",{className:"ca-empty",children:e.jsx("p",{className:"ca-body",children:_})}):e.jsx(Ae,{systems:Da,onConfigure:Ea,onTitleClick:p,onDescriptionClick:g,emptyMessage:f?"No systems match your search.":"No systems found."})]})}function re({steps:a=[],currentStep:r=1,onStepClick:t,className:l="",size:c="md"}){return e.jsx("nav",{className:`ca-stepper ca-stepper--${c} ${l}`.trim(),"aria-label":"Progress",children:a.map((i,h)=>{const o=i.id??h+1,p=o===r,g=o<r,d=!!t&&(g||p);return e.jsxs(u.Fragment,{children:[h>0?e.jsx("div",{className:`ca-stepper__line ${g||p?"ca-stepper__line--active":""}`}):null,e.jsxs("button",{type:"button",className:["ca-stepper__item",p?"ca-stepper__item--active":"",g?"ca-stepper__item--done":""].filter(Boolean).join(" "),onClick:()=>d&&t?.(o),disabled:!d,"aria-current":p?"step":void 0,children:[e.jsx("span",{className:"ca-stepper__circle",children:o}),e.jsx("span",{className:"ca-stepper__label",children:i.label})]})]},o)})})}const Pe=u.createContext(null),oa={categoryType:"qms",active:!0,description:"",roles:["Store Staff","HR Executive","HR Manager"],departmentRows:[{id:"1",department:"",subDepartment:"",roles:""}],priorityDraft:"",priorities:[],defaultPriorityId:null,selectedDeptNode:"payroll",workflow:{name:"",tatMinutes:"",description:"",statuses:[],steps:[]},fieldDraft:{name:"",type:""},formFields:[]};function Ie({children:a,initialValues:r}){const[t,l]=u.useState({...oa,...r}),c=u.useCallback(o=>{l(p=>({...p,...o}))},[]),i=u.useCallback(o=>{l(p=>({...p,workflow:{...p.workflow,...o}}))},[]),h=u.useMemo(()=>({state:t,setState:l,update:c,updateWorkflow:i}),[t,c,i]);return e.jsx(Pe.Provider,{value:h,children:a})}function M(){const a=u.useContext(Pe);if(!a)throw new Error("useSettingsWizard must be used within SettingsWizardProvider");return a}const x=[{id:1,key:"category",label:"Category Type",title:"Category Type",description:"Define the type and basic details for this category type."},{id:2,key:"departments",label:"Departments",title:"Departments",description:"----"},{id:3,key:"priorities",label:"Priorities",title:"Priorities",description:"----"},{id:4,key:"workflow",label:"Workflow",title:"Workflow",description:"----"},{id:5,key:"formFields",label:"Form Fields",title:"Form Fields",description:"----"},{id:6,key:"review",label:"Review & Publish",title:"Review & Publish",description:"Review your configuration and publish."}],te=[{id:1,label:"Create Workflow"},{id:2,label:"Statuses"},{id:3,label:"Workflow Steps"}],da=["Urgent","High","Medium","Low"],$e=[{id:"short",label:"Textfield / Short Answer",icon:"text"},{id:"long",label:"Description / Long Answer",icon:"doc"},{id:"date",label:"Date",icon:"calendar"},{id:"time",label:"Time",icon:"clock"},{id:"single",label:"Dropdown - Single Select",icon:"chevron"},{id:"multi",label:"Dropdown - Multiple Select",icon:"chevron"}],Oe=["Store Staff","HR Executive","HR Manager","Store Manager","Admin"],ze=[{value:"qms",label:"QMS - Query Management System"},{value:"cms",label:"CMS - Complaint Management System"},{value:"fms",label:"FMS - Feedback Management System"},{value:"rms",label:"RMS - Request Management System"}],ha=[{id:"hr",name:"HR",children:[{id:"payroll",name:"Payroll"},{id:"recruitment",name:"Recruitment"}]},{id:"finance",name:"Finance",children:[{id:"ap",name:"Accounts Payable"}]},{id:"it",name:"IT",children:[]}],pa=[{value:"#EF4444",label:"Red"},{value:"#F59E0B",label:"Orange"},{value:"#EAB308",label:"Yellow"},{value:"#22C55E",label:"Green"},{value:"#3B82F6",label:"Blue"},{value:"#8B5CF6",label:"Purple"}];function He({size:a=28,color:r="currentColor",...t}){return e.jsxs("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{color:"var(--ca-primary)"},...t,children:[e.jsx("path",{d:"M12 3 3 8l9 5 9-5-9-5Z",stroke:r,strokeWidth:"1.6",strokeLinejoin:"round"}),e.jsx("path",{d:"M3 12.5 12 17.5l9-5",stroke:r,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"}),e.jsx("path",{d:"M3 16.5 12 21.5l9-5",stroke:r,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"})]})}function We({title:a,description:r,nextLabel:t="Next",onNext:l,showNext:c=!0,nextDisabled:i=!1,nextVariant:h="primary",className:o=""}){return e.jsxs("div",{className:`ca-settings-card__header ${o}`.trim(),children:[e.jsxs("div",{className:"ca-settings-card__heading",children:[e.jsx(He,{}),e.jsxs("div",{children:[e.jsx(D,{children:a}),r?e.jsx(w,{className:"ca-settings-card__desc",children:r}):null]})]}),c?e.jsx(S,{variant:h,disabled:i,onClick:l,endIcon:e.jsx(V,{size:14,color:"currentColor"}),children:t}):null]})}function L({title:a,description:r,onNext:t,nextLabel:l,showNext:c=!0,nextDisabled:i,nextVariant:h,children:o,footer:p,className:g=""}){return e.jsxs("section",{className:`ca-settings-card ${g}`.trim(),children:[e.jsx(We,{title:a,description:r,onNext:t,nextLabel:l,showNext:c,nextDisabled:i,nextVariant:h}),e.jsx("div",{className:"ca-settings-card__divider"}),e.jsx("div",{className:"ca-settings-card__body",children:o}),p?e.jsx("div",{className:"ca-settings-card__footer",children:p}):null]})}function O({children:a,hint:r,htmlFor:t,className:l=""}){return e.jsxs("div",{className:`ca-field-label ${l}`.trim(),children:[e.jsx("label",{className:"ca-label",htmlFor:t,children:a}),r!=null?e.jsx("span",{className:"ca-field-label__hint",children:r}):null]})}function je({size:a=16,color:r="currentColor",...t}){return e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...t,children:e.jsx("path",{d:"M6 9l6 6 6-6",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function E({value:a,onChange:r,options:t=[],placeholder:l="Select",className:c="",disabled:i=!1,...h}){return e.jsxs("div",{className:`ca-select ${c}`.trim(),children:[e.jsxs("select",{className:"ca-select__control",value:a??"",onChange:r,disabled:i,...h,children:[e.jsx("option",{value:"",disabled:!0,children:l}),t.map(o=>{const p=typeof o=="string"?o:o.value,g=typeof o=="string"?o:o.label;return e.jsx("option",{value:p,children:g},p)})]}),e.jsx("span",{className:"ca-select__chevron",children:e.jsx(je,{size:16})})]})}function Ue({value:a,onChange:r,placeholder:t,maxLength:l,rows:c=4,className:i="",...h}){return e.jsx("textarea",{className:`ca-textarea ${i}`.trim(),value:a,onChange:r,placeholder:t,maxLength:l,rows:c,...h})}function Y({label:a,hint:r,children:t,className:l="",htmlFor:c}){return e.jsxs("div",{className:`ca-form-field ${l}`.trim(),children:[a!=null?e.jsx(O,{htmlFor:c,hint:r,children:a}):null,t]})}function le({label:a,hint:r,...t}){return e.jsx(Y,{label:a,hint:r,htmlFor:t.id,children:e.jsx(B,{...t})})}function Ve({label:a,hint:r,...t}){return e.jsx(Y,{label:a,hint:r,htmlFor:t.id,children:e.jsx(E,{...t})})}function ce({label:a,hint:r,maxLength:t,value:l="",...c}){const i=r??(t!=null?`${String(l).length}/${t}`:void 0);return e.jsx(Y,{label:a,hint:i,htmlFor:c.id,children:e.jsx(Ue,{value:l,maxLength:t,...c})})}function ne({checked:a=!1,onChange:r,disabled:t=!1,"aria-label":l="Toggle",className:c=""}){return e.jsx("button",{type:"button",role:"switch","aria-checked":a,"aria-label":l,disabled:t,className:`ca-toggle ${a?"ca-toggle--on":""} ${c}`.trim(),onClick:()=>r?.(!a),children:e.jsx("span",{className:"ca-toggle__thumb"})})}function qe({label:a="Active",checked:r,onChange:t,className:l=""}){return e.jsxs("div",{className:`ca-toggle-field ${l}`.trim(),children:[e.jsx(G,{children:a}),e.jsx(ne,{checked:r,onChange:t,"aria-label":a})]})}function Ge({size:a=12,color:r="currentColor",...t}){return e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...t,children:e.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:r,strokeWidth:"2",strokeLinecap:"round"})})}function Ye({label:a,onRemove:r,className:t=""}){return e.jsxs("span",{className:`ca-tag ${t}`.trim(),children:[a,r?e.jsx("button",{type:"button",className:"ca-tag__remove",onClick:r,"aria-label":`Remove ${a}`,children:e.jsx(Ge,{size:10})}):null]})}function Ke({label:a="Select Roles",options:r=[],value:t=[],onChange:l,placeholder:c="Select roles",className:i=""}){const[h,o]=u.useState(""),p=r.filter(s=>{const f=typeof s=="string"?s:s.value;return!t.includes(f)}),g=s=>{const f=s.target.value;f&&(l?.([...t,f]),o(""))},d=s=>{l?.(t.filter(f=>f!==s))};return e.jsxs("div",{className:`ca-role-select ${i}`.trim(),children:[e.jsx(O,{children:a}),e.jsx(E,{value:h,onChange:g,options:p,placeholder:c}),t.length>0?e.jsx("div",{className:"ca-tag-list",children:t.map(s=>e.jsx(Ye,{label:s,onRemove:()=>d(s)},s))}):null]})}function fa({onNext:a,stepMeta:r}){const{state:t,update:l}=M();return e.jsxs(L,{title:r.title,description:r.description,onNext:a,children:[e.jsx("div",{className:"ca-step-section",children:e.jsxs("div",{className:"ca-step-row ca-step-row--category",children:[e.jsx(Ve,{label:"Category Type",className:"ca-step-row__grow",value:t.categoryType,onChange:c=>l({categoryType:c.target.value}),options:ze,placeholder:"Select category type"}),e.jsx(qe,{checked:t.active,onChange:c=>l({active:c})})]})}),e.jsx("div",{className:"ca-step-section",children:e.jsx(ce,{label:"Description",placeholder:"Enter description",maxLength:500,value:t.description,onChange:c=>l({description:c.target.value}),rows:5})}),e.jsx("div",{className:"ca-step-section ca-step-section--last",children:e.jsx(Ke,{options:Oe,value:t.roles,onChange:c=>l({roles:c})})})]})}const ga=["HR","Finance","IT","Operations","Sales"];function ua(){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,department:"",subDepartment:"",roles:""}}function va({onNext:a,stepMeta:r}){const{state:t,update:l}=M(),c=t.departmentRows,i=(o,p)=>{l({departmentRows:c.map(g=>g.id===o?{...g,...p}:g)})},h=()=>{l({departmentRows:[...c,ua()]})};return e.jsx(L,{title:r.title,description:r.description,onNext:a,children:e.jsxs("div",{className:"ca-dept-table",children:[e.jsxs("div",{className:"ca-dept-table__head",children:[e.jsx("div",{children:"Department"}),e.jsx("div",{children:"Sub-department"}),e.jsx("div",{children:"Roles"}),e.jsx("div",{})]}),c.map(o=>e.jsxs("div",{className:"ca-dept-table__row",children:[e.jsx(E,{value:o.department,onChange:p=>i(o.id,{department:p.target.value}),options:ga,placeholder:"Select or add department"}),e.jsxs("div",{className:"ca-input-with-action",children:[e.jsx(B,{value:o.subDepartment,onChange:p=>i(o.id,{subDepartment:p.target.value}),placeholder:"Add sub-department"}),e.jsx("button",{type:"button",className:"ca-input-with-action__btn","aria-label":"Add sub-department",onClick:()=>{o.subDepartment.trim()},children:e.jsx(X,{size:14,color:"currentColor"})})]}),e.jsx(E,{value:o.roles,onChange:p=>i(o.id,{roles:p.target.value}),options:Oe,placeholder:"Select roles"}),e.jsx(S,{variant:"link",size:"sm",onClick:h,children:"+ Add"})]},o.id))]})})}function Qe({children:a,onClick:r,className:t="",active:l=!1}){return e.jsx("button",{type:"button",className:`ca-chip ${l?"ca-chip--active":""} ${t}`.trim(),onClick:r,children:a})}function Ze({checked:a=!1,onChange:r,name:t,value:l,"aria-label":c,className:i=""}){return e.jsxs("label",{className:`ca-radio ${i}`.trim(),children:[e.jsx("input",{type:"radio",className:"ca-radio__input",name:t,value:l,checked:a,onChange:r,"aria-label":c}),e.jsx("span",{className:"ca-radio__mark"})]})}function ie({size:a=16,color:r="#9CA3AF",...t}){return e.jsxs("svg",{width:a,height:a,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...t,children:[e.jsx("circle",{cx:"5",cy:"4",r:"1.2",fill:r}),e.jsx("circle",{cx:"11",cy:"4",r:"1.2",fill:r}),e.jsx("circle",{cx:"5",cy:"8",r:"1.2",fill:r}),e.jsx("circle",{cx:"11",cy:"8",r:"1.2",fill:r}),e.jsx("circle",{cx:"5",cy:"12",r:"1.2",fill:r}),e.jsx("circle",{cx:"11",cy:"12",r:"1.2",fill:r})]})}function Je(a){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,name:a,color:""}}function ba({onNext:a,stepMeta:r}){const{state:t,update:l}=M(),{priorityDraft:c,priorities:i,defaultPriorityId:h}=t,o=d=>{const s=(d??c).trim();if(!s)return;if(i.some(b=>b.name.toLowerCase()===s.toLowerCase())){l({priorityDraft:""});return}const f=[...i,Je(s)];l({priorities:f,priorityDraft:"",defaultPriorityId:h??f[0].id})},p=(d,s)=>{l({priorities:i.map(f=>f.id===d?{...f,...s}:f)})},g=pa.map(d=>({value:d.value,label:d.label}));return e.jsxs(L,{title:r.title,description:r.description,onNext:a,children:[e.jsxs("div",{className:"ca-priority-add",children:[e.jsx(O,{children:"Priorities"}),e.jsxs("div",{className:"ca-priority-add__row",children:[e.jsx(B,{value:c,onChange:d=>l({priorityDraft:d.target.value}),placeholder:"Add priority",onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),o())}}),e.jsx(S,{variant:"outline",onClick:()=>o(),children:"+ Add"})]}),e.jsx("div",{className:"ca-chip-row",children:da.map(d=>e.jsxs(Qe,{onClick:()=>o(d),children:["+ ",d]},d))})]}),e.jsxs("div",{className:"ca-priority-table",children:[e.jsxs("div",{className:"ca-priority-table__head",children:[e.jsx("div",{children:"Priority"}),e.jsx("div",{children:"Color"}),e.jsx("div",{children:"Default"})]}),(i.length?i:[Je("")]).map((d,s)=>{const f=!i.length;return e.jsxs("div",{className:"ca-priority-table__row",children:[e.jsxs("div",{className:"ca-priority-table__name",children:[e.jsx(ie,{}),e.jsx(B,{value:f?c:d.name,onChange:b=>{f?l({priorityDraft:b.target.value}):p(d.id,{name:b.target.value})},placeholder:"Add priority"})]}),e.jsx(E,{value:d.color,onChange:b=>{f||p(d.id,{color:b.target.value})},options:g,placeholder:"Select color"}),e.jsx(Ze,{name:"default-priority",value:d.id,checked:!f&&h===d.id,onChange:()=>!f&&l({defaultPriorityId:d.id}),"aria-label":"Default priority"})]},d.id||s)})]})]})}function ya({onNext:a,stepMeta:r,substep:t=1,onSubstepChange:l}){const{state:c,update:i,updateWorkflow:h}=M(),{selectedDeptNode:o,workflow:p}=c,g=()=>{if(t<te.length){l?.(t+1);return}a?.()};return e.jsx(L,{title:r.title,description:r.description,onNext:a,nextVariant:"secondary",children:e.jsxs("div",{className:"ca-workflow",children:[e.jsxs("aside",{className:"ca-workflow__sidebar",children:[e.jsx("h3",{className:"ca-workflow__sidebar-title",children:"Select Department"}),e.jsx("p",{className:"ca-small",children:"Add workflow for selected department"}),e.jsx("ul",{className:"ca-dept-tree",children:ha.map(d=>e.jsxs("li",{className:"ca-dept-tree__group",children:[e.jsx("button",{type:"button",className:`ca-dept-tree__item ${o===d.id?"ca-dept-tree__item--active":""}`,onClick:()=>i({selectedDeptNode:d.id}),children:d.name}),d.children?.length?e.jsx("ul",{className:"ca-dept-tree__children",children:d.children.map(s=>e.jsx("li",{children:e.jsxs("button",{type:"button",className:`ca-dept-tree__item ca-dept-tree__item--child ${o===s.id?"ca-dept-tree__item--active":""}`,onClick:()=>i({selectedDeptNode:s.id}),children:[e.jsx("span",{className:"ca-dept-tree__branch","aria-hidden":"true",children:"└"}),s.name]})},s.id))}):null]},d.id))})]}),e.jsxs("div",{className:"ca-workflow__main",children:[e.jsx(re,{steps:te,currentStep:t,onStepClick:l,size:"sm",className:"ca-workflow__substepper"}),t===1?e.jsxs("div",{className:"ca-workflow__form",children:[e.jsxs("div",{className:"ca-step-row",children:[e.jsx(le,{className:"ca-step-row__grow",label:"Name",placeholder:"Enter name",value:p.name,onChange:d=>h({name:d.target.value})}),e.jsx(le,{className:"ca-step-row__grow",label:"TAT Minutes",placeholder:"Enter here",value:p.tatMinutes,onChange:d=>h({tatMinutes:d.target.value})})]}),e.jsx(ce,{label:"Description",placeholder:"Enter description",value:p.description,onChange:d=>h({description:d.target.value}),rows:5})]}):null,t===2?e.jsx("div",{className:"ca-workflow__placeholder",children:e.jsx("p",{className:"ca-body",children:"Configure workflow statuses for the selected department."})}):null,t===3?e.jsx("div",{className:"ca-workflow__placeholder",children:e.jsx("p",{className:"ca-body",children:"Define ordered workflow steps and assignees."})}):null,e.jsx("div",{className:"ca-workflow__actions",children:e.jsx(S,{onClick:g,endIcon:e.jsx(V,{size:14,color:"#fff"}),children:"Next Step"})})]})]})})}function Xe({size:a=16,color:r="#9CA3AF",...t}){return e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...t,children:e.jsx("path",{d:"M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2m2 0v12a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V7h12Z",stroke:r,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}const K=$e.map(a=>({value:a.id,label:a.label}));function _a({type:a}){const r={text:"A",doc:"¶",calendar:"口",clock:"◷",chevron:"▾"};return e.jsx("span",{className:"ca-field-lib__glyph",children:r[a]||"▾"})}function ma({onNext:a,stepMeta:r}){const{state:t,update:l}=M(),{fieldDraft:c,formFields:i}=t,h=s=>l({fieldDraft:{...c,...s}}),o=()=>{if(!c.name.trim()||!c.type)return;const s=K.find(f=>f.value===c.type)?.label||c.type;l({formFields:[...i,{id:`${Date.now()}`,name:c.name.trim(),type:c.type,typeLabel:s,required:!1}],fieldDraft:{name:"",type:""}})},p=(s,f)=>{l({formFields:i.map(b=>b.id===s?{...b,...f}:b)})},g=s=>{l({formFields:i.filter(f=>f.id!==s)})},d=s=>{h({type:s.id})};return e.jsx(L,{title:r.title,description:r.description,showNext:!1,footer:e.jsx(S,{onClick:a,endIcon:e.jsx(V,{size:14,color:"#fff"}),children:"Next"}),children:e.jsxs("div",{className:"ca-form-fields",children:[e.jsxs("aside",{className:"ca-field-lib",children:[e.jsx("h3",{className:"ca-field-lib__title",children:"Field Library"}),e.jsx("p",{className:"ca-small",children:"Drag and drop the fields to add."}),e.jsx("ul",{className:"ca-field-lib__list",children:$e.map(s=>e.jsx("li",{children:e.jsxs("button",{type:"button",className:"ca-field-lib__item",draggable:!0,onDragStart:f=>{f.dataTransfer.setData("text/plain",s.id)},onClick:()=>d(s),children:[e.jsx(_a,{type:s.icon}),e.jsx("span",{children:s.label})]})},s.id))})]}),e.jsxs("div",{className:"ca-form-fields__main",children:[e.jsxs("div",{className:"ca-add-fields",onDragOver:s=>s.preventDefault(),onDrop:s=>{s.preventDefault();const f=s.dataTransfer.getData("text/plain");f&&h({type:f})},children:[e.jsxs("div",{className:"ca-add-fields__top",children:[e.jsx("h3",{className:"ca-add-fields__title",children:"Add Fields"}),e.jsx(S,{onClick:o,children:"Add Field"})]}),e.jsxs("div",{className:"ca-step-row",children:[e.jsxs("div",{className:"ca-step-row__grow",children:[e.jsx(O,{children:"Name of Field"}),e.jsx(B,{value:c.name,onChange:s=>h({name:s.target.value}),placeholder:"Enter name of the field."})]}),e.jsxs("div",{className:"ca-step-row__grow",children:[e.jsx(O,{children:"Type of Field"}),e.jsx(E,{value:c.type,onChange:s=>h({type:s.target.value}),options:K,placeholder:"Select type of the field."})]})]})]}),e.jsxs("div",{className:"ca-fields-table",children:[e.jsxs("div",{className:"ca-fields-table__head",children:[e.jsx("div",{children:"Field Name"}),e.jsx("div",{children:"Field Type"}),e.jsx("div",{children:"Required"}),e.jsx("div",{})]}),i.length===0?e.jsx("div",{className:"ca-fields-table__empty",children:e.jsx("p",{className:"ca-small",children:"No fields added yet."})}):i.map(s=>e.jsxs("div",{className:"ca-fields-table__row",children:[e.jsxs("div",{className:"ca-fields-table__name",children:[e.jsx(ie,{}),e.jsx(B,{value:s.name,onChange:f=>p(s.id,{name:f.target.value})})]}),e.jsx(E,{value:s.type,onChange:f=>{const b=f.target.value,v=K.find(y=>y.value===b)?.label||b;p(s.id,{type:b,typeLabel:v})},options:K,placeholder:"Select type"}),e.jsx(ne,{checked:s.required,onChange:f=>p(s.id,{required:f}),"aria-label":"Required"}),e.jsx("button",{type:"button",className:"ca-icon-btn","aria-label":"Delete field",onClick:()=>g(s.id),children:e.jsx(Xe,{})})]},s.id))]})]})]})})}function Sa({onPublish:a,stepMeta:r}){const{state:t}=M(),l=ze.find(c=>c.value===t.categoryType)?.label||t.categoryType;return e.jsx(L,{title:r.title,description:r.description,nextLabel:"Publish",onNext:a,children:e.jsxs("div",{className:"ca-review",children:[e.jsxs("section",{className:"ca-review__block",children:[e.jsx(D,{children:"Category Type"}),e.jsxs("div",{className:"ca-review__row",children:[e.jsx(G,{children:l}),e.jsx(ee,{status:t.active?"active":"inactive"})]}),t.description?e.jsx(w,{children:t.description}):null,t.roles.length?e.jsxs(w,{children:["Roles: ",t.roles.join(", ")]}):null]}),e.jsxs("section",{className:"ca-review__block",children:[e.jsx(D,{children:"Departments"}),e.jsxs(w,{children:[t.departmentRows.filter(c=>c.department).length," department row(s) configured"]})]}),e.jsxs("section",{className:"ca-review__block",children:[e.jsx(D,{children:"Priorities"}),e.jsx(w,{children:t.priorities.length?t.priorities.map(c=>c.name).join(", "):"No priorities added"})]}),e.jsxs("section",{className:"ca-review__block",children:[e.jsx(D,{children:"Workflow"}),e.jsx(w,{children:t.workflow.name?`${t.workflow.name} (TAT: ${t.workflow.tatMinutes||"—"} min)`:"No workflow created yet"})]}),e.jsxs("section",{className:"ca-review__block ca-review__block--last",children:[e.jsx(D,{children:"Form Fields"}),e.jsx(w,{children:t.formFields.length?t.formFields.map(c=>c.name).join(", "):"No form fields added"})]}),e.jsx("div",{className:"ca-workflow__actions",children:e.jsx(S,{onClick:a,children:"Publish"})})]})})}function wa(a){const r=Number(a);return!Number.isFinite(r)||r<1?1:r>x.length?x.length:Math.floor(r)}function Na(a){const r=Number(a);return!Number.isFinite(r)||r<1?1:r>3?3:Math.floor(r)}function Re({title:a="Complaint Management Settings",onPublish:r,onStepChange:t}){const l=F.useNavigate(),{systemId:c}=F.useParams(),[i,h]=F.useSearchParams(),o=wa(i.get("step")||1),p=Na(i.get("substep")||1);u.useEffect(()=>{if(!i.get("step")){const v=new URLSearchParams(i);v.set("step","1"),h(v,{replace:!0})}},[i,h]);const g=u.useMemo(()=>x.find(v=>v.id===o)||x[0],[o]),d=u.useCallback((v,y)=>{const _=new URLSearchParams(i);_.set("step",String(v)),v===4?_.set("substep",String(y??(v===o?p:1))):_.delete("substep"),h(_,{replace:!1}),t?.({systemId:c,step:v,substep:y})},[i,h,t,c,o,p]),s=()=>{o<x.length&&d(o+1,1)},f=v=>{d(4,v)},b=()=>{r?.({systemId:c,step:o})};return e.jsx(Ie,{children:e.jsxs("div",{className:"ca-settings-page",children:[e.jsx(R,{children:a}),e.jsx(re,{steps:x,currentStep:o,onStepClick:v=>d(v,v===4?1:void 0),className:"ca-settings-page__stepper"}),o===1?e.jsx(fa,{onNext:s,stepMeta:g}):null,o===2?e.jsx(va,{onNext:s,stepMeta:g}):null,o===3?e.jsx(ba,{onNext:s,stepMeta:g}):null,o===4?e.jsx(ya,{onNext:s,stepMeta:g,substep:p,onSubstepChange:f}):null,o===5?e.jsx(ma,{onNext:s,stepMeta:g}):null,o===6?e.jsx(Sa,{onPublish:b,stepMeta:g}):null,e.jsx("button",{type:"button",className:"ca-back-link",onClick:()=>l("/"),children:"← Back to Complaint Management"})]})})}function Fa({children:a}){const{cssVars:r,darkMode:t,mode:l}=ye();return e.jsx("div",{className:`ca-root ${t?"ca-root--dark":"ca-root--light"}`,"data-ca-theme":l,style:r,children:a})}const ea=({apiUrl:a,authToken:r,basePath:t="/",theme:l,darkMode:c=!1,title:i,description:h,systems:o,systemsEndpoint:p,useDemoData:g=!0,createLabel:d,onCreateForm:s,onConfigure:f,onTitleClick:b,onDescriptionClick:v,onSearch:y,onPublish:_,onStepChange:z,children:H})=>{const C={title:i,description:h,systems:o,systemsEndpoint:p,useDemoData:g,createLabel:d,onCreateForm:s,onConfigure:f,onTitleClick:b,onDescriptionClick:v,onSearch:y};return e.jsx(be,{theme:l,darkMode:c,children:e.jsx(Fa,{children:e.jsx(he,{apiUrl:a,authToken:r,children:e.jsx(F.BrowserRouter,{basename:t,children:e.jsxs(F.Routes,{children:[e.jsx(F.Route,{path:"/",element:H??e.jsx(ae,{...C})}),e.jsx(F.Route,{path:"/settings/:systemId",element:e.jsx(Re,{onPublish:_,onStepChange:z})}),e.jsx(F.Route,{path:"*",element:H??e.jsx(ae,{...C})})]})})})})})},ka=k.colors,Ca=k.radii,Ta=k.spacing,Aa=k.typography;n.ApiProvider=he,n.BodyText=w,n.Button=S,n.CardFooter=Fe,n.CardHeader=Ne,n.ChevronDownIcon=je,n.ChevronRightIcon=V,n.Chip=Qe,n.CloseIcon=Ge,n.ComplaintApp=ea,n.ComplaintManagementPage=ae,n.ComplaintSettingsPage=Re,n.DEFAULT_PAGE_DESCRIPTION=xe,n.DEMO_SYSTEMS=Me,n.DataPoint=ke,n.Divider=Ce,n.DragHandleIcon=ie,n.FieldLabel=O,n.FormField=Y,n.FormInput=le,n.FormSelect=Ve,n.FormTextarea=ce,n.Heading1=R,n.Heading2=D,n.Input=B,n.LabelText=G,n.LayersIcon=He,n.LinkText=Se,n.Loading=Ee,n.PageHeader=we,n.PlusIcon=X,n.Radio=Ze,n.RoleMultiSelect=Ke,n.SETTINGS_STEPS=x,n.SearchBar=Be,n.SearchIcon=De,n.Select=E,n.SettingsCard=L,n.SettingsCardHeader=We,n.SettingsWizardProvider=Ie,n.StatusBadge=ee,n.Stepper=re,n.SystemCard=Te,n.SystemCardGrid=Ae,n.Tag=Ye,n.Textarea=Ue,n.ThemeProvider=be,n.Toggle=ne,n.ToggleField=qe,n.TrashIcon=Xe,n.Typography=A,n.ValueText=me,n.WORKFLOW_SUBSTEPS=te,n.api=j,n.colors=ka,n.darkTheme=U,n.deepMerge=$,n.default=ea,n.defaultThemeFile=pe,n.lightTheme=k,n.normalizeThemeFile=fe,n.radii=Ca,n.resolveActiveTheme=ge,n.setAuthToken=de,n.setBaseUrl=oe,n.spacing=Ta,n.themeToCssVars=ue,n.typography=Aa,n.useSettingsWizard=M,n.useTheme=ye,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(g,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-redux"),require("@reduxjs/toolkit")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom","react-redux","@reduxjs/toolkit"],l):(g=typeof globalThis<"u"?globalThis:g||self,l(g.ComplaintApp={},g["react/jsx-runtime"],g.React,g.ReactDOM,g.ReactRedux,g.RTK))})(this,(function(g,l,D,Ic,Ya,ft){"use strict";var $t=typeof document<"u"?document.currentScript:null;function Qa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const b=Qa(D);function Ve(){return Ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ve.apply(null,arguments)}var oe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(oe||(oe={}));const Dn="popstate";function Za(e){e===void 0&&(e={});function t(r,a){let{pathname:o,search:s,hash:i}=r.location;return Wt("",{pathname:o,search:s,hash:i},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:ze(a)}return to(t,n,null,e)}function T(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function V(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eo(){return Math.random().toString(36).substr(2,8)}function Fn(e,t){return{usr:e.state,key:e.key,idx:t}}function Wt(e,t,n,r){return n===void 0&&(n=null),Ve({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Fe(t):t,{state:n,key:t&&t.key||r||eo()})}function ze(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Fe(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function to(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:o=!1}=r,s=a.history,i=oe.Pop,c=null,f=u();f==null&&(f=0,s.replaceState(Ve({},s.state,{idx:f}),""));function u(){return(s.state||{idx:null}).idx}function d(){i=oe.Pop;let y=u(),m=y==null?null:y-f;f=y,c&&c({action:i,location:_.location,delta:m})}function h(y,m){i=oe.Push;let w=Wt(_.location,y,m);f=u()+1;let S=Fn(w,f),N=_.createHref(w);try{s.pushState(S,"",N)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;a.location.assign(N)}o&&c&&c({action:i,location:_.location,delta:1})}function E(y,m){i=oe.Replace;let w=Wt(_.location,y,m);f=u();let S=Fn(w,f),N=_.createHref(w);s.replaceState(S,"",N),o&&c&&c({action:i,location:_.location,delta:0})}function v(y){let m=a.location.origin!=="null"?a.location.origin:a.location.href,w=typeof y=="string"?y:ze(y);return w=w.replace(/ $/,"%20"),T(m,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,m)}let _={get action(){return i},get location(){return e(a,s)},listen(y){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Dn,d),c=y,()=>{a.removeEventListener(Dn,d),c=null}},createHref(y){return t(a,y)},createURL:v,encodeLocation(y){let m=v(y);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:E,go(y){return s.go(y)}};return _}var kn;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(kn||(kn={}));function no(e,t,n){return n===void 0&&(n="/"),ro(e,t,n)}function ro(e,t,n,r){let a=typeof t=="string"?Fe(t):t,o=se(a.pathname||"/",n);if(o==null)return null;let s=Ln(e);ao(s);let i=null,c=go(o);for(let f=0;i==null&&f<s.length;++f)i=ho(s[f],c);return i}function Ln(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(o,s,i)=>{let c={relativePath:i===void 0?o.path||"":i,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};c.relativePath.startsWith("/")&&(T(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let f=Z([r,c.relativePath]),u=n.concat(c);o.children&&o.children.length>0&&(T(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),Ln(o.children,t,u,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:fo(f,o.index),routesMeta:u})};return e.forEach((o,s)=>{var i;if(o.path===""||!((i=o.path)!=null&&i.includes("?")))a(o,s);else for(let c of Bn(o.path))a(o,s,c)}),t}function Bn(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let s=Bn(r.join("/")),i=[];return i.push(...s.map(c=>c===""?o:[o,c].join("/"))),a&&i.push(...s),i.map(c=>e.startsWith("/")&&c===""?"/":c)}function ao(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:po(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const oo=/^:[\w-]+$/,so=3,io=2,lo=1,co=10,uo=-2,In=e=>e==="*";function fo(e,t){let n=e.split("/"),r=n.length;return n.some(In)&&(r+=uo),t&&(r+=io),n.filter(a=>!In(a)).reduce((a,o)=>a+(oo.test(o)?so:o===""?lo:co),r)}function po(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function ho(e,t,n){let{routesMeta:r}=e,a={},o="/",s=[];for(let i=0;i<r.length;++i){let c=r[i],f=i===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=Vt({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},u),h=c.route;if(!d)return null;Object.assign(a,d.params),s.push({params:a,pathname:Z([o,d.pathname]),pathnameBase:So(Z([o,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(o=Z([o,d.pathnameBase]))}return s}function Vt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=mo(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],s=o.replace(/(.)\/+$/,"$1"),i=a.slice(1);return{params:r.reduce((f,u,d)=>{let{paramName:h,isOptional:E}=u;if(h==="*"){let _=i[d]||"";s=o.slice(0,o.length-_.length).replace(/(.)\/+$/,"$1")}const v=i[d];return E&&!v?f[h]=void 0:f[h]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:s,pattern:e}}function mo(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),V(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,i,c)=>(r.push({paramName:i,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function go(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return V(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function se(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const yo=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wo=e=>yo.test(e);function bo(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Fe(e):e,o;if(n)if(wo(n))o=n;else{if(n.includes("//")){let s=n;n=jn(n),V(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?o=Rn(n.substring(1),"/"):o=Rn(n,t)}else o=t;return{pathname:o,search:Eo(r),hash:Co(a)}}function Rn(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function zt(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function vo(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Un(e,t){let n=vo(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Mn(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Fe(e):(a=Ve({},e),T(!a.pathname||!a.pathname.includes("?"),zt("?","pathname","search",a)),T(!a.pathname||!a.pathname.includes("#"),zt("#","pathname","hash",a)),T(!a.search||!a.search.includes("#"),zt("#","search","hash",a)));let o=e===""||a.pathname==="",s=o?"/":a.pathname,i;if(s==null)i=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;a.pathname=h.join("/")}i=d>=0?t[d]:"/"}let c=bo(a,i),f=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||u)&&(c.pathname+="/"),c}const jn=e=>e.replace(/\/\/+/g,"/"),Z=e=>jn(e.join("/")),So=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Eo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Co=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _o(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const $n=["post","put","patch","delete"];new Set($n);const No=["get",...$n];new Set(No);function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},He.apply(null,arguments)}const qe=b.createContext(null);process.env.NODE_ENV!=="production"&&(qe.displayName="DataRouter");const Ht=b.createContext(null);process.env.NODE_ENV!=="production"&&(Ht.displayName="DataRouterState");const Oo=b.createContext(null);process.env.NODE_ENV!=="production"&&(Oo.displayName="Await");const q=b.createContext(null);process.env.NODE_ENV!=="production"&&(q.displayName="Navigation");const Je=b.createContext(null);process.env.NODE_ENV!=="production"&&(Je.displayName="Location");const K=b.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(K.displayName="Route");const qt=b.createContext(null);process.env.NODE_ENV!=="production"&&(qt.displayName="RouteError");function To(e,t){let{relative:n}=t===void 0?{}:t;Ke()||(process.env.NODE_ENV!=="production"?T(!1,"useHref() may be used only in the context of a <Router> component."):T(!1));let{basename:r,navigator:a}=b.useContext(q),{hash:o,pathname:s,search:i}=Xe(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:Z([r,s])),a.createHref({pathname:c,search:i,hash:o})}function Ke(){return b.useContext(Je)!=null}function he(){return Ke()||(process.env.NODE_ENV!=="production"?T(!1,"useLocation() may be used only in the context of a <Router> component."):T(!1)),b.useContext(Je).location}const Wn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Vn(e){b.useContext(q).static||b.useLayoutEffect(e)}function pt(){let{isDataRoute:e}=b.useContext(K);return e?Wo():Ao()}function Ao(){Ke()||(process.env.NODE_ENV!=="production"?T(!1,"useNavigate() may be used only in the context of a <Router> component."):T(!1));let e=b.useContext(qe),{basename:t,future:n,navigator:r}=b.useContext(q),{matches:a}=b.useContext(K),{pathname:o}=he(),s=JSON.stringify(Un(a,n.v7_relativeSplatPath)),i=b.useRef(!1);return Vn(()=>{i.current=!0}),b.useCallback(function(f,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&V(i.current,Wn),!i.current)return;if(typeof f=="number"){r.go(f);return}let d=Mn(f,JSON.parse(s),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Z([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,s,o,e])}function Po(){let{matches:e}=b.useContext(K),t=e[e.length-1];return t?t.params:{}}function Xe(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(q),{matches:a}=b.useContext(K),{pathname:o}=he(),s=JSON.stringify(Un(a,r.v7_relativeSplatPath));return b.useMemo(()=>Mn(e,JSON.parse(s),o,n==="path"),[e,s,o,n])}function xo(e,t){return Do(e,t)}function Do(e,t,n,r){Ke()||(process.env.NODE_ENV!=="production"?T(!1,"useRoutes() may be used only in the context of a <Router> component."):T(!1));let{navigator:a}=b.useContext(q),{matches:o}=b.useContext(K),s=o[o.length-1],i=s?s.params:{},c=s?s.pathname:"/",f=s?s.pathnameBase:"/",u=s&&s.route;if(process.env.NODE_ENV!=="production"){let w=u&&u.path||"";qn(c,!u||w.endsWith("*"),"You rendered descendant <Routes> (or called `useRoutes()`) at "+('"'+c+'" (under <Route path="'+w+'">) but the ')+`parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
+
3
+ `+('Please change the parent <Route path="'+w+'"> to <Route ')+('path="'+(w==="/"?"*":w+"/*")+'">.'))}let d=he(),h;if(t){var E;let w=typeof t=="string"?Fe(t):t;f==="/"||(E=w.pathname)!=null&&E.startsWith(f)||(process.env.NODE_ENV!=="production"?T(!1,"When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was "+('matched by all parent routes. The current pathname base is "'+f+'" ')+('but pathname "'+w.pathname+'" was given in the `location` prop.')):T(!1)),h=w}else h=d;let v=h.pathname||"/",_=v;if(f!=="/"){let w=f.replace(/^\//,"").split("/");_="/"+v.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=no(e,{pathname:_});process.env.NODE_ENV!=="production"&&(process.env.NODE_ENV!=="production"&&V(u||y!=null,'No routes matched location "'+h.pathname+h.search+h.hash+'" '),process.env.NODE_ENV!=="production"&&V(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,'Matched leaf route at location "'+h.pathname+h.search+h.hash+'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.'));let m=Io(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},i,w.params),pathname:Z([f,a.encodeLocation?a.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?f:Z([f,a.encodeLocation?a.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,n,r);return t&&m?b.createElement(Je.Provider,{value:{location:He({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:oe.Pop}},m):m}function Fo(){let e=$o(),t=_o(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},s=null;return process.env.NODE_ENV!=="production"&&(console.error("Error handled by React Router default ErrorBoundary:",e),s=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:o},"ErrorBoundary")," or"," ",b.createElement("code",{style:o},"errorElement")," prop on your route."))),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:a},n):null,s)}const ko=b.createElement(Fo,null);class Lo extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(K.Provider,{value:this.props.routeContext},b.createElement(qt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Bo(e){let{routeContext:t,match:n,children:r}=e,a=b.useContext(qe);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(K.Provider,{value:t},r)}function Io(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,i=(a=n)==null?void 0:a.errors;if(i!=null){let u=s.findIndex(d=>d.route.id&&i?.[d.route.id]!==void 0);u>=0||(process.env.NODE_ENV!=="production"?T(!1,"Could not find a matching route for errors on route IDs: "+Object.keys(i).join(",")):T(!1)),s=s.slice(0,Math.min(s.length,u+1))}let c=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<s.length;u++){let d=s[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(f=u),d.route.id){let{loaderData:h,errors:E}=n,v=d.route.loader&&h[d.route.id]===void 0&&(!E||E[d.route.id]===void 0);if(d.route.lazy||v){c=!0,f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}return s.reduceRight((u,d,h)=>{let E,v=!1,_=null,y=null;n&&(E=i&&d.route.id?i[d.route.id]:void 0,_=d.route.errorElement||ko,c&&(f<0&&h===0?(qn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,y=null):f===h&&(v=!0,y=d.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,h+1)),w=()=>{let S;return E?S=_:v?S=y:d.route.Component?S=b.createElement(d.route.Component,null):d.route.element?S=d.route.element:S=u,b.createElement(Bo,{match:d,routeContext:{outlet:u,matches:m,isDataRoute:n!=null},children:S})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?b.createElement(Lo,{location:n.location,revalidation:n.revalidation,component:_,error:E,children:w(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):w()},null)}var zn=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(zn||{}),Ge=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Ge||{});function Jt(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Ro(e){let t=b.useContext(qe);return t||(process.env.NODE_ENV!=="production"?T(!1,Jt(e)):T(!1)),t}function Uo(e){let t=b.useContext(Ht);return t||(process.env.NODE_ENV!=="production"?T(!1,Jt(e)):T(!1)),t}function Mo(e){let t=b.useContext(K);return t||(process.env.NODE_ENV!=="production"?T(!1,Jt(e)):T(!1)),t}function Kt(e){let t=Mo(e),n=t.matches[t.matches.length-1];return n.route.id||(process.env.NODE_ENV!=="production"?T(!1,e+' can only be used on routes that contain a unique "id"'):T(!1)),n.route.id}function jo(){return Kt(Ge.UseRouteId)}function $o(){var e;let t=b.useContext(qt),n=Uo(Ge.UseRouteError),r=Kt(Ge.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Wo(){let{router:e}=Ro(zn.UseNavigateStable),t=Kt(Ge.UseNavigateStable),n=b.useRef(!1);return Vn(()=>{n.current=!0}),b.useCallback(function(a,o){o===void 0&&(o={}),process.env.NODE_ENV!=="production"&&V(n.current,Wn),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,He({fromRouteId:t},o)))},[e,t])}const Hn={};function qn(e,t,n){!t&&!Hn[e]&&(Hn[e]=!0,process.env.NODE_ENV!=="production"&&V(!1,n))}const Jn={};function Vo(e,t){process.env.NODE_ENV!=="production"&&!Jn[t]&&(Jn[t]=!0,console.warn(t))}const Kn=(e,t,n)=>Vo(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function zo(e,t){e?.v7_startTransition===void 0&&Kn("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),e?.v7_relativeSplatPath===void 0&&Kn("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function ht(e){process.env.NODE_ENV!=="production"?T(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>."):T(!1)}function Ho(e){let{basename:t="/",children:n=null,location:r,navigationType:a=oe.Pop,navigator:o,static:s=!1,future:i}=e;Ke()&&(process.env.NODE_ENV!=="production"?T(!1,"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."):T(!1));let c=t.replace(/^\/*/,"/"),f=b.useMemo(()=>({basename:c,navigator:o,static:s,future:He({v7_relativeSplatPath:!1},i)}),[c,i,o,s]);typeof r=="string"&&(r=Fe(r));let{pathname:u="/",search:d="",hash:h="",state:E=null,key:v="default"}=r,_=b.useMemo(()=>{let y=se(u,c);return y==null?null:{location:{pathname:y,search:d,hash:h,state:E,key:v},navigationType:a}},[c,u,d,h,E,v,a]);return process.env.NODE_ENV!=="production"&&V(_!=null,'<Router basename="'+c+'"> is not able to match the URL '+('"'+u+d+h+'" because it does not start with the ')+"basename, so the <Router> won't render anything."),_==null?null:b.createElement(q.Provider,{value:f},b.createElement(Je.Provider,{children:n,value:_}))}function qo(e){let{children:t,location:n}=e;return xo(Xt(t),n)}new Promise(()=>{});function Xt(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,a)=>{if(!b.isValidElement(r))return;let o=[...t,a];if(r.type===b.Fragment){n.push.apply(n,Xt(r.props.children,o));return}r.type!==ht&&(process.env.NODE_ENV!=="production"?T(!1,"["+(typeof r.type=="string"?r.type:r.type.name)+"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>"):T(!1)),!r.props.index||!r.props.children||(process.env.NODE_ENV!=="production"?T(!1,"An index route cannot have child routes."):T(!1));let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Xt(r.props.children,o)),n.push(s)}),n}function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ke.apply(null,arguments)}function Gt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}const mt="get",gt="application/x-www-form-urlencoded";function yt(e){return e!=null&&typeof e.tagName=="string"}function Jo(e){return yt(e)&&e.tagName.toLowerCase()==="button"}function Ko(e){return yt(e)&&e.tagName.toLowerCase()==="form"}function Xo(e){return yt(e)&&e.tagName.toLowerCase()==="input"}function Go(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Yo(e,t){return e.button===0&&(!t||t==="_self")&&!Go(e)}function Yt(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function Qo(e,t){let n=Yt(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}let wt=null;function Zo(){if(wt===null)try{new FormData(document.createElement("form"),0),wt=!1}catch{wt=!0}return wt}const es=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qt(e){return e!=null&&!es.has(e)?(process.env.NODE_ENV!=="production"&&V(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+gt+'"')),null):e}function ts(e,t){let n,r,a,o,s;if(Ko(e)){let i=e.getAttribute("action");r=i?se(i,t):null,n=e.getAttribute("method")||mt,a=Qt(e.getAttribute("enctype"))||gt,o=new FormData(e)}else if(Jo(e)||Xo(e)&&(e.type==="submit"||e.type==="image")){let i=e.form;if(i==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||i.getAttribute("action");if(r=c?se(c,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||mt,a=Qt(e.getAttribute("formenctype"))||Qt(i.getAttribute("enctype"))||gt,o=new FormData(i,e),!Zo()){let{name:f,type:u,value:d}=e;if(u==="image"){let h=f?f+".":"";o.append(h+"x","0"),o.append(h+"y","0")}else f&&o.append(f,d)}}else{if(yt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=mt,r=null,a=gt,s=e}return o&&a==="text/plain"&&(s=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:s}}const ns=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],rs=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],as=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"],os="6";try{window.__reactRouterVersion=os}catch{}const Xn=b.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Xn.displayName="ViewTransition");const ss=b.createContext(new Map);process.env.NODE_ENV!=="production"&&(ss.displayName="Fetchers");const Gn=b["startTransition"];function is(e){let{basename:t,children:n,future:r,window:a}=e,o=b.useRef();o.current==null&&(o.current=Za({window:a,v5Compat:!0}));let s=o.current,[i,c]=b.useState({action:s.action,location:s.location}),{v7_startTransition:f}=r||{},u=b.useCallback(d=>{f&&Gn?Gn(()=>c(d)):c(d)},[c,f]);return b.useLayoutEffect(()=>s.listen(u),[s,u]),b.useEffect(()=>zo(r),[r]),b.createElement(Ho,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:s,future:r})}process.env.NODE_ENV;const ls=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cs=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yn=b.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:o,replace:s,state:i,target:c,to:f,preventScrollReset:u,viewTransition:d}=t,h=Gt(t,ns),{basename:E}=b.useContext(q),v,_=!1;if(typeof f=="string"&&cs.test(f)&&(v=f,ls))try{let S=new URL(window.location.href),N=f.startsWith("//")?new URL(S.protocol+f):new URL(f),x=se(N.pathname,E);N.origin===S.origin&&x!=null?f=x+N.search+N.hash:_=!0}catch{process.env.NODE_ENV!=="production"&&V(!1,'<Link to="'+f+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let y=To(f,{relative:a}),m=ps(f,{replace:s,state:i,target:c,preventScrollReset:u,relative:a,viewTransition:d});function w(S){r&&r(S),S.defaultPrevented||m(S)}return b.createElement("a",ke({},h,{href:v||y,onClick:_||o?r:w,ref:n,target:c}))});process.env.NODE_ENV!=="production"&&(Yn.displayName="Link");const ds=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:o="",end:s=!1,style:i,to:c,viewTransition:f,children:u}=t,d=Gt(t,rs),h=Xe(c,{relative:d.relative}),E=he(),v=b.useContext(Ht),{navigator:_,basename:y}=b.useContext(q),m=v!=null&&vs(h)&&f===!0,w=_.encodeLocation?_.encodeLocation(h).pathname:h.pathname,S=E.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;a||(S=S.toLowerCase(),N=N?N.toLowerCase():null,w=w.toLowerCase()),N&&y&&(N=se(N,y)||N);const x=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let A=S===w||!s&&S.startsWith(w)&&S.charAt(x)==="/",$=N!=null&&(N===w||!s&&N.startsWith(w)&&N.charAt(w.length)==="/"),ne={isActive:A,isPending:$,isTransitioning:m},Pe=A?r:void 0,F;typeof o=="function"?F=o(ne):F=[o,A?"active":null,$?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let L=typeof i=="function"?i(ne):i;return b.createElement(Yn,ke({},d,{"aria-current":Pe,className:F,ref:n,style:L,to:c,viewTransition:f}),typeof u=="function"?u(ne):u)});process.env.NODE_ENV!=="production"&&(ds.displayName="NavLink");const us=b.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:s,method:i=mt,action:c,onSubmit:f,relative:u,preventScrollReset:d,viewTransition:h}=e,E=Gt(e,as),v=ws(),_=bs(c,{relative:u}),y=i.toLowerCase()==="get"?"get":"post",m=w=>{if(f&&f(w),w.defaultPrevented)return;w.preventDefault();let S=w.nativeEvent.submitter,N=S?.getAttribute("formmethod")||i;v(S||w.currentTarget,{fetcherKey:n,method:N,navigate:r,replace:o,state:s,relative:u,preventScrollReset:d,viewTransition:h})};return b.createElement("form",ke({ref:t,method:y,action:_,onSubmit:a?f:m},E))});process.env.NODE_ENV!=="production"&&(us.displayName="Form"),process.env.NODE_ENV;var bt;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(bt||(bt={}));var Qn;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Qn||(Qn={}));function fs(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Zn(e){let t=b.useContext(qe);return t||(process.env.NODE_ENV!=="production"?T(!1,fs(e)):T(!1)),t}function ps(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:s,viewTransition:i}=t===void 0?{}:t,c=pt(),f=he(),u=Xe(e,{relative:s});return b.useCallback(d=>{if(Yo(d,n)){d.preventDefault();let h=r!==void 0?r:ze(f)===ze(u);c(e,{replace:h,state:a,preventScrollReset:o,relative:s,viewTransition:i})}},[f,c,u,r,a,n,e,o,s,i])}function hs(e){process.env.NODE_ENV!=="production"&&V(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=b.useRef(Yt(e)),n=b.useRef(!1),r=he(),a=b.useMemo(()=>Qo(r.search,n.current?null:t.current),[r.search]),o=pt(),s=b.useCallback((i,c)=>{const f=Yt(typeof i=="function"?i(a):i);n.current=!0,o("?"+f,c)},[o,a]);return[a,s]}function ms(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let gs=0,ys=()=>"__"+String(++gs)+"__";function ws(){let{router:e}=Zn(bt.UseSubmit),{basename:t}=b.useContext(q),n=jo();return b.useCallback(function(r,a){a===void 0&&(a={}),ms();let{action:o,method:s,encType:i,formData:c,body:f}=ts(r,t);if(a.navigate===!1){let u=a.fetcherKey||ys();e.fetch(u,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:c,body:f,formMethod:a.method||s,formEncType:a.encType||i,flushSync:a.flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:c,body:f,formMethod:a.method||s,formEncType:a.encType||i,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,n])}function bs(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=b.useContext(q),a=b.useContext(K);a||(process.env.NODE_ENV!=="production"?T(!1,"useFormAction must be used inside a RouteContext"):T(!1));let[o]=a.matches.slice(-1),s=ke({},Xe(e||".",{relative:n})),i=he();if(e==null){s.search=i.search;let c=new URLSearchParams(s.search),f=c.getAll("index");if(f.some(d=>d==="")){c.delete("index"),f.filter(h=>h).forEach(h=>c.append("index",h));let d=c.toString();s.search=d?"?"+d:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Z([r,s.pathname])),ze(s)}function vs(e,t){t===void 0&&(t={});let n=b.useContext(Xn);n==null&&(process.env.NODE_ENV!=="production"?T(!1,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):T(!1));let{basename:r}=Zn(bt.useViewTransitionState),a=Xe(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=se(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=se(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Vt(a.pathname,s)!=null||Vt(a.pathname,o)!=null}function er(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ss}=Object.prototype,{getPrototypeOf:Le}=Object,{iterator:Ye,toStringTag:tr}=Symbol,vt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Qe=(e,t)=>{let n=e;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),vt(n,t))return!0;n=Le(n)}return!1},Es=(e,t)=>e!=null&&Qe(e,t)?e[t]:void 0,Zt=(e=>t=>{const n=Ss.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),z=e=>(e=e.toLowerCase(),t=>Zt(t)===e),St=e=>t=>typeof t===e,{isArray:me}=Array,ge=St("undefined");function Be(e){return e!==null&&!ge(e)&&e.constructor!==null&&!ge(e.constructor)&&M(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const nr=z("ArrayBuffer");function Cs(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&nr(e.buffer),t}const _s=St("string"),M=St("function"),rr=St("number"),Ie=e=>e!==null&&typeof e=="object",Ns=e=>e===!0||e===!1,Et=e=>{if(!Ie(e))return!1;const t=Le(e);return(t===null||t===Object.prototype||Le(t)===null)&&!Qe(e,tr)&&!Qe(e,Ye)},Os=e=>{if(!Ie(e)||Be(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ts=z("Date"),As=z("File"),Ps=e=>!!(e&&typeof e.uri<"u"),xs=e=>e&&typeof e.getParts<"u",Ds=z("Blob"),Fs=z("FileList"),ks=z("Set"),Ls=e=>Ie(e)&&M(e.pipe);function Bs(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const ar=Bs(),or=typeof ar.FormData<"u"?ar.FormData:void 0,Is=e=>{if(!e)return!1;if(or&&e instanceof or)return!0;const t=Le(e);if(!t||t===Object.prototype||!M(e.append))return!1;const n=Zt(e);return n==="formdata"||n==="object"&&M(e.toString)&&e.toString()==="[object FormData]"},Rs=z("URLSearchParams"),[Us,Ms,js,$s]=["ReadableStream","Request","Response","Headers"].map(z),Ws=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ze(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),me(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(Be(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function sr(e,t){if(Be(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,a;for(;r-- >0;)if(a=n[r],t===a.toLowerCase())return a;return null}const ye=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ir=e=>!ge(e)&&e!==ye;function en(...e){const{caseless:t,skipUndefined:n}=ir(this)&&this||{},r={},a=(o,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const i=t&&typeof s=="string"&&sr(r,s)||s,c=vt(r,i)?r[i]:void 0;Et(c)&&Et(o)?r[i]=en(c,o):Et(o)?r[i]=en({},o):me(o)?r[i]=o.slice():(!n||!ge(o))&&(r[i]=o)};for(let o=0,s=e.length;o<s;o++){const i=e[o];if(!i||Be(i)||(Ze(i,a),typeof i!="object"||me(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let f=0;f<c.length;f++){const u=c[f];ei.call(i,u)&&a(i[u],u)}}return r}const Vs=(e,t,n,{allOwnKeys:r}={})=>(Ze(t,(a,o)=>{n&&M(a)?Object.defineProperty(e,o,{__proto__:null,value:er(a,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),zs=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Hs=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},qs=(e,t,n,r)=>{let a,o,s;const i={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],(!r||r(s,e,t))&&!i[s]&&(t[s]=e[s],i[s]=!0);e=n!==!1&&Le(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Js=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Ks=e=>{if(!e)return null;if(me(e))return e;let t=e.length;if(!rr(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Xs=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Le(Uint8Array)),Gs=(e,t)=>{const r=(e&&e[Ye]).call(e);let a;for(;(a=r.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},Ys=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Qs=z("HTMLFormElement"),Zs=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),{propertyIsEnumerable:ei}=Object.prototype,ti=z("RegExp"),lr=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ze(n,(a,o)=>{let s;(s=t(a,o,e))!==!1&&(r[o]=s||a)}),Object.defineProperties(e,r)},ni=e=>{lr(e,(t,n)=>{if(M(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(M(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ri=(e,t)=>{const n={},r=a=>{a.forEach(o=>{n[o]=!0})};return me(e)?r(e):r(String(e).split(t)),n},ai=()=>{},oi=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function si(e){return!!(e&&M(e.append)&&e[tr]==="FormData"&&e[Ye])}const ii=e=>{const t=new WeakSet,n=r=>{if(Ie(r)){if(t.has(r))return;if(Be(r))return r;if(!("toJSON"in r)){t.add(r);let a;if(ks(r)){a=[];for(const o of r){const s=n(o);!ge(s)&&a.push(s)}}else a=me(r)?[]:{},Ze(r,(o,s)=>{const i=n(o);!ge(i)&&(a[s]=i)});return t.delete(r),a}}return r};return n(e)},li=z("AsyncFunction"),ci=e=>e&&(Ie(e)||M(e))&&M(e.then)&&M(e.catch),cr=((e,t)=>e?setImmediate:t?((n,r)=>(ye.addEventListener("message",({source:a,data:o})=>{a===ye&&o===n&&r.length&&r.shift()()},!1),a=>{r.push(a),ye.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",M(ye.postMessage)),di=typeof queueMicrotask<"u"?queueMicrotask.bind(ye):typeof process<"u"&&process.nextTick||cr,dr=e=>e!=null&&M(e[Ye]),p={isArray:me,isArrayBuffer:nr,isBuffer:Be,isFormData:Is,isArrayBufferView:Cs,isString:_s,isNumber:rr,isBoolean:Ns,isObject:Ie,isPlainObject:Et,isEmptyObject:Os,isReadableStream:Us,isRequest:Ms,isResponse:js,isHeaders:$s,isUndefined:ge,isDate:Ts,isFile:As,isReactNativeBlob:Ps,isReactNative:xs,isBlob:Ds,isRegExp:ti,isFunction:M,isStream:Ls,isURLSearchParams:Rs,isTypedArray:Xs,isFileList:Fs,forEach:Ze,merge:en,extend:Vs,trim:Ws,stripBOM:zs,inherits:Hs,toFlatObject:qs,kindOf:Zt,kindOfTest:z,endsWith:Js,toArray:Ks,forEachEntry:Gs,matchAll:Ys,isHTMLForm:Qs,hasOwnProperty:vt,hasOwnProp:vt,hasOwnInPrototypeChain:Qe,getSafeProp:Es,reduceDescriptors:lr,freezeMethods:ni,toObjectSet:ri,toCamelCase:Zs,noop:ai,toFiniteNumber:oi,findKey:sr,global:ye,isContextDefined:ir,isSpecCompliantForm:si,toJSONObject:ii,isAsyncFn:li,isThenable:ci,setImmediate:cr,asap:di,isIterable:dr,isSafeIterable:e=>e!=null&&Qe(e,Ye)&&dr(e)},ui=p.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fi=e=>{const t={};let n,r,a;return e&&e.split(`
4
+ `).forEach(function(s){a=s.indexOf(":"),n=s.substring(0,a).trim().toLowerCase(),r=s.substring(a+1).trim();const i=p.hasOwnProp(t,n);!n||i&&p.hasOwnProp(ui,n)||(n==="set-cookie"?i?t[n].push(r):t[n]=[r]:t[n]=i?t[n]+", "+r:r)}),t};function pi(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const hi=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),mi=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function tn(e,t){return p.isArray(e)?e.map(n=>tn(n,t)):pi(String(e).replace(t,""))}const gi=e=>tn(e,hi),yi=e=>tn(e,mi);function ur(e){const t=Object.create(null);return p.forEach(e.toJSON(),(n,r)=>{t[r]=yi(n)}),t}const fr=Symbol("internals");function et(e){return e&&String(e).trim().toLowerCase()}function Ct(e){return e===!1||e==null?e:p.isArray(e)?e.map(Ct):gi(String(e))}function wi(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const bi=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function nn(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function vi(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n="";for(let r=1;r<t;r++){const a=e.charCodeAt(r);if(a===34||a===92&&(r+=1,r>=t))return e;n+=e[r]}return n}function Si(e){const t=Object.create(null),n=String(e);let r=0,a=!1,o=!1;function s(i){const c=nn(n.slice(r,i)),f=c.indexOf("=");if(f<1)return;const u=nn(c.slice(0,f));if(!bi.test(u))return;const d=u.toLowerCase();if(d==="__proto__"||d==="constructor"||d==="prototype")return;const h=nn(c.slice(f+1));t[d]=vi(h)}for(let i=0;i<n.length;i++){const c=n.charCodeAt(i);a?o?o=!1:c===92?o=!0:c===34&&(a=!1):c===34?a=!0:(c===44||c===59)&&(s(i),r=i+1)}return s(n.length),t}const Ei=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function rn(e,t,n,r,a){if(p.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!p.isString(t)){if(p.isString(r))return t.indexOf(r)!==-1;if(p.isRegExp(r))return r.test(t)}}function Ci(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function _i(e,t){const n=p.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(a,o,s){return this[r].call(this,t,a,o,s)},configurable:!0})})}let R=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function o(i,c,f){const u=et(c);if(!u)return;const d=p.findKey(a,u);(!d||a[d]===void 0||f===!0||f===void 0&&a[d]!==!1)&&(a[d||c]=Ct(i))}const s=(i,c)=>p.forEach(i,(f,u)=>o(f,u,c));if(p.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(p.isString(t)&&(t=t.trim())&&!Ei(t))s(fi(t),n);else if(p.isObject(t)&&p.isSafeIterable(t)){let i=Object.create(null),c,f;for(const u of t){if(!p.isArray(u))throw new TypeError("Object iterator must return a key-value pair");f=u[0],p.hasOwnProp(i,f)?(c=i[f],i[f]=p.isArray(c)?[...c,u[1]]:[c,u[1]]):i[f]=u[1]}s(i,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=et(t),t){const r=p.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return wi(a);if(p.isFunction(n))return n.call(this,a,r);if(p.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=et(t),t){const r=p.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||rn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function o(s){if(s=et(s),s){const i=p.findKey(r,s);i&&(!n||rn(r,r[i],i,n))&&(delete r[i],a=!0)}}return p.isArray(t)?t.forEach(o):o(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const o=n[r];(!t||rn(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){const n=this,r={};return p.forEach(this,(a,o)=>{const s=p.findKey(r,o);if(s){n[s]=Ct(a),delete n[o];return}const i=t?Ci(o):String(o).trim();i!==o&&delete n[o],n[i]=Ct(a),r[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return p.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&p.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
5
+ `)}getSetCookie(){const t=this.get("set-cookie");return p.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Si(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[fr]=this[fr]={accessors:{}}).accessors,a=this.prototype;function o(s){const i=et(s);r[i]||(_i(a,s),r[i]=!0)}return p.isArray(t)?t.forEach(o):o(t),this}};R.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(R.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),p.freezeMethods(R);const _t="[REDACTED ****]";function Ni(e){if(p.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(p.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Oi(e,t){const n=new Set(t.map(o=>String(o).toLowerCase())),r=[],a=o=>{if(o===null||typeof o!="object"||p.isBuffer(o))return o;if(r.indexOf(o)!==-1)return;o instanceof R&&(o=o.toJSON()),r.push(o);let s;if(p.isArray(o))s=[],o.forEach((i,c)=>{const f=a(i);p.isUndefined(f)||(s[c]=f)});else{if(!p.isPlainObject(o)&&Ni(o))return r.pop(),o;s=Object.create(null);for(const[i,c]of Object.entries(o)){const f=n.has(i.toLowerCase())?_t:a(c);p.isUndefined(f)||(s[i]=f)}}return r.pop(),s};return a(e)}function pr(e){try{return String(e)}catch{return""}}function Ti(e){return e.errors.map(n=>{try{return n&&n.message?pr(n.message):pr(n)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}let C=class Xa extends Error{static from(t,n,r,a,o,s){let i=t.message;!i&&p.isArray(t.errors)&&t.errors.length&&(i=Ti(t));const c=new Xa(i,n||t.code,r,a,o);return Object.defineProperty(c,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),s&&Object.assign(c,s),c}constructor(t,n,r,a,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),a&&(this.request=a),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,n=t&&p.hasOwnProp(t,"redact")?t.redact:void 0,r=p.isArray(n)&&n.length>0?Oi(t,n):p.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};C.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",C.ERR_BAD_OPTION="ERR_BAD_OPTION",C.ECONNABORTED="ECONNABORTED",C.ETIMEDOUT="ETIMEDOUT",C.ECONNREFUSED="ECONNREFUSED",C.ERR_NETWORK="ERR_NETWORK",C.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",C.ERR_DEPRECATED="ERR_DEPRECATED",C.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",C.ERR_BAD_REQUEST="ERR_BAD_REQUEST",C.ERR_CANCELED="ERR_CANCELED",C.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",C.ERR_INVALID_URL="ERR_INVALID_URL",C.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Ai=null,hr=100;function an(e){return p.isPlainObject(e)||p.isArray(e)}function mr(e){return p.endsWith(e,"[]")?e.slice(0,-2):e}function on(e,t,n){return e?e.concat(t).map(function(a,o){return a=mr(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function Pi(e){return p.isArray(e)&&!e.some(an)}const xi=p.toFlatObject(p,{},null,function(t){return/^is[A-Z]/.test(t)});function Nt(e,t,n){if(!p.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=p.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,S){return!p.isUndefined(S[w])});const r=n.metaTokens,a=n.visitor||v,o=n.dots,s=n.indexes,i=n.Blob||typeof Blob<"u"&&Blob,c=n.maxDepth===void 0?hr:n.maxDepth,f=i&&p.isSpecCompliantForm(t),u=[];if(!p.isFunction(a))throw new TypeError("visitor must be a function");function d(m){if(m===null)return"";if(p.isDate(m))return m.toISOString();if(p.isBoolean(m))return m.toString();if(!f&&p.isBlob(m))throw new C("Blob is not supported. Use a Buffer instead.");if(p.isArrayBuffer(m)||p.isTypedArray(m)){if(f&&typeof i=="function")return new i([m]);throw new C("Blob is not supported. Use a Buffer instead.",C.ERR_NOT_SUPPORT)}return m}function h(m){if(m>c)throw new C("Object is too deeply nested ("+m+" levels). Max depth: "+c,C.ERR_FORM_DATA_DEPTH_EXCEEDED)}function E(m,w){if(c===1/0)return JSON.stringify(m);const S=[];return JSON.stringify(m,function(x,A){if(!p.isObject(A))return A;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(A),h(w+S.length-1),A})}function v(m,w,S){let N=m;if(p.isReactNative(t)&&p.isReactNativeBlob(m))return t.append(on(S,w,o),d(m)),!1;if(m&&!S&&typeof m=="object"){if(p.endsWith(w,"{}"))w=r?w:w.slice(0,-2),m=E(m,1);else if(p.isArray(m)&&Pi(m)||(p.isFileList(m)||p.endsWith(w,"[]"))&&(N=p.toArray(m)))return w=mr(w),N.forEach(function(A,$){!(p.isUndefined(A)||A===null)&&t.append(s===!0?on([w],$,o):s===null?w:w+"[]",d(A))}),!1}return an(m)?!0:(t.append(on(S,w,o),d(m)),!1)}const _=Object.assign(xi,{defaultVisitor:v,convertValue:d,isVisitable:an});function y(m,w,S=0){if(!p.isUndefined(m)){if(h(S),u.indexOf(m)!==-1)throw new Error("Circular reference detected in "+w.join("."));u.push(m),p.forEach(m,function(x,A){(!(p.isUndefined(x)||x===null)&&a.call(t,x,p.isString(A)?A.trim():A,w,_))===!0&&y(x,w?w.concat(A):[A],S+1)}),u.pop()}}if(!p.isObject(e))throw new TypeError("data must be an object");return y(e),t}function gr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function sn(e,t){this._pairs=[],e&&Nt(e,this,t)}const yr=sn.prototype;yr.append=function(t,n){this._pairs.push([t,n])},yr.toString=function(t){const n=t?r=>t.call(this,r,gr):gr;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function Di(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function wr(e,t,n){if(!t)return e;e=e||"";const r=p.isFunction(n)?{serialize:n}:n,a=p.getSafeProp(r,"encode")||Di,o=p.getSafeProp(r,"serialize");let s;if(o?s=o(t,r):s=p.isURLSearchParams(t)?t.toString():new sn(t,r).toString(a),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class br{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){p.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ln={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Fi={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:sn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},cn=typeof window<"u"&&typeof document<"u",dn=typeof navigator=="object"&&navigator||void 0,ki=cn&&(!dn||["ReactNative","NativeScript","NS"].indexOf(dn.product)<0),Li=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bi=cn&&window.location.href||"http://localhost",B={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:cn,hasStandardBrowserEnv:ki,hasStandardBrowserWebWorkerEnv:Li,navigator:dn,origin:Bi},Symbol.toStringTag,{value:"Module"})),...Fi};function Ii(e,t){return Nt(e,new B.classes.URLSearchParams,{visitor:function(n,r,a,o){return B.isNode&&p.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const vr=hr;function Sr(e){if(e>vr)throw new C("FormData field is too deeply nested ("+e+" levels). Max depth: "+vr,C.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Ri(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;(r=n.exec(e))!==null;)Sr(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function Ui(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r<a;r++)o=n[r],t[o]=e[o];return t}function Er(e){function t(n,r,a,o){Sr(o);let s=n[o++];if(s==="__proto__")return!0;const i=Number.isFinite(+s),c=o>=n.length;return s=!s&&p.isArray(a)?a.length:s,c?(p.hasOwnProp(a,s)?a[s]=p.isArray(a[s])?a[s].concat(r):[a[s],r]:a[s]=r,!i):((!p.hasOwnProp(a,s)||!p.isObject(a[s]))&&(a[s]=[]),t(n,r,a[s],o)&&p.isArray(a[s])&&(a[s]=Ui(a[s])),!i)}if(p.isFormData(e)&&p.isFunction(e.entries)){const n={};return p.forEachEntry(e,(r,a)=>{t(Ri(r),a,n,0)}),n}return null}const Re=(e,t)=>e!=null&&p.hasOwnProp(e,t)?e[t]:void 0;function Mi(e,t,n){if(p.isString(e))try{return(t||JSON.parse)(e),p.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const tt={transitional:ln,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,o=p.isObject(t);if(o&&p.isHTMLForm(t)&&(t=new FormData(t)),p.isFormData(t))return a?JSON.stringify(Er(t)):t;if(p.isArrayBuffer(t)||p.isBuffer(t)||p.isStream(t)||p.isFile(t)||p.isBlob(t)||p.isReadableStream(t))return t;if(p.isArrayBufferView(t))return t.buffer;if(p.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){const c=Re(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return Ii(t,c).toString();if((i=p.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=Re(this,"env"),u=f&&f.FormData;return Nt(i?{"files[]":t}:t,u&&new u,c)}}return o||a?(n.setContentType("application/json",!1),Mi(t)):t}],transformResponse:[function(t){const n=Re(this,"transitional")||tt.transitional,r=n&&n.forcedJSONParsing,a=Re(this,"responseType"),o=a==="json";if(p.isResponse(t)||p.isReadableStream(t))return t;if(t&&p.isString(t)&&(r&&!a||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,Re(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?C.from(c,C.ERR_BAD_RESPONSE,this,null,Re(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch","query"],e=>{tt.headers[e]={}});function un(e,t){const n=this||tt,r=t||n,a=R.from(r.headers);let o=r.data;return p.forEach(e,function(i){o=i.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function Cr(e){return!!(e&&e.__CANCEL__)}let nt=class extends C{constructor(t,n,r){super(t??"canceled",C.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function _r(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new C("Request failed with status code "+n.status,n.status>=400&&n.status<500?C.ERR_BAD_REQUEST:C.ERR_BAD_RESPONSE,n.config,n.request,n))}function ji(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function $i(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),u=r[o];s||(s=f),n[a]=c,r[a]=f;let d=o,h=0;for(;d!==a;)h+=n[d++],d=d%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),f-s<t)return;const E=u&&f-u;return E?Math.round(h*1e3/E):void 0}}function Wi(e,t){let n=0,r=1e3/t,a,o;const s=(f,u=Date.now())=>{n=u,a=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const u=Date.now(),d=u-n;d>=r?s(f,u):(a=f,o||(o=setTimeout(()=>{o=null,s(a)},r-d)))},()=>a&&s(a)]}const Ot=(e,t,n=3)=>{let r=0;const a=$i(50,250);return Wi(o=>{if(!o||typeof o.loaded!="number")return;const s=o.loaded,i=o.lengthComputable?o.total:void 0,c=Math.max(0,i!=null?Math.min(s,i):s),f=Math.max(0,c-r),u=a(f);r=Math.max(r,c);const d={loaded:c,total:i,progress:i?c/i:void 0,bytes:f,rate:u||void 0,estimated:u&&i?(i-c)/u:void 0,event:o,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(d)},n)},Nr=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Or=(e,t=p.asap)=>(...n)=>t(()=>e(...n)),Vi=B.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,B.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(B.origin),B.navigator&&/(msie|trident)/i.test(B.navigator.userAgent)):()=>!0,zi=B.hasStandardBrowserEnv?{write(e,t,n,r,a,o,s){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];p.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),p.isString(r)&&i.push(`path=${r}`),p.isString(a)&&i.push(`domain=${a}`),o===!0&&i.push("secure"),p.isString(s)&&i.push(`SameSite=${s}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),a=r.indexOf("=");if(a!==-1&&r.slice(0,a)===e)try{return decodeURIComponent(r.slice(a+1))}catch{return r.slice(a+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Hi(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function qi(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}const Ji=/^https?:(?!\/\/)/i,Ki=/[\t\n\r]/g;function Xi(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Gi(e){return Xi(e).replace(Ki,"")}function Yi(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,n,r="")=>`${n}${r}${_t}`)}function Qi(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${_t}@`),n=t.indexOf("#"),a=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${_t}`);return n===-1?a:`${a}#${Yi(t.slice(n+1))}`}function Tr(e,t){if(typeof e=="string"){const n=Gi(e);if(Ji.test(n))throw new C(`Invalid URL ${JSON.stringify(Qi(n))}: missing "//" after protocol`,C.ERR_INVALID_URL,t)}}function Ar(e,t,n,r){Tr(t,r);let a=!Hi(t);return e&&(a||n===!1)?(Tr(e,r),qi(e,t)):t}const Pr=e=>e instanceof R?{...e}:e,Zi=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function we(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(u,d,h,E){return p.isPlainObject(u)&&p.isPlainObject(d)?p.merge.call({caseless:E},u,d):p.isPlainObject(d)?p.merge({},d):p.isArray(d)?d.slice():d}function a(u,d,h,E){if(p.isUndefined(d)){if(!p.isUndefined(u))return r(void 0,u,h,E)}else return r(u,d,h,E)}function o(u,d){if(!p.isUndefined(d))return r(void 0,d)}function s(u,d){if(p.isUndefined(d)){if(!p.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function i(u){const d=p.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!p.isUndefined(d))if(p.isPlainObject(d)){if(p.hasOwnProp(d,u))return d[u]}else return;const h=p.hasOwnProp(e,"transitional")?e.transitional:void 0;if(p.isPlainObject(h)&&p.hasOwnProp(h,u))return h[u]}function c(u,d,h){if(p.hasOwnProp(t,h))return r(u,d);if(p.hasOwnProp(e,h))return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:c,headers:(u,d,h)=>a(Pr(u),Pr(d),h,!0)};return p.forEach(Zi({...e,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const h=p.hasOwnProp(f,d)?f[d]:a,E=p.hasOwnProp(e,d)?e[d]:void 0,v=p.hasOwnProp(t,d)?t[d]:void 0,_=h(E,v,d);p.isUndefined(_)&&h!==c||(n[d]=_)}),p.hasOwnProp(t,"validateStatus")&&p.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(p.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const el=["content-type","content-length"];function tl(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([r,a])=>{el.includes(r.toLowerCase())&&e.set(r,a)})}const nl=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function xr(e){const t=we({},e),n=h=>p.hasOwnProp(t,h)?t[h]:void 0,r=n("data");let a=n("withXSRFToken");const o=n("xsrfHeaderName"),s=n("xsrfCookieName");let i=n("headers");const c=n("auth"),f=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=i=R.from(i),t.url=wr(Ar(f,d,u,t),n("params"),n("paramsSerializer")),c){const h=p.getSafeProp(c,"username")||"",E=p.getSafeProp(c,"password")||"";try{i.set("Authorization","Basic "+btoa(h+":"+(E?nl(E):"")))}catch(v){throw C.from(v,C.ERR_BAD_OPTION_VALUE,e)}}if(p.isFormData(r)&&(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv||p.isReactNative(r)?i.setContentType(void 0):p.isFunction(r.getHeaders)&&tl(i,r.getHeaders(),n("formDataHeaderPolicy"))),B.hasStandardBrowserEnv&&(p.isFunction(a)&&(a=a(t)),a===!0||a==null&&Vi(t.url))){const E=o&&s&&zi.read(s);E&&i.set(o,E)}return t}const rl=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const a=xr(e);let o=a.data;const s=R.from(a.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:f}=a,u,d,h,E,v;function _(){E&&E(),v&&v(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(a.method.toUpperCase(),a.url,!0),y.timeout=a.timeout;function m(){if(!y)return;const S=R.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!i||i==="text"||i==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};_r(function($){n($),_()},function($){r($),_()},x),y=null}"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(m)},y.onabort=function(){y&&(r(new C("Request aborted",C.ECONNABORTED,e,y)),_(),y=null)},y.onerror=function(N){const x=N&&N.message?N.message:"Network Error",A=new C(x,C.ERR_NETWORK,e,y);A.event=N||null,r(A),_(),y=null},y.ontimeout=function(){let N=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const x=a.transitional||ln;a.timeoutErrorMessage&&(N=a.timeoutErrorMessage),r(new C(N,x.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,e,y)),_(),y=null},o===void 0&&s.setContentType(null),"setRequestHeader"in y&&p.forEach(ur(s),function(N,x){y.setRequestHeader(x,N)}),p.isUndefined(a.withCredentials)||(y.withCredentials=!!a.withCredentials),i&&i!=="json"&&(y.responseType=a.responseType),f&&([h,v]=Ot(f,!0),y.addEventListener("progress",h)),c&&y.upload&&([d,E]=Ot(c),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",E)),(a.cancelToken||a.signal)&&(u=S=>{y&&(r(!S||S.type?new nt(null,e,y):S),y.abort(),_(),y=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const w=ji(a.url);if(w&&!B.protocols.includes(w)){r(new C("Unsupported protocol "+w+":",C.ERR_BAD_REQUEST,e)),_();return}y.send(o||null)})},al=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const a=function(c){if(!r){r=!0,s();const f=c instanceof Error?c:this.reason;n.abort(f instanceof C?f:new nt(f instanceof Error?f.message:f))}};let o=t&&setTimeout(()=>{o=null,a(new C(`timeout of ${t}ms exceeded`,C.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(a):c.removeEventListener("abort",a)}),e=null)};e.forEach(c=>{if(!r){if(c.aborted){a.call(c);return}c.addEventListener("abort",a,{once:!0})}});const{signal:i}=n;return i.unsubscribe=()=>p.asap(s),i},ol=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,a;for(;r<n;)a=r+t,yield e.slice(r,a),r=a},sl=async function*(e,t){for await(const n of il(e))yield*ol(n,t)},il=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Dr=(e,t,n,r)=>{const a=sl(e,t);let o=0,s,i=c=>{s||(s=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:u}=await a.next();if(f){i(),c.close();return}let d=u.byteLength;if(n){let h=o+=d;n(h)}c.enqueue(new Uint8Array(u))}catch(f){throw i(f),f}},cancel(c){return i(c),a.return()}},{highWaterMark:2})},Fr=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,kr=(e,t,n)=>t+2<n&&Fr(e.charCodeAt(t+1))&&Fr(e.charCodeAt(t+2)),Lr=e=>e<=57?e-48:(e&223)-55,ll=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,cl=e=>e===9||e===10||e===12||e===13||e===32,dl=e=>{const t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},ul=e=>{const t=e.length;let n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},fl=e=>{const t=e.length;let n=0,r=0,a=!1;for(let o=0;o<t;o++){let s=e.charCodeAt(o);if(s===37&&kr(e,o,t)&&(s=Lr(e.charCodeAt(o+1))*16+Lr(e.charCodeAt(o+2)),o+=2),!cl(s)){if(s===61){r++;continue}if(!ll(s)||r>0){a=!0;continue}n++}}return a||r>2||r>0&&(n+r)%4!==0||n%4===1?ul(e):dl(n)},pl=(e,t)=>{if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const r=e.slice(5,n),a=e.slice(n+1);if(/;base64/i.test(r))return t(a);let s=0;for(let i=0,c=a.length;i<c;i++){const f=a.charCodeAt(i);if(f===37&&kr(a,i,c))s+=1,i+=2;else if(f<128)s+=1;else if(f<2048)s+=2;else if(f>=55296&&f<=56319&&i+1<c){const u=a.charCodeAt(i+1);u>=56320&&u<=57343?(s+=4,i++):s+=3}else s+=3}return s};function hl(e){const t=typeof e=="string"?e.indexOf("#"):-1;return pl(t===-1?e:e.slice(0,t),fl)}const fn="1.19.0",Br=64*1024,{isFunction:Tt}=p,ml=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),Ir=e=>{if(!p.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Rr=(e,...t)=>{try{return!!e(...t)}catch{return!1}},gl=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},yl=e=>{const t=p.global!==void 0&&p.global!==null?p.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=p.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:a,Request:o,Response:s}=e,i=a?Tt(a):typeof fetch=="function",c=Tt(o),f=Tt(s);if(!i)return!1;const u=i&&Tt(n),d=i&&(typeof r=="function"?(m=>w=>m.encode(w))(new r):async m=>new Uint8Array(await new o(m).arrayBuffer())),h=c&&u&&Rr(()=>{let m=!1;const w=new o(B.origin,{body:new n,method:"POST",get duplex(){return m=!0,"half"}}),S=w.headers.has("Content-Type");return w.body!=null&&w.body.cancel(),m&&!S}),E=f&&u&&Rr(()=>p.isReadableStream(new s("").body)),v={stream:E&&(m=>m.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!v[m]&&(v[m]=(w,S)=>{let N=w&&w[m];if(N)return N.call(w);throw new C(`Response type '${m}' is not supported`,C.ERR_NOT_SUPPORT,S)})});const _=async m=>{if(m==null)return 0;if(p.isBlob(m))return m.size;if(p.isSpecCompliantForm(m))return(await new o(B.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(p.isArrayBufferView(m)||p.isArrayBuffer(m))return m.byteLength;if(p.isURLSearchParams(m)&&(m=m+""),p.isString(m))return(await d(m)).byteLength},y=async(m,w)=>{const S=p.toFiniteNumber(m.getContentLength());return S??_(w)};return async m=>{let{url:w,method:S,data:N,signal:x,cancelToken:A,timeout:$,onDownloadProgress:ne,onUploadProgress:Pe,responseType:F,headers:L,withCredentials:J="same-origin",fetchOptions:Ut,maxContentLength:Q,maxBodyLength:Mt}=xr(m);const ct=p.isNumber(Q)&&Q>-1,Pn=p.isNumber(Mt)&&Mt>-1,kc=P=>p.hasOwnProp(m,P)?m[P]:void 0;let Va=a||fetch;F=F?(F+"").toLowerCase():"text";let fe=al([x,A&&A.toAbortSignal()],$),I=null;const xe=fe&&fe.unsubscribe&&(()=>{fe.unsubscribe()});let We,dt=null;const za=()=>new C("Request body larger than maxBodyLength limit",C.ERR_BAD_REQUEST,m,I);try{let P;const H=kc("auth");if(H){const O=p.getSafeProp(H,"username")||"",W=p.getSafeProp(H,"password")||"";P={username:O,password:W}}if(gl(w)){const O=new URL(w,B.origin);if(!P&&(O.username||O.password)){const W=Ir(O.username),pe=Ir(O.password);P={username:W,password:pe}}(O.username||O.password)&&(O.username="",O.password="",w=O.href)}if(P&&(L.delete("authorization"),L.set("Authorization","Basic "+btoa(ml((P.username||"")+":"+(P.password||""))))),ct&&typeof w=="string"&&w.startsWith("data:")&&hl(w)>Q)throw new C("maxContentLength size of "+Q+" exceeded",C.ERR_BAD_RESPONSE,m,I);if(Pn&&S!=="get"&&S!=="head"){const O=await _(N);if(typeof O=="number"&&isFinite(O)&&(We=O,O>Mt))throw za()}const jt=Pn&&(p.isReadableStream(N)||p.isStream(N)),Ha=(O,W,pe)=>Dr(O,Br,De=>{if(Pn&&De>Mt)throw dt=za();W&&W(De)},pe);if(h&&S!=="get"&&S!=="head"&&(Pe||jt)){if(We=We??await y(L,N),We!==0||jt){let O=new o(w,{method:"POST",body:N,duplex:"half"}),W;if(p.isFormData(N)&&(W=O.headers.get("content-type"))&&L.setContentType(W),O.body){const[pe,De]=Pe&&Nr(We,Ot(Or(Pe)))||[];N=Ha(O.body,pe,De)}}}else if(jt&&!c&&u&&S!=="get"&&S!=="head")N=Ha(N);else if(jt&&c&&!h&&S!=="get"&&S!=="head")throw new C("Stream request bodies are not supported by the current fetch implementation",C.ERR_NOT_SUPPORT,m,I);p.isString(J)||(J=J?"include":"omit");const Lc=c&&"credentials"in o.prototype;if(p.isFormData(N)){const O=L.getContentType();O&&/^multipart\/form-data/i.test(O)&&!/boundary=/i.test(O)&&L.delete("content-type")}L.set("User-Agent","axios/"+fn,!1);const qa={...Ut,signal:fe,method:S.toUpperCase(),headers:ur(L.normalize()),body:N,duplex:"half",credentials:Lc?J:void 0};I=c&&new o(w,qa);let re=await(c?Va(I,Ut):Va(w,qa));const Ja=R.from(re.headers);if(ct){const O=p.toFiniteNumber(Ja.getContentLength());if(O!=null&&O>Q)throw new C("maxContentLength size of "+Q+" exceeded",C.ERR_BAD_RESPONSE,m,I)}const xn=E&&(F==="stream"||F==="response");if(E&&re.body&&(ne||ct||xn&&xe)){const O={};["status","statusText","headers"].forEach(ut=>{O[ut]=re[ut]});const W=p.toFiniteNumber(Ja.getContentLength()),[pe,De]=ne&&Nr(W,Ot(Or(ne),!0))||[];let Ka=0;const Bc=ut=>{if(ct&&(Ka=ut,Ka>Q))throw new C("maxContentLength size of "+Q+" exceeded",C.ERR_BAD_RESPONSE,m,I);pe&&pe(ut)};re=new s(Dr(re.body,Br,Bc,()=>{De&&De(),xe&&xe()}),O)}F=F||"text";let ae=await v[p.findKey(v,F)||"text"](re,m);if(ct&&!E&&!xn){let O;if(ae!=null&&(typeof ae.byteLength=="number"?O=ae.byteLength:typeof ae.size=="number"?O=ae.size:typeof ae=="string"&&(O=typeof r=="function"?new r().encode(ae).byteLength:ae.length)),typeof O=="number"&&O>Q)throw new C("maxContentLength size of "+Q+" exceeded",C.ERR_BAD_RESPONSE,m,I)}return!xn&&xe&&xe(),await new Promise((O,W)=>{_r(O,W,{data:ae,headers:R.from(re.headers),status:re.status,statusText:re.statusText,config:m,request:I})})}catch(P){if(xe&&xe(),fe&&fe.aborted&&fe.reason instanceof C){const H=fe.reason;throw H.config=m,I&&(H.request=I),P!==H&&Object.defineProperty(H,"cause",{__proto__:null,value:P,writable:!0,enumerable:!1,configurable:!0}),H}if(dt)throw I&&!dt.request&&(dt.request=I),dt;if(P instanceof C)throw I&&!P.request&&(P.request=I),P;if(P&&P.name==="TypeError"&&/Load failed|fetch/i.test(P.message)){const H=new C("Network Error",C.ERR_NETWORK,m,I,P&&P.response);throw Object.defineProperty(H,"cause",{__proto__:null,value:P.cause||P,writable:!0,enumerable:!1,configurable:!0}),H}throw C.from(P,P&&P.code,m,I,P&&P.response)}}},wl=new Map,Ur=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let s=o.length,i=s,c,f,u=wl;for(;i--;)c=o[i],f=u.get(c),f===void 0&&u.set(c,f=i?new Map:yl(t)),u=f;return f};Ur();const pn={http:Ai,xhr:rl,fetch:{get:Ur}};p.forEach(pn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Mr=e=>`- ${e}`,bl=e=>p.isFunction(e)||e===null||e===!1;function vl(e,t){e=p.isArray(e)?e:[e];const{length:n}=e;let r,a;const o={};for(let s=0;s<n;s++){r=e[s];let i;if(a=r,!bl(r)&&(a=pn[(i=String(r)).toLowerCase()],a===void 0))throw new C(`Unknown adapter '${i}'`);if(a&&(p.isFunction(a)||(a=a.get(t))))break;o[i||"#"+s]=a}if(!a){const s=Object.entries(o).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=n?s.length>1?`since :
6
+ `+s.map(Mr).join(`
7
+ `):" "+Mr(s[0]):"as no adapter specified";throw new C("There is no suitable adapter to dispatch the request "+i,C.ERR_NOT_SUPPORT)}return a}const jr={getAdapter:vl,adapters:pn};function hn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function mn(e){return hn(e),e.headers=R.from(e.headers),e.data=un.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),jr.getAdapter(e.adapter||tt.adapter,e)(e).then(function(r){hn(e),e.response=r;try{r.data=un.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=R.from(r.headers),r},function(r){if(!Cr(r)&&(hn(e),r&&r.response)){e.response=r.response;try{r.response.data=un.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=R.from(r.response.headers)}return Promise.reject(r)})}const At={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{At[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const $r={};At.transitional=function(t,n,r){function a(o,s){return"[Axios v"+fn+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,i)=>{if(t===!1)throw new C(a(s," has been removed"+(n?" in "+n:"")),C.ERR_DEPRECATED);return n&&!$r[s]&&($r[s]=!0,console.warn(a(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,i):!0}},At.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Sl(e,t,n){if(typeof e!="object"||e===null)throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){const i=e[o],c=i===void 0||s(i,o,e);if(c!==!0)throw new C("option "+o+" must be "+c,C.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new C("Unknown option "+o,C.ERR_BAD_OPTION)}}const Pt={assertOptions:Sl,validators:At},U=Pt.validators;let be=class{constructor(t){this.defaults=t||{},this.interceptors={request:new br,response:new br}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=(()=>{if(!a.stack)return"";const s=a.stack.indexOf(`
8
+ `);return s===-1?"":a.stack.slice(s+1)})();try{if(!r.stack)r.stack=o;else if(o){const s=o.indexOf(`
9
+ `),i=s===-1?-1:o.indexOf(`
10
+ `,s+1),c=i===-1?"":o.slice(i+1);String(r.stack).endsWith(c)||(r.stack+=`
11
+ `+o)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=we(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&Pt.assertOptions(r,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean),legacyInterceptorReqResOrdering:U.transitional(U.boolean),advertiseZstdAcceptEncoding:U.transitional(U.boolean),validateStatusUndefinedResolves:U.transitional(U.boolean)},!1),a!=null&&(p.isFunction(a)?n.paramsSerializer={serialize:a}:Pt.assertOptions(a,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Pt.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&p.merge(o.common,o[n.method]);o&&p.forEach(["delete","get","head","post","put","patch","query","common"],v=>{delete o[v]}),n.headers=R.concat(s,o);const i=[];let c=!0;this.interceptors.request.forEach(function(_){if(typeof _.runWhen=="function"&&_.runWhen(n)===!1)return;c=c&&_.synchronous;const y=n.transitional||ln;y&&y.legacyInterceptorReqResOrdering?i.unshift(_.fulfilled,_.rejected):i.push(_.fulfilled,_.rejected)});const f=[];this.interceptors.response.forEach(function(_){f.push(_.fulfilled,_.rejected)});let u,d=0,h;if(!c){const v=[mn.bind(this),void 0];for(v.unshift(...i),v.push(...f),h=v.length,u=Promise.resolve(n);d<h;)u=u.then(v[d++],v[d++]);return u}h=i.length;let E=n;for(;d<h;){const v=i[d++],_=i[d++];try{E=v?v(E):E}catch(y){if(!_){u=Promise.reject(y);break}try{const m=_.call(this,y);p.isThenable(m)&&(u=Promise.resolve(m).then(()=>mn.call(this,E)))}catch(m){u=Promise.reject(m)}break}}if(!u)try{u=mn.call(this,E)}catch(v){u=Promise.reject(v)}for(d=0,h=f.length;d<h;)u=u.then(f[d++],f[d++]);return u}getUri(t){t=we(this.defaults,t);const n=Ar(t.baseURL,t.url,t.allowAbsoluteUrls,t);return wr(n,t.params,t.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(t){be.prototype[t]=function(n,r){return this.request(we(r||{},{method:t,url:n,data:r&&p.hasOwnProp(r,"data")?r.data:void 0}))}}),p.forEach(["post","put","patch","query"],function(t){function n(r){return function(o,s,i){return this.request(we(i||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}be.prototype[t]=n(),t!=="query"&&(be.prototype[t+"Form"]=n(!0))});let El=class Ga{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(a=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](a);r._listeners=null}),this.promise.then=a=>{let o;const s=new Promise(i=>{r.subscribe(i),o=i}).then(a);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,i){r.reason||(r.reason=new nt(o,s,i),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ga(function(a){t=a}),cancel:t}}};function Cl(e){return function(n){return e.apply(null,n)}}function _l(e){return p.isObject(e)&&e.isAxiosError===!0}const gn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(gn).forEach(([e,t])=>{gn[t]=e});function Wr(e){const t=new be(e),n=er(be.prototype.request,t);return p.extend(n,be.prototype,t,{allOwnKeys:!0}),p.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return Wr(we(e,a))},n}const k=Wr(tt);k.Axios=be,k.CanceledError=nt,k.CancelToken=El,k.isCancel=Cr,k.VERSION=fn,k.toFormData=Nt,k.AxiosError=C,k.Cancel=k.CanceledError,k.all=function(t){return Promise.all(t)},k.spread=Cl,k.isAxiosError=_l,k.mergeConfig=we,k.AxiosHeaders=R,k.formToJSON=e=>Er(p.isHTMLForm(e)?new FormData(e):e),k.getAdapter=jr.getAdapter,k.HttpStatusCode=gn,k.default=k;const{Axios:zc,AxiosError:Hc,CanceledError:qc,isCancel:Jc,CancelToken:Kc,VERSION:Xc,all:Gc,Cancel:Yc,isAxiosError:Qc,spread:Zc,toFormData:ed,AxiosHeaders:td,HttpStatusCode:nd,formToJSON:rd,getAdapter:ad,mergeConfig:od,create:sd}=k;function xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)r!=="__proto__"&&(e[r]=n[r])}return e}var Nl={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function yn(e,t){function n(a,o,s){if(!(typeof document>"u")){s=xt({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var c in s)s[c]&&(i+="; "+c,s[c]!==!0&&(i+="="+s[c].split(";")[0]));return document.cookie=a+"="+e.write(o,a)+i}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var o=document.cookie?document.cookie.split("; "):[],s={},i=0;i<o.length;i++){var c=o[i].split("="),f=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(u in s||(s[u]=e.read(f,u)),a===u)break}catch{}}return a?s[a]:s}}return Object.create({set:n,get:r,remove:function(a,o){n(a,"",xt({},o,{expires:-1}))},withAttributes:function(a){return yn(this.converter,xt({},this.attributes,a))},withConverter:function(a){return yn(xt({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var ie=yn(Nl,{path:"/"});const Ol={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let Ue="https://api-grievance.airaops.com";try{if(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:$t&&$t.tagName.toUpperCase()==="SCRIPT"&&$t.src||new URL("complaint-app.umd.js",document.baseURI).href}<"u"&&Ol?.VITE_API_URL)Ue=void 0;else{const e=typeof process<"u"?process:null;e?.env?.VITE_API_URL&&(Ue=e.env.VITE_API_URL)}}catch{}const Vr=e=>{Ue=e||"",j.defaults.baseURL=Ue},zr=e=>{e?ie.set("token",e,{secure:!0,sameSite:"Strict"}):ie.remove("token")},Tl=()=>ie.get("token")||null,j=k.create({baseURL:Ue,transformRequest:[function(e,t){const n=Tl();return n?t.Authorization=`Bearer ${n}`:delete t.Authorization,e==null||typeof e=="string"?e:JSON.stringify(e)}],headers:{Accept:"application/json","Content-Type":"application/json"}});let wn=!1,bn=null;j.interceptors.response.use(e=>e,async e=>{const t=e.config,n=e.response;if(n&&(n.status===401||n.status===402)){const r=ie.get("refreshToken");if(r)try{wn||(wn=!0,bn=k.post(`${Ue}/api/v1/auth/refresh`,{},{headers:{Authorization:`Bearer ${r}`}}));const a=await bn,{token:o,refreshToken:s}=a.data;return ie.set("token",o,{secure:!0,sameSite:"Strict"}),s&&ie.set("refreshToken",s),t.headers.Authorization=`Bearer ${o}`,j(t)}catch{ie.remove("token"),ie.remove("refreshToken")}finally{wn=!1,bn=null}}return Promise.reject(e)});const Al=D.createContext(null),Hr=({children:e,apiUrl:t,authToken:n})=>(D.useEffect(()=>{t&&Vr(t)},[t]),D.useEffect(()=>{zr(n||null)},[n]),l.jsx(Al.Provider,{value:{apiUrl:t,authToken:n},children:e})),ee={mode:"light",colors:{primary:"#2D64B8",primaryHover:"#2557A3",text:"#111827",textSecondary:"#6B7280",textMuted:"#9CA3AF",border:"#E5E7EB",borderLight:"#F3F4F6",background:"#F5F5F5",surface:"#FFFFFF",white:"#FFFFFF",onPrimary:"#FFFFFF",activeBg:"#ECFDF5",activeBorder:"#A7F3D0",activeText:"#059669",inactiveBg:"#F3F4F6",inactiveBorder:"#D1D5DB",inactiveText:"#6B7280",link:"#2D64B8",divider:"#E5E7EB",accentBorder:"#C5D7F0",accentBg:"#EEF4FB",stepDone:"#D6E4F7",success:"#22C55E",danger:"#EF4444",secondaryBtn:"#D1D5DB",secondaryBtnHover:"#C4C9D1",inputBg:"#FFFFFF",tableHeadBg:"#EEF4FB",sidebarBg:"#FAFBFD",overlay:"rgba(16, 24, 40, 0.06)"},radii:{sm:"6px",md:"8px",lg:"12px",xl:"16px",pill:"999px"},spacing:{xs:"4px",sm:"8px",md:"12px",lg:"16px",xl:"24px",xxl:"32px"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',h1Size:"28px",h2Size:"16px",bodySize:"14px",labelSize:"13px",valueSize:"22px",smallSize:"13px"},shadow:{card:"0 1px 2px rgba(16, 24, 40, 0.04)",settings:"0 1px 3px rgba(16, 24, 40, 0.06)"}},rt={mode:"dark",colors:{primary:"#5B8DEF",primaryHover:"#7BA3F3",text:"#F3F4F6",textSecondary:"#A1A1AA",textMuted:"#71717A",border:"#3F3F46",borderLight:"#27272A",background:"#0F1115",surface:"#18181B",white:"#FFFFFF",onPrimary:"#FFFFFF",activeBg:"#052E1C",activeBorder:"#166534",activeText:"#4ADE80",inactiveBg:"#27272A",inactiveBorder:"#3F3F46",inactiveText:"#A1A1AA",link:"#7BA3F3",divider:"#3F3F46",accentBorder:"#2A3A55",accentBg:"#1A2333",stepDone:"#1E3A5F",success:"#22C55E",danger:"#F87171",secondaryBtn:"#3F3F46",secondaryBtnHover:"#52525B",inputBg:"#18181B",tableHeadBg:"#1A2333",sidebarBg:"#12141A",overlay:"rgba(0, 0, 0, 0.35)"},radii:{sm:"6px",md:"8px",lg:"12px",xl:"16px",pill:"999px"},spacing:{xs:"4px",sm:"8px",md:"12px",lg:"16px",xl:"24px",xxl:"32px"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',h1Size:"28px",h2Size:"16px",bodySize:"14px",labelSize:"13px",valueSize:"22px",smallSize:"13px"},shadow:{card:"0 1px 2px rgba(0, 0, 0, 0.35)",settings:"0 1px 3px rgba(0, 0, 0, 0.4)"}},qr={light:ee,dark:rt};function Me(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function je(e,t){if(!Me(t))return e;const n={...e};return Object.keys(t).forEach(r=>{const a=t[r];Me(a)&&Me(e[r])?n[r]=je(e[r],a):a!==void 0&&(n[r]=a)}),n}function Jr(e){return!e||!Me(e)?{light:ee,dark:rt}:Me(e.light)||Me(e.dark)?{light:je(ee,e.light||{}),dark:je(rt,e.dark||{})}:{light:je(ee,e),dark:je(rt,e)}}function Kr(e,t=!1){const n=Jr(e);return{...t?n.dark:n.light,mode:t?"dark":"light",__pack:n}}const Pl={primary:"--ca-primary",primaryHover:"--ca-primary-hover",text:"--ca-text",textSecondary:"--ca-text-secondary",textMuted:"--ca-text-muted",border:"--ca-border",borderLight:"--ca-border-light",background:"--ca-bg",surface:"--ca-surface",white:"--ca-white",onPrimary:"--ca-on-primary",activeBg:"--ca-active-bg",activeBorder:"--ca-active-border",activeText:"--ca-active-text",inactiveBg:"--ca-inactive-bg",inactiveBorder:"--ca-inactive-border",inactiveText:"--ca-inactive-text",link:"--ca-link",divider:"--ca-divider",accentBorder:"--ca-accent-border",accentBg:"--ca-accent-bg",stepDone:"--ca-step-done",success:"--ca-success",danger:"--ca-danger",secondaryBtn:"--ca-secondary-btn",secondaryBtnHover:"--ca-secondary-btn-hover",inputBg:"--ca-input-bg",tableHeadBg:"--ca-table-head-bg",sidebarBg:"--ca-sidebar-bg",overlay:"--ca-overlay"},xl={sm:"--ca-radius-sm",md:"--ca-radius-md",lg:"--ca-radius-lg",xl:"--ca-radius-xl",pill:"--ca-radius-pill"},Dl={fontFamily:"--ca-font",h1Size:"--ca-h1-size",h2Size:"--ca-h2-size",bodySize:"--ca-body-size",labelSize:"--ca-label-size",valueSize:"--ca-value-size",smallSize:"--ca-small-size"},Fl={card:"--ca-shadow-card",settings:"--ca-shadow-settings"};function Xr(e){const t={};return e?.colors&&Object.entries(Pl).forEach(([n,r])=>{e.colors[n]!=null&&(t[r]=e.colors[n])}),e?.radii&&Object.entries(xl).forEach(([n,r])=>{e.radii[n]!=null&&(t[r]=e.radii[n])}),e?.typography&&Object.entries(Dl).forEach(([n,r])=>{e.typography[n]!=null&&(t[r]=e.typography[n])}),e?.shadow&&Object.entries(Fl).forEach(([n,r])=>{e.shadow[n]!=null&&(t[r]=e.shadow[n])}),t["--ca-on-primary"]&&!t["--ca-white"]&&(t["--ca-white"]=t["--ca-on-primary"]),t}const Gr=D.createContext({darkMode:!1,theme:null,themeFile:qr,cssVars:{}});function Yr({theme:e,darkMode:t=!1,children:n}){const r=D.useMemo(()=>{const a=Kr(e,!!t),o=Xr(a);return{darkMode:!!t,theme:a,themeFile:a.__pack,cssVars:o,mode:a.mode}},[e,t]);return l.jsx(Gr.Provider,{value:r,children:n})}function Qr(){return D.useContext(Gr)}const X=Object.freeze({types:"/api/v1/complaints/types",departments:"/api/v1/complaints/departments",departmentTree:"/api/v1/complaints/departments/tree",priorities:"/api/v1/complaints/priorities",workflows:"/api/v1/complaints/workflows",workflowSteps:"/api/v1/complaints/workflows/steps",statuses:"/api/v1/complaints/statuses"}),kl=(e,t)=>t.rejectWithValue({status:e?.response?.status??e?.status,message:e?.response?.data?.message??e?.response?.data?.error??e?.message??"Something went wrong"}),te=(e,t)=>ft.createAsyncThunk(e,async(n,r)=>{try{return(await t(n,r)).data}catch(a){return kl(a,r)}}),at=(e,t)=>({list:te(`complaint/${e}/list`,(n,{signal:r})=>j.get(t,{params:n,signal:r})),getById:te(`complaint/${e}/getById`,(n,{signal:r})=>j.get(`${t}/${n}`,{signal:r})),create:te(`complaint/${e}/create`,n=>j.post(t,n)),update:te(`complaint/${e}/update`,({id:n,data:r})=>j.patch(`${t}/${n}`,r)),remove:te(`complaint/${e}/remove`,n=>j.delete(`${t}/${n}`))}),ve=at("types",X.types),Se=at("departments",X.departments),Ee=at("priorities",X.priorities),Ce=at("workflows",X.workflows),_e=at("statuses",X.statuses),Dt=te("complaint/departments/getTree",(e,{signal:t})=>j.get(X.departmentTree,{signal:t})),Ft=te("complaint/workflows/getSteps",(e,{signal:t})=>j.get(`${X.workflowSteps}/${e}`,{signal:t})),kt=te("complaint/workflows/saveSteps",e=>j.post(X.workflowSteps,e)),Zr=te("complaint/workflows/deleteSteps",e=>j.delete(`${X.workflowSteps}/${e}`)),Ll=ve.list,Bl=ve.getById,Il=ve.create,Rl=ve.update,Ul=ve.remove,Ml=Se.list,jl=Se.getById,$l=Se.create,Wl=Se.update,Vl=Se.remove,zl=Ee.list,Hl=Ee.getById,ql=Ee.create,Jl=Ee.update,Kl=Ee.remove,Xl=Ce.list,Gl=Ce.getById,Yl=Ce.create,Ql=Ce.update,Zl=Ce.remove,ec=_e.list,tc=_e.getById,nc=_e.create,rc=_e.update,ac=_e.remove,ot=()=>({data:[],selected:null,pagination:null,isLoading:!1,isMutating:!1,error:null}),ea={types:ot(),departments:ot(),priorities:ot(),workflows:ot(),statuses:ot(),departmentTree:[],workflowSteps:{},isLoadingDepartmentTree:!1,isLoadingWorkflowSteps:!1,error:null},oc=e=>{if(Array.isArray(e))return{data:e,pagination:null};const t=e?.data??e;return Array.isArray(t)?{data:t,pagination:e?.pagination??null}:{data:t?.results??t?.items??[],pagination:t?.pagination??e?.pagination??null}},st=e=>e?.data??e,Lt=e=>e?.id??e?._id,sc=(e,t)=>{if(!t||typeof t!="object")return e;const n=Lt(t);if(n==null)return e;const r=e.findIndex(o=>Lt(o)===n);if(r<0)return[t,...e];const a=[...e];return a[r]=t,a},Ne=e=>e.payload?.message??e.error?.message??"Something went wrong",it=(e,t,n)=>{e.addCase(n.list.pending,r=>{r[t].isLoading=!0,r[t].error=null}).addCase(n.list.fulfilled,(r,a)=>{const o=oc(a.payload);r[t].isLoading=!1,r[t].data=o.data,r[t].pagination=o.pagination}).addCase(n.list.rejected,(r,a)=>{r[t].isLoading=!1,r[t].error=Ne(a)}).addCase(n.getById.pending,r=>{r[t].isLoading=!0,r[t].error=null}).addCase(n.getById.fulfilled,(r,a)=>{r[t].isLoading=!1,r[t].selected=st(a.payload)}).addCase(n.getById.rejected,(r,a)=>{r[t].isLoading=!1,r[t].error=Ne(a)}),[n.create,n.update].forEach(r=>{e.addCase(r.pending,a=>{a[t].isMutating=!0,a[t].error=null}).addCase(r.fulfilled,(a,o)=>{const s=st(o.payload);a[t].isMutating=!1,a[t].selected=s,a[t].data=sc(a[t].data,s)}).addCase(r.rejected,(a,o)=>{a[t].isMutating=!1,a[t].error=Ne(o)})}),e.addCase(n.remove.pending,r=>{r[t].isMutating=!0,r[t].error=null}).addCase(n.remove.fulfilled,(r,a)=>{const o=a.meta.arg;r[t].isMutating=!1,r[t].data=r[t].data.filter(s=>Lt(s)!==o),Lt(r[t].selected)===o&&(r[t].selected=null)}).addCase(n.remove.rejected,(r,a)=>{r[t].isMutating=!1,r[t].error=Ne(a)})},ta=ft.createSlice({name:"complaintAppComplaint",initialState:ea,reducers:{clearComplaintError(e,t){const n=t.payload;n&&e[n]?.error!==void 0?e[n].error=null:e.error=null},clearSelectedComplaintResource(e,t){const n=t.payload;n&&e[n]?.selected!==void 0&&(e[n].selected=null)},resetComplaintState(){return ea}},extraReducers:e=>{it(e,"types",ve),it(e,"departments",Se),it(e,"priorities",Ee),it(e,"workflows",Ce),it(e,"statuses",_e),e.addCase(Dt.pending,t=>{t.isLoadingDepartmentTree=!0,t.error=null}).addCase(Dt.fulfilled,(t,n)=>{t.isLoadingDepartmentTree=!1;const r=st(n.payload);t.departmentTree=Array.isArray(r)?r:r?.tree??r?.items??[]}).addCase(Dt.rejected,(t,n)=>{t.isLoadingDepartmentTree=!1,t.error=Ne(n)}).addCase(Ft.pending,t=>{t.isLoadingWorkflowSteps=!0,t.error=null}).addCase(Ft.fulfilled,(t,n)=>{t.isLoadingWorkflowSteps=!1,t.workflowSteps[n.meta.arg]=st(n.payload)}).addCase(Ft.rejected,(t,n)=>{t.isLoadingWorkflowSteps=!1,t.error=Ne(n)}).addCase(kt.pending,t=>{t.isLoadingWorkflowSteps=!0,t.error=null}).addCase(kt.fulfilled,(t,n)=>{t.isLoadingWorkflowSteps=!1;const r=st(n.payload),a=n.meta.arg?.workflowId??r?.workflowId??r?.id;a!==void 0&&(t.workflowSteps[a]=r)}).addCase(kt.rejected,(t,n)=>{t.isLoadingWorkflowSteps=!1,t.error=Ne(n)}).addCase(Zr.fulfilled,(t,n)=>{delete t.workflowSteps[n.meta.arg]})}}),{clearComplaintError:ic,clearSelectedComplaintResource:lc,resetComplaintState:cc}=ta.actions,na=ta.reducer,dc=ft.combineReducers({complaintAppComplaint:na}),ra=e=>ft.configureStore({reducer:dc,preloadedState:e,middleware:t=>t({immutableCheck:!1,serializableCheck:!1})}),aa=ra();function G({children:e,variant:t="primary",size:n="md",startIcon:r,endIcon:a,className:o="",type:s="button",disabled:i=!1,onClick:c,...f}){const u=["ca-btn",`ca-btn--${t}`,n==="sm"?"ca-btn--sm":"",n==="lg"?"ca-btn--lg":"",o].filter(Boolean).join(" ");return l.jsxs("button",{type:s,className:u,disabled:i,onClick:c,...f,children:[r?l.jsx("span",{className:"ca-btn__icon",children:r}):null,e,a?l.jsx("span",{className:"ca-btn__icon",children:a}):null]})}function vn({size:e=16,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:l.jsx("path",{d:"M12 5v14M5 12h14",stroke:t,strokeWidth:"2",strokeLinecap:"round"})})}const oa={h1:"ca-h1",h2:"ca-h2",body:"ca-body",label:"ca-label",value:"ca-value",small:"ca-small",link:"ca-link"},uc={h1:"h1",h2:"h2",body:"p",label:"span",value:"span",small:"span",link:"button"};function le({variant:e="body",as:t,className:n="",children:r,...a}){const o=t||uc[e]||"p",s=oa[e]||oa.body;return l.jsx(o,{className:`${s} ${n}`.trim(),...a,children:r})}function Sn(e){return l.jsx(le,{variant:"h1",...e})}function ce(e){return l.jsx(le,{variant:"h2",...e})}function Y(e){return l.jsx(le,{variant:"body",...e})}function Bt(e){return l.jsx(le,{variant:"label",...e})}function sa(e){return l.jsx(le,{variant:"value",...e})}function ia(e){return l.jsx(le,{variant:"link",type:"button",...e})}function la({title:e="Complaint Management",description:t,actionLabel:n="Create New Form",onAction:r,className:a=""}){return l.jsxs("header",{className:`ca-page-header ${a}`.trim(),children:[l.jsxs("div",{className:"ca-page-header__text",children:[l.jsx(Sn,{children:e}),t?l.jsx(Y,{children:t}):null]}),l.jsx("div",{className:"ca-page-header__actions",children:l.jsx(G,{startIcon:l.jsx(vn,{}),onClick:r,children:n})})]})}function En({status:e="inactive",label:t,className:n=""}){const a=String(e).toLowerCase()==="active",o=t??(a?"Active":"Inactive");return l.jsx("span",{className:`ca-badge ca-badge--${a?"active":"inactive"} ${n}`.trim(),children:o})}function ca({title:e,status:t,statusLabel:n,titleAsLink:r=!1,onTitleClick:a,className:o=""}){return l.jsxs("div",{className:`ca-system-card__header ${o}`.trim(),children:[l.jsx("div",{className:"ca-system-card__title-wrap",children:r?l.jsx("button",{type:"button",className:"ca-h2 ca-h2--link",onClick:a,children:e}):l.jsx(ce,{children:e})}),l.jsx(En,{status:t,label:n})]})}function lt({size:e=16,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:l.jsx("path",{d:"M9 6l6 6-6 6",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function da({updatedOn:e,configureLabel:t="Configure",onConfigure:n,className:r=""}){return l.jsxs("div",{className:`ca-system-card__footer ${r}`.trim(),children:[l.jsx(le,{variant:"small",as:"span",children:e?`Updated on ${e}`:""}),l.jsx(G,{size:"sm",onClick:n,endIcon:l.jsx(lt,{size:14,color:"#fff"}),children:t})]})}function ua({label:e,value:t,className:n=""}){const r=t==null?"—":typeof t=="number"?String(t).padStart(2,"0"):t;return l.jsxs("div",{className:`ca-data-point ${n}`.trim(),children:[l.jsx(Bt,{children:e}),l.jsx(sa,{children:r})]})}function fa({className:e=""}){return l.jsx("div",{className:`ca-divider ${e}`.trim(),role:"separator","aria-orientation":"vertical"})}function pa({id:e,title:t,status:n="inactive",statusLabel:r,description:a,descriptionHref:o,departments:s,workflows:i,fields:c,formsFilled:f,updatedOn:u,titleAsLink:d=!1,onTitleClick:h,onDescriptionClick:E,onConfigure:v,className:_=""}){const y=()=>{v?.({id:e,title:t,status:n,departments:s,workflows:i,fields:c,formsFilled:f,updatedOn:u})},m=()=>{if(E){E({id:e,title:t,descriptionHref:o});return}o&&typeof window<"u"&&window.open(o,"_blank","noopener,noreferrer")},w=[{label:"Departments",value:s},{label:"Workflows",value:i},{label:"Fields",value:c},{label:"Forms Filled",value:f}];return l.jsxs("article",{className:`ca-system-card ${_}`.trim(),children:[l.jsx(ca,{title:t,status:n,statusLabel:r,titleAsLink:d,onTitleClick:()=>h?.({id:e,title:t})}),a?l.jsx(ia,{onClick:m,children:a}):null,l.jsx("div",{className:"ca-system-card__stats",children:w.map((S,N)=>l.jsxs(D.Fragment,{children:[N>0?l.jsx(fa,{}):null,l.jsx(ua,{label:S.label,value:S.value})]},S.label))}),l.jsx(da,{updatedOn:u,onConfigure:y})]})}function ha({systems:e=[],onConfigure:t,onTitleClick:n,onDescriptionClick:r,emptyMessage:a="No systems found.",className:o=""}){return e.length?l.jsx("div",{className:`ca-system-grid ${o}`.trim(),children:e.map(s=>l.jsx(pa,{...s,onConfigure:t,onTitleClick:n,onDescriptionClick:r},s.id??s.title))}):l.jsx("div",{className:`ca-system-grid ${o}`.trim(),children:l.jsx("div",{className:"ca-empty",children:l.jsx(Y,{children:a})})})}function de({value:e,onChange:t,placeholder:n,type:r="text",icon:a,className:o="",inputClassName:s="",...i}){return l.jsxs("div",{className:`ca-input-wrap ${o}`.trim(),children:[a?l.jsx("span",{className:"ca-input-wrap__icon",children:a}):null,l.jsx("input",{type:r,className:`ca-input ${a?"ca-input--with-icon":""} ${s}`.trim(),value:e,onChange:t,placeholder:n,...i})]})}function ma({size:e=18,color:t="currentColor",...n}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:[l.jsx("path",{d:"M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15Z",stroke:t,strokeWidth:"1.75"}),l.jsx("path",{d:"M16.5 16.5 21 21",stroke:t,strokeWidth:"1.75",strokeLinecap:"round"})]})}function ga({value:e,onChange:t,onSearch:n,placeholder:r="Search",className:a=""}){const o=s=>{s.key==="Enter"&&n&&n(e)};return l.jsx("div",{className:`ca-search ${a}`.trim(),children:l.jsx(de,{value:e,onChange:t,onKeyDown:o,placeholder:r,icon:l.jsx(ma,{}),"aria-label":r})})}function ya({text:e="Loading",fullScreen:t=!1}){return l.jsxs("div",{className:"ca-loading",style:t?{minHeight:"calc(100vh - 80px)"}:void 0,role:"status","aria-live":"polite",children:[l.jsx("span",{className:"ca-loading__spinner"}),l.jsxs("span",{children:[e,"…"]})]})}const wa=[{id:"qms",title:"QMS - Query Management System",status:"active",description:"Description of the template",departments:3,workflows:12,fields:55,formsFilled:234,updatedOn:"12 Mar 2024",titleAsLink:!0},{id:"cms",title:"CMS - Complaint Management System",status:"active",description:"Description of the template",departments:5,workflows:8,fields:42,formsFilled:189,updatedOn:"08 Mar 2024"},{id:"fms",title:"FMS - Feedback Management System",status:"inactive",description:"Description of the template",departments:2,workflows:4,fields:28,formsFilled:56,updatedOn:"01 Feb 2024"},{id:"rms",title:"RMS - Request Management System",status:"active",description:"Description of the template",departments:4,workflows:10,fields:61,formsFilled:312,updatedOn:"20 Mar 2024"}],ba="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.";function va(e=[]){return e.map((t,n)=>({id:t.id??t._id??`system-${n}`,title:t.title??t.name??"Untitled",status:t.status??"inactive",statusLabel:t.statusLabel,description:t.description??t.templateDescription,descriptionHref:t.descriptionHref??t.url,departments:t.departments??t.departmentCount??0,workflows:t.workflows??t.workflowCount??0,fields:t.fields??t.fieldCount??0,formsFilled:t.formsFilled??t.formFilledCount??t.forms_filled??0,updatedOn:t.updatedOn??t.updatedAt??t.updated_on,titleAsLink:!!(t.titleAsLink??t.isLink)}))}function Sa({title:e="Complaint Management",description:t=ba,systems:n,systemsEndpoint:r,useDemoData:a=!0,createLabel:o="Create New Form",onCreateForm:s,onConfigure:i,onTitleClick:c,onDescriptionClick:f,onSearch:u}){const d=pt(),[h,E]=D.useState(""),[v,_]=D.useState(null),[y,m]=D.useState(null),[w,S]=D.useState(r&&!n?"loading":"idle");D.useEffect(()=>{if(!r||n)return;const F=new AbortController;return j.get(r,{signal:F.signal}).then(L=>{const J=L?.data,Ut=Array.isArray(J)?J:J?.data??J?.systems??J?.results??[];_(va(Ut)),m(null),S("success")}).catch(L=>{F.signal.aborted||(m(L?.message||"Failed to load systems"),_([]),S("error"))}),()=>F.abort()},[r,n]);const N=D.useMemo(()=>n?va(n):v||(a?wa:[]),[n,v,a]),x=D.useMemo(()=>{const F=h.trim().toLowerCase();return F?N.filter(L=>`${L.title} ${L.description??""} ${L.status??""}`.toLowerCase().includes(F)):N},[N,h]),A=F=>{const L=F.target.value;E(L),u?.(L)},$=F=>{i?.(F),d(`/settings/${F.id??"new"}?step=1`)},ne=()=>{s?.(),d("/settings/new?step=1")},Pe=w==="loading";return l.jsxs(l.Fragment,{children:[l.jsx(la,{title:e,description:t,actionLabel:o,onAction:ne}),l.jsx(ga,{value:h,onChange:A,placeholder:"Search"}),Pe?l.jsx(ya,{text:"Loading systems"}):y?l.jsx("div",{className:"ca-empty",children:l.jsx("p",{className:"ca-body",children:y})}):l.jsx(ha,{systems:x,onConfigure:$,onTitleClick:c,onDescriptionClick:f,emptyMessage:h?"No systems match your search.":"No systems found."})]})}function Cn({steps:e=[],currentStep:t=1,onStepClick:n,className:r="",size:a="md"}){return l.jsx("nav",{className:`ca-stepper ca-stepper--${a} ${r}`.trim(),"aria-label":"Progress",children:e.map((o,s)=>{const i=o.id??s+1,c=i===t,f=i<t,u=!!n&&(f||c);return l.jsxs(D.Fragment,{children:[s>0?l.jsx("div",{className:`ca-stepper__line ${f||c?"ca-stepper__line--active":""}`}):null,l.jsxs("button",{type:"button",className:["ca-stepper__item",c?"ca-stepper__item--active":"",f?"ca-stepper__item--done":""].filter(Boolean).join(" "),onClick:()=>u&&n?.(i),disabled:!u,"aria-current":c?"step":void 0,children:[l.jsx("span",{className:"ca-stepper__circle",children:i}),l.jsx("span",{className:"ca-stepper__label",children:o.label})]})]},i)})})}const Ea=D.createContext(null),Ca=()=>({categoryType:"",active:!1,description:"",roles:[],departmentRows:[{id:"1",department:"",subDepartment:"",roles:""}],priorityDraft:"",priorities:[],defaultPriorityId:null,selectedDeptNode:null,workflow:{name:"",tatMinutes:"",description:"",statuses:[],steps:[]},fieldDraft:{name:"",type:""},formFields:[]});function _a({children:e,initialValues:t}){const[n,r]=D.useState(()=>({...Ca(),...t,workflow:{...Ca().workflow,...t?.workflow}})),a=D.useCallback(i=>{r(c=>({...c,...i}))},[]),o=D.useCallback(i=>{r(c=>({...c,workflow:{...c.workflow,...i}}))},[]),s=D.useMemo(()=>({state:n,setState:r,update:a,updateWorkflow:o}),[n,a,o]);return l.jsx(Ea.Provider,{value:s,children:e})}function Oe(){const e=D.useContext(Ea);if(!e)throw new Error("useSettingsWizard must be used within SettingsWizardProvider");return e}const Te=[{id:1,key:"category",label:"Category Type",title:"Category Type",description:"Define the type and basic details for this category type."},{id:2,key:"departments",label:"Departments",title:"Departments",description:"----"},{id:3,key:"priorities",label:"Priorities",title:"Priorities",description:"----"},{id:4,key:"workflow",label:"Workflow",title:"Workflow",description:"----"},{id:5,key:"formFields",label:"Form Fields",title:"Form Fields",description:"----"},{id:6,key:"review",label:"Review & Publish",title:"Review & Publish",description:"Review your configuration and publish."}],_n=[{id:1,label:"Create Workflow"},{id:2,label:"Statuses"},{id:3,label:"Workflow Steps"}],fc=["Urgent","High","Medium","Low"],Na=[{id:"short",label:"Textfield / Short Answer",icon:"text"},{id:"long",label:"Description / Long Answer",icon:"doc"},{id:"date",label:"Date",icon:"calendar"},{id:"time",label:"Time",icon:"clock"},{id:"single",label:"Dropdown - Single Select",icon:"chevron"},{id:"multi",label:"Dropdown - Multiple Select",icon:"chevron"}],Oa=["Store Staff","HR Executive","HR Manager","Store Manager","Admin"],Ta=[{value:"qms",label:"QMS - Query Management System"},{value:"cms",label:"CMS - Complaint Management System"},{value:"fms",label:"FMS - Feedback Management System"},{value:"rms",label:"RMS - Request Management System"}],pc=[{id:"hr",name:"HR",children:[{id:"payroll",name:"Payroll"},{id:"recruitment",name:"Recruitment"}]},{id:"finance",name:"Finance",children:[{id:"ap",name:"Accounts Payable"}]},{id:"it",name:"IT",children:[]}],hc=[{value:"#EF4444",label:"Red"},{value:"#F59E0B",label:"Orange"},{value:"#EAB308",label:"Yellow"},{value:"#22C55E",label:"Green"},{value:"#3B82F6",label:"Blue"},{value:"#8B5CF6",label:"Purple"}];function Aa({size:e=28,color:t="currentColor",...n}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{color:"var(--ca-primary)"},...n,children:[l.jsx("path",{d:"M12 3 3 8l9 5 9-5-9-5Z",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round"}),l.jsx("path",{d:"M3 12.5 12 17.5l9-5",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"}),l.jsx("path",{d:"M3 16.5 12 21.5l9-5",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"})]})}function Pa({title:e,description:t,nextLabel:n="Next",onNext:r,showNext:a=!0,nextDisabled:o=!1,nextVariant:s="primary",className:i=""}){return l.jsxs("div",{className:`ca-settings-card__header ${i}`.trim(),children:[l.jsxs("div",{className:"ca-settings-card__heading",children:[l.jsx(Aa,{}),l.jsxs("div",{children:[l.jsx(ce,{children:e}),t?l.jsx(Y,{className:"ca-settings-card__desc",children:t}):null]})]}),a?l.jsx(G,{variant:s,disabled:o,onClick:r,endIcon:l.jsx(lt,{size:14,color:"currentColor"}),children:n}):null]})}function Ae({title:e,description:t,onNext:n,nextLabel:r,showNext:a=!0,nextDisabled:o,nextVariant:s,children:i,footer:c,className:f=""}){return l.jsxs("section",{className:`ca-settings-card ${f}`.trim(),children:[l.jsx(Pa,{title:e,description:t,onNext:n,nextLabel:r,showNext:a,nextDisabled:o,nextVariant:s}),l.jsx("div",{className:"ca-settings-card__divider"}),l.jsx("div",{className:"ca-settings-card__body",children:i}),c?l.jsx("div",{className:"ca-settings-card__footer",children:c}):null]})}function $e({children:e,hint:t,htmlFor:n,className:r=""}){return l.jsxs("div",{className:`ca-field-label ${r}`.trim(),children:[l.jsx("label",{className:"ca-label",htmlFor:n,children:e}),t!=null?l.jsx("span",{className:"ca-field-label__hint",children:t}):null]})}function xa({size:e=16,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...n,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ue({value:e,onChange:t,options:n=[],placeholder:r="Select",className:a="",disabled:o=!1,...s}){return l.jsxs("div",{className:`ca-select ${a}`.trim(),children:[l.jsxs("select",{className:"ca-select__control",value:e??"",onChange:t,disabled:o,...s,children:[l.jsx("option",{value:"",disabled:!0,children:r}),n.map(i=>{const c=typeof i=="string"?i:i.value,f=typeof i=="string"?i:i.label;return l.jsx("option",{value:c,children:f},c)})]}),l.jsx("span",{className:"ca-select__chevron",children:l.jsx(xa,{size:16})})]})}function Da({value:e,onChange:t,placeholder:n,maxLength:r,rows:a=4,className:o="",...s}){return l.jsx("textarea",{className:`ca-textarea ${o}`.trim(),value:e,onChange:t,placeholder:n,maxLength:r,rows:a,...s})}function It({label:e,hint:t,children:n,className:r="",htmlFor:a}){return l.jsxs("div",{className:`ca-form-field ${r}`.trim(),children:[e!=null?l.jsx($e,{htmlFor:a,hint:t,children:e}):null,n]})}function Nn({label:e,hint:t,...n}){return l.jsx(It,{label:e,hint:t,htmlFor:n.id,children:l.jsx(de,{...n})})}function Fa({label:e,hint:t,...n}){return l.jsx(It,{label:e,hint:t,htmlFor:n.id,children:l.jsx(ue,{...n})})}function On({label:e,hint:t,maxLength:n,value:r="",...a}){const o=t??(n!=null?`${String(r).length}/${n}`:void 0);return l.jsx(It,{label:e,hint:o,htmlFor:a.id,children:l.jsx(Da,{value:r,maxLength:n,...a})})}function Tn({checked:e=!1,onChange:t,disabled:n=!1,"aria-label":r="Toggle",className:a=""}){return l.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":r,disabled:n,className:`ca-toggle ${e?"ca-toggle--on":""} ${a}`.trim(),onClick:()=>t?.(!e),children:l.jsx("span",{className:"ca-toggle__thumb"})})}function ka({label:e="Active",checked:t,onChange:n,className:r=""}){return l.jsxs("div",{className:`ca-toggle-field ${r}`.trim(),children:[l.jsx(Bt,{children:e}),l.jsx(Tn,{checked:t,onChange:n,"aria-label":e})]})}function La({size:e=12,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...n,children:l.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:t,strokeWidth:"2",strokeLinecap:"round"})})}function Ba({label:e,onRemove:t,className:n=""}){return l.jsxs("span",{className:`ca-tag ${n}`.trim(),children:[e,t?l.jsx("button",{type:"button",className:"ca-tag__remove",onClick:t,"aria-label":`Remove ${e}`,children:l.jsx(La,{size:10})}):null]})}function Ia({label:e="Select Roles",options:t=[],value:n=[],onChange:r,placeholder:a="Select roles",className:o=""}){const[s,i]=D.useState(""),c=t.filter(d=>{const h=typeof d=="string"?d:d.value;return!n.includes(h)}),f=d=>{const h=d.target.value;h&&(r?.([...n,h]),i(""))},u=d=>{r?.(n.filter(h=>h!==d))};return l.jsxs("div",{className:`ca-role-select ${o}`.trim(),children:[l.jsx($e,{children:e}),l.jsx(ue,{value:s,onChange:f,options:c,placeholder:a}),n.length>0?l.jsx("div",{className:"ca-tag-list",children:n.map(d=>l.jsx(Ba,{label:d,onRemove:()=>u(d)},d))}):null]})}function mc({onNext:e,stepMeta:t}){const{state:n,update:r}=Oe();return l.jsxs(Ae,{title:t.title,description:t.description,onNext:e,children:[l.jsx("div",{className:"ca-step-section",children:l.jsxs("div",{className:"ca-step-row ca-step-row--category",children:[l.jsx(Fa,{label:"Category Type",className:"ca-step-row__grow",value:n.categoryType,onChange:a=>r({categoryType:a.target.value}),options:Ta,placeholder:"Select category type"}),l.jsx(ka,{checked:n.active,onChange:a=>r({active:a})})]})}),l.jsx("div",{className:"ca-step-section",children:l.jsx(On,{label:"Description",placeholder:"Enter description",maxLength:500,value:n.description,onChange:a=>r({description:a.target.value}),rows:5})}),l.jsx("div",{className:"ca-step-section ca-step-section--last",children:l.jsx(Ia,{options:Oa,value:n.roles,onChange:a=>r({roles:a})})})]})}const gc=["HR","Finance","IT","Operations","Sales"];function yc(){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,department:"",subDepartment:"",roles:""}}function wc({onNext:e,stepMeta:t}){const{state:n,update:r}=Oe(),a=n.departmentRows,o=(i,c)=>{r({departmentRows:a.map(f=>f.id===i?{...f,...c}:f)})},s=()=>{r({departmentRows:[...a,yc()]})};return l.jsx(Ae,{title:t.title,description:t.description,onNext:e,children:l.jsxs("div",{className:"ca-dept-table",children:[l.jsxs("div",{className:"ca-dept-table__head",children:[l.jsx("div",{children:"Department"}),l.jsx("div",{children:"Sub-department"}),l.jsx("div",{children:"Roles"}),l.jsx("div",{})]}),a.map(i=>l.jsxs("div",{className:"ca-dept-table__row",children:[l.jsx(ue,{value:i.department,onChange:c=>o(i.id,{department:c.target.value}),options:gc,placeholder:"Select or add department"}),l.jsxs("div",{className:"ca-input-with-action",children:[l.jsx(de,{value:i.subDepartment,onChange:c=>o(i.id,{subDepartment:c.target.value}),placeholder:"Add sub-department"}),l.jsx("button",{type:"button",className:"ca-input-with-action__btn","aria-label":"Add sub-department",onClick:()=>{i.subDepartment.trim()},children:l.jsx(vn,{size:14,color:"currentColor"})})]}),l.jsx(ue,{value:i.roles,onChange:c=>o(i.id,{roles:c.target.value}),options:Oa,placeholder:"Select roles"}),l.jsx(G,{variant:"link",size:"sm",onClick:s,children:"+ Add"})]},i.id))]})})}function Ra({children:e,onClick:t,className:n="",active:r=!1}){return l.jsx("button",{type:"button",className:`ca-chip ${r?"ca-chip--active":""} ${n}`.trim(),onClick:t,children:e})}function Ua({checked:e=!1,onChange:t,name:n,value:r,"aria-label":a,className:o=""}){return l.jsxs("label",{className:`ca-radio ${o}`.trim(),children:[l.jsx("input",{type:"radio",className:"ca-radio__input",name:n,value:r,checked:e,onChange:t,"aria-label":a}),l.jsx("span",{className:"ca-radio__mark"})]})}function An({size:e=16,color:t="#9CA3AF",...n}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...n,children:[l.jsx("circle",{cx:"5",cy:"4",r:"1.2",fill:t}),l.jsx("circle",{cx:"11",cy:"4",r:"1.2",fill:t}),l.jsx("circle",{cx:"5",cy:"8",r:"1.2",fill:t}),l.jsx("circle",{cx:"11",cy:"8",r:"1.2",fill:t}),l.jsx("circle",{cx:"5",cy:"12",r:"1.2",fill:t}),l.jsx("circle",{cx:"11",cy:"12",r:"1.2",fill:t})]})}function Ma(e){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,name:e,color:""}}function bc({onNext:e,stepMeta:t}){const{state:n,update:r}=Oe(),{priorityDraft:a,priorities:o,defaultPriorityId:s}=n,i=u=>{const d=(u??a).trim();if(!d)return;if(o.some(E=>E.name.toLowerCase()===d.toLowerCase())){r({priorityDraft:""});return}const h=[...o,Ma(d)];r({priorities:h,priorityDraft:"",defaultPriorityId:s??h[0].id})},c=(u,d)=>{r({priorities:o.map(h=>h.id===u?{...h,...d}:h)})},f=hc.map(u=>({value:u.value,label:u.label}));return l.jsxs(Ae,{title:t.title,description:t.description,onNext:e,children:[l.jsxs("div",{className:"ca-priority-add",children:[l.jsx($e,{children:"Priorities"}),l.jsxs("div",{className:"ca-priority-add__row",children:[l.jsx(de,{value:a,onChange:u=>r({priorityDraft:u.target.value}),placeholder:"Add priority",onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),i())}}),l.jsx(G,{variant:"outline",onClick:()=>i(),children:"+ Add"})]}),l.jsx("div",{className:"ca-chip-row",children:fc.map(u=>l.jsxs(Ra,{onClick:()=>i(u),children:["+ ",u]},u))})]}),l.jsxs("div",{className:"ca-priority-table",children:[l.jsxs("div",{className:"ca-priority-table__head",children:[l.jsx("div",{children:"Priority"}),l.jsx("div",{children:"Color"}),l.jsx("div",{children:"Default"})]}),(o.length?o:[Ma("")]).map((u,d)=>{const h=!o.length;return l.jsxs("div",{className:"ca-priority-table__row",children:[l.jsxs("div",{className:"ca-priority-table__name",children:[l.jsx(An,{}),l.jsx(de,{value:h?a:u.name,onChange:E=>{h?r({priorityDraft:E.target.value}):c(u.id,{name:E.target.value})},placeholder:"Add priority"})]}),l.jsx(ue,{value:u.color,onChange:E=>{h||c(u.id,{color:E.target.value})},options:f,placeholder:"Select color"}),l.jsx(Ua,{name:"default-priority",value:u.id,checked:!h&&s===u.id,onChange:()=>!h&&r({defaultPriorityId:u.id}),"aria-label":"Default priority"})]},u.id||d)})]})]})}function vc({onNext:e,stepMeta:t,substep:n=1,onSubstepChange:r}){const{state:a,update:o,updateWorkflow:s}=Oe(),{selectedDeptNode:i,workflow:c}=a,f=()=>{if(n<_n.length){r?.(n+1);return}e?.()};return l.jsx(Ae,{title:t.title,description:t.description,onNext:e,nextVariant:"secondary",children:l.jsxs("div",{className:"ca-workflow",children:[l.jsxs("aside",{className:"ca-workflow__sidebar",children:[l.jsx("h3",{className:"ca-workflow__sidebar-title",children:"Select Department"}),l.jsx("p",{className:"ca-small",children:"Add workflow for selected department"}),l.jsx("ul",{className:"ca-dept-tree",children:pc.map(u=>l.jsxs("li",{className:"ca-dept-tree__group",children:[l.jsx("button",{type:"button",className:`ca-dept-tree__item ${i===u.id?"ca-dept-tree__item--active":""}`,onClick:()=>o({selectedDeptNode:u.id}),children:u.name}),u.children?.length?l.jsx("ul",{className:"ca-dept-tree__children",children:u.children.map(d=>l.jsx("li",{children:l.jsxs("button",{type:"button",className:`ca-dept-tree__item ca-dept-tree__item--child ${i===d.id?"ca-dept-tree__item--active":""}`,onClick:()=>o({selectedDeptNode:d.id}),children:[l.jsx("span",{className:"ca-dept-tree__branch","aria-hidden":"true",children:"└"}),d.name]})},d.id))}):null]},u.id))})]}),l.jsxs("div",{className:"ca-workflow__main",children:[l.jsx(Cn,{steps:_n,currentStep:n,onStepClick:r,size:"sm",className:"ca-workflow__substepper"}),n===1?l.jsxs("div",{className:"ca-workflow__form",children:[l.jsxs("div",{className:"ca-step-row",children:[l.jsx(Nn,{className:"ca-step-row__grow",label:"Name",placeholder:"Enter name",value:c.name,onChange:u=>s({name:u.target.value})}),l.jsx(Nn,{className:"ca-step-row__grow",label:"TAT Minutes",placeholder:"Enter here",value:c.tatMinutes,onChange:u=>s({tatMinutes:u.target.value})})]}),l.jsx(On,{label:"Description",placeholder:"Enter description",value:c.description,onChange:u=>s({description:u.target.value}),rows:5})]}):null,n===2?l.jsx("div",{className:"ca-workflow__placeholder",children:l.jsx("p",{className:"ca-body",children:"Configure workflow statuses for the selected department."})}):null,n===3?l.jsx("div",{className:"ca-workflow__placeholder",children:l.jsx("p",{className:"ca-body",children:"Define ordered workflow steps and assignees."})}):null,l.jsx("div",{className:"ca-workflow__actions",children:l.jsx(G,{onClick:f,endIcon:l.jsx(lt,{size:14,color:"#fff"}),children:"Next Step"})})]})]})})}function ja({size:e=16,color:t="#9CA3AF",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...n,children:l.jsx("path",{d:"M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2m2 0v12a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V7h12Z",stroke:t,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}const Rt=Na.map(e=>({value:e.id,label:e.label}));function Sc({type:e}){const t={text:"A",doc:"¶",calendar:"口",clock:"◷",chevron:"▾"};return l.jsx("span",{className:"ca-field-lib__glyph",children:t[e]||"▾"})}function Ec({onNext:e,stepMeta:t}){const{state:n,update:r}=Oe(),{fieldDraft:a,formFields:o}=n,s=d=>r({fieldDraft:{...a,...d}}),i=()=>{if(!a.name.trim()||!a.type)return;const d=Rt.find(h=>h.value===a.type)?.label||a.type;r({formFields:[...o,{id:`${Date.now()}`,name:a.name.trim(),type:a.type,typeLabel:d,required:!1}],fieldDraft:{name:"",type:""}})},c=(d,h)=>{r({formFields:o.map(E=>E.id===d?{...E,...h}:E)})},f=d=>{r({formFields:o.filter(h=>h.id!==d)})},u=d=>{s({type:d.id})};return l.jsx(Ae,{title:t.title,description:t.description,showNext:!1,footer:l.jsx(G,{onClick:e,endIcon:l.jsx(lt,{size:14,color:"#fff"}),children:"Next"}),children:l.jsxs("div",{className:"ca-form-fields",children:[l.jsxs("aside",{className:"ca-field-lib",children:[l.jsx("h3",{className:"ca-field-lib__title",children:"Field Library"}),l.jsx("p",{className:"ca-small",children:"Drag and drop the fields to add."}),l.jsx("ul",{className:"ca-field-lib__list",children:Na.map(d=>l.jsx("li",{children:l.jsxs("button",{type:"button",className:"ca-field-lib__item",draggable:!0,onDragStart:h=>{h.dataTransfer.setData("text/plain",d.id)},onClick:()=>u(d),children:[l.jsx(Sc,{type:d.icon}),l.jsx("span",{children:d.label})]})},d.id))})]}),l.jsxs("div",{className:"ca-form-fields__main",children:[l.jsxs("div",{className:"ca-add-fields",onDragOver:d=>d.preventDefault(),onDrop:d=>{d.preventDefault();const h=d.dataTransfer.getData("text/plain");h&&s({type:h})},children:[l.jsxs("div",{className:"ca-add-fields__top",children:[l.jsx("h3",{className:"ca-add-fields__title",children:"Add Fields"}),l.jsx(G,{onClick:i,children:"Add Field"})]}),l.jsxs("div",{className:"ca-step-row",children:[l.jsxs("div",{className:"ca-step-row__grow",children:[l.jsx($e,{children:"Name of Field"}),l.jsx(de,{value:a.name,onChange:d=>s({name:d.target.value}),placeholder:"Enter name of the field."})]}),l.jsxs("div",{className:"ca-step-row__grow",children:[l.jsx($e,{children:"Type of Field"}),l.jsx(ue,{value:a.type,onChange:d=>s({type:d.target.value}),options:Rt,placeholder:"Select type of the field."})]})]})]}),l.jsxs("div",{className:"ca-fields-table",children:[l.jsxs("div",{className:"ca-fields-table__head",children:[l.jsx("div",{children:"Field Name"}),l.jsx("div",{children:"Field Type"}),l.jsx("div",{children:"Required"}),l.jsx("div",{})]}),o.length===0?l.jsx("div",{className:"ca-fields-table__empty",children:l.jsx("p",{className:"ca-small",children:"No fields added yet."})}):o.map(d=>l.jsxs("div",{className:"ca-fields-table__row",children:[l.jsxs("div",{className:"ca-fields-table__name",children:[l.jsx(An,{}),l.jsx(de,{value:d.name,onChange:h=>c(d.id,{name:h.target.value})})]}),l.jsx(ue,{value:d.type,onChange:h=>{const E=h.target.value,v=Rt.find(_=>_.value===E)?.label||E;c(d.id,{type:E,typeLabel:v})},options:Rt,placeholder:"Select type"}),l.jsx(Tn,{checked:d.required,onChange:h=>c(d.id,{required:h}),"aria-label":"Required"}),l.jsx("button",{type:"button",className:"ca-icon-btn","aria-label":"Delete field",onClick:()=>f(d.id),children:l.jsx(ja,{})})]},d.id))]})]})]})})}function Cc({onPublish:e,stepMeta:t}){const{state:n}=Oe(),r=Ta.find(a=>a.value===n.categoryType)?.label||n.categoryType;return l.jsx(Ae,{title:t.title,description:t.description,nextLabel:"Publish",onNext:e,children:l.jsxs("div",{className:"ca-review",children:[l.jsxs("section",{className:"ca-review__block",children:[l.jsx(ce,{children:"Category Type"}),l.jsxs("div",{className:"ca-review__row",children:[l.jsx(Bt,{children:r}),l.jsx(En,{status:n.active?"active":"inactive"})]}),n.description?l.jsx(Y,{children:n.description}):null,n.roles.length?l.jsxs(Y,{children:["Roles: ",n.roles.join(", ")]}):null]}),l.jsxs("section",{className:"ca-review__block",children:[l.jsx(ce,{children:"Departments"}),l.jsxs(Y,{children:[n.departmentRows.filter(a=>a.department).length," department row(s) configured"]})]}),l.jsxs("section",{className:"ca-review__block",children:[l.jsx(ce,{children:"Priorities"}),l.jsx(Y,{children:n.priorities.length?n.priorities.map(a=>a.name).join(", "):"No priorities added"})]}),l.jsxs("section",{className:"ca-review__block",children:[l.jsx(ce,{children:"Workflow"}),l.jsx(Y,{children:n.workflow.name?`${n.workflow.name} (TAT: ${n.workflow.tatMinutes||"—"} min)`:"No workflow created yet"})]}),l.jsxs("section",{className:"ca-review__block ca-review__block--last",children:[l.jsx(ce,{children:"Form Fields"}),l.jsx(Y,{children:n.formFields.length?n.formFields.map(a=>a.name).join(", "):"No form fields added"})]}),l.jsx("div",{className:"ca-workflow__actions",children:l.jsx(G,{onClick:e,children:"Publish"})})]})})}function _c(e){const t=Number(e);return!Number.isFinite(t)||t<1?1:t>Te.length?Te.length:Math.floor(t)}function Nc(e){const t=Number(e);return!Number.isFinite(t)||t<1?1:t>3?3:Math.floor(t)}function $a({title:e="Complaint Management Settings",onPublish:t,onStepChange:n}){const r=pt(),{systemId:a}=Po(),[o,s]=hs(),i=_c(o.get("step")||1),c=Nc(o.get("substep")||1);D.useEffect(()=>{if(!o.get("step")){const v=new URLSearchParams(o);v.set("step","1"),s(v,{replace:!0})}},[o,s]);const f=D.useMemo(()=>Te.find(v=>v.id===i)||Te[0],[i]),u=D.useCallback((v,_)=>{const y=new URLSearchParams(o);y.set("step",String(v)),v===4?y.set("substep",String(_??(v===i?c:1))):y.delete("substep"),s(y,{replace:!1}),n?.({systemId:a,step:v,substep:_})},[o,s,n,a,i,c]),d=()=>{i<Te.length&&u(i+1,1)},h=v=>{u(4,v)},E=()=>{t?.({systemId:a,step:i})};return l.jsx(_a,{children:l.jsxs("div",{className:"ca-settings-page",children:[l.jsx(Sn,{children:e}),l.jsx(Cn,{steps:Te,currentStep:i,onStepClick:v=>u(v,v===4?1:void 0),className:"ca-settings-page__stepper"}),i===1?l.jsx(mc,{onNext:d,stepMeta:f}):null,i===2?l.jsx(wc,{onNext:d,stepMeta:f}):null,i===3?l.jsx(bc,{onNext:d,stepMeta:f}):null,i===4?l.jsx(vc,{onNext:d,stepMeta:f,substep:c,onSubstepChange:h}):null,i===5?l.jsx(Ec,{onNext:d,stepMeta:f}):null,i===6?l.jsx(Cc,{onPublish:E,stepMeta:f}):null,l.jsx("button",{type:"button",className:"ca-back-link",onClick:()=>r("/"),children:"← Back to Complaint Management"})]})},a||"new")}function Oc({pageProps:e,onPublish:t,onStepChange:n,children:r}){const a=r??l.jsx(Sa,{...e});return l.jsxs(qo,{children:[l.jsx(ht,{path:"/",element:a}),l.jsx(ht,{path:"/settings/:systemId",element:l.jsx($a,{onPublish:t,onStepChange:n})}),l.jsx(ht,{path:"*",element:a})]})}function Tc({pageProps:e,onPublish:t,onStepChange:n,children:r}){return l.jsx(Oc,{pageProps:e,onPublish:t,onStepChange:n,children:r})}function Ac({children:e}){const{cssVars:t,darkMode:n,mode:r}=Qr();return l.jsx("div",{className:`ca-root ${n?"ca-root--dark":"ca-root--light"}`,"data-ca-theme":r,style:t,children:e})}const Wa=({apiUrl:e,authToken:t,store:n=aa,basePath:r="/",theme:a,darkMode:o=!1,title:s,description:i,systems:c,systemsEndpoint:f,useDemoData:u=!0,createLabel:d,onCreateForm:h,onConfigure:E,onTitleClick:v,onDescriptionClick:_,onSearch:y,onPublish:m,onStepChange:w,children:S})=>{const N={title:s,description:i,systems:c,systemsEndpoint:f,useDemoData:u,createLabel:d,onCreateForm:h,onConfigure:E,onTitleClick:v,onDescriptionClick:_,onSearch:y};return l.jsx(Yr,{theme:a,darkMode:o,children:l.jsx(Ya.Provider,{store:n,children:l.jsx(Ac,{children:l.jsx(Hr,{apiUrl:e,authToken:t,children:l.jsx(is,{basename:r,children:l.jsx(Tc,{pageProps:N,onPublish:m,onStepChange:w,children:S})})})})})})},Pc=ee.colors,xc=ee.radii,Dc=ee.spacing,Fc=ee.typography;g.ApiProvider=Hr,g.BodyText=Y,g.Button=G,g.COMPLAINT_ENDPOINTS=X,g.CardFooter=da,g.CardHeader=ca,g.ChevronDownIcon=xa,g.ChevronRightIcon=lt,g.Chip=Ra,g.CloseIcon=La,g.ComplaintApp=Wa,g.ComplaintManagementPage=Sa,g.ComplaintSettingsPage=$a,g.DEFAULT_PAGE_DESCRIPTION=ba,g.DEMO_SYSTEMS=wa,g.DataPoint=ua,g.Divider=fa,g.DragHandleIcon=An,g.FieldLabel=$e,g.FormField=It,g.FormInput=Nn,g.FormSelect=Fa,g.FormTextarea=On,g.Heading1=Sn,g.Heading2=ce,g.Input=de,g.LabelText=Bt,g.LayersIcon=Aa,g.LinkText=ia,g.Loading=ya,g.PageHeader=la,g.PlusIcon=vn,g.Radio=Ua,g.RoleMultiSelect=Ia,g.SETTINGS_STEPS=Te,g.SearchBar=ga,g.SearchIcon=ma,g.Select=ue,g.SettingsCard=Ae,g.SettingsCardHeader=Pa,g.SettingsWizardProvider=_a,g.StatusBadge=En,g.Stepper=Cn,g.SystemCard=pa,g.SystemCardGrid=ha,g.Tag=Ba,g.Textarea=Da,g.ThemeProvider=Yr,g.Toggle=Tn,g.ToggleField=ka,g.TrashIcon=ja,g.Typography=le,g.ValueText=sa,g.WORKFLOW_SUBSTEPS=_n,g.api=j,g.clearComplaintError=ic,g.clearSelectedComplaintResource=lc,g.colors=Pc,g.complaintDepartmentActions=Se,g.complaintPriorityActions=Ee,g.complaintReducer=na,g.complaintStatusActions=_e,g.complaintTypeActions=ve,g.complaintWorkflowActions=Ce,g.createComplaintDepartment=$l,g.createComplaintPriority=ql,g.createComplaintStatus=nc,g.createComplaintStore=ra,g.createComplaintType=Il,g.createComplaintWorkflow=Yl,g.darkTheme=rt,g.deepMerge=je,g.default=Wa,g.defaultThemeFile=qr,g.deleteComplaintDepartment=Vl,g.deleteComplaintPriority=Kl,g.deleteComplaintStatus=ac,g.deleteComplaintType=Ul,g.deleteComplaintWorkflow=Zl,g.deleteWorkflowSteps=Zr,g.getComplaintDepartmentById=jl,g.getComplaintDepartments=Ml,g.getComplaintPriorities=zl,g.getComplaintPriorityById=Hl,g.getComplaintStatusById=tc,g.getComplaintStatuses=ec,g.getComplaintTypeById=Bl,g.getComplaintTypes=Ll,g.getComplaintWorkflowById=Gl,g.getComplaintWorkflows=Xl,g.getDepartmentTree=Dt,g.getWorkflowSteps=Ft,g.lightTheme=ee,g.normalizeThemeFile=Jr,g.radii=xc,g.resetComplaintState=cc,g.resolveActiveTheme=Kr,g.saveWorkflowSteps=kt,g.setAuthToken=zr,g.setBaseUrl=Vr,g.spacing=Dc,g.store=aa,g.themeToCssVars=Xr,g.typography=Fc,g.updateComplaintDepartment=Wl,g.updateComplaintPriority=Jl,g.updateComplaintStatus=rc,g.updateComplaintType=Rl,g.updateComplaintWorkflow=Ql,g.useSettingsWizard=Oe,g.useTheme=Qr,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
2
12
  //# sourceMappingURL=complaint-app.umd.js.map