@meyicloud/meyi-cost-ui 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +259 -0
  2. package/dist/CostPage.d.ts +12 -0
  3. package/dist/api.d.ts +3 -0
  4. package/dist/components/cost-line-chart.d.ts +13 -0
  5. package/dist/components/cur-readiness.d.ts +5 -0
  6. package/dist/components/stacked-cost-trend.d.ts +6 -0
  7. package/dist/components/ui/card.d.ts +8 -0
  8. package/dist/features/analysis/components/analysis-results.d.ts +4 -0
  9. package/dist/features/analysis/hooks/use-cost-analysis.d.ts +21 -0
  10. package/dist/features/analysis/index.d.ts +1 -0
  11. package/dist/features/budgets/components/budget-form.d.ts +12 -0
  12. package/dist/features/budgets/components/budget-list.d.ts +7 -0
  13. package/dist/features/budgets/hooks/use-cost-budgets.d.ts +21 -0
  14. package/dist/features/budgets/index.d.ts +1 -0
  15. package/dist/features/cur-discovery/index.d.ts +1 -0
  16. package/dist/features/overview/components/breakdown-bar-chart.d.ts +6 -0
  17. package/dist/features/overview/components/overview-widgets.d.ts +14 -0
  18. package/dist/features/overview/hooks/use-cost-overview.d.ts +16 -0
  19. package/dist/features/overview/index.d.ts +1 -0
  20. package/dist/features/reports/components/comparison-overview.d.ts +5 -0
  21. package/dist/features/reports/components/report-common.d.ts +15 -0
  22. package/dist/features/reports/components/report-sidebar.d.ts +32 -0
  23. package/dist/features/reports/components/report-tables.d.ts +12 -0
  24. package/dist/features/reports/hooks/use-cost-reports.d.ts +36 -0
  25. package/dist/features/reports/index.d.ts +1 -0
  26. package/dist/features/reports/report-export.d.ts +15 -0
  27. package/dist/features/reports/report-model.d.ts +49 -0
  28. package/dist/features/sources/index.d.ts +1 -0
  29. package/dist/html2canvas.esm-B5qzocYs.cjs +5 -0
  30. package/dist/html2canvas.esm-BWVIUcAF.js +4802 -0
  31. package/dist/index.d.ts +10 -0
  32. package/dist/index.es-CUlzdq_P.cjs +5 -0
  33. package/dist/index.es-GAd5Tgul.js +6682 -0
  34. package/dist/index.js +21 -0
  35. package/dist/index.mjs +11453 -0
  36. package/dist/jspdf.es.min-6LRJ71fx.js +9860 -0
  37. package/dist/jspdf.es.min-C10id8ME.cjs +78 -0
  38. package/dist/jspdf.plugin.autotable-CogKBV4l.js +1087 -0
  39. package/dist/jspdf.plugin.autotable-CvTok6mL.cjs +2 -0
  40. package/dist/lib/utils.d.ts +4 -0
  41. package/dist/purify.es-BrrCv_hE.js +864 -0
  42. package/dist/purify.es-DCvfCVUO.cjs +3 -0
  43. package/dist/router.d.ts +2 -0
  44. package/dist/services/cost.d.ts +57 -0
  45. package/dist/style.css +1 -0
  46. package/dist/types.d.ts +217 -0
  47. package/package.json +66 -0
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),Na=require("react-dom");function Ra(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const $=Ra(k);var Kt={exports:{}},Pt={};var Ar;function Ca(){if(Ar)return Pt;Ar=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,n,a){var i=null;if(a!==void 0&&(i=""+a),n.key!==void 0&&(i=""+n.key),"key"in n){a={};for(var c in n)c!=="key"&&(a[c]=n[c])}else a=n;return n=a.ref,{$$typeof:e,type:r,key:i,ref:n!==void 0?n:null,props:a}}return Pt.Fragment=t,Pt.jsx=s,Pt.jsxs=s,Pt}var Tt={};var Or;function _a(){return Or||(Or=1,process.env.NODE_ENV!=="production"&&(function(){function e(N){if(N==null)return null;if(typeof N=="function")return N.$$typeof===P?null:N.displayName||N.name||null;if(typeof N=="string")return N;switch(N){case b:return"Fragment";case y:return"Profiler";case x:return"StrictMode";case _:return"Suspense";case R:return"SuspenseList";case A:return"Activity"}if(typeof N=="object")switch(typeof N.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),N.$$typeof){case g:return"Portal";case w:return N.displayName||"Context";case S:return(N._context.displayName||"Context")+".Consumer";case C:var B=N.render;return N=N.displayName,N||(N=B.displayName||B.name||"",N=N!==""?"ForwardRef("+N+")":"ForwardRef"),N;case j:return B=N.displayName||null,B!==null?B:e(N.type)||"Memo";case E:B=N._payload,N=N._init;try{return e(N(B))}catch{}}return null}function t(N){return""+N}function s(N){try{t(N);var B=!1}catch{B=!0}if(B){B=console;var H=B.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&N[Symbol.toStringTag]||N.constructor.name||"Object";return H.call(B,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),t(N)}}function r(N){if(N===b)return"<>";if(typeof N=="object"&&N!==null&&N.$$typeof===E)return"<...>";try{var B=e(N);return B?"<"+B+">":"<...>"}catch{return"<...>"}}function n(){var N=I.A;return N===null?null:N.getOwner()}function a(){return Error("react-stack-top-frame")}function i(N){if(ee.call(N,"key")){var B=Object.getOwnPropertyDescriptor(N,"key").get;if(B&&B.isReactWarning)return!1}return N.key!==void 0}function c(N,B){function H(){Q||(Q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",B))}H.isReactWarning=!0,Object.defineProperty(N,"key",{get:H,configurable:!0})}function d(){var N=e(this.type);return J[N]||(J[N]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),N=this.props.ref,N!==void 0?N:null}function l(N,B,H,G,D,F){var U=H.ref;return N={$$typeof:p,type:N,key:B,props:H,_owner:G},(U!==void 0?U:null)!==null?Object.defineProperty(N,"ref",{enumerable:!1,get:d}):Object.defineProperty(N,"ref",{enumerable:!1,value:null}),N._store={},Object.defineProperty(N._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(N,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(N,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.defineProperty(N,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.freeze&&(Object.freeze(N.props),Object.freeze(N)),N}function f(N,B,H,G,D,F){var U=B.children;if(U!==void 0)if(G)if(V(U)){for(G=0;G<U.length;G++)u(U[G]);Object.freeze&&Object.freeze(U)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(U);if(ee.call(B,"key")){U=e(N);var X=Object.keys(B).filter(function(fe){return fe!=="key"});G=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",O[U+G]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ let props = %s;
3
+ <%s {...props} />
4
+ React keys must be passed directly to JSX without using spread:
5
+ let props = %s;
6
+ <%s key={someKey} {...props} />`,G,U,X,U),O[U+G]=!0)}if(U=null,H!==void 0&&(s(H),U=""+H),i(B)&&(s(B.key),U=""+B.key),"key"in B){H={};for(var K in B)K!=="key"&&(H[K]=B[K])}else H=B;return U&&c(H,typeof N=="function"?N.displayName||N.name||"Unknown":N),l(N,U,H,n(),D,F)}function u(N){h(N)?N._store&&(N._store.validated=1):typeof N=="object"&&N!==null&&N.$$typeof===E&&(N._payload.status==="fulfilled"?h(N._payload.value)&&N._payload.value._store&&(N._payload.value._store.validated=1):N._store&&(N._store.validated=1))}function h(N){return typeof N=="object"&&N!==null&&N.$$typeof===p}var m=k,p=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),w=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),I=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=Object.prototype.hasOwnProperty,V=Array.isArray,Z=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(N){return N()}};var Q,J={},ue=m.react_stack_bottom_frame.bind(m,a)(),he=Z(r(a)),O={};Tt.Fragment=b,Tt.jsx=function(N,B,H){var G=1e4>I.recentlyCreatedOwnerStacks++;return f(N,B,H,!1,G?Error("react-stack-top-frame"):ue,G?Z(r(N)):he)},Tt.jsxs=function(N,B,H){var G=1e4>I.recentlyCreatedOwnerStacks++;return f(N,B,H,!0,G?Error("react-stack-top-frame"):ue,G?Z(r(N)):he)}})()),Tt}var Lr;function ka(){return Lr||(Lr=1,process.env.NODE_ENV==="production"?Kt.exports=Ca():Kt.exports=_a()),Kt.exports}var o=ka(),Ft=typeof window<"u"?$.useLayoutEffect:$.useEffect;function Is(e){const t=$.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function Ea(e,t,s={},r={}){$.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const n=new IntersectionObserver(([a])=>{t(a)},s);return n.observe(e.current),()=>{n.disconnect()}},[t,s,r.disabled,e])}function Pa(e){const t=$.useRef(null);return $.useImperativeHandle(e,()=>t.current,[]),t}const Wn=!1;function Bt(e){return e[e.length-1]}function Ta(e){return typeof e=="function"}function et(e,t){return Ta(e)?e(t):e}const Hn=Object.prototype.hasOwnProperty,Mr=Object.prototype.propertyIsEnumerable;function qn(e){for(const t in e)if(Hn.call(e,t))return!0;return!1}const Aa=()=>Object.create(null),Xe=(e,t)=>tt(e,t,Aa);function tt(e,t,s=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const n=t,a=Fr(e)&&Fr(n);if(!a&&!(xs(e)&&xs(n)))return n;const i=a?e:Ir(e);if(!i)return n;const c=a?n:Ir(n);if(!c)return n;const d=i.length,l=c.length,f=a?new Array(l):s();let u=0;for(let h=0;h<l;h++){const m=a?h:c[h],p=e[m],g=n[m];if(p===g){f[m]=p,(a?h<d:Hn.call(e,m))&&u++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){f[m]=g;continue}const b=tt(p,g,s,r+1);f[m]=b,b===p&&u++}return d===l&&u===d?e:f}function Ir(e){const t=Object.getOwnPropertyNames(e);for(const n of t)if(!Mr.call(e,n))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const r=t;for(const n of s){if(!Mr.call(e,n))return!1;r.push(n)}return r}function xs(e){if(!Dr(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!Dr(s)||!s.hasOwnProperty("isPrototypeOf"))}function Dr(e){return Object.prototype.toString.call(e)==="[object Object]"}function Fr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nt(e,t,s){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r++)if(!nt(e[r],t[r],s))return!1;return!0}if(xs(e)&&xs(t)){const r=s?.ignoreUndefined??!0;if(s?.partial){for(const i in t)if((!r||t[i]!==void 0)&&!nt(e[i],t[i],s))return!1;return!0}let n=0;if(!r)n=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&n++;let a=0;for(const i in t)if((!r||t[i]!==void 0)&&(a++,a>n||!nt(e[i],t[i],s)))return!1;return n===a}return!1}function wt(e){let t,s;const r=new Promise((n,a)=>{t=n,s=a});return r.status="pending",r.resolve=n=>{r.status="resolved",r.value=n,t(n),e?.(n)},r.reject=n=>{r.status="rejected",s(n)},r}function Ut(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Br(e,t){for(let s=e.length-1;s>=0;s--){const r=e[s];if(t(r))return r}}const Oa=/[\x00-\x1f\x7f"<>`{}]/g;function La(e){return e.replace(Oa,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function Ur(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return La(t)}const Ma=["http:","https:","mailto:","tel:"];function bs(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function At(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let s=0,r="",n;for(;(n=t.exec(e))!==null;)r+=Ur(e.slice(s,n.index))+n[0],s=t.lastIndex;r=r+Ur(s?e.slice(s):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function Ia(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Da(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}function Be(){throw new Error("Invariant failed")}function $t(e){const t=new Map;let s,r;const n=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,s=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const i=t.get(a);if(i)return n(i),i.value},set(a,i){if(t.size>=e&&s){const d=s;t.delete(d.key),d.next&&(s=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const c=t.get(a);if(c)c.value=i,n(c);else{const d={key:a,value:i,prev:r};r&&(r.next=d),r=d,s||(s=d),t.set(a,d)}},clear(){t.clear(),s=void 0,r=void 0}}}const Ve=4,Gn=5;function Fa(e){const t=e.indexOf("{");if(t===-1)return null;const s=e.indexOf("}",t);return s===-1||t+1>=e.length?null:[t,s]}function Kn(e,t,s=new Uint16Array(6)){const r=e.indexOf("/",t),n=r===-1?e.length:r,a=e.substring(t,n);if(!a||!a.includes("$"))return s[0]=0,s[1]=t,s[2]=t,s[3]=n,s[4]=n,s[5]=n,s;if(a==="$"){const c=e.length;return s[0]=2,s[1]=t,s[2]=t,s[3]=c,s[4]=c,s[5]=c,s}if(a.charCodeAt(0)===36)return s[0]=1,s[1]=t,s[2]=t+1,s[3]=n,s[4]=n,s[5]=n,s;const i=Fa(a);if(i){const[c,d]=i,l=a.charCodeAt(c+1);if(l===45){if(c+2<a.length&&a.charCodeAt(c+2)===36){const f=c+3,u=d;if(f<u)return s[0]=3,s[1]=t+c,s[2]=t+f,s[3]=t+u,s[4]=t+d+1,s[5]=n,s}}else if(l===36){const f=c+1,u=c+2;return u===d?(s[0]=2,s[1]=t+c,s[2]=t+f,s[3]=t+u,s[4]=t+d+1,s[5]=e.length,s):(s[0]=1,s[1]=t+c,s[2]=t+u,s[3]=t+d,s[4]=t+d+1,s[5]=n,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=n,s[4]=n,s[5]=n,s}function Es(e,t,s,r,n,a,i){i?.(s);let c=r;{const d=s.fullPath??s.from,l=d.length,f=s.options?.caseSensitive??e,u=s.options?.params?.parse??s.options?.parseParams;for(;c<l;){const m=Kn(d,c,t);let p;const g=c,b=m[5];switch(c=b+1,a++,m[0]){case 0:{const x=d.substring(m[2],m[3]);if(f){const y=n.static?.get(x);if(y)p=y;else{n.static??=new Map;const S=st(s.fullPath??s.from);S.parent=n,S.depth=a,p=S,n.static.set(x,S)}}else{const y=x.toLowerCase(),S=n.staticInsensitive?.get(y);if(S)p=S;else{n.staticInsensitive??=new Map;const w=st(s.fullPath??s.from);w.parent=n,w.depth=a,p=w,n.staticInsensitive.set(y,w)}}break}case 1:{const x=d.substring(g,m[1]),y=d.substring(m[4],b),S=f&&!!(x||y),w=x?S?x:x.toLowerCase():void 0,C=y?S?y:y.toLowerCase():void 0,_=!u&&n.dynamic?.find(R=>!R.parse&&R.caseSensitive===S&&R.prefix===w&&R.suffix===C);if(_)p=_;else{const R=Fs(1,s.fullPath??s.from,S,w,C);p=R,R.depth=a,R.parent=n,n.dynamic??=[],n.dynamic.push(R)}break}case 3:{const x=d.substring(g,m[1]),y=d.substring(m[4],b),S=f&&!!(x||y),w=x?S?x:x.toLowerCase():void 0,C=y?S?y:y.toLowerCase():void 0,_=!u&&n.optional?.find(R=>!R.parse&&R.caseSensitive===S&&R.prefix===w&&R.suffix===C);if(_)p=_;else{const R=Fs(3,s.fullPath??s.from,S,w,C);p=R,R.parent=n,R.depth=a,n.optional??=[],n.optional.push(R)}break}case 2:{const x=d.substring(g,m[1]),y=d.substring(m[4],b),S=f&&!!(x||y),w=x?S?x:x.toLowerCase():void 0,C=y?S?y:y.toLowerCase():void 0,_=Fs(2,s.fullPath??s.from,S,w,C);p=_,_.parent=n,_.depth=a,n.wildcard??=[],n.wildcard.push(_)}}n=p}if(u&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const m=st(s.fullPath??s.from);m.kind=Gn,m.parent=n,a++,m.depth=a,n.pathless??=[],n.pathless.push(m),n=m}const h=(s.path||!s.children)&&!s.isRoot;if(h&&d.endsWith("/")){const m=st(s.fullPath??s.from);m.kind=Ve,m.parent=n,a++,m.depth=a,n.index=m,n=m}n.parse=u??null,n.priority=s.options?.params?.priority??0,h&&!n.route&&(n.route=s,n.fullPath=s.fullPath??s.from)}if(s.children)for(const d of s.children)Es(e,t,d,c,n,a,i)}function Ds(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ze(e){if(e.pathless)for(const t of e.pathless)ze(t);if(e.static)for(const t of e.static.values())ze(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ze(t);if(e.dynamic?.length){e.dynamic.sort(Ds);for(const t of e.dynamic)ze(t)}if(e.optional?.length){e.optional.sort(Ds);for(const t of e.optional)ze(t)}if(e.wildcard?.length){e.wildcard.sort(Ds);for(const t of e.wildcard)ze(t)}}function st(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function Fs(e,t,s,r,n){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:s,prefix:r,suffix:n}}function Ba(e,t){const s=st("/"),r=new Uint16Array(6);for(const n of e)Es(!1,r,n,1,s,0);ze(s),t.masksTree=s,t.flatCache=$t(1e3)}function Ua(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const r=mr(e,t.masksTree);return t.flatCache.set(e,r),r}function $a(e,t,s,r,n){e||="/",r||="/";const a=t?`case\0${e}`:e;let i=n.singleCache.get(a);return i||(i=st("/"),Es(t,new Uint16Array(6),{from:e},1,i,0),n.singleCache.set(a,i)),mr(r,i,s)}function za(e,t,s=!1){const r=s?e:`nofuzz\0${e}`,n=t.matchCache.get(r);if(n!==void 0)return n;e||="/";let a;try{a=mr(e,t.segmentTree,s)}catch(i){if(i instanceof URIError)a=null;else throw i}return a&&(a.branch=Jn(a.route)),t.matchCache.set(r,a),a}function Va(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Wa(e,t=!1,s){const r=st(e.fullPath),n=new Uint16Array(6),a={},i={};let c=0;return Es(t,n,e,1,r,0,d=>{if(s?.(d,c),d.id in a){if(process.env.NODE_ENV!=="production")throw new Error(`Invariant failed: Duplicate routes found with id: ${String(d.id)}`);Be()}if(a[d.id]=d,c!==0&&d.path){const l=Va(d.fullPath);(!i[l]||d.fullPath.endsWith("/"))&&(i[l]=d)}c++}),ze(r),{processedTree:{segmentTree:r,singleCache:$t(1e3),matchCache:$t(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:i}}function mr(e,t,s=!1){const r=e.split("/"),n=qa(e,r,t,s);if(!n)return null;const[a]=Yn(e,r,n);return{route:n.node.route,rawParams:a}}function Yn(e,t,s){const r=Ha(s.node);let n=null;const a=Object.create(null);let i=s.extract?.part??0,c=s.extract?.node??0,d=s.extract?.path??0,l=s.extract?.segment??0;for(;c<r.length;i++,c++,d++,l++){const f=r[c];if(f.kind===Ve)break;if(f.kind===Gn){l--,i--,d--;continue}const u=t[i],h=d;if(u&&(d+=u.length),f.kind===1){n??=s.node.fullPath.split("/");const m=n[l],p=f.prefix?.length??0;if(m.charCodeAt(p)===123){const g=f.suffix?.length??0,b=m.substring(p+2,m.length-g-1),x=u.substring(p,u.length-g);a[b]=decodeURIComponent(x)}else{const g=m.substring(1);a[g]=decodeURIComponent(u)}}else if(f.kind===3){if(s.skipped&1<<c){i--,d=h-1;continue}n??=s.node.fullPath.split("/");const m=n[l],p=f.prefix?.length??0,g=f.suffix?.length??0,b=m.substring(p+3,m.length-g-1),x=f.suffix||f.prefix?u.substring(p,u.length-g):u;x&&(a[b]=decodeURIComponent(x))}else if(f.kind===2){const m=f,p=e.substring(h+(m.prefix?.length??0),e.length-(m.suffix?.length??0)),g=decodeURIComponent(p);a["*"]=g,a._splat=g;break}}return s.rawParams&&Object.assign(a,s.rawParams),[a,{part:i,node:c,path:d,segment:l}]}function Jn(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Ha(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function qa(e,t,s,r){if(e==="/"&&s.index)return{node:s.index,skipped:0};const n=!Bt(t),a=n&&e!=="/",i=t.length-(n?1:0),c=[{node:s,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let d=null,l=null;for(;c.length;){const f=c.pop(),{node:u,index:h,skipped:m,depth:p,statics:g,dynamics:b,optionals:x}=f;let{extract:y,rawParams:S}=f;if(u.kind===2&&u.route&&!Jt(l,f))continue;if(u.parse){if(!$r(e,t,f))continue;S=f.rawParams,y=f.extract}r&&u.route&&u.kind!==Ve&&Jt(d,f)&&(d=f);const w=h===i;if(w&&(u.route&&(!a||u.kind===Ve||u.kind===2)&&Jt(l,f)&&(l=f),!u.optional&&!u.wildcard&&!u.index&&!u.pathless))continue;const C=w?void 0:t[h];let _;if(w&&u.index){const R={node:u.index,index:h,skipped:m,depth:p+1,statics:g,dynamics:b,optionals:x,extract:y,rawParams:S};let j=!0;if(u.index.parse&&($r(e,t,R)||(j=!1)),j){if(!b&&!x&&!m&&Ga(g,i))return R;Jt(l,R)&&(l=R)}}if(u.wildcard)for(let R=u.wildcard.length-1;R>=0;R--){const j=u.wildcard[R],{prefix:E,suffix:A}=j;if(!(E&&(w||!(j.caseSensitive?C:_??=C.toLowerCase()).startsWith(E)))){if(A){if(w)continue;const P=t.slice(h).join("/").slice(-A.length);if((j.caseSensitive?P:P.toLowerCase())!==A)continue}c.push({node:j,index:i,skipped:m,depth:p+1,statics:g,dynamics:b,optionals:x,extract:y,rawParams:S})}}if(u.optional){const R=m|1<<p,j=p+1;for(let E=u.optional.length-1;E>=0;E--){const A=u.optional[E];c.push({node:A,index:h,skipped:R,depth:j,statics:g,dynamics:b,optionals:x,extract:y,rawParams:S})}if(!w)for(let E=u.optional.length-1;E>=0;E--){const A=u.optional[E],{prefix:P,suffix:I}=A;if(P||I){const ee=A.caseSensitive?C:_??=C.toLowerCase();if(P&&!ee.startsWith(P)||I&&!ee.endsWith(I))continue}c.push({node:A,index:h+1,skipped:m,depth:j,statics:g,dynamics:b,optionals:x+Yt(i,h),extract:y,rawParams:S})}}if(!w&&u.dynamic&&C)for(let R=u.dynamic.length-1;R>=0;R--){const j=u.dynamic[R],{prefix:E,suffix:A}=j;if(E||A){const P=j.caseSensitive?C:_??=C.toLowerCase();if(E&&!P.startsWith(E)||A&&!P.endsWith(A))continue}c.push({node:j,index:h+1,skipped:m,depth:p+1,statics:g,dynamics:b+Yt(i,h),optionals:x,extract:y,rawParams:S})}if(!w&&u.staticInsensitive){const R=u.staticInsensitive.get(_??=C.toLowerCase());R&&c.push({node:R,index:h+1,skipped:m,depth:p+1,statics:g+Yt(i,h),dynamics:b,optionals:x,extract:y,rawParams:S})}if(!w&&u.static){const R=u.static.get(C);R&&c.push({node:R,index:h+1,skipped:m,depth:p+1,statics:g+Yt(i,h),dynamics:b,optionals:x,extract:y,rawParams:S})}if(u.pathless){const R=p+1;for(let j=u.pathless.length-1;j>=0;j--){const E=u.pathless[j];c.push({node:E,index:h,skipped:m,depth:R,statics:g,dynamics:b,optionals:x,extract:y,rawParams:S})}}}if(l)return l;if(r&&d){let f=d.index;for(let h=0;h<d.index;h++)f+=t[h].length;const u=f===e.length?"/":e.slice(f);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(u),d}return null}function Yt(e,t){return 2**(e-t-1)}function Ga(e,t){return e===2**(t-1)-1}function $r(e,t,s){let r,n;try{[r,n]=Yn(e,t,s)}catch{return null}if(s.rawParams=r,s.extract=n,!s.node.parse)return!0;try{if(s.node.parse(r)===!1)return null}catch{}return!0}function Jt(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Ve)>(e.node.kind===Ve)||t.node.kind===Ve==(e.node.kind===Ve)&&t.depth>e.depth))):!0}function ls(e){return pr(e.filter(t=>t!==void 0).join("/"))}function pr(e){return e.replace(/\/{2,}/g,"/")}function Xn(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Fe(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Zn(e){return Fe(Xn(e))}function ys(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Ka(e,t,s){return ys(e,s)===ys(t,s)}function Ya({base:e,to:t,trailingSlash:s="never",cache:r}){const n=t.startsWith("/"),a=!n&&t===".";let i;if(r){i=n?t:a?e:e+"\0"+t;const l=r.get(i);if(l)return l}let c;if(a)c=e.split("/");else if(n)c=t.split("/");else{for(c=e.split("/");c.length>1&&Bt(c)==="";)c.pop();const l=t.split("/");for(let f=0,u=l.length;f<u;f++){const h=l[f];h===""?f?f===u-1&&c.push(h):c=[h]:h===".."?c.pop():h==="."||c.push(h)}}c.length>1&&(Bt(c)===""?s==="never"&&c.pop():s==="always"&&c.push(""));const d=pr(c.join("/"))||"/";return i&&r&&r.set(i,d),d}function Ja(e){const t=new Map(e.map(n=>[encodeURIComponent(n),n])),s=Array.from(t.keys()).map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(s,"g");return n=>n.replace(r,a=>t.get(a)??a)}function Bs(e,t,s){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(n=>Vr(n,s)).join("/"):Vr(r,s)}function zr({path:e,params:t,decoder:s,...r}){let n=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:n};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:n};const i=e.length;let c=0,d,l="";for(;c<i;){const f=c;d=Kn(e,f,d);const u=d[5];if(c=u+1,f===u)continue;const h=d[0];if(h===0){l+="/"+e.substring(f,u);continue}if(h===2){const m=t._splat;a._splat=m,a["*"]=m;const p=e.substring(f,d[1]),g=e.substring(d[4],u);if(!m){n=!0,(p||g)&&(l+="/"+p+g);continue}const b=Bs("_splat",t,s);l+="/"+p+b+g;continue}if(h===1){const m=e.substring(d[2],d[3]);!n&&!(m in t)&&(n=!0),a[m]=t[m];const p=e.substring(f,d[1]),g=e.substring(d[4],u),b=Bs(m,t,s)??"undefined";l+="/"+p+b+g;continue}if(h===3){const m=e.substring(d[2],d[3]),p=t[m];if(p==null)continue;a[m]=p;const g=e.substring(f,d[1]),b=e.substring(d[4],u),x=Bs(m,t,s)??"";l+="/"+g+x+b;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:a,interpolatedPath:l||"/",isMissingParams:n}}function Vr(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function xe(e){return e?.isNotFound===!0}function Xa(e,t=String){const s=new URLSearchParams;for(const r in e){const n=e[r];n!==void 0&&s.set(r,t(n))}return s.toString()}function Us(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Za(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[r,n]of t.entries()){const a=s[r];a==null?s[r]=Us(n):Array.isArray(a)?a.push(Us(n)):s[r]=[a,Us(n)]}return s}const Qa=ti(JSON.parse),ei=si(JSON.stringify,JSON.parse);function ti(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=Za(t);for(const r in s){const n=s[r];if(typeof n=="string")try{s[r]=e(n)}catch{}}return s}}function si(e,t){const s=typeof t=="function";function r(n){if(typeof n=="object"&&n!==null)try{return e(n)}catch{}else if(s&&typeof n=="string")try{return t(n),e(n)}catch{}return n}return n=>{const a=Xa(n,r);return a?`?${a}`:""}}const ot="__root__";function ri(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:t});if(s.options=e,e.throw)throw s;return s}function je(e){return e instanceof Response&&!!e.options}const tr=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ni=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Ps=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),at=(e,t,s=!0)=>{const r={...e.router.options.context??{}},n=s?t:t-1;for(let a=0;a<=n;a++){const i=e.matches[a];if(!i)continue;const c=e.router.getMatch(i.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},Wr=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,r=e.matches.findIndex(i=>i.routeId===e.router.routeTree.id),n=r>=0?r:0;let a=s?e.matches.findIndex(i=>i.routeId===s):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=n);for(let i=a;i>=0;i--){const c=e.matches[i];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return i}return s?a:n},We=(e,t,s)=>{if(!(!je(s)&&!xe(s)))throw je(s)&&s.redirectHandled&&!s.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=s,e.updateMatch(t.id,r=>({...r,status:je(s)?"redirected":xe(s)?"notFound":r.status==="pending"?"success":r.status,context:at(e,t.index),isFetching:!1,error:s})),xe(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),je(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},Qn=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},Hr=(e,t,s)=>{const r=at(e,s);e.updateMatch(t,n=>({...n,context:r}))},Ot=(e,t,s)=>{const{id:r,routeId:n}=e.matches[t],a=e.router.looseRoutesById[n];if(s instanceof Promise)throw s;e.firstBadMatchIndex??=t,We(e,e.router.getMatch(r),s);try{a.options.onError?.(s)}catch(i){s=i,We(e,e.router.getMatch(r),s)}e.updateMatch(r,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!je(s)&&!xe(s)&&(e.serialError??=s)},eo=(e,t,s,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const n=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ps(e,t)&&(s.options.loader||s.options.beforeLoad||so(s))&&typeof n=="number"&&n!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{tr(e)},n);r._nonReactive.pendingTimeout=a}},oi=(e,t,s)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;eo(e,t,s,r);const n=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&We(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(n):n()},ai=(e,t,s,r)=>{const n=e.router.getMatch(t);let a=n._nonReactive.loadPromise;n._nonReactive.loadPromise=wt(()=>{a?.resolve(),a=void 0});const{paramsError:i,searchError:c}=n;i&&Ot(e,s,i),c&&Ot(e,s,c),eo(e,t,r,n);const d=new AbortController;let l=!1;const f=()=>{l||(l=!0,e.updateMatch(t,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:d})))},u=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,w=>({...w,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{f(),u()});return}n._nonReactive.beforeLoadPromise=wt();const h={...at(e,s,!1),...n.__routeContext},{search:m,params:p,cause:g}=n,b=Ps(e,t),x={search:m,abortController:d,params:p,preload:b,context:h,location:e.location,navigate:w=>e.router.navigate({...w,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},y=w=>{if(w===void 0){e.router.batch(()=>{f(),u()});return}(je(w)||xe(w))&&(f(),Ot(e,s,w)),e.router.batch(()=>{f(),e.updateMatch(t,C=>({...C,__beforeLoadContext:w})),u()})};let S;try{if(S=r.options.beforeLoad(x),Ut(S))return f(),S.catch(w=>{Ot(e,s,w)}).then(y)}catch(w){f(),Ot(e,s,w)}y(S)},ii=(e,t)=>{const{id:s,routeId:r}=e.matches[t],n=e.router.looseRoutesById[r],a=()=>c(),i=()=>ai(e,s,t,n),c=()=>{if(Qn(e,s))return;const d=oi(e,s,n);return Ut(d)?d.then(i):i()};return a()},ci=(e,t,s)=>{const r=e.router.getMatch(t);if(!r||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const n={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([s.options.head?.(n),s.options.scripts?.(n),s.options.headers?.(n)]).then(([a,i,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:i,styles:a?.styles}))},to=(e,t,s,r,n)=>{const a=t[r-1],{params:i,loaderDeps:c,abortController:d,cause:l}=e.router.getMatch(s),f=at(e,r),u=Ps(e,s);return{params:i,deps:c,preload:!!u,parentMatchPromise:a,abortController:d,context:f,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:u?"preload":l,route:n,...e.router.options.additionalContext}},qr=async(e,t,s,r,n)=>{try{const a=e.router.getMatch(s);try{(!(Wn??e.router.isServer)||a.ssr===!0)&&zt(n);const i=n.options.loader,c=typeof i=="function"?i:i?.handler,d=c?.(to(e,t,s,r,n)),l=!!c&&Ut(d);if((l||n._lazyPromise||n._componentsPromise||n.options.head||n.options.scripts||n.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(s,u=>({...u,isFetching:"loader"})),c){const u=l?await d:d;We(e,e.router.getMatch(s),u),u!==void 0&&e.updateMatch(s,h=>({...h,loaderData:u}))}n._lazyPromise&&await n._lazyPromise;const f=a._nonReactive.minPendingPromise;f&&await f,n._componentsPromise&&await n._componentsPromise,e.updateMatch(s,u=>({...u,error:void 0,context:at(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let c=i;if(c?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,l=>({...l,status:l.status==="pending"?"success":l.status,isFetching:!1,context:at(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,xe(i)&&await n.options.notFoundComponent?.preload?.(),We(e,e.router.getMatch(s),i);try{n.options.onError?.(i)}catch(l){c=l,We(e,e.router.getMatch(s),l)}!je(c)&&!xe(c)&&await zt(n,["errorComponent"]),e.updateMatch(s,l=>({...l,error:c,context:at(e,r),status:"error",isFetching:!1}))}}catch(a){const i=e.router.getMatch(s);i&&(i._nonReactive.loaderPromise=void 0),We(e,i,a)}},li=async(e,t,s)=>{async function r(m,p,g,b,x){const y=Date.now()-p.updatedAt,S=m?x.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:x.options.staleTime??e.router.options.defaultStaleTime??0,w=x.options.shouldReload,C=typeof w=="function"?w(to(e,t,n,s,x)):w,{status:_,invalid:R}=b,j=y>=S&&(!!e.forceStaleReload||b.cause==="enter"||g!==void 0&&g!==b.id);i=_==="success"&&(R||(C??j)),m&&x.options.preload===!1||(i&&!e.sync&&f?(c=!0,(async()=>{try{await qr(e,t,n,s,x);const E=e.router.getMatch(n);E._nonReactive.loaderPromise?.resolve(),E._nonReactive.loadPromise?.resolve(),E._nonReactive.loaderPromise=void 0,E._nonReactive.loadPromise=void 0}catch(E){je(E)&&await e.router.navigate(E.options)}})()):_!=="success"||i?await qr(e,t,n,s,x):Hr(e,n,s))}const{id:n,routeId:a}=e.matches[s];let i=!1,c=!1;const d=e.router.looseRoutesById[a],l=d.options.loader,f=((typeof l=="function"?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Qn(e,n)){if(!e.router.getMatch(n))return e.matches[s];Hr(e,n,s)}else{const m=e.router.getMatch(n),p=e.router.stores.matchesId.get()[s],g=(p&&e.router.stores.matchStores.get(p)||null)?.routeId===a?p:e.router.stores.matches.get().find(x=>x.routeId===a)?.id,b=Ps(e,n);if(m._nonReactive.loaderPromise){if(m.status==="success"&&!e.sync&&!m.preload&&f)return m;await m._nonReactive.loaderPromise;const x=e.router.getMatch(n),y=x._nonReactive.error||x.error;y&&We(e,x,y),x.status==="pending"&&await r(b,m,g,x,d)}else{const x=b&&!e.router.stores.matchStores.has(n),y=e.router.getMatch(n);y._nonReactive.loaderPromise=wt(),x!==y.preload&&e.updateMatch(n,S=>({...S,preload:x})),await r(b,m,g,y,d)}}const u=e.router.getMatch(n);c||(u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loadPromise?.resolve(),u._nonReactive.loadPromise=void 0),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,c||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const h=c?u.isFetching:!1;return h!==u.isFetching||u.invalid!==!1?(e.updateMatch(n,m=>({...m,isFetching:h,invalid:!1})),e.router.getMatch(n)):u};async function Gr(e){const t=e,s=[];ni(t.router)&&tr(t);let r;for(let h=0;h<t.matches.length;h++){try{const m=ii(t,h);Ut(m)&&await m}catch(m){if(je(m))throw m;if(xe(m))r=m;else if(!t.preload)throw m;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const n=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Wr(t,r):void 0,i=r&&t.preload?0:a!==void 0?Math.min(a+1,n):n;let c,d;for(let h=0;h<i;h++)s.push(li(t,s,h));try{await Promise.all(s)}catch{const h=await Promise.allSettled(s);for(const m of h){if(m.status!=="rejected")continue;const p=m.reason;if(je(p))throw p;xe(p)?c??=p:d??=p}if(d!==void 0)throw d}const l=c??(r&&!t.preload?r:void 0);let f=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!l&&r&&t.preload)return t.matches;if(l){const h=Wr(t,l);if(h===void 0){if(process.env.NODE_ENV!=="production")throw new Error("Invariant failed: Could not find match for notFound boundary");Be()}const m=t.matches[h],p=t.router.looseRoutesById[m.routeId],g=t.router.options?.defaultNotFoundComponent;!p.options.notFoundComponent&&g&&(p.options.notFoundComponent=g),l.routeId=m.routeId;const b=m.routeId===t.router.routeTree.id;t.updateMatch(m.id,x=>({...x,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:l},isFetching:!1})),f=h,await zt(p,["notFoundComponent"])}else if(!t.preload){const h=t.matches[0];h.globalNotFound||t.router.getMatch(h.id)?.globalNotFound&&t.updateMatch(h.id,m=>({...m,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const h=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await zt(h,["errorComponent"])}for(let h=0;h<=f;h++){const{id:m,routeId:p}=t.matches[h],g=t.router.looseRoutesById[p];try{const b=ci(t,m,g);if(b){const x=await b;t.updateMatch(m,y=>({...y,...x}))}}catch(b){console.error(`Error executing head for route ${p}:`,b)}}const u=tr(t);if(Ut(u)&&await u,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Kr(e,t){const s=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function zt(e,t=ds){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:n,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:t===ds?(()=>{if(e._componentsPromise===void 0){const r=Kr(e,ds);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Kr(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function so(e){for(const t of ds)if(e.options[t]?.preload)return!0;return!1}const ds=["component","errorComponent","pendingComponent","notFoundComponent"];function di(e){return{input:({url:t})=>{for(const s of e)t=sr(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=ro(e[s],t);return t}}}function ui(e){const t=Zn(e.basepath),s=`/${t}`,r=e.caseSensitive?s:s.toLowerCase(),n=`${r}/`;return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===r?a.pathname="/":i.startsWith(n)&&(a.pathname=a.pathname.slice(s.length)),a},output:({url:a})=>(a.pathname=ls(["/",t,a.pathname]),a)}}function sr(e,t){const s=e?.input?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function ro(e,t){const s=e?.output?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function fi(e,t){const{createMutableStore:s,createReadonlyStore:r,batch:n,init:a}=t,i=new Map,c=new Map,d=new Map,l=s(e.status),f=s(e.loadedAt),u=s(e.isLoading),h=s(e.isTransitioning),m=s(e.location),p=s(e.resolvedLocation),g=s(e.statusCode),b=s(e.redirect),x=s([]),y=s([]),S=s([]),w=r(()=>$s(i,x.get())),C=r(()=>$s(c,y.get())),_=r(()=>$s(d,S.get())),R=r(()=>x.get()[0]),j=r(()=>x.get().some(J=>i.get(J)?.get().status==="pending")),E=r(()=>({locationHref:m.get().href,resolvedLocationHref:p.get()?.href,status:l.get()})),A=r(()=>({status:l.get(),loadedAt:f.get(),isLoading:u.get(),isTransitioning:h.get(),matches:w.get(),location:m.get(),resolvedLocation:p.get(),statusCode:g.get(),redirect:b.get()})),P=$t(64);function I(J){let ue=P.get(J);return ue||(ue=r(()=>{const he=x.get();for(const O of he){const N=i.get(O);if(N&&N.routeId===J)return N.get()}}),P.set(J,ue)),ue}const ee={status:l,loadedAt:f,isLoading:u,isTransitioning:h,location:m,resolvedLocation:p,statusCode:g,redirect:b,matchesId:x,pendingIds:y,cachedIds:S,matches:w,pendingMatches:C,cachedMatches:_,firstId:R,hasPending:j,matchRouteDeps:E,matchStores:i,pendingMatchStores:c,cachedMatchStores:d,__store:A,getRouteMatchStore:I,setMatches:V,setPending:Z,setCached:Q};V(e.matches),a?.(ee);function V(J){zs(J,i,x,s,n)}function Z(J){zs(J,c,y,s,n)}function Q(J){zs(J,d,S,s,n)}return ee}function $s(e,t){const s=[];for(const r of t){const n=e.get(r);n&&s.push(n.get())}return s}function zs(e,t,s,r,n){const a=e.map(c=>c.id),i=new Set(a);n(()=>{for(const c of t.keys())i.has(c)||t.delete(c);for(const c of e){const d=t.get(c.id);if(!d){const l=r(c);l.routeId=c.routeId,t.set(c.id,l);continue}d.routeId=c.routeId,d.get()!==c&&d.set(c)}Da(s.get(),a)||s.set(a)})}var He="__TSR_index",Yr="popstate",Jr="beforeunload";function hi(e){let t=e.getLocation();const s=new Set,r=i=>{t=e.getLocation(),s.forEach(c=>c({location:t,action:i}))},n=i=>{e.notifyOnIndexChange??!0?r(i):t=e.getLocation()},a=async({task:i,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){i();return}const l=e.getBlockers?.()??[],f=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&l.length&&f)for(const u of l){const h=vs(d.path,d.state);if(await u.blockerFn({currentLocation:t,nextLocation:h,action:d.type})){e.onBlocked?.();return}}i()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:i=>(s.add(i),()=>{s.delete(i)}),push:(i,c,d)=>{const l=t.state[He];c=Xr(l+1,c),a({task:()=>{e.pushState(i,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:i,state:c})},replace:(i,c,d)=>{const l=t.state[He];c=Xr(l,c),a({task:()=>{e.replaceState(i,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:i,state:c})},go:(i,c)=>{a({task:()=>{e.go(i),n({type:"GO",index:i})},navigateOpts:c,type:"GO"})},back:i=>{a({task:()=>{e.back(i?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{a({task:()=>{e.forward(i?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>t.state[He]!==0,createHref:i=>e.createHref(i),block:i=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,i]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(l=>l!==i))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Xr(e,t){t||(t={});const s=gr();return{...t,key:s,__TSR_key:s,[He]:e}}function mi(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,r=t.history.replaceState;let n=[];const a=()=>n,i=j=>n=j,c=(j=>j),d=(()=>vs(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const j=gr();t.history.replaceState({[He]:0,key:j,__TSR_key:j},"")}let l=d(),f,u=!1,h=!1,m=!1,p=!1;const g=()=>l;let b,x;const y=()=>{b&&(R._ignoreSubscribers=!0,(b.isPush?t.history.pushState:t.history.replaceState)(b.state,"",b.href),R._ignoreSubscribers=!1,b=void 0,x=void 0,f=void 0)},S=(j,E,A)=>{const P=c(E);x||(f=l),l=vs(E,A),b={href:P,state:A,isPush:b?.isPush||j==="push"},x||(x=Promise.resolve().then(()=>y()))},w=j=>{l=d(),R.notify({type:j})},C=async()=>{if(h){h=!1;return}const j=d(),E=j.state[He]-l.state[He],A=E===1,P=E===-1,I=!A&&!P||u;u=!1;const ee=I?"GO":P?"BACK":"FORWARD",V=I?{type:"GO",index:E}:{type:P?"BACK":"FORWARD"};if(m)m=!1;else{const Z=a();if(typeof document<"u"&&Z.length){for(const Q of Z)if(await Q.blockerFn({currentLocation:l,nextLocation:j,action:ee})){h=!0,t.history.go(1),R.notify(V);return}}}l=d(),R.notify(V)},_=j=>{if(p){p=!1;return}let E=!1;const A=a();if(typeof document<"u"&&A.length)for(const P of A){const I=P.enableBeforeUnload??!0;if(I===!0){E=!0;break}if(typeof I=="function"&&I()===!0){E=!0;break}}if(E)return j.preventDefault(),j.returnValue=""},R=hi({getLocation:g,getLength:()=>t.history.length,pushState:(j,E)=>S("push",j,E),replaceState:(j,E)=>S("replace",j,E),back:j=>(j&&(m=!0),p=!0,t.history.back()),forward:j=>{j&&(m=!0),p=!0,t.history.forward()},go:j=>{u=!0,t.history.go(j)},createHref:j=>c(j),flush:y,destroy:()=>{t.history.pushState=s,t.history.replaceState=r,t.removeEventListener(Jr,_,{capture:!0}),t.removeEventListener(Yr,C)},onBlocked:()=>{f&&l!==f&&(l=f)},getBlockers:a,setBlockers:i,notifyOnIndexChange:!1});return t.addEventListener(Jr,_,{capture:!0}),t.addEventListener(Yr,C),t.history.pushState=function(...j){const E=s.apply(t.history,j);return R._ignoreSubscribers||w("PUSH"),E},t.history.replaceState=function(...j){const E=r.apply(t.history,j);return R._ignoreSubscribers||w("REPLACE"),E},R}function pi(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function vs(e,t){const s=pi(e),r=s.indexOf("#"),n=s.indexOf("?"),a=gr();return{href:s,pathname:s.substring(0,r>0?n>0?Math.min(r,n):r:n>0?n:s.length),hash:r>-1?s.substring(r):"",search:n>-1?s.slice(n,r===-1?void 0:r):"",state:t||{[He]:0,key:a,__TSR_key:a}}}function gr(){return(Math.random()+1).toString(36).substring(7)}function vt(e,t){const s=t,r=e;return{fromLocation:s,toLocation:r,pathChanged:s?.pathname!==r.pathname,hrefChanged:s?.href!==r.href,hashChanged:s?.hash!==r.hash}}const rr=new WeakMap;var gi=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=s=>s(),this.update=s=>{process.env.NODE_ENV!=="production"&&s.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,n=this.basepath??r?.basepath??"/",a=this.basepath===void 0,i=r?.rewrite;if(this.options={...r,...s},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ja(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=mi()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=$t(1e3),f=this.buildRouteTree(),this.setRoutes(f)}if(!this.stores&&this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=fi(bi(this.latestLocation),f),Ei(this)}let c=!1;const d=this.options.basepath??"/",l=this.options.rewrite;if(a||n!==d||i!==l){this.basepath=d;const f=[],u=Zn(d);u&&u!=="/"&&f.push(ui({basepath:d})),l&&f.push(l),this.rewrite=f.length===0?void 0:f.length===1?f[0]:di(f),this.history&&this.updateLatestLocation(),c=!0}c&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=Wa(this.routeTree,this.options.caseSensitive,(r,n)=>{r.init({originalIndex:n})});return this.options.routeMasks&&Ba(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,r)=>{const n={eventType:s,fn:r};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=s=>{this.subscribers.forEach(r=>{r.eventType===s.type&&r.fn(s)})},this.parseLocation=(s,r)=>{const n=({pathname:d,search:l,hash:f,href:u,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const x=this.options.parseSearch(l),y=this.options.stringifySearch(x);return{href:d+y+f,publicHref:d+y+f,pathname:At(d).path,external:!1,searchStr:y,search:Xe(r?.search,x),hash:At(f.slice(1)).path,state:tt(r?.state,h)}}const m=new URL(u,this.origin),p=sr(this.rewrite,m),g=this.options.parseSearch(p.search),b=this.options.stringifySearch(g);return p.search=b,{href:p.href.replace(p.origin,""),publicHref:u,pathname:At(p.pathname).path,external:!!this.rewrite&&p.origin!==this.origin,searchStr:b,search:Xe(r?.search,g),hash:At(p.hash.slice(1)).path,state:tt(r?.state,h)}},a=n(s),{__tempLocation:i,__tempKey:c}=a.state;if(i&&(!c||c===this.tempLocationKey)){const d=n(i);return d.state.key=a.state.key,d.state.__TSR_key=a.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:a}}return a},this.resolvePathWithBase=(s,r)=>Ya({base:s,to:r.includes("//")?pr(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,r,n)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:r},n):this.matchRoutesInternal(s,r),this.getMatchedRoutes=s=>yi({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const r=this.getMatch(s);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(s=>{this.cancelMatch(s)}),this.stores.matchesId.get().forEach(s=>{if(this.stores.pendingMatchStores.has(s))return;const r=this.stores.matchStores.get(s)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(s)})},this.buildLocation=s=>{const r=(a={})=>{const i=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutesLightweight(i);if(a.from&&process.env.NODE_ENV!=="production"&&a._isNavigate){const P=this.getMatchedRoutes(a.from).matchedRoutes,I=Br(c.matchedRoutes,V=>Qr(V.fullPath,a.from)),ee=Br(P,V=>Qr(V.fullPath,c.fullPath));!I&&!ee&&console.warn(`Could not find match for from: ${a.from}`)}const d=a.unsafeRelative==="path"?i.pathname:a.from??c.fullPath,l=a.to?`${a.to}`:void 0,f=c.search,u=Object.assign(Object.create(null),c.params),h=l?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),m=l?this.resolvePathWithBase(h,l):h,p=a.params===!1||a.params===null?Object.create(null):(a.params??!0)===!0?u:Object.assign(u,et(a.params,u)),g=this.routesByPath[Fe(m)];let b;if(g)b=this.getRouteBranch(g);else if(m.includes("$"))b=[];else{const P=this.getMatchedRoutes(m);b=P.matchedRoutes,this.options.notFoundRoute&&(!P.foundRoute||P.foundRoute.path!=="/"&&P.routeParams["**"])&&(b=[...b,this.options.notFoundRoute])}if(b.length&&qn(p))for(const P of b){const I=P.options.params?.stringify??P.options.stringifyParams;if(I)try{Object.assign(p,I(p))}catch{}}const x=s.leaveParams?m:At(zr({path:m,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;if(process.env.NODE_ENV!=="production"&&g&&!s.leaveParams)try{const P=this.getMatchedRoutes(x);P.foundRoute?.id!==g.id&&console.warn(`Generated path "${x}" for route "${g.id}" matched route "${P.foundRoute?.id}" instead. This can happen when multiple route templates resolve to the same URL. Use the route template that matches the intended route, or adjust params.stringify if it changed the target path.`)}catch{}let y=f;if(s._includeValidateSearch&&this.options.search?.strict){const P={};b.forEach(I=>{if(I.options.validateSearch)try{Object.assign(P,us(I.options.validateSearch,{...P,...y}))}catch{}}),y=P}y=vi({search:y,dest:a,destRoutes:b,_includeValidateSearch:s._includeValidateSearch}),y=Xe(f,y);const S=this.options.stringifySearch(y),w=a.hash===!0?i.hash:a.hash?et(a.hash,i.hash):void 0,C=w?`#${w}`:"";let _=a.state===!0?i.state:a.state?et(a.state,i.state):{};_=tt(i.state,_);const R=`${x}${S}${C}`;let j,E,A=!1;if(this.rewrite){const P=new URL(R,this.origin),I=ro(this.rewrite,P);j=P.href.replace(P.origin,""),I.origin!==this.origin?(E=I.href,A=!0):E=I.pathname+I.search+I.hash}else j=Ia(R),E=j;return{publicHref:E,href:j,pathname:x,search:y,searchStr:S,state:_,hash:w??"",external:A,unmaskOnReload:a.unmaskOnReload}},n=(a={},i)=>{const c=r(a);let d=i?r(i):void 0;if(!d){const l=Object.create(null);if(this.options.routeMasks){const f=Ua(c.pathname,this.processedTree);if(f){Object.assign(l,f.rawParams);const{from:u,params:h,...m}=f.route,p=h===!1||h===null?Object.create(null):(h??!0)===!0?l:Object.assign(l,et(h,l));i={from:s.from,...m,params:p},d=r(i)}}}return d&&(c.maskedLocation=d),c};return s.mask?n(s,{from:s.from,...s.mask}):n(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:r,...n})=>{let a;const i=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{n.state[u]=this.latestLocation.state[u]});const f=nt(n.state,this.latestLocation.state);return l.forEach(u=>{delete n.state[u]}),f},c=Fe(this.latestLocation.href)===Fe(n.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=wt(()=>{d?.resolve(),d=void 0}),c&&i())this.load();else{let{maskedLocation:l,hashScrollIntoView:f,...u}=n;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,a=n.replace?"REPLACE":"PUSH",this.history[a==="REPLACE"?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:r})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(a?{action:{type:a}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:r,hashScrollIntoView:n,viewTransition:a,ignoreBlocker:i,href:c,...d}={})=>{if(c){const u=this.history.location.state.__TSR_index,h=vs(c,{__TSR_index:s?u:u+1}),m=new URL(h.pathname,this.origin);d.to=sr(this.rewrite,m).pathname,d.search=this.options.parseSearch(h.search),d.hash=h.hash.slice(1)}const l=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const f=this.commitLocation({...l,viewTransition:a,replace:s,resetScroll:r,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:s,reloadDocument:r,href:n,publicHref:a,...i})=>{let c=!1;if(n)try{new URL(`${n}`),c=!0}catch{}if(c&&!r&&(r=!0),r){if(s!==void 0||!n){const l=this.buildLocation({to:s,...i});n=n??l.publicHref,a=a??l.publicHref}const d=!c&&a?a:n;if(bs(d,this.protocolAllowlist)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked navigation to dangerous protocol: ${d}`);return}if(!i.ignoreBlocker){const l=this.history.getBlockers?.()??[];for(const f of l)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}i.replace?window.location.replace(d):window.location.href=d;return}return this.buildAndCommitLocation({...i,href:n,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(n=>!s.some(a=>a.id===n.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(s),this.stores.setCached(r)})},this.load=async s=>{const r=s?.action?.type;let n,a,i;const c=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(l=>{this.startTransition(async()=>{try{this.beforeLoad(),r?rr.set(this.latestLocation,r):rr.delete(this.latestLocation);const f=this.latestLocation,u=vt(f,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...u}),this.emit({type:"onBeforeLoad",...u}),await Gr({router:this,sync:s?.sync,forceStaleReload:c.href===f.href,matches:this.stores.pendingMatches.get(),location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let h=null,m=null,p=null,g=null;this.batch(()=>{const b=this.stores.pendingMatches.get(),x=b.length,y=this.stores.matches.get();h=x?y.filter(C=>!this.stores.pendingMatchStores.has(C.id)):null;const S=new Set;for(const C of this.stores.pendingMatchStores.values())C.routeId&&S.add(C.routeId);const w=new Set;for(const C of this.stores.matchStores.values())C.routeId&&w.add(C.routeId);m=x?y.filter(C=>!S.has(C.routeId)):null,p=x?b.filter(C=>!w.has(C.routeId)):null,g=x?b.filter(C=>w.has(C.routeId)):y,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),x&&(this.stores.setMatches(b),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]),this.clearExpiredCache())});for(const[b,x]of[[m,"onLeave"],[p,"onEnter"],[g,"onStay"]])if(b)for(const y of b)this.looseRoutesById[y.routeId].options[x]?.(y)})})}})}catch(f){je(f)?(n=f,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):xe(f)&&(a=f);const u=n?n.status:a?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(u),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.stores.matches.get().some(l=>l.status==="error")&&(d=500),d!==void 0&&this.stores.statusCode.set(d)},this.startViewTransition=s=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let n;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,i=this.stores.resolvedLocation.get(),c=typeof r.types=="function"?r.types(vt(a,i)):r.types;if(c===!1){s();return}n={update:s,types:c}}else n=s;document.startViewTransition(n)}else s()},this.updateMatch=(s,r)=>{this.startTransition(()=>{const n=this.stores.pendingMatchStores.get(s);if(n){n.set(r);return}const a=this.stores.matchStores.get(s);if(a){a.set(r);return}const i=this.stores.cachedMatchStores.get(s);if(i){const c=r(i.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(s)&&this.stores.cachedIds.set(d=>d.filter(l=>l!==s)):i.set(c)}})},this.getMatch=s=>this.stores.cachedMatchStores.get(s)?.get()??this.stores.pendingMatchStores.get(s)?.get()??this.stores.matchStores.get(s)?.get(),this.invalidate=s=>{const r=n=>s?.filter?.(n)??!0?{...n,invalid:!0,...s?.forcePending||n.status==="error"||n.status==="notFound"?{status:"pending",error:void 0}:void 0}:n;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:s?.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const r=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const n=s.options._builtLocation??this.buildLocation(s.options),a=this.getParsedLocationHref(n);s.options.href=a,s.headers.set("Location",a)}else if(r)try{const n=new URL(r);if(this.origin&&n.origin===this.origin){const a=n.pathname+n.search+n.hash;s.options.href=a,s.headers.set("Location",a)}}catch{}if(s.options.href&&!s.options._builtLocation&&bs(s.options.href,this.protocolAllowlist))throw new Error(process.env.NODE_ENV!=="production"?`Redirect blocked: unsafe protocol in href "${s.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`:"Redirect blocked: unsafe protocol");return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const r=s?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(n=>!r(n))):this.stores.setCached([])},this.clearExpiredCache=()=>{const s=Date.now(),r=n=>{const a=this.looseRoutesById[n.routeId];if(!a.options.loader)return!0;const i=(n.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:s-n.updatedAt>=i};this.clearCache({filter:r})},this.loadRouteChunk=zt,this.preloadRoute=async s=>{const r=s._builtLocation??this.buildLocation(s);let n=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:s});const a=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...a,...this.stores.cachedIds.get()]),c=n.filter(d=>!i.has(d.id));if(c.length){const d=this.stores.cachedMatches.get();this.stores.setCached([...d,...c])}try{return n=await Gr({router:this,matches:n,location:r,preload:!0,updateMatch:(d,l)=>{a.has(d)?n=n.map(f=>f.id===d?l(f):f):this.updateMatch(d,l)}}),n}catch(d){if(je(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});xe(d)||console.error(d);return}},this.matchRoute=(s,r)=>{const n={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},a=this.buildLocation(n);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const i=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=$a(a.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,i.pathname,this.processedTree);return!c||s.params&&!nt(c.rawParams,s.params,{partial:!0})?!1:r?.includeSearch??!0?nt(i.search,a.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(s=>s.status==="notFound"||s.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??ei,parseSearch:e.parseSearch??Qa,protocolAllowlist:e.protocolAllowlist??Ma}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:s}){this.routesById=e,this.routesByPath=t,this.processedTree=s;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Jn(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const s=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:n}=s;let{matchedRoutes:a}=s,i=!1;(r?r.path!=="/"&&n["**"]:Fe(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:i=!0);const c=i?Si(this.options.notFoundMode,a):void 0,d=new Array(a.length),l=new Map;for(const f of this.stores.matchStores.values())f.routeId&&l.set(f.routeId,f.get());for(let f=0;f<a.length;f++){const u=a[f],h=d[f-1];let m,p,g;{const I=h?.search??e.search,ee=h?._strictSearch??void 0;try{const V=us(u.options.validateSearch,{...I})??void 0;m={...I,...V},p={...ee,...V},g=void 0}catch(V){let Z=V;if(V instanceof ws||(Z=new ws(V.message,{cause:V})),t?.throwOnError)throw Z;m=I,p={},g=Z}}const b=u.options.loaderDeps?.({search:m})??"",x=b?JSON.stringify(b):"",{interpolatedPath:y,usedParams:S}=zr({path:u.fullPath,params:n,decoder:this.pathParamsDecoder,server:this.isServer}),w=u.id+y+x,C=this.getMatch(w),_=l.get(u.id),R=C?._strictParams??S;let j;if(!C)try{en(u,R)}catch(I){if(xe(I)||je(I)?j=I:j=new xi(I.message,{cause:I}),t?.throwOnError)throw j}Object.assign(n,R);const E=_?"stay":"enter";let A;if(C)A={...C,cause:E,params:_?.params??n,_strictParams:R,search:Xe(_?_.search:C.search,m),_strictSearch:p};else{const I=u.options.loader||u.options.beforeLoad||u.lazyFn||so(u)?"pending":"success";A={id:w,ssr:u.options.ssr,index:f,routeId:u.id,params:_?.params??n,_strictParams:R,pathname:y,updatedAt:Date.now(),search:_?Xe(_.search,m):m,_strictSearch:p,searchError:void 0,status:I,isFetching:!1,error:void 0,paramsError:j,__routeContext:void 0,_nonReactive:{loadPromise:wt()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:E,loaderDeps:_?tt(_.loaderDeps,b):b,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:u.options.staticData||{},fullPath:u.fullPath}}t?.preload||(A.globalNotFound=c===u.id),A.searchError=g;const P=this.getParentContext(h);A.context={...P,...A.__routeContext,...A.__beforeLoadContext},d[f]=A}for(let f=0;f<d.length;f++){const u=d[f],h=this.looseRoutesById[u.routeId],m=this.getMatch(u.id),p=l.get(u.routeId);if(u.params=p?Xe(p.params,n):n,!m){const g=d[f-1],b=this.getParentContext(g);if(h.options.context){const x={deps:u.loaderDeps,params:u.params,context:b??{},location:e,navigate:y=>this.navigate({...y,_fromLocation:e}),buildLocation:this.buildLocation,cause:u.cause,abortController:u.abortController,preload:!!u.preload,matches:d,routeId:h.id};u.__routeContext=h.options.context(x)??void 0}u.context={...b,...u.__routeContext,...u.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const t=Bt(this.stores.matchesId.get()),s=this.lightweightCache.get(e);if(s&&s[0]===t)return s[1];const{matchedRoutes:r,routeParams:n}=this.getMatchedRoutes(e.pathname),a=Bt(r),i={...e.search};for(const u of r)try{Object.assign(i,us(u.options.validateSearch,i))}catch{}const c=t&&this.stores.matchStores.get(t)?.get(),d=c&&c.routeId===a.id&&c.pathname===e.pathname;let l;if(d)l=c.params;else{const u=Object.assign(Object.create(null),n);for(const h of r)try{en(h,u)}catch{}l=u}const f={matchedRoutes:r,fullPath:a.fullPath,search:i,params:l};return this.lightweightCache.set(e,[t,f]),f}},ws=class extends Error{},xi=class extends Error{};const Zr=e=>e.endsWith("/")&&e.length>1?e.slice(0,-1):e;function Qr(e,t){return Zr(e)===Zr(t)}function bi(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function us(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new ws("Async validation not supported");if(s.issues)throw new ws(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function yi({pathname:e,routesById:t,processedTree:s}){const r=Object.create(null),n=Fe(e);let a;const i=za(n,s,!0);return i&&(a=i.route,Object.assign(r,i.rawParams)),{matchedRoutes:i?.branch||[t.__root__],routeParams:r,foundRoute:a}}function vi({search:e,dest:t,destRoutes:s,_includeValidateSearch:r}){return wi(s)(e,t,r??!1)}function wi(e){let t,s;const r=[];for(const a of e){const i=a.options;if("search"in i)i.search?.middlewares&&r.push(...i.search.middlewares);else if(i.preSearchFilters||i.postSearchFilters){const d=({search:l,next:f})=>{const u=f(i.preSearchFilters?i.preSearchFilters.reduce((h,m)=>m(h),l):l);return i.postSearchFilters?i.postSearchFilters.reduce((h,m)=>m(h),u):u};r.push(d)}const c=i.validateSearch;if(c){const d=({search:l,next:f,meta:u})=>{const h=f(l);if(s)try{const m=us(c,h);if(u&&m)for(const p in m)p in h||(u.defaulted||=new Map).set(p,m[p]);return{...h,...m}}catch{}return h};r.push(d)}}const n=(a,i,c)=>{if(a>=r.length){if(!t.search)return{};if(t.search===!0)return i;const l=et(t.search,i);return c&&(c.explicit=l),l}const d=(l,f)=>{if(f){const u=c||{};return{search:n(a+1,l,u),meta:u}}return n(a+1,l,c)};return r[a]({search:i,next:d,meta:c})};return function(i,c,d){return t=c,s=d,n(0,i)}}function Si(e,t){if(e!=="root")for(let s=t.length-1;s>=0;s--){const r=t[s];if(r.children)return r.id}return ot}function en(e,t){const s=e.options.params?.parse??e.options.parseParams;if(s){const r=s(t);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,r)}}function ji(){try{return sessionStorage}catch{return}}const Ni="tsr-scroll-restoration-v1_3",no=ji();function Ri(){try{return JSON.parse(no?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function Ci(){try{no?.setItem(Ni,JSON.stringify(xt))}catch{process.env.NODE_ENV!=="production"&&console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}const xt=Ri(),tn="data-scroll-restoration-id",_i=e=>e.state.__TSR_key||e.href;function ki(e){const t=e.getAttribute(tn);if(t)return`[${tn}="${t}"]`;let s="",r=e,n;for(;n=r.parentNode;){let a=1,i=r;for(;i=i.previousElementSibling;)a++;const c=`${r.localName}:nth-child(${a})`;s=s?`${c} > ${s}`:c,r=n}return s}let Xt=!1;const bt="window";function nr(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function sn(e){const t=[];for(const s of e){if(s===bt)continue;const r=nr(s);r&&t.push(r)}return t}function Ei(e,t){const s=e.options.scrollRestoration,r=e._scroll;s&&(r.restoring=!0);const n=e.options.getScrollRestorationKey||_i,a=new Map,i=(l,f,u)=>{const h=a.get(l)||{};h.scrollX=f,h.scrollY=u,a.set(l,h)},c=l=>{if(!(Xt||!r.restoring))if(l.target===document)i(bt,scrollX,scrollY);else{const f=l.target;i(f,f.scrollLeft,f.scrollTop)}},d=l=>{if(!r.restoring)return;const f=xt[l]||={};for(const[u,h]of a)u===bt?f[bt]=h:u.isConnected&&(f[ki(u)]=h)};s&&!r.restoration&&(r.restoration=!0,Xt=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c,!0),e.subscribe("onBeforeLoad",l=>{l.fromLocation&&d(n(l.fromLocation)),a.clear()}),addEventListener("pagehide",()=>{d(n(e.stores.resolvedLocation.get()??e.stores.location.get())),Ci()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",l=>{const f=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,h=r.next;let m;if(a.clear(),h||(r.next=!0),typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const p=n(l.toLocation),g=l.fromLocation&&n(l.fromLocation);if(r.restoring&&g&&g!==p){const b=xt[g];if(b){let x=xt[p];for(const y in b){if(y===bt){if(h)continue}else{const S=nr(y);if(!S||h&&u&&(m??=sn(u),m.includes(S)))continue}x||(x=xt[p]={}),x[y]??=b[y]}}}Xt=!0;try{const b=l.toLocation.hash,x=l.toLocation.state.__hashScrollIntoViewOptions??!0;let y=!1;if(h){const S=rr.get(l.toLocation),w=b&&x&&(S==="PUSH"||S==="REPLACE"),C=r.restoring?xt[p]:void 0;if(C)for(const _ in C){const{scrollX:R,scrollY:j}=C[_];if(_===bt){if(w)continue;scrollTo({top:j,left:R,behavior:f}),y=!0}else{const E=nr(_);E&&(E.scrollLeft=R,E.scrollTop=j)}}if(!y&&!b){const _={top:0,left:0,behavior:f};if(scrollTo(_),u){m??=sn(u);for(const R of m)R.scrollTo(_)}}}!y&&b&&x&&document.getElementById(b)?.scrollIntoView(x)}finally{Xt=!1}}))}const Pi="Error preloading route! ☝️";var oo=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const s=this.options,r=!s?.path&&!s?.id;if(this.parentRoute=this.options.getParentRoute?.(),r)this._path=ot;else if(!this.parentRoute){if(process.env.NODE_ENV!=="production")throw new Error("Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");Be()}let n=r?ot:s?.path;n&&n!=="/"&&(n=Xn(n));const a=s?.id||n;let i=r?ot:ls([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);n==="__root__"&&(n="/"),i!=="__root__"&&(i=ls(["/",i]));const c=i==="__root__"?"/":ls([this.parentRoute.fullPath,n]);this._path=n,this._id=i,this._fullPath=c,this._to=Fe(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>ri({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},Ti=class extends oo{constructor(e){super(e)}};function xr(e){const t=e.errorComponent??br;return o.jsx(Ai,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:r})=>s?$.createElement(t,{error:s,reset:r}):e.children})}var Ai=class extends $.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const s=e.getResetKey();return t.error&&t.resetKey!==s?{resetKey:s,error:null}:{resetKey:s}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function br({error:e}){const[t,s]=$.useState(process.env.NODE_ENV!=="production");return o.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[o.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),o.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(r=>!r),children:t?"Hide Error":"Show Error"})]}),o.jsx("div",{style:{height:".25rem"}}),t?o.jsx("div",{children:o.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?o.jsx("code",{children:e.message}):null})}):null]})}function Oi({children:e,fallback:t=null}){return ao()?o.jsx(k.Fragment,{children:e}):o.jsx(k.Fragment,{children:t})}function ao(){return k.useSyncExternalStore(Li,()=>!0,()=>!1)}function Li(){return()=>{}}var io=$.createContext(null);function Ce(e){const t=$.useContext(io);return process.env.NODE_ENV!=="production"&&(t||console.warn("Warning: useRouter must be used inside a <RouterProvider> component!")),t}var Ts=$.createContext(void 0),Mi=$.createContext(void 0),ne=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(ne||{});function Ii({update:e,notify:t,unwatched:s}){return{link:r,unlink:n,propagate:a,checkDirty:i,shallowPropagate:c};function r(l,f,u){const h=f.depsTail;if(h!==void 0&&h.dep===l)return;const m=h!==void 0?h.nextDep:f.deps;if(m!==void 0&&m.dep===l){m.version=u,f.depsTail=m;return}const p=l.subsTail;if(p!==void 0&&p.version===u&&p.sub===f)return;const g=f.depsTail=l.subsTail={version:u,dep:l,sub:f,prevDep:h,nextDep:m,prevSub:p,nextSub:void 0};m!==void 0&&(m.prevDep=g),h!==void 0?h.nextDep=g:f.deps=g,p!==void 0?p.nextSub=g:l.subs=g}function n(l,f=l.sub){const u=l.dep,h=l.prevDep,m=l.nextDep,p=l.nextSub,g=l.prevSub;return m!==void 0?m.prevDep=h:f.depsTail=h,h!==void 0?h.nextDep=m:f.deps=m,p!==void 0?p.prevSub=g:u.subsTail=g,g!==void 0?g.nextSub=p:(u.subs=p)===void 0&&s(u),m}function a(l){let f=l.nextSub,u;e:do{const h=l.sub;let m=h.flags;if(m&60?m&12?m&4?!(m&48)&&d(l,h)?(h.flags=m|40,m&=1):m=0:h.flags=m&-9|32:m=0:h.flags=m|32,m&2&&t(h),m&1){const p=h.subs;if(p!==void 0){const g=(l=p).nextSub;g!==void 0&&(u={value:f,prev:u},f=g);continue}}if((l=f)!==void 0){f=l.nextSub;continue}for(;u!==void 0;)if(l=u.value,u=u.prev,l!==void 0){f=l.nextSub;continue e}break}while(!0)}function i(l,f){let u,h=0,m=!1;e:do{const p=l.dep,g=p.flags;if(f.flags&16)m=!0;else if((g&17)===17){if(e(p)){const b=p.subs;b.nextSub!==void 0&&c(b),m=!0}}else if((g&33)===33){(l.nextSub!==void 0||l.prevSub!==void 0)&&(u={value:l,prev:u}),l=p.deps,f=p,++h;continue}if(!m){const b=l.nextDep;if(b!==void 0){l=b;continue}}for(;h--;){const b=f.subs,x=b.nextSub!==void 0;if(x?(l=u.value,u=u.prev):l=b,m){if(e(f)){x&&c(b),f=l.sub;continue}m=!1}else f.flags&=-33;f=l.sub;const y=l.nextDep;if(y!==void 0){l=y;continue e}}return m}while(!0)}function c(l){do{const f=l.sub,u=f.flags;(u&48)===32&&(f.flags=u|16,(u&6)===2&&t(f))}while((l=l.nextSub)!==void 0)}function d(l,f){let u=f.depsTail;for(;u!==void 0;){if(u===l)return!0;u=u.prevDep}return!1}}function Di(e,t,s){const r=typeof e=="object",n=r?e:void 0;return{next:(r?e.next:e)?.bind(n),error:(r?e.error:t)?.bind(n),complete:(r?e.complete:s)?.bind(n)}}const or=[];let fs=0;const{link:rn,unlink:Fi,propagate:Bi,checkDirty:co,shallowPropagate:nn}=Ii({update(e){return e._update()},notify(e){or[ar++]=e,e.flags&=~ne.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=ne.Mutable|ne.Dirty,Ss(e))}});let Zt=0,ar=0,Oe,ir=0;function lo(e){try{++ir,e()}finally{--ir||uo()}}function Ss(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=Fi(s,e)}function uo(){if(!(ir>0)){for(;Zt<ar;){const e=or[Zt];or[Zt++]=void 0,e.notify()}Zt=0,ar=0}}function on(e,t){const s=typeof e=="function",r=e,n={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?ne.None:ne.Mutable,get(){return Oe!==void 0&&rn(n,Oe,fs),n._snapshot},subscribe(a){const i=Di(a),c={current:!1},d=Ui(()=>{n.get(),c.current?i.next?.(n._snapshot):c.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const i=Oe,c=t?.compare??Object.is;if(s)Oe=n,++fs,n.depsTail=void 0;else if(a===void 0)return!1;s&&(n.flags=ne.Mutable|ne.RecursedCheck);try{const d=n._snapshot,l=typeof a=="function"?a(d):a===void 0&&s?r(d):a;return d===void 0||!c(d,l)?(n._snapshot=l,!0):!1}finally{Oe=i,s&&(n.flags&=~ne.RecursedCheck),Ss(n)}}};return s?(n.flags=ne.Mutable|ne.Dirty,n.get=function(){const a=n.flags;if(a&ne.Dirty||a&ne.Pending&&co(n.deps,n)){if(n._update()){const i=n.subs;i!==void 0&&nn(i)}}else a&ne.Pending&&(n.flags=a&~ne.Pending);return Oe!==void 0&&rn(n,Oe,fs),n._snapshot}):n.set=function(a){if(n._update(a)){const i=n.subs;i!==void 0&&(Bi(i),nn(i),uo())}},n}function Ui(e){const t=()=>{const r=Oe;Oe=s,++fs,s.depsTail=void 0,s.flags=ne.Watching|ne.RecursedCheck;try{return e()}finally{Oe=r,s.flags&=~ne.RecursedCheck,Ss(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:ne.Watching|ne.RecursedCheck,notify(){const r=this.flags;r&ne.Dirty||r&ne.Pending&&co(this.deps,this)?t():this.flags=ne.Watching},stop(){this.flags=ne.None,this.depsTail=void 0,Ss(this)}};return t(),s}var Qt={exports:{}},Vs={},es={exports:{}},Ws={};var an;function $i(){if(an)return Ws;an=1;var e=k;function t(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var s=typeof Object.is=="function"?Object.is:t,r=e.useState,n=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function c(u,h){var m=h(),p=r({inst:{value:m,getSnapshot:h}}),g=p[0].inst,b=p[1];return a(function(){g.value=m,g.getSnapshot=h,d(g)&&b({inst:g})},[u,m,h]),n(function(){return d(g)&&b({inst:g}),u(function(){d(g)&&b({inst:g})})},[u]),i(m),m}function d(u){var h=u.getSnapshot;u=u.value;try{var m=h();return!s(u,m)}catch{return!0}}function l(u,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:c;return Ws.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Ws}var Hs={};var cn;function zi(){return cn||(cn=1,process.env.NODE_ENV!=="production"&&(function(){function e(m,p){return m===p&&(m!==0||1/m===1/p)||m!==m&&p!==p}function t(m,p){f||n.startTransition===void 0||(f=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=p();if(!u){var b=p();a(g,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}b=i({inst:{value:g,getSnapshot:p}});var x=b[0].inst,y=b[1];return d(function(){x.value=g,x.getSnapshot=p,s(x)&&y({inst:x})},[m,g,p]),c(function(){return s(x)&&y({inst:x}),m(function(){s(x)&&y({inst:x})})},[m]),l(g),g}function s(m){var p=m.getSnapshot;m=m.value;try{var g=p();return!a(m,g)}catch{return!0}}function r(m,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=k,a=typeof Object.is=="function"?Object.is:e,i=n.useState,c=n.useEffect,d=n.useLayoutEffect,l=n.useDebugValue,f=!1,u=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Hs.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Hs}var ln;function fo(){return ln||(ln=1,process.env.NODE_ENV==="production"?es.exports=$i():es.exports=zi()),es.exports}var dn;function Vi(){if(dn)return Vs;dn=1;var e=k,t=fo();function s(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var r=typeof Object.is=="function"?Object.is:s,n=t.useSyncExternalStore,a=e.useRef,i=e.useEffect,c=e.useMemo,d=e.useDebugValue;return Vs.useSyncExternalStoreWithSelector=function(l,f,u,h,m){var p=a(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=c(function(){function x(_){if(!y){if(y=!0,S=_,_=h(_),m!==void 0&&g.hasValue){var R=g.value;if(m(R,_))return w=R}return w=_}if(R=w,r(S,_))return R;var j=h(_);return m!==void 0&&m(R,j)?(S=_,R):(S=_,w=j)}var y=!1,S,w,C=u===void 0?null:u;return[function(){return x(f())},C===null?void 0:function(){return x(C())}]},[f,u,h,m]);var b=n(l,p[0],p[1]);return i(function(){g.hasValue=!0,g.value=b},[b]),d(b),b},Vs}var qs={};var un;function Wi(){return un||(un=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,s=fo(),r=typeof Object.is=="function"?Object.is:e,n=s.useSyncExternalStore,a=t.useRef,i=t.useEffect,c=t.useMemo,d=t.useDebugValue;qs.useSyncExternalStoreWithSelector=function(l,f,u,h,m){var p=a(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=c(function(){function x(_){if(!y){if(y=!0,S=_,_=h(_),m!==void 0&&g.hasValue){var R=g.value;if(m(R,_))return w=R}return w=_}if(R=w,r(S,_))return R;var j=h(_);return m!==void 0&&m(R,j)?(S=_,R):(S=_,w=j)}var y=!1,S,w,C=u===void 0?null:u;return[function(){return x(f())},C===null?void 0:function(){return x(C())}]},[f,u,h,m]);var b=n(l,p[0],p[1]);return i(function(){g.hasValue=!0,g.value=b},[b]),d(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),qs}var fn;function Hi(){return fn||(fn=1,process.env.NODE_ENV==="production"?Qt.exports=Vi():Qt.exports=Wi()),Qt.exports}var qi=Hi();function Gi(e,t){return e===t}function Re(e,t,s=Gi){const r=k.useCallback(i=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(i);return c},[e]),n=k.useCallback(()=>e?.get(),[e]);return qi.useSyncExternalStoreWithSelector(r,n,n,t,s)}var Gs={get(){},subscribe(){return{unsubscribe(){}}}};function Ki(e,t){const s=$.useRef();return r=>{const n=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?s.current=tt(s.current,n):n}}function ut(e){const t=Ce(),s=$.useContext(e.from?Mi:Ts),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(s),n=Ki(e,t),a=Re(r??Gs,i=>i?n(i):Gs);if(a!==Gs)return a;if(e.shouldThrow??!0){if(process.env.NODE_ENV!=="production")throw new Error(`Invariant failed: Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`);Be()}}function ho(e){return ut({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function mo(e){const{select:t,...s}=e;return ut({...s,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function po(e){return ut({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function go(e){return ut({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function xo(e){const t=Ce();return $.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function bo(e){return ut({...e,select:t=>e.select?e.select(t.context):t.context})}function Yi(e,t){const s=Ce(),r=Pa(t),{activeProps:n,inactiveProps:a,activeOptions:i,to:c,preload:d,preloadDelay:l,preloadIntentProximity:f,hashScrollIntoView:u,replace:h,startTransition:m,resetScroll:p,viewTransition:g,children:b,target:x,disabled:y,style:S,className:w,onClick:C,onBlur:_,onFocus:R,onMouseEnter:j,onMouseLeave:E,onTouchStart:A,ignoreBlocker:P,params:I,search:ee,hash:V,state:Z,mask:Q,reloadDocument:J,unsafeRelative:ue,from:he,_fromLocation:O,...N}=e,B=ao(),H=$.useMemo(()=>e,[s,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),G=Re(s.stores.location,re=>re,(re,Se)=>re.href===Se.href),D=$.useMemo(()=>{const re={_fromLocation:G,...H};return s.buildLocation(re)},[s,G,H]),F=D.maskedLocation?D.maskedLocation.publicHref:D.publicHref,U=D.maskedLocation?D.maskedLocation.external:D.external,X=$.useMemo(()=>tc(F,U,s.history,y),[y,U,F,s.history]),K=$.useMemo(()=>{if(X?.external){if(bs(X.href,s.protocolAllowlist)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${X.href}`);return}return X.href}if(!sc(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{if(new URL(c),bs(c,s.protocolAllowlist)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${c}`);return}return c}catch{}},[c,X,s.protocolAllowlist]),fe=$.useMemo(()=>{if(K)return!1;if(i?.exact){if(!Ka(G.pathname,D.pathname,s.basepath))return!1}else{const re=ys(G.pathname,s.basepath),Se=ys(D.pathname,s.basepath);if(!(re.startsWith(Se)&&(re.length===Se.length||re[Se.length]==="/")))return!1}return(i?.includeSearch??!0)&&!nt(G.search,D.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?B&&G.hash===D.hash:!0},[i?.exact,i?.explicitUndefined,i?.includeHash,i?.includeSearch,G,K,B,D.hash,D.pathname,D.search,s.basepath]),ve=fe?et(n,{})??Ji:Ks,ae=fe?Ks:et(a,{})??Ks,Me=[w,ve.className,ae.className].filter(Boolean).join(" "),_e=(S||ve.style||ae.style)&&{...S,...ve.style,...ae.style},[ke,z]=$.useState(!1),pe=$.useRef(!1),we=e.reloadDocument||K?!1:d??s.options.defaultPreload,Ee=l??s.options.defaultPreloadDelay??0,Te=$.useCallback(()=>{s.preloadRoute({...H,_builtLocation:D}).catch(re=>{console.warn(re),console.warn(Pi)})},[s,H,D]);Ea(r,$.useCallback(re=>{re?.isIntersecting&&Te()},[Te]),ec,{disabled:!!y||we!=="viewport"}),$.useEffect(()=>{pe.current||!y&&we==="render"&&(Te(),pe.current=!0)},[y,Te,we]);const Ms=re=>{const Se=re.currentTarget.getAttribute("target"),Je=x!==void 0?x:Se;if(!y&&!rc(re)&&!re.defaultPrevented&&(!Je||Je==="_self")&&re.button===0){re.preventDefault(),Na.flushSync(()=>{z(!0)});const ja=s.subscribe("onResolved",()=>{ja(),z(!1)});s.navigate({...H,replace:h,resetScroll:p,hashScrollIntoView:u,startTransition:m,viewTransition:g,ignoreBlocker:P})}};if(K)return{...N,ref:r,href:K,...b&&{children:b},...x&&{target:x},...y&&{disabled:y},...S&&{style:S},...w&&{className:w},...C&&{onClick:C},..._&&{onBlur:_},...R&&{onFocus:R},...j&&{onMouseEnter:j},...E&&{onMouseLeave:E},...A&&{onTouchStart:A}};const Ue=re=>{if(y||we!=="intent")return;if(!Ee){Te();return}const Se=re.currentTarget;if(Lt.has(Se))return;const Je=setTimeout(()=>{Lt.delete(Se),Te()},Ee);Lt.set(Se,Je)},Sa=re=>{y||we!=="intent"||Te()},Tr=re=>{if(y||!we||!Ee)return;const Se=re.currentTarget,Je=Lt.get(Se);Je&&(clearTimeout(Je),Lt.delete(Se))};return{...N,...ve,...ae,href:X?.href,ref:r,onClick:mt([C,Ms]),onBlur:mt([_,Tr]),onFocus:mt([R,Ue]),onMouseEnter:mt([j,Ue]),onMouseLeave:mt([E,Tr]),onTouchStart:mt([A,Sa]),disabled:!!y,target:x,..._e&&{style:_e},...Me&&{className:Me},...y&&Xi,...fe&&Zi,...B&&ke&&Qi}}var Ks={},Ji={className:"active"},Xi={role:"link","aria-disabled":!0},Zi={"data-status":"active","aria-current":"page"},Qi={"data-transitioning":"transitioning"},Lt=new WeakMap,ec={rootMargin:"100px"},mt=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function tc(e,t,s,r){if(!r)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function sc(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var js=$.forwardRef((e,t)=>{const{_asChild:s,...r}=e,{type:n,...a}=Yi(r,t),i=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!s){const{disabled:c,...d}=a;return $.createElement("a",d,i)}return $.createElement(s,a,i)});function rc(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var nc=class extends oo{constructor(e){super(e),this.useMatch=t=>ut({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>bo({...t,from:this.id}),this.useSearch=t=>go({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>po({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>mo({...t,from:this.id}),this.useLoaderData=t=>ho({...t,from:this.id}),this.useNavigate=()=>xo({from:this.fullPath}),this.Link=k.forwardRef((t,s)=>o.jsx(js,{ref:s,from:this.fullPath,...t}))}};function Ct(e){return new nc(e)}var oc=class extends Ti{constructor(e){super(e),this.useMatch=t=>ut({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>bo({...t,from:this.id}),this.useSearch=t=>go({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>po({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>mo({...t,from:this.id}),this.useLoaderData=t=>ho({...t,from:this.id}),this.useNavigate=()=>xo({from:this.fullPath}),this.Link=k.forwardRef((t,s)=>o.jsx(js,{ref:s,from:this.fullPath,...t}))}};function ac(e){return new oc(e)}function ic(e){const t=Ce(),s=`not-found-${Re(t.stores.location,r=>r.pathname)}-${Re(t.stores.status,r=>r)}`;return o.jsx(xr,{getResetKey:()=>s,onCatch:(r,n)=>{if(xe(r))e.onCatch?.(r,n);else throw r},errorComponent:({error:r})=>{if(xe(r))return e.fallback?.(r);throw r},children:e.children})}function cc(){return o.jsx("p",{children:"Not Found"})}function yt(e){return o.jsx(o.Fragment,{children:e.children})}function yo(e,t,s){return t.options.notFoundComponent?o.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?o.jsx(e.options.defaultNotFoundComponent,{...s}):(process.env.NODE_ENV!=="production"&&(t.options.notFoundComponent||console.warn(`Warning: A notFoundError was encountered on the route with ID "${t.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`)),o.jsx(cc,{}))}function lc(e){return null}function dc(){return lc(Ce()),null}var uc=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,fc=(e,t)=>e[0]===t[0]&&e[1]===t[1],vo=$.memo(function({matchId:t}){const s=Ce(),r=s.stores.matchStores.get(t);if(!r){if(process.env.NODE_ENV!=="production")throw new Error(`Invariant failed: Could not find match for matchId "${t}". Please file an issue!`);Be()}const n=Re(s.stores.loadedAt,i=>i),a=Re(r,i=>i,uc);return o.jsx(hc,{router:s,matchId:t,resetKey:n,matchState:$.useMemo(()=>{const i=a.routeId,c=s.routesById[i].parentRoute?.id;return{routeId:i,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:c}},[a._displayPending,a.routeId,a.ssr,s.routesById])})});function hc({router:e,matchId:t,resetKey:s,matchState:r}){const n=e.routesById[r.routeId],a=n.options.pendingComponent??e.options.defaultPendingComponent,i=a?o.jsx(a,{}):null,c=n.options.errorComponent??e.options.defaultErrorComponent,d=n.options.onCatch??e.options.defaultOnCatch,l=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,f=r.ssr===!1||r.ssr==="data-only",u=(!n.isRoot||n.options.wrapInSuspense||f)&&(n.options.wrapInSuspense??a??(n.options.errorComponent?.preload||f))?$.Suspense:yt,h=c?xr:yt,m=l?ic:yt;return o.jsxs(n.isRoot?n.options.shellComponent??yt:yt,{children:[o.jsx(Ts.Provider,{value:t,children:o.jsx(u,{fallback:i,children:o.jsx(h,{getResetKey:()=>s,errorComponent:c||br,onCatch:(p,g)=>{if(xe(p))throw p.routeId??=r.routeId,p;process.env.NODE_ENV!=="production"&&console.warn(`Warning: Error in route match: ${t}`),d?.(p,g)},children:o.jsx(m,{fallback:p=>{if(p.routeId??=r.routeId,!l||p.routeId&&p.routeId!==r.routeId||!p.routeId&&!n.isRoot)throw p;return $.createElement(l,p)},children:f||r._displayPending?o.jsx(Oi,{fallback:i,children:o.jsx(hn,{matchId:t})}):o.jsx(hn,{matchId:t})})})})}),r.parentRouteId===ot?o.jsxs(o.Fragment,{children:[o.jsx(mc,{}),e.options.scrollRestoration&&Wn?o.jsx(dc,{}):null]}):null]})}function mc(){const e=Ce(),t=$.useRef();return Ft(()=>{const s=e.stores.resolvedLocation.get(),r=t.current;s&&(!r||r.href!==s.href)&&e.emit({type:"onRendered",...vt(e.stores.location.get(),r??s)}),t.current=s},[Re(e.stores.resolvedLocation,s=>s?.state.__TSR_key),e]),null}var hn=$.memo(function({matchId:t}){const s=Ce(),r=(f,u)=>s.getMatch(f.id)?._nonReactive[u]??f._nonReactive[u],n=s.stores.matchStores.get(t);if(!n){if(process.env.NODE_ENV!=="production")throw new Error(`Invariant failed: Could not find match for matchId "${t}". Please file an issue!`);Be()}const a=Re(n,f=>f),i=a.routeId,c=s.routesById[i],d=$.useMemo(()=>{const f=(s.routesById[i].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:i,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return f?JSON.stringify(f):void 0},[i,a.loaderDeps,a._strictParams,a._strictSearch,s.options.defaultRemountDeps,s.routesById]),l=$.useMemo(()=>{const f=c.options.component??s.options.defaultComponent;return f?o.jsx(f,{},d):o.jsx(wo,{})},[d,c.options.component,s.options.defaultComponent]);if(a._displayPending)throw r(a,"displayPendingPromise");if(a._forcePending)throw r(a,"minPendingPromise");if(a.status==="pending"){const f=c.options.pendingMinMs??s.options.defaultPendingMinMs;if(f){const u=s.getMatch(a.id);if(u&&!u._nonReactive.minPendingPromise){const h=wt();u._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),u._nonReactive.minPendingPromise=void 0},f)}}throw r(a,"loadPromise")}if(a.status==="notFound"){if(!xe(a.error)){if(process.env.NODE_ENV!=="production")throw new Error("Invariant failed: Expected a notFound error");Be()}return yo(s,c,a.error)}if(a.status==="redirected"){if(!je(a.error)){if(process.env.NODE_ENV!=="production")throw new Error("Invariant failed: Expected a redirect error");Be()}throw r(a,"loadPromise")}if(a.status==="error")throw a.error;return l}),wo=$.memo(function(){const t=Ce(),s=$.useContext(Ts);let r,n=!1,a;{const l=s?t.stores.matchStores.get(s):void 0;[r,n]=Re(l,f=>[f?.routeId,f?.globalNotFound??!1],fc),a=Re(t.stores.matchesId,f=>f[f.findIndex(u=>u===s)+1])}const i=r?t.routesById[r]:void 0,c=t.options.defaultPendingComponent?o.jsx(t.options.defaultPendingComponent,{}):null;if(n){if(!i){if(process.env.NODE_ENV!=="production")throw new Error("Invariant failed: Could not resolve route for Outlet render");Be()}return yo(t,i,void 0)}if(!a)return null;const d=o.jsx(vo,{matchId:a});return r===ot?o.jsx($.Suspense,{fallback:c,children:d}):d});function pc(){const e=Ce(),t=$.useRef({router:e,mounted:!1}),[s,r]=$.useState(!1),n=Re(e.stores.isLoading,u=>u),a=Re(e.stores.hasPending,u=>u),i=Is(n),c=n||s||a,d=Is(c),l=n||a,f=Is(l);return e.startTransition=u=>{r(!0),$.startTransition(()=>{u(),r(!1)})},$.useEffect(()=>{const u=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Fe(e.latestLocation.publicHref)!==Fe(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{u()}},[e,e.history]),Ft(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),Ft(()=>{i&&!n&&e.emit({type:"onLoad",...vt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[i,e,n]),Ft(()=>{f&&!l&&e.emit({type:"onBeforeRouteMount",...vt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,f,e]),Ft(()=>{if(d&&!c){const u=vt(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...u}),lo(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[c,d,e]),null}function gc(){const e=Ce(),t=e.routesById[ot].options.pendingComponent??e.options.defaultPendingComponent,s=t?o.jsx(t,{}):null,r=o.jsxs(typeof document<"u"&&e.ssr?yt:$.Suspense,{fallback:s,children:[o.jsx(pc,{}),o.jsx(xc,{})]});return e.options.InnerWrap?o.jsx(e.options.InnerWrap,{children:r}):r}function xc(){const e=Ce(),t=Re(e.stores.firstId,n=>n),s=Re(e.stores.loadedAt,n=>n),r=t?o.jsx(vo,{matchId:t}):null;return o.jsx(Ts.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:o.jsx(xr,{getResetKey:()=>s,errorComponent:br,onCatch:process.env.NODE_ENV!=="production"?n=>{console.warn("Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),console.warn(`Warning: ${n.message||n.toString()}`)}:void 0,children:r})})}var bc=e=>({createMutableStore:on,createReadonlyStore:on,batch:lo}),So=e=>new yc(e),yc=class extends gi{constructor(e){super(e,bc)}};function vc({router:e,children:t,...s}){qn(s)&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const r=o.jsx(io.Provider,{value:e,children:t});return e.options.Wrap?o.jsx(e.options.Wrap,{children:r}):r}function wc({router:e,...t}){return o.jsx(vc,{router:e,...t,children:o.jsx(gc,{})})}function jo(e,t){return function(){return e.apply(t,arguments)}}const{toString:Sc}=Object.prototype,{getPrototypeOf:St}=Object,{iterator:Wt,toStringTag:No}=Symbol,Ns=(({hasOwnProperty:e})=>(t,s)=>e.call(t,s))(Object.prototype),Vt=(e,t)=>{let s=e;const r=[];for(;s!=null&&s!==Object.prototype;){if(r.indexOf(s)!==-1)return!1;if(r.push(s),Ns(s,t))return!0;s=St(s)}return!1},jc=(e,t)=>e!=null&&Vt(e,t)?e[t]:void 0,yr=(e=>t=>{const s=Sc.call(t);return e[s]||(e[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),Pe=e=>(e=e.toLowerCase(),t=>yr(t)===e),As=e=>t=>typeof t===e,{isArray:lt}=Array,jt=As("undefined");function _t(e){return e!==null&&!jt(e)&&e.constructor!==null&&!jt(e.constructor)&&Ne(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ro=Pe("ArrayBuffer");function Nc(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ro(e.buffer),t}const Rc=As("string"),Ne=As("function"),Co=As("number"),kt=e=>e!==null&&typeof e=="object",Cc=e=>e===!0||e===!1,hs=e=>{if(!kt(e))return!1;const t=St(e);return(t===null||t===Object.prototype||St(t)===null)&&!Vt(e,No)&&!Vt(e,Wt)},_c=e=>{if(!kt(e)||_t(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},kc=Pe("Date"),Ec=Pe("File"),Pc=e=>!!(e&&typeof e.uri<"u"),Tc=e=>e&&typeof e.getParts<"u",Ac=Pe("Blob"),Oc=Pe("FileList"),Lc=e=>kt(e)&&Ne(e.pipe);function Mc(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const mn=Mc(),pn=typeof mn.FormData<"u"?mn.FormData:void 0,Ic=e=>{if(!e)return!1;if(pn&&e instanceof pn)return!0;const t=St(e);if(!t||t===Object.prototype||!Ne(e.append))return!1;const s=yr(e);return s==="formdata"||s==="object"&&Ne(e.toString)&&e.toString()==="[object FormData]"},Dc=Pe("URLSearchParams"),[Fc,Bc,Uc,$c]=["ReadableStream","Request","Response","Headers"].map(Pe),zc=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ht(e,t,{allOwnKeys:s=!1}={}){if(e===null||typeof e>"u")return;let r,n;if(typeof e!="object"&&(e=[e]),lt(e))for(r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else{if(_t(e))return;const a=s?Object.getOwnPropertyNames(e):Object.keys(e),i=a.length;let c;for(r=0;r<i;r++)c=a[r],t.call(null,e[c],c,e)}}function _o(e,t){if(_t(e))return null;t=t.toLowerCase();const s=Object.keys(e);let r=s.length,n;for(;r-- >0;)if(n=s[r],t===n.toLowerCase())return n;return null}const rt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ko=e=>!jt(e)&&e!==rt;function cr(...e){const{caseless:t,skipUndefined:s}=ko(this)&&this||{},r={},n=(a,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const c=t&&typeof i=="string"&&_o(r,i)||i,d=Ns(r,c)?r[c]:void 0;hs(d)&&hs(a)?r[c]=cr(d,a):hs(a)?r[c]=cr({},a):lt(a)?r[c]=a.slice():(!s||!jt(a))&&(r[c]=a)};for(let a=0,i=e.length;a<i;a++){const c=e[a];if(!c||_t(c)||(Ht(c,n),typeof c!="object"||lt(c)))continue;const d=Object.getOwnPropertySymbols(c);for(let l=0;l<d.length;l++){const f=d[l];el.call(c,f)&&n(c[f],f)}}return r}const Vc=(e,t,s,{allOwnKeys:r}={})=>(Ht(t,(n,a)=>{s&&Ne(n)?Object.defineProperty(e,a,{__proto__:null,value:jo(n,s),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,a,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Wc=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Hc=(e,t,s,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),s&&Object.assign(e.prototype,s)},qc=(e,t,s,r)=>{let n,a,i;const c={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)i=n[a],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=s!==!1&&St(e)}while(e&&(!s||s(e,t))&&e!==Object.prototype);return t},Gc=(e,t,s)=>{e=String(e),(s===void 0||s>e.length)&&(s=e.length),s-=t.length;const r=e.indexOf(t,s);return r!==-1&&r===s},Kc=e=>{if(!e)return null;if(lt(e))return e;let t=e.length;if(!Co(t))return null;const s=new Array(t);for(;t-- >0;)s[t]=e[t];return s},Yc=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&St(Uint8Array)),Jc=(e,t)=>{const r=(e&&e[Wt]).call(e);let n;for(;(n=r.next())&&!n.done;){const a=n.value;t.call(e,a[0],a[1])}},Xc=(e,t)=>{let s;const r=[];for(;(s=e.exec(t))!==null;)r.push(s);return r},Zc=Pe("HTMLFormElement"),Qc=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,r,n){return r.toUpperCase()+n}),{propertyIsEnumerable:el}=Object.prototype,tl=Pe("RegExp"),Eo=(e,t)=>{const s=Object.getOwnPropertyDescriptors(e),r={};Ht(s,(n,a)=>{let i;(i=t(n,a,e))!==!1&&(r[a]=i||n)}),Object.defineProperties(e,r)},sl=e=>{Eo(e,(t,s)=>{if(Ne(e)&&["arguments","caller","callee"].includes(s))return!1;const r=e[s];if(Ne(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},rl=(e,t)=>{const s={},r=n=>{n.forEach(a=>{s[a]=!0})};return lt(e)?r(e):r(String(e).split(t)),s},nl=()=>{},ol=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function al(e){return!!(e&&Ne(e.append)&&e[No]==="FormData"&&e[Wt])}const il=e=>{const t=new WeakSet,s=r=>{if(kt(r)){if(t.has(r))return;if(_t(r))return r;if(!("toJSON"in r)){t.add(r);const n=lt(r)?[]:{};return Ht(r,(a,i)=>{const c=s(a);!jt(c)&&(n[i]=c)}),t.delete(r),n}}return r};return s(e)},cl=Pe("AsyncFunction"),ll=e=>e&&(kt(e)||Ne(e))&&Ne(e.then)&&Ne(e.catch),Po=((e,t)=>e?setImmediate:t?((s,r)=>(rt.addEventListener("message",({source:n,data:a})=>{n===rt&&a===s&&r.length&&r.shift()()},!1),n=>{r.push(n),rt.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",Ne(rt.postMessage)),dl=typeof queueMicrotask<"u"?queueMicrotask.bind(rt):typeof process<"u"&&process.nextTick||Po,To=e=>e!=null&&Ne(e[Wt]),ul=e=>e!=null&&Vt(e,Wt)&&To(e),v={isArray:lt,isArrayBuffer:Ro,isBuffer:_t,isFormData:Ic,isArrayBufferView:Nc,isString:Rc,isNumber:Co,isBoolean:Cc,isObject:kt,isPlainObject:hs,isEmptyObject:_c,isReadableStream:Fc,isRequest:Bc,isResponse:Uc,isHeaders:$c,isUndefined:jt,isDate:kc,isFile:Ec,isReactNativeBlob:Pc,isReactNative:Tc,isBlob:Ac,isRegExp:tl,isFunction:Ne,isStream:Lc,isURLSearchParams:Dc,isTypedArray:Yc,isFileList:Oc,forEach:Ht,merge:cr,extend:Vc,trim:zc,stripBOM:Wc,inherits:Hc,toFlatObject:qc,kindOf:yr,kindOfTest:Pe,endsWith:Gc,toArray:Kc,forEachEntry:Jc,matchAll:Xc,isHTMLForm:Zc,hasOwnProperty:Ns,hasOwnProp:Ns,hasOwnInPrototypeChain:Vt,getSafeProp:jc,reduceDescriptors:Eo,freezeMethods:sl,toObjectSet:rl,toCamelCase:Qc,noop:nl,toFiniteNumber:ol,findKey:_o,global:rt,isContextDefined:ko,isSpecCompliantForm:al,toJSONObject:il,isAsyncFn:cl,isThenable:ll,setImmediate:Po,asap:dl,isIterable:To,isSafeIterable:ul},fl=v.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"]),hl=e=>{const t={};let s,r,n;return e&&e.split(`
7
+ `).forEach(function(i){n=i.indexOf(":"),s=i.substring(0,n).trim().toLowerCase(),r=i.substring(n+1).trim(),!(!s||t[s]&&fl[s])&&(s==="set-cookie"?t[s]?t[s].push(r):t[s]=[r]:t[s]=t[s]?t[s]+", "+r:r)}),t};function ml(e){let t=0,s=e.length;for(;t<s;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;s>t;){const r=e.charCodeAt(s-1);if(r!==9&&r!==32)break;s-=1}return t===0&&s===e.length?e:e.slice(t,s)}const pl=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),gl=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function vr(e,t){return v.isArray(e)?e.map(s=>vr(s,t)):ml(String(e).replace(t,""))}const xl=e=>vr(e,pl),bl=e=>vr(e,gl);function Ao(e){const t=Object.create(null);return v.forEach(e.toJSON(),(s,r)=>{t[r]=bl(s)}),t}const gn=Symbol("internals");function Mt(e){return e&&String(e).trim().toLowerCase()}function ms(e){return e===!1||e==null?e:v.isArray(e)?e.map(ms):xl(String(e))}function yl(e){const t=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=s.exec(e);)t[r[1]]=r[2];return t}const vl=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ys(e,t,s,r,n){if(v.isFunction(r))return r.call(this,t,s);if(n&&(t=s),!!v.isString(t)){if(v.isString(r))return t.indexOf(r)!==-1;if(v.isRegExp(r))return r.test(t)}}function wl(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,s,r)=>s.toUpperCase()+r)}function Sl(e,t){const s=v.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+s,{__proto__:null,value:function(n,a,i){return this[r].call(this,t,n,a,i)},configurable:!0})})}let be=class{constructor(t){t&&this.set(t)}set(t,s,r){const n=this;function a(c,d,l){const f=Mt(d);if(!f)return;const u=v.findKey(n,f);(!u||n[u]===void 0||l===!0||l===void 0&&n[u]!==!1)&&(n[u||d]=ms(c))}const i=(c,d)=>v.forEach(c,(l,f)=>a(l,f,d));if(v.isPlainObject(t)||t instanceof this.constructor)i(t,s);else if(v.isString(t)&&(t=t.trim())&&!vl(t))i(hl(t),s);else if(v.isObject(t)&&v.isSafeIterable(t)){let c=Object.create(null),d,l;for(const f of t){if(!v.isArray(f))throw new TypeError("Object iterator must return a key-value pair");l=f[0],v.hasOwnProp(c,l)?(d=c[l],c[l]=v.isArray(d)?[...d,f[1]]:[d,f[1]]):c[l]=f[1]}i(c,s)}else t!=null&&a(s,t,r);return this}get(t,s){if(t=Mt(t),t){const r=v.findKey(this,t);if(r){const n=this[r];if(!s)return n;if(s===!0)return yl(n);if(v.isFunction(s))return s.call(this,n,r);if(v.isRegExp(s))return s.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,s){if(t=Mt(t),t){const r=v.findKey(this,t);return!!(r&&this[r]!==void 0&&(!s||Ys(this,this[r],r,s)))}return!1}delete(t,s){const r=this;let n=!1;function a(i){if(i=Mt(i),i){const c=v.findKey(r,i);c&&(!s||Ys(r,r[c],c,s))&&(delete r[c],n=!0)}}return v.isArray(t)?t.forEach(a):a(t),n}clear(t){const s=Object.keys(this);let r=s.length,n=!1;for(;r--;){const a=s[r];(!t||Ys(this,this[a],a,t,!0))&&(delete this[a],n=!0)}return n}normalize(t){const s=this,r={};return v.forEach(this,(n,a)=>{const i=v.findKey(r,a);if(i){s[i]=ms(n),delete s[a];return}const c=t?wl(a):String(a).trim();c!==a&&delete s[a],s[c]=ms(n),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const s=Object.create(null);return v.forEach(this,(r,n)=>{r!=null&&r!==!1&&(s[n]=t&&v.isArray(r)?r.join(", "):r)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,s])=>t+": "+s).join(`
8
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...s){const r=new this(t);return s.forEach(n=>r.set(n)),r}static accessor(t){const r=(this[gn]=this[gn]={accessors:{}}).accessors,n=this.prototype;function a(i){const c=Mt(i);r[c]||(Sl(n,i),r[c]=!0)}return v.isArray(t)?t.forEach(a):a(t),this}};be.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);v.reduceDescriptors(be.prototype,({value:e},t)=>{let s=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[s]=r}}});v.freezeMethods(be);const jl="[REDACTED ****]";function Nl(e){if(v.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(v.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Rl(e,t){const s=new Set(t.map(a=>String(a).toLowerCase())),r=[],n=a=>{if(a===null||typeof a!="object"||v.isBuffer(a))return a;if(r.indexOf(a)!==-1)return;a instanceof be&&(a=a.toJSON()),r.push(a);let i;if(v.isArray(a))i=[],a.forEach((c,d)=>{const l=n(c);v.isUndefined(l)||(i[d]=l)});else{if(!v.isPlainObject(a)&&Nl(a))return r.pop(),a;i=Object.create(null);for(const[c,d]of Object.entries(a)){const l=s.has(c.toLowerCase())?jl:n(d);v.isUndefined(l)||(i[c]=l)}}return r.pop(),i};return n(e)}let T=class Oo extends Error{static from(t,s,r,n,a,i){const c=new Oo(t.message,s||t.code,r,n,a);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),i&&Object.assign(c,i),c}constructor(t,s,r,n,a){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,s&&(this.code=s),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status)}toJSON(){const t=this.config,s=t&&v.hasOwnProp(t,"redact")?t.redact:void 0,r=v.isArray(s)&&s.length>0?Rl(t,s):v.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};T.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";T.ERR_BAD_OPTION="ERR_BAD_OPTION";T.ECONNABORTED="ECONNABORTED";T.ETIMEDOUT="ETIMEDOUT";T.ECONNREFUSED="ECONNREFUSED";T.ERR_NETWORK="ERR_NETWORK";T.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";T.ERR_DEPRECATED="ERR_DEPRECATED";T.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";T.ERR_BAD_REQUEST="ERR_BAD_REQUEST";T.ERR_CANCELED="ERR_CANCELED";T.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";T.ERR_INVALID_URL="ERR_INVALID_URL";T.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Cl=null,Lo=100;function lr(e){return v.isPlainObject(e)||v.isArray(e)}function Mo(e){return v.endsWith(e,"[]")?e.slice(0,-2):e}function Js(e,t,s){return e?e.concat(t).map(function(n,a){return n=Mo(n),!s&&a?"["+n+"]":n}).join(s?".":""):t}function _l(e){return v.isArray(e)&&!e.some(lr)}const kl=v.toFlatObject(v,{},null,function(t){return/^is[A-Z]/.test(t)});function Os(e,t,s){if(!v.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,s=v.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,S){return!v.isUndefined(S[y])});const r=s.metaTokens,n=s.visitor||p,a=s.dots,i=s.indexes,c=s.Blob||typeof Blob<"u"&&Blob,d=s.maxDepth===void 0?Lo:s.maxDepth,l=c&&v.isSpecCompliantForm(t),f=[];if(!v.isFunction(n))throw new TypeError("visitor must be a function");function u(x){if(x===null)return"";if(v.isDate(x))return x.toISOString();if(v.isBoolean(x))return x.toString();if(!l&&v.isBlob(x))throw new T("Blob is not supported. Use a Buffer instead.");if(v.isArrayBuffer(x)||v.isTypedArray(x)){if(l&&typeof c=="function")return new c([x]);if(typeof Buffer<"u")return Buffer.from(x);throw new T("Blob is not supported. Use a Buffer instead.",T.ERR_NOT_SUPPORT)}return x}function h(x){if(x>d)throw new T("Object is too deeply nested ("+x+" levels). Max depth: "+d,T.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(x,y){if(d===1/0)return JSON.stringify(x);const S=[];return JSON.stringify(x,function(C,_){if(!v.isObject(_))return _;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(_),h(y+S.length-1),_})}function p(x,y,S){let w=x;if(v.isReactNative(t)&&v.isReactNativeBlob(x))return t.append(Js(S,y,a),u(x)),!1;if(x&&!S&&typeof x=="object"){if(v.endsWith(y,"{}"))y=r?y:y.slice(0,-2),x=m(x,1);else if(v.isArray(x)&&_l(x)||(v.isFileList(x)||v.endsWith(y,"[]"))&&(w=v.toArray(x)))return y=Mo(y),w.forEach(function(_,R){!(v.isUndefined(_)||_===null)&&t.append(i===!0?Js([y],R,a):i===null?y:y+"[]",u(_))}),!1}return lr(x)?!0:(t.append(Js(S,y,a),u(x)),!1)}const g=Object.assign(kl,{defaultVisitor:p,convertValue:u,isVisitable:lr});function b(x,y,S=0){if(!v.isUndefined(x)){if(h(S),f.indexOf(x)!==-1)throw new Error("Circular reference detected in "+y.join("."));f.push(x),v.forEach(x,function(C,_){(!(v.isUndefined(C)||C===null)&&n.call(t,C,v.isString(_)?_.trim():_,y,g))===!0&&b(C,y?y.concat(_):[_],S+1)}),f.pop()}}if(!v.isObject(e))throw new TypeError("data must be an object");return b(e),t}function xn(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function wr(e,t){this._pairs=[],e&&Os(e,this,t)}const Io=wr.prototype;Io.append=function(t,s){this._pairs.push([t,s])};Io.toString=function(t){const s=t?r=>t.call(this,r,xn):xn;return this._pairs.map(function(n){return s(n[0])+"="+s(n[1])},"").join("&")};function El(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Do(e,t,s){if(!t)return e;e=e||"";const r=v.isFunction(s)?{serialize:s}:s,n=v.getSafeProp(r,"encode")||El,a=v.getSafeProp(r,"serialize");let i;if(a?i=a(t,r):i=v.isURLSearchParams(t)?t.toString():new wr(t,r).toString(n),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class bn{constructor(){this.handlers=[]}use(t,s,r){return this.handlers.push({fulfilled:t,rejected:s,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){v.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Sr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Pl=typeof URLSearchParams<"u"?URLSearchParams:wr,Tl=typeof FormData<"u"?FormData:null,Al=typeof Blob<"u"?Blob:null,Ol={isBrowser:!0,classes:{URLSearchParams:Pl,FormData:Tl,Blob:Al},protocols:["http","https","file","blob","url","data"]},jr=typeof window<"u"&&typeof document<"u",dr=typeof navigator=="object"&&navigator||void 0,Ll=jr&&(!dr||["ReactNative","NativeScript","NS"].indexOf(dr.product)<0),Ml=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Il=jr&&window.location.href||"http://localhost",Dl=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:jr,hasStandardBrowserEnv:Ll,hasStandardBrowserWebWorkerEnv:Ml,navigator:dr,origin:Il},Symbol.toStringTag,{value:"Module"})),me={...Dl,...Ol};function Fl(e,t){return Os(e,new me.classes.URLSearchParams,{visitor:function(s,r,n,a){return me.isNode&&v.isBuffer(s)?(this.append(r,s.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}const yn=Lo;function Fo(e){if(e>yn)throw new T("FormData field is too deeply nested ("+e+" levels). Max depth: "+yn,T.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Bl(e){const t=[],s=/\w+|\[(\w*)]/g;let r;for(;(r=s.exec(e))!==null;)Fo(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function Ul(e){const t={},s=Object.keys(e);let r;const n=s.length;let a;for(r=0;r<n;r++)a=s[r],t[a]=e[a];return t}function Bo(e){function t(s,r,n,a){Fo(a);let i=s[a++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),d=a>=s.length;return i=!i&&v.isArray(n)?n.length:i,d?(v.hasOwnProp(n,i)?n[i]=v.isArray(n[i])?n[i].concat(r):[n[i],r]:n[i]=r,!c):((!v.hasOwnProp(n,i)||!v.isObject(n[i]))&&(n[i]=[]),t(s,r,n[i],a)&&v.isArray(n[i])&&(n[i]=Ul(n[i])),!c)}if(v.isFormData(e)&&v.isFunction(e.entries)){const s={};return v.forEachEntry(e,(r,n)=>{t(Bl(r),n,s,0)}),s}return null}const pt=(e,t)=>e!=null&&v.hasOwnProp(e,t)?e[t]:void 0;function $l(e,t,s){if(v.isString(e))try{return(t||JSON.parse)(e),v.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(s||JSON.stringify)(e)}const qt={transitional:Sr,adapter:["xhr","http","fetch"],transformRequest:[function(t,s){const r=s.getContentType()||"",n=r.indexOf("application/json")>-1,a=v.isObject(t);if(a&&v.isHTMLForm(t)&&(t=new FormData(t)),v.isFormData(t))return n?JSON.stringify(Bo(t)):t;if(v.isArrayBuffer(t)||v.isBuffer(t)||v.isStream(t)||v.isFile(t)||v.isBlob(t)||v.isReadableStream(t))return t;if(v.isArrayBufferView(t))return t.buffer;if(v.isURLSearchParams(t))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){const d=pt(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return Fl(t,d).toString();if((c=v.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=pt(this,"env"),f=l&&l.FormData;return Os(c?{"files[]":t}:t,f&&new f,d)}}return a||n?(s.setContentType("application/json",!1),$l(t)):t}],transformResponse:[function(t){const s=pt(this,"transitional")||qt.transitional,r=s&&s.forcedJSONParsing,n=pt(this,"responseType"),a=n==="json";if(v.isResponse(t)||v.isReadableStream(t))return t;if(t&&v.isString(t)&&(r&&!n||a)){const c=!(s&&s.silentJSONParsing)&&a;try{return JSON.parse(t,pt(this,"parseReviver"))}catch(d){if(c)throw d.name==="SyntaxError"?T.from(d,T.ERR_BAD_RESPONSE,this,null,pt(this,"response")):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};v.forEach(["delete","get","head","post","put","patch","query"],e=>{qt.headers[e]={}});function Xs(e,t){const s=this||qt,r=t||s,n=be.from(r.headers);let a=r.data;return v.forEach(e,function(c){a=c.call(s,a,n.normalize(),t?t.status:void 0)}),n.normalize(),a}function Uo(e){return!!(e&&e.__CANCEL__)}let Gt=class extends T{constructor(t,s,r){super(t??"canceled",T.ERR_CANCELED,s,r),this.name="CanceledError",this.__CANCEL__=!0}};function $o(e,t,s){const r=s.config.validateStatus;!s.status||!r||r(s.status)?e(s):t(new T("Request failed with status code "+s.status,s.status>=400&&s.status<500?T.ERR_BAD_REQUEST:T.ERR_BAD_RESPONSE,s.config,s.request,s))}function zl(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function Vl(e,t){e=e||10;const s=new Array(e),r=new Array(e);let n=0,a=0,i;return t=t!==void 0?t:1e3,function(d){const l=Date.now(),f=r[a];i||(i=l),s[n]=d,r[n]=l;let u=a,h=0;for(;u!==n;)h+=s[u++],u=u%e;if(n=(n+1)%e,n===a&&(a=(a+1)%e),l-i<t)return;const m=f&&l-f;return m?Math.round(h*1e3/m):void 0}}function Wl(e,t){let s=0,r=1e3/t,n,a;const i=(l,f=Date.now())=>{s=f,n=null,a&&(clearTimeout(a),a=null),e(...l)};return[(...l)=>{const f=Date.now(),u=f-s;u>=r?i(l,f):(n=l,a||(a=setTimeout(()=>{a=null,i(n)},r-u)))},()=>n&&i(n)]}const Rs=(e,t,s=3)=>{let r=0;const n=Vl(50,250);return Wl(a=>{if(!a||typeof a.loaded!="number")return;const i=a.loaded,c=a.lengthComputable?a.total:void 0,d=c!=null?Math.min(i,c):i,l=Math.max(0,d-r),f=n(l);r=Math.max(r,d);const u={loaded:d,total:c,progress:c?d/c:void 0,bytes:l,rate:f||void 0,estimated:f&&c?(c-d)/f:void 0,event:a,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(u)},s)},vn=(e,t)=>{const s=e!=null;return[r=>t[0]({lengthComputable:s,total:e,loaded:r}),t[1]]},wn=e=>(...t)=>v.asap(()=>e(...t)),Hl=me.hasStandardBrowserEnv?((e,t)=>s=>(s=new URL(s,me.origin),e.protocol===s.protocol&&e.host===s.host&&(t||e.port===s.port)))(new URL(me.origin),me.navigator&&/(msie|trident)/i.test(me.navigator.userAgent)):()=>!0,ql=me.hasStandardBrowserEnv?{write(e,t,s,r,n,a,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];v.isNumber(s)&&c.push(`expires=${new Date(s).toUTCString()}`),v.isString(r)&&c.push(`path=${r}`),v.isString(n)&&c.push(`domain=${n}`),a===!0&&c.push("secure"),v.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let s=0;s<t.length;s++){const r=t[s].replace(/^\s+/,""),n=r.indexOf("=");if(n!==-1&&r.slice(0,n)===e)try{return decodeURIComponent(r.slice(n+1))}catch{return r.slice(n+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Gl(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Kl(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const Yl=/^https?:(?!\/\/)/i,Jl=/[\t\n\r]/g;function Xl(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Zl(e){return Xl(e).replace(Jl,"")}function Sn(e,t){if(typeof e=="string"&&Yl.test(Zl(e)))throw new T('Invalid URL: missing "//" after protocol',T.ERR_INVALID_URL,t)}function zo(e,t,s,r){Sn(t,r);let n=!Gl(t);return e&&(n||s===!1)?(Sn(e,r),Kl(e,t)):t}const jn=e=>e instanceof be?{...e}:e;function dt(e,t){e=e||{},t=t||{};const s=Object.create(null);Object.defineProperty(s,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(f,u,h,m){return v.isPlainObject(f)&&v.isPlainObject(u)?v.merge.call({caseless:m},f,u):v.isPlainObject(u)?v.merge({},u):v.isArray(u)?u.slice():u}function n(f,u,h,m){if(v.isUndefined(u)){if(!v.isUndefined(f))return r(void 0,f,h,m)}else return r(f,u,h,m)}function a(f,u){if(!v.isUndefined(u))return r(void 0,u)}function i(f,u){if(v.isUndefined(u)){if(!v.isUndefined(f))return r(void 0,f)}else return r(void 0,u)}function c(f){const u=v.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!v.isUndefined(u))if(v.isPlainObject(u)){if(v.hasOwnProp(u,f))return u[f]}else return;const h=v.hasOwnProp(e,"transitional")?e.transitional:void 0;if(v.isPlainObject(h)&&v.hasOwnProp(h,f))return h[f]}function d(f,u,h){if(v.hasOwnProp(t,h))return r(f,u);if(v.hasOwnProp(e,h))return r(void 0,f)}const l={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:d,headers:(f,u,h)=>n(jn(f),jn(u),h,!0)};return v.forEach(Object.keys({...e,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const h=v.hasOwnProp(l,u)?l[u]:n,m=v.hasOwnProp(e,u)?e[u]:void 0,p=v.hasOwnProp(t,u)?t[u]:void 0,g=h(m,p,u);v.isUndefined(g)&&h!==d||(s[u]=g)}),v.hasOwnProp(t,"validateStatus")&&v.isUndefined(t.validateStatus)&&c("validateStatusUndefinedResolves")===!1&&(v.hasOwnProp(e,"validateStatus")?s.validateStatus=r(void 0,e.validateStatus):delete s.validateStatus),s}const Ql=["content-type","content-length"];function ed(e,t,s){if(s!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([r,n])=>{Ql.includes(r.toLowerCase())&&e.set(r,n)})}const td=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,s)=>String.fromCharCode(parseInt(s,16)));function Vo(e){const t=dt({},e),s=h=>v.hasOwnProp(t,h)?t[h]:void 0,r=s("data");let n=s("withXSRFToken");const a=s("xsrfHeaderName"),i=s("xsrfCookieName");let c=s("headers");const d=s("auth"),l=s("baseURL"),f=s("allowAbsoluteUrls"),u=s("url");if(t.headers=c=be.from(c),t.url=Do(zo(l,u,f,t),s("params"),s("paramsSerializer")),d){const h=v.getSafeProp(d,"username")||"",m=v.getSafeProp(d,"password")||"";try{c.set("Authorization","Basic "+btoa(h+":"+(m?td(m):"")))}catch(p){throw T.from(p,T.ERR_BAD_OPTION_VALUE,e)}}if(v.isFormData(r)&&(me.hasStandardBrowserEnv||me.hasStandardBrowserWebWorkerEnv||v.isReactNative(r)?c.setContentType(void 0):v.isFunction(r.getHeaders)&&ed(c,r.getHeaders(),s("formDataHeaderPolicy"))),me.hasStandardBrowserEnv&&(v.isFunction(n)&&(n=n(t)),n===!0||n==null&&Hl(t.url))){const m=a&&i&&ql.read(i);m&&c.set(a,m)}return t}const sd=typeof XMLHttpRequest<"u",rd=sd&&function(e){return new Promise(function(s,r){const n=Vo(e);let a=n.data;const i=be.from(n.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:l}=n,f,u,h,m,p;function g(){m&&m(),p&&p(),n.cancelToken&&n.cancelToken.unsubscribe(f),n.signal&&n.signal.removeEventListener("abort",f)}let b=new XMLHttpRequest;b.open(n.method.toUpperCase(),n.url,!0),b.timeout=n.timeout;function x(){if(!b)return;const S=be.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),C={data:!c||c==="text"||c==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:S,config:e,request:b};$o(function(R){s(R),g()},function(R){r(R),g()},C),b=null}"onloadend"in b?b.onloadend=x:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.startsWith("file:"))||setTimeout(x)},b.onabort=function(){b&&(r(new T("Request aborted",T.ECONNABORTED,e,b)),g(),b=null)},b.onerror=function(w){const C=w&&w.message?w.message:"Network Error",_=new T(C,T.ERR_NETWORK,e,b);_.event=w||null,r(_),g(),b=null},b.ontimeout=function(){let w=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const C=n.transitional||Sr;n.timeoutErrorMessage&&(w=n.timeoutErrorMessage),r(new T(w,C.clarifyTimeoutError?T.ETIMEDOUT:T.ECONNABORTED,e,b)),g(),b=null},a===void 0&&i.setContentType(null),"setRequestHeader"in b&&v.forEach(Ao(i),function(w,C){b.setRequestHeader(C,w)}),v.isUndefined(n.withCredentials)||(b.withCredentials=!!n.withCredentials),c&&c!=="json"&&(b.responseType=n.responseType),l&&([h,p]=Rs(l,!0),b.addEventListener("progress",h)),d&&b.upload&&([u,m]=Rs(d),b.upload.addEventListener("progress",u),b.upload.addEventListener("loadend",m)),(n.cancelToken||n.signal)&&(f=S=>{b&&(r(!S||S.type?new Gt(null,e,b):S),b.abort(),g(),b=null)},n.cancelToken&&n.cancelToken.subscribe(f),n.signal&&(n.signal.aborted?f():n.signal.addEventListener("abort",f)));const y=zl(n.url);if(y&&!me.protocols.includes(y)){r(new T("Unsupported protocol "+y+":",T.ERR_BAD_REQUEST,e)),g();return}b.send(a||null)})},nd=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const s=new AbortController;let r=!1;const n=function(d){if(!r){r=!0,i();const l=d instanceof Error?d:this.reason;s.abort(l instanceof T?l:new Gt(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{a=null,n(new T(`timeout of ${t}ms exceeded`,T.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(n):d.removeEventListener("abort",n)}),e=null)};e.forEach(d=>d.addEventListener("abort",n,{once:!0}));const{signal:c}=s;return c.unsubscribe=()=>v.asap(i),c},od=function*(e,t){let s=e.byteLength;if(s<t){yield e;return}let r=0,n;for(;r<s;)n=r+t,yield e.slice(r,n),r=n},ad=async function*(e,t){for await(const s of id(e))yield*od(s,t)},id=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:s,value:r}=await t.read();if(s)break;yield r}}finally{await t.cancel()}},Nn=(e,t,s,r)=>{const n=ad(e,t);let a=0,i,c=d=>{i||(i=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:l,value:f}=await n.next();if(l){c(),d.close();return}let u=f.byteLength;if(s){let h=a+=u;s(h)}d.enqueue(new Uint8Array(f))}catch(l){throw c(l),l}},cancel(d){return c(d),n.return()}},{highWaterMark:2})},Cs=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cd=(e,t,s)=>t+2<s&&Cs(e.charCodeAt(t+1))&&Cs(e.charCodeAt(t+2));function ld(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const s=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(s)){let i=r.length;const c=r.length;for(let m=0;m<c;m++)if(r.charCodeAt(m)===37&&m+2<c){const p=r.charCodeAt(m+1),g=r.charCodeAt(m+2);Cs(p)&&Cs(g)&&(i-=2,m+=2)}let d=0,l=c-1;const f=m=>m>=2&&r.charCodeAt(m-2)===37&&r.charCodeAt(m-1)===51&&(r.charCodeAt(m)===68||r.charCodeAt(m)===100);l>=0&&(r.charCodeAt(l)===61?(d++,l--):f(l)&&(d++,l-=3)),d===1&&l>=0&&(r.charCodeAt(l)===61||f(l))&&d++;const h=Math.floor(i/4)*3-(d||0);return h>0?h:0}let a=0;for(let i=0,c=r.length;i<c;i++){const d=r.charCodeAt(i);if(d===37&&cd(r,i,c))a+=1,i+=2;else if(d<128)a+=1;else if(d<2048)a+=2;else if(d>=55296&&d<=56319&&i+1<c){const l=r.charCodeAt(i+1);l>=56320&&l<=57343?(a+=4,i++):a+=3}else a+=3}return a}const Nr="1.18.1",Rn=64*1024,{isFunction:ts}=v,dd=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,s)=>String.fromCharCode(parseInt(s,16))),Cn=e=>{if(!v.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},_n=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ud=e=>{const t=e.indexOf("://");let s=e;return t!==-1&&(s=s.slice(t+3)),s.includes("@")||s.includes(":")},fd=e=>{const t=v.global!==void 0&&v.global!==null?v.global:globalThis,{ReadableStream:s,TextEncoder:r}=t;e=v.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:n,Request:a,Response:i}=e,c=n?ts(n):typeof fetch=="function",d=ts(a),l=ts(i);if(!c)return!1;const f=c&&ts(s),u=c&&(typeof r=="function"?(x=>y=>x.encode(y))(new r):async x=>new Uint8Array(await new a(x).arrayBuffer())),h=d&&f&&_n(()=>{let x=!1;const y=new a(me.origin,{body:new s,method:"POST",get duplex(){return x=!0,"half"}}),S=y.headers.has("Content-Type");return y.body!=null&&y.body.cancel(),x&&!S}),m=l&&f&&_n(()=>v.isReadableStream(new i("").body)),p={stream:m&&(x=>x.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!p[x]&&(p[x]=(y,S)=>{let w=y&&y[x];if(w)return w.call(y);throw new T(`Response type '${x}' is not supported`,T.ERR_NOT_SUPPORT,S)})});const g=async x=>{if(x==null)return 0;if(v.isBlob(x))return x.size;if(v.isSpecCompliantForm(x))return(await new a(me.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(v.isArrayBufferView(x)||v.isArrayBuffer(x))return x.byteLength;if(v.isURLSearchParams(x)&&(x=x+""),v.isString(x))return(await u(x)).byteLength},b=async(x,y)=>{const S=v.toFiniteNumber(x.getContentLength());return S??g(y)};return async x=>{let{url:y,method:S,data:w,signal:C,cancelToken:_,timeout:R,onDownloadProgress:j,onUploadProgress:E,responseType:A,headers:P,withCredentials:I="same-origin",fetchOptions:ee,maxContentLength:V,maxBodyLength:Z}=Vo(x);const Q=v.isNumber(V)&&V>-1,J=v.isNumber(Z)&&Z>-1,ue=F=>v.hasOwnProp(x,F)?x[F]:void 0;let he=n||fetch;A=A?(A+"").toLowerCase():"text";let O=nd([C,_&&_.toAbortSignal()],R),N=null;const B=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let H,G=null;const D=()=>new T("Request body larger than maxBodyLength limit",T.ERR_BAD_REQUEST,x,N);try{let F;const U=ue("auth");if(U){const z=v.getSafeProp(U,"username")||"",pe=v.getSafeProp(U,"password")||"";F={username:z,password:pe}}if(ud(y)){const z=new URL(y,me.origin);if(!F&&(z.username||z.password)){const pe=Cn(z.username),we=Cn(z.password);F={username:pe,password:we}}(z.username||z.password)&&(z.username="",z.password="",y=z.href)}if(F&&(P.delete("authorization"),P.set("Authorization","Basic "+btoa(dd((F.username||"")+":"+(F.password||""))))),Q&&typeof y=="string"&&y.startsWith("data:")&&ld(y)>V)throw new T("maxContentLength size of "+V+" exceeded",T.ERR_BAD_RESPONSE,x,N);if(J&&S!=="get"&&S!=="head"){const z=await g(w);if(typeof z=="number"&&isFinite(z)&&(H=z,z>Z))throw D()}const X=J&&(v.isReadableStream(w)||v.isStream(w)),K=(z,pe,we)=>Nn(z,Rn,Ee=>{if(J&&Ee>Z)throw G=D();pe&&pe(Ee)},we);if(h&&S!=="get"&&S!=="head"&&(E||X)){if(H=H??await b(P,w),H!==0||X){let z=new a(y,{method:"POST",body:w,duplex:"half"}),pe;if(v.isFormData(w)&&(pe=z.headers.get("content-type"))&&P.setContentType(pe),z.body){const[we,Ee]=E&&vn(H,Rs(wn(E)))||[];w=K(z.body,we,Ee)}}}else if(X&&!d&&f&&S!=="get"&&S!=="head")w=K(w);else if(X&&d&&!h&&S!=="get"&&S!=="head")throw new T("Stream request bodies are not supported by the current fetch implementation",T.ERR_NOT_SUPPORT,x,N);v.isString(I)||(I=I?"include":"omit");const fe=d&&"credentials"in a.prototype;if(v.isFormData(w)){const z=P.getContentType();z&&/^multipart\/form-data/i.test(z)&&!/boundary=/i.test(z)&&P.delete("content-type")}P.set("User-Agent","axios/"+Nr,!1);const ve={...ee,signal:O,method:S.toUpperCase(),headers:Ao(P.normalize()),body:w,duplex:"half",credentials:fe?I:void 0};N=d&&new a(y,ve);let ae=await(d?he(N,ee):he(y,ve));const Me=be.from(ae.headers);if(Q){const z=v.toFiniteNumber(Me.getContentLength());if(z!=null&&z>V)throw new T("maxContentLength size of "+V+" exceeded",T.ERR_BAD_RESPONSE,x,N)}const _e=m&&(A==="stream"||A==="response");if(m&&ae.body&&(j||Q||_e&&B)){const z={};["status","statusText","headers"].forEach(Ue=>{z[Ue]=ae[Ue]});const pe=v.toFiniteNumber(Me.getContentLength()),[we,Ee]=j&&vn(pe,Rs(wn(j),!0))||[];let Te=0;const Ms=Ue=>{if(Q&&(Te=Ue,Te>V))throw new T("maxContentLength size of "+V+" exceeded",T.ERR_BAD_RESPONSE,x,N);we&&we(Ue)};ae=new i(Nn(ae.body,Rn,Ms,()=>{Ee&&Ee(),B&&B()}),z)}A=A||"text";let ke=await p[v.findKey(p,A)||"text"](ae,x);if(Q&&!m&&!_e){let z;if(ke!=null&&(typeof ke.byteLength=="number"?z=ke.byteLength:typeof ke.size=="number"?z=ke.size:typeof ke=="string"&&(z=typeof r=="function"?new r().encode(ke).byteLength:ke.length)),typeof z=="number"&&z>V)throw new T("maxContentLength size of "+V+" exceeded",T.ERR_BAD_RESPONSE,x,N)}return!_e&&B&&B(),await new Promise((z,pe)=>{$o(z,pe,{data:ke,headers:be.from(ae.headers),status:ae.status,statusText:ae.statusText,config:x,request:N})})}catch(F){if(B&&B(),O&&O.aborted&&O.reason instanceof T){const U=O.reason;throw U.config=x,N&&(U.request=N),F!==U&&Object.defineProperty(U,"cause",{__proto__:null,value:F,writable:!0,enumerable:!1,configurable:!0}),U}if(G)throw N&&!G.request&&(G.request=N),G;if(F instanceof T)throw N&&!F.request&&(F.request=N),F;if(F&&F.name==="TypeError"&&/Load failed|fetch/i.test(F.message)){const U=new T("Network Error",T.ERR_NETWORK,x,N,F&&F.response);throw Object.defineProperty(U,"cause",{__proto__:null,value:F.cause||F,writable:!0,enumerable:!1,configurable:!0}),U}throw T.from(F,F&&F.code,x,N,F&&F.response)}}},hd=new Map,Wo=e=>{let t=e&&e.env||{};const{fetch:s,Request:r,Response:n}=t,a=[r,n,s];let i=a.length,c=i,d,l,f=hd;for(;c--;)d=a[c],l=f.get(d),l===void 0&&f.set(d,l=c?new Map:fd(t)),f=l;return l};Wo();const Rr={http:Cl,xhr:rd,fetch:{get:Wo}};v.forEach(Rr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const kn=e=>`- ${e}`,md=e=>v.isFunction(e)||e===null||e===!1;function pd(e,t){e=v.isArray(e)?e:[e];const{length:s}=e;let r,n;const a={};for(let i=0;i<s;i++){r=e[i];let c;if(n=r,!md(r)&&(n=Rr[(c=String(r)).toLowerCase()],n===void 0))throw new T(`Unknown adapter '${c}'`);if(n&&(v.isFunction(n)||(n=n.get(t))))break;a[c||"#"+i]=n}if(!n){const i=Object.entries(a).map(([d,l])=>`adapter ${d} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=s?i.length>1?`since :
9
+ `+i.map(kn).join(`
10
+ `):" "+kn(i[0]):"as no adapter specified";throw new T("There is no suitable adapter to dispatch the request "+c,T.ERR_NOT_SUPPORT)}return n}const Ho={getAdapter:pd,adapters:Rr};function Zs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Gt(null,e)}function En(e){return Zs(e),e.headers=be.from(e.headers),e.data=Xs.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ho.getAdapter(e.adapter||qt.adapter,e)(e).then(function(r){Zs(e),e.response=r;try{r.data=Xs.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=be.from(r.headers),r},function(r){if(!Uo(r)&&(Zs(e),r&&r.response)){e.response=r.response;try{r.response.data=Xs.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=be.from(r.response.headers)}return Promise.reject(r)})}const Ls={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ls[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Pn={};Ls.transitional=function(t,s,r){function n(a,i){return"[Axios v"+Nr+"] Transitional option '"+a+"'"+i+(r?". "+r:"")}return(a,i,c)=>{if(t===!1)throw new T(n(i," has been removed"+(s?" in "+s:"")),T.ERR_DEPRECATED);return s&&!Pn[i]&&(Pn[i]=!0,console.warn(n(i," has been deprecated since v"+s+" and will be removed in the near future"))),t?t(a,i,c):!0}};Ls.spelling=function(t){return(s,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function gd(e,t,s){if(typeof e!="object"||e===null)throw new T("options must be an object",T.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let n=r.length;for(;n-- >0;){const a=r[n],i=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(i){const c=e[a],d=c===void 0||i(c,a,e);if(d!==!0)throw new T("option "+a+" must be "+d,T.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new T("Unknown option "+a,T.ERR_BAD_OPTION)}}const ps={assertOptions:gd,validators:Ls},ge=ps.validators;let it=class{constructor(t){this.defaults=t||{},this.interceptors={request:new bn,response:new bn}}async request(t,s){try{return await this._request(t,s)}catch(r){if(r instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const a=(()=>{if(!n.stack)return"";const i=n.stack.indexOf(`
11
+ `);return i===-1?"":n.stack.slice(i+1)})();try{if(!r.stack)r.stack=a;else if(a){const i=a.indexOf(`
12
+ `),c=i===-1?-1:a.indexOf(`
13
+ `,i+1),d=c===-1?"":a.slice(c+1);String(r.stack).endsWith(d)||(r.stack+=`
14
+ `+a)}}catch{}}throw r}}_request(t,s){typeof t=="string"?(s=s||{},s.url=t):s=t||{},s=dt(this.defaults,s);const{transitional:r,paramsSerializer:n,headers:a}=s;r!==void 0&&ps.assertOptions(r,{silentJSONParsing:ge.transitional(ge.boolean),forcedJSONParsing:ge.transitional(ge.boolean),clarifyTimeoutError:ge.transitional(ge.boolean),legacyInterceptorReqResOrdering:ge.transitional(ge.boolean),advertiseZstdAcceptEncoding:ge.transitional(ge.boolean),validateStatusUndefinedResolves:ge.transitional(ge.boolean)},!1),n!=null&&(v.isFunction(n)?s.paramsSerializer={serialize:n}:ps.assertOptions(n,{encode:ge.function,serialize:ge.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),ps.assertOptions(s,{baseUrl:ge.spelling("baseURL"),withXsrfToken:ge.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let i=a&&v.merge(a.common,a[s.method]);a&&v.forEach(["delete","get","head","post","put","patch","query","common"],p=>{delete a[p]}),s.headers=be.concat(i,a);const c=[];let d=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(s)===!1)return;d=d&&g.synchronous;const b=s.transitional||Sr;b&&b.legacyInterceptorReqResOrdering?c.unshift(g.fulfilled,g.rejected):c.push(g.fulfilled,g.rejected)});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let f,u=0,h;if(!d){const p=[En.bind(this),void 0];for(p.unshift(...c),p.push(...l),h=p.length,f=Promise.resolve(s);u<h;)f=f.then(p[u++],p[u++]);return f}h=c.length;let m=s;for(;u<h;){const p=c[u++],g=c[u++];try{m=p(m)}catch(b){g.call(this,b);break}}try{f=En.call(this,m)}catch(p){return Promise.reject(p)}for(u=0,h=l.length;u<h;)f=f.then(l[u++],l[u++]);return f}getUri(t){t=dt(this.defaults,t);const s=zo(t.baseURL,t.url,t.allowAbsoluteUrls,t);return Do(s,t.params,t.paramsSerializer)}};v.forEach(["delete","get","head","options"],function(t){it.prototype[t]=function(s,r){return this.request(dt(r||{},{method:t,url:s,data:r&&v.hasOwnProp(r,"data")?r.data:void 0}))}});v.forEach(["post","put","patch","query"],function(t){function s(r){return function(a,i,c){return this.request(dt(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}it.prototype[t]=s(),t!=="query"&&(it.prototype[t+"Form"]=s(!0))});let xd=class qo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(a){s=a});const r=this;this.promise.then(n=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](n);r._listeners=null}),this.promise.then=n=>{let a;const i=new Promise(c=>{r.subscribe(c),a=c}).then(n);return i.cancel=function(){r.unsubscribe(a)},i},t(function(a,i,c){r.reason||(r.reason=new Gt(a,i,c),s(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const s=this._listeners.indexOf(t);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const t=new AbortController,s=r=>{t.abort(r)};return this.subscribe(s),t.signal.unsubscribe=()=>this.unsubscribe(s),t.signal}static source(){let t;return{token:new qo(function(n){t=n}),cancel:t}}};function bd(e){return function(s){return e.apply(null,s)}}function yd(e){return v.isObject(e)&&e.isAxiosError===!0}const ur={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ur).forEach(([e,t])=>{ur[t]=e});function Go(e){const t=new it(e),s=jo(it.prototype.request,t);return v.extend(s,it.prototype,t,{allOwnKeys:!0}),v.extend(s,t,null,{allOwnKeys:!0}),s.create=function(n){return Go(dt(e,n))},s}const ce=Go(qt);ce.Axios=it;ce.CanceledError=Gt;ce.CancelToken=xd;ce.isCancel=Uo;ce.VERSION=Nr;ce.toFormData=Os;ce.AxiosError=T;ce.Cancel=ce.CanceledError;ce.all=function(t){return Promise.all(t)};ce.spread=bd;ce.isAxiosError=yd;ce.mergeConfig=dt;ce.AxiosHeaders=be;ce.formToJSON=e=>Bo(v.isHTMLForm(e)?new FormData(e):e);ce.getAdapter=Ho.getAdapter;ce.HttpStatusCode=ur;ce.default=ce;const{Axios:jh,AxiosError:Nh,CanceledError:Rh,isCancel:Ch,CancelToken:_h,VERSION:kh,all:Eh,Cancel:Ph,isAxiosError:Th,spread:Ah,toFormData:Oh,AxiosHeaders:Lh,HttpStatusCode:Mh,formToJSON:Ih,getAdapter:Dh,mergeConfig:Fh,create:Bh}=ce,oe=ce.create({baseURL:"/api/v1/cost"});function Ko(e,t){oe.defaults.baseURL=`${e.replace(/\/$/,"")}/cost`,t?oe.defaults.headers.common.Authorization=`Bearer ${t}`:delete oe.defaults.headers.common.Authorization}function vd(e){e.interceptors.request.use(t=>{if(typeof window<"u"){const s=window.localStorage.getItem("access_token");s?(t.headers=t.headers||{},t.headers.Authorization=`Bearer ${s}`):t.headers&&delete t.headers.Authorization}return t})}const wd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Sd=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,r)=>r?r.toUpperCase():s.toLowerCase()),Tn=e=>{const t=Sd(e);return t.charAt(0).toUpperCase()+t.slice(1)},Yo=(...e)=>e.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim(),jd=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Nd={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 Rd=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:n="",children:a,iconNode:i,...c},d)=>k.createElement("svg",{ref:d,...Nd,width:t,height:t,stroke:e,strokeWidth:r?Number(s)*24/Number(t):s,className:Yo("lucide",n),...!a&&!jd(c)&&{"aria-hidden":"true"},...c},[...i.map(([l,f])=>k.createElement(l,f)),...Array.isArray(a)?a:[a]]));const Y=(e,t)=>{const s=k.forwardRef(({className:r,...n},a)=>k.createElement(Rd,{ref:a,iconNode:t,className:Yo(`lucide-${wd(Tn(e))}`,`lucide-${e}`,r),...n}));return s.displayName=Tn(e),s};const Cd=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],_d=Y("arrow-down-right",Cd);const kd=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Ed=Y("arrow-up-right",kd);const Pd=[["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"}]],Td=Y("building-2",Pd);const Ad=[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]],Od=Y("calendar-range",Ad);const Ld=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Md=Y("chart-column",Ld);const Id=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Dd=Y("chevron-down",Id);const Fd=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Bd=Y("chevron-left",Fd);const Ud=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],$d=Y("chevron-right",Ud);const zd=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ge=Y("circle-alert",zd);const Vd=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Jo=Y("circle-check",Vd);const Wd=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],_s=Y("cloud",Wd);const Hd=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Xo=Y("database",Hd);const qd=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],Zo=Y("dollar-sign",qd);const Gd=[["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"}]],Qo=Y("download",Gd);const Kd=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ea=Y("external-link",Kd);const Yd=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Jd=Y("eye",Yd);const Xd=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],Zd=Y("file-down",Xd);const Qd=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],eu=Y("file-text",Qd);const tu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],su=Y("info",tu);const ru=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],nu=Y("lightbulb",ru);const ou=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],au=Y("list",ou);const iu=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],gs=Y("loader-circle",iu);const cu=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],lu=Y("map-pin",cu);const du=[["path",{d:"M5 12h14",key:"1ays0h"}]],uu=Y("minus",du);const fu=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ta=Y("plus",fu);const hu=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ke=Y("refresh-cw",hu);const mu=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Cr=Y("search",mu);const pu=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],sa=Y("server",pu);const gu=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],xu=Y("settings-2",gu);const bu=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],yu=Y("shield-alert",bu);const vu=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ss=Y("sparkles",vu);const wu=[["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"}]],Su=Y("trash-2",wu);const ju=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],Nu=Y("trending-down",ju);const Ru=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ra=Y("trending-up",Ru);const Cu=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_u=Y("triangle-alert",Cu);const ku=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],na=Y("wallet",ku);const Eu=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_r=Y("x",Eu);function oa(e){var t,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(s=oa(e[t]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function Pu(){for(var e,t,s=0,r="",n=arguments.length;s<n;s++)(e=arguments[s])&&(t=oa(e))&&(r&&(r+=" "),r+=t);return r}const Tu=(e,t)=>{const s=new Array(e.length+t.length);for(let r=0;r<e.length;r++)s[r]=e[r];for(let r=0;r<t.length;r++)s[e.length+r]=t[r];return s},Au=(e,t)=>({classGroupId:e,validator:t}),aa=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),ks="-",An=[],Ou="arbitrary..",Lu=e=>{const t=Iu(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Mu(i);const c=i.split(ks),d=c[0]===""&&c.length>1?1:0;return ia(c,d,t)},getConflictingClassGroupIds:(i,c)=>{if(c){const d=r[i],l=s[i];return d?l?Tu(l,d):d:l||An}return s[i]||An}}},ia=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const n=e[t],a=s.nextPart.get(n);if(a){const l=ia(e,t+1,a);if(l)return l}const i=s.validators;if(i===null)return;const c=t===0?e.join(ks):e.slice(t).join(ks),d=i.length;for(let l=0;l<d;l++){const f=i[l];if(f.validator(c))return f.classGroupId}},Mu=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),r=t.slice(0,s);return r?Ou+r:void 0})(),Iu=e=>{const{theme:t,classGroups:s}=e;return Du(s,t)},Du=(e,t)=>{const s=aa();for(const r in e){const n=e[r];kr(n,s,r,t)}return s},kr=(e,t,s,r)=>{const n=e.length;for(let a=0;a<n;a++){const i=e[a];Fu(i,t,s,r)}},Fu=(e,t,s,r)=>{if(typeof e=="string"){Bu(e,t,s);return}if(typeof e=="function"){Uu(e,t,s,r);return}$u(e,t,s,r)},Bu=(e,t,s)=>{const r=e===""?t:ca(t,e);r.classGroupId=s},Uu=(e,t,s,r)=>{if(zu(e)){kr(e(r),t,s,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Au(s,e))},$u=(e,t,s,r)=>{const n=Object.entries(e),a=n.length;for(let i=0;i<a;i++){const[c,d]=n[i];kr(d,ca(t,c),s,r)}},ca=(e,t)=>{let s=e;const r=t.split(ks),n=r.length;for(let a=0;a<n;a++){const i=r[a];let c=s.nextPart.get(i);c||(c=aa(),s.nextPart.set(i,c)),s=c}return s},zu=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Vu=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),r=Object.create(null);const n=(a,i)=>{s[a]=i,t++,t>e&&(t=0,r=s,s=Object.create(null))};return{get(a){let i=s[a];if(i!==void 0)return i;if((i=r[a])!==void 0)return n(a,i),i},set(a,i){a in s?s[a]=i:n(a,i)}}},fr="!",On=":",Wu=[],Ln=(e,t,s,r,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:r,isExternal:n}),Hu=e=>{const{prefix:t,experimentalParseClassName:s}=e;let r=n=>{const a=[];let i=0,c=0,d=0,l;const f=n.length;for(let g=0;g<f;g++){const b=n[g];if(i===0&&c===0){if(b===On){a.push(n.slice(d,g)),d=g+1;continue}if(b==="/"){l=g;continue}}b==="["?i++:b==="]"?i--:b==="("?c++:b===")"&&c--}const u=a.length===0?n:n.slice(d);let h=u,m=!1;u.endsWith(fr)?(h=u.slice(0,-1),m=!0):u.startsWith(fr)&&(h=u.slice(1),m=!0);const p=l&&l>d?l-d:void 0;return Ln(a,m,h,p)};if(t){const n=t+On,a=r;r=i=>i.startsWith(n)?a(i.slice(n.length)):Ln(Wu,!1,i,void 0,!0)}if(s){const n=r;r=a=>s({className:a,parseClassName:n})}return r},qu=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,r)=>{t.set(s,1e6+r)}),s=>{const r=[];let n=[];for(let a=0;a<s.length;a++){const i=s[a],c=i[0]==="[",d=t.has(i);c||d?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(i)):n.push(i)}return n.length>0&&(n.sort(),r.push(...n)),r}},Gu=e=>({cache:Vu(e.cacheSize),parseClassName:Hu(e),sortModifiers:qu(e),postfixLookupClassGroupIds:Ku(e),...Lu(e)}),Ku=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let r=0;r<s.length;r++)t[s[r]]=!0;return t},Yu=/\s+/,Ju=(e,t)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:n,sortModifiers:a,postfixLookupClassGroupIds:i}=t,c=[],d=e.trim().split(Yu);let l="";for(let f=d.length-1;f>=0;f-=1){const u=d[f],{isExternal:h,modifiers:m,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:b}=s(u);if(h){l=u+(l.length>0?" "+l:l);continue}let x=!!b,y;if(x){const R=g.substring(0,b);y=r(R);const j=y&&i[y]?r(g):void 0;j&&j!==y&&(y=j,x=!1)}else y=r(g);if(!y){if(!x){l=u+(l.length>0?" "+l:l);continue}if(y=r(g),!y){l=u+(l.length>0?" "+l:l);continue}x=!1}const S=m.length===0?"":m.length===1?m[0]:a(m).join(":"),w=p?S+fr:S,C=w+y;if(c.indexOf(C)>-1)continue;c.push(C);const _=n(y,x);for(let R=0;R<_.length;++R){const j=_[R];c.push(w+j)}l=u+(l.length>0?" "+l:l)}return l},Xu=(...e)=>{let t=0,s,r,n="";for(;t<e.length;)(s=e[t++])&&(r=la(s))&&(n&&(n+=" "),n+=r);return n},la=e=>{if(typeof e=="string")return e;let t,s="";for(let r=0;r<e.length;r++)e[r]&&(t=la(e[r]))&&(s&&(s+=" "),s+=t);return s},Zu=(e,...t)=>{let s,r,n,a;const i=d=>{const l=t.reduce((f,u)=>u(f),e());return s=Gu(l),r=s.cache.get,n=s.cache.set,a=c,c(d)},c=d=>{const l=r(d);if(l)return l;const f=Ju(d,s);return n(d,f),f};return a=i,(...d)=>a(Xu(...d))},Qu=[],le=e=>{const t=s=>s[e]||Qu;return t.isThemeGetter=!0,t},da=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ua=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ef=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,tf=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sf=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rf=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nf=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,of=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$e=e=>ef.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),Ae=e=>!!e&&Number.isInteger(Number(e)),Qs=e=>e.endsWith("%")&&q(e.slice(0,-1)),Ie=e=>tf.test(e),fa=()=>!0,af=e=>sf.test(e)&&!rf.test(e),Er=()=>!1,cf=e=>nf.test(e),lf=e=>of.test(e),df=e=>!L(e)&&!M(e),uf=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),ff=e=>Ye(e,pa,Er),L=e=>da.test(e),Ze=e=>Ye(e,ga,af),Mn=e=>Ye(e,vf,q),hf=e=>Ye(e,ba,fa),mf=e=>Ye(e,xa,Er),In=e=>Ye(e,ha,Er),pf=e=>Ye(e,ma,lf),rs=e=>Ye(e,ya,cf),M=e=>ua.test(e),It=e=>ft(e,ga),gf=e=>ft(e,xa),Dn=e=>ft(e,ha),xf=e=>ft(e,pa),bf=e=>ft(e,ma),ns=e=>ft(e,ya,!0),yf=e=>ft(e,ba,!0),Ye=(e,t,s)=>{const r=da.exec(e);return r?r[1]?t(r[1]):s(r[2]):!1},ft=(e,t,s=!1)=>{const r=ua.exec(e);return r?r[1]?t(r[1]):s:!1},ha=e=>e==="position"||e==="percentage",ma=e=>e==="image"||e==="url",pa=e=>e==="length"||e==="size"||e==="bg-size",ga=e=>e==="length",vf=e=>e==="number",xa=e=>e==="family-name",ba=e=>e==="number"||e==="weight",ya=e=>e==="shadow",wf=()=>{const e=le("color"),t=le("font"),s=le("text"),r=le("font-weight"),n=le("tracking"),a=le("leading"),i=le("breakpoint"),c=le("container"),d=le("spacing"),l=le("radius"),f=le("shadow"),u=le("inset-shadow"),h=le("text-shadow"),m=le("drop-shadow"),p=le("blur"),g=le("perspective"),b=le("aspect"),x=le("ease"),y=le("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...w(),M,L],_=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],j=()=>[M,L,d],E=()=>[$e,"full","auto",...j()],A=()=>[Ae,"none","subgrid",M,L],P=()=>["auto",{span:["full",Ae,M,L]},Ae,M,L],I=()=>[Ae,"auto",M,L],ee=()=>["auto","min","max","fr",M,L],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...j()],J=()=>[$e,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],ue=()=>[$e,"screen","full","dvw","lvw","svw","min","max","fit",...j()],he=()=>[$e,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],O=()=>[e,M,L],N=()=>[...w(),Dn,In,{position:[M,L]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",xf,ff,{size:[M,L]}],G=()=>[Qs,It,Ze],D=()=>["","none","full",l,M,L],F=()=>["",q,It,Ze],U=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[q,Qs,Dn,In],fe=()=>["","none",p,M,L],ve=()=>["none",q,M,L],ae=()=>["none",q,M,L],Me=()=>[q,M,L],_e=()=>[$e,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ie],breakpoint:[Ie],color:[fa],container:[Ie],"drop-shadow":[Ie],ease:["in","out","in-out"],font:[df],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ie],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ie],shadow:[Ie],spacing:["px",q],text:[Ie],"text-shadow":[Ie],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$e,L,M,b]}],container:["container"],"container-type":[{"@container":["","normal","size",M,L]}],"container-named":[uf],columns:[{columns:[q,L,M,c]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{"inset-s":E(),start:E()}],end:[{"inset-e":E(),end:E()}],"inset-bs":[{"inset-bs":E()}],"inset-be":[{"inset-be":E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[Ae,"auto",M,L]}],basis:[{basis:[$e,"full","auto",c,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[q,$e,"auto","initial","none",L]}],grow:[{grow:["",q,M,L]}],shrink:[{shrink:["",q,M,L]}],order:[{order:[Ae,"first","last","none",M,L]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mbs:[{mbs:Q()}],mbe:[{mbe:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...ue()]}],"min-inline-size":[{"min-inline":["auto",...ue()]}],"max-inline-size":[{"max-inline":["none",...ue()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[c,"screen",...J()]}],"min-w":[{"min-w":[c,"screen","none",...J()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[i]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",s,It,Ze]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,yf,hf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qs,L]}],"font-family":[{font:[gf,mf,t]}],"font-features":[{"font-features":[L]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,M,L]}],"line-clamp":[{"line-clamp":[q,"none",M,Mn]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",M,L]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",M,L]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:[q,"from-font","auto",M,Ze]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[q,"auto",M,L]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[Ae,M,L]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",M,L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",M,L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ae,M,L],radial:["",M,L],conic:[Ae,M,L]},bf,pf]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...U(),"hidden","none"]}],"divide-style":[{divide:[...U(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...U(),"none","hidden"]}],"outline-offset":[{"outline-offset":[q,M,L]}],"outline-w":[{outline:["",q,It,Ze]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",f,ns,rs]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",u,ns,rs]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[q,Ze]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",h,ns,rs]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[q,M,L]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[q]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[M,L]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[q]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",M,L]}],filter:[{filter:["","none",M,L]}],blur:[{blur:fe()}],brightness:[{brightness:[q,M,L]}],contrast:[{contrast:[q,M,L]}],"drop-shadow":[{"drop-shadow":["","none",m,ns,rs]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",q,M,L]}],"hue-rotate":[{"hue-rotate":[q,M,L]}],invert:[{invert:["",q,M,L]}],saturate:[{saturate:[q,M,L]}],sepia:[{sepia:["",q,M,L]}],"backdrop-filter":[{"backdrop-filter":["","none",M,L]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[q,M,L]}],"backdrop-contrast":[{"backdrop-contrast":[q,M,L]}],"backdrop-grayscale":[{"backdrop-grayscale":["",q,M,L]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[q,M,L]}],"backdrop-invert":[{"backdrop-invert":["",q,M,L]}],"backdrop-opacity":[{"backdrop-opacity":[q,M,L]}],"backdrop-saturate":[{"backdrop-saturate":[q,M,L]}],"backdrop-sepia":[{"backdrop-sepia":["",q,M,L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",M,L]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[q,"initial",M,L]}],ease:[{ease:["linear","initial",x,M,L]}],delay:[{delay:[q,M,L]}],animate:[{animate:["none",y,M,L]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,M,L]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[M,L,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],zoom:[{zoom:[Ae,M,L]}],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",M,L]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",M,L]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[q,It,Ze,Mn]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Sf=Zu(wf);function Et(...e){return Sf(Pu(e))}function W(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:2}).format(e)}const te=$.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Et("rounded-xl border bg-card text-card-foreground shadow",e),...t}));te.displayName="Card";const de=$.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Et("flex flex-col space-y-1.5 p-6",e),...t}));de.displayName="CardHeader";const ye=$.forwardRef(({className:e,...t},s)=>o.jsx("h3",{ref:s,className:Et("font-semibold leading-none tracking-tight",e),...t}));ye.displayName="CardTitle";const jf=$.forwardRef(({className:e,...t},s)=>o.jsx("p",{ref:s,className:Et("text-sm text-muted-foreground",e),...t}));jf.displayName="CardDescription";const se=$.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Et("p-6 pt-0",e),...t}));se.displayName="CardContent";const Nf=$.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Et("flex items-center p-6 pt-0",e),...t}));Nf.displayName="CardFooter";function Nt({status:e,error:t}){const s=e?.action==="connect_source"||e?.state==="not_configured",r=e?.message||t||"CUR status could not be loaded. Verify the cost source, discovery job, and Athena configuration.";return o.jsx("section",{className:"rounded-md border bg-card p-6","aria-live":"polite",children:o.jsxs("div",{className:"flex items-start gap-3",children:[e?.state==="unavailable"||t?o.jsx(Ge,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"}):o.jsx(Xo,{className:"mt-0.5 h-5 w-5 shrink-0 text-primary"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h2",{className:"font-semibold",children:s?"Enable AWS Cost and Usage Reports":"CUR data is not ready"}),o.jsx("p",{className:"mt-1 max-w-3xl text-sm text-muted-foreground",children:r}),o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[o.jsxs(js,{to:s?"/sources":"/cur-discovery",className:"inline-flex items-center gap-2 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground",children:[o.jsx(ea,{className:"h-4 w-4"}),s?"Connect AWS source":"Review CUR discovery"]}),!s&&o.jsx(js,{to:"/sources",className:"rounded-md border px-3 py-2 text-sm font-medium hover:bg-muted",children:"Cost sources"})]})]})]})})}function Rf({points:e,currency:t="USD"}){const[s,r]=k.useState(null);if(!e.length)return o.jsx("p",{className:"py-20 text-center text-sm text-muted-foreground",children:"No trend data for this period."});const n=900,a=260,i=70,c=24,d=22,l=48,f=n-i-c,u=a-d-l,h=Math.max(...e.map(b=>b.value),1),m=e.map((b,x)=>({...b,x:i+(e.length===1?f/2:x*f/(e.length-1)),y:d+u-b.value/h*u})),p=s==null?null:m[s],g=b=>{const x=b.currentTarget.getBoundingClientRect(),y=(b.clientX-x.left)/x.width*n;let S=0;for(let w=1;w<m.length;w+=1)Math.abs(m[w].x-y)<Math.abs(m[S].x-y)&&(S=w);r(S)};return o.jsxs("div",{className:"relative w-full",children:[o.jsxs("svg",{viewBox:`0 0 ${n} ${a}`,className:"h-72 w-full",onMouseMove:g,onMouseLeave:()=>r(null),role:"img","aria-label":"Cost trend line chart",children:[[0,.25,.5,.75,1].map(b=>{const x=d+u*b;return o.jsxs("g",{children:[o.jsx("line",{x1:i,y1:x,x2:n-c,y2:x,stroke:"#d8e0e7",strokeDasharray:"4 4"}),o.jsx("text",{x:i-10,y:x+4,textAnchor:"end",fill:"currentColor",className:"text-[10px] text-muted-foreground",children:W(h*(1-b),t)})]},b)}),o.jsx("line",{x1:i,y1:d+u,x2:n-c,y2:d+u,stroke:"#aebbc5"}),o.jsx("polyline",{points:m.map(b=>`${b.x},${b.y}`).join(" "),fill:"none",stroke:"#1f5f85",strokeWidth:"4",strokeLinejoin:"round",strokeLinecap:"round"}),p&&o.jsx("line",{x1:p.x,y1:d,x2:p.x,y2:d+u,stroke:"#1f5f85",strokeDasharray:"3 4",opacity:"0.45"}),m.map((b,x)=>o.jsxs("g",{children:[o.jsx("circle",{cx:b.x,cy:b.y,r:s===x?7:5,fill:"#1f5f85",stroke:"white",strokeWidth:"2"}),o.jsx("text",{x:b.x,y:a-17,textAnchor:"middle",fill:"currentColor",className:"text-[11px] text-muted-foreground",children:b.label})]},b.key))]}),p&&o.jsxs("div",{className:"pointer-events-none absolute z-20 min-w-44 rounded-lg border bg-popover p-3 text-popover-foreground shadow-xl",style:{left:`${p.x/n*100}%`,top:`${Math.max(p.y/a*100-4,2)}%`,transform:p.x>n*.75?"translate(-100%, -100%)":"translate(-50%, -100%)"},children:[o.jsx("p",{className:"text-xs font-semibold",children:p.label}),o.jsx("p",{className:"mt-1 text-sm font-bold text-primary",children:W(p.value,t)}),p.details?.slice(0,5).map(b=>o.jsxs("div",{className:"mt-1 flex justify-between gap-4 text-xs",children:[o.jsx("span",{className:"max-w-40 truncate text-muted-foreground",children:b.label}),o.jsx("span",{children:W(b.value,t)})]},b.label))]})]})}const Fn=e=>e.length>16?`${e.slice(0,14)}...`:e,Cf=(e,t)=>new Intl.NumberFormat("en-US",{style:"currency",currency:t||"USD",notation:"compact",maximumFractionDigits:1}).format(e);function _f({title:e,items:t,currency:s}){const a={top:38,right:18,bottom:72,left:76},i=720-a.left-a.right,c=320-a.top-a.bottom,d=Math.max(...t.map(u=>u.amount),1),l=i/t.length,f=Math.min(56,l*.58);return o.jsxs("svg",{viewBox:"0 0 720 320",className:"h-80 w-full",role:"img","aria-label":`${e} cost bar chart`,children:[[0,.25,.5,.75,1].map(u=>{const h=a.top+c-u*c;return o.jsxs("g",{children:[o.jsx("line",{x1:a.left,y1:h,x2:720-a.right,y2:h,stroke:"currentColor",opacity:u===0?.3:.12,vectorEffect:"non-scaling-stroke"}),o.jsx("text",{x:a.left-12,y:h+4,textAnchor:"end",fill:"currentColor",opacity:"0.7",fontSize:"11",children:Cf(d*u,s)})]},u)}),o.jsx("line",{x1:a.left,y1:a.top,x2:a.left,y2:a.top+c,stroke:"currentColor",opacity:"0.3",vectorEffect:"non-scaling-stroke"}),t.map((u,h)=>{const m=a.left+l*h+l/2,p=Math.max(u.amount/d*c,3),g=a.top+c-p;return o.jsxs("g",{tabIndex:0,"aria-label":`${u.label}: ${W(u.amount,s)}`,className:"outline-none focus-visible:opacity-75",children:[o.jsxs("title",{children:[u.label,": ",W(u.amount,s)]}),o.jsx("rect",{x:m-f/2,y:g,width:f,height:p,rx:"4",className:"fill-primary opacity-80 transition-opacity hover:opacity-100"}),o.jsx("text",{x:m,y:Math.max(g-8,16),textAnchor:"middle",fill:"currentColor",fontSize:"11",fontWeight:"600",children:W(u.amount,s)}),o.jsx("text",{x:m,y:278,textAnchor:"middle",fill:"currentColor",opacity:"0.72",fontSize:"11",children:Fn(u.label)}),u.accountId&&o.jsx("text",{x:m,y:295,textAnchor:"middle",fill:"currentColor",opacity:"0.55",fontSize:"9",children:Fn(u.accountId)})]},u.key||u.label)}),o.jsxs("text",{x:"18",y:a.top+c/2,transform:`rotate(-90 18 ${a.top+c/2})`,textAnchor:"middle",fill:"currentColor",opacity:"0.65",fontSize:"11",children:["Cost (",s,")"]})]})}const va="min-h-32 transition-all duration-200 ease-out hover:-translate-y-1 hover:scale-[1.01] hover:border-primary/30 hover:shadow-lg";function er({title:e,icon:t,items:s,currency:r}){const[n,a]=k.useState("chart"),i=s.slice(0,6),c=Math.max(...i.map(d=>d.amount),1);return o.jsxs(te,{className:"min-w-0",children:[o.jsxs(de,{className:"flex flex-row items-center justify-between gap-3 pb-3",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx("span",{className:"text-primary",children:t}),o.jsx(ye,{className:"truncate text-sm",children:e})]}),o.jsxs("div",{className:"flex rounded-md border p-0.5","aria-label":`${e} view`,children:[o.jsx("button",{type:"button",onClick:()=>a("chart"),"aria-label":`Show ${e} as bar chart`,"aria-pressed":n==="chart",title:"Bar chart",className:`rounded p-1.5 ${n==="chart"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"}`,children:o.jsx(Md,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",onClick:()=>a("list"),"aria-label":`Show ${e} as list`,"aria-pressed":n==="list",title:"List",className:`rounded p-1.5 ${n==="list"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"}`,children:o.jsx(au,{className:"h-4 w-4"})})]})]}),o.jsx(se,{children:i.length?n==="chart"?o.jsx(_f,{title:e,items:i,currency:r}):o.jsx("div",{className:"space-y-3",children:i.map(d=>o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[o.jsxs("span",{className:"truncate text-muted-foreground",title:d.label,children:[d.label,d.accountId?o.jsxs("span",{className:"ml-1 text-xs",children:["(",d.accountId,")"]}):null]}),o.jsx("span",{className:"shrink-0 font-medium",children:W(d.amount,r)})]}),o.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full rounded-full bg-primary/75",style:{width:`${d.amount/c*100}%`}})})]},d.key||d.label))}):o.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No cost data for this period."})})]})}function kf(){return o.jsxs("div",{"aria-live":"polite","aria-busy":"true",className:"contents",children:[o.jsx("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,240px),1fr))] gap-4",children:Array.from({length:4},(e,t)=>o.jsxs(te,{className:va,children:[o.jsx(de,{className:"pb-2",children:o.jsx("div",{className:"h-3 w-24 animate-pulse rounded bg-muted"})}),o.jsxs(se,{children:[o.jsx("div",{className:"h-6 w-3/4 animate-pulse rounded bg-muted"}),o.jsx("div",{className:"mt-3 h-3 w-1/2 animate-pulse rounded bg-muted/80"})]})]},t))}),o.jsxs(te,{children:[o.jsx(de,{children:o.jsx("div",{className:"h-4 w-36 animate-pulse rounded bg-muted"})}),o.jsx(se,{children:o.jsx("div",{className:"h-72 animate-pulse rounded-lg bg-muted/70"})})]}),o.jsx("div",{className:"grid gap-4 lg:grid-cols-2",children:Array.from({length:3},(e,t)=>o.jsxs(te,{children:[o.jsx(de,{children:o.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted"})}),o.jsx(se,{className:"space-y-4",children:Array.from({length:5},(s,r)=>o.jsxs("div",{children:[o.jsxs("div",{className:"flex justify-between",children:[o.jsx("div",{className:"h-3 w-2/5 animate-pulse rounded bg-muted"}),o.jsx("div",{className:"h-3 w-20 animate-pulse rounded bg-muted"})]}),o.jsx("div",{className:"mt-2 h-1.5 animate-pulse rounded bg-muted/80"})]},r))})]},t))})]})}function Ef({data:e,period:t,selectedMonth:s}){const r=e.topServices[0],n=e.topAccounts[0],a=new Date,[i,c]=s.split("-").map(Number),d=t==="monthly"?new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric"}).format(new Date(i,c-1,1)):String(a.getFullYear()),l=[{label:"Total cost",value:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:W(e.totalCost,e.currency)}),o.jsxs("span",{className:"mt-1 block text-sm font-medium text-muted-foreground",children:["Accounts: ",e.activeAccounts]})]}),helper:d,icon:o.jsx(Zo,{})},{label:"Active resources",value:e.activeResources==null?o.jsx("span",{className:"text-sm",title:e.activeResourcesMessage,children:"CUR access required"}):Number(e.activeResources).toLocaleString(),helper:`${d} across all accounts`,icon:o.jsx(_s,{})},{label:"Highest cost service",value:r?o.jsx("span",{className:"whitespace-pre-line text-sm",children:`Service - ${r.label}
15
+ Cost - ${W(r.amount,e.currency)}`}):"-",helper:d,icon:o.jsx(sa,{})},{label:"Highest cost account",value:n?o.jsx("span",{className:"whitespace-pre-line text-sm",children:`Account Name - ${n.label}
16
+ Account Id - ${n.accountId||n.key||"Unknown"}
17
+ Cost - ${W(n.amount,e.currency)}`}):"-",helper:d,icon:o.jsx(_s,{})}];return o.jsx("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,240px),1fr))] gap-4",children:l.map(f=>o.jsxs(te,{className:va,children:[o.jsxs(de,{className:"flex flex-row items-center justify-between pb-2",children:[o.jsx(ye,{className:"text-xs font-medium text-muted-foreground",children:f.label}),o.jsx("span",{className:"text-muted-foreground [&>svg]:h-4 [&>svg]:w-4",children:f.icon})]}),o.jsxs(se,{children:[o.jsx("div",{className:"break-words text-base font-semibold leading-snug xl:text-lg",children:f.value}),o.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:f.helper})]})]},f.label))})}const ie={getOverview:e=>oe.get("/overview",{params:e}).then(t=>t.data),getAccounts:()=>oe.get("/accounts").then(e=>e.data),getReports:e=>oe.get("/reports",{params:e}).then(t=>t.data),getFilterOptions:e=>oe.get("/filter-options",{params:{start:e?.start,end:e?.end,tagKey:e?.filterTagKey}}).then(t=>t.data),getTags:e=>oe.get("/tags",{params:e}).then(t=>t.data),getDataStatus:()=>oe.get("/data-status").then(e=>e.data),getAnalysisStatus:()=>oe.get("/analysis/status").then(e=>e.data),getLatestAnalysis:()=>oe.get("/analysis/latest").then(e=>e.data.analysis),generateAnalysis:e=>oe.post("/analysis",e).then(t=>t.data),getBudgets:()=>oe.get("/budgets").then(e=>e.data),createBudget:e=>oe.post("/budgets",e).then(t=>t.data),deleteBudget:e=>oe.delete(`/budgets/${e}`).then(()=>{}),getSources:()=>oe.get("/sources").then(e=>e.data),createSource:e=>oe.post("/sources",e).then(t=>t.data),getSourceStatus:e=>oe.get(`/sources/${e}/status`).then(t=>t.data),verifySource:e=>oe.post(`/sources/${e}/verify`).then(t=>t.data),downloadSourceTemplate:e=>oe.get(`/sources/${e}/template`,{responseType:"blob"}).then(t=>t.data)};function Pf(){const e=new Date,t=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`,[s,r]=k.useState(null),[n,a]=k.useState(!0),[i,c]=k.useState(null),[d,l]=k.useState(null),[f,u]=k.useState("monthly"),[h,m]=k.useState(t),p=k.useRef(0),g=Array.from({length:e.getMonth()+1},(S,w)=>({value:`${e.getFullYear()}-${String(w+1).padStart(2,"0")}`,label:new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric"}).format(new Date(e.getFullYear(),w,1))})),b=async(S=f,w=h)=>{const C=++p.current;a(!0),r(null),c(null);try{let _;if(S==="yearly")_={period:S,start:`${e.getFullYear()}-01-01`};else{const[E,A]=w.split("-").map(Number),P=w===t?e.getDate():new Date(E,A,0).getDate();_={period:S,start:`${w}-01`,end:`${w}-${String(P).padStart(2,"0")}`}}const R=await ie.getDataStatus();if(C===p.current&&l(R),!R.ready)return;const j=await ie.getOverview(_);C===p.current&&r(j)}catch(_){C===p.current&&c(_?.response?.data?.error||_.message||"Failed to load AWS costs")}finally{C===p.current&&a(!1)}};return k.useEffect(()=>{b(f,h)},[f,h]),{data:s,dataStatus:d,loading:n,error:i,period:f,selectedMonth:h,monthOptions:g,changePeriod:S=>{S!==f&&(a(!0),r(null),u(S))},changeMonth:S=>{S===h||!g.some(w=>w.value===S)||(a(!0),r(null),m(S))},refresh:()=>b(f,h)}}function Tf(){const{data:e,dataStatus:t,loading:s,error:r,period:n,selectedMonth:a,monthOptions:i,changePeriod:c,changeMonth:d,refresh:l}=Pf();return o.jsxs("div",{className:"flex w-full flex-col gap-6 p-2 md:p-6",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold",children:[o.jsx(Zo,{className:"h-6 w-6 text-primary"}),"Cloud Cost Management"]}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Costs across all AWS organization and member accounts available to this tenant"})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n==="monthly"&&o.jsx("select",{"aria-label":"Cost month",value:a,onChange:f=>d(f.target.value),disabled:s,className:"rounded-lg border bg-background px-3 py-2 text-sm shadow-sm disabled:opacity-50",children:i.map(f=>o.jsx("option",{value:f.value,children:f.label},f.value))}),o.jsx("div",{className:"flex rounded-lg border p-1",children:["monthly","yearly"].map(f=>o.jsx("button",{onClick:()=>c(f),className:`rounded-md px-3 py-1.5 text-sm capitalize transition-colors ${n===f?"bg-primary text-primary-foreground":"hover:bg-muted"}`,children:f},f))}),o.jsx("button",{onClick:()=>{l()},disabled:s,className:"rounded-lg border p-2 hover:bg-muted",children:o.jsx(Ke,{className:`h-4 w-4 ${s?"animate-spin":""}`})})]})]}),r&&e&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:[o.jsx(Ge,{className:"h-4 w-4"}),r]}),s?o.jsx(kf,{}):t&&!t.ready?o.jsx(Nt,{status:t}):r&&!e?o.jsx(Nt,{status:t,error:r}):e?o.jsxs(o.Fragment,{children:[e.dataSource&&o.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[o.jsx("span",{children:"Source: AWS CUR via SaaS Athena - gross positive unblended charges"}),o.jsxs("span",{children:["CUR: Ready",t?.lastDataAt?`, updated ${new Date(t.lastDataAt).toLocaleString()}`:""]})]}),o.jsx(Ef,{data:e,period:n,selectedMonth:a}),e.message&&!/historical data beyond 14 months/i.test(e.message)&&o.jsx(te,{children:o.jsx(se,{className:"py-8 text-center text-sm text-muted-foreground",children:e.message})}),o.jsxs(te,{children:[o.jsxs(de,{className:"flex flex-row items-center gap-2",children:[o.jsx(ra,{className:"h-4 w-4 text-primary"}),o.jsxs(ye,{className:"text-sm",children:["Cost Trend - ",n==="monthly"?"Monthly":"Yearly"]})]}),o.jsx(se,{children:o.jsx(Rf,{points:e.trends.map(f=>({key:f.month,label:n==="yearly"?f.month.slice(0,4):new Date(`${f.month}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",year:"2-digit"}),value:f.amount})),currency:e.currency})})]}),o.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[o.jsx(er,{title:"Top services",icon:o.jsx(sa,{className:"h-4 w-4"}),items:e.topServices,currency:e.currency}),o.jsx(er,{title:"AWS accounts",icon:o.jsx(Td,{className:"h-4 w-4"}),items:e.topAccounts,currency:e.currency}),o.jsx(er,{title:"Regional distribution",icon:o.jsx(lu,{className:"h-4 w-4"}),items:e.topRegions,currency:e.currency})]})]}):null]})}const os=["#6264e9","#eb67ad","#31c39a","#f29a05","#579bea","#9078ed","#f7842c","#24b9ad","#8ac926","#ffca3a","#6a4c93","#1982c4"];function Bn(e,t){const s=new Date(e.length===10?`${e}T00:00:00Z`:e);return Number.isFinite(s.getTime())?s.toLocaleDateString(void 0,t?{month:"short",day:"numeric",year:"numeric"}:{month:"short",year:"numeric"}):e}function Af({timeline:e,currency:t="USD",daily:s=!1}){const[r,n]=k.useState(null),[a,i]=k.useState(null),c=k.useMemo(()=>{const h=new Map;for(const m of e)for(const p of m.groups)h.set(p.label,(h.get(p.label)||0)+p.amount);return[...h.entries()].sort((m,p)=>p[1]-m[1]).map(([m],p)=>({label:m,color:os[p%os.length]}))},[e]),d=new Map(c.map(h=>[h.label,h.color])),l=Math.max(...e.map(h=>h.total),1),f=r??a,u=f==null?null:e[f];return e.length?o.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_288px]",onMouseLeave:()=>n(null),children:[o.jsxs("div",{children:[o.jsxs("div",{className:"grid min-h-80 grid-cols-[64px_1fr] gap-3",children:[o.jsx("div",{className:"flex h-64 flex-col justify-between pb-1 text-right text-[11px] text-muted-foreground",children:[1,.75,.5,.25,0].map(h=>o.jsx("span",{children:W(l*h,t)},h))}),o.jsxs("div",{children:[o.jsxs("div",{className:"relative flex h-64 items-end justify-around border-b px-4",children:[[0,25,50,75].map(h=>o.jsx("span",{className:"pointer-events-none absolute left-0 right-0 border-t border-dashed border-slate-200",style:{top:`${h}%`}},h)),e.map((h,m)=>o.jsx("button",{type:"button",onMouseEnter:()=>n(m),onMouseLeave:()=>n(null),onPointerDown:p=>p.preventDefault(),onFocus:()=>i(m),onBlur:()=>i(null),className:"group z-10 flex h-full min-w-10 flex-1 items-end justify-center px-2 outline-none focus-visible:ring-2 focus-visible:ring-primary",children:o.jsx("span",{className:"flex w-full max-w-16 flex-col-reverse overflow-hidden rounded-t-sm shadow-sm transition group-hover:brightness-95",style:{height:`${Math.max(h.total/l*100,1)}%`},children:h.groups.map(p=>o.jsx("span",{style:{backgroundColor:d.get(p.label)||os[0],height:`${h.total?p.amount/h.total*100:0}%`}},p.key||p.label))})},`${h.start}-${m}`))]}),o.jsx("div",{className:"flex justify-around px-4 pt-2",children:e.map((h,m)=>o.jsx("span",{className:"min-w-10 flex-1 text-center text-[11px] text-muted-foreground",children:Bn(h.start,s)},`${h.start}-label-${m}`))})]})]}),o.jsxs("div",{className:"mt-5 flex flex-wrap gap-x-4 gap-y-2",children:[c.slice(0,8).map(h=>o.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[o.jsx("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:h.color}}),h.label]},h.label)),c.length>8&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",c.length-8," more"]})]})]}),o.jsx("aside",{"aria-live":"polite",className:"min-h-44",children:u?o.jsxs("div",{role:"tooltip",className:"rounded-2xl border bg-popover p-4 text-popover-foreground shadow-lg",children:[o.jsx("p",{className:"font-semibold",children:Bn(u.start,s)}),o.jsxs("div",{className:"mt-3 space-y-2",children:[[...u.groups].sort((h,m)=>m.amount-h.amount).slice(0,5).map(h=>o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[o.jsx("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:d.get(h.label)||os[0]}}),o.jsx("span",{className:"min-w-0 flex-1 truncate",children:h.label}),o.jsx("strong",{children:W(h.amount,t)})]},h.key||h.label)),u.groups.length>5&&o.jsxs("p",{className:"text-xs italic text-muted-foreground",children:["+ ",u.groups.length-5," others"]})]}),o.jsxs("div",{className:"mt-3 flex justify-between border-t pt-3 text-sm",children:[o.jsx("strong",{children:"Total"}),o.jsx("strong",{className:"text-primary",children:W(u.total,t)})]})]}):o.jsx("div",{className:"flex min-h-44 items-center justify-center rounded-2xl border border-dashed p-4 text-center text-xs text-muted-foreground",children:"Hover over a bar to view its cost details."})})]}):o.jsx("p",{className:"py-24 text-center text-sm text-muted-foreground",children:"No trend data for this period."})}function Of({rows:e,currency:t}){const s=e.slice(0,8),r=Math.max(1,...s.flatMap(n=>[n.current?.amount||0,n.previous?.amount||0]));return o.jsxs(te,{className:"bg-primary/5",children:[o.jsx(de,{children:o.jsx(ye,{className:"text-sm",children:"Comparison Overview"})}),o.jsx(se,{children:o.jsxs("div",{className:"rounded-xl border bg-card p-5",children:[o.jsx("div",{className:"flex h-72 items-end gap-4 border-b border-l px-4 pt-4",children:s.map(n=>o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col items-center",children:[o.jsxs("div",{className:"flex h-56 w-full items-end justify-center gap-1",children:[o.jsx("div",{title:`Current: ${W(n.current?.amount||0,t)}`,className:"w-1/3 max-w-10 rounded-t bg-indigo-500",style:{height:`${Math.max((n.current?.amount||0)/r*100,n.current?.amount?1:0)}%`}}),o.jsx("div",{title:`Previous: ${W(n.previous?.amount||0,t)}`,className:"w-1/3 max-w-10 rounded-t bg-pink-400",style:{height:`${Math.max((n.previous?.amount||0)/r*100,n.previous?.amount?1:0)}%`}})]}),o.jsx("span",{title:n.label,className:"mt-2 w-full truncate text-center text-[10px] text-muted-foreground",children:n.label})]},n.key))}),o.jsxs("div",{className:"mt-4 flex gap-5 text-xs",children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("i",{className:"h-2.5 w-2.5 rounded-full bg-indigo-500"}),"Current Period"]}),o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("i",{className:"h-2.5 w-2.5 rounded-full bg-pink-400"}),"Previous Period"]})]})]})})]})}function Le({label:e,value:t,helper:s,accent:r=!1,trend:n}){return o.jsxs("div",{className:"rounded-xl border bg-card p-5 shadow-sm",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[n!=null&&(n<0?o.jsx(Nu,{className:"h-4 w-4 text-red-500"}):o.jsx(ra,{className:"h-4 w-4 text-emerald-500"})),o.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:e})]}),o.jsx("p",{className:`mt-2 text-2xl font-bold ${r?"text-primary":n!=null&&n<0?"text-red-500":""}`,children:t}),s&&o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:s})]})}function as({label:e,options:t,selected:s,onChange:r}){const n=s.length?`${s.length} selected`:e;return o.jsxs("details",{className:"group relative",children:[o.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between rounded-lg border bg-background px-3 py-3 text-sm text-primary",children:[o.jsx("span",{children:n}),o.jsx(Dd,{className:"h-4 w-4 transition-transform group-open:rotate-180"})]}),o.jsx("div",{className:"absolute z-30 mt-1 max-h-64 w-full overflow-auto rounded-lg border bg-popover p-2 shadow-xl",children:t.length?t.map(a=>o.jsxs("label",{className:"flex cursor-pointer items-start gap-2 rounded px-2 py-2 text-xs hover:bg-muted",children:[o.jsx("input",{type:"checkbox",checked:s.includes(a.value),onChange:i=>r(i.target.checked?[...s,a.value]:s.filter(c=>c!==a.value))}),o.jsx("span",{className:"min-w-0 break-words",children:a.label})]},a.value)):o.jsx("p",{className:"p-2 text-xs text-muted-foreground",children:"No values available."})})]})}function Lf(){return o.jsxs("div",{"aria-live":"polite","aria-busy":"true",className:"space-y-5",children:[o.jsxs("section",{className:"rounded-xl bg-primary/5 p-5",children:[o.jsxs("div",{className:"flex items-center gap-3 text-sm font-medium text-primary",children:[o.jsx(gs,{className:"h-5 w-5 animate-spin"}),"Loading live AWS cost report..."]}),o.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-3",children:[1,2,3].map(e=>o.jsx("div",{className:"h-28 animate-pulse rounded-xl border bg-card/70"},e))})]}),o.jsx("div",{className:"h-80 animate-pulse rounded-xl border bg-muted/40"}),o.jsx("div",{className:"h-64 animate-pulse rounded-xl border bg-muted/40"})]})}const qe=10,hr=new Date,Mf=new Date(Date.UTC(hr.getUTCFullYear(),hr.getUTCMonth()-2,1)).toISOString().slice(0,10),If=hr.toISOString().slice(0,10),Dt={services:[],regions:[],accountIds:[],tagKey:"",tagValues:[]},ct={service:{tab:"Services",title:"Service Cost Summary",pdfTitle:"Service Cost Report",top:"Top service cost",count:"Service count",item:"Service",empty:"No service cost data found."},account:{tab:"Accounts",title:"Account Cost Summary",pdfTitle:"Account Cost Report",top:"Top account cost",count:"Account count",item:"Linked account",empty:"No linked account cost data found."},region:{tab:"Regions",title:"Regional Cost Summary",pdfTitle:"Region Cost Report",top:"Top region cost",count:"Region count",item:"Region",empty:"No regional cost data found."},resource:{tab:"Resources",title:"Resource Cost Summary",pdfTitle:"Resource Cost Report",top:"Top resource cost",count:"Resource count",item:"Resource",empty:"Resource-level cost data requires resource IDs in the CUR export."},tag:{tab:"Tags",title:"Tag Cost Summary",pdfTitle:"Tag Cost Report",top:"Top tag value cost",count:"Tag value count",item:"Tag value",empty:"No cost allocation tag data found."}};function Un(e){return e?new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"longOffset"}).format(new Date(e)).replace("GMT","UTC"):"Not updated yet"}function $n(e,t){const s=new Date(`${e}T00:00:00Z`);if(t==="monthly"){const n=new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),0)),a=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1)),i=new Date(a);i.setUTCDate(i.getUTCDate()-1);const c=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1));return{currentStart:a.toISOString().slice(0,10),currentEnd:n.toISOString().slice(0,10),previousStart:c.toISOString().slice(0,10),previousEnd:i.toISOString().slice(0,10)}}const r=new Date(s);return r.setUTCDate(r.getUTCDate()-1),{currentStart:e,currentEnd:e,previousStart:r.toISOString().slice(0,10),previousEnd:r.toISOString().slice(0,10)}}function Rt(e,t,s){const r=new Date(`${e}T00:00:00Z`),n=new Date(`${t}T00:00:00Z`);if(s==="monthly"&&r.getUTCFullYear()===n.getUTCFullYear()&&r.getUTCMonth()===n.getUTCMonth())return new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric",timeZone:"UTC"}).format(r);const a=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});return`${a.format(r)} – ${a.format(n)}`}function Df(e){const t=new Map;return e.current.summary.forEach(s=>t.set(s.key||s.label,{current:s})),e.previous.summary.forEach(s=>{const r=s.key||s.label;t.set(r,{...t.get(r),previous:s})}),[...t.entries()].map(([s,r])=>{const n=r.current?.amount||0,a=r.previous?.amount||0,i=n-a;return{key:s,label:r.current?.label||r.previous?.label||s,...r,difference:i,change:a?i/Math.abs(a)*100:0}}).sort((s,r)=>Math.max(r.current?.amount||0,r.previous?.amount||0)-Math.max(s.current?.amount||0,s.previous?.amount||0))}function Qe(e){return e?.length?e.map(t=>`${t.label}
18
+ ${W(t.amount,"USD")}`).join(`
19
+ `):"—"}function zn({values:e}){const[t,s]=k.useState(!1);return o.jsxs("div",{className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>s(r=>!r),className:"inline-flex items-center gap-2 text-primary",children:[o.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-1 text-xs font-semibold",children:e.length}),o.jsx("span",{children:"›"})]}),t&&o.jsxs("div",{className:"absolute right-0 top-8 z-20 w-72 rounded-lg border bg-popover p-3 shadow-xl",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("strong",{className:"text-xs",children:"Cost distribution"}),o.jsx("button",{onClick:()=>s(!1),children:o.jsx(_r,{className:"h-3.5 w-3.5"})})]}),e.length?e.map(r=>o.jsxs("div",{className:"flex justify-between gap-3 border-t py-2 text-xs",children:[o.jsx("span",{className:"min-w-0 truncate",title:r.label,children:r.label}),o.jsx("strong",{children:W(r.amount,"USD")})]},r.key)):o.jsx("p",{className:"text-xs text-muted-foreground",children:"No related values."})]})]})}function wa({page:e,pages:t,total:s,onChange:r}){const n=s?(e-1)*qe+1:0,a=Math.min(e*qe,s);return o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t px-4 py-4 text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Showing ",n,"–",a," of ",s]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{"aria-label":"Previous page",disabled:e<=1,onClick:()=>r(e-1),className:"rounded-md border p-1.5 disabled:opacity-40",children:o.jsx(Bd,{className:"h-4 w-4"})}),o.jsxs("span",{children:["Page ",e," of ",t]}),o.jsx("button",{"aria-label":"Next page",disabled:e>=t,onClick:()=>r(e+1),className:"rounded-md border p-1.5 disabled:opacity-40",children:o.jsx($d,{className:"h-4 w-4"})})]})]})}function Ff({groupBy:e,report:t}){const[s,r]=k.useState(""),[n,a]=k.useState(1),[i,c]=k.useState(null),[d,l]=k.useState({percentage:!0,accounts:!0,regions:!0}),f=ct[e],u=k.useMemo(()=>{const g=s.trim().toLowerCase();return g?t.summary.filter(b=>`${b.label} ${b.accountId||""}`.toLowerCase().includes(g)):t.summary},[t,s]),h=Math.max(1,Math.ceil(u.length/qe)),m=u.slice((n-1)*qe,n*qe),p=3+Number(d.percentage)+Number(d.accounts)+Number(d.regions);return k.useEffect(()=>{a(1)},[t,s,e]),o.jsxs(te,{children:[o.jsxs(de,{className:"flex flex-row flex-wrap items-center justify-between gap-3",children:[o.jsx(ye,{className:"text-sm text-primary",children:"Cost and usage breakdown"}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs("label",{className:"flex items-center gap-2 rounded-full border bg-background px-4 py-2 text-sm",children:[o.jsx(Cr,{className:"h-4 w-4 text-muted-foreground"}),o.jsx("input",{"aria-label":"Search breakdown",value:s,onChange:g=>r(g.target.value),placeholder:"Search...",className:"w-48 bg-transparent outline-none"})]}),o.jsxs("details",{className:"relative",children:[o.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 rounded-md border px-3 py-2 text-sm text-primary",children:[o.jsx(xu,{className:"h-4 w-4"}),"Column visibility"]}),o.jsx("div",{className:"absolute right-0 z-20 mt-1 w-48 rounded-md border bg-popover p-3 shadow-xl",children:Object.entries(d).map(([g,b])=>o.jsxs("label",{className:"flex gap-2 py-1 text-xs capitalize",children:[o.jsx("input",{type:"checkbox",checked:b,onChange:x=>l(y=>({...y,[g]:x.target.checked}))}),g]},g))})]})]})]}),o.jsx(se,{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b bg-primary/5 text-left text-xs uppercase text-primary",children:[o.jsx("th",{className:"px-4 py-4",children:f.item}),o.jsx("th",{className:"px-4",children:"Cost"}),d.percentage&&o.jsx("th",{className:"px-4",children:"Percentage"}),d.accounts&&o.jsx("th",{className:"px-4",children:"Accounts"}),d.regions&&o.jsx("th",{className:"px-4",children:"Regions"}),o.jsx("th",{className:"px-4 text-center",children:"Actions"})]})}),o.jsx("tbody",{children:m.length?m.map(g=>o.jsxs("tr",{className:"border-b last:border-0",children:[o.jsxs("td",{className:"max-w-72 px-4 py-4 font-medium",children:[o.jsx("div",{className:"truncate",title:g.label,children:g.label}),e==="account"&&o.jsx("div",{className:"font-mono text-xs text-muted-foreground",children:g.accountId||g.key})]}),o.jsx("td",{className:"px-4 font-semibold",children:W(g.amount,t.currency)}),d.percentage&&o.jsxs("td",{className:"px-4",children:[o.jsx("span",{className:"mr-2 inline-block h-1.5 w-12 overflow-hidden rounded-full bg-primary/15 align-middle",children:o.jsx("span",{className:"block h-full bg-primary",style:{width:`${Math.min(g.percentage||0,100)}%`}})}),o.jsxs("strong",{className:"text-primary",children:[g.percentage?.toFixed(2),"%"]})]}),d.accounts&&o.jsx("td",{className:"px-4",children:o.jsx(zn,{values:g.accounts||[]})}),d.regions&&o.jsx("td",{className:"px-4",children:o.jsx(zn,{values:g.regions||[]})}),o.jsx("td",{className:"px-4 text-center",children:o.jsx("button",{type:"button",onClick:()=>c(g),title:"View cost details",className:"text-primary hover:opacity-70",children:o.jsx(Jd,{className:"h-4 w-4"})})})]},g.key||g.label)):o.jsx("tr",{children:o.jsx("td",{colSpan:p,className:"py-12 text-center text-muted-foreground",children:f.empty})})})]})}),o.jsx(wa,{page:n,pages:h,total:u.length,onChange:a}),i&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:()=>c(null),children:o.jsxs("div",{className:"max-h-[80vh] w-full max-w-2xl overflow-auto rounded-xl bg-card p-6 shadow-2xl",onClick:g=>g.stopPropagation(),children:[o.jsxs("div",{className:"flex justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-xs uppercase text-muted-foreground",children:f.item}),o.jsx("h3",{className:"mt-1 text-lg font-semibold",children:i.label})]}),o.jsx("button",{onClick:()=>c(null),children:o.jsx(_r,{})})]}),o.jsxs("div",{className:"mt-5 grid gap-3 sm:grid-cols-3",children:[o.jsx(Le,{label:"Cost",value:W(i.amount,t.currency)}),o.jsx(Le,{label:"Accounts",value:String(i.accounts?.length||0)}),o.jsx(Le,{label:"Regions",value:String(i.regions?.length||0)})]}),o.jsxs("div",{className:"mt-5 grid gap-5 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"mb-2 text-sm font-semibold",children:"Accounts"}),(i.accounts||[]).map(g=>o.jsxs("div",{className:"flex justify-between border-t py-2 text-xs",children:[o.jsx("span",{children:g.label}),o.jsx("strong",{children:W(g.amount,t.currency)})]},g.key))]}),o.jsxs("div",{children:[o.jsx("h4",{className:"mb-2 text-sm font-semibold",children:"Regions"}),(i.regions||[]).map(g=>o.jsxs("div",{className:"flex justify-between border-t py-2 text-xs",children:[o.jsx("span",{children:g.label}),o.jsx("strong",{children:W(g.amount,t.currency)})]},g.key))]})]})]})})]})}function Bf({rows:e,groupBy:t,comparison:s,granularity:r}){const[n,a]=k.useState(""),[i,c]=k.useState(1),d=k.useMemo(()=>{const m=n.trim().toLowerCase();return m?e.filter(p=>p.label.toLowerCase().includes(m)):e},[e,n]),l=Math.max(1,Math.ceil(d.length/qe)),f=d.slice((i-1)*qe,i*qe),u=Rt(s.currentStart,s.currentEnd,r),h=Rt(s.previousStart,s.previousEnd,r);return k.useEffect(()=>{c(1)},[n,t,s]),o.jsxs(te,{children:[o.jsxs(de,{className:"flex flex-row flex-wrap items-center justify-between gap-3",children:[o.jsx(ye,{className:"text-sm text-primary",children:"Comparison Details"}),o.jsxs("label",{className:"flex items-center gap-2 rounded-full border bg-background px-4 py-2 text-sm",children:[o.jsx(Cr,{className:"h-4 w-4 text-muted-foreground"}),o.jsx("input",{"aria-label":"Search comparison",value:n,onChange:m=>a(m.target.value),placeholder:"Search...",className:"w-48 bg-transparent outline-none"})]})]}),o.jsx(se,{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b bg-primary/5 text-left text-xs uppercase text-primary",children:[o.jsxs("th",{className:"px-4 py-4",children:[ct[t].item," name"]}),o.jsxs("th",{className:"px-4",children:[u,o.jsx("small",{className:"block font-normal",children:"Cost"})]}),o.jsxs("th",{className:"px-4",children:[h,o.jsx("small",{className:"block font-normal",children:"Cost"})]}),o.jsx("th",{className:"px-4",children:"Difference"}),o.jsx("th",{className:"px-4",children:"Change %"})]})}),o.jsx("tbody",{children:f.length?f.map(m=>o.jsxs("tr",{className:"border-b",children:[o.jsx("td",{className:"max-w-80 px-4 py-4 font-medium",children:o.jsx("div",{className:"truncate",title:m.label,children:m.label})}),o.jsx("td",{className:"px-4",children:W(m.current?.amount||0,s.current.currency)}),o.jsx("td",{className:"px-4",children:W(m.previous?.amount||0,s.previous.currency)}),o.jsxs("td",{className:`px-4 font-medium ${m.difference<0?"text-red-500":"text-emerald-600"}`,children:[m.difference>=0?"+":"",W(m.difference,s.current.currency)]}),o.jsxs("td",{className:`px-4 font-medium ${m.change<0?"text-red-500":m.change>0?"text-emerald-600":"text-muted-foreground"}`,children:[m.change>0?"+":"",m.change.toFixed(1),"%"]})]},m.key)):o.jsx("tr",{children:o.jsx("td",{colSpan:5,className:"py-12 text-center text-muted-foreground",children:"No comparison data found."})})})]})}),o.jsx(wa,{page:i,pages:l,total:d.length,onChange:c})]})}function Uf(e){const{mode:t,groupBy:s,start:r,end:n,granularity:a,reportTagKey:i,options:c,filters:d,loading:l,filtersLoading:f,comparisonPeriods:u}=e;return o.jsxs("aside",{className:"space-y-4",children:[o.jsxs(te,{className:"bg-primary/5",children:[o.jsx(de,{children:o.jsx(ye,{className:"text-sm uppercase text-primary",children:"Report parameters"})}),o.jsxs(se,{className:"space-y-4",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:()=>e.onModeChange("standard"),className:`rounded-md px-4 py-2 text-xs font-semibold ${t==="standard"?"bg-primary text-primary-foreground":"border text-primary"}`,children:"Standard"}),o.jsx("button",{onClick:()=>e.onModeChange("compare"),className:`rounded-md px-4 py-2 text-xs font-semibold ${t==="compare"?"bg-primary text-primary-foreground":"border text-primary"}`,children:"Compare"})]}),t==="standard"&&o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"block text-xs text-muted-foreground",children:["Start date",o.jsx("input",{type:"date",value:r,onChange:h=>e.onStartChange(h.target.value),className:"mt-1 w-full rounded-md border bg-background p-2 text-sm text-foreground"})]}),o.jsxs("label",{className:"block text-xs text-muted-foreground",children:["End date",o.jsx("input",{type:"date",value:n,onChange:h=>e.onEndChange(h.target.value),className:"mt-1 w-full rounded-md border bg-background p-2 text-sm text-foreground"})]})]}),o.jsxs("label",{className:"block text-xs text-muted-foreground",children:["Granularity",o.jsxs("select",{value:a,onChange:h=>e.onGranularityChange(h.target.value),className:"mt-1 w-full rounded-md border bg-background p-2 text-sm text-foreground",children:[o.jsx("option",{value:"monthly",children:"Monthly"}),o.jsx("option",{value:"daily",children:"Daily"})]})]}),t==="compare"&&o.jsxs("p",{className:"rounded-md bg-background p-2 text-xs text-muted-foreground",children:["Current: ",u.currentStart," to ",u.currentEnd,o.jsx("br",{}),"Previous: ",u.previousStart," to ",u.previousEnd]}),s==="tag"&&o.jsxs("label",{className:"block text-xs text-muted-foreground",children:["Group by tag key",o.jsx("select",{value:i,onChange:h=>e.onReportTagKeyChange(h.target.value),className:"mt-1 w-full rounded-md border bg-background p-2 text-sm text-foreground",children:c.tagKeys.map(h=>o.jsx("option",{children:h},h))})]}),o.jsxs("button",{onClick:e.onRun,disabled:l,className:"flex w-full items-center justify-center gap-2 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",children:[o.jsx(Ke,{className:`h-4 w-4 ${l?"animate-spin":""}`}),"Run report"]})]})]}),o.jsxs(te,{className:"bg-primary/5",children:[o.jsx(de,{children:o.jsx(ye,{className:"text-sm uppercase text-primary",children:"Filter by"})}),o.jsxs(se,{className:"space-y-3",children:[o.jsx(as,{label:"Services",options:c.services,selected:d.services,onChange:h=>e.onFiltersChange(m=>({...m,services:h}))}),o.jsx(as,{label:"Region",options:c.regions,selected:d.regions,onChange:h=>e.onFiltersChange(m=>({...m,regions:h}))}),o.jsx(as,{label:"Linked Account",options:c.accounts,selected:d.accountIds,onChange:h=>e.onFiltersChange(m=>({...m,accountIds:h}))}),o.jsxs("select",{value:d.tagKey,onChange:h=>{const m=h.target.value;e.onFiltersChange(p=>({...p,tagKey:m,tagValues:[]})),m&&e.onLoadTagValues(m)},className:"w-full rounded-lg border bg-background px-3 py-3 text-sm text-primary",children:[o.jsx("option",{value:"",children:"Tag key"}),c.tagKeys.map(h=>o.jsx("option",{children:h},h))]}),d.tagKey&&o.jsx(as,{label:"Tag values",options:c.tagValues.map(h=>({value:h,label:h})),selected:d.tagValues,onChange:h=>e.onFiltersChange(m=>({...m,tagValues:h}))}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-2",children:[o.jsx("button",{onClick:e.onApply,disabled:f||l,className:"rounded-md bg-primary px-3 py-2 text-sm font-semibold text-primary-foreground disabled:opacity-50",children:"Apply Filters"}),o.jsx("button",{onClick:e.onReset,disabled:l,className:"rounded-md border bg-background px-3 py-2 text-sm text-primary disabled:opacity-50",children:"Reset"})]})]})]})]})}function $f(){const[e,t]=k.useState("service"),[s,r]=k.useState("standard"),[n,a]=k.useState(Mf),[i,c]=k.useState(If),[d,l]=k.useState("monthly"),[f,u]=k.useState("Name"),[h,m]=k.useState({services:[],regions:[],accounts:[],tagKeys:[],tagValues:[]}),[p,g]=k.useState(Dt),[b,x]=k.useState(Dt),[y,S]=k.useState(null),[w,C]=k.useState(null),[_,R]=k.useState(!0),[j,E]=k.useState(!1),[A,P]=k.useState(null),[I,ee]=k.useState(null),V=k.useRef(0),Z=k.useMemo(()=>w?Df(w):[],[w]),Q=$n(i,d),J=(D,F,U,X)=>({start:F,end:U,groupBy:X,granularity:d,tagKey:f,services:D.services.join(","),regions:D.regions.join(","),accountIds:D.accountIds.join(","),filterTagKey:D.tagKey||void 0,tagValues:D.tagValues.join(",")}),ue=async(D="")=>{E(!0);try{const F=I||await ie.getDataStatus();if(ee(F),!F.ready)return;const U=await ie.getFilterOptions({start:n,end:i,filterTagKey:D||void 0});m(X=>D?{...X,tagValues:U.tagValues}:U),!D&&U.tagKeys.length&&!U.tagKeys.includes(f)&&u(U.tagKeys[0])}catch(F){P(F?.response?.data?.error||F.message||"Failed to load filter values")}finally{E(!1)}},he=async(D=b,F=s,U=e)=>{const X=++V.current;R(!0),P(null),S(null),C(null);try{const K=await ie.getDataStatus();if(X===V.current&&ee(K),!K.ready)return;if(F==="compare"){const fe=$n(i,d),[ve,ae]=await Promise.all([ie.getReports(J(D,fe.currentStart,fe.currentEnd,U)),ie.getReports(J(D,fe.previousStart,fe.previousEnd,U))]);X===V.current&&(S(ve),C({current:ve,previous:ae,...fe}))}else{const fe=await ie.getReports(J(D,n,i,U));X===V.current&&S(fe)}}catch(K){X===V.current&&P(K?.response?.data?.error||K.message||"Failed to generate cost report")}finally{X===V.current&&R(!1)}};return k.useEffect(()=>{he(b,s,e)},[e,s]),k.useEffect(()=>{ue()},[]),{groupBy:e,mode:s,start:n,end:i,granularity:d,reportTagKey:f,options:h,draftFilters:p,report:y,comparison:w,loading:_,filtersLoading:j,error:A,dataStatus:I,comparedRows:Z,selectedComparisonPeriods:Q,setStart:a,setEnd:c,setGranularity:l,setReportTagKey:u,setDraftFilters:g,changeGroup:D=>{D!==e&&(R(!0),S(null),C(null),t(D))},changeMode:D=>{D!==s&&(R(!0),S(null),C(null),r(D))},applyFilters:()=>{const D={...p,services:[...p.services],regions:[...p.regions],accountIds:[...p.accountIds],tagValues:[...p.tagValues]};x(D),he(D)},resetFilters:()=>{g(Dt),x(Dt),he(Dt)},runReport:()=>{ue(),he()},loadOptions:ue}}function zf(e){const{report:t,comparison:s,rows:r,groupBy:n,mode:a,start:i,end:c}=e,d=ct[n];let l,f;a==="compare"&&s?(l=[[d.item,"Current Cost","Previous Cost","Difference","Change %"].join(","),...r.map(h=>[`"${h.label.replace(/"/g,'""')}"`,h.current?.amount||0,h.previous?.amount||0,h.difference,h.change.toFixed(2)].join(","))].join(`
20
+ `),f=`comparison-report-${n}-${Date.now()}.csv`):(l=[[d.item,"Cost","Percentage","Accounts","Regions"].join(","),...t.summary.map(h=>[`"${h.label.replace(/"/g,'""')}"`,h.amount,h.percentage||0,h.accounts?.length||0,h.regions?.length||0].join(","))].join(`
21
+ `),f=`${n}-summary-report-${Date.now()}.csv`);const u=document.createElement("a");u.href=URL.createObjectURL(new Blob([l],{type:"text/csv"})),u.download=f,u.click(),URL.revokeObjectURL(u.href)}async function Vf(e){const{report:t,comparison:s,rows:r,groupBy:n,mode:a,start:i,end:c,granularity:d}=e,l=ct[n],[{jsPDF:f},{default:u}]=await Promise.all([Promise.resolve().then(()=>require("./jspdf.es.min-C10id8ME.cjs")).then(g=>g.jspdf_es_min),Promise.resolve().then(()=>require("./jspdf.plugin.autotable-CvTok6mL.cjs"))]),h=new f({orientation:"landscape",unit:"pt",format:"a4"}),m=(g,b,x)=>{h.setFontSize(7),h.setTextColor(100),h.text(`Report generated · All costs in ${t.currency} · ${b} to ${x}`,40,h.internal.pageSize.height-18),h.text(`Page ${g.pageNumber}`,h.internal.pageSize.width-70,h.internal.pageSize.height-18)};if(a==="compare"&&s){h.setFontSize(18),h.setTextColor(25),h.text("Comparison Report",40,42),h.setFontSize(9),h.setTextColor(98,86,230),h.text("TOTAL COST",40,66),h.setTextColor(40),h.text(`Previous Cost: ${s.previous.totalCost}`,40,82),h.text(`Current Cost: ${s.current.totalCost}`,220,82),h.text(`Granularity: ${d}`,400,82),u(h,{startY:100,head:[[`${l.item} Name`,"Current Cost","Previous Cost","Current Period","Previous Period","Change %","Current Accounts","Previous Accounts","Current Regions","Previous Regions"]],body:r.map(g=>[g.label,g.current?.amount?.toFixed(2)||"0.00",g.previous?.amount?.toFixed(2)||"0.00",Rt(s.currentStart,s.currentEnd,d),Rt(s.previousStart,s.previousEnd,d),`${g.change.toFixed(4)}%`,Qe(g.current?.accounts),Qe(g.previous?.accounts),Qe(g.current?.regions),Qe(g.previous?.regions)]),styles:{fontSize:6,cellPadding:3,overflow:"linebreak"},headStyles:{fillColor:[242,237,255],textColor:[82,35,190]},didDrawPage:g=>m(g,s.previousStart,s.currentEnd),margin:{bottom:32}}),h.save(`comparison-report-${n}-${Date.now()}.pdf`);return}h.setFontSize(18),h.setTextColor(25),h.text(l.pdfTitle,40,42),h.setFontSize(9),h.setTextColor(98,86,230),h.text("REPORT METADATA",40,66),h.setTextColor(40),h.text(`Tenant ID: ${t.tenantId||"Current tenant"}`,40,82),h.text(`Date Range: ${i} to ${c}`,40,97),h.text(`Accrued Total Cost: ${W(t.totalCost,t.currency)}`,40,112),h.setTextColor(98,86,230),h.text("COST SUMMARY BREAKDOWN",40,136);const p=n==="account";u(h,{startY:146,head:[p?["Account ID","Account Name","Total Cost","Percentage","Regions"]:[`${l.item} Name`,"Total Cost","Percentage","Accounts","Regions"]],body:t.summary.map(g=>p?[g.accountId||g.key||"—",g.label,W(g.amount,t.currency),`${(g.percentage||0).toFixed(2)}%`,Qe(g.regions)]:[g.label,W(g.amount,t.currency),`${(g.percentage||0).toFixed(2)}%`,Qe(g.accounts),Qe(g.regions)]),styles:{fontSize:7,cellPadding:4,overflow:"linebreak"},headStyles:{fillColor:[242,237,255],textColor:[82,35,190]},didDrawPage:g=>m(g,i,c),margin:{bottom:32}}),h.save(`${n}-summary-report-${Date.now()}.pdf`)}function Wf(){const e=$f(),{groupBy:t,mode:s,report:r,comparison:n,comparedRows:a,loading:i,error:c,dataStatus:d,granularity:l,start:f,end:u}=e,h=ct[t],m=r?.summary[0],p=n?n.current.totalCost-n.previous.totalCost:0,g=n?.previous.totalCost?p/Math.abs(n.previous.totalCost)*100:0,b=r?{report:r,comparison:n,rows:a,groupBy:t,mode:s,start:f,end:u,granularity:l}:null,x=o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("button",{onClick:()=>b&&void Vf(b),disabled:!b||i,className:"flex items-center gap-2 rounded-md border bg-card px-3 py-1.5 text-sm disabled:opacity-50",children:[o.jsx(Zd,{className:"h-4 w-4"}),"PDF"]}),o.jsxs("button",{onClick:()=>b&&zf(b),disabled:!b||i,className:"flex items-center gap-2 rounded-md border bg-card px-3 py-1.5 text-sm disabled:opacity-50",children:[o.jsx(Qo,{className:"h-4 w-4"}),"CSV"]})]});return o.jsxs("div",{className:"flex w-full flex-col gap-5 p-2 md:p-6",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold",children:[o.jsx(eu,{className:"h-6 w-6 text-primary"}),"Cost reports"]}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Analyse live AWS cost by service, linked account, region, resource, or cost allocation tag"})]}),!i&&(d&&!d.ready||c&&!d)?o.jsx(Nt,{status:d,error:c}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex gap-1 overflow-x-auto border-b",children:Object.keys(ct).map(y=>o.jsx("button",{onClick:()=>e.changeGroup(y),className:`border-b-2 px-4 py-3 text-sm font-medium ${t===y?"border-primary text-primary":"border-transparent text-muted-foreground"}`,children:ct[y].tab},y))}),o.jsxs("div",{className:"grid gap-5 xl:grid-cols-[minmax(0,1fr)_320px]",children:[o.jsxs("div",{className:"space-y-5",children:[c&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:[o.jsx(Ge,{className:"h-4 w-4"}),c]}),i?o.jsx(Lf,{}):s==="compare"&&n?o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"rounded-xl bg-primary/5 p-4",children:[o.jsxs("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-sm font-semibold",children:"Comparison Cost Summary"}),o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Updated On: ",Un(n.current.updatedAt)]})]}),x]}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[o.jsx(Le,{label:"Period accrued total",value:`${W(n.current.totalCost,n.current.currency)} vs ${W(n.previous.totalCost,n.previous.currency)}`,helper:`${g>=0?"+":""}${g.toFixed(1)}% from previous period`,trend:g}),o.jsx(Le,{label:Rt(n.currentStart,n.currentEnd,l),value:W(n.current.totalCost,n.current.currency),helper:"Current period spending"}),o.jsx(Le,{label:Rt(n.previousStart,n.previousEnd,l),value:W(n.previous.totalCost,n.previous.currency),helper:"Previous period spending"}),o.jsx(Le,{label:l==="monthly"?"Monthly change":"Period change",value:`${p>=0?"+":""}${W(p,n.current.currency)}`,helper:`${g>=0?"+":""}${g.toFixed(1)}% from previous period`,trend:p})]})]}),o.jsx(Of,{rows:a,currency:n.current.currency}),o.jsx(Bf,{rows:a,groupBy:t,comparison:n,granularity:l})]}):r?o.jsxs(o.Fragment,{children:[r.message&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border bg-muted/50 p-3 text-sm text-muted-foreground",children:[o.jsx(Ge,{className:"h-4 w-4"}),r.message]}),o.jsxs("section",{className:"rounded-xl bg-primary/5 p-4",children:[o.jsxs("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-sm font-semibold",children:h.title}),o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Updated On: ",Un(r.updatedAt)]})]}),x]}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[o.jsx(Le,{label:"Accrued cost",value:W(r.totalCost,r.currency)}),o.jsx(Le,{label:h.top,value:m?W(m.amount,r.currency):"-",accent:!0}),o.jsx(Le,{label:h.count,value:String(r.count||0),accent:!0})]})]}),o.jsxs(te,{children:[o.jsx(de,{children:o.jsx(ye,{className:"text-sm",children:"Cost Trend"})}),o.jsx(se,{children:o.jsx(Af,{timeline:r.timeline||[],currency:r.currency||"USD",daily:l==="daily"})})]}),o.jsx(Ff,{groupBy:t,report:r})]}):null]}),o.jsx(Uf,{mode:s,groupBy:t,start:f,end:u,granularity:l,reportTagKey:e.reportTagKey,options:e.options,filters:e.draftFilters,loading:i,filtersLoading:e.filtersLoading,comparisonPeriods:e.selectedComparisonPeriods,onModeChange:e.changeMode,onStartChange:e.setStart,onEndChange:e.setEnd,onGranularityChange:e.setGranularity,onReportTagKeyChange:e.setReportTagKey,onFiltersChange:e.setDraftFilters,onLoadTagValues:y=>{e.loadOptions(y)},onRun:e.runReport,onApply:e.applyFilters,onReset:e.resetFilters})]})]})]})}function Hf(e){return o.jsxs(te,{children:[o.jsx(de,{children:o.jsx(ye,{className:"text-sm",children:"Configure monthly budget"})}),o.jsxs(se,{children:[o.jsxs("form",{onSubmit:e.onSubmit,className:"grid gap-4 md:grid-cols-4 md:items-end",children:[o.jsxs("label",{className:"text-xs text-muted-foreground",children:["Budget name",o.jsx("input",{value:e.name,onChange:t=>e.onNameChange(t.target.value),placeholder:"Monthly AWS budget",className:"mt-1 w-full rounded-md border bg-background p-2 text-sm text-foreground"})]}),o.jsxs("label",{className:"text-xs text-muted-foreground",children:["Monthly limit (USD)",o.jsx("input",{type:"number",min:"0.01",step:"0.01",value:e.amount,onChange:t=>e.onAmountChange(t.target.value),placeholder:"500",className:"mt-1 w-full rounded-md border bg-background p-2 text-sm text-foreground"})]}),o.jsxs("label",{className:"text-xs text-muted-foreground",children:["Warning threshold (%)",o.jsx("input",{type:"number",min:"1",max:"100",value:e.threshold,onChange:t=>e.onThresholdChange(t.target.value),className:"mt-1 w-full rounded-md border bg-background p-2 text-sm text-foreground"})]}),o.jsx("button",{type:"submit",disabled:e.creating,className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",children:e.creating?"Saving...":"Create budget"})]}),o.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"This plugin budget compares the current month's gross AWS cost with your limit. Meyi Connect checks the rule after login and periodically while the user is signed in, then shows an in-app alert when the warning threshold or limit is crossed. It does not create or modify an AWS Budgets resource."})]})]})}function qf({budget:e,deleting:t,onDelete:s}){const r=e.amount>0?e.spent/e.amount*100:0,n=r>=100,a=r>=e.alert_threshold,i=n?"Over budget":a?"Near limit":"Within budget",c=n?"text-destructive":a?"text-yellow-600":"text-emerald-600";return o.jsxs(te,{className:n?"border-destructive/50":"",children:[o.jsxs(de,{className:"flex flex-row items-center justify-between pb-2 space-y-0",children:[o.jsx(ye,{className:"text-sm font-medium",children:e.name}),o.jsx("button",{onClick:()=>s(e.id),disabled:t===e.id,className:"text-muted-foreground hover:text-destructive disabled:opacity-50",title:"Delete budget",children:o.jsx(Su,{className:"h-4 w-4"})})]}),o.jsxs(se,{className:"space-y-3",children:[o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{className:"text-muted-foreground",children:"Spent"}),o.jsx("span",{className:n?"text-destructive font-semibold":"font-medium",children:W(e.spent,e.currency)})]}),o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{className:"text-muted-foreground",children:"Budget"}),o.jsx("span",{children:W(e.amount,e.currency)})]}),o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{className:"text-muted-foreground",children:"Alert status"}),o.jsx("span",{className:`font-medium ${c}`,children:i})]}),o.jsx("div",{className:"h-2 w-full rounded-full bg-muted overflow-hidden",children:o.jsx("div",{className:`h-full rounded-full transition-all ${n?"bg-destructive":a?"bg-yellow-500":"bg-primary"}`,style:{width:`${Math.min(r,100)}%`}})}),o.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[r.toFixed(1),"% used"]}),o.jsxs("p",{className:"text-xs text-muted-foreground capitalize",children:[e.period.replace(/_/g," "),e.provider?` · ${e.provider.toUpperCase()}`:""]})]})]})}function Gf({budgets:e,loading:t,deleting:s,onDelete:r}){return t?o.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(n=>o.jsx("div",{className:"h-40 animate-pulse rounded-xl bg-muted"},n))}):e.length?o.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>o.jsx(qf,{budget:n,deleting:s,onDelete:r},n.id))}):o.jsx(te,{children:o.jsxs(se,{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground gap-3",children:[o.jsx(na,{className:"h-10 w-10 opacity-30"}),o.jsx("p",{className:"text-sm",children:"No budgets configured yet."}),o.jsx("p",{className:"text-xs",children:"Create a budget to track and alert on your cloud spend."})]})})}function Kf(){const[e,t]=k.useState([]),[s,r]=k.useState(!1),[n,a]=k.useState(null),[i,c]=k.useState(null),[d,l]=k.useState(!1),[f,u]=k.useState(!1),[h,m]=k.useState(""),[p,g]=k.useState(""),[b,x]=k.useState("80"),[y,S]=k.useState(0),[w,C]=k.useState(null),_=async()=>{r(!0),a(null);try{const[E,A]=await Promise.all([ie.getBudgets(),ie.getDataStatus()]);C(A);let P=0;if(A.ready)try{P=(await ie.getOverview({period:"monthly"})).totalCost}catch{}S(P),t(E.budgets.map(I=>({...I,spent:P})))}catch(E){a(E?.response?.data?.error||E.message||"Failed to load budgets")}finally{r(!1)}},R=async E=>{E.preventDefault();const A=Number(p),P=Number(b);if(!h.trim()||!Number.isFinite(A)||A<=0||!Number.isFinite(P)||P<1||P>100){a("Enter a name, a positive budget amount, and an alert threshold from 1 to 100.");return}u(!0),a(null);try{const I=await ie.createBudget({name:h.trim(),amount:A,currency:"USD",period:"monthly",alert_threshold:P,provider:"aws"});t(ee=>[{...I,spent:y},...ee]),m(""),g(""),x("80"),l(!1)}catch(I){a(I?.response?.data?.error||I.message||"Failed to create budget")}finally{u(!1)}},j=async E=>{c(E);try{await ie.deleteBudget(E),t(A=>A.filter(P=>P.id!==E))}catch(A){a(A?.response?.data?.error||A.message||"Failed to delete budget")}finally{c(null)}};return k.useEffect(()=>{_()},[]),{budgets:e,dataStatus:w,loading:s,error:n,deleting:i,showForm:d,creating:f,name:h,amount:p,threshold:b,setShowForm:l,setName:m,setAmount:g,setThreshold:x,load:_,create:R,remove:j}}function Yf(){const e=Kf();return o.jsxs("div",{className:"flex flex-col gap-6 p-6 w-full",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[o.jsx(na,{className:"h-6 w-6 text-primary"}),"Budgets"]}),o.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Set a monthly spending target and monitor when usage crosses its warning threshold"})]}),e.dataStatus?.ready&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:()=>e.setShowForm(t=>!t),className:"inline-flex items-center gap-2 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground",children:[o.jsx(ta,{className:"h-4 w-4"}),"New budget"]}),o.jsxs("button",{onClick:e.load,disabled:e.loading,className:"inline-flex items-center gap-2 rounded-md border border-border bg-background px-3 py-1.5 text-sm font-medium shadow-sm hover:bg-muted disabled:opacity-50",children:[o.jsx(Ke,{className:`h-4 w-4 ${e.loading?"animate-spin":""}`}),"Refresh"]})]})]}),!e.loading&&(e.dataStatus&&!e.dataStatus.ready||e.error&&!e.dataStatus)?o.jsx(Nt,{status:e.dataStatus,error:e.error}):o.jsxs(o.Fragment,{children:[e.error&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/50 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:[o.jsx(Ge,{className:"h-4 w-4 shrink-0"}),e.error]}),e.showForm&&o.jsx(Hf,{name:e.name,amount:e.amount,threshold:e.threshold,creating:e.creating,onNameChange:e.setName,onAmountChange:e.setAmount,onThresholdChange:e.setThreshold,onSubmit:e.create}),o.jsx(Gf,{budgets:e.budgets,loading:e.loading,deleting:e.deleting,onDelete:e.remove})]})]})}const Vn={READY:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30",RUNNING:"bg-blue-500/10 text-blue-600 border-blue-500/30",WAITING_FOR_DATA:"bg-amber-500/10 text-amber-600 border-amber-500/30",WAITING_FOR_TABLE:"bg-amber-500/10 text-amber-600 border-amber-500/30",FAILED:"bg-destructive/10 text-destructive border-destructive/30",PENDING:"bg-muted text-muted-foreground border-border"},Jf={INFO:"text-muted-foreground",WARN:"text-amber-600",ERROR:"text-destructive"},is=e=>e?new Date(e).toLocaleString():"—";function Xf({status:e}){return o.jsx("span",{className:`rounded-full border px-2 py-0.5 text-xs font-medium ${Vn[e]||Vn.PENDING}`,children:e.replace(/_/g," ")})}function De({label:e,value:t,mono:s}){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:e}),o.jsx("span",{className:`break-all text-sm ${s?"font-mono text-xs":""}`,children:t||"—"})]})}function Zf(){const[e,t]=k.useState([]),[s,r]=k.useState([]),[n,a]=k.useState(!0),[i,c]=k.useState(null),d=k.useCallback(async()=>{a(!0),c(null);try{const l=await oe.get("/cur-discovery",{params:{logLimit:100}});t(l.data?.jobs||[]),r(l.data?.logs||[])}catch(l){c(l?.response?.data?.error||l?.message||"Unable to load CUR discovery status")}finally{a(!1)}},[]);return k.useEffect(()=>{d()},[d]),o.jsxs("div",{className:"flex w-full flex-col gap-6 p-2 md:p-6",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold",children:[o.jsx(Cr,{className:"h-6 w-6 text-primary"}),"CUR Discovery"]}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Progress of the scheduled job that locates this tenant’s Cost and Usage Report table. Cost data becomes available after it reports Ready."})]}),o.jsx("button",{onClick:()=>{d()},disabled:n,className:"rounded-lg border p-2 hover:bg-muted disabled:opacity-50","aria-label":"Refresh",children:o.jsx(Ke,{className:`h-4 w-4 ${n?"animate-spin":""}`})})]}),i&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:[o.jsx(Ge,{className:"h-4 w-4"}),i]}),!n&&!i&&!e.length&&o.jsx(te,{children:o.jsx(se,{className:"py-10 text-center text-sm text-muted-foreground",children:"No discovery job exists for this tenant yet. One is created automatically once the AWS connection is verified and the Cost plugin is entitled."})}),e.map(l=>o.jsxs(te,{children:[o.jsxs(de,{className:"flex flex-row flex-wrap items-center gap-3",children:[o.jsx(Xo,{className:"h-4 w-4 text-primary"}),o.jsxs(ye,{className:"text-sm",children:["Connection ",l.connectionId]}),o.jsx(Xf,{status:l.status}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["attempt ",l.attemptCount]}),o.jsxs("span",{className:"ms-auto text-xs text-muted-foreground",children:["next check ",is(l.nextRunAt)]})]}),o.jsxs(se,{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[o.jsx(De,{label:"Source",value:l.curS3Uri||`s3://${l.bucket}/${l.prefix}`,mono:!0}),o.jsx(De,{label:"Tenant partition",value:l.tenantPartition,mono:!0}),o.jsx(De,{label:"Region",value:l.region}),o.jsx(De,{label:"Glue database",value:l.database,mono:!0}),o.jsx(De,{label:"Discovered table",value:l.table,mono:!0}),o.jsx(De,{label:"Table location",value:l.tableLocation,mono:!0}),o.jsx(De,{label:"Sample object",value:l.sampleObjectKey,mono:!0}),o.jsx(De,{label:"Last data",value:is(l.lastDataAt)}),o.jsx(De,{label:"Last checked",value:is(l.lastFinishedAt||l.lastStartedAt)}),l.lastError&&o.jsx("div",{className:"md:col-span-2 lg:col-span-3 rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:l.lastError})]})]},l.id)),e.length>0&&o.jsxs(te,{children:[o.jsx(de,{children:o.jsx(ye,{className:"text-sm",children:"Recent activity"})}),o.jsx(se,{children:s.length?o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b text-left text-xs uppercase text-muted-foreground",children:[o.jsx("th",{className:"py-2 pe-4 font-medium",children:"Time"}),o.jsx("th",{className:"py-2 pe-4 font-medium",children:"Level"}),o.jsx("th",{className:"py-2 pe-4 font-medium",children:"Event"}),o.jsx("th",{className:"py-2 font-medium",children:"Message"})]})}),o.jsx("tbody",{children:s.map(l=>o.jsxs("tr",{className:"border-b last:border-0 align-top",children:[o.jsx("td",{className:"whitespace-nowrap py-2 pe-4 text-xs text-muted-foreground",children:is(l.createdAt)}),o.jsx("td",{className:`py-2 pe-4 text-xs font-medium ${Jf[l.level]||""}`,children:l.level}),o.jsx("td",{className:"whitespace-nowrap py-2 pe-4 font-mono text-xs",children:l.event}),o.jsx("td",{className:"py-2",children:l.message})]},l.id))})]})}):o.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"No log entries recorded yet."})})]})]})}const Qf="https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/template",eh=e=>e==="CONNECTED"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-600":e==="FAILED"?"border-destructive/30 bg-destructive/10 text-destructive":"border-amber-500/30 bg-amber-500/10 text-amber-700",cs=e=>e?.response?.data?.error||e?.response?.data?.message||e?.message||"Request failed";function th(){const[e,t]=k.useState([]),[s,r]=k.useState(!0),[n,a]=k.useState(!1),[i,c]=k.useState(""),[d,l]=k.useState(!1),[f,u]=k.useState(null),[h,m]=k.useState(null),[p,g]=k.useState(null),b=k.useCallback(async()=>{r(!0),g(null);try{t((await ie.getSources()).sources||[])}catch(w){g(cs(w))}finally{r(!1)}},[]);k.useEffect(()=>{b()},[b]);const x=async w=>{if(w.preventDefault(),!/^\d{12}$/.test(i)){g("AWS account ID must contain exactly 12 digits");return}m("create"),g(null);try{const C=await ie.createSource({managementAccountId:i,regionMode:d?"ALL":"SINGLE"});u(C.connectionId),a(!1),c(""),l(!1),await b()}catch(C){g(cs(C))}finally{m(null)}},y=async w=>{m(`download-${w}`),g(null);try{const C=await ie.downloadSourceTemplate(w),_=URL.createObjectURL(C),R=document.createElement("a");R.href=_,R.download=`meyi-connect-cost-${w}.yaml`,R.click(),URL.revokeObjectURL(_),u(w)}catch(C){g(cs(C))}finally{m(null)}},S=async w=>{m(`verify-${w}`),g(null);try{const C=await ie.verifySource(w);C.status==="FAILED"&&g(C.message||"AWS connection verification failed"),await b()}catch(C){g(cs(C))}finally{m(null)}};return o.jsxs("div",{className:"flex w-full flex-col gap-6 p-2 md:p-6",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold",children:[o.jsx(_s,{className:"h-6 w-6 text-primary"}),"Cost Sources"]}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"AWS accounts connected to this tenant for Cost and Usage Report data."})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{type:"button",onClick:()=>{b()},disabled:s,className:"rounded-md border p-2 hover:bg-muted disabled:opacity-50","aria-label":"Refresh sources",title:"Refresh sources",children:o.jsx(Ke,{className:`h-4 w-4 ${s?"animate-spin":""}`})}),o.jsxs("button",{type:"button",onClick:()=>{g(null),a(!0)},className:"flex items-center gap-2 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground hover:opacity-90",children:[o.jsx(ta,{className:"h-4 w-4"}),"Add AWS account"]})]})]}),p&&o.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:[o.jsx(Ge,{className:"mt-0.5 h-4 w-4 shrink-0"}),p]}),!s&&e.length===0&&o.jsxs("div",{className:"rounded-md border border-dashed py-14 text-center",children:[o.jsx(_s,{className:"mx-auto mb-3 h-8 w-8 text-muted-foreground"}),o.jsx("p",{className:"font-medium",children:"No AWS Cost source"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Add an AWS account to begin collecting tenant cost data."})]}),e.length>0&&o.jsx("div",{className:"overflow-x-auto rounded-md border",children:o.jsxs("table",{className:"w-full min-w-[780px] text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b bg-muted/50 text-left text-xs uppercase text-muted-foreground",children:[o.jsx("th",{className:"px-4 py-3 font-medium",children:"AWS account"}),o.jsx("th",{className:"px-4 py-3 font-medium",children:"Connection"}),o.jsx("th",{className:"px-4 py-3 font-medium",children:"Scope"}),o.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),o.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),o.jsx("tbody",{children:e.map(w=>o.jsxs("tr",{className:`border-b last:border-0 ${f===w.connectionId?"bg-muted/30":""}`,children:[o.jsx("td",{className:"px-4 py-3 font-mono",children:w.managementAccountId||"Pending"}),o.jsx("td",{className:"px-4 py-3 font-mono text-xs",children:w.connectionId}),o.jsxs("td",{className:"px-4 py-3",children:[w.accountScope," / ",w.regionMode]}),o.jsxs("td",{className:"px-4 py-3",children:[o.jsx("span",{className:`rounded-full border px-2 py-1 text-xs font-medium ${eh(w.status)}`,children:w.status.replace(/_/g," ")}),w.stackSetStatus&&o.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:w.stackSetStatus.replace(/_/g," ")})]}),o.jsx("td",{className:"px-4 py-3",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx("button",{type:"button",onClick:()=>{y(w.connectionId)},disabled:!!h,className:"rounded-md border p-2 hover:bg-muted disabled:opacity-50",title:"Download CloudFormation template","aria-label":"Download CloudFormation template",children:h===`download-${w.connectionId}`?o.jsx(gs,{className:"h-4 w-4 animate-spin"}):o.jsx(Qo,{className:"h-4 w-4"})}),o.jsx("a",{href:Qf,target:"_blank",rel:"noreferrer",className:"rounded-md border p-2 hover:bg-muted",title:"Open AWS CloudFormation","aria-label":"Open AWS CloudFormation",children:o.jsx(ea,{className:"h-4 w-4"})}),o.jsxs("button",{type:"button",onClick:()=>{S(w.connectionId)},disabled:!!h||w.status==="CONNECTED",className:"flex items-center gap-2 rounded-md border px-3 py-2 font-medium hover:bg-muted disabled:opacity-50",children:[h===`verify-${w.connectionId}`?o.jsx(gs,{className:"h-4 w-4 animate-spin"}):w.status==="CONNECTED"?o.jsx(Jo,{className:"h-4 w-4 text-emerald-600"}):o.jsx(Ke,{className:"h-4 w-4"}),w.status==="CONNECTED"?"Connected":"Verify"]})]})})]},w.connectionId))})]})}),n&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"add-source-title",children:o.jsxs("form",{onSubmit:w=>{x(w)},className:"w-full max-w-md rounded-md border bg-background p-5 shadow-xl",children:[o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsx("h2",{id:"add-source-title",className:"text-lg font-semibold",children:"Add AWS account"}),o.jsx("button",{type:"button",onClick:()=>a(!1),className:"rounded-md p-1 hover:bg-muted","aria-label":"Close",children:o.jsx(_r,{className:"h-4 w-4"})})]}),o.jsx("label",{className:"mt-5 block text-sm font-medium",htmlFor:"aws-account-id",children:"AWS account ID"}),o.jsx("input",{id:"aws-account-id",value:i,onChange:w=>c(w.target.value.replace(/\D/g,"").slice(0,12)),inputMode:"numeric",autoComplete:"off",placeholder:"123456789012",className:"mt-2 h-10 w-full rounded-md border bg-background px-3 font-mono outline-none focus:ring-2 focus:ring-ring"}),o.jsxs("label",{className:"mt-4 flex items-start gap-3 rounded-md border p-3",children:[o.jsx("input",{type:"checkbox",checked:d,onChange:w=>l(w.target.checked),className:"mt-1 h-4 w-4"}),o.jsxs("span",{children:[o.jsx("span",{className:"block text-sm font-medium",children:"All enabled AWS regions"}),o.jsx("span",{className:"block text-xs text-muted-foreground",children:"Use organization-wide StackSet deployment across enabled regions."})]})]}),o.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[o.jsx("button",{type:"button",onClick:()=>a(!1),className:"rounded-md border px-4 py-2 text-sm font-medium hover:bg-muted",children:"Cancel"}),o.jsxs("button",{type:"submit",disabled:h==="create"||i.length!==12,className:"flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",children:[h==="create"&&o.jsx(gs,{className:"h-4 w-4 animate-spin"}),"Create source"]})]})]})})]})}const sh={high:{icon:yu,className:"border-destructive/40 bg-destructive/5 text-destructive"},medium:{icon:_u,className:"border-amber-500/40 bg-amber-500/5 text-amber-700 dark:text-amber-300"},low:{icon:su,className:"border-sky-500/40 bg-sky-500/5 text-sky-700 dark:text-sky-300"}};function rh({value:e}){if(e==null)return o.jsx("span",{className:"text-muted-foreground",children:"No comparable baseline"});const t=e>0?Ed:e<0?_d:uu;return o.jsxs("span",{className:`inline-flex items-center gap-1 font-semibold ${e>0?"text-destructive":e<0?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground"}`,children:[o.jsx(t,{className:"h-4 w-4"}),Math.abs(e).toLocaleString(void 0,{maximumFractionDigits:1}),"%"]})}function nh({item:e,currency:t}){const s=sh[e.severity],r=s.icon;return o.jsxs(te,{className:`h-full border-l-4 ${s.className}`,children:[o.jsx(de,{className:"pb-2",children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(r,{className:"mt-0.5 h-4 w-4 shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsxs("p",{className:"text-xs font-semibold uppercase text-current",children:[e.severity," priority"]}),o.jsx(ye,{className:"mt-1 break-words text-sm text-foreground",children:e.title})]})]})}),o.jsxs(se,{className:"space-y-3 text-sm text-foreground",children:[o.jsx("p",{children:e.explanation}),o.jsxs("p",{className:"border-t pt-3 text-xs text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"Evidence:"})," ",e.evidence]}),e.estimatedImpact!=null&&o.jsxs("p",{className:"text-xs font-medium text-foreground",children:["Estimated impact: ",W(e.estimatedImpact,t)]})]})]})}const oh=!1;function ah({analysis:e}){const{facts:t}=e,s=t.serviceChanges[0];return o.jsxs("div",{className:"space-y-6",children:[o.jsxs(te,{className:"min-w-0",children:[o.jsx(de,{className:"border-b",children:o.jsxs("div",{className:"flex min-w-0 flex-col items-start justify-between gap-3 sm:flex-row sm:items-center",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx(ye,{className:"text-base",children:"Executive summary"}),o.jsxs("p",{className:"mt-1 break-words text-xs text-muted-foreground",children:["Generated ",new Date(e.generatedAt).toLocaleString()," from AWS CUR",e.cached?" - cached result":""]})]}),o.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(Jo,{className:"h-4 w-4 text-emerald-600"}),"Analysis complete"]})]})}),o.jsx(se,{className:"py-5",children:o.jsx("p",{className:"max-w-5xl break-words text-sm leading-6 text-foreground",children:e.summary})})]}),o.jsxs("section",{"aria-label":"Cost analysis facts",className:"grid overflow-hidden rounded-lg border bg-card sm:grid-cols-2 lg:grid-cols-4",children:[o.jsxs("div",{className:"border-b p-4 sm:border-r lg:border-b-0",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:"Period spend"}),o.jsx("p",{className:"mt-1 text-lg font-semibold",children:W(t.currentTotal,t.currency)})]}),o.jsxs("div",{className:"border-b p-4 lg:border-b-0 lg:border-r",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:"Previous period"}),o.jsx("p",{className:"mt-1 text-lg font-semibold",children:W(t.previousTotal,t.currency)})]}),o.jsxs("div",{className:"border-b p-4 sm:border-b-0 sm:border-r",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:"Period change"}),o.jsx("p",{className:"mt-1 text-sm",children:o.jsx(rh,{value:t.changePercentage})})]}),o.jsxs("div",{className:"p-4",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:"Largest service movement"}),o.jsx("p",{className:"mt-1 truncate text-sm font-semibold",title:s?.label,children:s?.label||"No service data"}),s&&o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[W(Math.abs(s.change),t.currency)," ",s.change>=0?"increase":"decrease"]})]})]}),o.jsxs("section",{className:"min-w-0",children:[o.jsxs("div",{className:"mb-3",children:[o.jsx("h2",{className:"text-base font-semibold",children:"Key findings"}),o.jsx("p",{className:"break-words text-sm text-muted-foreground",children:"Evidence-backed observations from the selected period and its preceding comparison window"})]}),o.jsx("div",{className:"grid min-w-0 gap-4 lg:grid-cols-2",children:e.findings.map((r,n)=>o.jsx(nh,{item:r,currency:t.currency},`${r.title}-${n}`))})]}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-3",children:[o.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold",children:[o.jsx(nu,{className:"h-4 w-4 text-amber-600"}),"Recommended actions"]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Review these actions before making any AWS configuration change"})]}),o.jsx("div",{className:"divide-y rounded-lg border bg-card",children:e.recommendations.map((r,n)=>o.jsxs("div",{className:"grid gap-3 p-4 md:grid-cols-[2rem_minmax(0,1fr)]",children:[o.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full border bg-muted text-xs font-semibold",children:r.priority}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold",children:r.title}),o.jsx("p",{className:"mt-1 text-sm",children:r.action}),o.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:r.rationale})]})]},`${r.title}-${n}`))})]}),oh,o.jsx("p",{className:"text-xs text-muted-foreground",children:"AI recommendations are advisory. Meyi Connect does not automatically modify AWS resources."})]})}function gt(e){return e.toISOString().slice(0,10)}function ih(e,t=new Date){const s=t.getUTCFullYear(),r=t.getUTCMonth();if(e==="last_month"){const n=new Date(Date.UTC(s,r-1,1)),a=new Date(Date.UTC(s,r,0));return{start:gt(n),end:gt(a)}}return e==="last_3_months"?{start:gt(new Date(Date.UTC(s,r-2,1))),end:gt(t)}:{start:gt(new Date(Date.UTC(s,r,1))),end:gt(t)}}function ch(){const[e,t]=k.useState(null),[s,r]=k.useState(null),[n,a]=k.useState(null),[i,c]=k.useState("current_month"),[d,l]=k.useState(!0),[f,u]=k.useState(!1),[h,m]=k.useState(null),p=k.useRef(!0),g=k.useMemo(()=>ih(i),[i]);return k.useEffect(()=>(p.current=!0,Promise.all([ie.getAnalysisStatus(),ie.getDataStatus()]).then(async([x,y])=>{p.current&&(t(x),r(y),y.ready&&a(await ie.getLatestAnalysis()))}).catch(x=>{p.current&&m(x?.response?.data?.error||x?.message||"Unable to load AI analysis status")}).finally(()=>{p.current&&l(!1)}),()=>{p.current=!1}),[]),{status:e,dataStatus:s,analysis:n,rangeKey:i,setRangeKey:c,range:g,initialLoading:d,generating:f,error:h,generate:async(x=!1)=>{u(!0),m(null);try{const y=await ie.generateAnalysis({...g,force:x});p.current&&a(y)}catch(y){p.current&&m(y?.response?.data?.error||y?.message||"AI cost analysis failed")}finally{p.current&&u(!1)}}}}const lh=[{value:"current_month",label:"Current month"},{value:"last_month",label:"Last full month"},{value:"last_3_months",label:"Last 3 months"}];function dh(){const e=ch();return o.jsxs("div",{className:"flex min-w-0 max-w-full flex-col gap-6 overflow-x-hidden p-2 md:p-6",children:[o.jsxs("header",{className:"flex min-w-0 flex-col items-start justify-between gap-4 lg:flex-row",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold",children:[o.jsx(ss,{className:"h-6 w-6 shrink-0 text-primary"}),"AI Cost Analysis"]}),o.jsx("p",{className:"mt-1 break-words text-sm text-muted-foreground",children:"Explain cost movement, surface material drivers, and prioritize investigation"})]}),e.status?.enabled&&o.jsxs("div",{className:"flex w-full min-w-0 flex-wrap items-center justify-end gap-2 sm:w-auto",children:[o.jsxs("label",{className:"relative w-[200px] max-w-full shrink-0",children:[o.jsx("span",{className:"sr-only",children:"Analysis period"}),o.jsx(Od,{className:"pointer-events-none absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx("select",{value:e.rangeKey,onChange:t=>e.setRangeKey(t.target.value),disabled:e.generating,className:"w-full min-w-0 rounded-lg border bg-background py-2 pl-9 pr-8 text-sm shadow-sm disabled:opacity-50",children:lh.map(t=>o.jsx("option",{value:t.value,children:t.label},t.value))})]}),o.jsxs("button",{type:"button",onClick:()=>{e.generate(!!e.analysis)},disabled:e.generating,className:"inline-flex min-h-10 w-[150px] max-w-full shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm hover:bg-primary/90 disabled:opacity-50",children:[e.generating?o.jsx(Ke,{className:"h-4 w-4 animate-spin"}):o.jsx(ss,{className:"h-4 w-4"}),e.generating?"Analyzing":e.analysis?"Regenerate":"Generate analysis"]})]})]}),e.error&&e.dataStatus?.ready&&o.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",children:[o.jsx(Ge,{className:"mt-0.5 h-4 w-4 shrink-0"}),o.jsx("span",{children:e.error})]}),e.initialLoading?o.jsxs("div",{"aria-busy":"true",className:"space-y-4",children:[o.jsx("div",{className:"h-28 animate-pulse rounded-lg bg-muted"}),o.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[o.jsx("div",{className:"h-44 animate-pulse rounded-lg bg-muted"}),o.jsx("div",{className:"h-44 animate-pulse rounded-lg bg-muted"})]})]}):e.dataStatus&&!e.dataStatus.ready?o.jsx(Nt,{status:e.dataStatus}):e.error&&!e.dataStatus?o.jsx(Nt,{error:e.error}):e.status&&!e.status.enabled?o.jsx(te,{children:o.jsxs(se,{className:"flex min-h-64 flex-col items-center justify-center px-6 text-center",children:[o.jsx(ss,{className:"h-8 w-8 text-muted-foreground"}),o.jsx("h2",{className:"mt-4 text-base font-semibold",children:"AI cost analysis is not enabled"}),o.jsx("p",{className:"mt-2 max-w-xl text-sm text-muted-foreground",children:"Cost overview, CUR, reports, and budgets remain available. An administrator must enable the Cost AI deployment setting before analysis can run."})]})}):e.generating&&!e.analysis?o.jsx(te,{children:o.jsxs(se,{className:"flex min-h-64 flex-col items-center justify-center text-center",children:[o.jsx(Ke,{className:"h-7 w-7 animate-spin text-primary"}),o.jsx("h2",{className:"mt-4 text-sm font-semibold",children:"Analyzing tenant cost data"}),o.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Comparing the selected period and preparing evidence-backed findings"})]})}):e.analysis?o.jsx(ah,{analysis:e.analysis}):o.jsx(te,{children:o.jsxs(se,{className:"flex min-h-64 flex-col items-center justify-center px-6 text-center",children:[o.jsx(ss,{className:"h-8 w-8 text-primary"}),o.jsx("h2",{className:"mt-4 text-base font-semibold",children:"No analysis has been generated"}),o.jsx("p",{className:"mt-2 max-w-lg text-sm text-muted-foreground",children:"Choose a period and generate an analysis to review cost changes, significant drivers, and recommended investigation steps."})]})})]})}const ht=ac({component:wo}),uh=Ct({getParentRoute:()=>ht,path:"/",component:Tf}),fh=Ct({getParentRoute:()=>ht,path:"/reports",component:Wf}),hh=Ct({getParentRoute:()=>ht,path:"/budgets",component:Yf}),mh=Ct({getParentRoute:()=>ht,path:"/cur-discovery",component:Zf}),ph=Ct({getParentRoute:()=>ht,path:"/analysis",component:dh}),gh=Ct({getParentRoute:()=>ht,path:"/sources",component:th});function Pr(){return ht.addChildren([uh,ph,fh,hh,gh,mh])}function xh(e="/cost"){return So({routeTree:Pr(),basepath:e})}function bh({apiBase:e,token:t,basePath:s="/cost",userRole:r="admin"}){Ko(e,t);const n=k.useMemo(()=>So({routeTree:Pr(),basepath:s}),[s]);return o.jsx(wc,{router:n})}const yh=[{title:"Overview",url:"/",icon:"DollarSign",roles:["admin","user"]},{title:"AI Analysis",url:"/analysis",icon:"Sparkles",roles:["admin","user"]},{title:"Reports",url:"/reports",icon:"FileText",roles:["admin","user"]},{title:"Budgets",url:"/budgets",icon:"Wallet",roles:["admin"]},{title:"Sources",url:"/sources",icon:"CloudCog",roles:["admin"]},{title:"CUR Discovery",url:"/cur-discovery",icon:"Search",roles:["admin"]}];exports.CostPage=bh;exports.api=oe;exports.attachAuthInterceptors=vd;exports.configureApi=Ko;exports.costNavItems=yh;exports.createCostRouter=xh;exports.createRouteTree=Pr;