@attabot/complaint-app 1.0.7 → 1.0.8
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.
- package/dist/complaint-app.js +2047 -1866
- package/dist/complaint-app.js.map +1 -1
- package/dist/complaint-app.umd.js +9 -9
- package/dist/complaint-app.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
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,O,Nd,kr,ft){"use strict";var Rt=typeof document<"u"?document.currentScript:null;function fo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const w=fo(O);function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},We.apply(null,arguments)}var ce;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ce||(ce={}));const Dr="popstate";function po(e){e===void 0&&(e={});function t(n,a){let{pathname:o,search:s,hash:i}=n.location;return jt("",{pathname:o,search:s,hash:i},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ze(a)}return mo(t,r,null,e)}function A(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function W(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ho(){return Math.random().toString(36).substr(2,8)}function Br(e,t){return{usr:e.state,key:e.key,idx:t}}function jt(e,t,r,n){return r===void 0&&(r=null),We({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Le(t):t,{state:r,key:t&&t.key||n||ho()})}function ze(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Le(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function mo(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,s=a.history,i=ce.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(We({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function f(){i=ce.Pop;let b=u(),m=b==null?null:b-d;d=b,c&&c({action:i,location:E.location,delta:m})}function h(b,m){i=ce.Push;let y=jt(E.location,b,m);d=u()+1;let C=Br(y,d),N=E.createHref(y);try{s.pushState(C,"",N)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;a.location.assign(N)}o&&c&&c({action:i,location:E.location,delta:1})}function v(b,m){i=ce.Replace;let y=jt(E.location,b,m);d=u();let C=Br(y,d),N=E.createHref(y);s.replaceState(C,"",N),o&&c&&c({action:i,location:E.location,delta:0})}function S(b){let m=a.location.origin!=="null"?a.location.origin:a.location.href,y=typeof b=="string"?b:ze(b);return y=y.replace(/ $/,"%20"),A(m,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,m)}let E={get action(){return i},get location(){return e(a,s)},listen(b){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Dr,f),c=b,()=>{a.removeEventListener(Dr,f),c=null}},createHref(b){return t(a,b)},createURL:S,encodeLocation(b){let m=S(b);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:v,go(b){return s.go(b)}};return E}var Ir;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ir||(Ir={}));function go(e,t,r){return r===void 0&&(r="/"),yo(e,t,r)}function yo(e,t,r,n){let a=typeof t=="string"?Le(t):t,o=de(a.pathname||"/",r);if(o==null)return null;let s=Ur(e);bo(s);let i=null,c=Lo(o);for(let d=0;i==null&&d<s.length;++d)i=To(s[d],c);return i}function Ur(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");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("/")&&(A(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let d=ne([n,c.relativePath]),u=r.concat(c);o.children&&o.children.length>0&&(A(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Ur(o.children,t,u,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:No(d,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 Mr(o.path))a(o,s,c)}),t}function Mr(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let s=Mr(n.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 bo(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Oo(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const wo=/^:[\w-]+$/,vo=3,Co=2,So=1,Eo=10,_o=-2,$r=e=>e==="*";function No(e,t){let r=e.split("/"),n=r.length;return r.some($r)&&(n+=_o),t&&(n+=Co),r.filter(a=>!$r(a)).reduce((a,o)=>a+(wo.test(o)?vo:o===""?So:Eo),n)}function Oo(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function To(e,t,r){let{routesMeta:n}=e,a={},o="/",s=[];for(let i=0;i<n.length;++i){let c=n[i],d=i===n.length-1,u=o==="/"?t:t.slice(o.length)||"/",f=Vt({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),h=c.route;if(!f)return null;Object.assign(a,f.params),s.push({params:a,pathname:ne([o,f.pathname]),pathnameBase:Do(ne([o,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(o=ne([o,f.pathnameBase]))}return s}function Vt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Ao(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],s=o.replace(/(.)\/+$/,"$1"),i=a.slice(1);return{params:n.reduce((d,u,f)=>{let{paramName:h,isOptional:v}=u;if(h==="*"){let E=i[f]||"";s=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const S=i[f];return v&&!S?d[h]=void 0:d[h]=(S||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:s,pattern:e}}function Ao(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),W(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,i,c)=>(n.push({paramName:i,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Lo(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return W(!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 de(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Fo=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xo=e=>Fo.test(e);function Po(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Le(e):e,o;if(r)if(xo(r))o=r;else{if(r.includes("//")){let s=r;r=Hr(r),W(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?o=Rr(r.substring(1),"/"):o=Rr(r,t)}else o=t;return{pathname:o,search:Bo(n),hash:Io(a)}}function Rr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Ht(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function ko(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function jr(e,t){let r=ko(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Vr(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Le(e):(a=We({},e),A(!a.pathname||!a.pathname.includes("?"),Ht("?","pathname","search",a)),A(!a.pathname||!a.pathname.includes("#"),Ht("#","pathname","hash",a)),A(!a.search||!a.search.includes("#"),Ht("#","search","hash",a)));let o=e===""||a.pathname==="",s=o?"/":a.pathname,i;if(s==null)i=r;else{let f=t.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}i=f>=0?t[f]:"/"}let c=Po(a,i),d=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Hr=e=>e.replace(/\/\/+/g,"/"),ne=e=>Hr(e.join("/")),Do=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Bo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Io=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Uo(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Wr=["post","put","patch","delete"];new Set(Wr);const Mo=["get",...Wr];new Set(Mo);function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qe.apply(null,arguments)}const Ke=w.createContext(null);process.env.NODE_ENV!=="production"&&(Ke.displayName="DataRouter");const Wt=w.createContext(null);process.env.NODE_ENV!=="production"&&(Wt.displayName="DataRouterState");const $o=w.createContext(null);process.env.NODE_ENV!=="production"&&($o.displayName="Await");const G=w.createContext(null);process.env.NODE_ENV!=="production"&&(G.displayName="Navigation");const Je=w.createContext(null);process.env.NODE_ENV!=="production"&&(Je.displayName="Location");const Y=w.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(Y.displayName="Route");const zt=w.createContext(null);process.env.NODE_ENV!=="production"&&(zt.displayName="RouteError");function Ro(e,t){let{relative:r}=t===void 0?{}:t;Fe()||(process.env.NODE_ENV!=="production"?A(!1,"useHref() may be used only in the context of a <Router> component."):A(!1));let{basename:n,navigator:a}=w.useContext(G),{hash:o,pathname:s,search:i}=Ze(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:ne([n,s])),a.createHref({pathname:c,search:i,hash:o})}function Fe(){return w.useContext(Je)!=null}function he(){return Fe()||(process.env.NODE_ENV!=="production"?A(!1,"useLocation() may be used only in the context of a <Router> component."):A(!1)),w.useContext(Je).location}const zr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qr(e){w.useContext(G).static||w.useLayoutEffect(e)}function pt(){let{isDataRoute:e}=w.useContext(Y);return e?ts():jo()}function jo(){Fe()||(process.env.NODE_ENV!=="production"?A(!1,"useNavigate() may be used only in the context of a <Router> component."):A(!1));let e=w.useContext(Ke),{basename:t,future:r,navigator:n}=w.useContext(G),{matches:a}=w.useContext(Y),{pathname:o}=he(),s=JSON.stringify(jr(a,r.v7_relativeSplatPath)),i=w.useRef(!1);return qr(()=>{i.current=!0}),w.useCallback(function(d,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&W(i.current,zr),!i.current)return;if(typeof d=="number"){n.go(d);return}let f=Vr(d,JSON.parse(s),o,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ne([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,s,o,e])}function Vo(){let{matches:e}=w.useContext(Y),t=e[e.length-1];return t?t.params:{}}function Ze(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=w.useContext(G),{matches:a}=w.useContext(Y),{pathname:o}=he(),s=JSON.stringify(jr(a,n.v7_relativeSplatPath));return w.useMemo(()=>Vr(e,JSON.parse(s),o,r==="path"),[e,s,o,r])}function Ho(e,t){return Wo(e,t)}function Wo(e,t,r,n){Fe()||(process.env.NODE_ENV!=="production"?A(!1,"useRoutes() may be used only in the context of a <Router> component."):A(!1));let{navigator:a}=w.useContext(G),{matches:o}=w.useContext(Y),s=o[o.length-1],i=s?s.params:{},c=s?s.pathname:"/",d=s?s.pathnameBase:"/",u=s&&s.route;if(process.env.NODE_ENV!=="production"){let y=u&&u.path||"";Zr(c,!u||y.endsWith("*"),"You rendered descendant <Routes> (or called `useRoutes()`) at "+('"'+c+'" (under <Route path="'+y+'">) 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.
|
|
1
|
+
(function(g,i){typeof exports=="object"&&typeof module<"u"?i(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"],i):(g=typeof globalThis<"u"?globalThis:g||self,i(g.ComplaintApp={},g["react/jsx-runtime"],g.React,g.ReactDOM,g.ReactRedux,g.RTK))})(this,(function(g,i,L,jd,kr,ht){"use strict";var jt=typeof document<"u"?document.currentScript:null;function po(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const w=po(L);function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qe.apply(null,arguments)}var de;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(de||(de={}));const Dr="popstate";function ho(e){e===void 0&&(e={});function t(n,a){let{pathname:o,search:s,hash:l}=n.location;return Vt("",{pathname:o,search:s,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ze(a)}return go(t,r,null,e)}function T(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function q(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mo(){return Math.random().toString(36).substr(2,8)}function Br(e,t){return{usr:e.state,key:e.key,idx:t}}function Vt(e,t,r,n){return r===void 0&&(r=null),qe({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Fe(t):t,{state:r,key:t&&t.key||n||mo()})}function ze(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Fe(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function go(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,s=a.history,l=de.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(qe({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function f(){l=de.Pop;let b=u(),m=b==null?null:b-d;d=b,c&&c({action:l,location:S.location,delta:m})}function h(b,m){l=de.Push;let y=Vt(S.location,b,m);d=u()+1;let C=Br(y,d),N=S.createHref(y);try{s.pushState(C,"",N)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(N)}o&&c&&c({action:l,location:S.location,delta:1})}function v(b,m){l=de.Replace;let y=Vt(S.location,b,m);d=u();let C=Br(y,d),N=S.createHref(y);s.replaceState(C,"",N),o&&c&&c({action:l,location:S.location,delta:0})}function _(b){let m=a.location.origin!=="null"?a.location.origin:a.location.href,y=typeof b=="string"?b:ze(b);return y=y.replace(/ $/,"%20"),T(m,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,m)}let S={get action(){return l},get location(){return e(a,s)},listen(b){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Dr,f),c=b,()=>{a.removeEventListener(Dr,f),c=null}},createHref(b){return t(a,b)},createURL:_,encodeLocation(b){let m=_(b);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:v,go(b){return s.go(b)}};return S}var Ir;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ir||(Ir={}));function yo(e,t,r){return r===void 0&&(r="/"),bo(e,t,r)}function bo(e,t,r,n){let a=typeof t=="string"?Fe(t):t,o=ue(a.pathname||"/",r);if(o==null)return null;let s=Mr(e);vo(s);let l=null,c=Fo(o);for(let d=0;l==null&&d<s.length;++d)l=To(s[d],c);return l}function Mr(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(o,s,l)=>{let c={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};c.relativePath.startsWith("/")&&(T(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let d=ne([n,c.relativePath]),u=r.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 "'+d+'".')),Mr(o.children,t,u,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:Lo(d,o.index),routesMeta:u})};return e.forEach((o,s)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))a(o,s);else for(let c of Ur(o.path))a(o,s,c)}),t}function Ur(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let s=Ur(n.join("/")),l=[];return l.push(...s.map(c=>c===""?o:[o,c].join("/"))),a&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function vo(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Oo(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const wo=/^:[\w-]+$/,Co=3,_o=2,So=1,Eo=10,No=-2,$r=e=>e==="*";function Lo(e,t){let r=e.split("/"),n=r.length;return r.some($r)&&(n+=No),t&&(n+=_o),r.filter(a=>!$r(a)).reduce((a,o)=>a+(wo.test(o)?Co:o===""?So:Eo),n)}function Oo(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function To(e,t,r){let{routesMeta:n}=e,a={},o="/",s=[];for(let l=0;l<n.length;++l){let c=n[l],d=l===n.length-1,u=o==="/"?t:t.slice(o.length)||"/",f=Ht({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),h=c.route;if(!f)return null;Object.assign(a,f.params),s.push({params:a,pathname:ne([o,f.pathname]),pathnameBase:Bo(ne([o,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(o=ne([o,f.pathnameBase]))}return s}function Ht(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Ao(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],s=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((d,u,f)=>{let{paramName:h,isOptional:v}=u;if(h==="*"){let S=l[f]||"";s=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const _=l[f];return v&&!_?d[h]=void 0:d[h]=(_||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:s,pattern:e}}function Ao(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),q(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Fo(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return q(!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 ue(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const xo=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Po=e=>xo.test(e);function ko(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Fe(e):e,o;if(r)if(Po(r))o=r;else{if(r.includes("//")){let s=r;r=Wr(r),q(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?o=jr(r.substring(1),"/"):o=jr(r,t)}else o=t;return{pathname:o,search:Io(n),hash:Mo(a)}}function jr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Wt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Do(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Vr(e,t){let r=Do(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Hr(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Fe(e):(a=qe({},e),T(!a.pathname||!a.pathname.includes("?"),Wt("?","pathname","search",a)),T(!a.pathname||!a.pathname.includes("#"),Wt("#","pathname","hash",a)),T(!a.search||!a.search.includes("#"),Wt("#","search","hash",a)));let o=e===""||a.pathname==="",s=o?"/":a.pathname,l;if(s==null)l=r;else{let f=t.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=ko(a,l),d=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Wr=e=>e.replace(/\/\/+/g,"/"),ne=e=>Wr(e.join("/")),Bo=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Io=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Mo=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Uo(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const qr=["post","put","patch","delete"];new Set(qr);const $o=["get",...qr];new Set($o);function Re(){return Re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Re.apply(null,arguments)}const Ke=w.createContext(null);process.env.NODE_ENV!=="production"&&(Ke.displayName="DataRouter");const qt=w.createContext(null);process.env.NODE_ENV!=="production"&&(qt.displayName="DataRouterState");const jo=w.createContext(null);process.env.NODE_ENV!=="production"&&(jo.displayName="Await");const X=w.createContext(null);process.env.NODE_ENV!=="production"&&(X.displayName="Navigation");const Je=w.createContext(null);process.env.NODE_ENV!=="production"&&(Je.displayName="Location");const Y=w.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(Y.displayName="Route");const zt=w.createContext(null);process.env.NODE_ENV!=="production"&&(zt.displayName="RouteError");function Vo(e,t){let{relative:r}=t===void 0?{}:t;xe()||(process.env.NODE_ENV!=="production"?T(!1,"useHref() may be used only in the context of a <Router> component."):T(!1));let{basename:n,navigator:a}=w.useContext(X),{hash:o,pathname:s,search:l}=Ge(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:ne([n,s])),a.createHref({pathname:c,search:l,hash:o})}function xe(){return w.useContext(Je)!=null}function me(){return xe()||(process.env.NODE_ENV!=="production"?T(!1,"useLocation() may be used only in the context of a <Router> component."):T(!1)),w.useContext(Je).location}const zr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rr(e){w.useContext(X).static||w.useLayoutEffect(e)}function Ze(){let{isDataRoute:e}=w.useContext(Y);return e?rs():Ho()}function Ho(){xe()||(process.env.NODE_ENV!=="production"?T(!1,"useNavigate() may be used only in the context of a <Router> component."):T(!1));let e=w.useContext(Ke),{basename:t,future:r,navigator:n}=w.useContext(X),{matches:a}=w.useContext(Y),{pathname:o}=me(),s=JSON.stringify(Vr(a,r.v7_relativeSplatPath)),l=w.useRef(!1);return Rr(()=>{l.current=!0}),w.useCallback(function(d,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&q(l.current,zr),!l.current)return;if(typeof d=="number"){n.go(d);return}let f=Hr(d,JSON.parse(s),o,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ne([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,s,o,e])}function Wo(){let{matches:e}=w.useContext(Y),t=e[e.length-1];return t?t.params:{}}function Ge(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=w.useContext(X),{matches:a}=w.useContext(Y),{pathname:o}=me(),s=JSON.stringify(Vr(a,n.v7_relativeSplatPath));return w.useMemo(()=>Hr(e,JSON.parse(s),o,r==="path"),[e,s,o,r])}function qo(e,t){return zo(e,t)}function zo(e,t,r,n){xe()||(process.env.NODE_ENV!=="production"?T(!1,"useRoutes() may be used only in the context of a <Router> component."):T(!1));let{navigator:a}=w.useContext(X),{matches:o}=w.useContext(Y),s=o[o.length-1],l=s?s.params:{},c=s?s.pathname:"/",d=s?s.pathnameBase:"/",u=s&&s.route;if(process.env.NODE_ENV!=="production"){let y=u&&u.path||"";Zr(c,!u||y.endsWith("*"),"You rendered descendant <Routes> (or called `useRoutes()`) at "+('"'+c+'" (under <Route path="'+y+'">) 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
2
|
|
|
3
|
-
`+('Please change the parent <Route path="'+y+'"> to <Route ')+('path="'+(y==="/"?"*":y+"/*")+'">.'))}let f=he(),h;if(t){var v;let y=typeof t=="string"?Le(t):t;d==="/"||(v=y.pathname)!=null&&v.startsWith(d)||(process.env.NODE_ENV!=="production"?A(!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 "'+d+'" ')+('but pathname "'+y.pathname+'" was given in the `location` prop.')):A(!1)),h=y}else h=f;let S=h.pathname||"/",E=S;if(d!=="/"){let y=d.replace(/^\//,"").split("/");E="/"+S.replace(/^\//,"").split("/").slice(y.length).join("/")}let b=go(e,{pathname:E});process.env.NODE_ENV!=="production"&&(process.env.NODE_ENV!=="production"&&W(u||b!=null,'No routes matched location "'+h.pathname+h.search+h.hash+'" '),process.env.NODE_ENV!=="production"&&W(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.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=Zo(b&&b.map(y=>Object.assign({},y,{params:Object.assign({},i,y.params),pathname:ne([d,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?d:ne([d,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,r,n);return t&&m?w.createElement(Je.Provider,{value:{location:qe({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:ce.Pop}},m):m}function zo(){let e=es(),t=Uo(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},s=null;return process.env.NODE_ENV!=="production"&&(console.error("Error handled by React Router default ErrorBoundary:",e),s=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:o},"ErrorBoundary")," or"," ",w.createElement("code",{style:o},"errorElement")," prop on your route."))),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:a},r):null,s)}const qo=w.createElement(zo,null);class Ko extends w.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?w.createElement(Y.Provider,{value:this.props.routeContext},w.createElement(zt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Jo(e){let{routeContext:t,match:r,children:n}=e,a=w.useContext(Ke);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(Y.Provider,{value:t},n)}function Zo(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,i=(a=r)==null?void 0:a.errors;if(i!=null){let u=s.findIndex(f=>f.route.id&&i?.[f.route.id]!==void 0);u>=0||(process.env.NODE_ENV!=="production"?A(!1,"Could not find a matching route for errors on route IDs: "+Object.keys(i).join(",")):A(!1)),s=s.slice(0,Math.min(s.length,u+1))}let c=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let u=0;u<s.length;u++){let f=s[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(d=u),f.route.id){let{loaderData:h,errors:v}=r,S=f.route.loader&&h[f.route.id]===void 0&&(!v||v[f.route.id]===void 0);if(f.route.lazy||S){c=!0,d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}return s.reduceRight((u,f,h)=>{let v,S=!1,E=null,b=null;r&&(v=i&&f.route.id?i[f.route.id]:void 0,E=f.route.errorElement||qo,c&&(d<0&&h===0?(Zr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,b=null):d===h&&(S=!0,b=f.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,h+1)),y=()=>{let C;return v?C=E:S?C=b:f.route.Component?C=w.createElement(f.route.Component,null):f.route.element?C=f.route.element:C=u,w.createElement(Jo,{match:f,routeContext:{outlet:u,matches:m,isDataRoute:r!=null},children:C})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?w.createElement(Ko,{location:r.location,revalidation:r.revalidation,component:E,error:v,children:y(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):y()},null)}var Kr=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Kr||{}),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 qt(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Go(e){let t=w.useContext(Ke);return t||(process.env.NODE_ENV!=="production"?A(!1,qt(e)):A(!1)),t}function Xo(e){let t=w.useContext(Wt);return t||(process.env.NODE_ENV!=="production"?A(!1,qt(e)):A(!1)),t}function Yo(e){let t=w.useContext(Y);return t||(process.env.NODE_ENV!=="production"?A(!1,qt(e)):A(!1)),t}function Kt(e){let t=Yo(e),r=t.matches[t.matches.length-1];return r.route.id||(process.env.NODE_ENV!=="production"?A(!1,e+' can only be used on routes that contain a unique "id"'):A(!1)),r.route.id}function Qo(){return Kt(Ge.UseRouteId)}function es(){var e;let t=w.useContext(zt),r=Xo(Ge.UseRouteError),n=Kt(Ge.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function ts(){let{router:e}=Go(Kr.UseNavigateStable),t=Kt(Ge.UseNavigateStable),r=w.useRef(!1);return qr(()=>{r.current=!0}),w.useCallback(function(a,o){o===void 0&&(o={}),process.env.NODE_ENV!=="production"&&W(r.current,zr),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,qe({fromRouteId:t},o)))},[e,t])}const Jr={};function Zr(e,t,r){!t&&!Jr[e]&&(Jr[e]=!0,process.env.NODE_ENV!=="production"&&W(!1,r))}const Gr={};function rs(e,t){process.env.NODE_ENV!=="production"&&!Gr[t]&&(Gr[t]=!0,console.warn(t))}const Xr=(e,t,r)=>rs(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+r+"."));function ns(e,t){e?.v7_startTransition===void 0&&Xr("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&&Xr("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"?A(!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>."):A(!1)}function as(e){let{basename:t="/",children:r=null,location:n,navigationType:a=ce.Pop,navigator:o,static:s=!1,future:i}=e;Fe()&&(process.env.NODE_ENV!=="production"?A(!1,"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."):A(!1));let c=t.replace(/^\/*/,"/"),d=w.useMemo(()=>({basename:c,navigator:o,static:s,future:qe({v7_relativeSplatPath:!1},i)}),[c,i,o,s]);typeof n=="string"&&(n=Le(n));let{pathname:u="/",search:f="",hash:h="",state:v=null,key:S="default"}=n,E=w.useMemo(()=>{let b=de(u,c);return b==null?null:{location:{pathname:b,search:f,hash:h,state:v,key:S},navigationType:a}},[c,u,f,h,v,S,a]);return process.env.NODE_ENV!=="production"&&W(E!=null,'<Router basename="'+c+'"> is not able to match the URL '+('"'+u+f+h+'" because it does not start with the ')+"basename, so the <Router> won't render anything."),E==null?null:w.createElement(G.Provider,{value:d},w.createElement(Je.Provider,{children:r,value:E}))}function os(e){let{children:t,location:r}=e;return Ho(Jt(t),r)}new Promise(()=>{});function Jt(e,t){t===void 0&&(t=[]);let r=[];return w.Children.forEach(e,(n,a)=>{if(!w.isValidElement(n))return;let o=[...t,a];if(n.type===w.Fragment){r.push.apply(r,Jt(n.props.children,o));return}n.type!==ht&&(process.env.NODE_ENV!=="production"?A(!1,"["+(typeof n.type=="string"?n.type:n.type.name)+"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>"):A(!1)),!n.props.index||!n.props.children||(process.env.NODE_ENV!=="production"?A(!1,"An index route cannot have child routes."):A(!1));let s={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=Jt(n.props.children,o)),r.push(s)}),r}function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xe.apply(null,arguments)}function Zt(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}const mt="get",gt="application/x-www-form-urlencoded";function yt(e){return e!=null&&typeof e.tagName=="string"}function ss(e){return yt(e)&&e.tagName.toLowerCase()==="button"}function is(e){return yt(e)&&e.tagName.toLowerCase()==="form"}function ls(e){return yt(e)&&e.tagName.toLowerCase()==="input"}function cs(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ds(e,t){return e.button===0&&(!t||t==="_self")&&!cs(e)}function Gt(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function us(e,t){let r=Gt(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}let bt=null;function fs(){if(bt===null)try{new FormData(document.createElement("form"),0),bt=!1}catch{bt=!0}return bt}const ps=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xt(e){return e!=null&&!ps.has(e)?(process.env.NODE_ENV!=="production"&&W(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+gt+'"')),null):e}function hs(e,t){let r,n,a,o,s;if(is(e)){let i=e.getAttribute("action");n=i?de(i,t):null,r=e.getAttribute("method")||mt,a=Xt(e.getAttribute("enctype"))||gt,o=new FormData(e)}else if(ss(e)||ls(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(n=c?de(c,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||mt,a=Xt(e.getAttribute("formenctype"))||Xt(i.getAttribute("enctype"))||gt,o=new FormData(i,e),!fs()){let{name:d,type:u,value:f}=e;if(u==="image"){let h=d?d+".":"";o.append(h+"x","0"),o.append(h+"y","0")}else d&&o.append(d,f)}}else{if(yt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=mt,n=null,a=gt,s=e}return o&&a==="text/plain"&&(s=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:s}}const ms=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],gs=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],ys=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"],bs="6";try{window.__reactRouterVersion=bs}catch{}const Yr=w.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Yr.displayName="ViewTransition");const ws=w.createContext(new Map);process.env.NODE_ENV!=="production"&&(ws.displayName="Fetchers");const Qr=w["startTransition"];function vs(e){let{basename:t,children:r,future:n,window:a}=e,o=w.useRef();o.current==null&&(o.current=po({window:a,v5Compat:!0}));let s=o.current,[i,c]=w.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=w.useCallback(f=>{d&&Qr?Qr(()=>c(f)):c(f)},[c,d]);return w.useLayoutEffect(()=>s.listen(u),[s,u]),w.useEffect(()=>ns(n),[n]),w.createElement(as,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:s,future:n})}process.env.NODE_ENV;const Cs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ss=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,en=w.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:o,replace:s,state:i,target:c,to:d,preventScrollReset:u,viewTransition:f}=t,h=Zt(t,ms),{basename:v}=w.useContext(G),S,E=!1;if(typeof d=="string"&&Ss.test(d)&&(S=d,Cs))try{let C=new URL(window.location.href),N=d.startsWith("//")?new URL(C.protocol+d):new URL(d),L=de(N.pathname,v);N.origin===C.origin&&L!=null?d=L+N.search+N.hash:E=!0}catch{process.env.NODE_ENV!=="production"&&W(!1,'<Link to="'+d+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let b=Ro(d,{relative:a}),m=Os(d,{replace:s,state:i,target:c,preventScrollReset:u,relative:a,viewTransition:f});function y(C){n&&n(C),C.defaultPrevented||m(C)}return w.createElement("a",xe({},h,{href:S||b,onClick:E||o?n:y,ref:r,target:c}))});process.env.NODE_ENV!=="production"&&(en.displayName="Link");const Es=w.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:o="",end:s=!1,style:i,to:c,viewTransition:d,children:u}=t,f=Zt(t,gs),h=Ze(c,{relative:f.relative}),v=he(),S=w.useContext(Wt),{navigator:E,basename:b}=w.useContext(G),m=S!=null&&ks(h)&&d===!0,y=E.encodeLocation?E.encodeLocation(h).pathname:h.pathname,C=v.pathname,N=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;a||(C=C.toLowerCase(),N=N?N.toLowerCase():null,y=y.toLowerCase()),N&&b&&(N=de(N,b)||N);const L=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let F=C===y||!s&&C.startsWith(y)&&C.charAt(L)==="/",$=N!=null&&(N===y||!s&&N.startsWith(y)&&N.charAt(y.length)==="/"),X={isActive:F,isPending:$,isTransitioning:m},Oe=F?n:void 0,V;typeof o=="function"?V=o(X):V=[o,F?"active":null,$?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let k=typeof i=="function"?i(X):i;return w.createElement(en,xe({},f,{"aria-current":Oe,className:V,ref:r,style:k,to:c,viewTransition:d}),typeof u=="function"?u(X):u)});process.env.NODE_ENV!=="production"&&(Es.displayName="NavLink");const _s=w.forwardRef((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:a,replace:o,state:s,method:i=mt,action:c,onSubmit:d,relative:u,preventScrollReset:f,viewTransition:h}=e,v=Zt(e,ys),S=xs(),E=Ps(c,{relative:u}),b=i.toLowerCase()==="get"?"get":"post",m=y=>{if(d&&d(y),y.defaultPrevented)return;y.preventDefault();let C=y.nativeEvent.submitter,N=C?.getAttribute("formmethod")||i;S(C||y.currentTarget,{fetcherKey:r,method:N,navigate:n,replace:o,state:s,relative:u,preventScrollReset:f,viewTransition:h})};return w.createElement("form",xe({ref:t,method:b,action:E,onSubmit:a?d:m},v))});process.env.NODE_ENV!=="production"&&(_s.displayName="Form"),process.env.NODE_ENV;var wt;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(wt||(wt={}));var tn;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(tn||(tn={}));function Ns(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function rn(e){let t=w.useContext(Ke);return t||(process.env.NODE_ENV!=="production"?A(!1,Ns(e)):A(!1)),t}function Os(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:s,viewTransition:i}=t===void 0?{}:t,c=pt(),d=he(),u=Ze(e,{relative:s});return w.useCallback(f=>{if(ds(f,r)){f.preventDefault();let h=n!==void 0?n:ze(d)===ze(u);c(e,{replace:h,state:a,preventScrollReset:o,relative:s,viewTransition:i})}},[d,c,u,n,a,r,e,o,s,i])}function Ts(e){process.env.NODE_ENV!=="production"&&W(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=w.useRef(Gt(e)),r=w.useRef(!1),n=he(),a=w.useMemo(()=>us(n.search,r.current?null:t.current),[n.search]),o=pt(),s=w.useCallback((i,c)=>{const d=Gt(typeof i=="function"?i(a):i);r.current=!0,o("?"+d,c)},[o,a]);return[a,s]}function As(){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 Ls=0,Fs=()=>"__"+String(++Ls)+"__";function xs(){let{router:e}=rn(wt.UseSubmit),{basename:t}=w.useContext(G),r=Qo();return w.useCallback(function(n,a){a===void 0&&(a={}),As();let{action:o,method:s,encType:i,formData:c,body:d}=hs(n,t);if(a.navigate===!1){let u=a.fetcherKey||Fs();e.fetch(u,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:c,body:d,formMethod:a.method||s,formEncType:a.encType||i,flushSync:a.flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:c,body:d,formMethod:a.method||s,formEncType:a.encType||i,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}function Ps(e,t){let{relative:r}=t===void 0?{}:t,{basename:n}=w.useContext(G),a=w.useContext(Y);a||(process.env.NODE_ENV!=="production"?A(!1,"useFormAction must be used inside a RouteContext"):A(!1));let[o]=a.matches.slice(-1),s=xe({},Ze(e||".",{relative:r})),i=he();if(e==null){s.search=i.search;let c=new URLSearchParams(s.search),d=c.getAll("index");if(d.some(f=>f==="")){c.delete("index"),d.filter(h=>h).forEach(h=>c.append("index",h));let f=c.toString();s.search=f?"?"+f:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:ne([n,s.pathname])),ze(s)}function ks(e,t){t===void 0&&(t={});let r=w.useContext(Yr);r==null&&(process.env.NODE_ENV!=="production"?A(!1,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):A(!1));let{basename:n}=rn(wt.useViewTransitionState),a=Ze(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=de(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=de(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Vt(a.pathname,s)!=null||Vt(a.pathname,o)!=null}function nn(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ds}=Object.prototype,{getPrototypeOf:Pe}=Object,{iterator:Xe,toStringTag:an}=Symbol,vt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Ye=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),vt(r,t))return!0;r=Pe(r)}return!1},Bs=(e,t)=>e!=null&&Ye(e,t)?e[t]:void 0,Yt=(e=>t=>{const r=Ds.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),z=e=>(e=e.toLowerCase(),t=>Yt(t)===e),Ct=e=>t=>typeof t===e,{isArray:me}=Array,ge=Ct("undefined");function ke(e){return e!==null&&!ge(e)&&e.constructor!==null&&!ge(e.constructor)&&j(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const on=z("ArrayBuffer");function Is(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&on(e.buffer),t}const Us=Ct("string"),j=Ct("function"),sn=Ct("number"),De=e=>e!==null&&typeof e=="object",Ms=e=>e===!0||e===!1,St=e=>{if(!De(e))return!1;const t=Pe(e);return(t===null||t===Object.prototype||Pe(t)===null)&&!Ye(e,an)&&!Ye(e,Xe)},$s=e=>{if(!De(e)||ke(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Rs=z("Date"),js=z("File"),Vs=e=>!!(e&&typeof e.uri<"u"),Hs=e=>e&&typeof e.getParts<"u",Ws=z("Blob"),zs=z("FileList"),qs=z("Set"),Ks=e=>De(e)&&j(e.pipe);function Js(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const ln=Js(),cn=typeof ln.FormData<"u"?ln.FormData:void 0,Zs=e=>{if(!e)return!1;if(cn&&e instanceof cn)return!0;const t=Pe(e);if(!t||t===Object.prototype||!j(e.append))return!1;const r=Yt(e);return r==="formdata"||r==="object"&&j(e.toString)&&e.toString()==="[object FormData]"},Gs=z("URLSearchParams"),[Xs,Ys,Qs,ei]=["ReadableStream","Request","Response","Headers"].map(z),ti=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qe(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),me(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(ke(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(n=0;n<s;n++)i=o[n],t.call(null,e[i],i,e)}}function dn(e,t){if(ke(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,a;for(;n-- >0;)if(a=r[n],t===a.toLowerCase())return a;return null}const ye=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,un=e=>!ge(e)&&e!==ye;function Qt(...e){const{caseless:t,skipUndefined:r}=un(this)&&this||{},n={},a=(o,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const i=t&&typeof s=="string"&&dn(n,s)||s,c=vt(n,i)?n[i]:void 0;St(c)&&St(o)?n[i]=Qt(c,o):St(o)?n[i]=Qt({},o):me(o)?n[i]=o.slice():(!r||!ge(o))&&(n[i]=o)};for(let o=0,s=e.length;o<s;o++){const i=e[o];if(!i||ke(i)||(Qe(i,a),typeof i!="object"||me(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let d=0;d<c.length;d++){const u=c[d];pi.call(i,u)&&a(i[u],u)}}return n}const ri=(e,t,r,{allOwnKeys:n}={})=>(Qe(t,(a,o)=>{r&&j(a)?Object.defineProperty(e,o,{__proto__:null,value:nn(a,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),ni=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ai=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},oi=(e,t,r,n)=>{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],(!n||n(s,e,t))&&!i[s]&&(t[s]=e[s],i[s]=!0);e=r!==!1&&Pe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},si=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},ii=e=>{if(!e)return null;if(me(e))return e;let t=e.length;if(!sn(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},li=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Pe(Uint8Array)),ci=(e,t)=>{const n=(e&&e[Xe]).call(e);let a;for(;(a=n.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},di=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},ui=z("HTMLFormElement"),fi=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),{propertyIsEnumerable:pi}=Object.prototype,hi=z("RegExp"),fn=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Qe(r,(a,o)=>{let s;(s=t(a,o,e))!==!1&&(n[o]=s||a)}),Object.defineProperties(e,n)},mi=e=>{fn(e,(t,r)=>{if(j(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(j(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},gi=(e,t)=>{const r={},n=a=>{a.forEach(o=>{r[o]=!0})};return me(e)?n(e):n(String(e).split(t)),r},yi=()=>{},bi=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function wi(e){return!!(e&&j(e.append)&&e[an]==="FormData"&&e[Xe])}const vi=e=>{const t=new WeakSet,r=n=>{if(De(n)){if(t.has(n))return;if(ke(n))return n;if(!("toJSON"in n)){t.add(n);let a;if(qs(n)){a=[];for(const o of n){const s=r(o);!ge(s)&&a.push(s)}}else a=me(n)?[]:{},Qe(n,(o,s)=>{const i=r(o);!ge(i)&&(a[s]=i)});return t.delete(n),a}}return n};return r(e)},Ci=z("AsyncFunction"),Si=e=>e&&(De(e)||j(e))&&j(e.then)&&j(e.catch),pn=((e,t)=>e?setImmediate:t?((r,n)=>(ye.addEventListener("message",({source:a,data:o})=>{a===ye&&o===r&&n.length&&n.shift()()},!1),a=>{n.push(a),ye.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",j(ye.postMessage)),Ei=typeof queueMicrotask<"u"?queueMicrotask.bind(ye):typeof process<"u"&&process.nextTick||pn,hn=e=>e!=null&&j(e[Xe]),p={isArray:me,isArrayBuffer:on,isBuffer:ke,isFormData:Zs,isArrayBufferView:Is,isString:Us,isNumber:sn,isBoolean:Ms,isObject:De,isPlainObject:St,isEmptyObject:$s,isReadableStream:Xs,isRequest:Ys,isResponse:Qs,isHeaders:ei,isUndefined:ge,isDate:Rs,isFile:js,isReactNativeBlob:Vs,isReactNative:Hs,isBlob:Ws,isRegExp:hi,isFunction:j,isStream:Ks,isURLSearchParams:Gs,isTypedArray:li,isFileList:zs,forEach:Qe,merge:Qt,extend:ri,trim:ti,stripBOM:ni,inherits:ai,toFlatObject:oi,kindOf:Yt,kindOfTest:z,endsWith:si,toArray:ii,forEachEntry:ci,matchAll:di,isHTMLForm:ui,hasOwnProperty:vt,hasOwnProp:vt,hasOwnInPrototypeChain:Ye,getSafeProp:Bs,reduceDescriptors:fn,freezeMethods:mi,toObjectSet:gi,toCamelCase:fi,noop:yi,toFiniteNumber:bi,findKey:dn,global:ye,isContextDefined:un,isSpecCompliantForm:wi,toJSONObject:vi,isAsyncFn:Ci,isThenable:Si,setImmediate:pn,asap:Ei,isIterable:hn,isSafeIterable:e=>e!=null&&Ye(e,Xe)&&hn(e)},_i=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"]),Ni=e=>{const t={};let r,n,a;return e&&e.split(`
|
|
4
|
-
`).forEach(function(s){a=s.indexOf(":"),r=s.substring(0,a).trim().toLowerCase(),n=s.substring(a+1).trim();const
|
|
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 Di(t)}static concat(t,...r){const n=new this(t);return r.forEach(a=>n.set(a)),n}static accessor(t){const n=(this[gn]=this[gn]={accessors:{}}).accessors,a=this.prototype;function o(s){const i=et(s);n[i]||(Ui(a,s),n[i]=!0)}return p.isArray(t)?t.forEach(o):o(t),this}};I.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(I.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),p.freezeMethods(I);const _t="[REDACTED ****]";function Mi(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 $i(e,t){const r=new Set(t.map(o=>String(o).toLowerCase())),n=[],a=o=>{if(o===null||typeof o!="object"||p.isBuffer(o))return o;if(n.indexOf(o)!==-1)return;o instanceof I&&(o=o.toJSON()),n.push(o);let s;if(p.isArray(o))s=[],o.forEach((i,c)=>{const d=a(i);p.isUndefined(d)||(s[c]=d)});else{if(!p.isPlainObject(o)&&Mi(o))return n.pop(),o;s=Object.create(null);for(const[i,c]of Object.entries(o)){const d=r.has(i.toLowerCase())?_t:a(c);p.isUndefined(d)||(s[i]=d)}}return n.pop(),s};return a(e)}function yn(e){try{return String(e)}catch{return""}}function Ri(e){return e.errors.map(r=>{try{return r&&r.message?yn(r.message):yn(r)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}let _=class co extends Error{static from(t,r,n,a,o,s){let i=t.message;!i&&p.isArray(t.errors)&&t.errors.length&&(i=Ri(t));const c=new co(i,r||t.code,n,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,r,n,a,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),a&&(this.request=a),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,r=t&&p.hasOwnProp(t,"redact")?t.redact:void 0,n=p.isArray(r)&&r.length>0?$i(t,r):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:n,code:this.code,status:this.status}}};_.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",_.ERR_BAD_OPTION="ERR_BAD_OPTION",_.ECONNABORTED="ECONNABORTED",_.ETIMEDOUT="ETIMEDOUT",_.ECONNREFUSED="ECONNREFUSED",_.ERR_NETWORK="ERR_NETWORK",_.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",_.ERR_DEPRECATED="ERR_DEPRECATED",_.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",_.ERR_BAD_REQUEST="ERR_BAD_REQUEST",_.ERR_CANCELED="ERR_CANCELED",_.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",_.ERR_INVALID_URL="ERR_INVALID_URL",_.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const ji=null,bn=100;function nr(e){return p.isPlainObject(e)||p.isArray(e)}function wn(e){return p.endsWith(e,"[]")?e.slice(0,-2):e}function ar(e,t,r){return e?e.concat(t).map(function(a,o){return a=wn(a),!r&&o?"["+a+"]":a}).join(r?".":""):t}function Vi(e){return p.isArray(e)&&!e.some(nr)}const Hi=p.toFlatObject(p,{},null,function(t){return/^is[A-Z]/.test(t)});function Nt(e,t,r){if(!p.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=p.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,C){return!p.isUndefined(C[y])});const n=r.metaTokens,a=r.visitor||S,o=r.dots,s=r.indexes,i=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?bn:r.maxDepth,d=i&&p.isSpecCompliantForm(t),u=[];if(!p.isFunction(a))throw new TypeError("visitor must be a function");function f(m){if(m===null)return"";if(p.isDate(m))return m.toISOString();if(p.isBoolean(m))return m.toString();if(!d&&p.isBlob(m))throw new _("Blob is not supported. Use a Buffer instead.");if(p.isArrayBuffer(m)||p.isTypedArray(m)){if(d&&typeof i=="function")return new i([m]);throw new _("Blob is not supported. Use a Buffer instead.",_.ERR_NOT_SUPPORT)}return m}function h(m){if(m>c)throw new _("Object is too deeply nested ("+m+" levels). Max depth: "+c,_.ERR_FORM_DATA_DEPTH_EXCEEDED)}function v(m,y){if(c===1/0)return JSON.stringify(m);const C=[];return JSON.stringify(m,function(L,F){if(!p.isObject(F))return F;for(;C.length&&C[C.length-1]!==this;)C.pop();return C.push(F),h(y+C.length-1),F})}function S(m,y,C){let N=m;if(p.isReactNative(t)&&p.isReactNativeBlob(m))return t.append(ar(C,y,o),f(m)),!1;if(m&&!C&&typeof m=="object"){if(p.endsWith(y,"{}"))y=n?y:y.slice(0,-2),m=v(m,1);else if(p.isArray(m)&&Vi(m)||(p.isFileList(m)||p.endsWith(y,"[]"))&&(N=p.toArray(m)))return y=wn(y),N.forEach(function(F,$){!(p.isUndefined(F)||F===null)&&t.append(s===!0?ar([y],$,o):s===null?y:y+"[]",f(F))}),!1}return nr(m)?!0:(t.append(ar(C,y,o),f(m)),!1)}const E=Object.assign(Hi,{defaultVisitor:S,convertValue:f,isVisitable:nr});function b(m,y,C=0){if(!p.isUndefined(m)){if(h(C),u.indexOf(m)!==-1)throw new Error("Circular reference detected in "+y.join("."));u.push(m),p.forEach(m,function(L,F){(!(p.isUndefined(L)||L===null)&&a.call(t,L,p.isString(F)?F.trim():F,y,E))===!0&&b(L,y?y.concat(F):[F],C+1)}),u.pop()}}if(!p.isObject(e))throw new TypeError("data must be an object");return b(e),t}function vn(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function or(e,t){this._pairs=[],e&&Nt(e,this,t)}const Cn=or.prototype;Cn.append=function(t,r){this._pairs.push([t,r])},Cn.toString=function(t){const r=t?n=>t.call(this,n,vn):vn;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function Wi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Sn(e,t,r){if(!t)return e;e=e||"";const n=p.isFunction(r)?{serialize:r}:r,a=p.getSafeProp(n,"encode")||Wi,o=p.getSafeProp(n,"serialize");let s;if(o?s=o(t,n):s=p.isURLSearchParams(t)?t.toString():new or(t,n).toString(a),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class En{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.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(n){n!==null&&t(n)})}}const sr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},zi={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:or,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ir=typeof window<"u"&&typeof document<"u",lr=typeof navigator=="object"&&navigator||void 0,qi=ir&&(!lr||["ReactNative","NativeScript","NS"].indexOf(lr.product)<0),Ki=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ji=ir&&window.location.href||"http://localhost",D={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ir,hasStandardBrowserEnv:qi,hasStandardBrowserWebWorkerEnv:Ki,navigator:lr,origin:Ji},Symbol.toStringTag,{value:"Module"})),...zi};function Zi(e,t){return Nt(e,new D.classes.URLSearchParams,{visitor:function(r,n,a,o){return D.isNode&&p.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const _n=bn;function Nn(e){if(e>_n)throw new _("FormData field is too deeply nested ("+e+" levels). Max depth: "+_n,_.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Gi(e){const t=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;let n;for(;(n=r.exec(e))!==null;)Nn(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function Xi(e){const t={},r=Object.keys(e);let n;const a=r.length;let o;for(n=0;n<a;n++)o=r[n],t[o]=e[o];return t}function On(e){function t(r,n,a,o){Nn(o);let s=r[o++];if(s==="__proto__")return!0;const i=Number.isFinite(+s),c=o>=r.length;return s=!s&&p.isArray(a)?a.length:s,c?(p.hasOwnProp(a,s)?a[s]=p.isArray(a[s])?a[s].concat(n):[a[s],n]:a[s]=n,!i):((!p.hasOwnProp(a,s)||!p.isObject(a[s]))&&(a[s]=[]),t(r,n,a[s],o)&&p.isArray(a[s])&&(a[s]=Xi(a[s])),!i)}if(p.isFormData(e)&&p.isFunction(e.entries)){const r={};return p.forEachEntry(e,(n,a)=>{t(Gi(n),a,r,0)}),r}return null}const Be=(e,t)=>e!=null&&p.hasOwnProp(e,t)?e[t]:void 0;function Yi(e,t,r){if(p.isString(e))try{return(t||JSON.parse)(e),p.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const tt={transitional:sr,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",a=n.indexOf("application/json")>-1,o=p.isObject(t);if(o&&p.isHTMLForm(t)&&(t=new FormData(t)),p.isFormData(t))return a?JSON.stringify(On(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 r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){const c=Be(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return Zi(t,c).toString();if((i=p.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=Be(this,"env"),u=d&&d.FormData;return Nt(i?{"files[]":t}:t,u&&new u,c)}}return o||a?(r.setContentType("application/json",!1),Yi(t)):t}],transformResponse:[function(t){const r=Be(this,"transitional")||tt.transitional,n=r&&r.forcedJSONParsing,a=Be(this,"responseType"),o=a==="json";if(p.isResponse(t)||p.isReadableStream(t))return t;if(t&&p.isString(t)&&(n&&!a||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,Be(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?_.from(c,_.ERR_BAD_RESPONSE,this,null,Be(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:D.classes.FormData,Blob:D.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 cr(e,t){const r=this||tt,n=t||r,a=I.from(n.headers);let o=n.data;return p.forEach(e,function(i){o=i.call(r,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function Tn(e){return!!(e&&e.__CANCEL__)}let rt=class extends _{constructor(t,r,n){super(t??"canceled",_.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function An(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new _("Request failed with status code "+r.status,r.status>=400&&r.status<500?_.ERR_BAD_REQUEST:_.ERR_BAD_RESPONSE,r.config,r.request,r))}function Qi(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function el(e,t){e=e||10;const r=new Array(e),n=new Array(e);let a=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[o];s||(s=d),r[a]=c,n[a]=d;let f=o,h=0;for(;f!==a;)h+=r[f++],f=f%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),d-s<t)return;const v=u&&d-u;return v?Math.round(h*1e3/v):void 0}}function tl(e,t){let r=0,n=1e3/t,a,o;const s=(d,u=Date.now())=>{r=u,a=null,o&&(clearTimeout(o),o=null),e(...d)};return[(...d)=>{const u=Date.now(),f=u-r;f>=n?s(d,u):(a=d,o||(o=setTimeout(()=>{o=null,s(a)},n-f)))},()=>a&&s(a)]}const Ot=(e,t,r=3)=>{let n=0;const a=el(50,250);return tl(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),d=Math.max(0,c-n),u=a(d);n=Math.max(n,c);const f={loaded:c,total:i,progress:i?c/i:void 0,bytes:d,rate:u||void 0,estimated:u&&i?(i-c)/u:void 0,event:o,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(f)},r)},Ln=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Fn=(e,t=p.asap)=>(...r)=>t(()=>e(...r)),rl=D.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,D.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(D.origin),D.navigator&&/(msie|trident)/i.test(D.navigator.userAgent)):()=>!0,nl=D.hasStandardBrowserEnv?{write(e,t,r,n,a,o,s){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];p.isNumber(r)&&i.push(`expires=${new Date(r).toUTCString()}`),p.isString(n)&&i.push(`path=${n}`),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 r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),a=n.indexOf("=");if(a!==-1&&n.slice(0,a)===e)try{return decodeURIComponent(n.slice(a+1))}catch{return n.slice(a+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function al(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ol(e,t){if(!t)return e;let r=e.length;for(;r>0&&e.charCodeAt(r-1)===47;)r--;return e.slice(0,r)+"/"+t.replace(/^\/+/,"")}const sl=/^https?:(?!\/\/)/i,il=/[\t\n\r]/g;function ll(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function cl(e){return ll(e).replace(il,"")}function dl(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,r,n="")=>`${r}${n}${_t}`)}function ul(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${_t}@`),r=t.indexOf("#"),a=(r===-1?t:t.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${_t}`);return r===-1?a:`${a}#${dl(t.slice(r+1))}`}function xn(e,t){if(typeof e=="string"){const r=cl(e);if(sl.test(r))throw new _(`Invalid URL ${JSON.stringify(ul(r))}: missing "//" after protocol`,_.ERR_INVALID_URL,t)}}function Pn(e,t,r,n){xn(t,n);let a=!al(t);return e&&(a||r===!1)?(xn(e,n),ol(e,t)):t}const kn=e=>e instanceof I?{...e}:e,fl=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function be(e,t){e=e||{},t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(u,f,h,v){return p.isPlainObject(u)&&p.isPlainObject(f)?p.merge.call({caseless:v},u,f):p.isPlainObject(f)?p.merge({},f):p.isArray(f)?f.slice():f}function a(u,f,h,v){if(p.isUndefined(f)){if(!p.isUndefined(u))return n(void 0,u,h,v)}else return n(u,f,h,v)}function o(u,f){if(!p.isUndefined(f))return n(void 0,f)}function s(u,f){if(p.isUndefined(f)){if(!p.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function i(u){const f=p.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!p.isUndefined(f))if(p.isPlainObject(f)){if(p.hasOwnProp(f,u))return f[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,f,h){if(p.hasOwnProp(t,h))return n(u,f);if(p.hasOwnProp(e,h))return n(void 0,u)}const d={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,f,h)=>a(kn(u),kn(f),h,!0)};return p.forEach(fl({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const h=p.hasOwnProp(d,f)?d[f]:a,v=p.hasOwnProp(e,f)?e[f]:void 0,S=p.hasOwnProp(t,f)?t[f]:void 0,E=h(v,S,f);p.isUndefined(E)&&h!==c||(r[f]=E)}),p.hasOwnProp(t,"validateStatus")&&p.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(p.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const pl=["content-type","content-length"];function hl(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([n,a])=>{pl.includes(n.toLowerCase())&&e.set(n,a)})}const ml=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function Dn(e){const t=be({},e),r=h=>p.hasOwnProp(t,h)?t[h]:void 0,n=r("data");let a=r("withXSRFToken");const o=r("xsrfHeaderName"),s=r("xsrfCookieName");let i=r("headers");const c=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),f=r("url");if(t.headers=i=I.from(i),t.url=Sn(Pn(d,f,u,t),r("params"),r("paramsSerializer")),c){const h=p.getSafeProp(c,"username")||"",v=p.getSafeProp(c,"password")||"";try{i.set("Authorization","Basic "+btoa(h+":"+(v?ml(v):"")))}catch(S){throw _.from(S,_.ERR_BAD_OPTION_VALUE,e)}}if(p.isFormData(n)&&(D.hasStandardBrowserEnv||D.hasStandardBrowserWebWorkerEnv||p.isReactNative(n)?i.setContentType(void 0):p.isFunction(n.getHeaders)&&hl(i,n.getHeaders(),r("formDataHeaderPolicy"))),D.hasStandardBrowserEnv&&(p.isFunction(a)&&(a=a(t)),a===!0||a==null&&rl(t.url))){const v=o&&s&&nl.read(s);v&&i.set(o,v)}return t}const gl=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const a=Dn(e);let o=a.data;const s=I.from(a.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:d}=a,u,f,h,v,S;function E(){v&&v(),S&&S(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(a.method.toUpperCase(),a.url,!0),b.timeout=a.timeout;function m(){if(!b)return;const C=I.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),L={data:!i||i==="text"||i==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:C,config:e,request:b};An(function($){r($),E()},function($){n($),E()},L),b=null}"onloadend"in b?b.onloadend=m:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.startsWith("file:"))||setTimeout(m)},b.onabort=function(){b&&(n(new _("Request aborted",_.ECONNABORTED,e,b)),E(),b=null)},b.onerror=function(N){const L=N&&N.message?N.message:"Network Error",F=new _(L,_.ERR_NETWORK,e,b);F.event=N||null,n(F),E(),b=null},b.ontimeout=function(){let N=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const L=a.transitional||sr;a.timeoutErrorMessage&&(N=a.timeoutErrorMessage),n(new _(N,L.clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,e,b)),E(),b=null},o===void 0&&s.setContentType(null),"setRequestHeader"in b&&p.forEach(mn(s),function(N,L){b.setRequestHeader(L,N)}),p.isUndefined(a.withCredentials)||(b.withCredentials=!!a.withCredentials),i&&i!=="json"&&(b.responseType=a.responseType),d&&([h,S]=Ot(d,!0),b.addEventListener("progress",h)),c&&b.upload&&([f,v]=Ot(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",v)),(a.cancelToken||a.signal)&&(u=C=>{b&&(n(!C||C.type?new rt(null,e,b):C),b.abort(),E(),b=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const y=Qi(a.url);if(y&&!D.protocols.includes(y)){n(new _("Unsupported protocol "+y+":",_.ERR_BAD_REQUEST,e)),E();return}b.send(o||null)})},yl=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const a=function(c){if(!n){n=!0,s();const d=c instanceof Error?c:this.reason;r.abort(d instanceof _?d:new rt(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,a(new _(`timeout of ${t}ms exceeded`,_.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(!n){if(c.aborted){a.call(c);return}c.addEventListener("abort",a,{once:!0})}});const{signal:i}=r;return i.unsubscribe=()=>p.asap(s),i},bl=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,a;for(;n<r;)a=n+t,yield e.slice(n,a),n=a},wl=async function*(e,t){for await(const r of vl(e))yield*bl(r,t)},vl=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Bn=(e,t,r,n)=>{const a=wl(e,t);let o=0,s,i=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await a.next();if(d){i(),c.close();return}let f=u.byteLength;if(r){let h=o+=f;r(h)}c.enqueue(new Uint8Array(u))}catch(d){throw i(d),d}},cancel(c){return i(c),a.return()}},{highWaterMark:2})},In=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Un=(e,t,r)=>t+2<r&&In(e.charCodeAt(t+1))&&In(e.charCodeAt(t+2)),Mn=e=>e<=57?e-48:(e&223)-55,Cl=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,Sl=e=>e===9||e===10||e===12||e===13||e===32,El=e=>{const t=Math.floor(e/4),r=e%4;return t*3+(r===2?1:r===3?2:0)},_l=e=>{const t=e.length;let r=0;return t>0&&e.charCodeAt(t-1)===61&&(r++,t>1&&e.charCodeAt(t-2)===61&&r++),Math.floor((t-r)*3/4)},Nl=e=>{const t=e.length;let r=0,n=0,a=!1;for(let o=0;o<t;o++){let s=e.charCodeAt(o);if(s===37&&Un(e,o,t)&&(s=Mn(e.charCodeAt(o+1))*16+Mn(e.charCodeAt(o+2)),o+=2),!Sl(s)){if(s===61){n++;continue}if(!Cl(s)||n>0){a=!0;continue}r++}}return a||n>2||n>0&&(r+n)%4!==0||r%4===1?_l(e):El(r)},Ol=(e,t)=>{if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const r=e.indexOf(",");if(r<0)return 0;const n=e.slice(5,r),a=e.slice(r+1);if(/;base64/i.test(n))return t(a);let s=0;for(let i=0,c=a.length;i<c;i++){const d=a.charCodeAt(i);if(d===37&&Un(a,i,c))s+=1,i+=2;else if(d<128)s+=1;else if(d<2048)s+=2;else if(d>=55296&&d<=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 Tl(e){const t=typeof e=="string"?e.indexOf("#"):-1;return Ol(t===-1?e:e.slice(0,t),Nl)}const dr="1.19.0",$n=64*1024,{isFunction:Tt}=p,Al=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Rn=e=>{if(!p.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},jn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ll=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},Fl=e=>{const t=p.global!==void 0&&p.global!==null?p.global:globalThis,{ReadableStream:r,TextEncoder:n}=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),d=Tt(s);if(!i)return!1;const u=i&&Tt(r),f=i&&(typeof n=="function"?(m=>y=>m.encode(y))(new n):async m=>new Uint8Array(await new o(m).arrayBuffer())),h=c&&u&&jn(()=>{let m=!1;const y=new o(D.origin,{body:new r,method:"POST",get duplex(){return m=!0,"half"}}),C=y.headers.has("Content-Type");return y.body!=null&&y.body.cancel(),m&&!C}),v=d&&u&&jn(()=>p.isReadableStream(new s("").body)),S={stream:v&&(m=>m.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!S[m]&&(S[m]=(y,C)=>{let N=y&&y[m];if(N)return N.call(y);throw new _(`Response type '${m}' is not supported`,_.ERR_NOT_SUPPORT,C)})});const E=async m=>{if(m==null)return 0;if(p.isBlob(m))return m.size;if(p.isSpecCompliantForm(m))return(await new o(D.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 f(m)).byteLength},b=async(m,y)=>{const C=p.toFiniteNumber(m.getContentLength());return C??E(y)};return async m=>{let{url:y,method:C,data:N,signal:L,cancelToken:F,timeout:$,onDownloadProgress:X,onUploadProgress:Oe,responseType:V,headers:k,withCredentials:R="same-origin",fetchOptions:se,maxContentLength:J,maxBodyLength:Mt}=Dn(m);const ct=p.isNumber(J)&&J>-1,xr=p.isNumber(Mt)&&Mt>-1,Sd=x=>p.hasOwnProp(m,x)?m[x]:void 0;let no=a||fetch;V=V?(V+"").toLowerCase():"text";let fe=yl([L,F&&F.toAbortSignal()],$),B=null;const Te=fe&&fe.unsubscribe&&(()=>{fe.unsubscribe()});let He,dt=null;const ao=()=>new _("Request body larger than maxBodyLength limit",_.ERR_BAD_REQUEST,m,B);try{let x;const Z=Sd("auth");if(Z){const T=p.getSafeProp(Z,"username")||"",H=p.getSafeProp(Z,"password")||"";x={username:T,password:H}}if(Ll(y)){const T=new URL(y,D.origin);if(!x&&(T.username||T.password)){const H=Rn(T.username),pe=Rn(T.password);x={username:H,password:pe}}(T.username||T.password)&&(T.username="",T.password="",y=T.href)}if(x&&(k.delete("authorization"),k.set("Authorization","Basic "+btoa(Al((x.username||"")+":"+(x.password||""))))),ct&&typeof y=="string"&&y.startsWith("data:")&&Tl(y)>J)throw new _("maxContentLength size of "+J+" exceeded",_.ERR_BAD_RESPONSE,m,B);if(xr&&C!=="get"&&C!=="head"){const T=await E(N);if(typeof T=="number"&&isFinite(T)&&(He=T,T>Mt))throw ao()}const $t=xr&&(p.isReadableStream(N)||p.isStream(N)),oo=(T,H,pe)=>Bn(T,$n,Ae=>{if(xr&&Ae>Mt)throw dt=ao();H&&H(Ae)},pe);if(h&&C!=="get"&&C!=="head"&&(Oe||$t)){if(He=He??await b(k,N),He!==0||$t){let T=new o(y,{method:"POST",body:N,duplex:"half"}),H;if(p.isFormData(N)&&(H=T.headers.get("content-type"))&&k.setContentType(H),T.body){const[pe,Ae]=Oe&&Ln(He,Ot(Fn(Oe)))||[];N=oo(T.body,pe,Ae)}}}else if($t&&!c&&u&&C!=="get"&&C!=="head")N=oo(N);else if($t&&c&&!h&&C!=="get"&&C!=="head")throw new _("Stream request bodies are not supported by the current fetch implementation",_.ERR_NOT_SUPPORT,m,B);p.isString(R)||(R=R?"include":"omit");const Ed=c&&"credentials"in o.prototype;if(p.isFormData(N)){const T=k.getContentType();T&&/^multipart\/form-data/i.test(T)&&!/boundary=/i.test(T)&&k.delete("content-type")}k.set("User-Agent","axios/"+dr,!1);const so={...se,signal:fe,method:C.toUpperCase(),headers:mn(k.normalize()),body:N,duplex:"half",credentials:Ed?R:void 0};B=c&&new o(y,so);let ie=await(c?no(B,se):no(y,so));const io=I.from(ie.headers);if(ct){const T=p.toFiniteNumber(io.getContentLength());if(T!=null&&T>J)throw new _("maxContentLength size of "+J+" exceeded",_.ERR_BAD_RESPONSE,m,B)}const Pr=v&&(V==="stream"||V==="response");if(v&&ie.body&&(X||ct||Pr&&Te)){const T={};["status","statusText","headers"].forEach(ut=>{T[ut]=ie[ut]});const H=p.toFiniteNumber(io.getContentLength()),[pe,Ae]=X&&Ln(H,Ot(Fn(X),!0))||[];let lo=0;const _d=ut=>{if(ct&&(lo=ut,lo>J))throw new _("maxContentLength size of "+J+" exceeded",_.ERR_BAD_RESPONSE,m,B);pe&&pe(ut)};ie=new s(Bn(ie.body,$n,_d,()=>{Ae&&Ae(),Te&&Te()}),T)}V=V||"text";let le=await S[p.findKey(S,V)||"text"](ie,m);if(ct&&!v&&!Pr){let T;if(le!=null&&(typeof le.byteLength=="number"?T=le.byteLength:typeof le.size=="number"?T=le.size:typeof le=="string"&&(T=typeof n=="function"?new n().encode(le).byteLength:le.length)),typeof T=="number"&&T>J)throw new _("maxContentLength size of "+J+" exceeded",_.ERR_BAD_RESPONSE,m,B)}return!Pr&&Te&&Te(),await new Promise((T,H)=>{An(T,H,{data:le,headers:I.from(ie.headers),status:ie.status,statusText:ie.statusText,config:m,request:B})})}catch(x){if(Te&&Te(),fe&&fe.aborted&&fe.reason instanceof _){const Z=fe.reason;throw Z.config=m,B&&(Z.request=B),x!==Z&&Object.defineProperty(Z,"cause",{__proto__:null,value:x,writable:!0,enumerable:!1,configurable:!0}),Z}if(dt)throw B&&!dt.request&&(dt.request=B),dt;if(x instanceof _)throw B&&!x.request&&(x.request=B),x;if(x&&x.name==="TypeError"&&/Load failed|fetch/i.test(x.message)){const Z=new _("Network Error",_.ERR_NETWORK,m,B,x&&x.response);throw Object.defineProperty(Z,"cause",{__proto__:null,value:x.cause||x,writable:!0,enumerable:!1,configurable:!0}),Z}throw _.from(x,x&&x.code,m,B,x&&x.response)}}},xl=new Map,Vn=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:a}=t,o=[n,a,r];let s=o.length,i=s,c,d,u=xl;for(;i--;)c=o[i],d=u.get(c),d===void 0&&u.set(c,d=i?new Map:Fl(t)),u=d;return d};Vn();const ur={http:ji,xhr:gl,fetch:{get:Vn}};p.forEach(ur,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Hn=e=>`- ${e}`,Pl=e=>p.isFunction(e)||e===null||e===!1;function kl(e,t){e=p.isArray(e)?e:[e];const{length:r}=e;let n,a;const o={};for(let s=0;s<r;s++){n=e[s];let i;if(a=n,!Pl(n)&&(a=ur[(i=String(n)).toLowerCase()],a===void 0))throw new _(`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,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=r?s.length>1?`since :
|
|
6
|
-
`+s.map(
|
|
7
|
-
`):" "+
|
|
3
|
+
`+('Please change the parent <Route path="'+y+'"> to <Route ')+('path="'+(y==="/"?"*":y+"/*")+'">.'))}let f=me(),h;if(t){var v;let y=typeof t=="string"?Fe(t):t;d==="/"||(v=y.pathname)!=null&&v.startsWith(d)||(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 "'+d+'" ')+('but pathname "'+y.pathname+'" was given in the `location` prop.')):T(!1)),h=y}else h=f;let _=h.pathname||"/",S=_;if(d!=="/"){let y=d.replace(/^\//,"").split("/");S="/"+_.replace(/^\//,"").split("/").slice(y.length).join("/")}let b=yo(e,{pathname:S});process.env.NODE_ENV!=="production"&&(process.env.NODE_ENV!=="production"&&q(u||b!=null,'No routes matched location "'+h.pathname+h.search+h.hash+'" '),process.env.NODE_ENV!=="production"&&q(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.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=Go(b&&b.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:ne([d,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?d:ne([d,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,r,n);return t&&m?w.createElement(Je.Provider,{value:{location:Re({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:de.Pop}},m):m}function Ro(){let e=ts(),t=Uo(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},s=null;return process.env.NODE_ENV!=="production"&&(console.error("Error handled by React Router default ErrorBoundary:",e),s=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:o},"ErrorBoundary")," or"," ",w.createElement("code",{style:o},"errorElement")," prop on your route."))),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:a},r):null,s)}const Ko=w.createElement(Ro,null);class Jo extends w.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?w.createElement(Y.Provider,{value:this.props.routeContext},w.createElement(zt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Zo(e){let{routeContext:t,match:r,children:n}=e,a=w.useContext(Ke);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(Y.Provider,{value:t},n)}function Go(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let u=s.findIndex(f=>f.route.id&&l?.[f.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(l).join(",")):T(!1)),s=s.slice(0,Math.min(s.length,u+1))}let c=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let u=0;u<s.length;u++){let f=s[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(d=u),f.route.id){let{loaderData:h,errors:v}=r,_=f.route.loader&&h[f.route.id]===void 0&&(!v||v[f.route.id]===void 0);if(f.route.lazy||_){c=!0,d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}return s.reduceRight((u,f,h)=>{let v,_=!1,S=null,b=null;r&&(v=l&&f.route.id?l[f.route.id]:void 0,S=f.route.errorElement||Ko,c&&(d<0&&h===0?(Zr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,b=null):d===h&&(_=!0,b=f.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,h+1)),y=()=>{let C;return v?C=S:_?C=b:f.route.Component?C=w.createElement(f.route.Component,null):f.route.element?C=f.route.element:C=u,w.createElement(Zo,{match:f,routeContext:{outlet:u,matches:m,isDataRoute:r!=null},children:C})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?w.createElement(Jo,{location:r.location,revalidation:r.revalidation,component:S,error:v,children:y(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):y()},null)}var Kr=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Kr||{}),Xe=(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})(Xe||{});function Rt(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Xo(e){let t=w.useContext(Ke);return t||(process.env.NODE_ENV!=="production"?T(!1,Rt(e)):T(!1)),t}function Qo(e){let t=w.useContext(qt);return t||(process.env.NODE_ENV!=="production"?T(!1,Rt(e)):T(!1)),t}function Yo(e){let t=w.useContext(Y);return t||(process.env.NODE_ENV!=="production"?T(!1,Rt(e)):T(!1)),t}function Kt(e){let t=Yo(e),r=t.matches[t.matches.length-1];return r.route.id||(process.env.NODE_ENV!=="production"?T(!1,e+' can only be used on routes that contain a unique "id"'):T(!1)),r.route.id}function es(){return Kt(Xe.UseRouteId)}function ts(){var e;let t=w.useContext(zt),r=Qo(Xe.UseRouteError),n=Kt(Xe.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function rs(){let{router:e}=Xo(Kr.UseNavigateStable),t=Kt(Xe.UseNavigateStable),r=w.useRef(!1);return Rr(()=>{r.current=!0}),w.useCallback(function(a,o){o===void 0&&(o={}),process.env.NODE_ENV!=="production"&&q(r.current,zr),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Re({fromRouteId:t},o)))},[e,t])}const Jr={};function Zr(e,t,r){!t&&!Jr[e]&&(Jr[e]=!0,process.env.NODE_ENV!=="production"&&q(!1,r))}const Gr={};function ns(e,t){process.env.NODE_ENV!=="production"&&!Gr[t]&&(Gr[t]=!0,console.warn(t))}const Xr=(e,t,r)=>ns(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+r+"."));function as(e,t){e?.v7_startTransition===void 0&&Xr("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&&Xr("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function Qe(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 os(e){let{basename:t="/",children:r=null,location:n,navigationType:a=de.Pop,navigator:o,static:s=!1,future:l}=e;xe()&&(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(/^\/*/,"/"),d=w.useMemo(()=>({basename:c,navigator:o,static:s,future:Re({v7_relativeSplatPath:!1},l)}),[c,l,o,s]);typeof n=="string"&&(n=Fe(n));let{pathname:u="/",search:f="",hash:h="",state:v=null,key:_="default"}=n,S=w.useMemo(()=>{let b=ue(u,c);return b==null?null:{location:{pathname:b,search:f,hash:h,state:v,key:_},navigationType:a}},[c,u,f,h,v,_,a]);return process.env.NODE_ENV!=="production"&&q(S!=null,'<Router basename="'+c+'"> is not able to match the URL '+('"'+u+f+h+'" because it does not start with the ')+"basename, so the <Router> won't render anything."),S==null?null:w.createElement(X.Provider,{value:d},w.createElement(Je.Provider,{children:r,value:S}))}function ss(e){let{children:t,location:r}=e;return qo(Jt(t),r)}new Promise(()=>{});function Jt(e,t){t===void 0&&(t=[]);let r=[];return w.Children.forEach(e,(n,a)=>{if(!w.isValidElement(n))return;let o=[...t,a];if(n.type===w.Fragment){r.push.apply(r,Jt(n.props.children,o));return}n.type!==Qe&&(process.env.NODE_ENV!=="production"?T(!1,"["+(typeof n.type=="string"?n.type:n.type.name)+"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>"):T(!1)),!n.props.index||!n.props.children||(process.env.NODE_ENV!=="production"?T(!1,"An index route cannot have child routes."):T(!1));let s={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=Jt(n.props.children,o)),r.push(s)}),r}function Pe(){return Pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pe.apply(null,arguments)}function Zt(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}const mt="get",gt="application/x-www-form-urlencoded";function yt(e){return e!=null&&typeof e.tagName=="string"}function is(e){return yt(e)&&e.tagName.toLowerCase()==="button"}function ls(e){return yt(e)&&e.tagName.toLowerCase()==="form"}function cs(e){return yt(e)&&e.tagName.toLowerCase()==="input"}function ds(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function us(e,t){return e.button===0&&(!t||t==="_self")&&!ds(e)}function Gt(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function fs(e,t){let r=Gt(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}let bt=null;function ps(){if(bt===null)try{new FormData(document.createElement("form"),0),bt=!1}catch{bt=!0}return bt}const hs=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xt(e){return e!=null&&!hs.has(e)?(process.env.NODE_ENV!=="production"&&q(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+gt+'"')),null):e}function ms(e,t){let r,n,a,o,s;if(ls(e)){let l=e.getAttribute("action");n=l?ue(l,t):null,r=e.getAttribute("method")||mt,a=Xt(e.getAttribute("enctype"))||gt,o=new FormData(e)}else if(is(e)||cs(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(n=c?ue(c,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||mt,a=Xt(e.getAttribute("formenctype"))||Xt(l.getAttribute("enctype"))||gt,o=new FormData(l,e),!ps()){let{name:d,type:u,value:f}=e;if(u==="image"){let h=d?d+".":"";o.append(h+"x","0"),o.append(h+"y","0")}else d&&o.append(d,f)}}else{if(yt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=mt,n=null,a=gt,s=e}return o&&a==="text/plain"&&(s=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:s}}const gs=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ys=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],bs=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"],vs="6";try{window.__reactRouterVersion=vs}catch{}const Qr=w.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Qr.displayName="ViewTransition");const ws=w.createContext(new Map);process.env.NODE_ENV!=="production"&&(ws.displayName="Fetchers");const Yr=w["startTransition"];function Cs(e){let{basename:t,children:r,future:n,window:a}=e,o=w.useRef();o.current==null&&(o.current=ho({window:a,v5Compat:!0}));let s=o.current,[l,c]=w.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=w.useCallback(f=>{d&&Yr?Yr(()=>c(f)):c(f)},[c,d]);return w.useLayoutEffect(()=>s.listen(u),[s,u]),w.useEffect(()=>as(n),[n]),w.createElement(os,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}process.env.NODE_ENV;const _s=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ss=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,en=w.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:o,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:f}=t,h=Zt(t,gs),{basename:v}=w.useContext(X),_,S=!1;if(typeof d=="string"&&Ss.test(d)&&(_=d,_s))try{let C=new URL(window.location.href),N=d.startsWith("//")?new URL(C.protocol+d):new URL(d),A=ue(N.pathname,v);N.origin===C.origin&&A!=null?d=A+N.search+N.hash:S=!0}catch{process.env.NODE_ENV!=="production"&&q(!1,'<Link to="'+d+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let b=Vo(d,{relative:a}),m=Os(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:a,viewTransition:f});function y(C){n&&n(C),C.defaultPrevented||m(C)}return w.createElement("a",Pe({},h,{href:_||b,onClick:S||o?n:y,ref:r,target:c}))});process.env.NODE_ENV!=="production"&&(en.displayName="Link");const Es=w.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:o="",end:s=!1,style:l,to:c,viewTransition:d,children:u}=t,f=Zt(t,ys),h=Ge(c,{relative:f.relative}),v=me(),_=w.useContext(qt),{navigator:S,basename:b}=w.useContext(X),m=_!=null&&Ds(h)&&d===!0,y=S.encodeLocation?S.encodeLocation(h).pathname:h.pathname,C=v.pathname,N=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;a||(C=C.toLowerCase(),N=N?N.toLowerCase():null,y=y.toLowerCase()),N&&b&&(N=ue(N,b)||N);const A=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let F=C===y||!s&&C.startsWith(y)&&C.charAt(A)==="/",$=N!=null&&(N===y||!s&&N.startsWith(y)&&N.charAt(y.length)==="/"),Q={isActive:F,isPending:$,isTransitioning:m},Oe=F?n:void 0,H;typeof o=="function"?H=o(Q):H=[o,F?"active":null,$?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let k=typeof l=="function"?l(Q):l;return w.createElement(en,Pe({},f,{"aria-current":Oe,className:H,ref:r,style:k,to:c,viewTransition:d}),typeof u=="function"?u(Q):u)});process.env.NODE_ENV!=="production"&&(Es.displayName="NavLink");const Ns=w.forwardRef((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:a,replace:o,state:s,method:l=mt,action:c,onSubmit:d,relative:u,preventScrollReset:f,viewTransition:h}=e,v=Zt(e,bs),_=Ps(),S=ks(c,{relative:u}),b=l.toLowerCase()==="get"?"get":"post",m=y=>{if(d&&d(y),y.defaultPrevented)return;y.preventDefault();let C=y.nativeEvent.submitter,N=C?.getAttribute("formmethod")||l;_(C||y.currentTarget,{fetcherKey:r,method:N,navigate:n,replace:o,state:s,relative:u,preventScrollReset:f,viewTransition:h})};return w.createElement("form",Pe({ref:t,method:b,action:S,onSubmit:a?d:m},v))});process.env.NODE_ENV!=="production"&&(Ns.displayName="Form"),process.env.NODE_ENV;var vt;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(vt||(vt={}));var tn;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(tn||(tn={}));function Ls(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function rn(e){let t=w.useContext(Ke);return t||(process.env.NODE_ENV!=="production"?T(!1,Ls(e)):T(!1)),t}function Os(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ze(),d=me(),u=Ge(e,{relative:s});return w.useCallback(f=>{if(us(f,r)){f.preventDefault();let h=n!==void 0?n:ze(d)===ze(u);c(e,{replace:h,state:a,preventScrollReset:o,relative:s,viewTransition:l})}},[d,c,u,n,a,r,e,o,s,l])}function Ts(e){process.env.NODE_ENV!=="production"&&q(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=w.useRef(Gt(e)),r=w.useRef(!1),n=me(),a=w.useMemo(()=>fs(n.search,r.current?null:t.current),[n.search]),o=Ze(),s=w.useCallback((l,c)=>{const d=Gt(typeof l=="function"?l(a):l);r.current=!0,o("?"+d,c)},[o,a]);return[a,s]}function As(){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 Fs=0,xs=()=>"__"+String(++Fs)+"__";function Ps(){let{router:e}=rn(vt.UseSubmit),{basename:t}=w.useContext(X),r=es();return w.useCallback(function(n,a){a===void 0&&(a={}),As();let{action:o,method:s,encType:l,formData:c,body:d}=ms(n,t);if(a.navigate===!1){let u=a.fetcherKey||xs();e.fetch(u,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:c,body:d,formMethod:a.method||s,formEncType:a.encType||l,flushSync:a.flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:c,body:d,formMethod:a.method||s,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}function ks(e,t){let{relative:r}=t===void 0?{}:t,{basename:n}=w.useContext(X),a=w.useContext(Y);a||(process.env.NODE_ENV!=="production"?T(!1,"useFormAction must be used inside a RouteContext"):T(!1));let[o]=a.matches.slice(-1),s=Pe({},Ge(e||".",{relative:r})),l=me();if(e==null){s.search=l.search;let c=new URLSearchParams(s.search),d=c.getAll("index");if(d.some(f=>f==="")){c.delete("index"),d.filter(h=>h).forEach(h=>c.append("index",h));let f=c.toString();s.search=f?"?"+f:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:ne([n,s.pathname])),ze(s)}function Ds(e,t){t===void 0&&(t={});let r=w.useContext(Qr);r==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:n}=rn(vt.useViewTransitionState),a=Ge(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=ue(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=ue(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Ht(a.pathname,s)!=null||Ht(a.pathname,o)!=null}function nn(e,t){return function(){return e.apply(t,arguments)}}const{toString:Bs}=Object.prototype,{getPrototypeOf:ke}=Object,{iterator:Ye,toStringTag:an}=Symbol,wt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),et=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),wt(r,t))return!0;r=ke(r)}return!1},Is=(e,t)=>e!=null&&et(e,t)?e[t]:void 0,Qt=(e=>t=>{const r=Bs.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),z=e=>(e=e.toLowerCase(),t=>Qt(t)===e),Ct=e=>t=>typeof t===e,{isArray:ge}=Array,ye=Ct("undefined");function De(e){return e!==null&&!ye(e)&&e.constructor!==null&&!ye(e.constructor)&&V(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const on=z("ArrayBuffer");function Ms(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&on(e.buffer),t}const Us=Ct("string"),V=Ct("function"),sn=Ct("number"),Be=e=>e!==null&&typeof e=="object",$s=e=>e===!0||e===!1,_t=e=>{if(!Be(e))return!1;const t=ke(e);return(t===null||t===Object.prototype||ke(t)===null)&&!et(e,an)&&!et(e,Ye)},js=e=>{if(!Be(e)||De(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Vs=z("Date"),Hs=z("File"),Ws=e=>!!(e&&typeof e.uri<"u"),qs=e=>e&&typeof e.getParts<"u",zs=z("Blob"),Rs=z("FileList"),Ks=z("Set"),Js=e=>Be(e)&&V(e.pipe);function Zs(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const ln=Zs(),cn=typeof ln.FormData<"u"?ln.FormData:void 0,Gs=e=>{if(!e)return!1;if(cn&&e instanceof cn)return!0;const t=ke(e);if(!t||t===Object.prototype||!V(e.append))return!1;const r=Qt(e);return r==="formdata"||r==="object"&&V(e.toString)&&e.toString()==="[object FormData]"},Xs=z("URLSearchParams"),[Qs,Ys,ei,ti]=["ReadableStream","Request","Response","Headers"].map(z),ri=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function tt(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),ge(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(De(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let l;for(n=0;n<s;n++)l=o[n],t.call(null,e[l],l,e)}}function dn(e,t){if(De(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,a;for(;n-- >0;)if(a=r[n],t===a.toLowerCase())return a;return null}const be=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,un=e=>!ye(e)&&e!==be;function Yt(...e){const{caseless:t,skipUndefined:r}=un(this)&&this||{},n={},a=(o,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const l=t&&typeof s=="string"&&dn(n,s)||s,c=wt(n,l)?n[l]:void 0;_t(c)&&_t(o)?n[l]=Yt(c,o):_t(o)?n[l]=Yt({},o):ge(o)?n[l]=o.slice():(!r||!ye(o))&&(n[l]=o)};for(let o=0,s=e.length;o<s;o++){const l=e[o];if(!l||De(l)||(tt(l,a),typeof l!="object"||ge(l)))continue;const c=Object.getOwnPropertySymbols(l);for(let d=0;d<c.length;d++){const u=c[d];hi.call(l,u)&&a(l[u],u)}}return n}const ni=(e,t,r,{allOwnKeys:n}={})=>(tt(t,(a,o)=>{r&&V(a)?Object.defineProperty(e,o,{__proto__:null,value:nn(a,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),ai=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),oi=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},si=(e,t,r,n)=>{let a,o,s;const l={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&ke(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ii=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},li=e=>{if(!e)return null;if(ge(e))return e;let t=e.length;if(!sn(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ci=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ke(Uint8Array)),di=(e,t)=>{const n=(e&&e[Ye]).call(e);let a;for(;(a=n.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},ui=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},fi=z("HTMLFormElement"),pi=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),{propertyIsEnumerable:hi}=Object.prototype,mi=z("RegExp"),fn=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};tt(r,(a,o)=>{let s;(s=t(a,o,e))!==!1&&(n[o]=s||a)}),Object.defineProperties(e,n)},gi=e=>{fn(e,(t,r)=>{if(V(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(V(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},yi=(e,t)=>{const r={},n=a=>{a.forEach(o=>{r[o]=!0})};return ge(e)?n(e):n(String(e).split(t)),r},bi=()=>{},vi=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function wi(e){return!!(e&&V(e.append)&&e[an]==="FormData"&&e[Ye])}const Ci=e=>{const t=new WeakSet,r=n=>{if(Be(n)){if(t.has(n))return;if(De(n))return n;if(!("toJSON"in n)){t.add(n);let a;if(Ks(n)){a=[];for(const o of n){const s=r(o);!ye(s)&&a.push(s)}}else a=ge(n)?[]:{},tt(n,(o,s)=>{const l=r(o);!ye(l)&&(a[s]=l)});return t.delete(n),a}}return n};return r(e)},_i=z("AsyncFunction"),Si=e=>e&&(Be(e)||V(e))&&V(e.then)&&V(e.catch),pn=((e,t)=>e?setImmediate:t?((r,n)=>(be.addEventListener("message",({source:a,data:o})=>{a===be&&o===r&&n.length&&n.shift()()},!1),a=>{n.push(a),be.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",V(be.postMessage)),Ei=typeof queueMicrotask<"u"?queueMicrotask.bind(be):typeof process<"u"&&process.nextTick||pn,hn=e=>e!=null&&V(e[Ye]),p={isArray:ge,isArrayBuffer:on,isBuffer:De,isFormData:Gs,isArrayBufferView:Ms,isString:Us,isNumber:sn,isBoolean:$s,isObject:Be,isPlainObject:_t,isEmptyObject:js,isReadableStream:Qs,isRequest:Ys,isResponse:ei,isHeaders:ti,isUndefined:ye,isDate:Vs,isFile:Hs,isReactNativeBlob:Ws,isReactNative:qs,isBlob:zs,isRegExp:mi,isFunction:V,isStream:Js,isURLSearchParams:Xs,isTypedArray:ci,isFileList:Rs,forEach:tt,merge:Yt,extend:ni,trim:ri,stripBOM:ai,inherits:oi,toFlatObject:si,kindOf:Qt,kindOfTest:z,endsWith:ii,toArray:li,forEachEntry:di,matchAll:ui,isHTMLForm:fi,hasOwnProperty:wt,hasOwnProp:wt,hasOwnInPrototypeChain:et,getSafeProp:Is,reduceDescriptors:fn,freezeMethods:gi,toObjectSet:yi,toCamelCase:pi,noop:bi,toFiniteNumber:vi,findKey:dn,global:be,isContextDefined:un,isSpecCompliantForm:wi,toJSONObject:Ci,isAsyncFn:_i,isThenable:Si,setImmediate:pn,asap:Ei,isIterable:hn,isSafeIterable:e=>e!=null&&et(e,Ye)&&hn(e)},Ni=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"]),Li=e=>{const t={};let r,n,a;return e&&e.split(`
|
|
4
|
+
`).forEach(function(s){a=s.indexOf(":"),r=s.substring(0,a).trim().toLowerCase(),n=s.substring(a+1).trim();const l=p.hasOwnProp(t,r);!r||l&&p.hasOwnProp(Ni,r)||(r==="set-cookie"?l?t[r].push(n):t[r]=[n]:t[r]=l?t[r]+", "+n:n)}),t};function Oi(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const Ti=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Ai=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function er(e,t){return p.isArray(e)?e.map(r=>er(r,t)):Oi(String(e).replace(t,""))}const Fi=e=>er(e,Ti),xi=e=>er(e,Ai);function mn(e){const t=Object.create(null);return p.forEach(e.toJSON(),(r,n)=>{t[n]=xi(r)}),t}const gn=Symbol("internals");function rt(e){return e&&String(e).trim().toLowerCase()}function St(e){return e===!1||e==null?e:p.isArray(e)?e.map(St):Fi(String(e))}function Pi(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const ki=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function tr(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function Di(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let r="";for(let n=1;n<t;n++){const a=e.charCodeAt(n);if(a===34||a===92&&(n+=1,n>=t))return e;r+=e[n]}return r}function Bi(e){const t=Object.create(null),r=String(e);let n=0,a=!1,o=!1;function s(l){const c=tr(r.slice(n,l)),d=c.indexOf("=");if(d<1)return;const u=tr(c.slice(0,d));if(!ki.test(u))return;const f=u.toLowerCase();if(f==="__proto__"||f==="constructor"||f==="prototype")return;const h=tr(c.slice(d+1));t[f]=Di(h)}for(let l=0;l<r.length;l++){const c=r.charCodeAt(l);a?o?o=!1:c===92?o=!0:c===34&&(a=!1):c===34?a=!0:(c===44||c===59)&&(s(l),n=l+1)}return s(r.length),t}const Ii=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function rr(e,t,r,n,a){if(p.isFunction(n))return n.call(this,t,r);if(a&&(t=r),!!p.isString(t)){if(p.isString(n))return t.indexOf(n)!==-1;if(p.isRegExp(n))return n.test(t)}}function Mi(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Ui(e,t){const r=p.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(a,o,s){return this[n].call(this,t,a,o,s)},configurable:!0})})}let I=class{constructor(t){t&&this.set(t)}set(t,r,n){const a=this;function o(l,c,d){const u=rt(c);if(!u)return;const f=p.findKey(a,u);(!f||a[f]===void 0||d===!0||d===void 0&&a[f]!==!1)&&(a[f||c]=St(l))}const s=(l,c)=>p.forEach(l,(d,u)=>o(d,u,c));if(p.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(p.isString(t)&&(t=t.trim())&&!Ii(t))s(Li(t),r);else if(p.isObject(t)&&p.isSafeIterable(t)){let l=Object.create(null),c,d;for(const u of t){if(!p.isArray(u))throw new TypeError("Object iterator must return a key-value pair");d=u[0],p.hasOwnProp(l,d)?(c=l[d],l[d]=p.isArray(c)?[...c,u[1]]:[c,u[1]]):l[d]=u[1]}s(l,r)}else t!=null&&o(r,t,n);return this}get(t,r){if(t=rt(t),t){const n=p.findKey(this,t);if(n){const a=this[n];if(!r)return a;if(r===!0)return Pi(a);if(p.isFunction(r))return r.call(this,a,n);if(p.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=rt(t),t){const n=p.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||rr(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let a=!1;function o(s){if(s=rt(s),s){const l=p.findKey(n,s);l&&(!r||rr(n,n[l],l,r))&&(delete n[l],a=!0)}}return p.isArray(t)?t.forEach(o):o(t),a}clear(t){const r=Object.keys(this);let n=r.length,a=!1;for(;n--;){const o=r[n];(!t||rr(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){const r=this,n={};return p.forEach(this,(a,o)=>{const s=p.findKey(n,o);if(s){r[s]=St(a),delete r[o];return}const l=t?Mi(o):String(o).trim();l!==o&&delete r[o],r[l]=St(a),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return p.forEach(this,(n,a)=>{n!=null&&n!==!1&&(r[a]=t&&p.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).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 Bi(t)}static concat(t,...r){const n=new this(t);return r.forEach(a=>n.set(a)),n}static accessor(t){const n=(this[gn]=this[gn]={accessors:{}}).accessors,a=this.prototype;function o(s){const l=rt(s);n[l]||(Ui(a,s),n[l]=!0)}return p.isArray(t)?t.forEach(o):o(t),this}};I.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(I.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),p.freezeMethods(I);const Et="[REDACTED ****]";function $i(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 ji(e,t){const r=new Set(t.map(o=>String(o).toLowerCase())),n=[],a=o=>{if(o===null||typeof o!="object"||p.isBuffer(o))return o;if(n.indexOf(o)!==-1)return;o instanceof I&&(o=o.toJSON()),n.push(o);let s;if(p.isArray(o))s=[],o.forEach((l,c)=>{const d=a(l);p.isUndefined(d)||(s[c]=d)});else{if(!p.isPlainObject(o)&&$i(o))return n.pop(),o;s=Object.create(null);for(const[l,c]of Object.entries(o)){const d=r.has(l.toLowerCase())?Et:a(c);p.isUndefined(d)||(s[l]=d)}}return n.pop(),s};return a(e)}function yn(e){try{return String(e)}catch{return""}}function Vi(e){return e.errors.map(r=>{try{return r&&r.message?yn(r.message):yn(r)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}let E=class uo extends Error{static from(t,r,n,a,o,s){let l=t.message;!l&&p.isArray(t.errors)&&t.errors.length&&(l=Vi(t));const c=new uo(l,r||t.code,n,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,r,n,a,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),a&&(this.request=a),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,r=t&&p.hasOwnProp(t,"redact")?t.redact:void 0,n=p.isArray(r)&&r.length>0?ji(t,r):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:n,code:this.code,status:this.status}}};E.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",E.ERR_BAD_OPTION="ERR_BAD_OPTION",E.ECONNABORTED="ECONNABORTED",E.ETIMEDOUT="ETIMEDOUT",E.ECONNREFUSED="ECONNREFUSED",E.ERR_NETWORK="ERR_NETWORK",E.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",E.ERR_DEPRECATED="ERR_DEPRECATED",E.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",E.ERR_BAD_REQUEST="ERR_BAD_REQUEST",E.ERR_CANCELED="ERR_CANCELED",E.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",E.ERR_INVALID_URL="ERR_INVALID_URL",E.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Hi=null,bn=100;function nr(e){return p.isPlainObject(e)||p.isArray(e)}function vn(e){return p.endsWith(e,"[]")?e.slice(0,-2):e}function ar(e,t,r){return e?e.concat(t).map(function(a,o){return a=vn(a),!r&&o?"["+a+"]":a}).join(r?".":""):t}function Wi(e){return p.isArray(e)&&!e.some(nr)}const qi=p.toFlatObject(p,{},null,function(t){return/^is[A-Z]/.test(t)});function Nt(e,t,r){if(!p.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=p.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,C){return!p.isUndefined(C[y])});const n=r.metaTokens,a=r.visitor||_,o=r.dots,s=r.indexes,l=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?bn:r.maxDepth,d=l&&p.isSpecCompliantForm(t),u=[];if(!p.isFunction(a))throw new TypeError("visitor must be a function");function f(m){if(m===null)return"";if(p.isDate(m))return m.toISOString();if(p.isBoolean(m))return m.toString();if(!d&&p.isBlob(m))throw new E("Blob is not supported. Use a Buffer instead.");if(p.isArrayBuffer(m)||p.isTypedArray(m)){if(d&&typeof l=="function")return new l([m]);throw new E("Blob is not supported. Use a Buffer instead.",E.ERR_NOT_SUPPORT)}return m}function h(m){if(m>c)throw new E("Object is too deeply nested ("+m+" levels). Max depth: "+c,E.ERR_FORM_DATA_DEPTH_EXCEEDED)}function v(m,y){if(c===1/0)return JSON.stringify(m);const C=[];return JSON.stringify(m,function(A,F){if(!p.isObject(F))return F;for(;C.length&&C[C.length-1]!==this;)C.pop();return C.push(F),h(y+C.length-1),F})}function _(m,y,C){let N=m;if(p.isReactNative(t)&&p.isReactNativeBlob(m))return t.append(ar(C,y,o),f(m)),!1;if(m&&!C&&typeof m=="object"){if(p.endsWith(y,"{}"))y=n?y:y.slice(0,-2),m=v(m,1);else if(p.isArray(m)&&Wi(m)||(p.isFileList(m)||p.endsWith(y,"[]"))&&(N=p.toArray(m)))return y=vn(y),N.forEach(function(F,$){!(p.isUndefined(F)||F===null)&&t.append(s===!0?ar([y],$,o):s===null?y:y+"[]",f(F))}),!1}return nr(m)?!0:(t.append(ar(C,y,o),f(m)),!1)}const S=Object.assign(qi,{defaultVisitor:_,convertValue:f,isVisitable:nr});function b(m,y,C=0){if(!p.isUndefined(m)){if(h(C),u.indexOf(m)!==-1)throw new Error("Circular reference detected in "+y.join("."));u.push(m),p.forEach(m,function(A,F){(!(p.isUndefined(A)||A===null)&&a.call(t,A,p.isString(F)?F.trim():F,y,S))===!0&&b(A,y?y.concat(F):[F],C+1)}),u.pop()}}if(!p.isObject(e))throw new TypeError("data must be an object");return b(e),t}function wn(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function or(e,t){this._pairs=[],e&&Nt(e,this,t)}const Cn=or.prototype;Cn.append=function(t,r){this._pairs.push([t,r])},Cn.toString=function(t){const r=t?n=>t.call(this,n,wn):wn;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function zi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _n(e,t,r){if(!t)return e;e=e||"";const n=p.isFunction(r)?{serialize:r}:r,a=p.getSafeProp(n,"encode")||zi,o=p.getSafeProp(n,"serialize");let s;if(o?s=o(t,n):s=p.isURLSearchParams(t)?t.toString():new or(t,n).toString(a),s){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Sn{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.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(n){n!==null&&t(n)})}}const sr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Ri={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:or,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ir=typeof window<"u"&&typeof document<"u",lr=typeof navigator=="object"&&navigator||void 0,Ki=ir&&(!lr||["ReactNative","NativeScript","NS"].indexOf(lr.product)<0),Ji=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Zi=ir&&window.location.href||"http://localhost",D={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ir,hasStandardBrowserEnv:Ki,hasStandardBrowserWebWorkerEnv:Ji,navigator:lr,origin:Zi},Symbol.toStringTag,{value:"Module"})),...Ri};function Gi(e,t){return Nt(e,new D.classes.URLSearchParams,{visitor:function(r,n,a,o){return D.isNode&&p.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const En=bn;function Nn(e){if(e>En)throw new E("FormData field is too deeply nested ("+e+" levels). Max depth: "+En,E.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Xi(e){const t=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;let n;for(;(n=r.exec(e))!==null;)Nn(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function Qi(e){const t={},r=Object.keys(e);let n;const a=r.length;let o;for(n=0;n<a;n++)o=r[n],t[o]=e[o];return t}function Ln(e){function t(r,n,a,o){Nn(o);let s=r[o++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=o>=r.length;return s=!s&&p.isArray(a)?a.length:s,c?(p.hasOwnProp(a,s)?a[s]=p.isArray(a[s])?a[s].concat(n):[a[s],n]:a[s]=n,!l):((!p.hasOwnProp(a,s)||!p.isObject(a[s]))&&(a[s]=[]),t(r,n,a[s],o)&&p.isArray(a[s])&&(a[s]=Qi(a[s])),!l)}if(p.isFormData(e)&&p.isFunction(e.entries)){const r={};return p.forEachEntry(e,(n,a)=>{t(Xi(n),a,r,0)}),r}return null}const Ie=(e,t)=>e!=null&&p.hasOwnProp(e,t)?e[t]:void 0;function Yi(e,t,r){if(p.isString(e))try{return(t||JSON.parse)(e),p.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const nt={transitional:sr,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",a=n.indexOf("application/json")>-1,o=p.isObject(t);if(o&&p.isHTMLForm(t)&&(t=new FormData(t)),p.isFormData(t))return a?JSON.stringify(Ln(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 r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(o){const c=Ie(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return Gi(t,c).toString();if((l=p.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=Ie(this,"env"),u=d&&d.FormData;return Nt(l?{"files[]":t}:t,u&&new u,c)}}return o||a?(r.setContentType("application/json",!1),Yi(t)):t}],transformResponse:[function(t){const r=Ie(this,"transitional")||nt.transitional,n=r&&r.forcedJSONParsing,a=Ie(this,"responseType"),o=a==="json";if(p.isResponse(t)||p.isReadableStream(t))return t;if(t&&p.isString(t)&&(n&&!a||o)){const l=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,Ie(this,"parseReviver"))}catch(c){if(l)throw c.name==="SyntaxError"?E.from(c,E.ERR_BAD_RESPONSE,this,null,Ie(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:D.classes.FormData,Blob:D.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=>{nt.headers[e]={}});function cr(e,t){const r=this||nt,n=t||r,a=I.from(n.headers);let o=n.data;return p.forEach(e,function(l){o=l.call(r,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function On(e){return!!(e&&e.__CANCEL__)}let at=class extends E{constructor(t,r,n){super(t??"canceled",E.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function Tn(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new E("Request failed with status code "+r.status,r.status>=400&&r.status<500?E.ERR_BAD_REQUEST:E.ERR_BAD_RESPONSE,r.config,r.request,r))}function el(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function tl(e,t){e=e||10;const r=new Array(e),n=new Array(e);let a=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[o];s||(s=d),r[a]=c,n[a]=d;let f=o,h=0;for(;f!==a;)h+=r[f++],f=f%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),d-s<t)return;const v=u&&d-u;return v?Math.round(h*1e3/v):void 0}}function rl(e,t){let r=0,n=1e3/t,a,o;const s=(d,u=Date.now())=>{r=u,a=null,o&&(clearTimeout(o),o=null),e(...d)};return[(...d)=>{const u=Date.now(),f=u-r;f>=n?s(d,u):(a=d,o||(o=setTimeout(()=>{o=null,s(a)},n-f)))},()=>a&&s(a)]}const Lt=(e,t,r=3)=>{let n=0;const a=tl(50,250);return rl(o=>{if(!o||typeof o.loaded!="number")return;const s=o.loaded,l=o.lengthComputable?o.total:void 0,c=Math.max(0,l!=null?Math.min(s,l):s),d=Math.max(0,c-n),u=a(d);n=Math.max(n,c);const f={loaded:c,total:l,progress:l?c/l:void 0,bytes:d,rate:u||void 0,estimated:u&&l?(l-c)/u:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},r)},An=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Fn=(e,t=p.asap)=>(...r)=>t(()=>e(...r)),nl=D.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,D.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(D.origin),D.navigator&&/(msie|trident)/i.test(D.navigator.userAgent)):()=>!0,al=D.hasStandardBrowserEnv?{write(e,t,r,n,a,o,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];p.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),p.isString(n)&&l.push(`path=${n}`),p.isString(a)&&l.push(`domain=${a}`),o===!0&&l.push("secure"),p.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),a=n.indexOf("=");if(a!==-1&&n.slice(0,a)===e)try{return decodeURIComponent(n.slice(a+1))}catch{return n.slice(a+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ol(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sl(e,t){if(!t)return e;let r=e.length;for(;r>0&&e.charCodeAt(r-1)===47;)r--;return e.slice(0,r)+"/"+t.replace(/^\/+/,"")}const il=/^https?:(?!\/\/)/i,ll=/[\t\n\r]/g;function cl(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function dl(e){return cl(e).replace(ll,"")}function ul(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,r,n="")=>`${r}${n}${Et}`)}function fl(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Et}@`),r=t.indexOf("#"),a=(r===-1?t:t.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Et}`);return r===-1?a:`${a}#${ul(t.slice(r+1))}`}function xn(e,t){if(typeof e=="string"){const r=dl(e);if(il.test(r))throw new E(`Invalid URL ${JSON.stringify(fl(r))}: missing "//" after protocol`,E.ERR_INVALID_URL,t)}}function Pn(e,t,r,n){xn(t,n);let a=!ol(t);return e&&(a||r===!1)?(xn(e,n),sl(e,t)):t}const kn=e=>e instanceof I?{...e}:e,pl=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function ve(e,t){e=e||{},t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(u,f,h,v){return p.isPlainObject(u)&&p.isPlainObject(f)?p.merge.call({caseless:v},u,f):p.isPlainObject(f)?p.merge({},f):p.isArray(f)?f.slice():f}function a(u,f,h,v){if(p.isUndefined(f)){if(!p.isUndefined(u))return n(void 0,u,h,v)}else return n(u,f,h,v)}function o(u,f){if(!p.isUndefined(f))return n(void 0,f)}function s(u,f){if(p.isUndefined(f)){if(!p.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function l(u){const f=p.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!p.isUndefined(f))if(p.isPlainObject(f)){if(p.hasOwnProp(f,u))return f[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,f,h){if(p.hasOwnProp(t,h))return n(u,f);if(p.hasOwnProp(e,h))return n(void 0,u)}const d={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,f,h)=>a(kn(u),kn(f),h,!0)};return p.forEach(pl({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const h=p.hasOwnProp(d,f)?d[f]:a,v=p.hasOwnProp(e,f)?e[f]:void 0,_=p.hasOwnProp(t,f)?t[f]:void 0,S=h(v,_,f);p.isUndefined(S)&&h!==c||(r[f]=S)}),p.hasOwnProp(t,"validateStatus")&&p.isUndefined(t.validateStatus)&&l("validateStatusUndefinedResolves")===!1&&(p.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const hl=["content-type","content-length"];function ml(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([n,a])=>{hl.includes(n.toLowerCase())&&e.set(n,a)})}const gl=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function Dn(e){const t=ve({},e),r=h=>p.hasOwnProp(t,h)?t[h]:void 0,n=r("data");let a=r("withXSRFToken");const o=r("xsrfHeaderName"),s=r("xsrfCookieName");let l=r("headers");const c=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),f=r("url");if(t.headers=l=I.from(l),t.url=_n(Pn(d,f,u,t),r("params"),r("paramsSerializer")),c){const h=p.getSafeProp(c,"username")||"",v=p.getSafeProp(c,"password")||"";try{l.set("Authorization","Basic "+btoa(h+":"+(v?gl(v):"")))}catch(_){throw E.from(_,E.ERR_BAD_OPTION_VALUE,e)}}if(p.isFormData(n)&&(D.hasStandardBrowserEnv||D.hasStandardBrowserWebWorkerEnv||p.isReactNative(n)?l.setContentType(void 0):p.isFunction(n.getHeaders)&&ml(l,n.getHeaders(),r("formDataHeaderPolicy"))),D.hasStandardBrowserEnv&&(p.isFunction(a)&&(a=a(t)),a===!0||a==null&&nl(t.url))){const v=o&&s&&al.read(s);v&&l.set(o,v)}return t}const yl=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const a=Dn(e);let o=a.data;const s=I.from(a.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=a,u,f,h,v,_;function S(){v&&v(),_&&_(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(a.method.toUpperCase(),a.url,!0),b.timeout=a.timeout;function m(){if(!b)return;const C=I.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),A={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:C,config:e,request:b};Tn(function($){r($),S()},function($){n($),S()},A),b=null}"onloadend"in b?b.onloadend=m:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.startsWith("file:"))||setTimeout(m)},b.onabort=function(){b&&(n(new E("Request aborted",E.ECONNABORTED,e,b)),S(),b=null)},b.onerror=function(N){const A=N&&N.message?N.message:"Network Error",F=new E(A,E.ERR_NETWORK,e,b);F.event=N||null,n(F),S(),b=null},b.ontimeout=function(){let N=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const A=a.transitional||sr;a.timeoutErrorMessage&&(N=a.timeoutErrorMessage),n(new E(N,A.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,e,b)),S(),b=null},o===void 0&&s.setContentType(null),"setRequestHeader"in b&&p.forEach(mn(s),function(N,A){b.setRequestHeader(A,N)}),p.isUndefined(a.withCredentials)||(b.withCredentials=!!a.withCredentials),l&&l!=="json"&&(b.responseType=a.responseType),d&&([h,_]=Lt(d,!0),b.addEventListener("progress",h)),c&&b.upload&&([f,v]=Lt(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",v)),(a.cancelToken||a.signal)&&(u=C=>{b&&(n(!C||C.type?new at(null,e,b):C),b.abort(),S(),b=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const y=el(a.url);if(y&&!D.protocols.includes(y)){n(new E("Unsupported protocol "+y+":",E.ERR_BAD_REQUEST,e)),S();return}b.send(o||null)})},bl=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const a=function(c){if(!n){n=!0,s();const d=c instanceof Error?c:this.reason;r.abort(d instanceof E?d:new at(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,a(new E(`timeout of ${t}ms exceeded`,E.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(!n){if(c.aborted){a.call(c);return}c.addEventListener("abort",a,{once:!0})}});const{signal:l}=r;return l.unsubscribe=()=>p.asap(s),l},vl=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,a;for(;n<r;)a=n+t,yield e.slice(n,a),n=a},wl=async function*(e,t){for await(const r of Cl(e))yield*vl(r,t)},Cl=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Bn=(e,t,r,n)=>{const a=wl(e,t);let o=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await a.next();if(d){l(),c.close();return}let f=u.byteLength;if(r){let h=o+=f;r(h)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),a.return()}},{highWaterMark:2})},In=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Mn=(e,t,r)=>t+2<r&&In(e.charCodeAt(t+1))&&In(e.charCodeAt(t+2)),Un=e=>e<=57?e-48:(e&223)-55,_l=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,Sl=e=>e===9||e===10||e===12||e===13||e===32,El=e=>{const t=Math.floor(e/4),r=e%4;return t*3+(r===2?1:r===3?2:0)},Nl=e=>{const t=e.length;let r=0;return t>0&&e.charCodeAt(t-1)===61&&(r++,t>1&&e.charCodeAt(t-2)===61&&r++),Math.floor((t-r)*3/4)},Ll=e=>{const t=e.length;let r=0,n=0,a=!1;for(let o=0;o<t;o++){let s=e.charCodeAt(o);if(s===37&&Mn(e,o,t)&&(s=Un(e.charCodeAt(o+1))*16+Un(e.charCodeAt(o+2)),o+=2),!Sl(s)){if(s===61){n++;continue}if(!_l(s)||n>0){a=!0;continue}r++}}return a||n>2||n>0&&(r+n)%4!==0||r%4===1?Nl(e):El(r)},Ol=(e,t)=>{if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const r=e.indexOf(",");if(r<0)return 0;const n=e.slice(5,r),a=e.slice(r+1);if(/;base64/i.test(n))return t(a);let s=0;for(let l=0,c=a.length;l<c;l++){const d=a.charCodeAt(l);if(d===37&&Mn(a,l,c))s+=1,l+=2;else if(d<128)s+=1;else if(d<2048)s+=2;else if(d>=55296&&d<=56319&&l+1<c){const u=a.charCodeAt(l+1);u>=56320&&u<=57343?(s+=4,l++):s+=3}else s+=3}return s};function Tl(e){const t=typeof e=="string"?e.indexOf("#"):-1;return Ol(t===-1?e:e.slice(0,t),Ll)}const dr="1.19.0",$n=64*1024,{isFunction:Ot}=p,Al=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),jn=e=>{if(!p.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Vn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Fl=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},xl=e=>{const t=p.global!==void 0&&p.global!==null?p.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=p.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:a,Request:o,Response:s}=e,l=a?Ot(a):typeof fetch=="function",c=Ot(o),d=Ot(s);if(!l)return!1;const u=l&&Ot(r),f=l&&(typeof n=="function"?(m=>y=>m.encode(y))(new n):async m=>new Uint8Array(await new o(m).arrayBuffer())),h=c&&u&&Vn(()=>{let m=!1;const y=new o(D.origin,{body:new r,method:"POST",get duplex(){return m=!0,"half"}}),C=y.headers.has("Content-Type");return y.body!=null&&y.body.cancel(),m&&!C}),v=d&&u&&Vn(()=>p.isReadableStream(new s("").body)),_={stream:v&&(m=>m.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!_[m]&&(_[m]=(y,C)=>{let N=y&&y[m];if(N)return N.call(y);throw new E(`Response type '${m}' is not supported`,E.ERR_NOT_SUPPORT,C)})});const S=async m=>{if(m==null)return 0;if(p.isBlob(m))return m.size;if(p.isSpecCompliantForm(m))return(await new o(D.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 f(m)).byteLength},b=async(m,y)=>{const C=p.toFiniteNumber(m.getContentLength());return C??S(y)};return async m=>{let{url:y,method:C,data:N,signal:A,cancelToken:F,timeout:$,onDownloadProgress:Q,onUploadProgress:Oe,responseType:H,headers:k,withCredentials:j="same-origin",fetchOptions:ie,maxContentLength:Z,maxBodyLength:Ut}=Dn(m);const ut=p.isNumber(Z)&&Z>-1,xr=p.isNumber(Ut)&&Ut>-1,Md=x=>p.hasOwnProp(m,x)?m[x]:void 0;let ao=a||fetch;H=H?(H+"").toLowerCase():"text";let pe=bl([A,F&&F.toAbortSignal()],$),B=null;const Te=pe&&pe.unsubscribe&&(()=>{pe.unsubscribe()});let We,ft=null;const oo=()=>new E("Request body larger than maxBodyLength limit",E.ERR_BAD_REQUEST,m,B);try{let x;const G=Md("auth");if(G){const O=p.getSafeProp(G,"username")||"",W=p.getSafeProp(G,"password")||"";x={username:O,password:W}}if(Fl(y)){const O=new URL(y,D.origin);if(!x&&(O.username||O.password)){const W=jn(O.username),he=jn(O.password);x={username:W,password:he}}(O.username||O.password)&&(O.username="",O.password="",y=O.href)}if(x&&(k.delete("authorization"),k.set("Authorization","Basic "+btoa(Al((x.username||"")+":"+(x.password||""))))),ut&&typeof y=="string"&&y.startsWith("data:")&&Tl(y)>Z)throw new E("maxContentLength size of "+Z+" exceeded",E.ERR_BAD_RESPONSE,m,B);if(xr&&C!=="get"&&C!=="head"){const O=await S(N);if(typeof O=="number"&&isFinite(O)&&(We=O,O>Ut))throw oo()}const $t=xr&&(p.isReadableStream(N)||p.isStream(N)),so=(O,W,he)=>Bn(O,$n,Ae=>{if(xr&&Ae>Ut)throw ft=oo();W&&W(Ae)},he);if(h&&C!=="get"&&C!=="head"&&(Oe||$t)){if(We=We??await b(k,N),We!==0||$t){let O=new o(y,{method:"POST",body:N,duplex:"half"}),W;if(p.isFormData(N)&&(W=O.headers.get("content-type"))&&k.setContentType(W),O.body){const[he,Ae]=Oe&&An(We,Lt(Fn(Oe)))||[];N=so(O.body,he,Ae)}}}else if($t&&!c&&u&&C!=="get"&&C!=="head")N=so(N);else if($t&&c&&!h&&C!=="get"&&C!=="head")throw new E("Stream request bodies are not supported by the current fetch implementation",E.ERR_NOT_SUPPORT,m,B);p.isString(j)||(j=j?"include":"omit");const Ud=c&&"credentials"in o.prototype;if(p.isFormData(N)){const O=k.getContentType();O&&/^multipart\/form-data/i.test(O)&&!/boundary=/i.test(O)&&k.delete("content-type")}k.set("User-Agent","axios/"+dr,!1);const io={...ie,signal:pe,method:C.toUpperCase(),headers:mn(k.normalize()),body:N,duplex:"half",credentials:Ud?j:void 0};B=c&&new o(y,io);let le=await(c?ao(B,ie):ao(y,io));const lo=I.from(le.headers);if(ut){const O=p.toFiniteNumber(lo.getContentLength());if(O!=null&&O>Z)throw new E("maxContentLength size of "+Z+" exceeded",E.ERR_BAD_RESPONSE,m,B)}const Pr=v&&(H==="stream"||H==="response");if(v&&le.body&&(Q||ut||Pr&&Te)){const O={};["status","statusText","headers"].forEach(pt=>{O[pt]=le[pt]});const W=p.toFiniteNumber(lo.getContentLength()),[he,Ae]=Q&&An(W,Lt(Fn(Q),!0))||[];let co=0;const $d=pt=>{if(ut&&(co=pt,co>Z))throw new E("maxContentLength size of "+Z+" exceeded",E.ERR_BAD_RESPONSE,m,B);he&&he(pt)};le=new s(Bn(le.body,$n,$d,()=>{Ae&&Ae(),Te&&Te()}),O)}H=H||"text";let ce=await _[p.findKey(_,H)||"text"](le,m);if(ut&&!v&&!Pr){let O;if(ce!=null&&(typeof ce.byteLength=="number"?O=ce.byteLength:typeof ce.size=="number"?O=ce.size:typeof ce=="string"&&(O=typeof n=="function"?new n().encode(ce).byteLength:ce.length)),typeof O=="number"&&O>Z)throw new E("maxContentLength size of "+Z+" exceeded",E.ERR_BAD_RESPONSE,m,B)}return!Pr&&Te&&Te(),await new Promise((O,W)=>{Tn(O,W,{data:ce,headers:I.from(le.headers),status:le.status,statusText:le.statusText,config:m,request:B})})}catch(x){if(Te&&Te(),pe&&pe.aborted&&pe.reason instanceof E){const G=pe.reason;throw G.config=m,B&&(G.request=B),x!==G&&Object.defineProperty(G,"cause",{__proto__:null,value:x,writable:!0,enumerable:!1,configurable:!0}),G}if(ft)throw B&&!ft.request&&(ft.request=B),ft;if(x instanceof E)throw B&&!x.request&&(x.request=B),x;if(x&&x.name==="TypeError"&&/Load failed|fetch/i.test(x.message)){const G=new E("Network Error",E.ERR_NETWORK,m,B,x&&x.response);throw Object.defineProperty(G,"cause",{__proto__:null,value:x.cause||x,writable:!0,enumerable:!1,configurable:!0}),G}throw E.from(x,x&&x.code,m,B,x&&x.response)}}},Pl=new Map,Hn=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:a}=t,o=[n,a,r];let s=o.length,l=s,c,d,u=Pl;for(;l--;)c=o[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:xl(t)),u=d;return d};Hn();const ur={http:Hi,xhr:yl,fetch:{get:Hn}};p.forEach(ur,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Wn=e=>`- ${e}`,kl=e=>p.isFunction(e)||e===null||e===!1;function Dl(e,t){e=p.isArray(e)?e:[e];const{length:r}=e;let n,a;const o={};for(let s=0;s<r;s++){n=e[s];let l;if(a=n,!kl(n)&&(a=ur[(l=String(n)).toLowerCase()],a===void 0))throw new E(`Unknown adapter '${l}'`);if(a&&(p.isFunction(a)||(a=a.get(t))))break;o[l||"#"+s]=a}if(!a){const s=Object.entries(o).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
|
|
6
|
+
`+s.map(Wn).join(`
|
|
7
|
+
`):" "+Wn(s[0]):"as no adapter specified";throw new E("There is no suitable adapter to dispatch the request "+l,E.ERR_NOT_SUPPORT)}return a}const qn={getAdapter:Dl,adapters:ur};function fr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new at(null,e)}function pr(e){return fr(e),e.headers=I.from(e.headers),e.data=cr.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),qn.getAdapter(e.adapter||nt.adapter,e)(e).then(function(n){fr(e),e.response=n;try{n.data=cr.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=I.from(n.headers),n},function(n){if(!On(n)&&(fr(e),n&&n.response)){e.response=n.response;try{n.response.data=cr.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=I.from(n.response.headers)}return Promise.reject(n)})}const Tt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Tt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const zn={};Tt.transitional=function(t,r,n){function a(o,s){return"[Axios v"+dr+"] Transitional option '"+o+"'"+s+(n?". "+n:"")}return(o,s,l)=>{if(t===!1)throw new E(a(s," has been removed"+(r?" in "+r:"")),E.ERR_DEPRECATED);return r&&!zn[s]&&(zn[s]=!0,console.warn(a(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,s,l):!0}},Tt.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Bl(e,t,r){if(typeof e!="object"||e===null)throw new E("options must be an object",E.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const o=n[a],s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){const l=e[o],c=l===void 0||s(l,o,e);if(c!==!0)throw new E("option "+o+" must be "+c,E.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new E("Unknown option "+o,E.ERR_BAD_OPTION)}}const At={assertOptions:Bl,validators:Tt},M=At.validators;let we=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Sn,response:new Sn}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=(()=>{if(!a.stack)return"";const s=a.stack.indexOf(`
|
|
8
8
|
`);return s===-1?"":a.stack.slice(s+1)})();try{if(!n.stack)n.stack=o;else if(o){const s=o.indexOf(`
|
|
9
|
-
`),
|
|
10
|
-
`,s+1),c=
|
|
11
|
-
`+o)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=be(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:o}=r;n!==void 0&&Lt.assertOptions(n,{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)?r.paramsSerializer={serialize:a}:Lt.assertOptions(a,{encode:U.function,serialize:U.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Lt.assertOptions(r,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=o&&p.merge(o.common,o[r.method]);o&&p.forEach(["delete","get","head","post","put","patch","query","common"],S=>{delete o[S]}),r.headers=I.concat(s,o);const i=[];let c=!0;this.interceptors.request.forEach(function(E){if(typeof E.runWhen=="function"&&E.runWhen(r)===!1)return;c=c&&E.synchronous;const b=r.transitional||sr;b&&b.legacyInterceptorReqResOrdering?i.unshift(E.fulfilled,E.rejected):i.push(E.fulfilled,E.rejected)});const d=[];this.interceptors.response.forEach(function(E){d.push(E.fulfilled,E.rejected)});let u,f=0,h;if(!c){const S=[pr.bind(this),void 0];for(S.unshift(...i),S.push(...d),h=S.length,u=Promise.resolve(r);f<h;)u=u.then(S[f++],S[f++]);return u}h=i.length;let v=r;for(;f<h;){const S=i[f++],E=i[f++];try{v=S?S(v):v}catch(b){if(!E){u=Promise.reject(b);break}try{const m=E.call(this,b);p.isThenable(m)&&(u=Promise.resolve(m).then(()=>pr.call(this,v)))}catch(m){u=Promise.reject(m)}break}}if(!u)try{u=pr.call(this,v)}catch(S){u=Promise.reject(S)}for(f=0,h=d.length;f<h;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=be(this.defaults,t);const r=Pn(t.baseURL,t.url,t.allowAbsoluteUrls,t);return Sn(r,t.params,t.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(t){we.prototype[t]=function(r,n){return this.request(be(n||{},{method:t,url:r,data:n&&p.hasOwnProp(n,"data")?n.data:void 0}))}}),p.forEach(["post","put","patch","query"],function(t){function r(n){return function(o,s,i){return this.request(be(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}we.prototype[t]=r(),t!=="query"&&(we.prototype[t+"Form"]=r(!0))});let Bl=class uo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(a=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](a);n._listeners=null}),this.promise.then=a=>{let o;const s=new Promise(i=>{n.subscribe(i),o=i}).then(a);return s.cancel=function(){n.unsubscribe(o)},s},t(function(o,s,i){n.reason||(n.reason=new rt(o,s,i),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new uo(function(a){t=a}),cancel:t}}};function Il(e){return function(r){return e.apply(null,r)}}function Ul(e){return p.isObject(e)&&e.isAxiosError===!0}const hr={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(hr).forEach(([e,t])=>{hr[t]=e});function qn(e){const t=new we(e),r=nn(we.prototype.request,t);return p.extend(r,we.prototype,t,{allOwnKeys:!0}),p.extend(r,t,null,{allOwnKeys:!0}),r.create=function(a){return qn(be(e,a))},r}const P=qn(tt);P.Axios=we,P.CanceledError=rt,P.CancelToken=Bl,P.isCancel=Tn,P.VERSION=dr,P.toFormData=Nt,P.AxiosError=_,P.Cancel=P.CanceledError,P.all=function(t){return Promise.all(t)},P.spread=Il,P.isAxiosError=Ul,P.mergeConfig=be,P.AxiosHeaders=I,P.formToJSON=e=>On(p.isHTMLForm(e)?new FormData(e):e),P.getAdapter=Wn.getAdapter,P.HttpStatusCode=hr,P.default=P;const{Axios:kd,AxiosError:Dd,CanceledError:Bd,isCancel:Id,CancelToken:Ud,VERSION:Md,all:$d,Cancel:Rd,isAxiosError:jd,spread:Vd,toFormData:Hd,AxiosHeaders:Wd,HttpStatusCode:zd,formToJSON:qd,getAdapter:Kd,mergeConfig:Jd,create:Zd}=P;function Ft(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)n!=="__proto__"&&(e[n]=r[n])}return e}var Ml={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 mr(e,t){function r(a,o,s){if(!(typeof document>"u")){s=Ft({},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 n(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("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(u in s||(s[u]=e.read(d,u)),a===u)break}catch{}}return a?s[a]:s}}return Object.create({set:r,get:n,remove:function(a,o){r(a,"",Ft({},o,{expires:-1}))},withAttributes:function(a){return mr(this.converter,Ft({},this.attributes,a))},withConverter:function(a){return mr(Ft({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var nt=mr(Ml,{path:"/"});const $l={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let Ie="https://api-grievance.airaops.com",Kn=null;try{if(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Rt&&Rt.tagName.toUpperCase()==="SCRIPT"&&Rt.src||new URL("complaint-app.umd.js",document.baseURI).href}<"u"&&$l?.VITE_API_URL)Ie=void 0;else{const e=typeof process<"u"?process:null;e?.env?.VITE_API_URL&&(Ie=e.env.VITE_API_URL)}}catch{}const Jn=e=>{Ie=e||"",M.defaults.baseURL=Ie},gr=e=>{Kn=e||null},Rl=()=>Kn||nt.get("token")||null,M=P.create({baseURL:Ie,headers:{Accept:"application/json","Content-Type":"application/json"}});M.interceptors.request.use(e=>{const t=Rl();return e.headers=e.headers||{},t?e.headers.Authorization=`Bearer ${t}`:delete e.headers.Authorization,e});let yr=!1,br=null;M.interceptors.response.use(e=>e,async e=>{const t=e.config,r=e.response;if(r&&(r.status===401||r.status===402)){const n=nt.get("refreshToken");if(n)try{yr||(yr=!0,br=P.post(`${Ie}/api/v1/auth/refresh`,{},{headers:{Authorization:`Bearer ${n}`}}));const a=await br,{token:o,refreshToken:s}=a.data;return gr(o),s&&nt.set("refreshToken",s),t.headers.Authorization=`Bearer ${o}`,M(t)}catch{nt.remove("token"),nt.remove("refreshToken")}finally{yr=!1,br=null}}return Promise.reject(e)});const jl=O.createContext(null),Zn=({children:e,apiUrl:t,authToken:r})=>(t&&Jn(t),gr(r||null),l.jsx(jl.Provider,{value:{apiUrl:t,authToken:r},children:e})),ae={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)"}},at={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)"}},Gn={light:ae,dark:at};function Ue(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function Me(e,t){if(!Ue(t))return e;const r={...e};return Object.keys(t).forEach(n=>{const a=t[n];Ue(a)&&Ue(e[n])?r[n]=Me(e[n],a):a!==void 0&&(r[n]=a)}),r}function Xn(e){return!e||!Ue(e)?{light:ae,dark:at}:Ue(e.light)||Ue(e.dark)?{light:Me(ae,e.light||{}),dark:Me(at,e.dark||{})}:{light:Me(ae,e),dark:Me(at,e)}}function Yn(e,t=!1){const r=Xn(e);return{...t?r.dark:r.light,mode:t?"dark":"light",__pack:r}}const Vl={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"},Hl={sm:"--ca-radius-sm",md:"--ca-radius-md",lg:"--ca-radius-lg",xl:"--ca-radius-xl",pill:"--ca-radius-pill"},Wl={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"},zl={card:"--ca-shadow-card",settings:"--ca-shadow-settings"};function Qn(e){const t={};return e?.colors&&Object.entries(Vl).forEach(([r,n])=>{e.colors[r]!=null&&(t[n]=e.colors[r])}),e?.radii&&Object.entries(Hl).forEach(([r,n])=>{e.radii[r]!=null&&(t[n]=e.radii[r])}),e?.typography&&Object.entries(Wl).forEach(([r,n])=>{e.typography[r]!=null&&(t[n]=e.typography[r])}),e?.shadow&&Object.entries(zl).forEach(([r,n])=>{e.shadow[r]!=null&&(t[n]=e.shadow[r])}),t["--ca-on-primary"]&&!t["--ca-white"]&&(t["--ca-white"]=t["--ca-on-primary"]),t}const ea=O.createContext({darkMode:!1,theme:null,themeFile:Gn,cssVars:{}});function ta({theme:e,darkMode:t=!1,children:r}){const n=O.useMemo(()=>{const a=Yn(e,!!t),o=Qn(a);return{darkMode:!!t,theme:a,themeFile:a.__pack,cssVars:o,mode:a.mode}},[e,t]);return l.jsx(ea.Provider,{value:n,children:r})}function ra(){return O.useContext(ea)}const Q=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"}),ql=(e,t)=>t.rejectWithValue({status:e?.response?.status??e?.status,message:e?.response?.data?.message??e?.response?.data?.error??e?.message??"Something went wrong"}),oe=(e,t)=>ft.createAsyncThunk(e,async(r,n)=>{try{return(await t(r,n)).data}catch(a){return ql(a,n)}}),ot=(e,t)=>({list:oe(`complaint/${e}/list`,(r,{signal:n})=>M.get(t,{params:r,signal:n})),getById:oe(`complaint/${e}/getById`,(r,{signal:n})=>M.get(`${t}/${r}`,{signal:n})),create:oe(`complaint/${e}/create`,r=>M.post(t,r)),update:oe(`complaint/${e}/update`,({id:r,data:n})=>M.patch(`${t}/${r}`,n)),remove:oe(`complaint/${e}/remove`,r=>M.delete(`${t}/${r}`))}),ve=ot("types",Q.types),Ce=ot("departments",Q.departments),Se=ot("priorities",Q.priorities),Ee=ot("workflows",Q.workflows),_e=ot("statuses",Q.statuses),xt=oe("complaint/departments/getTree",(e,{signal:t})=>M.get(Q.departmentTree,{signal:t})),Pt=oe("complaint/workflows/getSteps",(e,{signal:t})=>M.get(`${Q.workflowSteps}/${e}`,{signal:t})),kt=oe("complaint/workflows/saveSteps",e=>M.post(Q.workflowSteps,e)),na=oe("complaint/workflows/deleteSteps",e=>M.delete(`${Q.workflowSteps}/${e}`)),Kl=ve.list,Jl=ve.getById,Zl=ve.create,Gl=ve.update,Xl=ve.remove,Yl=Ce.list,Ql=Ce.getById,ec=Ce.create,tc=Ce.update,rc=Ce.remove,nc=Se.list,ac=Se.getById,oc=Se.create,sc=Se.update,ic=Se.remove,lc=Ee.list,cc=Ee.getById,dc=Ee.create,uc=Ee.update,fc=Ee.remove,pc=_e.list,hc=_e.getById,mc=_e.create,gc=_e.update,yc=_e.remove,st=()=>({data:[],selected:null,pagination:null,isLoading:!1,isMutating:!1,error:null}),aa={types:st(),departments:st(),priorities:st(),workflows:st(),statuses:st(),departmentTree:[],workflowSteps:{},isLoadingDepartmentTree:!1,isLoadingWorkflowSteps:!1,error:null},bc=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}},it=e=>e?.data??e,Dt=e=>e?.id??e?._id,wc=(e,t)=>{if(!t||typeof t!="object")return e;const r=Dt(t);if(r==null)return e;const n=e.findIndex(o=>Dt(o)===r);if(n<0)return[t,...e];const a=[...e];return a[n]=t,a},Ne=e=>e.payload?.message??e.error?.message??"Something went wrong",lt=(e,t,r)=>{e.addCase(r.list.pending,n=>{n[t].isLoading=!0,n[t].error=null}).addCase(r.list.fulfilled,(n,a)=>{const o=bc(a.payload);n[t].isLoading=!1,n[t].data=o.data,n[t].pagination=o.pagination}).addCase(r.list.rejected,(n,a)=>{n[t].isLoading=!1,n[t].error=Ne(a)}).addCase(r.getById.pending,n=>{n[t].isLoading=!0,n[t].error=null}).addCase(r.getById.fulfilled,(n,a)=>{n[t].isLoading=!1,n[t].selected=it(a.payload)}).addCase(r.getById.rejected,(n,a)=>{n[t].isLoading=!1,n[t].error=Ne(a)}),[r.create,r.update].forEach(n=>{e.addCase(n.pending,a=>{a[t].isMutating=!0,a[t].error=null}).addCase(n.fulfilled,(a,o)=>{const s=it(o.payload);a[t].isMutating=!1,a[t].selected=s,a[t].data=wc(a[t].data,s)}).addCase(n.rejected,(a,o)=>{a[t].isMutating=!1,a[t].error=Ne(o)})}),e.addCase(r.remove.pending,n=>{n[t].isMutating=!0,n[t].error=null}).addCase(r.remove.fulfilled,(n,a)=>{const o=a.meta.arg;n[t].isMutating=!1,n[t].data=n[t].data.filter(s=>Dt(s)!==o),Dt(n[t].selected)===o&&(n[t].selected=null)}).addCase(r.remove.rejected,(n,a)=>{n[t].isMutating=!1,n[t].error=Ne(a)})},oa=ft.createSlice({name:"complaintAppComplaint",initialState:aa,reducers:{clearComplaintError(e,t){const r=t.payload;r&&e[r]?.error!==void 0?e[r].error=null:e.error=null},clearSelectedComplaintResource(e,t){const r=t.payload;r&&e[r]?.selected!==void 0&&(e[r].selected=null)},resetComplaintState(){return aa}},extraReducers:e=>{lt(e,"types",ve),lt(e,"departments",Ce),lt(e,"priorities",Se),lt(e,"workflows",Ee),lt(e,"statuses",_e),e.addCase(xt.pending,t=>{t.isLoadingDepartmentTree=!0,t.error=null}).addCase(xt.fulfilled,(t,r)=>{t.isLoadingDepartmentTree=!1;const n=it(r.payload);t.departmentTree=Array.isArray(n)?n:n?.tree??n?.items??[]}).addCase(xt.rejected,(t,r)=>{t.isLoadingDepartmentTree=!1,t.error=Ne(r)}).addCase(Pt.pending,t=>{t.isLoadingWorkflowSteps=!0,t.error=null}).addCase(Pt.fulfilled,(t,r)=>{t.isLoadingWorkflowSteps=!1,t.workflowSteps[r.meta.arg]=it(r.payload)}).addCase(Pt.rejected,(t,r)=>{t.isLoadingWorkflowSteps=!1,t.error=Ne(r)}).addCase(kt.pending,t=>{t.isLoadingWorkflowSteps=!0,t.error=null}).addCase(kt.fulfilled,(t,r)=>{t.isLoadingWorkflowSteps=!1;const n=it(r.payload),a=r.meta.arg?.workflowId??n?.workflowId??n?.id;a!==void 0&&(t.workflowSteps[a]=n)}).addCase(kt.rejected,(t,r)=>{t.isLoadingWorkflowSteps=!1,t.error=Ne(r)}).addCase(na.fulfilled,(t,r)=>{delete t.workflowSteps[r.meta.arg]})}}),{clearComplaintError:vc,clearSelectedComplaintResource:Cc,resetComplaintState:Sc}=oa.actions,sa=oa.reducer,Ec=ft.combineReducers({complaintAppComplaint:sa}),ia=e=>ft.configureStore({reducer:Ec,preloadedState:e,middleware:t=>t({immutableCheck:!1,serializableCheck:!1})}),la=ia();function ee({children:e,variant:t="primary",size:r="md",startIcon:n,endIcon:a,className:o="",type:s="button",disabled:i=!1,onClick:c,...d}){const u=["ca-btn",`ca-btn--${t}`,r==="sm"?"ca-btn--sm":"",r==="lg"?"ca-btn--lg":"",o].filter(Boolean).join(" ");return l.jsxs("button",{type:s,className:u,disabled:i,onClick:c,...d,children:[n?l.jsx("span",{className:"ca-btn__icon",children:n}):null,e,a?l.jsx("span",{className:"ca-btn__icon",children:a}):null]})}function ca({size:e=16,color:t="currentColor",...r}){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",...r,children:l.jsx("path",{d:"M12 5v14M5 12h14",stroke:t,strokeWidth:"2",strokeLinecap:"round"})})}const da={h1:"ca-h1",h2:"ca-h2",body:"ca-body",label:"ca-label",value:"ca-value",small:"ca-small",link:"ca-link"},_c={h1:"h1",h2:"h2",body:"p",label:"span",value:"span",small:"span",link:"button"};function ue({variant:e="body",as:t,className:r="",children:n,...a}){const o=t||_c[e]||"p",s=da[e]||da.body;return l.jsx(o,{className:`${s} ${r}`.trim(),...a,children:n})}function wr(e){return l.jsx(ue,{variant:"h1",...e})}function Bt(e){return l.jsx(ue,{variant:"h2",...e})}function It(e){return l.jsx(ue,{variant:"body",...e})}function ua(e){return l.jsx(ue,{variant:"label",...e})}function fa(e){return l.jsx(ue,{variant:"value",...e})}function Nc(e){return l.jsx(ue,{variant:"link",type:"button",...e})}function pa({title:e="Complaint Management",description:t,actionLabel:r="Create New Form",onAction:n,className:a=""}){return l.jsxs("header",{className:`ca-page-header ${a}`.trim(),children:[l.jsxs("div",{className:"ca-page-header__text",children:[l.jsx(wr,{children:e}),t?l.jsx(It,{children:t}):null]}),l.jsx("div",{className:"ca-page-header__actions",children:l.jsx(ee,{startIcon:l.jsx(ca,{}),onClick:n,children:r})})]})}function ha({status:e="inactive",label:t,className:r=""}){const a=String(e).toLowerCase()==="active",o=t??(a?"Active":"Inactive");return l.jsx("span",{className:`ca-badge rounded ca-badge--${a?"active":"inactive"} ${r}`.trim(),children:o})}const ma=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();const Oc=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Tc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());const ga=e=>{const t=Tc(e);return t.charAt(0).toUpperCase()+t.slice(1)};var vr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ac=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Lc=O.createContext({}),Fc=()=>O.useContext(Lc),xc=O.forwardRef(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:n,className:a="",children:o,iconNode:s,...i},c)=>{const{size:d=24,strokeWidth:u=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:v=""}=Fc()??{},S=n??f?Number(r??u)*24/Number(t??d):r??u;return O.createElement("svg",{ref:c,...vr,width:t??d??vr.width,height:t??d??vr.height,stroke:e??h,strokeWidth:S,className:ma("lucide",v,a),...!o&&!Ac(i)&&{"aria-hidden":"true"},...i},[...s.map(([E,b])=>O.createElement(E,b)),...Array.isArray(o)?o:[o]])});const $e=(e,t)=>{const r=O.forwardRef(({className:n,...a},o)=>O.createElement(xc,{ref:o,iconNode:t,className:ma(`lucide-${Oc(ga(e))}`,`lucide-${e}`,n),...a}));return r.displayName=ga(e),r};const Pc=$e("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]]);const kc=$e("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);const Dc=$e("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);const Bc=$e("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]);const Ic=$e("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Uc=$e("store",[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]]);function Mc({options:e=[],className:t=""}){const[r,n]=O.useState(!1),a=O.useRef(null);O.useEffect(()=>{const s=i=>{a.current&&!a.current.contains(i.target)&&n(!1)};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[]);const o=s=>{s.onClick?.(),n(!1)};return l.jsxs("div",{ref:a,className:`ca-more-functions ${t}`.trim(),children:[l.jsx("button",{type:"button",className:"ca-more-functions__button",onClick:()=>n(s=>!s),"aria-label":"More options","aria-expanded":r,children:l.jsx(Dc,{size:16})}),r&&e.length>0&&l.jsx("div",{className:"ca-more-functions__menu",children:e.map((s,i)=>l.jsxs("button",{type:"button",className:`ca-more-functions__item ${s.danger?"ca-more-functions__item--danger":""}`,onClick:()=>o(s),children:[s.icon&&l.jsx("span",{className:"ca-more-functions__icon",children:s.icon}),l.jsx("span",{children:s.label})]},s.key||i))})]})}function ya({title:e,status:t,statusLabel:r,titleAsLink:n=!1,onTitleClick:a,menuOptions:o=[],className:s=""}){return l.jsxs("div",{className:`ca-system-card__header ${s}`.trim(),children:[l.jsx("div",{className:"ca-system-card__title-wrap",children:n?l.jsx("button",{type:"button",className:"ca-h2 ca-h2--link",onClick:a,children:e}):l.jsx(Bt,{children:e})}),l.jsxs("div",{className:"ca-system-card__header-actions",children:[l.jsx(ha,{status:t,label:r}),l.jsx(Mc,{options:o})]})]})}function Cr({size:e=16,color:t="currentColor",...r}){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",...r,children:l.jsx("path",{d:"M9 6l6 6-6 6",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ba({updatedOn:e,openLabel:t="Open",configureLabel:r="Configure",onOpen:n,onConfigure:a,className:o=""}){return l.jsxs("div",{className:`ca-system-card__footer ${o}`.trim(),children:[l.jsx(ue,{variant:"small",as:"span",children:e?`Updated on ${e}`:""}),l.jsxs("div",{className:"ca-system-card__footer-actions",children:[l.jsx(ee,{size:"sm",onClick:n,children:t}),l.jsx(ee,{variant:"outline",size:"sm",onClick:a,endIcon:l.jsx(Cr,{size:14,color:"currentColor"}),children:r})]})]})}function wa({label:e,value:t,icon:r,className:n=""}){const a=t==null?"—":typeof t=="number"?String(t).padStart(2,"0"):t;return l.jsxs("div",{className:`ca-data-point ${n}`.trim(),children:[r?l.jsx("span",{className:"ca-data-point__icon","aria-hidden":"true",children:r}):null,l.jsx(fa,{children:a}),l.jsx("span",{className:"ca-data-point__label",children:e})]})}function va({className:e=""}){return l.jsx("div",{className:`ca-divider ${e}`.trim(),role:"separator","aria-orientation":"vertical"})}const $c="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_617_15259)'%3e%3cpath%20d='M9.99992%2011.9997H6.66658M11.9999%209.33301H6.66658M2.66659%2014.6663H13.3333C13.6869%2014.6663%2014.026%2014.5259%2014.2761%2014.2758C14.5261%2014.0258%2014.6666%2013.6866%2014.6666%2013.333V2.66634C14.6666%202.31272%2014.5261%201.97358%2014.2761%201.72353C14.026%201.47348%2013.6869%201.33301%2013.3333%201.33301H5.33325C4.97963%201.33301%204.64049%201.47348%204.39044%201.72353C4.14039%201.97358%203.99992%202.31272%203.99992%202.66634V5.99967M2.66659%2014.6663C3.02021%2014.6663%203.35935%2014.5259%203.60939%2014.2758C3.85944%2014.0258%203.99992%2013.6866%203.99992%2013.333V5.99967M2.66659%2014.6663C2.31296%2014.6663%201.97382%2014.5259%201.72378%2014.2758C1.47373%2014.0258%201.33325%2013.6866%201.33325%2013.333V7.33301C1.33325%206.97939%201.47373%206.64025%201.72378%206.3902C1.97382%206.14015%202.31296%205.99967%202.66659%205.99967H3.99992M7.33325%203.99967H11.3333C11.7014%203.99967%2011.9999%204.29815%2011.9999%204.66634V5.99967C11.9999%206.36786%2011.7014%206.66634%2011.3333%206.66634H7.33325C6.96506%206.66634%206.66658%206.36786%206.66658%205.99967V4.66634C6.66658%204.29815%206.96506%203.99967%207.33325%203.99967Z'%20stroke='%232D64B8'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_617_15259'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Rc="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.44729%202.75711C6.48402%202.37067%206.66351%202.01181%206.95069%201.75063C7.23787%201.48945%207.61211%201.34473%208.00029%201.34473C8.38847%201.34473%208.76271%201.48945%209.04989%201.75063C9.33707%202.01181%209.51656%202.37067%209.55329%202.75711C9.57537%203.00675%209.65727%203.24739%209.79205%203.45867C9.92683%203.66995%2010.1105%203.84565%2010.3276%203.97089C10.5447%204.09614%2010.7887%204.16724%2011.0391%204.17819C11.2895%204.18913%2011.5388%204.1396%2011.766%204.03378C12.1187%203.87363%2012.5184%203.85045%2012.8873%203.96877C13.2562%204.08708%2013.5678%204.33841%2013.7616%204.67385C13.9554%205.00928%2014.0175%205.40482%2013.9357%205.78349C13.854%206.16215%2013.6342%206.49685%2013.3193%206.72244C13.1142%206.86634%2012.9468%207.05751%2012.8312%207.27979C12.7157%207.50207%2012.6553%207.74891%2012.6553%207.99944C12.6553%208.24997%2012.7157%208.49681%2012.8312%208.71909C12.9468%208.94137%2013.1142%209.13254%2013.3193%209.27644C13.6342%209.50203%2013.854%209.83673%2013.9357%2010.2154C14.0175%2010.5941%2013.9554%2010.9896%2013.7616%2011.325C13.5678%2011.6605%2013.2562%2011.9118%2012.8873%2012.0301C12.5184%2012.1484%2012.1187%2012.1253%2011.766%2011.9651C11.5388%2011.8593%2011.2895%2011.8097%2011.0391%2011.8207C10.7887%2011.8316%2010.5447%2011.9027%2010.3276%2012.028C10.1105%2012.1532%209.92683%2012.3289%209.79205%2012.5402C9.65727%2012.7515%209.57537%2012.9921%209.55329%2013.2418C9.51656%2013.6282%209.33707%2013.9871%209.04989%2014.2483C8.76271%2014.5094%208.38847%2014.6542%208.00029%2014.6542C7.61211%2014.6542%207.23787%2014.5094%206.95069%2014.2483C6.66351%2013.9871%206.48402%2013.6282%206.44729%2013.2418C6.42525%2012.992%206.34336%2012.7513%206.20854%2012.54C6.07371%2012.3286%205.88994%2012.1528%205.67278%2012.0276C5.45562%2011.9023%205.21147%2011.8313%204.96101%2011.8204C4.71055%2011.8095%204.46116%2011.8591%204.23396%2011.9651C3.88122%2012.1253%203.48151%2012.1484%203.11263%2012.0301C2.74374%2011.9118%202.43207%2011.6605%202.23828%2011.325C2.04449%2010.9896%201.98244%2010.5941%202.0642%2010.2154C2.14596%209.83673%202.36569%209.50203%202.68063%209.27644C2.88571%209.13254%203.05311%208.94137%203.16868%208.71909C3.28426%208.49681%203.34459%208.24997%203.34459%207.99944C3.34459%207.74891%203.28426%207.50207%203.16868%207.27979C3.05311%207.05751%202.88571%206.86634%202.68063%206.72244C2.36614%206.49674%202.14679%206.16217%202.06523%205.78376C1.98366%205.40535%202.0457%205.01014%202.23928%204.67492C2.43287%204.3397%202.74417%204.08843%203.11269%203.96994C3.4812%203.85144%203.88061%203.8742%204.23329%204.03378C4.46046%204.1396%204.70979%204.18913%204.96016%204.17819C5.21053%204.16724%205.45458%204.09614%205.67165%203.97089C5.88872%203.84565%206.07242%203.66995%206.2072%203.45867C6.34198%203.24739%206.42388%203.00675%206.44596%202.75711M9.99996%207.99978C9.99996%209.10434%209.10453%209.99978%207.99996%209.99978C6.89539%209.99978%205.99996%209.10434%205.99996%207.99978C5.99996%206.89521%206.89539%205.99978%207.99996%205.99978C9.10453%205.99978%209.99996%206.89521%209.99996%207.99978Z'%20stroke='%23745EBF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",jc="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.99992%208H6.66659M9.99992%205.33333H6.66659M12.6666%2011.3333V3.33333C12.6666%202.97971%2012.5261%202.64057%2012.2761%202.39052C12.026%202.14048%2011.6869%202%2011.3333%202H2.66659M2.66659%202C3.02021%202%203.35935%202.14048%203.60939%202.39052C3.85944%202.64057%203.99992%202.97971%203.99992%203.33333V5.33333M2.66659%202C2.31296%202%201.97382%202.14048%201.72378%202.39052C1.47373%202.64057%201.33325%202.97971%201.33325%203.33333V4.66667C1.33325%204.84348%201.40349%205.01305%201.52851%205.13807C1.65354%205.2631%201.82311%205.33333%201.99992%205.33333H3.99992M5.33325%2014H13.3333C13.6869%2014%2014.026%2013.8595%2014.2761%2013.6095C14.5261%2013.3594%2014.6666%2013.0203%2014.6666%2012.6667V12C14.6666%2011.8232%2014.5963%2011.6536%2014.4713%2011.5286C14.3463%2011.4036%2014.1767%2011.3333%2013.9999%2011.3333H7.33325C7.15644%2011.3333%206.98687%2011.4036%206.86185%2011.5286C6.73682%2011.6536%206.66659%2011.8232%206.66659%2012V12.6667C6.66659%2013.0203%206.52611%2013.3594%206.27606%2013.6095C6.02601%2013.8595%205.68687%2014%205.33325%2014ZM5.33325%2014C4.97963%2014%204.64049%2013.8595%204.39044%2013.6095C4.14039%2013.3594%203.99992%2013.0203%203.99992%2012.6667V5.33333'%20stroke='%2300B692'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Vc="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.66675%209.33301H6.66675M2.66675%201.33301H9.33341M3.33341%2011.9997H12.6667C13.0349%2011.9997%2013.3334%2012.2982%2013.3334%2012.6663V13.9997C13.3334%2014.3679%2013.0349%2014.6663%2012.6667%2014.6663H3.33341C2.96522%2014.6663%202.66675%2014.3679%202.66675%2013.9997V12.6663C2.66675%2012.2982%202.96522%2011.9997%203.33341%2011.9997ZM3.33341%203.99967H12.6667C13.0349%203.99967%2013.3334%204.29815%2013.3334%204.66634V5.99967C13.3334%206.36786%2013.0349%206.66634%2012.6667%206.66634H3.33341C2.96522%206.66634%202.66675%206.36786%202.66675%205.99967V4.66634C2.66675%204.29815%202.96522%203.99967%203.33341%203.99967Z'%20stroke='%23FF6F00'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function Ca({id:e,title:t,status:r="inactive",statusLabel:n,description:a,descriptionHref:o,departments:s,workflows:i,fields:c,formsFilled:d,updatedOn:u,titleAsLink:f=!1,onTitleClick:h,onDescriptionClick:v,onConfigure:S,onOpen:E,menuOptions:b=[],className:m=""}){const y=()=>{S?.({id:e,title:t,status:r,departments:s,workflows:i,fields:c,formsFilled:d,updatedOn:u})},C=()=>{if(v){v({id:e,title:t,descriptionHref:o});return}o&&typeof window<"u"&&window.open(o,"_blank","noopener,noreferrer")},N=[{label:"Departments",value:s,icon:l.jsx("img",{src:$c,alt:""})},{label:"Workflows",value:i,icon:l.jsx("img",{src:Rc,alt:""})},{label:"Fields",value:c,icon:l.jsx("img",{src:jc,alt:""})},{label:"Forms Filled",value:d,icon:l.jsx("img",{src:Vc,alt:""})}];return l.jsxs("article",{className:`ca-system-card ${m}`.trim(),children:[l.jsx(ya,{title:t,status:r,statusLabel:n,titleAsLink:f,onTitleClick:()=>h?.({id:e,title:t}),menuOptions:b}),a?l.jsx("p",{className:"ca-system-card__description",onClick:C,children:a}):null,l.jsx("div",{className:"ca-system-card__stats",children:N.map((L,F)=>l.jsxs(O.Fragment,{children:[F>0?l.jsx(va,{}):l.jsx("div",{className:"ca-system-card__stats-spacer"}),l.jsx(wa,{label:L.label,value:L.value,icon:L.icon})]},L.label))}),l.jsx(ba,{updatedOn:u,onOpen:()=>E?.({id:e,title:t}),onConfigure:y})]})}function Sa({systems:e=[],onConfigure:t,onOpen:r,onTitleClick:n,onDescriptionClick:a,emptyMessage:o="No systems found.",className:s=""}){return e.length?l.jsx("div",{className:`ca-system-grid ${s}`.trim(),children:e.map(i=>l.jsx(Ca,{...i,onConfigure:t,onOpen:r,onTitleClick:n,onDescriptionClick:a},i.id??i.title))}):l.jsx("div",{className:`ca-system-grid ${s}`.trim(),children:l.jsx("div",{className:"ca-empty",children:l.jsx(It,{children:o})})})}function te({value:e,onChange:t,placeholder:r,type:n="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:n,className:`ca-input ${a?"ca-input--with-icon":""} ${s}`.trim(),value:e,onChange:t,placeholder:r,...i})]})}function Ea({size:e=18,color:t="currentColor",...r}){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",...r,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 _a({value:e,onChange:t,onSearch:r,placeholder:n="Search",className:a=""}){const o=s=>{s.key==="Enter"&&r&&r(e)};return l.jsx("div",{className:`ca-search ${a}`.trim(),children:l.jsx(te,{value:e,onChange:t,onKeyDown:o,placeholder:n,icon:l.jsx(Ea,{}),"aria-label":n})})}function Na({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 Oa=[{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:!1},{id:"cms",title:"CX- Pulse-360 ",status:"active",description:"Description of the template",departments:5,workflows:8,fields:42,formsFilled:189,updatedOn:"08 Mar 2024"},{id:"fms",title:"ENE - TRACKER",status:"inactive",description:"Description of the template",departments:2,workflows:4,fields:28,formsFilled:56,updatedOn:"01 Feb 2024"},{id:"rms",title:"RTV - Return to Vendor ",status:"active",description:"Description of the template",departments:4,workflows:10,fields:61,formsFilled:312,updatedOn:"20 Mar 2024"}],Ta="Create, manage and track complaint forms, workflows and responses across departments.";function Aa(e=[]){return e.map((t,r)=>({id:t.id??t._id??`system-${r}`,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 La({title:e="Complaint Management",description:t=Ta,systems:r,systemsEndpoint:n,useDemoData:a=!0,createLabel:o="Create New Form",onCreateForm:s,onConfigure:i,onOpen:c,onTitleClick:d,onDescriptionClick:u,onSearch:f}){const h=pt(),[v,S]=O.useState(""),[E,b]=O.useState(null),[m,y]=O.useState(null),[C,N]=O.useState(n&&!r?"loading":"idle");O.useEffect(()=>{if(!n||r)return;const k=new AbortController;return M.get(n,{signal:k.signal}).then(R=>{const se=R?.data,J=Array.isArray(se)?se:se?.data??se?.systems??se?.results??[];b(Aa(J)),y(null),N("success")}).catch(R=>{k.signal.aborted||(y(R?.message||"Failed to load systems"),b([]),N("error"))}),()=>k.abort()},[n,r]);const L=O.useMemo(()=>r?Aa(r):E||(a?Oa:[]),[r,E,a]),F=O.useMemo(()=>{const k=v.trim().toLowerCase();return k?L.filter(R=>`${R.title} ${R.description??""} ${R.status??""}`.toLowerCase().includes(k)):L},[L,v]),$=k=>{const R=k.target.value;S(R),f?.(R)},X=k=>{i?.(k),h(`/settings/${k.id??"new"}?step=1`)},Oe=()=>{s?.(),h("/settings/new?step=1")},V=C==="loading";return l.jsxs("div",{className:"ca-complaint-management-page","data-testid":"complaint-management-page",children:[l.jsx(pa,{title:e,description:t,actionLabel:o,onAction:Oe}),l.jsx(_a,{value:v,onChange:$,placeholder:"Search"}),V?l.jsx(Na,{text:"Loading systems"}):m?l.jsx("div",{className:"ca-empty",children:l.jsx("p",{className:"ca-body",children:m})}):l.jsx(Sa,{systems:F,onConfigure:X,onOpen:c,onTitleClick:d,onDescriptionClick:u,emptyMessage:v?"No systems match your search.":"No systems found."})]})}const Fa=O.createContext(null),xa=()=>({categoryName:"",categoryType:"",tatMinutes:"",template:"",visibilityType:"",urlLink:"",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 Pa({children:e,initialValues:t}){const[r,n]=O.useState(()=>({...xa(),...t,workflow:{...xa().workflow,...t?.workflow}})),a=O.useCallback(i=>{n(c=>({...c,...i}))},[]),o=O.useCallback(i=>{n(c=>({...c,workflow:{...c.workflow,...i}}))},[]),s=O.useMemo(()=>({state:r,setState:n,update:a,updateWorkflow:o}),[r,a,o]);return l.jsx(Fa.Provider,{value:s,children:e})}function Re(){const e=O.useContext(Fa);if(!e)throw new Error("useSettingsWizard must be used within SettingsWizardProvider");return e}const q=[{id:1,key:"category",label:"Category Type",title:"Category Type",description:"Define the type and basic details for this category type."},{id:2,key:"workflow",label:"Workflow",title:"Workflow",description:"L1 > L2 > L3"},{id:3,key:"formFields",label:"Form Fields",title:"Form Fields",description:"----"},{id:4,key:"review",label:"Review & Publish",title:"Review & Publish",description:"Review your configuration and publish."}],Hc=[{id:1,label:"Create Workflow"},{id:2,label:"Statuses"},{id:3,label:"Workflow Steps"}],Wc=["Urgent","High","Medium","Low"],zc=["Store Staff","HR Executive","HR Manager","Store Manager","Admin"],ka=[{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"}],qc=[{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 Da({size:e=28,color:t="currentColor",...r}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{color:"var(--ca-primary)"},...r,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 Ba({title:e,description:t,nextLabel:r="Next",onNext:n,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(Da,{}),l.jsxs("div",{children:[l.jsx(Bt,{children:e}),t?l.jsx(It,{className:"ca-settings-card__desc",children:t}):null]})]}),a?l.jsx(ee,{variant:s,disabled:o,onClick:n,endIcon:l.jsx(Cr,{size:14,color:"currentColor"}),children:r}):null]})}function je({title:e,description:t,onNext:r,nextLabel:n,showNext:a=!0,nextDisabled:o,nextVariant:s,children:i,footer:c,className:d=""}){return l.jsxs("section",{className:`ca-settings-card ${d}`.trim(),children:[l.jsx(Ba,{title:e,description:t,onNext:r,nextLabel:n,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 Ut({children:e,hint:t,htmlFor:r,className:n=""}){return l.jsxs("div",{className:`ca-field-label ${n}`.trim(),children:[l.jsx("label",{className:"ca-label",htmlFor:r,children:e}),t!=null?l.jsx("span",{className:"ca-field-label__hint",children:t}):null]})}function Ia({size:e=16,color:t="currentColor",...r}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...r,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function K({value:e,onChange:t,options:r=[],placeholder:n="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:n}),r.map(i=>{const c=typeof i=="string"?i:i.value,d=typeof i=="string"?i:i.label;return l.jsx("option",{value:c,children:d},c)})]}),l.jsx("span",{className:"ca-select__chevron",children:l.jsx(Ia,{size:16})})]})}function Ua({value:e,onChange:t,placeholder:r,maxLength:n,rows:a=4,className:o="",...s}){return l.jsx("textarea",{className:`ca-textarea ${o}`.trim(),value:e,onChange:t,placeholder:r,maxLength:n,rows:a,...s})}function re({label:e,hint:t,children:r,className:n="",htmlFor:a}){return l.jsxs("div",{className:`ca-form-field ${n}`.trim(),children:[e!=null?l.jsx(Ut,{htmlFor:a,hint:t,children:e}):null,r]})}function Sr({label:e,hint:t,...r}){return l.jsx(re,{label:e,hint:t,htmlFor:r.id,children:l.jsx(te,{...r})})}function Kc({label:e,hint:t,suffix:r,...n}){return l.jsx(re,{label:e,hint:t,htmlFor:n.id,children:l.jsxs("div",{className:"input-with-suffix",children:[l.jsx(te,{...n}),r&&l.jsx("div",{className:"input-suffix",children:r})]})})}function Er({label:e,hint:t,...r}){return l.jsx(re,{label:e,hint:t,htmlFor:r.id,children:l.jsx(K,{...r})})}function Ma({label:e,hint:t,maxLength:r,value:n="",...a}){const o=t??(r!=null?`${String(n).length}/${r}`:void 0);return l.jsx(re,{label:e,hint:o,htmlFor:a.id,children:l.jsx(Ua,{value:n,maxLength:r,...a})})}function _r({checked:e=!1,onChange:t,disabled:r=!1,"aria-label":n="Toggle",className:a=""}){return l.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":n,disabled:r,className:`ca-toggle ${e?"ca-toggle--on":""} ${a}`.trim(),onClick:()=>t?.(!e),children:l.jsx("span",{className:"ca-toggle__thumb"})})}function $a({label:e="Active",checked:t,onChange:r,className:n=""}){return l.jsxs("div",{className:`ca-toggle-field ${n}`.trim(),children:[l.jsx(ua,{children:e}),l.jsx(_r,{checked:t,onChange:r,"aria-label":e})]})}function Ra({size:e=12,color:t="currentColor",...r}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...r,children:l.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:t,strokeWidth:"2",strokeLinecap:"round"})})}function ja({label:e,onRemove:t,className:r=""}){return l.jsxs("span",{className:`ca-tag ${r}`.trim(),children:[e,t?l.jsx("button",{type:"button",className:"ca-tag__remove",onClick:t,"aria-label":`Remove ${e}`,children:l.jsx(Ra,{size:10})}):null]})}function Va({label:e="Select Roles",options:t=[],value:r=[],onChange:n,placeholder:a="Select roles",className:o=""}){const[s,i]=O.useState(""),c=t.filter(f=>{const h=typeof f=="string"?f:f.value;return!r.includes(h)}),d=f=>{const h=f.target.value;h&&(n?.([...r,h]),i(""))},u=f=>{n?.(r.filter(h=>h!==f))};return l.jsxs("div",{className:`ca-role-select ${o}`.trim(),children:[l.jsx(Ut,{children:e}),l.jsx(K,{value:s,onChange:d,options:c,placeholder:a}),r.length>0?l.jsx("div",{className:"ca-tag-list",children:r.map(f=>l.jsx(ja,{label:f,onRemove:()=>u(f)},f))}):null]})}function Ve({steps:e=[],currentStep:t=1,onStepClick:r,className:n="",size:a="md",showSaveButton:o=!1,showNextButton:s=!1,onSaveDraft:i,onNext:c,saveLabel:d="Save Draft",nextLabel:u="Next >"}){return l.jsxs("div",{className:`ca-stepper-wrap ca-stepper-wrap--${a} ${n}`.trim(),children:[l.jsx("nav",{className:`ca-stepper ca-stepper--${a}`,"aria-label":"Progress",children:e.map((f,h)=>{const v=f.id??h+1,S=v===t,E=v<t,b=!!r&&(E||S);return l.jsxs(O.Fragment,{children:[h>0?l.jsx("div",{className:"ca-stepper__line"}):null,l.jsxs("button",{type:"button",className:["ca-stepper__item",S?"ca-stepper__item--active":"",E?"ca-stepper__item--done":""].filter(Boolean).join(" "),onClick:()=>b&&r?.(v),disabled:!b,"aria-current":S?"step":void 0,children:[l.jsxs("span",{className:"ca-stepper__circle",children:[v,"."]}),l.jsx("span",{className:"ca-stepper__label",children:f.label})]})]},v)})}),o||s?l.jsxs("div",{className:"ca-stepper__actions",children:[o?l.jsx(ee,{variant:"outline",onClick:i,children:d}):null,s?l.jsx(ee,{onClick:c,children:u}):null]}):null]})}function Jc({stepMeta:e,stepperProps:t}){const{state:r,update:n}=Re();return l.jsxs(l.Fragment,{children:[l.jsx(Ve,{...t,steps:q}),l.jsxs(je,{title:e.title,description:e.description,showNext:!1,children:[l.jsx("div",{className:"ca-category-type__status",children:l.jsx($a,{checked:r.active,onChange:a=>n({active:a})})}),l.jsxs("div",{className:"ca-step-section",children:[l.jsxs("div",{className:"ca-step-row ca-step-row--category-fields",children:[l.jsx(Sr,{label:"Category Name",className:"ca-step-row__grow",value:r.categoryName,onChange:a=>n({categoryName:a.target.value}),placeholder:"Enter category name"}),l.jsx(Kc,{label:"TAT Minutes",suffix:"minutes",type:"number",min:"0",value:r.tatMinutes,onChange:a=>n({tatMinutes:a.target.value}),placeholder:"Enter here"})]}),l.jsx("div",{className:"ca-step-row",children:l.jsx(Er,{label:"Select Template",className:"ca-step-row__grow",value:r.template||r.categoryType,onChange:a=>n({template:a.target.value,categoryType:a.target.value}),options:ka,placeholder:"Select template"})}),l.jsx("div",{className:"ca-step-section",children:l.jsx(Ma,{label:"Description",placeholder:"Enter description",maxLength:500,value:r.description,onChange:a=>n({description:a.target.value}),rows:5})}),l.jsxs("div",{className:"ca-step-row",children:[l.jsx(Er,{label:"Select Visibility Type",className:"ca-step-row__grow",value:r.visibilityType,onChange:a=>n({visibilityType:a.target.value}),options:[{value:"public",label:"Public"},{value:"private",label:"Private"},{value:"restricted",label:"Restricted"}],placeholder:"Select visibility type"}),l.jsx(Sr,{label:null,className:"ca-step-row__grow ca-category-type__url-link",value:r.urlLink,onChange:a=>n({urlLink:a.target.value}),placeholder:"urllink"})]})]}),l.jsx("div",{className:"ca-step-section ca-step-section--last",children:l.jsx(Va,{label:"Select Roles for Complaint Filling",options:zc,value:r.roles,onChange:a=>n({roles:a})})})]})]})}function Ha({children:e,onClick:t,className:r="",active:n=!1}){return l.jsx("button",{type:"button",className:`ca-chip ${n?"ca-chip--active":""} ${r}`.trim(),onClick:t,children:e})}function Wa({checked:e=!1,onChange:t,name:r,value:n,"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:r,value:n,checked:e,onChange:t,"aria-label":a}),l.jsx("span",{className:"ca-radio__mark"})]})}function Nr({size:e=16,color:t="#9CA3AF",...r}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...r,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 za(e){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,name:e,color:""}}function Zc({stepMeta:e,stepperProps:t}){const{state:r,update:n}=Re(),{priorityDraft:a,priorities:o,defaultPriorityId:s}=r,i=u=>{const f=(u??a).trim();if(!f)return;if(o.some(v=>v.name.toLowerCase()===f.toLowerCase())){n({priorityDraft:""});return}const h=[...o,za(f)];n({priorities:h,priorityDraft:"",defaultPriorityId:s??h[0].id})},c=(u,f)=>{n({priorities:o.map(h=>h.id===u?{...h,...f}:h)})},d=qc.map(u=>({value:u.value,label:u.label}));return l.jsxs(l.Fragment,{children:[l.jsx(Ve,{...t,steps:q}),l.jsxs(je,{title:e.title,description:e.description,showNext:!1,children:[l.jsxs("div",{className:"ca-priority-add",children:[l.jsx(Ut,{children:"Priorities"}),l.jsxs("div",{className:"ca-priority-add__row",children:[l.jsx(te,{value:a,onChange:u=>n({priorityDraft:u.target.value}),placeholder:"Add priority",onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),i())}}),l.jsx(ee,{variant:"outline",onClick:()=>i(),children:"+ Add"})]}),l.jsx("div",{className:"ca-chip-row",children:Wc.map(u=>l.jsxs(Ha,{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:[za("")]).map((u,f)=>{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(Nr,{}),l.jsx(te,{value:h?a:u.name,onChange:v=>{h?n({priorityDraft:v.target.value}):c(u.id,{name:v.target.value})},placeholder:"Add priority"})]}),l.jsx(K,{value:u.color,onChange:v=>{h||c(u.id,{color:v.target.value})},options:d,placeholder:"Select color"}),l.jsx(Wa,{name:"default-priority",value:u.id,checked:!h&&s===u.id,onChange:()=>!h&&n({defaultPriorityId:u.id}),"aria-label":"Default priority"})]},u.id||f)})]})]})]})}function qa({level:e,onAdd:t}){const[r,n]=O.useState(""),a=o=>{o.preventDefault();const s=r.trim();s&&(t?.(s),n(""))};return l.jsxs("form",{className:"ca-add-table-card",onSubmit:a,children:[l.jsxs("span",{className:"ca-add-table-card__level",children:["L",e]}),l.jsxs("label",{className:"ca-add-table-card__label",htmlFor:`add-workflow-level-${e}`,children:["Name Level ",e]}),l.jsx(te,{id:`add-workflow-level-${e}`,value:r,placeholder:`Enter name for L${e}`,onChange:o=>n(o.target.value)}),l.jsxs(ee,{type:"submit",className:"ca-add-table-card__button",disabled:!r.trim(),children:["+ Add L",e]})]})}const Gc=["Store Staff","Manager","Supervisor","Admin"],Or=["Yes","No"];function Ka({name:e,level:t,value:r,onChange:n}){const a=r??{},o=(c,d)=>n?.({...a,[c]:d}),s=t===1?"green":t===2?"orange":"blue",i=c=>`workflow-level-${t}-${c}`;return l.jsxs("article",{className:`ca-table-card ca-table-card--${s}`,children:[l.jsxs("header",{className:"ca-table-card__header",children:[l.jsxs("span",{className:"ca-table-card__level",children:["L",t]}),l.jsxs("div",{children:[l.jsx("h3",{className:"ca-table-card__title",children:e}),l.jsx("p",{className:"ca-table-card__subtitle",children:"Initial Handler"})]})]}),l.jsx("div",{className:"ca-table-card__divider"}),l.jsxs("div",{className:"ca-table-card__fields",children:[l.jsx(re,{label:"Select Role",htmlFor:i("role"),children:l.jsx(K,{id:i("role"),value:a.role,options:Gc,placeholder:"Select role",onChange:c=>o("role",c.target.value)})}),l.jsx(re,{label:"Can Resolve",htmlFor:i("canResolve"),children:l.jsx(K,{id:i("canResolve"),value:a.canResolve,options:Or,onChange:c=>o("canResolve",c.target.value)})}),l.jsx(re,{label:"Can Reassign",htmlFor:i("canReassign"),children:l.jsx(K,{id:i("canReassign"),value:a.canReassign,options:Or,onChange:c=>o("canReassign",c.target.value)})}),l.jsx(re,{label:"Final Level",htmlFor:i("finalLevel"),children:l.jsx(K,{id:i("finalLevel"),value:a.finalLevel,options:Or,onChange:c=>o("finalLevel",c.target.value)})}),l.jsx(re,{label:"Escalation time",htmlFor:i("escalationTime"),children:l.jsxs("div",{className:"ca-table-card__time-input",children:[l.jsx(te,{id:i("escalationTime"),type:"number",min:"0",value:a.escalationTime??"",placeholder:"--",onChange:c=>o("escalationTime",c.target.value)}),l.jsx("span",{children:"minutes"})]})})]})]})}const Xc="data:image/svg+xml,%3csvg%20width='31'%20height='57'%20viewBox='0%200%2031%2057'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.50001%200.000227733C0.223869%200.000226605%209.85899e-06%200.224084%208.79418e-06%200.500226C7.72665e-06%200.776369%200.223865%201.00023%200.500009%201.00023L0.50001%200.500227L0.50001%200.000227733ZM15%200.500275L15%201.00028L15%200.500275ZM27%2012.5003L27.5%2012.5003L27%2012.5003ZM26.6464%2056.8527C26.8417%2057.048%2027.1582%2057.048%2027.3535%2056.8527L30.5355%2053.6707C30.7307%2053.4755%2030.7307%2053.1589%2030.5355%2052.9636C30.3402%2052.7683%2030.0236%2052.7683%2029.8284%2052.9636L26.9999%2055.792L24.1715%2052.9636C23.9763%2052.7683%2023.6597%2052.7683%2023.4644%2052.9636C23.2692%2053.1589%2023.2692%2053.4754%2023.4644%2053.6707L26.6464%2056.8527ZM0.50001%200.500227L0.500009%201.00023L15%201.00028L15%200.500275L15%200.000275583L0.50001%200.000227733L0.50001%200.500227ZM27%2012.5003L26.5%2012.5003L26.4999%2056.4991L26.9999%2056.4991L27.4999%2056.4991L27.5%2012.5003L27%2012.5003ZM15%200.500275L15%201.00028C21.3513%201.0003%2026.5%206.14903%2026.5%2012.5003L27%2012.5003L27.5%2012.5003C27.5%205.59674%2021.9036%200.000298399%2015%200.000275583L15%200.500275Z'%20fill='%2300BF87'/%3e%3c/svg%3e",Yc="data:image/svg+xml,%3csvg%20width='28'%20height='61'%20viewBox='0%200%2028%2061'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M27.0053%2057.2042C27.2006%2057.009%2027.2006%2056.6924%2027.0053%2056.4971L23.8233%2053.3152C23.6281%2053.1199%2023.3115%2053.1199%2023.1162%2053.3152C22.921%2053.5104%2022.921%2053.827%2023.1162%2054.0223L25.9447%2056.8507L23.1163%2059.6791C22.921%2059.8744%2022.921%2060.191%2023.1163%2060.3862C23.3115%2060.5815%2023.6281%2060.5815%2023.8234%2060.3862L27.0053%2057.2042ZM12.5001%2056.8508L12.5001%2057.3508V57.3508L12.5001%2056.8508ZM0.500014%2044.8508L1.33317e-05%2044.8508V44.8508L0.500014%2044.8508ZM26.6518%2056.8507L26.6518%2056.3507L12.5001%2056.3508L12.5001%2056.8508L12.5001%2057.3508L26.6518%2057.3507L26.6518%2056.8507ZM0.500014%2044.8508L1.00001%2044.8508L1.00001%20-0.000388027L0.50001%20-0.000388722L9.54624e-06%20-0.000389416L1.33317e-05%2044.8508L0.500014%2044.8508ZM12.5001%2056.8508L12.5001%2056.3508C6.14877%2056.3508%201.00001%2051.2021%201.00001%2044.8508L0.500014%2044.8508L1.33317e-05%2044.8508C1.43871e-05%2051.7544%205.59649%2057.3508%2012.5001%2057.3508L12.5001%2056.8508Z'%20fill='%23FF9E32'/%3e%3c/svg%3e",Tr=(e,t)=>({id:e,name:t,role:"",canResolve:"",canReassign:"",finalLevel:"",escalationTime:""});function Qc({accent:e}){return l.jsxs("div",{className:`ca-escalation-connector ca-escalation-connector--${e}`,"aria-hidden":"true",children:[l.jsx("img",{src:Xc,alt:"",className:"ca-escalation-connector__arrow ca-escalation-connector__arrow--first"}),l.jsx("span",{children:"Escalates to"}),l.jsx("img",{src:Yc,alt:"",className:"ca-escalation-connector__arrow ca-escalation-connector__arrow--second"})]})}function Ja({initialTables:e,onChange:t}){const[r,n]=O.useState(()=>e?.length?e:[Tr(1,"Level 1 - First Response"),Tr(2,"Level 2 - Secondary")]),a=i=>{n(i),t?.(i)},o=(i,c)=>a(r.map(d=>d.id===i?{...d,...c}:d)),s=i=>{const c=r.reduce((d,u)=>Math.max(d,Number(u.id)||0),0)+1;a([...r,Tr(c,i)])};return l.jsx("div",{className:"ca-table-card-grid","aria-label":"Escalation levels",children:l.jsxs("div",{className:"ca-table-card-grid__track",children:[r.map((i,c)=>l.jsxs(O.Fragment,{children:[l.jsx(Ka,{name:i.name,level:c+1,value:i,onChange:d=>o(i.id,d)}),c<r.length?l.jsx(Qc,{accent:c===0?"green":c===1?"orange":"purple"}):null]},i.id)),l.jsx(qa,{level:r.length+1,onAdd:s})]})})}function Za({onNext:e,stepMeta:t,stepperProps:r}){const{state:n,update:a,updateWorkflow:o}=Re(),{selectedDeptNode:s,workflow:i}=n;return l.jsxs(l.Fragment,{children:[l.jsx(Ve,{...r,steps:q}),l.jsx(je,{title:t.title,description:t.description,showNext:!1,children:l.jsx("div",{className:"ca-workflow__main",children:l.jsx(Ja,{initialTables:i.steps,onChange:c=>o({steps:c})})})})]})}function Ga({onAdd:e}){return l.jsx("button",{type:"button",className:"ca-add-form-button",onClick:e,children:"+ Add Form Fields"})}function Xa({size:e=16,color:t="#9CA3AF",...r}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...r,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 ed=["Custom","Text","Number","Date","Dropdown","Checkbox","Radio"],Ar=["All","Admin","Manager","Staff"],td=["Level 1","Level 2","Level 3"];function Ya({field:e,fieldOptions:t=[],onChange:r,onDelete:n}){const[a,o]=O.useState(""),s=d=>r?.({...e,...d}),i=()=>{const d=a.trim();!d||e.options?.includes(d)||(s({options:[...e.options||[],d]}),o(""))},c=d=>s({options:e.options.filter(u=>u!==d)});return l.jsxs("article",{className:"ca-form-card",children:[l.jsxs("div",{className:"ca-form-card__row ca-form-card__row--order",children:[l.jsx(Nr,{size:15,color:"#111827"}),l.jsx("button",{type:"button",className:"ca-icon-btn ca-form-card__delete","aria-label":"Delete form field",onClick:()=>n?.(e.id),children:l.jsx(Xa,{size:15})})]}),l.jsx("div",{className:"ca-form-card__row",children:l.jsx(te,{value:e.fieldLabel,placeholder:"Enter field label",onChange:d=>s({fieldLabel:d.target.value})})}),l.jsx("div",{className:"ca-form-card__row",children:l.jsx(K,{value:e.fieldType,options:ed,placeholder:"Select type",onChange:d=>s({fieldType:d.target.value})})}),l.jsx("div",{className:"ca-form-card__row ca-form-card__row--toggle",children:l.jsx(_r,{checked:!!e.required,onChange:d=>s({required:d}),"aria-label":"Required"})}),l.jsx("div",{className:"ca-form-card__row",children:l.jsx(K,{value:e.fieldAccess,options:e.fieldAccess&&!Ar.includes(e.fieldAccess)?[e.fieldAccess,...Ar]:Ar,placeholder:"Select access",onChange:d=>s({fieldAccess:d.target.value})})}),l.jsxs("div",{className:"ca-form-card__row",children:[l.jsx(K,{value:"",options:td.filter(d=>!e.hideFor?.includes(d)),placeholder:"Select level",onChange:d=>s({hideFor:[...e.hideFor||[],d.target.value]})}),e.hideFor?.length?l.jsx("div",{className:"ca-form-card__chips",children:e.hideFor.map(d=>l.jsxs("span",{className:"ca-form-card__chip",children:[d,l.jsx("button",{type:"button","aria-label":`Remove ${d}`,onClick:()=>s({hideFor:e.hideFor.filter(u=>u!==d)}),children:"×"})]},d))}):null]}),l.jsx("div",{className:"ca-form-card__row",children:l.jsx(K,{value:e.dependsOn,options:t,placeholder:"Select field label",onChange:d=>s({dependsOn:d.target.value})})}),l.jsxs("div",{className:"ca-form-card__row ca-form-card__row--options",children:[l.jsxs("div",{className:"ca-form-card__option-entry",children:[l.jsx(te,{value:a,placeholder:"Enter option",onChange:d=>o(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),i())}}),l.jsx("button",{type:"button",className:"ca-form-card__add-option","aria-label":"Add option",onClick:i,children:"+"})]}),l.jsx("div",{className:"ca-form-card__chips",children:(e.options||[]).map(d=>l.jsxs("span",{className:"ca-form-card__chip",children:[d,l.jsx("button",{type:"button","aria-label":`Remove ${d}`,onClick:()=>c(d),children:"×"})]},d))})]})]})}const rd=["Order","Field Label","Field Type","Required","Field Access","Hide for","DependsOn","Options"],nd=[{id:1,order:1,fieldLabel:"Department - Finance",fieldType:"Custom",required:!1,fieldAccess:"",hideFor:["Level 1","Level 2"],dependsOn:"",options:["Low","High"]},{id:2,order:2,fieldLabel:"Sub-department",fieldType:"Custom",required:!1,fieldAccess:"",hideFor:[],dependsOn:"Department - Finance",options:["Payroll","Recruitment"]}];function Lr(e,t){return{id:e.id??`${Date.now()}-${t}`,order:t+1,fieldLabel:e.fieldLabel??e.name??"",fieldType:e.fieldType??e.typeLabel??"Custom",required:!!e.required,fieldAccess:e.fieldAccess??"",hideFor:e.hideFor??[],dependsOn:e.dependsOn??"",options:e.options??[]}}function Qa({initialFields:e,onChange:t,fieldToAdd:r}){const[n,a]=O.useState(()=>(e?.length?e:nd).map(Lr)),o=u=>{a(u),t?.(u)};O.useEffect(()=>{r&&a(u=>{const f=[...u,Lr({...r,id:`${r.id}-${Date.now()}`},u.length)];return t?.(f),f})},[r,t]);const s=u=>o(n.map(f=>f.id===u.id?u:f)),i=u=>o(n.filter(f=>f.id!==u).map((f,h)=>({...f,order:h+1}))),c=()=>o([...n,Lr({id:`${Date.now()}-${n.length}`,fieldLabel:"",fieldType:"Custom",options:[]},n.length)]),d=n.map(u=>u.fieldLabel).filter(Boolean);return l.jsxs("div",{className:"ca-form-card-grid",children:[l.jsx("div",{className:"ca-form-card-grid__labels",children:rd.map(u=>l.jsx("div",{className:"ca-form-card-grid__label",children:u},u))}),l.jsxs("div",{className:"ca-form-card-grid__cards",children:[n.map(u=>l.jsx(Ya,{field:u,fieldOptions:d.filter(f=>f!==u.fieldLabel),onChange:s,onDelete:i},u.id)),l.jsx(Ga,{onAdd:c})]})]})}const ad=[{id:"department",label:"Department",fieldLabel:"Department - Finance",fieldType:"Custom",required:!1,fieldAccess:"Select access",hideFor:[],dependsOn:"",options:["Payroll","Recruitment","Hardware"]},{id:"priorities",label:"Priorities",fieldLabel:"Priorities",fieldType:"Custom",required:!1,fieldAccess:"Select access",hideFor:[],dependsOn:"",options:["Low","Medium","High"]},{id:"statuses",label:"Statuses",fieldLabel:"Statuses",fieldType:"Custom",required:!1,fieldAccess:"Select access",hideFor:[],dependsOn:"",options:["Open","In Progress","Closed"]},{id:"storeId",label:"Store ID",fieldLabel:"Store ID",fieldType:"Custom",required:!1,fieldAccess:"Select access",hideFor:[],dependsOn:"",options:["Store 101","Store 102","Store 103"]}],od={department:Pc,priorities:Bc,statuses:kc,storeId:Uc};function sd({onAddField:e}){return l.jsxs("aside",{className:"custom-field-table","aria-labelledby":"custom-field-table-title",children:[l.jsx("h2",{id:"custom-field-table-title",className:"custom-field-table__title",children:"Custom Fields"}),l.jsx("p",{className:"custom-field-table__description",children:"Use these fields to show options from database table."}),l.jsx("div",{className:"custom-field-table__list",children:ad.map(t=>{const r=od[t.id];return l.jsxs("div",{className:"custom-field-table__row",children:[l.jsx(r,{className:"custom-field-table__field-icon",size:14,strokeWidth:1.5,"aria-hidden":"true"}),l.jsx("span",{className:"custom-field-table__label",children:t.label}),l.jsx("button",{className:"custom-field-table__add",type:"button","aria-label":`Add ${t.label}`,title:`Add ${t.label}`,onClick:()=>e?.(t),children:l.jsx(Ic,{size:14,strokeWidth:2,"aria-hidden":"true"})})]},t.id)})})]})}function id({stepMeta:e,stepperProps:t}){const{state:r,update:n}=Re(),{formFields:a}=r,[o,s]=O.useState(null),i=O.useCallback(c=>n({formFields:c}),[n]);return l.jsxs(l.Fragment,{children:[l.jsx(Ve,{...t,steps:q}),l.jsx(je,{title:e.title,description:e.description,showNext:!1,children:l.jsxs("div",{className:"ca-form-fields",children:[l.jsx(sd,{onAddField:c=>s({...c})}),l.jsx(Qa,{initialFields:a,fieldToAdd:o,onChange:i})]})})]})}const ld=[{order:4,fieldLabel:"Email",fieldType:"string",required:!1,fieldAccess:"editable",hideFor:[],dependsOn:"",options:[]},{order:1,fieldLabel:"Name",fieldType:"string",required:!0,fieldAccess:"editable",hideFor:[],dependsOn:"",options:[]},{order:6,fieldLabel:"Checkbox Selector",fieldType:"checkbox",required:!1,fieldAccess:"editable",hideFor:[],dependsOn:"",options:["Checkbox1","Checkbox2","Checkbox3"]},{order:2,fieldLabel:"Date of Birth",fieldType:"date",required:!0,fieldAccess:"editable",hideFor:[],dependsOn:"",options:[]},{order:7,fieldLabel:"Enter Complaint",fieldType:"string",required:!0,fieldAccess:"editable",hideFor:[],dependsOn:"",options:[]},{order:3,fieldLabel:"Gender",fieldType:"radio",required:!1,fieldAccess:"editable",hideFor:[],dependsOn:"",options:["Male","Female","Other"]},{order:5,fieldLabel:"Select Complaint Type",fieldType:"select",required:!1,fieldAccess:"editable",hideFor:[],dependsOn:"",options:["Complaint","Feedback","Suggestion"]}];function Fr(e){return`review-${e.order}-${e.fieldLabel.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}`}function eo(e){return e.fieldLabel.toLowerCase().includes("complaint")}function cd(){const[e,t]=O.useState({}),r=[...ld].sort((o,s)=>o.order-s.order),n=(o,s)=>{t(i=>({...i,[o.fieldLabel]:s}))},a=o=>{const s=Fr(o),i=e[o.fieldLabel]||"",c={id:s,name:o.fieldLabel,required:o.required,disabled:o.fieldAccess==="read-only"};switch(o.fieldType){case"date":return l.jsx("input",{...c,className:"review-control",type:"date",value:i,onChange:d=>n(o,d.target.value)});case"select":case"dropdown":return l.jsxs("select",{...c,className:"review-control",value:i,onChange:d=>n(o,d.target.value),children:[l.jsxs("option",{value:"",children:["Select ",o.fieldLabel.toLowerCase()]}),o.options.map(d=>l.jsx("option",{value:d,children:d},d))]});case"radio":return l.jsx("div",{className:"review-options review-options--inline",children:o.options.map((d,u)=>{const f=u===0?s:`${s}-${d.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return l.jsxs("label",{className:"review-option",htmlFor:f,children:[l.jsx("input",{...c,id:f,type:"radio",value:d,checked:i===d,onChange:h=>n(o,h.target.value)}),l.jsx("span",{children:d})]},d)})});case"checkbox":return l.jsx("div",{className:"review-options review-options--inline",children:o.options.map((d,u)=>{const f=u===0?s:`${s}-${d.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,h=e[o.fieldLabel]||[];return l.jsxs("label",{className:"review-option",htmlFor:f,children:[l.jsx("input",{...c,id:f,name:`${o.fieldLabel}[]`,type:"checkbox",value:d,checked:h.includes(d),onChange:v=>{const S=v.target.checked?[...h,d]:h.filter(E=>E!==d);n(o,S)}}),l.jsx("span",{children:d})]},d)})});default:return eo(o)?l.jsx("textarea",{...c,className:"review-control review-control--textarea",value:i,placeholder:"Enter your complaint here...",onChange:d=>n(o,d.target.value)}):l.jsx("input",{...c,className:"review-control",type:"text",value:i,placeholder:`Enter ${o.fieldLabel.toLowerCase()}`,onChange:d=>n(o,d.target.value)})}};return l.jsx("div",{className:"review-form","aria-label":"Complaint review form",children:l.jsx("div",{className:"review-form-grid",children:r.map(o=>l.jsxs("div",{className:`review-question${eo(o)?" review-question--wide":""}`,children:[l.jsxs("label",{className:"review-label",htmlFor:Fr(o),children:[o.fieldLabel,o.required?l.jsx("span",{className:"review-required",children:"*"}):null]}),a(o)]},Fr(o)))})})}function dd({onPublish:e,stepMeta:t,stepperProps:r}){const{state:n}=Re();return ka.find(a=>a.value===n.categoryType)?.label||n.categoryType,l.jsxs(l.Fragment,{children:[l.jsx(Ve,{...r,steps:q}),l.jsx(je,{title:t.title,description:t.description,showNext:!1,children:l.jsxs("div",{className:"ca-review",children:[l.jsxs("section",{className:"ca-review__block ca-review__block--last",children:[l.jsx(Bt,{children:"Form Fields"}),l.jsx(cd,{})]}),l.jsx("div",{className:"ca-workflow__actions",children:l.jsx(ee,{onClick:e,children:"Publish"})})]})})]})}function ud(e){const t=Number(e);return!Number.isFinite(t)||t<1?1:t>q.length?q.length:Math.floor(t)}function fd(e){const t=Number(e);return!Number.isFinite(t)||t<1?1:t>3?3:Math.floor(t)}function to({title:e="Complaint Management Settings",onPublish:t,onStepChange:r,onSaveDraft:n,showSaveButton:a=!0,showNextButton:o=!0}){const s=pt(),{systemId:i}=Vo(),[c,d]=Ts(),u=ud(c.get("step")||1),f=fd(c.get("substep")||1);O.useEffect(()=>{if(!c.get("step")){const y=new URLSearchParams(c);y.set("step","1"),d(y,{replace:!0})}},[c,d]);const h=O.useMemo(()=>q.find(y=>y.id===u)||q[0],[u]),v=O.useCallback((y,C)=>{const N=new URLSearchParams(c);N.set("step",String(y)),y===4?N.set("substep",String(C??(y===u?f:1))):N.delete("substep"),d(N,{replace:!1}),r?.({systemId:i,step:y,substep:C})},[c,d,r,i,u,f]),S=()=>{u<q.length&&v(u+1,1)},E=y=>{v(4,y)},b=()=>{t?.({systemId:i,step:u})},m={currentStep:u,onStepClick:y=>v(y,y===4?1:void 0),showSaveButton:a,showNextButton:o&&u<q.length,onSaveDraft:()=>n?.({systemId:i,step:u}),onNext:S,className:"ca-settings-page__stepper"};return l.jsx(Pa,{children:l.jsxs("div",{className:"ca-settings-page",children:[l.jsx(wr,{children:e}),u===1?l.jsx(Jc,{stepMeta:h,stepperProps:m}):null,u===2?l.jsx(Za,{onNext:S,stepMeta:h,substep:f,onSubstepChange:E,stepperProps:m}):null,u===5?l.jsx(Zc,{stepMeta:h,stepperProps:m}):null,u===7?l.jsx(Za,{onNext:S,stepMeta:h,substep:f,onSubstepChange:E,stepperProps:m}):null,u===3?l.jsx(id,{stepMeta:h,stepperProps:m}):null,u===4?l.jsx(dd,{onPublish:b,stepMeta:h,stepperProps:m}):null,l.jsx("button",{type:"button",className:"ca-back-link",onClick:()=>s("/"),children:"← Back to Complaint Management"})]})},i||"new")}function pd({pageProps:e,onPublish:t,onStepChange:r,children:n}){const a=n??l.jsx(La,{...e});return l.jsxs(os,{children:[l.jsx(ht,{path:"/",element:a}),l.jsx(ht,{path:"/settings/:systemId",element:l.jsx(to,{onPublish:t,onStepChange:r})}),l.jsx(ht,{path:"*",element:a})]})}function hd({pageProps:e,onPublish:t,onStepChange:r,children:n}){return l.jsx(pd,{pageProps:e,onPublish:t,onStepChange:r,children:n})}function md({children:e}){const{cssVars:t,darkMode:r,mode:n}=ra();return l.jsx("div",{className:`ca-root ${r?"ca-root--dark":"ca-root--light"}`,"data-ca-theme":n,style:t,children:e})}function gd({basePath:e,children:t}){return Fe()?t:l.jsx(vs,{basename:e,children:t})}function yd({store:e,children:t}){const r=O.useContext(kr.ReactReduxContext);return!e&&r?.store?t:l.jsx(kr.Provider,{store:e||la,children:t})}const ro=({apiUrl:e,authToken:t,store:r,basePath:n="/",theme:a,darkMode:o=!1,title:s,description:i,systems:c,systemsEndpoint:d,useDemoData:u=!0,createLabel:f,onCreateForm:h,onConfigure:v,onOpen:S,onTitleClick:E,onDescriptionClick:b,onSearch:m,onPublish:y,onSaveDraft:C,showSaveButton:N,showNextButton:L,onStepChange:F,children:$})=>{const X={title:s,description:i,systems:c,systemsEndpoint:d,useDemoData:u,createLabel:f,onCreateForm:h,onConfigure:v,onOpen:S,onTitleClick:E,onDescriptionClick:b,onSearch:m,onSaveDraft:C,showSaveButton:N,showNextButton:L};return l.jsx(ta,{theme:a,darkMode:o,children:l.jsx(yd,{store:r,children:l.jsx(md,{children:l.jsx(Zn,{apiUrl:e,authToken:t,children:l.jsx(gd,{basePath:n,children:l.jsx(hd,{pageProps:X,onPublish:y,onStepChange:F,children:$})})})})})})},bd=ae.colors,wd=ae.radii,vd=ae.spacing,Cd=ae.typography;g.AddFormButton=Ga,g.AddTableCard=qa,g.ApiProvider=Zn,g.BodyText=It,g.Button=ee,g.COMPLAINT_ENDPOINTS=Q,g.CardFooter=ba,g.CardHeader=ya,g.ChevronDownIcon=Ia,g.ChevronRightIcon=Cr,g.Chip=Ha,g.CloseIcon=Ra,g.ComplaintApp=ro,g.ComplaintManagementPage=La,g.ComplaintSettingsPage=to,g.DEFAULT_PAGE_DESCRIPTION=Ta,g.DEMO_SYSTEMS=Oa,g.DataPoint=wa,g.Divider=va,g.DragHandleIcon=Nr,g.FieldLabel=Ut,g.FormCard=Ya,g.FormCardGrid=Qa,g.FormField=re,g.FormInput=Sr,g.FormSelect=Er,g.FormTextarea=Ma,g.Heading1=wr,g.Heading2=Bt,g.Input=te,g.LabelText=ua,g.LayersIcon=Da,g.LinkText=Nc,g.Loading=Na,g.PageHeader=pa,g.PlusIcon=ca,g.Radio=Wa,g.RoleMultiSelect=Va,g.SETTINGS_STEPS=q,g.SearchBar=_a,g.SearchIcon=Ea,g.Select=K,g.SettingsCard=je,g.SettingsCardHeader=Ba,g.SettingsWizardProvider=Pa,g.StatusBadge=ha,g.Stepper=Ve,g.SystemCard=Ca,g.SystemCardGrid=Sa,g.TableCard=Ka,g.TableCardGrid=Ja,g.Tag=ja,g.Textarea=Ua,g.ThemeProvider=ta,g.Toggle=_r,g.ToggleField=$a,g.TrashIcon=Xa,g.Typography=ue,g.ValueText=fa,g.WORKFLOW_SUBSTEPS=Hc,g.api=M,g.clearComplaintError=vc,g.clearSelectedComplaintResource=Cc,g.colors=bd,g.complaintDepartmentActions=Ce,g.complaintPriorityActions=Se,g.complaintReducer=sa,g.complaintStatusActions=_e,g.complaintTypeActions=ve,g.complaintWorkflowActions=Ee,g.createComplaintDepartment=ec,g.createComplaintPriority=oc,g.createComplaintStatus=mc,g.createComplaintStore=ia,g.createComplaintType=Zl,g.createComplaintWorkflow=dc,g.darkTheme=at,g.deepMerge=Me,g.default=ro,g.defaultThemeFile=Gn,g.deleteComplaintDepartment=rc,g.deleteComplaintPriority=ic,g.deleteComplaintStatus=yc,g.deleteComplaintType=Xl,g.deleteComplaintWorkflow=fc,g.deleteWorkflowSteps=na,g.getComplaintDepartmentById=Ql,g.getComplaintDepartments=Yl,g.getComplaintPriorities=nc,g.getComplaintPriorityById=ac,g.getComplaintStatusById=hc,g.getComplaintStatuses=pc,g.getComplaintTypeById=Jl,g.getComplaintTypes=Kl,g.getComplaintWorkflowById=cc,g.getComplaintWorkflows=lc,g.getDepartmentTree=xt,g.getWorkflowSteps=Pt,g.lightTheme=ae,g.normalizeThemeFile=Xn,g.radii=wd,g.resetComplaintState=Sc,g.resolveActiveTheme=Yn,g.saveWorkflowSteps=kt,g.setAuthToken=gr,g.setBaseUrl=Jn,g.spacing=vd,g.store=la,g.themeToCssVars=Qn,g.typography=Cd,g.updateComplaintDepartment=tc,g.updateComplaintPriority=sc,g.updateComplaintStatus=gc,g.updateComplaintType=Gl,g.updateComplaintWorkflow=uc,g.useSettingsWizard=Re,g.useTheme=ra,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
9
|
+
`),l=s===-1?-1:o.indexOf(`
|
|
10
|
+
`,s+1),c=l===-1?"":o.slice(l+1);String(n.stack).endsWith(c)||(n.stack+=`
|
|
11
|
+
`+o)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=ve(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:o}=r;n!==void 0&&At.assertOptions(n,{silentJSONParsing:M.transitional(M.boolean),forcedJSONParsing:M.transitional(M.boolean),clarifyTimeoutError:M.transitional(M.boolean),legacyInterceptorReqResOrdering:M.transitional(M.boolean),advertiseZstdAcceptEncoding:M.transitional(M.boolean),validateStatusUndefinedResolves:M.transitional(M.boolean)},!1),a!=null&&(p.isFunction(a)?r.paramsSerializer={serialize:a}:At.assertOptions(a,{encode:M.function,serialize:M.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),At.assertOptions(r,{baseUrl:M.spelling("baseURL"),withXsrfToken:M.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=o&&p.merge(o.common,o[r.method]);o&&p.forEach(["delete","get","head","post","put","patch","query","common"],_=>{delete o[_]}),r.headers=I.concat(s,o);const l=[];let c=!0;this.interceptors.request.forEach(function(S){if(typeof S.runWhen=="function"&&S.runWhen(r)===!1)return;c=c&&S.synchronous;const b=r.transitional||sr;b&&b.legacyInterceptorReqResOrdering?l.unshift(S.fulfilled,S.rejected):l.push(S.fulfilled,S.rejected)});const d=[];this.interceptors.response.forEach(function(S){d.push(S.fulfilled,S.rejected)});let u,f=0,h;if(!c){const _=[pr.bind(this),void 0];for(_.unshift(...l),_.push(...d),h=_.length,u=Promise.resolve(r);f<h;)u=u.then(_[f++],_[f++]);return u}h=l.length;let v=r;for(;f<h;){const _=l[f++],S=l[f++];try{v=_?_(v):v}catch(b){if(!S){u=Promise.reject(b);break}try{const m=S.call(this,b);p.isThenable(m)&&(u=Promise.resolve(m).then(()=>pr.call(this,v)))}catch(m){u=Promise.reject(m)}break}}if(!u)try{u=pr.call(this,v)}catch(_){u=Promise.reject(_)}for(f=0,h=d.length;f<h;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=ve(this.defaults,t);const r=Pn(t.baseURL,t.url,t.allowAbsoluteUrls,t);return _n(r,t.params,t.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(t){we.prototype[t]=function(r,n){return this.request(ve(n||{},{method:t,url:r,data:n&&p.hasOwnProp(n,"data")?n.data:void 0}))}}),p.forEach(["post","put","patch","query"],function(t){function r(n){return function(o,s,l){return this.request(ve(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}we.prototype[t]=r(),t!=="query"&&(we.prototype[t+"Form"]=r(!0))});let Il=class fo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(a=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](a);n._listeners=null}),this.promise.then=a=>{let o;const s=new Promise(l=>{n.subscribe(l),o=l}).then(a);return s.cancel=function(){n.unsubscribe(o)},s},t(function(o,s,l){n.reason||(n.reason=new at(o,s,l),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new fo(function(a){t=a}),cancel:t}}};function Ml(e){return function(r){return e.apply(null,r)}}function Ul(e){return p.isObject(e)&&e.isAxiosError===!0}const hr={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(hr).forEach(([e,t])=>{hr[t]=e});function Rn(e){const t=new we(e),r=nn(we.prototype.request,t);return p.extend(r,we.prototype,t,{allOwnKeys:!0}),p.extend(r,t,null,{allOwnKeys:!0}),r.create=function(a){return Rn(ve(e,a))},r}const P=Rn(nt);P.Axios=we,P.CanceledError=at,P.CancelToken=Il,P.isCancel=On,P.VERSION=dr,P.toFormData=Nt,P.AxiosError=E,P.Cancel=P.CanceledError,P.all=function(t){return Promise.all(t)},P.spread=Ml,P.isAxiosError=Ul,P.mergeConfig=ve,P.AxiosHeaders=I,P.formToJSON=e=>Ln(p.isHTMLForm(e)?new FormData(e):e),P.getAdapter=qn.getAdapter,P.HttpStatusCode=hr,P.default=P;const{Axios:Jd,AxiosError:Zd,CanceledError:Gd,isCancel:Xd,CancelToken:Qd,VERSION:Yd,all:eu,Cancel:tu,isAxiosError:ru,spread:nu,toFormData:au,AxiosHeaders:ou,HttpStatusCode:su,formToJSON:iu,getAdapter:lu,mergeConfig:cu,create:du}=P;function Ft(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)n!=="__proto__"&&(e[n]=r[n])}return e}var $l={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 mr(e,t){function r(a,o,s){if(!(typeof document>"u")){s=Ft({},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 l="";for(var c in s)s[c]&&(l+="; "+c,s[c]!==!0&&(l+="="+s[c].split(";")[0]));return document.cookie=a+"="+e.write(o,a)+l}}function n(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var o=document.cookie?document.cookie.split("; "):[],s={},l=0;l<o.length;l++){var c=o[l].split("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(u in s||(s[u]=e.read(d,u)),a===u)break}catch{}}return a?s[a]:s}}return Object.create({set:r,get:n,remove:function(a,o){r(a,"",Ft({},o,{expires:-1}))},withAttributes:function(a){return mr(this.converter,Ft({},this.attributes,a))},withConverter:function(a){return mr(Ft({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var ot=mr($l,{path:"/"});const jl={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let Me="https://api-grievance.airaops.com",Kn=null;try{if(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:jt&&jt.tagName.toUpperCase()==="SCRIPT"&&jt.src||new URL("complaint-app.umd.js",document.baseURI).href}<"u"&&jl?.VITE_API_URL)Me=void 0;else{const e=typeof process<"u"?process:null;e?.env?.VITE_API_URL&&(Me=e.env.VITE_API_URL)}}catch{}const Jn=e=>{Me=e||"",U.defaults.baseURL=Me},gr=e=>{Kn=e||null},Vl=()=>Kn||ot.get("token")||null,U=P.create({baseURL:Me,headers:{Accept:"application/json","Content-Type":"application/json"}});U.interceptors.request.use(e=>{const t=Vl();return e.headers=e.headers||{},t?e.headers.Authorization=`Bearer ${t}`:delete e.headers.Authorization,e});let yr=!1,br=null;U.interceptors.response.use(e=>e,async e=>{const t=e.config,r=e.response;if(r&&(r.status===401||r.status===402)){const n=ot.get("refreshToken");if(n)try{yr||(yr=!0,br=P.post(`${Me}/api/v1/auth/refresh`,{},{headers:{Authorization:`Bearer ${n}`}}));const a=await br,{token:o,refreshToken:s}=a.data;return gr(o),s&&ot.set("refreshToken",s),t.headers.Authorization=`Bearer ${o}`,U(t)}catch{ot.remove("token"),ot.remove("refreshToken")}finally{yr=!1,br=null}}return Promise.reject(e)});const Hl=L.createContext(null),Zn=({children:e,apiUrl:t,authToken:r})=>(t&&Jn(t),gr(r||null),i.jsx(Hl.Provider,{value:{apiUrl:t,authToken:r},children:e})),ae={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)"}},st={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)"}},Gn={light:ae,dark:st};function Ue(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function $e(e,t){if(!Ue(t))return e;const r={...e};return Object.keys(t).forEach(n=>{const a=t[n];Ue(a)&&Ue(e[n])?r[n]=$e(e[n],a):a!==void 0&&(r[n]=a)}),r}function Xn(e){return!e||!Ue(e)?{light:ae,dark:st}:Ue(e.light)||Ue(e.dark)?{light:$e(ae,e.light||{}),dark:$e(st,e.dark||{})}:{light:$e(ae,e),dark:$e(st,e)}}function Qn(e,t=!1){const r=Xn(e);return{...t?r.dark:r.light,mode:t?"dark":"light",__pack:r}}const Wl={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"},ql={sm:"--ca-radius-sm",md:"--ca-radius-md",lg:"--ca-radius-lg",xl:"--ca-radius-xl",pill:"--ca-radius-pill"},zl={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"},Rl={card:"--ca-shadow-card",settings:"--ca-shadow-settings"};function Yn(e){const t={};return e?.colors&&Object.entries(Wl).forEach(([r,n])=>{e.colors[r]!=null&&(t[n]=e.colors[r])}),e?.radii&&Object.entries(ql).forEach(([r,n])=>{e.radii[r]!=null&&(t[n]=e.radii[r])}),e?.typography&&Object.entries(zl).forEach(([r,n])=>{e.typography[r]!=null&&(t[n]=e.typography[r])}),e?.shadow&&Object.entries(Rl).forEach(([r,n])=>{e.shadow[r]!=null&&(t[n]=e.shadow[r])}),t["--ca-on-primary"]&&!t["--ca-white"]&&(t["--ca-white"]=t["--ca-on-primary"]),t}const ea=L.createContext({darkMode:!1,theme:null,themeFile:Gn,cssVars:{}});function ta({theme:e,darkMode:t=!1,children:r}){const n=L.useMemo(()=>{const a=Qn(e,!!t),o=Yn(a);return{darkMode:!!t,theme:a,themeFile:a.__pack,cssVars:o,mode:a.mode}},[e,t]);return i.jsx(ea.Provider,{value:n,children:r})}function ra(){return L.useContext(ea)}const ee=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"}),oe=(e,t)=>ht.createAsyncThunk(e,async(r,n)=>{try{return(await t(r,n)).data}catch(a){return Kl(a,n)}}),it=(e,t)=>({list:oe(`complaint/${e}/list`,(r,{signal:n})=>U.get(t,{params:r,signal:n})),getById:oe(`complaint/${e}/getById`,(r,{signal:n})=>U.get(`${t}/${r}`,{signal:n})),create:oe(`complaint/${e}/create`,r=>U.post(t,r)),update:oe(`complaint/${e}/update`,({id:r,data:n})=>U.patch(`${t}/${r}`,n)),remove:oe(`complaint/${e}/remove`,r=>U.delete(`${t}/${r}`))}),Ce=it("types",ee.types),_e=it("departments",ee.departments),Se=it("priorities",ee.priorities),Ee=it("workflows",ee.workflows),Ne=it("statuses",ee.statuses),xt=oe("complaint/departments/getTree",(e,{signal:t})=>U.get(ee.departmentTree,{signal:t})),Pt=oe("complaint/workflows/getSteps",(e,{signal:t})=>U.get(`${ee.workflowSteps}/${e}`,{signal:t})),kt=oe("complaint/workflows/saveSteps",e=>U.post(ee.workflowSteps,e)),na=oe("complaint/workflows/deleteSteps",e=>U.delete(`${ee.workflowSteps}/${e}`)),Jl=Ce.list,Zl=Ce.getById,Gl=Ce.create,Xl=Ce.update,Ql=Ce.remove,Yl=_e.list,ec=_e.getById,tc=_e.create,rc=_e.update,nc=_e.remove,ac=Se.list,oc=Se.getById,sc=Se.create,ic=Se.update,lc=Se.remove,cc=Ee.list,dc=Ee.getById,uc=Ee.create,fc=Ee.update,pc=Ee.remove,hc=Ne.list,mc=Ne.getById,gc=Ne.create,yc=Ne.update,bc=Ne.remove,lt=()=>({data:[],selected:null,pagination:null,isLoading:!1,isMutating:!1,error:null}),aa={types:lt(),departments:lt(),priorities:lt(),workflows:lt(),statuses:lt(),departmentTree:[],workflowSteps:{},isLoadingDepartmentTree:!1,isLoadingWorkflowSteps:!1,error:null},vc=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}},ct=e=>e?.data??e,Dt=e=>e?.id??e?._id,wc=(e,t)=>{if(!t||typeof t!="object")return e;const r=Dt(t);if(r==null)return e;const n=e.findIndex(o=>Dt(o)===r);if(n<0)return[t,...e];const a=[...e];return a[n]=t,a},Le=e=>e.payload?.message??e.error?.message??"Something went wrong",dt=(e,t,r)=>{e.addCase(r.list.pending,n=>{n[t].isLoading=!0,n[t].error=null}).addCase(r.list.fulfilled,(n,a)=>{const o=vc(a.payload);n[t].isLoading=!1,n[t].data=o.data,n[t].pagination=o.pagination}).addCase(r.list.rejected,(n,a)=>{n[t].isLoading=!1,n[t].error=Le(a)}).addCase(r.getById.pending,n=>{n[t].isLoading=!0,n[t].error=null}).addCase(r.getById.fulfilled,(n,a)=>{n[t].isLoading=!1,n[t].selected=ct(a.payload)}).addCase(r.getById.rejected,(n,a)=>{n[t].isLoading=!1,n[t].error=Le(a)}),[r.create,r.update].forEach(n=>{e.addCase(n.pending,a=>{a[t].isMutating=!0,a[t].error=null}).addCase(n.fulfilled,(a,o)=>{const s=ct(o.payload);a[t].isMutating=!1,a[t].selected=s,a[t].data=wc(a[t].data,s)}).addCase(n.rejected,(a,o)=>{a[t].isMutating=!1,a[t].error=Le(o)})}),e.addCase(r.remove.pending,n=>{n[t].isMutating=!0,n[t].error=null}).addCase(r.remove.fulfilled,(n,a)=>{const o=a.meta.arg;n[t].isMutating=!1,n[t].data=n[t].data.filter(s=>Dt(s)!==o),Dt(n[t].selected)===o&&(n[t].selected=null)}).addCase(r.remove.rejected,(n,a)=>{n[t].isMutating=!1,n[t].error=Le(a)})},oa=ht.createSlice({name:"complaintAppComplaint",initialState:aa,reducers:{clearComplaintError(e,t){const r=t.payload;r&&e[r]?.error!==void 0?e[r].error=null:e.error=null},clearSelectedComplaintResource(e,t){const r=t.payload;r&&e[r]?.selected!==void 0&&(e[r].selected=null)},resetComplaintState(){return aa}},extraReducers:e=>{dt(e,"types",Ce),dt(e,"departments",_e),dt(e,"priorities",Se),dt(e,"workflows",Ee),dt(e,"statuses",Ne),e.addCase(xt.pending,t=>{t.isLoadingDepartmentTree=!0,t.error=null}).addCase(xt.fulfilled,(t,r)=>{t.isLoadingDepartmentTree=!1;const n=ct(r.payload);t.departmentTree=Array.isArray(n)?n:n?.tree??n?.items??[]}).addCase(xt.rejected,(t,r)=>{t.isLoadingDepartmentTree=!1,t.error=Le(r)}).addCase(Pt.pending,t=>{t.isLoadingWorkflowSteps=!0,t.error=null}).addCase(Pt.fulfilled,(t,r)=>{t.isLoadingWorkflowSteps=!1,t.workflowSteps[r.meta.arg]=ct(r.payload)}).addCase(Pt.rejected,(t,r)=>{t.isLoadingWorkflowSteps=!1,t.error=Le(r)}).addCase(kt.pending,t=>{t.isLoadingWorkflowSteps=!0,t.error=null}).addCase(kt.fulfilled,(t,r)=>{t.isLoadingWorkflowSteps=!1;const n=ct(r.payload),a=r.meta.arg?.workflowId??n?.workflowId??n?.id;a!==void 0&&(t.workflowSteps[a]=n)}).addCase(kt.rejected,(t,r)=>{t.isLoadingWorkflowSteps=!1,t.error=Le(r)}).addCase(na.fulfilled,(t,r)=>{delete t.workflowSteps[r.meta.arg]})}}),{clearComplaintError:Cc,clearSelectedComplaintResource:_c,resetComplaintState:Sc}=oa.actions,sa=oa.reducer,Ec=ht.combineReducers({complaintAppComplaint:sa}),ia=e=>ht.configureStore({reducer:Ec,preloadedState:e,middleware:t=>t({immutableCheck:!1,serializableCheck:!1})}),la=ia();function R({children:e,variant:t="primary",size:r="md",startIcon:n,endIcon:a,className:o="",type:s="button",disabled:l=!1,onClick:c,...d}){const u=["ca-btn",`ca-btn--${t}`,r==="sm"?"ca-btn--sm":"",r==="lg"?"ca-btn--lg":"",o].filter(Boolean).join(" ");return i.jsxs("button",{type:s,className:u,disabled:l,onClick:c,...d,children:[n?i.jsx("span",{className:"ca-btn__icon",children:n}):null,e,a?i.jsx("span",{className:"ca-btn__icon",children:a}):null]})}function ca({size:e=16,color:t="currentColor",...r}){return i.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...r,children:i.jsx("path",{d:"M12 5v14M5 12h14",stroke:t,strokeWidth:"2",strokeLinecap:"round"})})}const da={h1:"ca-h1",h2:"ca-h2",body:"ca-body",label:"ca-label",value:"ca-value",small:"ca-small",link:"ca-link"},Nc={h1:"h1",h2:"h2",body:"p",label:"span",value:"span",small:"span",link:"button"};function fe({variant:e="body",as:t,className:r="",children:n,...a}){const o=t||Nc[e]||"p",s=da[e]||da.body;return i.jsx(o,{className:`${s} ${r}`.trim(),...a,children:n})}function vr(e){return i.jsx(fe,{variant:"h1",...e})}function Bt(e){return i.jsx(fe,{variant:"h2",...e})}function It(e){return i.jsx(fe,{variant:"body",...e})}function ua(e){return i.jsx(fe,{variant:"label",...e})}function fa(e){return i.jsx(fe,{variant:"value",...e})}function Lc(e){return i.jsx(fe,{variant:"link",type:"button",...e})}function pa({title:e="Complaint Management",description:t,actionLabel:r="Create New Form",onAction:n,className:a=""}){return i.jsxs("header",{className:`ca-page-header ${a}`.trim(),children:[i.jsxs("div",{className:"ca-page-header__text",children:[i.jsx(vr,{children:e}),t?i.jsx(It,{children:t}):null]}),i.jsx("div",{className:"ca-page-header__actions",children:i.jsx(R,{startIcon:i.jsx(ca,{}),onClick:n,children:r})})]})}function ha({status:e="inactive",label:t,className:r=""}){const a=String(e).toLowerCase()==="active",o=t??(a?"Active":"Inactive");return i.jsx("span",{className:`ca-badge rounded ca-badge--${a?"active":"inactive"} ${r}`.trim(),children:o})}const ma=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();const Oc=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Tc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());const ga=e=>{const t=Tc(e);return t.charAt(0).toUpperCase()+t.slice(1)};var wr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ac=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Fc=L.createContext({}),xc=()=>L.useContext(Fc),Pc=L.forwardRef(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:n,className:a="",children:o,iconNode:s,...l},c)=>{const{size:d=24,strokeWidth:u=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:v=""}=xc()??{},_=n??f?Number(r??u)*24/Number(t??d):r??u;return L.createElement("svg",{ref:c,...wr,width:t??d??wr.width,height:t??d??wr.height,stroke:e??h,strokeWidth:_,className:ma("lucide",v,a),...!o&&!Ac(l)&&{"aria-hidden":"true"},...l},[...s.map(([S,b])=>L.createElement(S,b)),...Array.isArray(o)?o:[o]])});const se=(e,t)=>{const r=L.forwardRef(({className:n,...a},o)=>L.createElement(Pc,{ref:o,iconNode:t,className:ma(`lucide-${Oc(ga(e))}`,`lucide-${e}`,n),...a}));return r.displayName=ga(e),r};const kc=se("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]]);const Dc=se("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);const Bc=se("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);const Ic=se("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);const Mc=se("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]);const Uc=se("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);const ya=se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const $c=se("store",[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]]);const jc=se("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);function Vc({options:e=[],className:t=""}){const[r,n]=L.useState(!1),a=L.useRef(null);L.useEffect(()=>{const s=l=>{a.current&&!a.current.contains(l.target)&&n(!1)};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[]);const o=s=>{s.onClick?.(),n(!1)};return i.jsxs("div",{ref:a,className:`ca-more-functions ${t}`.trim(),children:[i.jsx("button",{type:"button",className:"ca-more-functions__button",onClick:()=>n(s=>!s),"aria-label":"More options","aria-expanded":r,children:i.jsx(Ic,{size:16})}),r&&e.length>0&&i.jsx("div",{className:"ca-more-functions__menu",children:e.map((s,l)=>i.jsxs("button",{type:"button",className:`ca-more-functions__item ${s.danger?"ca-more-functions__item--danger":""}`,onClick:()=>o(s),children:[s.icon&&i.jsx("span",{className:"ca-more-functions__icon",children:s.icon}),i.jsx("span",{children:s.label})]},s.key||l))})]})}function ba({title:e,status:t,statusLabel:r,titleAsLink:n=!1,onTitleClick:a,menuOptions:o=[],className:s=""}){return i.jsxs("div",{className:`ca-system-card__header ${s}`.trim(),children:[i.jsx("div",{className:"ca-system-card__title-wrap",children:n?i.jsx("button",{type:"button",className:"ca-h2 ca-h2--link",onClick:a,children:e}):i.jsx(Bt,{children:e})}),i.jsxs("div",{className:"ca-system-card__header-actions",children:[i.jsx(ha,{status:t,label:r}),i.jsx(Vc,{options:o})]})]})}function Cr({size:e=16,color:t="currentColor",...r}){return i.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...r,children:i.jsx("path",{d:"M9 6l6 6-6 6",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function va({updatedOn:e,openLabel:t="Open",configureLabel:r="Configure",onOpen:n,onConfigure:a,className:o="",id:s,title:l}){const c=Ze(),d=()=>{c("/querymanagement")};return i.jsxs("div",{className:`ca-system-card__footer ${o}`.trim(),children:[i.jsx(fe,{variant:"small",as:"span",children:e?`Updated on ${e}`:""}),i.jsxs("div",{className:"ca-system-card__footer-actions",children:[i.jsx(R,{size:"sm",onClick:d,children:t}),i.jsx(R,{variant:"outline",size:"sm",onClick:a,endIcon:i.jsx(Cr,{size:14,color:"currentColor"}),children:r})]})]})}function wa({label:e,value:t,icon:r,className:n=""}){const a=t==null?"—":typeof t=="number"?String(t).padStart(2,"0"):t;return i.jsxs("div",{className:`ca-data-point ${n}`.trim(),children:[r?i.jsx("span",{className:"ca-data-point__icon","aria-hidden":"true",children:r}):null,i.jsx(fa,{children:a}),i.jsx("span",{className:"ca-data-point__label",children:e})]})}function Ca({className:e=""}){return i.jsx("div",{className:`ca-divider ${e}`.trim(),role:"separator","aria-orientation":"vertical"})}const Hc="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_617_15259)'%3e%3cpath%20d='M9.99992%2011.9997H6.66658M11.9999%209.33301H6.66658M2.66659%2014.6663H13.3333C13.6869%2014.6663%2014.026%2014.5259%2014.2761%2014.2758C14.5261%2014.0258%2014.6666%2013.6866%2014.6666%2013.333V2.66634C14.6666%202.31272%2014.5261%201.97358%2014.2761%201.72353C14.026%201.47348%2013.6869%201.33301%2013.3333%201.33301H5.33325C4.97963%201.33301%204.64049%201.47348%204.39044%201.72353C4.14039%201.97358%203.99992%202.31272%203.99992%202.66634V5.99967M2.66659%2014.6663C3.02021%2014.6663%203.35935%2014.5259%203.60939%2014.2758C3.85944%2014.0258%203.99992%2013.6866%203.99992%2013.333V5.99967M2.66659%2014.6663C2.31296%2014.6663%201.97382%2014.5259%201.72378%2014.2758C1.47373%2014.0258%201.33325%2013.6866%201.33325%2013.333V7.33301C1.33325%206.97939%201.47373%206.64025%201.72378%206.3902C1.97382%206.14015%202.31296%205.99967%202.66659%205.99967H3.99992M7.33325%203.99967H11.3333C11.7014%203.99967%2011.9999%204.29815%2011.9999%204.66634V5.99967C11.9999%206.36786%2011.7014%206.66634%2011.3333%206.66634H7.33325C6.96506%206.66634%206.66658%206.36786%206.66658%205.99967V4.66634C6.66658%204.29815%206.96506%203.99967%207.33325%203.99967Z'%20stroke='%232D64B8'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_617_15259'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Wc="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.44729%202.75711C6.48402%202.37067%206.66351%202.01181%206.95069%201.75063C7.23787%201.48945%207.61211%201.34473%208.00029%201.34473C8.38847%201.34473%208.76271%201.48945%209.04989%201.75063C9.33707%202.01181%209.51656%202.37067%209.55329%202.75711C9.57537%203.00675%209.65727%203.24739%209.79205%203.45867C9.92683%203.66995%2010.1105%203.84565%2010.3276%203.97089C10.5447%204.09614%2010.7887%204.16724%2011.0391%204.17819C11.2895%204.18913%2011.5388%204.1396%2011.766%204.03378C12.1187%203.87363%2012.5184%203.85045%2012.8873%203.96877C13.2562%204.08708%2013.5678%204.33841%2013.7616%204.67385C13.9554%205.00928%2014.0175%205.40482%2013.9357%205.78349C13.854%206.16215%2013.6342%206.49685%2013.3193%206.72244C13.1142%206.86634%2012.9468%207.05751%2012.8312%207.27979C12.7157%207.50207%2012.6553%207.74891%2012.6553%207.99944C12.6553%208.24997%2012.7157%208.49681%2012.8312%208.71909C12.9468%208.94137%2013.1142%209.13254%2013.3193%209.27644C13.6342%209.50203%2013.854%209.83673%2013.9357%2010.2154C14.0175%2010.5941%2013.9554%2010.9896%2013.7616%2011.325C13.5678%2011.6605%2013.2562%2011.9118%2012.8873%2012.0301C12.5184%2012.1484%2012.1187%2012.1253%2011.766%2011.9651C11.5388%2011.8593%2011.2895%2011.8097%2011.0391%2011.8207C10.7887%2011.8316%2010.5447%2011.9027%2010.3276%2012.028C10.1105%2012.1532%209.92683%2012.3289%209.79205%2012.5402C9.65727%2012.7515%209.57537%2012.9921%209.55329%2013.2418C9.51656%2013.6282%209.33707%2013.9871%209.04989%2014.2483C8.76271%2014.5094%208.38847%2014.6542%208.00029%2014.6542C7.61211%2014.6542%207.23787%2014.5094%206.95069%2014.2483C6.66351%2013.9871%206.48402%2013.6282%206.44729%2013.2418C6.42525%2012.992%206.34336%2012.7513%206.20854%2012.54C6.07371%2012.3286%205.88994%2012.1528%205.67278%2012.0276C5.45562%2011.9023%205.21147%2011.8313%204.96101%2011.8204C4.71055%2011.8095%204.46116%2011.8591%204.23396%2011.9651C3.88122%2012.1253%203.48151%2012.1484%203.11263%2012.0301C2.74374%2011.9118%202.43207%2011.6605%202.23828%2011.325C2.04449%2010.9896%201.98244%2010.5941%202.0642%2010.2154C2.14596%209.83673%202.36569%209.50203%202.68063%209.27644C2.88571%209.13254%203.05311%208.94137%203.16868%208.71909C3.28426%208.49681%203.34459%208.24997%203.34459%207.99944C3.34459%207.74891%203.28426%207.50207%203.16868%207.27979C3.05311%207.05751%202.88571%206.86634%202.68063%206.72244C2.36614%206.49674%202.14679%206.16217%202.06523%205.78376C1.98366%205.40535%202.0457%205.01014%202.23928%204.67492C2.43287%204.3397%202.74417%204.08843%203.11269%203.96994C3.4812%203.85144%203.88061%203.8742%204.23329%204.03378C4.46046%204.1396%204.70979%204.18913%204.96016%204.17819C5.21053%204.16724%205.45458%204.09614%205.67165%203.97089C5.88872%203.84565%206.07242%203.66995%206.2072%203.45867C6.34198%203.24739%206.42388%203.00675%206.44596%202.75711M9.99996%207.99978C9.99996%209.10434%209.10453%209.99978%207.99996%209.99978C6.89539%209.99978%205.99996%209.10434%205.99996%207.99978C5.99996%206.89521%206.89539%205.99978%207.99996%205.99978C9.10453%205.99978%209.99996%206.89521%209.99996%207.99978Z'%20stroke='%23745EBF'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",qc="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.99992%208H6.66659M9.99992%205.33333H6.66659M12.6666%2011.3333V3.33333C12.6666%202.97971%2012.5261%202.64057%2012.2761%202.39052C12.026%202.14048%2011.6869%202%2011.3333%202H2.66659M2.66659%202C3.02021%202%203.35935%202.14048%203.60939%202.39052C3.85944%202.64057%203.99992%202.97971%203.99992%203.33333V5.33333M2.66659%202C2.31296%202%201.97382%202.14048%201.72378%202.39052C1.47373%202.64057%201.33325%202.97971%201.33325%203.33333V4.66667C1.33325%204.84348%201.40349%205.01305%201.52851%205.13807C1.65354%205.2631%201.82311%205.33333%201.99992%205.33333H3.99992M5.33325%2014H13.3333C13.6869%2014%2014.026%2013.8595%2014.2761%2013.6095C14.5261%2013.3594%2014.6666%2013.0203%2014.6666%2012.6667V12C14.6666%2011.8232%2014.5963%2011.6536%2014.4713%2011.5286C14.3463%2011.4036%2014.1767%2011.3333%2013.9999%2011.3333H7.33325C7.15644%2011.3333%206.98687%2011.4036%206.86185%2011.5286C6.73682%2011.6536%206.66659%2011.8232%206.66659%2012V12.6667C6.66659%2013.0203%206.52611%2013.3594%206.27606%2013.6095C6.02601%2013.8595%205.68687%2014%205.33325%2014ZM5.33325%2014C4.97963%2014%204.64049%2013.8595%204.39044%2013.6095C4.14039%2013.3594%203.99992%2013.0203%203.99992%2012.6667V5.33333'%20stroke='%2300B692'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",zc="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.66675%209.33301H6.66675M2.66675%201.33301H9.33341M3.33341%2011.9997H12.6667C13.0349%2011.9997%2013.3334%2012.2982%2013.3334%2012.6663V13.9997C13.3334%2014.3679%2013.0349%2014.6663%2012.6667%2014.6663H3.33341C2.96522%2014.6663%202.66675%2014.3679%202.66675%2013.9997V12.6663C2.66675%2012.2982%202.96522%2011.9997%203.33341%2011.9997ZM3.33341%203.99967H12.6667C13.0349%203.99967%2013.3334%204.29815%2013.3334%204.66634V5.99967C13.3334%206.36786%2013.0349%206.66634%2012.6667%206.66634H3.33341C2.96522%206.66634%202.66675%206.36786%202.66675%205.99967V4.66634C2.66675%204.29815%202.96522%203.99967%203.33341%203.99967Z'%20stroke='%23FF6F00'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function _a({id:e,title:t,status:r="inactive",statusLabel:n,description:a,descriptionHref:o,departments:s,workflows:l,fields:c,formsFilled:d,updatedOn:u,titleAsLink:f=!1,onTitleClick:h,onDescriptionClick:v,onConfigure:_,onOpen:S,menuOptions:b=[],className:m=""}){const y=()=>{_?.({id:e,title:t,status:r,departments:s,workflows:l,fields:c,formsFilled:d,updatedOn:u})},C=()=>{if(v){v({id:e,title:t,descriptionHref:o});return}o&&typeof window<"u"&&window.open(o,"_blank","noopener,noreferrer")},N=[{label:"Departments",value:s,icon:i.jsx("img",{src:Hc,alt:""})},{label:"Workflows",value:l,icon:i.jsx("img",{src:Wc,alt:""})},{label:"Fields",value:c,icon:i.jsx("img",{src:qc,alt:""})},{label:"Forms Filled",value:d,icon:i.jsx("img",{src:zc,alt:""})}];return i.jsxs("article",{className:`ca-system-card ${m}`.trim(),children:[i.jsx(ba,{title:t,status:r,statusLabel:n,titleAsLink:f,onTitleClick:()=>h?.({id:e,title:t}),menuOptions:b}),a?i.jsx("p",{className:"ca-system-card__description",onClick:C,children:a}):null,i.jsx("div",{className:"ca-system-card__stats",children:N.map((A,F)=>i.jsxs(L.Fragment,{children:[F>0?i.jsx(Ca,{}):i.jsx("div",{className:"ca-system-card__stats-spacer"}),i.jsx(wa,{label:A.label,value:A.value,icon:A.icon})]},A.label))}),i.jsx(va,{updatedOn:u,onOpen:()=>S?.({id:e,title:t}),id:e,title:t,onConfigure:y})]})}function Sa({systems:e=[],onConfigure:t,onOpen:r,onTitleClick:n,onDescriptionClick:a,emptyMessage:o="No systems found.",className:s=""}){return e.length?i.jsx("div",{className:`ca-system-grid ${s}`.trim(),children:e.map(l=>i.jsx(_a,{...l,onConfigure:t,onOpen:r,onTitleClick:n,onDescriptionClick:a},l.id??l.title))}):i.jsx("div",{className:`ca-system-grid ${s}`.trim(),children:i.jsx("div",{className:"ca-empty",children:i.jsx(It,{children:o})})})}function te({value:e,onChange:t,placeholder:r,type:n="text",icon:a,className:o="",inputClassName:s="",...l}){return i.jsxs("div",{className:`ca-input-wrap ${o}`.trim(),children:[a?i.jsx("span",{className:"ca-input-wrap__icon",children:a}):null,i.jsx("input",{type:n,className:`ca-input ${a?"ca-input--with-icon":""} ${s}`.trim(),value:e,onChange:t,placeholder:r,...l})]})}function Ea({size:e=18,color:t="currentColor",...r}){return i.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...r,children:[i.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"}),i.jsx("path",{d:"M16.5 16.5 21 21",stroke:t,strokeWidth:"1.75",strokeLinecap:"round"})]})}function Na({value:e,onChange:t,onSearch:r,placeholder:n="Search",className:a=""}){const o=s=>{s.key==="Enter"&&r&&r(e)};return i.jsx("div",{className:`ca-search ${a}`.trim(),children:i.jsx(te,{value:e,onChange:t,onKeyDown:o,placeholder:n,icon:i.jsx(Ea,{}),"aria-label":n})})}function La({text:e="Loading",fullScreen:t=!1}){return i.jsxs("div",{className:"ca-loading",style:t?{minHeight:"calc(100vh - 80px)"}:void 0,role:"status","aria-live":"polite",children:[i.jsx("span",{className:"ca-loading__spinner"}),i.jsxs("span",{children:[e,"…"]})]})}const Oa=[{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:!1},{id:"cms",title:"CX- Pulse-360 ",status:"active",description:"Description of the template",departments:5,workflows:8,fields:42,formsFilled:189,updatedOn:"08 Mar 2024"},{id:"fms",title:"ENE - TRACKER",status:"inactive",description:"Description of the template",departments:2,workflows:4,fields:28,formsFilled:56,updatedOn:"01 Feb 2024"},{id:"rms",title:"RTV - Return to Vendor ",status:"active",description:"Description of the template",departments:4,workflows:10,fields:61,formsFilled:312,updatedOn:"20 Mar 2024"}],Ta="Create, manage and track complaint forms, workflows and responses across departments.";function Aa(e=[]){return e.map((t,r)=>({id:t.id??t._id??`system-${r}`,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 Fa({title:e="Complaint Management",description:t=Ta,systems:r,systemsEndpoint:n,useDemoData:a=!0,createLabel:o="Create New Form",onCreateForm:s,onConfigure:l,onOpen:c,onTitleClick:d,onDescriptionClick:u,onSearch:f}){const h=Ze(),[v,_]=L.useState(""),[S,b]=L.useState(null),[m,y]=L.useState(null),[C,N]=L.useState(n&&!r?"loading":"idle");L.useEffect(()=>{if(!n||r)return;const k=new AbortController;return U.get(n,{signal:k.signal}).then(j=>{const ie=j?.data,Z=Array.isArray(ie)?ie:ie?.data??ie?.systems??ie?.results??[];b(Aa(Z)),y(null),N("success")}).catch(j=>{k.signal.aborted||(y(j?.message||"Failed to load systems"),b([]),N("error"))}),()=>k.abort()},[n,r]);const A=L.useMemo(()=>r?Aa(r):S||(a?Oa:[]),[r,S,a]),F=L.useMemo(()=>{const k=v.trim().toLowerCase();return k?A.filter(j=>`${j.title} ${j.description??""} ${j.status??""}`.toLowerCase().includes(k)):A},[A,v]),$=k=>{const j=k.target.value;_(j),f?.(j)},Q=k=>{l?.(k),h(`/settings/${k.id??"new"}?step=1`)},Oe=()=>{s?.(),h("/settings/new?step=1")},H=C==="loading";return i.jsxs("div",{className:"ca-complaint-management-page","data-testid":"complaint-management-page",children:[i.jsx(pa,{title:e,description:t,actionLabel:o,onAction:Oe}),i.jsx("div",{className:"ca-search-container",children:i.jsx(Na,{value:v,onChange:$,placeholder:"Search"})}),H?i.jsx(La,{text:"Loading systems"}):m?i.jsx("div",{className:"ca-empty",children:i.jsx("p",{className:"ca-body",children:m})}):i.jsx(Sa,{systems:F,onConfigure:Q,onOpen:c,onTitleClick:d,onDescriptionClick:u,emptyMessage:v?"No systems match your search.":"No systems found."})]})}const xa=L.createContext(null),Pa=()=>({categoryName:"",categoryType:"",tatMinutes:"",template:"",visibilityType:"",urlLink:"",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 ka({children:e,initialValues:t}){const[r,n]=L.useState(()=>({...Pa(),...t,workflow:{...Pa().workflow,...t?.workflow}})),a=L.useCallback(l=>{n(c=>({...c,...l}))},[]),o=L.useCallback(l=>{n(c=>({...c,workflow:{...c.workflow,...l}}))},[]),s=L.useMemo(()=>({state:r,setState:n,update:a,updateWorkflow:o}),[r,a,o]);return i.jsx(xa.Provider,{value:s,children:e})}function je(){const e=L.useContext(xa);if(!e)throw new Error("useSettingsWizard must be used within SettingsWizardProvider");return e}const K=[{id:1,key:"category",label:"Category Type",title:"Category Type",description:"Define the type and basic details for this category type."},{id:2,key:"workflow",label:"Workflow",title:"Workflow",description:"L1 > L2 > L3"},{id:3,key:"formFields",label:"Form Fields",title:"Form Fields",description:"----"},{id:4,key:"review",label:"Review & Publish",title:"Review & Publish",description:"Review your configuration and publish."}],Rc=[{id:1,label:"Create Workflow"},{id:2,label:"Statuses"},{id:3,label:"Workflow Steps"}],Kc=["Urgent","High","Medium","Low"],Jc=["Store Staff","HR Executive","HR Manager","Store Manager","Admin"],Da=[{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"}],Zc=[{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 Ba({size:e=28,color:t="currentColor",...r}){return i.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{color:"var(--ca-primary)"},...r,children:[i.jsx("path",{d:"M12 3 3 8l9 5 9-5-9-5Z",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round"}),i.jsx("path",{d:"M3 12.5 12 17.5l9-5",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"}),i.jsx("path",{d:"M3 16.5 12 21.5l9-5",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"})]})}function Ia({title:e,description:t,nextLabel:r="Next",onNext:n,showNext:a=!0,nextDisabled:o=!1,nextVariant:s="primary",className:l=""}){return i.jsxs("div",{className:`ca-settings-card__header ${l}`.trim(),children:[i.jsxs("div",{className:"ca-settings-card__heading",children:[i.jsx(Ba,{}),i.jsxs("div",{children:[i.jsx(Bt,{children:e}),t?i.jsx(It,{className:"ca-settings-card__desc",children:t}):null]})]}),a?i.jsx(R,{variant:s,disabled:o,onClick:n,endIcon:i.jsx(Cr,{size:14,color:"currentColor"}),children:r}):null]})}function Ve({title:e,description:t,onNext:r,nextLabel:n,showNext:a=!0,nextDisabled:o,nextVariant:s,children:l,footer:c,className:d=""}){return i.jsxs("section",{className:`ca-settings-card ${d}`.trim(),children:[i.jsx(Ia,{title:e,description:t,onNext:r,nextLabel:n,showNext:a,nextDisabled:o,nextVariant:s}),i.jsx("div",{className:"ca-settings-card__divider"}),i.jsx("div",{className:"ca-settings-card__body",children:l}),c?i.jsx("div",{className:"ca-settings-card__footer",children:c}):null]})}function Mt({children:e,hint:t,htmlFor:r,className:n=""}){return i.jsxs("div",{className:`ca-field-label ${n}`.trim(),children:[i.jsx("label",{className:"ca-label",htmlFor:r,children:e}),t!=null?i.jsx("span",{className:"ca-field-label__hint",children:t}):null]})}function Ma({size:e=16,color:t="currentColor",...r}){return i.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...r,children:i.jsx("path",{d:"M6 9l6 6 6-6",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function J({value:e,onChange:t,options:r=[],placeholder:n="Select",className:a="",disabled:o=!1,...s}){return i.jsxs("div",{className:`ca-select ${a}`.trim(),children:[i.jsxs("select",{className:"ca-select__control",value:e??"",onChange:t,disabled:o,...s,children:[i.jsx("option",{value:"",disabled:!0,children:n}),r.map(l=>{const c=typeof l=="string"?l:l.value,d=typeof l=="string"?l:l.label;return i.jsx("option",{value:c,children:d},c)})]}),i.jsx("span",{className:"ca-select__chevron",children:i.jsx(Ma,{size:16})})]})}function Ua({value:e,onChange:t,placeholder:r,maxLength:n,rows:a=4,className:o="",...s}){return i.jsx("textarea",{className:`ca-textarea ${o}`.trim(),value:e,onChange:t,placeholder:r,maxLength:n,rows:a,...s})}function re({label:e,hint:t,children:r,className:n="",htmlFor:a}){return i.jsxs("div",{className:`ca-form-field ${n}`.trim(),children:[e!=null?i.jsx(Mt,{htmlFor:a,hint:t,children:e}):null,r]})}function _r({label:e,hint:t,...r}){return i.jsx(re,{label:e,hint:t,htmlFor:r.id,children:i.jsx(te,{...r})})}function Gc({label:e,hint:t,suffix:r,...n}){return i.jsx(re,{label:e,hint:t,htmlFor:n.id,children:i.jsxs("div",{className:"input-with-suffix",children:[i.jsx(te,{...n}),r&&i.jsx("div",{className:"input-suffix",children:r})]})})}function Sr({label:e,hint:t,...r}){return i.jsx(re,{label:e,hint:t,htmlFor:r.id,children:i.jsx(J,{...r})})}function $a({label:e,hint:t,maxLength:r,value:n="",...a}){const o=t??(r!=null?`${String(n).length}/${r}`:void 0);return i.jsx(re,{label:e,hint:o,htmlFor:a.id,children:i.jsx(Ua,{value:n,maxLength:r,...a})})}function Er({checked:e=!1,onChange:t,disabled:r=!1,"aria-label":n="Toggle",className:a=""}){return i.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":n,disabled:r,className:`ca-toggle ${e?"ca-toggle--on":""} ${a}`.trim(),onClick:()=>t?.(!e),children:i.jsx("span",{className:"ca-toggle__thumb"})})}function ja({label:e="Active",checked:t,onChange:r,className:n=""}){return i.jsxs("div",{className:`ca-toggle-field ${n}`.trim(),children:[i.jsx(ua,{children:e}),i.jsx(Er,{checked:t,onChange:r,"aria-label":e})]})}function Va({size:e=12,color:t="currentColor",...r}){return i.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...r,children:i.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:t,strokeWidth:"2",strokeLinecap:"round"})})}function Ha({label:e,onRemove:t,className:r=""}){return i.jsxs("span",{className:`ca-tag ${r}`.trim(),children:[e,t?i.jsx("button",{type:"button",className:"ca-tag__remove",onClick:t,"aria-label":`Remove ${e}`,children:i.jsx(Va,{size:10})}):null]})}function Wa({label:e="Select Roles",options:t=[],value:r=[],onChange:n,placeholder:a="Select roles",className:o=""}){const[s,l]=L.useState(""),c=t.filter(f=>{const h=typeof f=="string"?f:f.value;return!r.includes(h)}),d=f=>{const h=f.target.value;h&&(n?.([...r,h]),l(""))},u=f=>{n?.(r.filter(h=>h!==f))};return i.jsxs("div",{className:`ca-role-select ${o}`.trim(),children:[i.jsx(Mt,{children:e}),i.jsx(J,{value:s,onChange:d,options:c,placeholder:a}),r.length>0?i.jsx("div",{className:"ca-tag-list",children:r.map(f=>i.jsx(Ha,{label:f,onRemove:()=>u(f)},f))}):null]})}function He({steps:e=[],currentStep:t=1,onStepClick:r,className:n="",size:a="md",showSaveButton:o=!1,showNextButton:s=!1,onSaveDraft:l,onNext:c,saveLabel:d="Save Draft",nextLabel:u="Next >"}){return i.jsxs("div",{className:`ca-stepper-wrap ca-stepper-wrap--${a} ${n}`.trim(),children:[i.jsx("nav",{className:`ca-stepper ca-stepper--${a}`,"aria-label":"Progress",children:e.map((f,h)=>{const v=f.id??h+1,_=v===t,S=v<t,b=!!r&&(S||_);return i.jsxs(L.Fragment,{children:[h>0?i.jsx("div",{className:"ca-stepper__line"}):null,i.jsxs("button",{type:"button",className:["ca-stepper__item",_?"ca-stepper__item--active":"",S?"ca-stepper__item--done":""].filter(Boolean).join(" "),onClick:()=>b&&r?.(v),disabled:!b,"aria-current":_?"step":void 0,children:[i.jsxs("span",{className:"ca-stepper__circle",children:[v,"."]}),i.jsx("span",{className:"ca-stepper__label",children:f.label})]})]},v)})}),o||s?i.jsxs("div",{className:"ca-stepper__actions",children:[o?i.jsx(R,{variant:"outline",onClick:l,children:d}):null,s?i.jsx(R,{onClick:c,children:u}):null]}):null]})}function Xc({stepMeta:e,stepperProps:t}){const{state:r,update:n}=je();return i.jsxs(i.Fragment,{children:[i.jsx(He,{...t,steps:K}),i.jsxs(Ve,{title:e.title,description:e.description,showNext:!1,children:[i.jsx("div",{className:"ca-category-type__status",children:i.jsx(ja,{checked:r.active,onChange:a=>n({active:a})})}),i.jsxs("div",{className:"ca-step-section",children:[i.jsxs("div",{className:"ca-step-row ca-step-row--category-fields",children:[i.jsx(_r,{label:"Category Name",className:"ca-step-row__grow",value:r.categoryName,onChange:a=>n({categoryName:a.target.value}),placeholder:"Enter category name"}),i.jsx(Gc,{label:"TAT Minutes",suffix:"minutes",type:"number",min:"0",value:r.tatMinutes,onChange:a=>n({tatMinutes:a.target.value}),placeholder:"Enter here"})]}),i.jsx("div",{className:"ca-step-row",children:i.jsx(Sr,{label:"Select Template",className:"ca-step-row__grow",value:r.template||r.categoryType,onChange:a=>n({template:a.target.value,categoryType:a.target.value}),options:Da,placeholder:"Select template"})}),i.jsx("div",{className:"ca-step-section",children:i.jsx($a,{label:"Description",placeholder:"Enter description",maxLength:500,value:r.description,onChange:a=>n({description:a.target.value}),rows:5})}),i.jsxs("div",{className:"ca-step-row",children:[i.jsx(Sr,{label:"Select Visibility Type",className:"ca-step-row__grow",value:r.visibilityType,onChange:a=>n({visibilityType:a.target.value}),options:[{value:"public",label:"Public"},{value:"private",label:"Private"},{value:"restricted",label:"Restricted"}],placeholder:"Select visibility type"}),i.jsx(_r,{label:null,className:"ca-step-row__grow ca-category-type__url-link",value:r.urlLink,onChange:a=>n({urlLink:a.target.value}),placeholder:"urllink"})]})]}),i.jsx("div",{className:"ca-step-section ca-step-section--last",children:i.jsx(Wa,{label:"Select Roles for Complaint Filling",options:Jc,value:r.roles,onChange:a=>n({roles:a})})})]})]})}function qa({children:e,onClick:t,className:r="",active:n=!1}){return i.jsx("button",{type:"button",className:`ca-chip ${n?"ca-chip--active":""} ${r}`.trim(),onClick:t,children:e})}function za({checked:e=!1,onChange:t,name:r,value:n,"aria-label":a,className:o=""}){return i.jsxs("label",{className:`ca-radio ${o}`.trim(),children:[i.jsx("input",{type:"radio",className:"ca-radio__input",name:r,value:n,checked:e,onChange:t,"aria-label":a}),i.jsx("span",{className:"ca-radio__mark"})]})}function Nr({size:e=16,color:t="#9CA3AF",...r}){return i.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...r,children:[i.jsx("circle",{cx:"5",cy:"4",r:"1.2",fill:t}),i.jsx("circle",{cx:"11",cy:"4",r:"1.2",fill:t}),i.jsx("circle",{cx:"5",cy:"8",r:"1.2",fill:t}),i.jsx("circle",{cx:"11",cy:"8",r:"1.2",fill:t}),i.jsx("circle",{cx:"5",cy:"12",r:"1.2",fill:t}),i.jsx("circle",{cx:"11",cy:"12",r:"1.2",fill:t})]})}function Ra(e){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,name:e,color:""}}function Qc({stepMeta:e,stepperProps:t}){const{state:r,update:n}=je(),{priorityDraft:a,priorities:o,defaultPriorityId:s}=r,l=u=>{const f=(u??a).trim();if(!f)return;if(o.some(v=>v.name.toLowerCase()===f.toLowerCase())){n({priorityDraft:""});return}const h=[...o,Ra(f)];n({priorities:h,priorityDraft:"",defaultPriorityId:s??h[0].id})},c=(u,f)=>{n({priorities:o.map(h=>h.id===u?{...h,...f}:h)})},d=Zc.map(u=>({value:u.value,label:u.label}));return i.jsxs(i.Fragment,{children:[i.jsx(He,{...t,steps:K}),i.jsxs(Ve,{title:e.title,description:e.description,showNext:!1,children:[i.jsxs("div",{className:"ca-priority-add",children:[i.jsx(Mt,{children:"Priorities"}),i.jsxs("div",{className:"ca-priority-add__row",children:[i.jsx(te,{value:a,onChange:u=>n({priorityDraft:u.target.value}),placeholder:"Add priority",onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),l())}}),i.jsx(R,{variant:"outline",onClick:()=>l(),children:"+ Add"})]}),i.jsx("div",{className:"ca-chip-row",children:Kc.map(u=>i.jsxs(qa,{onClick:()=>l(u),children:["+ ",u]},u))})]}),i.jsxs("div",{className:"ca-priority-table",children:[i.jsxs("div",{className:"ca-priority-table__head",children:[i.jsx("div",{children:"Priority"}),i.jsx("div",{children:"Color"}),i.jsx("div",{children:"Default"})]}),(o.length?o:[Ra("")]).map((u,f)=>{const h=!o.length;return i.jsxs("div",{className:"ca-priority-table__row",children:[i.jsxs("div",{className:"ca-priority-table__name",children:[i.jsx(Nr,{}),i.jsx(te,{value:h?a:u.name,onChange:v=>{h?n({priorityDraft:v.target.value}):c(u.id,{name:v.target.value})},placeholder:"Add priority"})]}),i.jsx(J,{value:u.color,onChange:v=>{h||c(u.id,{color:v.target.value})},options:d,placeholder:"Select color"}),i.jsx(za,{name:"default-priority",value:u.id,checked:!h&&s===u.id,onChange:()=>!h&&n({defaultPriorityId:u.id}),"aria-label":"Default priority"})]},u.id||f)})]})]})]})}function Ka({level:e,onAdd:t}){const[r,n]=L.useState(""),a=o=>{o.preventDefault();const s=r.trim();s&&(t?.(s),n(""))};return i.jsxs("form",{className:"ca-add-table-card",onSubmit:a,children:[i.jsxs("span",{className:"ca-add-table-card__level",children:["L",e]}),i.jsxs("label",{className:"ca-add-table-card__label",htmlFor:`add-workflow-level-${e}`,children:["Name Level ",e]}),i.jsx(te,{id:`add-workflow-level-${e}`,value:r,placeholder:`Enter name for L${e}`,onChange:o=>n(o.target.value)}),i.jsxs(R,{type:"submit",className:"ca-add-table-card__button",disabled:!r.trim(),children:["+ Add L",e]})]})}const Yc=["Store Staff","Manager","Supervisor","Admin"],Lr=["Yes","No"];function Ja({name:e,level:t,value:r,onChange:n}){const a=r??{},o=(c,d)=>n?.({...a,[c]:d}),s=t===1?"green":t===2?"orange":"blue",l=c=>`workflow-level-${t}-${c}`;return i.jsxs("article",{className:`ca-table-card ca-table-card--${s}`,children:[i.jsxs("header",{className:"ca-table-card__header",children:[i.jsxs("span",{className:"ca-table-card__level",children:["L",t]}),i.jsxs("div",{children:[i.jsx("h3",{className:"ca-table-card__title",children:e}),i.jsx("p",{className:"ca-table-card__subtitle",children:"Initial Handler"})]})]}),i.jsx("div",{className:"ca-table-card__divider"}),i.jsxs("div",{className:"ca-table-card__fields",children:[i.jsx(re,{label:"Select Role",htmlFor:l("role"),children:i.jsx(J,{id:l("role"),value:a.role,options:Yc,placeholder:"Select role",onChange:c=>o("role",c.target.value)})}),i.jsx(re,{label:"Can Resolve",htmlFor:l("canResolve"),children:i.jsx(J,{id:l("canResolve"),value:a.canResolve,options:Lr,onChange:c=>o("canResolve",c.target.value)})}),i.jsx(re,{label:"Can Reassign",htmlFor:l("canReassign"),children:i.jsx(J,{id:l("canReassign"),value:a.canReassign,options:Lr,onChange:c=>o("canReassign",c.target.value)})}),i.jsx(re,{label:"Final Level",htmlFor:l("finalLevel"),children:i.jsx(J,{id:l("finalLevel"),value:a.finalLevel,options:Lr,onChange:c=>o("finalLevel",c.target.value)})}),i.jsx(re,{label:"Escalation time",htmlFor:l("escalationTime"),children:i.jsxs("div",{className:"ca-table-card__time-input",children:[i.jsx(te,{id:l("escalationTime"),type:"number",min:"0",value:a.escalationTime??"",placeholder:"--",onChange:c=>o("escalationTime",c.target.value)}),i.jsx("span",{children:"minutes"})]})})]})]})}const ed="data:image/svg+xml,%3csvg%20width='31'%20height='57'%20viewBox='0%200%2031%2057'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.50001%200.000227733C0.223869%200.000226605%209.85899e-06%200.224084%208.79418e-06%200.500226C7.72665e-06%200.776369%200.223865%201.00023%200.500009%201.00023L0.50001%200.500227L0.50001%200.000227733ZM15%200.500275L15%201.00028L15%200.500275ZM27%2012.5003L27.5%2012.5003L27%2012.5003ZM26.6464%2056.8527C26.8417%2057.048%2027.1582%2057.048%2027.3535%2056.8527L30.5355%2053.6707C30.7307%2053.4755%2030.7307%2053.1589%2030.5355%2052.9636C30.3402%2052.7683%2030.0236%2052.7683%2029.8284%2052.9636L26.9999%2055.792L24.1715%2052.9636C23.9763%2052.7683%2023.6597%2052.7683%2023.4644%2052.9636C23.2692%2053.1589%2023.2692%2053.4754%2023.4644%2053.6707L26.6464%2056.8527ZM0.50001%200.500227L0.500009%201.00023L15%201.00028L15%200.500275L15%200.000275583L0.50001%200.000227733L0.50001%200.500227ZM27%2012.5003L26.5%2012.5003L26.4999%2056.4991L26.9999%2056.4991L27.4999%2056.4991L27.5%2012.5003L27%2012.5003ZM15%200.500275L15%201.00028C21.3513%201.0003%2026.5%206.14903%2026.5%2012.5003L27%2012.5003L27.5%2012.5003C27.5%205.59674%2021.9036%200.000298399%2015%200.000275583L15%200.500275Z'%20fill='%2300BF87'/%3e%3c/svg%3e",td="data:image/svg+xml,%3csvg%20width='28'%20height='61'%20viewBox='0%200%2028%2061'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M27.0053%2057.2042C27.2006%2057.009%2027.2006%2056.6924%2027.0053%2056.4971L23.8233%2053.3152C23.6281%2053.1199%2023.3115%2053.1199%2023.1162%2053.3152C22.921%2053.5104%2022.921%2053.827%2023.1162%2054.0223L25.9447%2056.8507L23.1163%2059.6791C22.921%2059.8744%2022.921%2060.191%2023.1163%2060.3862C23.3115%2060.5815%2023.6281%2060.5815%2023.8234%2060.3862L27.0053%2057.2042ZM12.5001%2056.8508L12.5001%2057.3508V57.3508L12.5001%2056.8508ZM0.500014%2044.8508L1.33317e-05%2044.8508V44.8508L0.500014%2044.8508ZM26.6518%2056.8507L26.6518%2056.3507L12.5001%2056.3508L12.5001%2056.8508L12.5001%2057.3508L26.6518%2057.3507L26.6518%2056.8507ZM0.500014%2044.8508L1.00001%2044.8508L1.00001%20-0.000388027L0.50001%20-0.000388722L9.54624e-06%20-0.000389416L1.33317e-05%2044.8508L0.500014%2044.8508ZM12.5001%2056.8508L12.5001%2056.3508C6.14877%2056.3508%201.00001%2051.2021%201.00001%2044.8508L0.500014%2044.8508L1.33317e-05%2044.8508C1.43871e-05%2051.7544%205.59649%2057.3508%2012.5001%2057.3508L12.5001%2056.8508Z'%20fill='%23FF9E32'/%3e%3c/svg%3e",rd="data:image/svg+xml,%3csvg%20width='57'%20height='31'%20viewBox='0%200%2057%2031'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M56.9989%200.500133C56.9989%200.223991%2056.7751%200.000131942%2056.4989%200.00013087C56.2228%200.000129795%2055.9989%200.223987%2055.9989%200.500131L56.4989%200.500132L56.9989%200.500133ZM56.4989%2015.0002L55.9989%2015.0002L56.4989%2015.0002ZM44.4989%2027.0001L44.4988%2027.5001L44.4989%2027.0001ZM0.146456%2026.6465C-0.0488074%2026.8418%20-0.0488086%2027.1584%200.146455%2027.3536L3.32843%2030.5356C3.52369%2030.7309%203.84027%2030.7309%204.03554%2030.5356C4.2308%2030.3403%204.2308%2030.0238%204.03554%2029.8285L1.20712%2027.0001L4.03555%2024.1716C4.23081%2023.9764%204.23081%2023.6598%204.03555%2023.4645C3.84029%2023.2693%203.5237%2023.2693%203.32844%2023.4645L0.146456%2026.6465ZM56.4989%200.500132L55.9989%200.500131L55.9989%2015.0002L56.4989%2015.0002L56.9989%2015.0002L56.9989%200.500133L56.4989%200.500132ZM44.4989%2027.0001L44.4989%2026.5001L0.500009%2026.5001L0.500008%2027.0001L0.500007%2027.5001L44.4988%2027.5001L44.4989%2027.0001ZM56.4989%2015.0002L55.9989%2015.0002C55.9988%2021.3514%2050.8501%2026.5001%2044.4989%2026.5001L44.4989%2027.0001L44.4988%2027.5001C51.4024%2027.5001%2056.9988%2021.9037%2056.9989%2015.0002L56.4989%2015.0002Z'%20fill='%2300BF87'/%3e%3c/svg%3e",nd="data:image/svg+xml,%3csvg%20width='61'%20height='28'%20viewBox='0%200%2061%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.32848%2027.0049C3.52374%2027.2002%203.84032%2027.2002%204.03559%2027.0049L7.21755%2023.8229C7.41281%2023.6277%207.4128%2023.3111%207.21754%2023.1158C7.02228%2022.9206%206.70569%2022.9206%206.51043%2023.1158L3.68203%2025.9443L0.85358%2023.1159C0.658316%2022.9206%200.341733%2022.9206%200.146472%2023.1159C-0.0487878%2023.3111%20-0.0487864%2023.6277%200.146478%2023.823L3.32848%2027.0049ZM3.68194%2012.4997L3.18194%2012.4997V12.4997L3.68194%2012.4997ZM15.6819%200.499617L15.6819%20-0.000382774V-0.000382774L15.6819%200.499617ZM3.68203%2026.6514L4.18203%2026.6514L4.18194%2012.4997L3.68194%2012.4997L3.18194%2012.4997L3.18203%2026.6514L3.68203%2026.6514ZM15.6819%200.499617L15.6819%200.999618L60.5331%200.999616L60.5331%200.499615L60.5331%20-0.000385315L15.6819%20-0.000382774L15.6819%200.499617ZM3.68194%2012.4997L4.18194%2012.4997C4.1819%206.14838%209.33063%200.999618%2015.6819%200.999618L15.6819%200.499617L15.6819%20-0.000382774C8.77834%20-0.00038191%203.18189%205.5961%203.18194%2012.4997L3.68194%2012.4997Z'%20fill='%23FF9E32'/%3e%3c/svg%3e",Or=(e,t)=>({id:e,name:t,role:"",canResolve:"",canReassign:"",finalLevel:"",escalationTime:""});function ad({accent:e}){return i.jsxs("div",{className:`ca-escalation-connector ca-escalation-connector--desktop ca-escalation-connector--${e}`,"aria-hidden":"true",children:[i.jsx("img",{src:ed,alt:"",className:"ca-escalation-connector__arrow ca-escalation-connector__arrow--first"}),i.jsx("span",{children:"Escalates to"}),i.jsx("img",{src:td,alt:"",className:"ca-escalation-connector__arrow ca-escalation-connector__arrow--second"})]})}function od({accent:e}){return i.jsxs("div",{className:`ca-escalation-connector ca-escalation-connector--mobile ca-escalation-connector--${e}`,"aria-hidden":"true",children:[i.jsx("img",{src:rd,alt:"",className:"ca-escalation-connector__arrow ca-escalation-connector__arrow--first"}),i.jsx("span",{children:"Escalates to"}),i.jsx("img",{src:nd,alt:"",className:"ca-escalation-connector__arrow ca-escalation-connector__arrow--second"})]})}function Za({initialTables:e,onChange:t}){const[r,n]=L.useState(()=>e?.length?e:[Or(1,"Level 1 - First Response"),Or(2,"Level 2 - Secondary")]),a=l=>{n(l),t?.(l)},o=(l,c)=>a(r.map(d=>d.id===l?{...d,...c}:d)),s=l=>{const c=r.reduce((d,u)=>Math.max(d,Number(u.id)||0),0)+1;a([...r,Or(c,l)])};return i.jsx("div",{className:"ca-table-card-grid","aria-label":"Escalation levels",children:i.jsxs("div",{className:"ca-table-card-grid__track",children:[r.map((l,c)=>i.jsxs(L.Fragment,{children:[i.jsx(Ja,{name:l.name,level:c+1,value:l,onChange:d=>o(l.id,d)}),c<r.length-0?i.jsxs(i.Fragment,{children:[i.jsx(ad,{accent:c===0?"green":c===1?"orange":"purple"}),i.jsx(od,{accent:c===0?"green":c===1?"orange":"purple"})]}):null]},l.id)),i.jsx(Ka,{level:r.length+1,onAdd:s})]})})}function Ga({onNext:e,stepMeta:t,stepperProps:r}){const{state:n,update:a,updateWorkflow:o}=je(),{selectedDeptNode:s,workflow:l}=n;return i.jsxs(i.Fragment,{children:[i.jsx(He,{...r,steps:K}),i.jsx(Ve,{title:t.title,description:t.description,showNext:!1,children:i.jsx("div",{className:"ca-workflow__main",children:i.jsx(Za,{initialTables:l.steps,onChange:c=>o({steps:c})})})})]})}function Xa({onAdd:e}){return i.jsx("button",{type:"button",className:"ca-add-form-button",onClick:e,children:"+ Add Form Fields"})}function Qa({size:e=16,color:t="#9CA3AF",...r}){return i.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...r,children:i.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 sd=["Custom","Text","Number","Date","Dropdown","Checkbox","Radio"],Tr=["All","Admin","Manager","Staff"],id=["Level 1","Level 2","Level 3"];function Ya({field:e,fieldOptions:t=[],onChange:r,onDelete:n}){const[a,o]=L.useState(""),s=d=>r?.({...e,...d}),l=()=>{const d=a.trim();!d||e.options?.includes(d)||(s({options:[...e.options||[],d]}),o(""))},c=d=>s({options:e.options.filter(u=>u!==d)});return i.jsxs("article",{className:"ca-form-card",children:[i.jsxs("div",{className:"ca-form-card__row ca-form-card__row--order",children:[i.jsx(Nr,{size:15,color:"#111827"}),i.jsx("button",{type:"button",className:"ca-icon-btn ca-form-card__delete","aria-label":"Delete form field",onClick:()=>n?.(e.id),children:i.jsx(Qa,{size:15})})]}),i.jsx("div",{className:"ca-form-card__row",children:i.jsx(te,{value:e.fieldLabel,placeholder:"Enter field label",onChange:d=>s({fieldLabel:d.target.value})})}),i.jsx("div",{className:"ca-form-card__row",children:i.jsx(J,{value:e.fieldType,options:sd,placeholder:"Select type",onChange:d=>s({fieldType:d.target.value})})}),i.jsx("div",{className:"ca-form-card__row ca-form-card__row--toggle",children:i.jsx(Er,{checked:!!e.required,onChange:d=>s({required:d}),"aria-label":"Required"})}),i.jsx("div",{className:"ca-form-card__row",children:i.jsx(J,{value:e.fieldAccess,options:e.fieldAccess&&!Tr.includes(e.fieldAccess)?[e.fieldAccess,...Tr]:Tr,placeholder:"Select access",onChange:d=>s({fieldAccess:d.target.value})})}),i.jsxs("div",{className:"ca-form-card__row",children:[i.jsx(J,{value:"",options:id.filter(d=>!e.hideFor?.includes(d)),placeholder:"Select level",onChange:d=>s({hideFor:[...e.hideFor||[],d.target.value]})}),e.hideFor?.length?i.jsx("div",{className:"ca-form-card__chips",children:e.hideFor.map(d=>i.jsxs("span",{className:"ca-form-card__chip",children:[d,i.jsx("button",{type:"button","aria-label":`Remove ${d}`,onClick:()=>s({hideFor:e.hideFor.filter(u=>u!==d)}),children:"×"})]},d))}):null]}),i.jsx("div",{className:"ca-form-card__row",children:i.jsx(J,{value:e.dependsOn,options:t,placeholder:"Select field label",onChange:d=>s({dependsOn:d.target.value})})}),i.jsxs("div",{className:"ca-form-card__row ca-form-card__row--options",children:[i.jsxs("div",{className:"ca-form-card__option-entry",children:[i.jsx(te,{value:a,placeholder:"Enter option",onChange:d=>o(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),l())}}),i.jsx("button",{type:"button",className:"ca-form-card__add-option","aria-label":"Add option",onClick:l,children:"+"})]}),i.jsx("div",{className:"ca-form-card__chips",children:(e.options||[]).map(d=>i.jsxs("span",{className:"ca-form-card__chip",children:[d,i.jsx("button",{type:"button","aria-label":`Remove ${d}`,onClick:()=>c(d),children:"×"})]},d))})]})]})}function ld({formFields:e=[],onChange:t}){const r=e.find(u=>u.fieldLabel==="Sub-department"),n=e.find(u=>u.fieldLabel==="Department"),a=r?.options||["payrool ","recruitment"],o=n?.options||["hr","finance"],[s,l]=L.useState({});L.useEffect(()=>{const u=new Set(a);l(f=>Object.fromEntries(Object.entries(f).filter(([h])=>u.has(h))))},[a]);const c=(u,f)=>{l(h=>({...h,[u]:f}))},d=u=>{if(!r)return;const f=e.map(h=>h!==r?h:{...h,options:h.options.filter(v=>v!==u)});l(h=>{const v={...h};return delete v[u],v}),t?.(f)};return i.jsxs("aside",{className:"subdepartment-parent","aria-labelledby":"subdepartment-parent-title",children:[i.jsxs("h2",{id:"subdepartment-parent-title",className:"subdepartment-parent__title",children:["Options for: ",r?.fieldLabel||"Sub-department"]}),i.jsx("p",{className:"subdepartment-parent__description",children:"Define options and set parent."}),a.length?i.jsx("div",{className:"subdepartment-parent__table-wrap",children:i.jsxs("table",{className:"subdepartment-parent__table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",children:"Option label"}),i.jsx("th",{scope:"col",children:"Parent"}),i.jsx("th",{scope:"col","aria-label":"Delete"})]})}),i.jsx("tbody",{children:a.map(u=>i.jsxs("tr",{children:[i.jsx("td",{children:u}),i.jsx("td",{children:i.jsxs("select",{"aria-label":`Parent for ${u}`,value:s[u]||"",disabled:!o.length,onChange:f=>c(u,f.target.value),children:[i.jsx("option",{value:"",children:o.length?"Select parent":"No department options"}),o.map(f=>i.jsx("option",{value:f,children:f},f))]})}),i.jsx("td",{children:i.jsx("button",{className:"subdepartment-parent__delete",type:"button","aria-label":`Delete ${u}`,title:`Delete ${u}`,onClick:()=>d(u),children:i.jsx(jc,{size:14,strokeWidth:1.5,"aria-hidden":"true"})})})]},u))})]})}):i.jsx("p",{className:"subdepartment-parent__empty",children:"No sub-department options added."})]})}const cd=["Order","Field Label","Field Type","Required","Field Access","Hide for","DependsOn","Options"],dd=[{id:1,order:1,fieldLabel:"Department",fieldType:"Custom",required:!1,fieldAccess:"",hideFor:["Level 1","Level 2"],dependsOn:"",options:["Low","High"]},{id:2,order:2,fieldLabel:"Sub-department",fieldType:"Custom",required:!1,fieldAccess:"",hideFor:[],dependsOn:"Department",options:["Payroll","Recruitment"]}];function Ar(e,t){return{id:e.id??`${Date.now()}-${t}`,order:t+1,fieldLabel:e.fieldLabel??e.name??"",fieldType:e.fieldType??e.typeLabel??"Custom",required:!!e.required,fieldAccess:e.fieldAccess??"",hideFor:e.hideFor??[],dependsOn:e.dependsOn??"",options:e.options??[]}}function eo({initialFields:e,onChange:t,fieldToAdd:r}){const[n,a]=L.useState(()=>(e?.length?e:dd).map(Ar)),o=u=>{a(u),t?.(u)};L.useEffect(()=>{r&&a(u=>{const f=[...u,Ar({...r,id:`${r.id}-${Date.now()}`},u.length)];return t?.(f),f})},[r,t]);const s=u=>o(n.map(f=>f.id===u.id?u:f)),l=u=>o(n.filter(f=>f.id!==u).map((f,h)=>({...f,order:h+1}))),c=()=>o([...n,Ar({id:`${Date.now()}-${n.length}`,fieldLabel:"",fieldType:"Custom",options:[]},n.length)]),d=n.map(u=>u.fieldLabel).filter(Boolean);return i.jsxs("div",{className:"ca-form-card-grid__container ",children:[i.jsxs("div",{className:"ca-form-card-grid",children:[i.jsx("div",{className:"ca-form-card-grid__labels",children:cd.map(u=>i.jsx("div",{className:"ca-form-card-grid__label",children:u},u))}),i.jsxs("div",{className:"ca-form-card-grid__cards",children:[n.map(u=>i.jsx(Ya,{field:u,fieldOptions:d.filter(f=>f!==u.fieldLabel),onChange:s,onDelete:l},u.id)),i.jsx(Xa,{onAdd:c})]})]}),i.jsx(ld,{formFields:n})]})}const ud=[{id:"department",label:"Department",fieldLabel:"Department - Finance",fieldType:"Custom",required:!1,fieldAccess:"Select access",hideFor:[],dependsOn:"",options:["Payroll","Recruitment","Hardware"]},{id:"priorities",label:"Priorities",fieldLabel:"Priorities",fieldType:"Custom",required:!1,fieldAccess:"Select access",hideFor:[],dependsOn:"",options:["Low","Medium","High"]},{id:"statuses",label:"Statuses",fieldLabel:"Statuses",fieldType:"Custom",required:!1,fieldAccess:"Select access",hideFor:[],dependsOn:"",options:["Open","In Progress","Closed"]},{id:"storeId",label:"Store ID",fieldLabel:"Store ID",fieldType:"Custom",required:!1,fieldAccess:"Select access",hideFor:[],dependsOn:"",options:["Store 101","Store 102","Store 103"]}],fd={department:kc,priorities:Mc,statuses:Dc,storeId:$c};function pd({onAddField:e}){return i.jsxs("aside",{className:"custom-field-table","aria-labelledby":"custom-field-table-title",children:[i.jsx("h2",{id:"custom-field-table-title",className:"custom-field-table__title",children:"Custom Fields"}),i.jsx("p",{className:"custom-field-table__description",children:"Use these fields to show options from database table."}),i.jsx("div",{className:"custom-field-table__list",children:ud.map(t=>{const r=fd[t.id];return i.jsxs("div",{className:"custom-field-table__row",children:[i.jsx(r,{className:"custom-field-table__field-icon",size:14,strokeWidth:1.5,"aria-hidden":"true"}),i.jsx("span",{className:"custom-field-table__label",children:t.label}),i.jsx("button",{className:"custom-field-table__add",type:"button","aria-label":`Add ${t.label}`,title:`Add ${t.label}`,onClick:()=>e?.(t),children:i.jsx(ya,{size:14,strokeWidth:2,"aria-hidden":"true"})})]},t.id)})})]})}function hd({stepMeta:e,stepperProps:t}){const{state:r,update:n}=je(),{formFields:a}=r,[o,s]=L.useState(null),l=L.useCallback(c=>n({formFields:c}),[n]);return i.jsxs(i.Fragment,{children:[i.jsx(He,{...t,steps:K}),i.jsx(Ve,{title:e.title,description:e.description,showNext:!1,children:i.jsxs("div",{className:"ca-form-fields",children:[i.jsx(pd,{onAddField:c=>s({...c})}),i.jsx(eo,{initialFields:a,fieldToAdd:o,onChange:l})]})})]})}const md=[{order:4,fieldLabel:"Email",fieldType:"string",required:!1,fieldAccess:"editable",hideFor:[],dependsOn:"",options:[]},{order:1,fieldLabel:"Name",fieldType:"string",required:!0,fieldAccess:"editable",hideFor:[],dependsOn:"",options:[]},{order:6,fieldLabel:"Checkbox Selector",fieldType:"checkbox",required:!1,fieldAccess:"editable",hideFor:[],dependsOn:"",options:["Checkbox1","Checkbox2","Checkbox3"]},{order:2,fieldLabel:"Date of Birth",fieldType:"date",required:!0,fieldAccess:"editable",hideFor:[],dependsOn:"",options:[]},{order:7,fieldLabel:"Enter Complaint",fieldType:"string",required:!0,fieldAccess:"editable",hideFor:[],dependsOn:"",options:[]},{order:3,fieldLabel:"Gender",fieldType:"radio",required:!1,fieldAccess:"editable",hideFor:[],dependsOn:"",options:["Male","Female","Other"]},{order:5,fieldLabel:"Select Complaint Type",fieldType:"select",required:!1,fieldAccess:"editable",hideFor:[],dependsOn:"",options:["Complaint","Feedback","Suggestion"]}];function Fr(e){return`review-${e.order}-${e.fieldLabel.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}`}function to(e){return e.fieldLabel.toLowerCase().includes("complaint")}function gd(){const[e,t]=L.useState({}),r=[...md].sort((o,s)=>o.order-s.order),n=(o,s)=>{t(l=>({...l,[o.fieldLabel]:s}))},a=o=>{const s=Fr(o),l=e[o.fieldLabel]||"",c={id:s,name:o.fieldLabel,required:o.required,disabled:o.fieldAccess==="read-only"};switch(o.fieldType){case"date":return i.jsx("input",{...c,className:"review-control",type:"date",value:l,onChange:d=>n(o,d.target.value)});case"select":case"dropdown":return i.jsxs("select",{...c,className:"review-control",value:l,onChange:d=>n(o,d.target.value),children:[i.jsxs("option",{value:"",children:["Select ",o.fieldLabel.toLowerCase()]}),o.options.map(d=>i.jsx("option",{value:d,children:d},d))]});case"radio":return i.jsx("div",{className:"review-options review-options--inline",children:o.options.map((d,u)=>{const f=u===0?s:`${s}-${d.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return i.jsxs("label",{className:"review-option",htmlFor:f,children:[i.jsx("input",{...c,id:f,type:"radio",value:d,checked:l===d,onChange:h=>n(o,h.target.value)}),i.jsx("span",{children:d})]},d)})});case"checkbox":return i.jsx("div",{className:"review-options review-options--inline",children:o.options.map((d,u)=>{const f=u===0?s:`${s}-${d.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,h=e[o.fieldLabel]||[];return i.jsxs("label",{className:"review-option",htmlFor:f,children:[i.jsx("input",{...c,id:f,name:`${o.fieldLabel}[]`,type:"checkbox",value:d,checked:h.includes(d),onChange:v=>{const _=v.target.checked?[...h,d]:h.filter(S=>S!==d);n(o,_)}}),i.jsx("span",{children:d})]},d)})});default:return to(o)?i.jsx("textarea",{...c,className:"review-control review-control--textarea",value:l,placeholder:"Enter your complaint here...",onChange:d=>n(o,d.target.value)}):i.jsx("input",{...c,className:"review-control",type:"text",value:l,placeholder:`Enter ${o.fieldLabel.toLowerCase()}`,onChange:d=>n(o,d.target.value)})}};return i.jsx("div",{className:"review-form","aria-label":"Complaint review form",children:i.jsx("div",{className:"review-form-grid",children:r.map(o=>i.jsxs("div",{className:`review-question${to(o)?" review-question--wide":""}`,children:[i.jsxs("label",{className:"review-label",htmlFor:Fr(o),children:[o.fieldLabel,o.required?i.jsx("span",{className:"review-required",children:"*"}):null]}),a(o)]},Fr(o)))})})}function yd({onPublish:e,stepMeta:t,stepperProps:r}){const{state:n}=je();return Da.find(a=>a.value===n.categoryType)?.label||n.categoryType,i.jsxs(i.Fragment,{children:[i.jsx(He,{...r,steps:K}),i.jsx(Ve,{title:t.title,description:t.description,showNext:!1,children:i.jsxs("div",{className:"ca-review",children:[i.jsxs("section",{className:"ca-review__block ca-review__block--last",children:[i.jsx(Bt,{children:"Form Fields"}),i.jsx(gd,{})]}),i.jsx("div",{className:"ca-workflow__actions",children:i.jsx(R,{onClick:e,children:"Publish"})})]})})]})}function bd(e){const t=Number(e);return!Number.isFinite(t)||t<1?1:t>K.length?K.length:Math.floor(t)}function vd(e){const t=Number(e);return!Number.isFinite(t)||t<1?1:t>3?3:Math.floor(t)}function ro({title:e="Complaint Management Settings",onPublish:t,onStepChange:r,onSaveDraft:n,showSaveButton:a=!0,showNextButton:o=!0}){const s=Ze(),{systemId:l}=Wo(),[c,d]=Ts(),u=bd(c.get("step")||1),f=vd(c.get("substep")||1);L.useEffect(()=>{if(!c.get("step")){const y=new URLSearchParams(c);y.set("step","1"),d(y,{replace:!0})}},[c,d]);const h=L.useMemo(()=>K.find(y=>y.id===u)||K[0],[u]),v=L.useCallback((y,C)=>{const N=new URLSearchParams(c);N.set("step",String(y)),y===4?N.set("substep",String(C??(y===u?f:1))):N.delete("substep"),d(N,{replace:!1}),r?.({systemId:l,step:y,substep:C})},[c,d,r,l,u,f]),_=()=>{u<K.length&&v(u+1,1)},S=y=>{v(4,y)},b=()=>{t?.({systemId:l,step:u})},m={currentStep:u,onStepClick:y=>v(y,y===4?1:void 0),showSaveButton:a,showNextButton:o&&u<K.length,onSaveDraft:()=>n?.({systemId:l,step:u}),onNext:_,className:"ca-settings-page__stepper"};return i.jsx(ka,{children:i.jsxs("div",{className:"ca-settings-page",children:[i.jsx(vr,{children:e}),u===1?i.jsx(Xc,{stepMeta:h,stepperProps:m}):null,u===2?i.jsx(Ga,{onNext:_,stepMeta:h,substep:f,onSubstepChange:S,stepperProps:m}):null,u===5?i.jsx(Qc,{stepMeta:h,stepperProps:m}):null,u===7?i.jsx(Ga,{onNext:_,stepMeta:h,substep:f,onSubstepChange:S,stepperProps:m}):null,u===3?i.jsx(hd,{stepMeta:h,stepperProps:m}):null,u===4?i.jsx(yd,{onPublish:b,stepMeta:h,stepperProps:m}):null,i.jsx("button",{type:"button",className:"ca-back-link",onClick:()=>s("/"),children:"← Back to Complaint Management"})]})},l||"new")}const wd=12,Cd="18 July 2026, 12:09";function _d({totalCount:e=88}){return i.jsxs("section",{className:"ca-query-details","aria-labelledby":"query-management-title",children:[i.jsxs("div",{className:"ca-query-details__heading",children:[i.jsx("h1",{id:"query-management-title",className:"ca-query-details__title",children:"Query Management"}),i.jsxs("span",{className:"ca-query-details__count",children:["Total Count: ",e]})]}),i.jsxs("div",{className:"ca-query-details__summary",children:[i.jsxs("div",{className:"ca-query-details__card",children:[i.jsx("span",{className:"ca-query-details__label",children:"Total Queries"}),i.jsx("strong",{className:"ca-query-details__value",children:wd})]}),i.jsxs("div",{className:"ca-query-details__card",children:[i.jsx("span",{className:"ca-query-details__label",children:"Last Query Submitted Date"}),i.jsx("strong",{className:"ca-query-details__value",children:Cd})]})]})]})}const Sd=[{id:1,label:"Name",key:"name"},{id:2,label:"Email",key:"email"},{id:3,label:"Query Type",key:"queryType"},{id:4,label:"Description",key:"description"},{id:5,label:"Employee",key:"employee"},{id:6,label:"Status",key:"status"},{id:7,label:"Escalation To",key:"escalationTo"}],Ed=[{id:1,name:"Rajesh Kumar",email:"rajesh@gmail.com",queryType:"shift_timing",description:"Need to upload hono hr app in new phone Emp id- 90998989",employee:"Employee",status:"Status",escalationTo:"Level 1"},{id:2,name:"Deepanshu",email:"deepanshu@gmail.com",queryType:"shift_timing",description:"Need to upload hono hr app in new phone Emp id- 90998989",employee:"Employee",status:"Status",escalationTo:"Level 1"},{id:3,name:"Ritik Kumar",email:"ritik@gmail.com",queryType:"shift_timing",description:"Need to upload hono hr app in new phone Emp id- 90998989",employee:"Employee",status:"Status",escalationTo:"Level 1"},{id:4,name:"Raj Kumar",email:"raj@gmail.com",queryType:"shift_timing",description:"Need to upload hono hr app in new phone Emp id- 90998989",employee:"Employee",status:"Status",escalationTo:"Level 1"}],Nd=44;function Ld({id:e=Nd,labelFields:t=Sd,tableData:r=Ed}){return i.jsxs("section",{className:"ca-query-table","aria-label":"Query records",children:[i.jsxs("div",{className:"ca-query-table__toolbar",children:[i.jsxs("label",{className:"ca-query-table__filter",children:[i.jsx(Uc,{size:14,"aria-hidden":"true"}),i.jsx("span",{className:"ca-query-table__sr-only",children:"Filter by status"}),i.jsxs("select",{defaultValue:"all","aria-label":"Filter by status",children:[i.jsx("option",{value:"all",children:"Select Status"}),i.jsx("option",{value:"open",children:"Open"}),i.jsx("option",{value:"closed",children:"Closed"})]})]}),i.jsxs("div",{className:"ca-query-table__actions",children:[i.jsx(R,{variant:"outline",size:"sm",startIcon:i.jsx(ya,{size:14}),children:"New Query"}),i.jsx(R,{variant:"outline",size:"sm",startIcon:i.jsx(Bc,{size:14}),children:"Download Report"})]})]}),i.jsx("div",{className:"ca-query-table__scroll","data-label-field-id":e,children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",children:"#"}),t.map(n=>i.jsx("th",{scope:"col",children:n.label},n.id))]})}),i.jsx("tbody",{children:r.map((n,a)=>i.jsxs("tr",{children:[i.jsx("td",{children:a+1}),t.map(o=>i.jsx("td",{children:n[o.key]??"-"},`${n.id??a}-${o.id}`))]},n.id??a))})]})})]})}const Od=()=>i.jsxs("main",{className:"ca-query-management-page",children:[i.jsx(_d,{}),i.jsx(Ld,{})]});function Td({pageProps:e,onPublish:t,onStepChange:r,children:n}){const a=n??i.jsx(Fa,{...e});return i.jsxs(ss,{children:[i.jsx(Qe,{path:"/",element:a}),i.jsx(Qe,{path:"/settings/:systemId",element:i.jsx(ro,{onPublish:t,onStepChange:r})}),i.jsx(Qe,{path:"querymanagement",element:i.jsx(Od,{})}),i.jsx(Qe,{path:"*",element:a})]})}function Ad({pageProps:e,onPublish:t,onStepChange:r,children:n}){return i.jsx(Td,{pageProps:e,onPublish:t,onStepChange:r,children:n})}function Fd({children:e}){const{cssVars:t,darkMode:r,mode:n}=ra();return i.jsx("div",{className:`ca-root ${r?"ca-root--dark":"ca-root--light"}`,"data-ca-theme":n,style:t,children:e})}function xd({basePath:e,children:t}){return xe()?t:i.jsx(Cs,{basename:e,children:t})}function Pd({store:e,children:t}){const r=L.useContext(kr.ReactReduxContext);return!e&&r?.store?t:i.jsx(kr.Provider,{store:e||la,children:t})}const no=({apiUrl:e,authToken:t,store:r,basePath:n="/",theme:a,darkMode:o=!1,title:s,description:l,systems:c,systemsEndpoint:d,useDemoData:u=!0,createLabel:f,onCreateForm:h,onConfigure:v,onOpen:_,onTitleClick:S,onDescriptionClick:b,onSearch:m,onPublish:y,onSaveDraft:C,showSaveButton:N,showNextButton:A,onStepChange:F,children:$})=>{const Q={title:s,description:l,systems:c,systemsEndpoint:d,useDemoData:u,createLabel:f,onCreateForm:h,onConfigure:v,onOpen:_,onTitleClick:S,onDescriptionClick:b,onSearch:m,onSaveDraft:C,showSaveButton:N,showNextButton:A};return i.jsx(ta,{theme:a,darkMode:o,children:i.jsx(Pd,{store:r,children:i.jsx(Fd,{children:i.jsx(Zn,{apiUrl:e,authToken:t,children:i.jsx(xd,{basePath:n,children:i.jsx(Ad,{pageProps:Q,onPublish:y,onStepChange:F,children:$})})})})})})},kd=ae.colors,Dd=ae.radii,Bd=ae.spacing,Id=ae.typography;g.AddFormButton=Xa,g.AddTableCard=Ka,g.ApiProvider=Zn,g.BodyText=It,g.Button=R,g.COMPLAINT_ENDPOINTS=ee,g.CardFooter=va,g.CardHeader=ba,g.ChevronDownIcon=Ma,g.ChevronRightIcon=Cr,g.Chip=qa,g.CloseIcon=Va,g.ComplaintApp=no,g.ComplaintManagementPage=Fa,g.ComplaintSettingsPage=ro,g.DEFAULT_PAGE_DESCRIPTION=Ta,g.DEMO_SYSTEMS=Oa,g.DataPoint=wa,g.Divider=Ca,g.DragHandleIcon=Nr,g.FieldLabel=Mt,g.FormCard=Ya,g.FormCardGrid=eo,g.FormField=re,g.FormInput=_r,g.FormSelect=Sr,g.FormTextarea=$a,g.Heading1=vr,g.Heading2=Bt,g.Input=te,g.LabelText=ua,g.LayersIcon=Ba,g.LinkText=Lc,g.Loading=La,g.PageHeader=pa,g.PlusIcon=ca,g.Radio=za,g.RoleMultiSelect=Wa,g.SETTINGS_STEPS=K,g.SearchBar=Na,g.SearchIcon=Ea,g.Select=J,g.SettingsCard=Ve,g.SettingsCardHeader=Ia,g.SettingsWizardProvider=ka,g.StatusBadge=ha,g.Stepper=He,g.SystemCard=_a,g.SystemCardGrid=Sa,g.TableCard=Ja,g.TableCardGrid=Za,g.Tag=Ha,g.Textarea=Ua,g.ThemeProvider=ta,g.Toggle=Er,g.ToggleField=ja,g.TrashIcon=Qa,g.Typography=fe,g.ValueText=fa,g.WORKFLOW_SUBSTEPS=Rc,g.api=U,g.clearComplaintError=Cc,g.clearSelectedComplaintResource=_c,g.colors=kd,g.complaintDepartmentActions=_e,g.complaintPriorityActions=Se,g.complaintReducer=sa,g.complaintStatusActions=Ne,g.complaintTypeActions=Ce,g.complaintWorkflowActions=Ee,g.createComplaintDepartment=tc,g.createComplaintPriority=sc,g.createComplaintStatus=gc,g.createComplaintStore=ia,g.createComplaintType=Gl,g.createComplaintWorkflow=uc,g.darkTheme=st,g.deepMerge=$e,g.default=no,g.defaultThemeFile=Gn,g.deleteComplaintDepartment=nc,g.deleteComplaintPriority=lc,g.deleteComplaintStatus=bc,g.deleteComplaintType=Ql,g.deleteComplaintWorkflow=pc,g.deleteWorkflowSteps=na,g.getComplaintDepartmentById=ec,g.getComplaintDepartments=Yl,g.getComplaintPriorities=ac,g.getComplaintPriorityById=oc,g.getComplaintStatusById=mc,g.getComplaintStatuses=hc,g.getComplaintTypeById=Zl,g.getComplaintTypes=Jl,g.getComplaintWorkflowById=dc,g.getComplaintWorkflows=cc,g.getDepartmentTree=xt,g.getWorkflowSteps=Pt,g.lightTheme=ae,g.normalizeThemeFile=Xn,g.radii=Dd,g.resetComplaintState=Sc,g.resolveActiveTheme=Qn,g.saveWorkflowSteps=kt,g.setAuthToken=gr,g.setBaseUrl=Jn,g.spacing=Bd,g.store=la,g.themeToCssVars=Yn,g.typography=Id,g.updateComplaintDepartment=rc,g.updateComplaintPriority=ic,g.updateComplaintStatus=yc,g.updateComplaintType=Xl,g.updateComplaintWorkflow=fc,g.useSettingsWizard=je,g.useTheme=ra,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
12
12
|
//# sourceMappingURL=complaint-app.umd.js.map
|